/* =====================================================================
   Mofelle  スタイル
   スマホ優先。端末設定にかかわらず明るい配色を使う。
   ===================================================================== */

:root {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --surface-2: #f8fafc;
  --line:      #e2e8f0;
  --text:      #0f172a;
  --text-2:    #64748b;
  --navy:      #0f172a;
  --navy-2:    #2563eb;
  --accent:    #2563eb;
  --accent-2:  #3b82f6;
  --ok:        #059669;
  --warn:      #e11d48;
  --radius:    14px;
  --nav-h:     64px;
  --shadow:    0 1px 2px rgba(15, 23, 42, .05), 0 4px 12px -2px rgba(15, 23, 42, .08);
}



* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Yu Gothic", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
}

.hidden { display: none !important; }
.muted  { color: var(--text-2); font-size:14px; }

/* ---------- ログイン ---------- */
.login {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background: linear-gradient(160deg, var(--navy), var(--navy-2));
}
.login-box {
  width: 100%;
  max-width: 380px;
  background: var(--surface);
  border-radius: 18px;
  padding: 28px 24px 24px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
}
.brand {
  font-weight: 700;
  letter-spacing: .28em;
  font-size:14px;
  color: var(--accent);
}
.login-box h1 { margin: 4px 0 12px; font-size: 22px; }
.login-box input[type=email] {
  width: 100%;
  margin: 16px 0 10px;
  padding: 13px 14px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}
.otp-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.otp-form label { display: block; margin-bottom: 6px; color: var(--text-2); font-size:14px; font-weight: 700; }
.otp-form input {
  width: 100%;
  margin: 0 0 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--bg);
  color: var(--text);
  font-size: 24px;
  font-weight: 750;
  letter-spacing: .22em;
  text-align: center;
}
.otp-form .muted { margin: 8px 0 0; text-align: center; }
.owner-dev-login { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.owner-dev-login summary { color: #5f6f85; font-size:14px; font-weight: 800; letter-spacing: .08em; text-align: center; cursor: pointer; }
.owner-dev-login form { margin-top: 13px; }
.owner-dev-login label { display: block; margin-bottom: 6px; color: #5f6f85; font-size:14px; font-weight: 700; }
.owner-dev-login input[type=password] { width: 100%; margin: 0 0 10px; padding: 13px 14px; border: 1px solid #d5dce6; border-radius: 10px; background: #f8fafc; color: #10213a; font-size: 16px; }
.owner-dev-login .muted { margin: 8px 0 0; text-align: center; font-size:14px; }
.owner-login-btn { background: linear-gradient(135deg, #0a1d35, #102c50); color: #fff; border: 1px solid #29486d; letter-spacing: .05em; }
.login-msg { margin: 12px 0 0; font-size:14px; min-height: 20px; }
.login-msg strong { font-size: 14px; }
.login-msg small { opacity: .8; }
.login-msg.ok  { color: var(--ok); }
.login-msg.err { color: var(--warn); }

/* ---------- ヘッダー ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  background: var(--surface);
  color: var(--text);
  border-bottom: 1px solid var(--line);
}
.topbar-title { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.topbar-title strong { font-size: 17px; }
.role-badge { display:inline-flex; align-items:center; min-height:24px; padding:3px 8px; border:1px solid currentColor; border-radius:999px; font-size:14px; font-weight:850; line-height:1; white-space:nowrap; }
.role-badge.owner { background:color-mix(in srgb,var(--gold) 12%,var(--surface)); color:var(--gold); }
.role-badge.secretary { background:color-mix(in srgb,var(--accent) 10%,var(--surface)); color:var(--accent); }
.brand-sm { font-size:14px; letter-spacing: .22em; color: var(--accent); font-weight: 800; }
.topbar-actions { display: flex; gap: 2px; }
.icon-btn {
  background: none;
  border: 0;
  color: inherit;
  width: 44px;
  height: 44px;
  padding: 11px;
  border-radius: 50%;
  cursor: pointer;
}
.icon-btn svg, .search-wrap svg, .bottom-nav svg, .inline-icon { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.icon-btn:active { background: var(--surface-2); }

/* ---------- 検索 ---------- */
.search-bar { padding: 10px 14px 0; }
.search-wrap { position: relative; }
.search-wrap > svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 17px; height: 17px; color: var(--text-2); pointer-events: none; }
.search-bar input {
  width: 100%;
  padding: 10px 13px 10px 38px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

/* ---------- 本体 ---------- */
main {
  padding: 12px 14px calc(var(--nav-h) + 36px + env(safe-area-inset-bottom));
  max-width: 760px;
  margin: 0 auto;
}

.section-label {
  font-size:14px;
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: .06em;
  margin: 18px 2px 8px;
}
.section-label:first-child { margin-top: 4px; }

.empty {
  text-align: center;
  color: var(--text-2);
  padding: 48px 20px;
  font-size: 14px;
}
.empty .big { font-size: 34px; display: block; margin-bottom: 10px; }
.empty-icon { width: 36px; height: 36px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- カード共通 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 10px;
  overflow: hidden;
  cursor: pointer;
}
.card:active { transform: scale(.995); }
.card-row { display: flex; gap: 12px; padding: 12px; align-items: flex-start; }
.card-row .thumb {
  width: 82px;
  height: 50px;
  flex: 0 0 82px;
  object-fit: cover;
  border-radius: 7px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.card-main { min-width: 0; flex: 1; }
.card-main .t1 { font-weight: 600; font-size: 15px; overflow-wrap: anywhere; }
.card-main .t2 { font-size:14px; color: var(--text-2); overflow-wrap: anywhere; }
.card-main .t3 { font-size:14px; color: var(--text-2); margin-top: 3px; }

/* ---------- バッジ ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size:14px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  white-space: nowrap;
  vertical-align: 2px;
}
.pill .inline-icon { width: 12px; height: 12px; margin: 0; }
.pill.inbox     { background: #fdf0d9; color: #8a5a08; }
.pill.done      { background: #e2f0e8; color: var(--ok); }
.pill.todo      { background: #fde5de; color: #a3361a; }
.pill.doing     { background: #dce8fb; color: #1f4b95; }
.pill.high      { background: #fbdcdc; color: #9d2222; }
.pill.submitted { background: #fdf0d9; color: #8a5a08; }
.pill.checking  { background: #dce8fb; color: #1f4b95; }
.pill.settled   { background: #e2f0e8; color: var(--ok); }


.badge {
  position: absolute;
  top: 4px;
  right: 50%;
  transform: translateX(20px);
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--warn);
  color: #fff;
  font-size:14px;
  font-style: normal;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* ---------- ボタン ---------- */
.btn {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  border-radius: 8px;
  min-height: 44px;
  padding: 10px 14px;
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
}
.btn:active { opacity: .75; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
.btn.accent  { background: var(--ok); border-color: var(--ok); color: #fff; font-weight: 700; }
.btn.ghost   { background: transparent; }
.btn.danger  { color: var(--warn); border-color: var(--warn); }
.btn.block   { display: block; width: 100%; padding: 13px; font-size: 15px; }
.btn.sm      { padding: 6px 11px; font-size:14px; }
.btn-row     { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.btn-row .btn { flex: 1 1 auto; }

/* ---------- 下部ナビ ---------- */
.bottom-nav-shell {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  pointer-events: none;
}
.bottom-nav {
  pointer-events: auto;
  display: flex;
  align-items: center;
  height: calc(var(--nav-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(15, 23, 42, .08);
}
.bottom-nav .nav-tab {
  position: relative;
  flex: 1;
  min-width: 0;
  min-height: 52px;
  border: 0;
  background: none;
  color: var(--text-2);
  font-size:14px;
  font-weight: 600;
  font-family: inherit;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
}
.bottom-nav .nav-tab svg { width: 22px; height: 22px; }
.bottom-nav .nav-tab.active { color: var(--accent); font-weight: 700; }
.nav-center { flex: 1; min-width: 0; height: 100%; position: relative; display: flex; justify-content: center; align-items: flex-end; padding-bottom: 5px; color: var(--accent); font-size:14px; font-weight: 700; }
.nav-camera-btn { position: absolute; top: -24px; width: 58px; height: 58px; border-radius: 50%; border: 4px solid var(--surface); background: linear-gradient(135deg, var(--accent-2), var(--accent)); color: #fff; box-shadow: 0 10px 25px -3px rgba(37,99,235,.38); padding: 13px; cursor: pointer; }
.nav-camera-btn svg { width: 100%; height: 100%; }
.nav-camera-btn:active { transform: scale(.93); }

.list-action { display: flex; justify-content: flex-end; margin: 2px 0 10px; }
.list-action .btn { min-height: 40px; padding: 7px 12px; }
.inline-icon { width: 16px; height: 16px; vertical-align: -3px; margin-right: 4px; }

/* ---------- モーダル ---------- */
.modal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(10, 14, 22, .55);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.modal-sheet {
  width: 100%;
  max-width: 440px;
  max-height: 94dvh;
  background: var(--bg);
  border-radius: 18px 18px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideup .2s ease-out;
}
@keyframes slideup { from { transform: translateY(24px); opacity: .4; } }
.modal-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  border-radius: 18px 18px 0 0;
}
.modal-body {
  min-height: 0;
  flex: 1;
  overflow-y: auto;
  padding: 16px 16px 24px;
  -webkit-overflow-scrolling: touch;
}
.modal-foot { flex:0 0 auto; padding:10px 16px max(10px,env(safe-area-inset-bottom)); border-top:1px solid var(--line); background:color-mix(in srgb,var(--surface) 94%,transparent); box-shadow:0 -8px 22px rgba(2,8,23,.08); }
.modal-close-btn { display:flex; align-items:center; justify-content:center; gap:7px; width:100%; min-height:50px; padding:10px 16px; border:1px solid var(--line); border-radius:13px; background:var(--surface-2); color:var(--text); font:inherit; font-size:15px; font-weight:800; cursor:pointer; }
.modal-close-btn svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.modal-close-btn:active { transform:scale(.985); background:color-mix(in srgb,var(--accent) 8%,var(--surface)); }

/* ---------- フォーム ---------- */
.field { margin-bottom: 12px; }
.field > label {
  display: block;
  font-size:14px;
  font-weight: 600;
  color: var(--text-2);
  margin-bottom: 4px;
}
.field input, .field textarea, .field select {
  width: 100%;
  padding: 10px 12px;
  font-size: 16px;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
}
.field textarea { min-height: 92px; resize: vertical; line-height: 1.6; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }

.box {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 14px;
}
.box > h3 { margin: 0 0 10px; font-size: 14px; }
.box.tip { background: var(--surface-2); border-style: dashed; }

.developer-build-box {
  margin: 16px 0 4px;
  padding: 16px;
  border: 1px solid rgba(200,156,53,.42);
  border-radius: 17px;
  background: linear-gradient(145deg, #071b34, #0c3159);
  color: #f8fafc;
  box-shadow: 0 14px 32px rgba(4,18,36,.2);
}
.developer-build-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.developer-build-head span { color:#d8b454; font-size:14px; font-weight:850; letter-spacing:.18em; }
.developer-build-head strong { color:#fff; font-size:22px; letter-spacing:.04em; }
.developer-build-meta { display:grid; grid-template-columns:70px 1fr; gap:5px 10px; margin:0; padding:12px; border-radius:12px; background:rgba(255,255,255,.07); }
.developer-build-meta dt { color:#9fb0c6; font-size:14px; }
.developer-build-meta dd { margin:0; color:#f8fafc; font-size:14px; font-weight:650; overflow-wrap:anywhere; }
.developer-build-box h3 { margin:16px 0 8px; color:#d8b454; font-size:14px; letter-spacing:.06em; }
.developer-build-box ul { margin:0; padding-left:19px; }
.developer-build-box li { margin:7px 0; color:#e7edf5; font-size:14px; line-height:1.55; }
.developer-build-box p { margin:13px 0 0; color:#8fa2ba; font-size:14px; line-height:1.5; }

.capture-done {
  margin-top: 14px;
  border-color: color-mix(in srgb, var(--ok) 45%, var(--line));
  background: color-mix(in srgb, var(--ok) 8%, var(--surface));
}
.capture-done strong { display: inline-flex; align-items: center; color: var(--ok); font-size: 16px; }
.capture-done strong .inline-icon { width: 19px; height: 19px; }
.capture-done p { margin: 4px 0 0; }
.card-tools {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 14px;
  overflow: hidden;
}
.card-tools > summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 42px 14px 14px;
  font-weight: 700;
  position: relative;
}
.card-tools > summary::-webkit-details-marker { display: none; }
.card-tools > summary::after {
  content: '開く';
  position: absolute;
  right: 14px;
  color: var(--text-2);
  font-size:14px;
}
.card-tools[open] > summary::after { content: '閉じる'; }
.card-tools-body { padding: 0 14px 14px; }
.card-tools-body .box { margin: 0; }

.detail-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--surface-2);
  display: block;
  cursor: zoom-in;
}

.owner-name { font-size: 18px; font-weight: 750; margin-bottom: 2px; }
.contact-link { display: flex; align-items: center; gap: 7px; min-height: 44px; color: var(--accent); text-decoration: none; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 7px; overflow-wrap: anywhere; }
.contact-link .inline-icon { flex: 0 0 18px; width: 18px; height: 18px; margin: 0; }
.secretary-ai { border-color: color-mix(in srgb, var(--accent) 26%, var(--line)); background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.secretary-ai h3 { color: var(--accent); }

.capture-complete { text-align: center; padding: 6px 0; }
.capture-complete h2 { margin: 8px 0 4px; font-size: 20px; }
.capture-complete > p { margin: 0 auto 16px; max-width: 330px; }
.success-mark { width: 66px; height: 66px; border-radius: 50%; display: inline-grid; place-items: center; background: color-mix(in srgb, var(--ok) 12%, var(--surface)); color: var(--ok); }
.success-icon { width: 38px; height: 38px; fill: none; stroke: currentColor; stroke-width: 2.3; stroke-linecap: round; stroke-linejoin: round; }
.capture-thumb { display: flex; align-items: center; gap: 12px; text-align: left; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; margin-bottom: 16px; font-size:14px; font-weight: 700; }
.capture-thumb img { width: 78px; height: 48px; object-fit: cover; border: 1px solid var(--line); border-radius: 8px; }
.capture-complete > .btn + .btn { margin-top: 8px; }
.capture-spinner { margin: 26px auto 20px; width: 44px; height: 44px; }
.processing-thumb { display: block; width: min(260px, 82%); aspect-ratio: 1.586 / 1; object-fit: cover; margin: 20px auto 4px; border-radius: 12px; box-shadow: 0 10px 28px rgba(15, 23, 42, .18); }
.capture-card-data { margin: 16px 0; padding: 4px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); text-align: left; }
.card-data-grid { margin: 0; }
.card-data-grid > div { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 10px; padding: 11px 0; border-bottom: 1px solid var(--line); }
.card-data-grid > div:last-child { border-bottom: 0; }
.card-data-grid dt { color: var(--muted); font-size:14px; font-weight: 700; }
.card-data-grid dd { min-width: 0; margin: 0; color: var(--text); font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.card-data-grid a { color: var(--accent); text-decoration: none; }
.card-data-empty { padding: 18px 0; color: var(--muted); text-align: center; }

/* ---------- 名刺専用カメラ ---------- */
.card-camera {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  background: #060912;
  color: #fff;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.camera-head { min-height: 58px; display: grid; grid-template-columns: 92px 1fr 92px; align-items: center; padding: 0 12px; background: rgba(6,9,18,.94); }
.camera-head strong { text-align: center; font-size: 16px; }
.camera-text-btn, .camera-sub, .camera-done { min-height: 44px; border: 0; border-radius: 8px; font: inherit; font-weight: 700; cursor: pointer; }
.camera-text-btn { background: none; color: #dbeafe; text-align: left; padding: 0 4px; }
.camera-stage { position: relative; min-height: 0; overflow: hidden; background: #02040a; }
.camera-stage video { width: 100%; height: 100%; display: block; object-fit: cover; }
.card-guide {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(88vw, 440px);
  aspect-ratio: 85.6 / 54;
  transform: translate(-50%, -50%);
  border: 3px solid rgba(255,255,255,.92);
  border-radius: 13px;
  box-shadow: 0 0 0 999px rgba(0,0,0,.38), inset 0 0 0 1px rgba(37,99,235,.8);
  pointer-events: none;
}
.card-guide::before, .card-guide::after { content: ''; position: absolute; inset: -4px; border-radius: 15px; }
.card-guide::before { border-left: 9px solid #3b82f6; border-right: 9px solid #3b82f6; clip-path: polygon(0 0,100% 0,100% 18px,calc(100% - 9px) 18px,calc(100% - 9px) 9px,9px 9px,9px 18px,0 18px,0 calc(100% - 18px),9px calc(100% - 18px),9px calc(100% - 9px),calc(100% - 9px) calc(100% - 9px),calc(100% - 9px) calc(100% - 18px),100% calc(100% - 18px),100% 100%,0 100%); }
.card-guide span { position: absolute; left: 50%; bottom: -42px; transform: translateX(-50%); width: max-content; max-width: 88vw; padding: 6px 11px; border-radius: 999px; background: rgba(6,9,18,.78); font-size:14px; font-weight: 700; text-align: center; }
.camera-preview { position: absolute; inset: 0; display: grid; place-items: center; padding: 24px; background: #060912; }
.camera-preview img { width: min(92vw, 520px); max-height: 72vh; object-fit: contain; border-radius: 12px; box-shadow: 0 12px 36px rgba(0,0,0,.45); }
.camera-preview .pair-preview { display: grid; gap: 14px; width: min(92vw, 520px); }
.camera-preview figure { margin: 0; }
.camera-preview figcaption { margin: 0 0 5px; color: #cbd5e1; font-size:14px; font-weight: 700; }
.camera-preview .pair-preview img { width: 100%; max-height: 31vh; }
.camera-help { min-height: 56px; display: grid; place-items: center; padding: 8px 20px; color: #cbd5e1; font-size:14px; text-align: center; background: #0b101b; }
.camera-actions { min-height: 92px; display: flex; align-items: center; justify-content: center; gap: 14px; padding: 12px 16px; background: #0b101b; }
.camera-shutter { width: 68px; height: 68px; flex: 0 0 68px; border: 4px solid #fff; border-radius: 50%; background: transparent; padding: 5px; cursor: pointer; }
.camera-shutter span { display: block; width: 100%; height: 100%; border-radius: 50%; background: #fff; }
.camera-shutter:active span { transform: scale(.9); }
.camera-sub { min-width: 0; flex: 1; max-width: 150px; padding: 9px 8px; background: #1e293b; color: #fff; }
.camera-done { min-width: 0; flex: 1.2; max-width: 180px; padding: 10px 8px; background: #2563eb; color: #fff; }

/* 横持ちでは操作部を左右へ逃がし、名刺枠の高さを最大限確保する。 */
@media (orientation: landscape) and (max-height: 600px) {
  .card-camera {
    grid-template-columns: minmax(104px, 17vw) minmax(0, 1fr) minmax(164px, 24vw);
    grid-template-rows: minmax(0, 1fr) auto;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  }
  .camera-head {
    grid-column: 1; grid-row: 1 / 3; min-height: 0; padding: 10px 8px;
    display: flex; flex-direction: column; align-items: stretch; justify-content: space-between;
  }
  .camera-head strong { font-size: 14px; }
  .camera-text-btn { text-align: center; }
  .camera-stage { grid-column: 2; grid-row: 1 / 3; }
  .card-guide { width: min(94%, calc(88vh * 1.585)); }
  .card-guide span { bottom: 8px; max-width: 90%; white-space: normal; font-size:14px; }
  .camera-help { grid-column: 3; grid-row: 1; min-height: 0; padding: 12px; align-content: center; font-size:14px; }
  .camera-actions { grid-column: 3; grid-row: 2; min-height: 0; flex-direction: column; gap: 8px; padding: 10px; }
  .camera-shutter { width: 58px; height: 58px; flex-basis: 58px; }
  .camera-sub,.camera-done { width: 100%; max-width: none; min-height: 40px; }
  .camera-preview { padding: 12px; }
  .camera-preview img { width: 94%; max-height: 94vh; }
  .camera-preview .pair-preview { grid-template-columns: repeat(2,minmax(0,1fr)); width: 96%; }
  .camera-preview .pair-preview img { max-height: 78vh; }
}
.detail-side { margin: 8px 0 14px; }
.detail-side-label { display: inline-block; margin: 0 0 5px; padding: 2px 8px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size:14px; font-weight: 700; }
.capture-thumbs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: 16px; }
.capture-thumbs figure { margin: 0; padding: 8px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2); }
.capture-thumbs img { width: 100%; aspect-ratio: 85.6 / 54; object-fit: cover; border-radius: 7px; }
.capture-thumbs figcaption { color: var(--text-2); font-size:14px; font-weight: 700; }

@media (max-width: 390px) {
  .grid2 { grid-template-columns: 1fr; gap: 0; }
  .modal-body { padding-left: 14px; padding-right: 14px; }
}

/* ---------- コメント（依頼のやり取り） ---------- */
.thread { display: flex; flex-direction: column; gap: 8px; margin: 10px 0; }
.bubble {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 9px 12px;
  font-size: 14px;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  max-width: 88%;
}
.bubble.mine { align-self: flex-end; background: var(--navy-2); border-color: var(--navy-2); color: #fff; }
.bubble .who { display: block; font-size:14px; opacity: .7; margin-bottom: 2px; }

.kv { display: grid; grid-template-columns: 84px 1fr; gap: 4px 10px; font-size: 14px; }
.kv dt { color: var(--text-2); font-size:14px; padding-top: 2px; }
.kv dd { margin: 0; overflow-wrap: anywhere; }
.kv a { color: var(--navy-2); }


/* ---------- 拡大表示・トースト ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(0, 0, 0, .9);
  display: grid;
  place-items: center;
  padding: 12px;
  cursor: zoom-out;
}
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--nav-h) + 26px);
  transform: translateX(-50%);
  z-index: 90;
  background: #1a1d24;
  color: #fff;
  padding: 11px 18px;
  border-radius: 999px;
  font-size:14px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .3);
  max-width: 88vw;
  text-align: center;
}

.uploading { display: flex; align-items: center; gap: 8px; color: var(--text-2); font-size:14px; padding: 10px 2px; }
.spinner {
  width: 15px;
  height: 15px;
  border: 2px solid var(--line);
  border-top-color: var(--navy-2);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* MOFELLE — premium brand layer */
:root {
  --bg:#f3f5f8; --surface:#fff; --surface-2:#f7f8fa; --line:#dde3eb;
  --text:#10213a; --text-2:#68758a; --navy:#061a33; --navy-2:#0b2a51;
  --accent:#0a3565; --accent-2:#14518e; --gold:#c89c35; --gold-2:#e0bd62;
  --radius:16px; --shadow:0 1px 2px rgba(6,26,51,.04),0 12px 32px rgba(6,26,51,.07);
}

html,body { letter-spacing:.01em; }
body { background-image:radial-gradient(circle at 100% 0,rgba(200,156,53,.055),transparent 32rem); }
.login { position:relative; overflow:hidden; padding:max(28px,env(safe-area-inset-top)) 20px max(28px,env(safe-area-inset-bottom)); background:radial-gradient(circle at 82% 16%,rgba(38,87,139,.72),transparent 34%),radial-gradient(circle at 10% 90%,rgba(200,156,53,.15),transparent 30%),linear-gradient(145deg,#031125 0%,#071d39 58%,#0c315c 100%); }
.login::before { content:''; position:absolute; inset:0; opacity:.18; background-image:linear-gradient(rgba(255,255,255,.035) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.035) 1px,transparent 1px); background-size:32px 32px; mask-image:linear-gradient(to bottom,#000,transparent 70%); }
.login-box { position:relative; max-width:408px; padding:34px 28px 24px; border:1px solid rgba(255,255,255,.55); border-radius:24px; background:rgba(255,255,255,.97); box-shadow:0 32px 80px rgba(0,0,0,.35),inset 0 1px 0 #fff; }
.login-brand { width:210px; height:72px; margin:0 auto 18px; overflow:hidden; position:relative; }
.login-brand img { display:block; width:100%; transform:translateY(-43%); }
.login-brand span { position:absolute; right:3px; bottom:0; color:#997220; font-size:14px; font-weight:800; letter-spacing:.3em; }
.login-box h1 { margin:0 0 8px; color:#0a213e; font-family:Georgia,"Yu Mincho",serif; font-size:clamp(22px,6vw,27px); font-weight:600; letter-spacing:.02em; text-align:center; }
.login-lead { margin:0 auto 20px; color:#5f6d82; font-size:14px; text-align:center; }
.login-box>.muted { margin:0; color:#68758a; text-align:center; }
.login-box input[type=email],.otp-form input { border:1px solid #d5dce6; background:#f8fafc; color:#10213a; box-shadow:inset 0 1px 2px rgba(6,26,51,.04); }
.login-box input:focus { outline:none; border-color:#b99235; box-shadow:0 0 0 3px rgba(200,156,53,.14); }
.login-foot { margin:22px 0 0; color:#9ba5b4; font-size:14px; font-weight:700; letter-spacing:.16em; text-align:center; }
.topbar { min-height:66px; padding:max(8px,env(safe-area-inset-top)) 12px 8px 16px; border-bottom:1px solid rgba(211,171,71,.28); background:linear-gradient(112deg,#05162c,#0a294d 72%,#0d355e); color:#fff; box-shadow:0 8px 24px rgba(6,26,51,.13); }
.topbar-title { align-items:center; gap:13px; }
.topbar-title strong { font-size:16px; font-weight:650; letter-spacing:.03em; }
.header-brand { position:relative; display:block; width:92px; height:35px; overflow:hidden; flex:0 0 auto; }
.header-brand img { display:block; width:100%; transform:translateY(-43%); }
.header-brand i { position:absolute; right:0; bottom:-1px; color:#d8b454; font-size:14px; font-style:normal; font-weight:800; letter-spacing:.22em; }
.topbar .icon-btn { color:rgba(255,255,255,.82); }
.topbar .icon-btn:active { background:rgba(255,255,255,.1); }
.search-bar { padding:13px 14px 2px; background:linear-gradient(to bottom,rgba(6,26,51,.045),transparent); }
.search-bar input { min-height:46px; border-color:transparent; border-radius:14px; box-shadow:0 5px 18px rgba(6,26,51,.06),0 0 0 1px var(--line); }
.search-bar input:focus { outline:none; box-shadow:0 0 0 2px rgba(200,156,53,.35),0 8px 24px rgba(6,26,51,.08); }
main { padding-top:14px; }
.section-label { color:var(--text-2); font-size:14px; font-weight:800; letter-spacing:.11em; }
.card { border-color:color-mix(in srgb,var(--line) 85%,transparent); border-radius:17px; box-shadow:var(--shadow); transition:transform .15s ease,box-shadow .15s ease; }
.card-row { padding:14px; gap:14px; }
.card-row .thumb { width:92px; height:58px; flex-basis:92px; border-radius:10px; }
.card-main .t1 { font-size:15px; font-weight:720; letter-spacing:.015em; }
.card-main .t2 { margin-top:2px; }
.box { border-color:color-mix(in srgb,var(--line) 88%,transparent); border-radius:17px; box-shadow:0 6px 22px rgba(6,26,51,.045); }
.box>h3 { color:var(--text); font-size:14px; letter-spacing:.04em; }
.btn { border-radius:11px; font-weight:650; transition:transform .15s ease,filter .15s ease; }
.btn.primary { border-color:#0a315d; background:linear-gradient(135deg,#0d3c6f,#071f3d); box-shadow:0 8px 18px rgba(7,31,61,.18); }
.btn.accent { border-color:#b88a27; background:linear-gradient(135deg,#e0bd62,#b48626); color:#10213a; box-shadow:0 8px 18px rgba(184,138,39,.2); }
.btn.block { padding:14px; }
.field>label { font-size:14px; font-weight:750; letter-spacing:.04em; }
.field input,.field textarea,.field select { min-height:46px; border-radius:11px; }
.field input:focus,.field textarea:focus,.field select:focus { outline:none; border-color:var(--gold); box-shadow:0 0 0 3px rgba(200,156,53,.12); }
.bottom-nav { border-top-color:rgba(200,156,53,.22); background:color-mix(in srgb,var(--surface) 96%,transparent); box-shadow:0 -10px 30px rgba(6,26,51,.1); backdrop-filter:blur(18px); -webkit-backdrop-filter:blur(18px); }
.bottom-nav .nav-tab { font-weight:650; }
.bottom-nav .nav-tab.active,.nav-center { color:var(--gold); }
.nav-camera-btn { top:-26px; border-color:var(--surface); background:linear-gradient(145deg,#e3c46f,#b28322); color:#071a31; box-shadow:0 12px 28px rgba(132,94,21,.32),0 0 0 1px rgba(200,156,53,.28); }
.modal { background:rgba(2,11,23,.7); backdrop-filter:blur(5px); -webkit-backdrop-filter:blur(5px); }
.modal-sheet { border:1px solid color-mix(in srgb,var(--gold) 18%,var(--line)); border-bottom:0; border-radius:24px 24px 0 0; box-shadow:0 -24px 64px rgba(0,0,0,.25); }
.modal-head { padding:14px 20px; border-radius:24px 24px 0 0; }
.modal-head strong { font-size:16px; letter-spacing:.02em; }
.success-mark { background:linear-gradient(145deg,rgba(200,156,53,.16),rgba(5,150,105,.1)); color:#bd8e28; box-shadow:inset 0 0 0 1px rgba(200,156,53,.2); }
.capture-card-data { border-color:color-mix(in srgb,var(--gold) 28%,var(--line)); box-shadow:0 8px 24px rgba(6,26,51,.055); }
.card-camera { background:#020b17; }
.camera-head,.camera-help,.camera-actions { background:#051326; }
.card-guide { border-color:rgba(255,255,255,.9); box-shadow:0 0 0 999px rgba(0,6,15,.5),inset 0 0 0 1px rgba(211,171,71,.85); }
.card-guide::before { border-left-color:#d5ac47; border-right-color:#d5ac47; }
.camera-done { background:linear-gradient(135deg,#dec069,#ae7f20); color:#071a31; }
.nav-center { padding-bottom:3px; white-space:nowrap; font-size:14px; letter-spacing:.02em; }
.nav-camera-btn { width:64px; height:64px; top:-32px; padding:14px; animation:camera-pop 2.4s ease-in-out infinite; }
@keyframes camera-pop { 0%,100% { transform:translateY(0); box-shadow:0 12px 28px rgba(132,94,21,.32),0 0 0 1px rgba(200,156,53,.28); } 50% { transform:translateY(-4px); box-shadow:0 18px 34px rgba(132,94,21,.38),0 0 0 6px rgba(200,156,53,.1); } }
.nav-camera-btn:active { animation:none; transform:scale(.91); }
.expense-capture-wrap { margin:4px 0 16px; }
.expense-capture-btn { display:grid; grid-template-columns:52px minmax(0,1fr) 20px; align-items:center; gap:12px; width:100%; min-height:82px; padding:13px 15px; border:1px solid rgba(200,156,53,.38); border-radius:17px; background:linear-gradient(120deg,#071f3d,#0d3d70); color:#fff; text-align:left; box-shadow:0 12px 28px rgba(6,26,51,.18); cursor:pointer; }
.expense-camera-icon { display:grid; place-items:center; width:52px; height:52px; border-radius:14px; background:linear-gradient(145deg,#e2c46f,#b58424); color:#071a31; }
.expense-camera-icon .inline-icon { width:25px; height:25px; margin:0; }
.expense-capture-btn strong { display:block; font-size:16px; letter-spacing:.03em; }
.expense-capture-btn small { display:block; margin-top:1px; color:rgba(255,255,255,.7); font-size:14px; }
.expense-arrow { color:#d9b75d; font-size:30px; line-height:1; text-align:right; }
.expense-capture-btn:active { transform:scale(.985); }
.camera-torch { justify-self:end; display:flex; flex-direction:column; align-items:center; justify-content:center; gap:1px; min-width:56px; min-height:48px; padding:4px; border:0; border-radius:10px; background:rgba(255,255,255,.08); color:#fff; font:inherit; cursor:pointer; }
.camera-torch svg { width:20px; height:20px; fill:none; stroke:currentColor; stroke-width:2; stroke-linecap:round; stroke-linejoin:round; }
.camera-torch span { font-size:14px; font-weight:700; }
.camera-torch.active { background:#d5ac47; color:#071a31; box-shadow:0 0 22px rgba(213,172,71,.45); }
.camera-torch.unsupported { opacity:.34; cursor:default; }
.focus-indicator { position:absolute; z-index:4; width:68px; height:68px; margin:-34px 0 0 -34px; border:2px solid #e0b84f; border-radius:12px; opacity:0; pointer-events:none; box-shadow:0 0 0 1px rgba(0,0,0,.25); }
.focus-indicator::before,.focus-indicator::after { content:''; position:absolute; background:#e0b84f; }
.focus-indicator::before { left:50%; top:-7px; width:2px; height:12px; }
.focus-indicator::after { top:50%; left:-7px; width:12px; height:2px; }
.focus-indicator.show { animation:focus-pulse .8s ease-out forwards; }
@keyframes focus-pulse { 0% { opacity:0; transform:scale(1.35); } 22% { opacity:1; transform:scale(1); } 75% { opacity:1; } 100% { opacity:0; } }
.feature-action-wrap { margin:4px 0 18px; }
.feature-action-btn { display:grid; grid-template-columns:54px minmax(0,1fr) 20px; align-items:center; gap:13px; width:100%; min-height:84px; padding:14px 16px; border:1px solid rgba(200,156,53,.35); border-radius:18px; background:linear-gradient(120deg,#071f3d,#0d3d70); color:#fff; text-align:left; box-shadow:0 13px 30px rgba(6,26,51,.18); cursor:pointer; }
.feature-action-icon { display:grid; place-items:center; width:54px; height:54px; border-radius:15px; background:linear-gradient(145deg,#e2c46f,#b58424); color:#071a31; }
.feature-action-icon .inline-icon { width:26px; height:26px; margin:0; }
.feature-action-btn strong { display:block; font-size:17px; letter-spacing:.03em; }
.feature-action-btn small { display:block; margin-top:1px; color:rgba(255,255,255,.72); font-size:14px; }
.feature-action-arrow { color:#d9b75d; font-size:30px; line-height:1; text-align:right; }
.feature-action-btn:active { transform:scale(.985); }
.editor-intro { display:flex; align-items:center; gap:12px; margin:-2px 0 15px; padding:13px 14px; border:1px solid rgba(200,156,53,.26); border-radius:15px; background:linear-gradient(120deg,rgba(200,156,53,.1),rgba(10,53,101,.06)); }
.editor-intro>span { display:grid; place-items:center; width:42px; height:42px; flex:0 0 42px; border-radius:12px; background:linear-gradient(145deg,#e1c168,#b58525); color:#071a31; }
.editor-intro .inline-icon { width:22px; height:22px; margin:0; }
.editor-intro strong,.editor-intro small { display:block; }
.editor-intro strong { font-size:15px; }
.editor-intro small { color:var(--text-2); font-size:14px; }
.editor-section { margin-bottom:13px; padding:15px; border:1px solid var(--line); border-radius:16px; background:var(--surface); box-shadow:0 6px 20px rgba(6,26,51,.045); }
.secondary-editor { background:var(--surface-2); }
.editor-section .field:last-child { margin-bottom:0; }
.prominent-field input { font-weight:650; }
.schedule-primary-grid { display:grid; grid-template-columns:minmax(0,1fr); gap:0; }
.schedule-primary-grid .field { min-width:0; }
.schedule-primary-grid input { display:block; width:100%; min-width:0; max-width:100%; }
.schedule-primary-grid input[type="datetime-local"] {
  width:-webkit-fill-available;
  min-width:0;
  max-width:100%;
  overflow:hidden;
  -webkit-appearance:none;
  appearance:none;
}
.schedule-primary-grid input[type="datetime-local"]::-webkit-date-and-time-value {
  min-width:0;
  text-align:left;
}
.editor-save { min-height:52px; font-size:16px; }
.receipt-capture-box { padding:14px; border-color:rgba(200,156,53,.3); background:linear-gradient(145deg,var(--surface),color-mix(in srgb,var(--gold) 5%,var(--surface))); }
.receipt-placeholder { display:flex; flex-direction:column; align-items:center; justify-content:center; min-height:132px; padding:18px; border:1px dashed color-mix(in srgb,var(--gold) 48%,var(--line)); border-radius:14px; background:var(--surface-2); text-align:center; }
.receipt-placeholder .inline-icon { width:34px; height:34px; margin:0 0 8px; color:var(--gold); }
.receipt-placeholder strong { font-size:14px; }
.receipt-placeholder small { margin-top:3px; color:var(--text-2); font-size:14px; }
.receipt-modal-camera { display:flex; align-items:center; justify-content:center; gap:9px; width:100%; min-height:58px; margin-top:12px; padding:13px 16px; border:1px solid #b88a27; border-radius:14px; background:linear-gradient(135deg,#e4c66e,#b38323); color:#10213a; font:inherit; font-size:16px; font-weight:800; box-shadow:0 9px 22px rgba(184,138,39,.22); cursor:pointer; }
.receipt-modal-camera .inline-icon { width:23px; height:23px; margin:0; }
.receipt-modal-camera:active { transform:scale(.985); }
.card-directory-head { display:flex; align-items:center; justify-content:space-between; gap:10px; margin:0 12px 14px 0; padding:12px 13px; border:1px solid var(--line); border-radius:15px; background:var(--surface); box-shadow:0 6px 20px rgba(6,26,51,.05); }
.card-directory-head>div:first-child { display:flex; align-items:baseline; gap:4px; white-space:nowrap; }
.card-directory-head>div:first-child strong { color:var(--gold); font-family:Georgia,serif; font-size:23px; line-height:1; }
.card-directory-head>div:first-child span { color:var(--text-2); font-size:14px; font-weight:700; }
.card-sort { display:flex; padding:3px; border-radius:11px; background:var(--surface-2); }
.card-sort button { min-height:36px; padding:7px 10px; border:0; border-radius:8px; background:transparent; color:var(--text-2); font:inherit; font-size:14px; font-weight:750; white-space:nowrap; }
.card-sort button.active { background:var(--surface); color:var(--accent); box-shadow:0 2px 8px rgba(6,26,51,.1); }
.directory-toolbar { display:flex; align-items:center; gap:9px; margin:-5px 14px 10px 1px; }
.directory-toolbar button { display:inline-flex; align-items:center; gap:5px; min-height:38px; padding:7px 11px; border:1px solid color-mix(in srgb,var(--gold) 38%,var(--line)); border-radius:10px; background:var(--surface); color:var(--accent); font:inherit; font-size:14px; font-weight:800; box-shadow:0 3px 12px rgba(6,26,51,.05); }
.directory-toolbar button .inline-icon { width:15px; height:15px; margin:0; }
.directory-toolbar span { color:var(--text-2); font-size:14px; }
.card-month-section { scroll-margin-top:78px; margin:0 12px 20px 0; }
.card-month-section>h2 { margin:0; padding:8px 3px 9px; color:var(--text-2); font-size:16px; font-weight:750; letter-spacing:.04em; }
.card-month-section>h2 span { margin-left:5px; font-size:14px; font-weight:700; }
.directory-card { display:grid; grid-template-columns:minmax(0,1fr) 104px; align-items:center; gap:13px; min-height:126px; padding:15px 3px 15px 4px; border-bottom:1px solid var(--line); cursor:pointer; }
.directory-card:first-of-type { border-top:1px solid var(--line); }
.directory-card:active { background:color-mix(in srgb,var(--gold) 5%,transparent); }
.directory-info { min-width:0; }
.directory-info h3 { display:flex; align-items:center; gap:6px; margin:0 0 3px; color:var(--text); font-size:18px; font-weight:800; line-height:1.35; overflow-wrap:anywhere; }
.directory-info h3 i { padding:2px 5px; border-radius:5px; background:var(--gold); color:#071a31; font-size:14px; font-style:normal; letter-spacing:.08em; }
.directory-info p { margin:1px 0; color:var(--text-2); font-size:14px; line-height:1.45; overflow-wrap:anywhere; }
.directory-info .directory-company { color:var(--text); font-size:14px; font-weight:650; }
.directory-info time { display:flex; align-items:center; gap:3px; margin-top:7px; color:var(--text-2); font-size:14px; font-weight:650; }
.directory-info time .inline-icon { width:12px; height:12px; margin:0; }
.directory-delete { display:inline-flex; align-items:center; gap:3px; min-height:32px; margin-top:6px; padding:4px 8px; border:1px solid color-mix(in srgb,var(--warn) 32%,var(--line)); border-radius:8px; background:transparent; color:var(--warn); font:inherit; font-size:14px; font-weight:750; }
.directory-delete .inline-icon { width:13px; height:13px; margin:0; }
.directory-thumb { width:104px; aspect-ratio:85.6/54; object-fit:cover; border:1px solid var(--line); border-radius:8px; background:var(--surface-2); box-shadow:0 6px 16px rgba(6,26,51,.09); }
.month-rail { position:fixed; z-index:18; right:2px; top:154px; bottom:calc(var(--nav-h) + env(safe-area-inset-bottom) + 16px); display:flex; flex-direction:column; justify-content:center; gap:1px; width:24px; padding:5px 0; touch-action:none; }
.month-rail button { display:flex; align-items:center; justify-content:center; width:24px; min-height:28px; padding:0; border:0; background:transparent; color:var(--accent); }
.month-rail button span { width:7px; height:7px; border-radius:50%; background:currentColor; box-shadow:0 0 0 3px color-mix(in srgb,var(--accent) 9%,transparent); }
.month-rail button small { display:none; }
.month-rail button:active span { width:11px; height:11px; background:var(--gold); }
.nav-center>span { position:relative; top:1px; padding:2px 6px; border-radius:7px; background:var(--surface); color:var(--text); font-size:14px; font-weight:850; letter-spacing:.03em; box-shadow:0 2px 8px rgba(6,26,51,.08); }
.card-profile { margin:-16px -16px 18px; background:var(--surface); }
.profile-gallery { display:flex; gap:10px; overflow-x:auto; padding:16px 16px 10px; scroll-snap-type:x mandatory; scrollbar-width:none; }
.profile-gallery::-webkit-scrollbar { display:none; }
.profile-gallery figure { position:relative; flex:0 0 100%; margin:0; scroll-snap-align:center; }
.profile-gallery img { display:block; width:100%; aspect-ratio:85.6/54; object-fit:contain; border:1px solid var(--line); border-radius:12px; background:#fff; box-shadow:0 12px 28px rgba(6,26,51,.12); cursor:zoom-in; }
.profile-gallery figcaption { position:absolute; right:8px; bottom:8px; padding:2px 8px; border-radius:999px; background:rgba(6,26,51,.72); color:#fff; font-size:14px; font-weight:800; }
.profile-identity { position:relative; padding:14px 18px 16px; border-bottom:1px solid var(--line); }
.profile-identity h2 { margin:0 0 7px; color:var(--text); font-size:19px; line-height:1.35; }
.profile-identity h1 { margin:0 0 3px; color:var(--text); font-size:25px; line-height:1.3; }
.profile-identity p { margin:0; color:var(--text-2); font-size:14px; }
.profile-contacts { padding:7px 18px 12px; }
.profile-contact-row { display:grid; grid-template-columns:29px minmax(0,1fr) auto; align-items:center; gap:8px; min-height:52px; border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent); color:var(--accent); font-size:15px; text-decoration:none; overflow-wrap:anywhere; }
.profile-contact-row:last-child { border-bottom:0; }
.profile-contact-row .inline-icon { width:22px; height:22px; margin:0; color:var(--text-2); }
.profile-contact-row i { padding:2px 6px; border:1px solid currentColor; border-radius:6px; font-size:14px; font-style:normal; font-weight:800; }
.profile-editor { margin:0 16px 16px; border:1px solid color-mix(in srgb,var(--accent) 24%,var(--line)); border-radius:14px; overflow:hidden; background:color-mix(in srgb,var(--accent) 5%,var(--surface)); }
.profile-editor summary { display:flex; align-items:center; justify-content:center; gap:7px; min-height:54px; padding:12px 16px; color:var(--accent); font-size:15px; font-weight:800; list-style:none; cursor:pointer; }
.profile-editor summary::-webkit-details-marker { display:none; }
.profile-editor summary .inline-icon { width:19px; height:19px; margin:0; }
.profile-editor-body { padding:15px; border-top:1px solid var(--line); background:var(--surface-2); }
.profile-exchange { padding:16px 18px; border-top:12px solid var(--bg); border-bottom:12px solid var(--bg); }
.profile-exchange>div { display:flex; align-items:center; gap:6px; font-size:14px; }
.profile-exchange .inline-icon { width:21px; height:21px; margin:0 4px 0 0; color:var(--gold); }
.profile-exchange strong { color:var(--accent); font-size:18px; }
.profile-exchange p { display:flex; align-items:center; margin:9px 0 0; color:var(--text-2); font-size:14px; }
.app-confirm-overlay { position:fixed; z-index:1000; inset:0; display:grid; place-items:center; padding:24px; background:rgba(2,8,23,.72); backdrop-filter:blur(8px); -webkit-backdrop-filter:blur(8px); }
.app-confirm { width:min(100%,360px); padding:24px 20px 18px; border:1px solid var(--line); border-radius:22px; background:var(--surface); box-shadow:0 24px 64px rgba(0,0,0,.42); text-align:center; }
.app-confirm-icon { display:grid; place-items:center; width:54px; height:54px; margin:0 auto 14px; border-radius:16px; background:color-mix(in srgb,var(--warn) 12%,var(--surface)); color:var(--warn); }
.app-confirm-icon .inline-icon { width:25px; height:25px; margin:0; }
.app-confirm h2 { margin:0 0 7px; font-size:19px; line-height:1.4; }
.app-confirm p { margin:0 0 20px; color:var(--text-2); font-size:14px; line-height:1.65; }
.app-confirm-actions { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.app-confirm-actions .btn { min-height:48px; margin:0; }

/* 消えるものの内訳。数で見せて、押す前に数えられるようにする */
.app-confirm-detail { display:grid; gap:4px; margin:0 0 18px; padding:11px 14px; list-style:none; border-radius:12px; background:color-mix(in srgb,var(--warn) 9%,var(--surface)); color:var(--text-2); font-size:14px; text-align:left; }
.app-confirm-detail li { display:flex; align-items:center; gap:7px; }
.app-confirm-detail li::before { content:''; flex:none; width:4px; height:4px; border-radius:50%; background:var(--warn); }

/* 押し続けて実行するボタン。指が滑っただけ・二度押ししただけでは実行されない */
.app-confirm-actions .btn.hold { position:relative; overflow:hidden; touch-action:none; -webkit-user-select:none; user-select:none; }
.app-confirm-actions .btn.hold .hold-fill { position:absolute; inset:0; transform:scaleX(0); transform-origin:left center; background:color-mix(in srgb,var(--warn) 26%,transparent); pointer-events:none; }
.app-confirm-actions .btn.hold .hold-label { position:relative; }
.app-confirm-actions .btn.hold.holding { opacity:1; }
@media (prefers-reduced-motion:reduce) { .app-confirm-actions .btn.hold .hold-fill { transition:none; } }

/* 依頼の片づけ。ふだんは畳んでおき、開かないと削除は出てこない */
.tidy { margin:18px 0 0; border:1px solid var(--line); border-radius:14px; background:var(--surface); overflow:hidden; }
.tidy > summary { padding:13px 16px; color:var(--text-2); font-size:14px; font-weight:600; cursor:pointer; list-style:none; display:flex; align-items:center; justify-content:space-between; gap:8px; }
.tidy > summary::-webkit-details-marker { display:none; }
.tidy > summary::after { content:'▾'; color:var(--text-2); font-size:14px; transition:transform .15s ease; }
.tidy[open] > summary::after { transform:rotate(180deg); }
.tidy[open] > summary { border-bottom:1px solid var(--line); }
.tidy-body { padding:14px 16px 16px; }
.tidy-body p { margin:0 0 10px; color:var(--text-2); font-size:14px; line-height:1.7; }
.tidy-warn { color:var(--warn); }
.tidy-body .btn { margin:4px 0 0; }
@media (max-width:390px) { .directory-card { grid-template-columns:minmax(0,1fr) 90px; } .directory-thumb { width:90px; } .card-sort button { padding:7px 8px; } }
@media (min-width:700px) { .modal-sheet { border-radius:24px; } .modal-head { border-radius:24px 24px 0 0; } }

/* Apple HIG refinement — Mofelleのブランドを保ちながらiOSの階層と操作感を採用 */
:root { --system-blue:#007aff; --system-green:#34c759; --system-orange:#ff9500; --system-red:#ff3b30; }

.topbar { background:color-mix(in srgb,var(--navy) 82%,transparent); backdrop-filter:blur(25px) saturate(180%); -webkit-backdrop-filter:blur(25px) saturate(180%); border-bottom:.5px solid rgba(255,255,255,.18); box-shadow:none; }
.bottom-nav { background:color-mix(in srgb,var(--surface) 78%,transparent); backdrop-filter:blur(25px) saturate(180%); -webkit-backdrop-filter:blur(25px) saturate(180%); border-top:.5px solid color-mix(in srgb,var(--text-2) 24%,transparent); box-shadow:none; }
.bottom-nav .nav-tab.active { color:var(--system-blue); }
.modal-sheet { overflow:hidden; border-color:color-mix(in srgb,var(--text-2) 20%,transparent); box-shadow:0 -14px 44px rgba(0,0,0,.24); animation:ios-sheet-in .34s cubic-bezier(.2,.8,.2,1); }
@keyframes ios-sheet-in { from { transform:translateY(100%); } to { transform:translateY(0); } }
.modal-grabber { flex:0 0 auto; width:36px; height:5px; margin:7px auto 3px; border-radius:3px; background:color-mix(in srgb,var(--text-2) 45%,transparent); }
.modal-head { padding-top:8px; border-bottom:.5px solid color-mix(in srgb,var(--text-2) 22%,transparent); }
.ios-list-section { margin:0 0 20px; }
.section-label,.card-month-section>h2 { margin:0 12px; padding:0 0 7px; color:color-mix(in srgb,var(--text-2) 82%,transparent); font-size:14px; font-weight:650; letter-spacing:.06em; text-transform:none; }
.ios-list { overflow:hidden; border:.5px solid color-mix(in srgb,var(--text-2) 18%,transparent); border-radius:16px; background:var(--surface); box-shadow:none; }
.ios-list .card { position:relative; margin:0; border:0; border-radius:0; background:transparent; box-shadow:none; }
.ios-list .card:not(:last-child)::before { content:""; position:absolute; z-index:2; right:0; bottom:0; left:78px; height:.5px; background:color-mix(in srgb,var(--text-2) 22%,transparent); }
.ios-list .card::after { content:"›"; position:absolute; top:50%; right:12px; transform:translateY(-50%); color:color-mix(in srgb,var(--text-2) 55%,transparent); font-size:25px; font-weight:300; }
.ios-list .card-row { min-height:66px; padding:11px 34px 11px 14px; }
.ios-list .card-main .t1 { font-size:16px; font-weight:600; }
.ios-list .card-main .t2 { font-size:14px; }
.ios-list .card-main .t3 { font-size:14px; }
.directory-list .directory-card { min-height:92px; padding:11px 14px; border:0; }
.directory-list .directory-card:not(:last-child) { border-bottom:.5px solid color-mix(in srgb,var(--text-2) 22%,transparent); }
.directory-list .directory-card:first-of-type { border-top:0; }
.directory-list .directory-thumb { width:86px; border-radius:7px; box-shadow:none; }
.directory-list .directory-info h3 { font-size:16px; font-weight:600; }
.directory-list .directory-info .directory-company { font-size:14px; }
.directory-list .directory-info time { font-size:14px; }
.btn:active,.card:active,.directory-card:active,.nav-tab:active { transform:scale(.985); transition-duration:.08s; }

/* 全操作共通の押下フィードバック。タッチでは:activeが短すぎる端末があるためJSクラスも併用。 */
button,a[href],[role="button"],.card[data-card],.card[data-task],.card[data-meeting],.card[data-expense],.card[data-doc] {
  -webkit-tap-highlight-color:rgba(200,156,53,.18);
  transition:transform .1s ease,filter .1s ease,box-shadow .1s ease,background-color .1s ease,opacity .1s ease;
}
button.is-pressing,a[href].is-pressing,[role="button"].is-pressing,
.card.is-pressing,.directory-card.is-pressing {
  transform:translateY(2px) scale(.965) !important;
  filter:brightness(.82) saturate(1.18);
  box-shadow:inset 0 2px 7px rgba(0,0,0,.2) !important;
}
button.press-confirmed,a[href].press-confirmed,[role="button"].press-confirmed,
.card.press-confirmed,.directory-card.press-confirmed { animation:press-confirm .26s ease-out; }
@keyframes press-confirm {
  0% { filter:brightness(.82); }
  45% { filter:brightness(1.18); }
  100% { filter:brightness(1); }
}
button:disabled { cursor:wait; opacity:.58; filter:saturate(.55); }
.btn.danger,.directory-delete { color:var(--system-red); }

/* メニューの通知セクション */
.notify-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 14px;
  font-size: 14px;
  cursor: pointer;
}
.notify-row input { width: 18px; height: 18px; accent-color: var(--accent, #c9a227); flex: 0 0 auto; }
#push-actions:empty { display: none; }

/* ---------------------------------------------------------------
   依頼・返信に付けたファイルと画像
   --------------------------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
/* 何も付いていないうちは、余白ごと畳む */
.chips:empty { display: none; }

.filechip {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 100%; padding: 6px 10px;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--surface-2); color: var(--text);
  font-size:14px; text-decoration: none; line-height: 1.3;
  /* .bubble の中に置いても、本文の pre-wrap を引きずらないようにする */
  white-space: normal;
}
.filechip:hover { border-color: var(--accent); }
.filechip.img { padding: 6px 10px 6px 6px; }
.filechip img { width: 40px; height: 40px; object-fit: cover; border-radius: 7px; display: block; }
.filechip .fi { display: inline-flex; opacity: .65; }
.filechip .fi svg { width: 15px; height: 15px; margin: 0; }
.filechip .fname { max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip .fsize { font-size:14px; opacity: .6; flex: none; }
.filechip .fx {
  border: 0; background: none; cursor: pointer; padding: 0 0 0 2px;
  font-size: 16px; line-height: 1; color: inherit; opacity: .5;
}
.filechip .fx:hover { opacity: 1; color: var(--warn); }

/* ---------------------------------------------------------------
   ファイルのドラッグ＆ドロップ（パソコンのとき）
   --------------------------------------------------------------- */
.dropzone {
  border: 1.5px dashed transparent; border-radius: 12px;
  transition: border-color .15s, background .15s;
}
.dropzone.over { border-color: var(--accent); background: rgba(37, 99, 235, .07); }
.dropzone-hint { display: none; margin: 8px 0 0; font-size:14px; color: var(--text-2); }

/* マウスが使える環境（＝パソコン）だけ、置き場所として見せる */
@media (hover: hover) and (pointer: fine) {
  .dropzone { border-color: var(--line); padding: 10px; }
  .dropzone-hint { display: block; }
}

/* ---------------------------------------------------------------
   バージョンアップのお知らせ
   --------------------------------------------------------------- */
.whatsnew-head { display: flex; align-items: center; gap: 12px; }
.whatsnew-icon { width: 52px; height: 52px; border-radius: 13px; display: block; flex: none; }
.whatsnew-head strong { display: block; font-size: 17px; }
.whatsnew-head small { color: var(--text-2); font-size:14px; }
.whatsnew-list { margin: 14px 0 0; padding-left: 20px; }
.whatsnew-list li { margin-bottom: 8px; line-height: 1.6; }
.whatsnew-list li:last-child { margin-bottom: 0; }

/* ---------------------------------------------------------------
   新着（どこに未読があるかを示す）
   --------------------------------------------------------------- */
/* カードに出す未読件数（見出しの「新着（n）」は依頼の数なので呼び分ける） */
.pill.new { background: var(--warn); color: #fff; }

/* 新着のある依頼カードは左に色の帯を出す */
.ios-list-section.is-new .section-label { color: var(--warn); }
.card.has-new { box-shadow: inset 3px 0 0 var(--warn); }

/* 下部ナビのバッジ。新着のときだけ輪を足して、未完了件数と見分ける */
.badge.new { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px rgba(225, 29, 72, .3); }

/* やり取りの「ここから新着」のしおり */
.unread-line {
  display: flex; align-items: center; gap: 10px;
  margin: 6px 0 2px; color: var(--warn);
  font-size:14px; font-weight: 800; white-space: nowrap;
}
.unread-line::before, .unread-line::after {
  content: ''; flex: 1; height: 1px; background: currentColor; opacity: .45;
}

/* 「新着へ」ボタン。スクロールしても上に貼りつく */
.jump-new {
  position: sticky; top: 0; z-index: 5;
  display: block; margin: 0 auto 12px; padding: 8px 18px;
  border: 0; border-radius: 999px;
  background: var(--warn); color: #fff;
  font: inherit; font-size:14px; font-weight: 800;
  cursor: pointer; box-shadow: 0 4px 14px rgba(225, 29, 72, .35);
}
.jump-new:hover { filter: brightness(1.06); }

@media (prefers-reduced-motion: reduce) {
  .jump-new { transition: none; }
}

/* ---------------------------------------------------------------
   既読の共有と更新（v1.20.0）
   --------------------------------------------------------------- */
/* 更新中は右上の矢印が回る。押せたかどうかが目で分かるように */
#btn-refresh.spinning svg { animation: spin .8s linear infinite; }
#btn-refresh:disabled { opacity: .7; cursor: default; }

/* 新着のある依頼は、帯に加えて背景もうすく色づけ、題名を太くする。読んだものは普通の見た目に戻る */
.card.has-new { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.card.has-new .t1 { font-weight: 800; }

/* 相手が読んだか */
.seen-by { font-weight: 700; }
.seen-by.yes { color: var(--ok); }
.seen-by.no { color: var(--system-orange); }

/* 新着をまとめて既読にする */
.read-all-row { display: flex; justify-content: flex-end; margin: -4px 0 14px; }
.read-all-row .btn { font-size: 14px; }
