/* =========================================================
 * MeishiHub — モバイルアプリ スタイル
 * ブランド：グリーン × ホワイト / モダン・ミニマル
 * ========================================================= */
:root {
  --green-800: #065f46;
  --green-700: #047857;
  --green-600: #059669;
  --green-500: #10b981;
  --green-400: #34d399;
  --green-100: #d1fae5;
  --green-50:  #ecfdf5;
  --ink:       #0f172a;
  --ink-2:     #475569;
  --ink-3:     #94a3b8;
  --line:      #e2e8f0;
  --bg:        #f6f8f7;
  --surface:   #ffffff;
  --amber:     #d97706;
  --amber-bg:  #fef3c7;
  --red:       #dc2626;
  --red-bg:    #fee2e2;
  --blue:      #2563eb;
  --blue-bg:   #dbeafe;
  --radius:    16px;
  --shadow:    0 1px 3px rgba(15, 23, 42, .06), 0 4px 16px rgba(15, 23, 42, .05);
  --shadow-lg: 0 8px 32px rgba(15, 23, 42, .14);
  --safe-b:    env(safe-area-inset-bottom, 0px);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { color-scheme: light; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Noto Sans JP", "Segoe UI", sans-serif;
  background: #e8ece9;
  color: var(--ink);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; font-size: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, select, textarea { font-family: inherit; font-size: 16px; /* iOSズーム防止 */ }
a { color: var(--green-700); text-decoration: none; }

/* ---------- アプリシェル（スマホ幅） ---------- */
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  position: relative;
  box-shadow: 0 0 40px rgba(15, 23, 42, .12);
  display: flex;
  flex-direction: column;
}
.screen { display: none; flex: 1; flex-direction: column; padding-bottom: calc(88px + var(--safe-b)); }
.screen.active { display: flex; }
.screen.no-tab { padding-bottom: 0; }

/* ---------- 共通ヘッダー ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  background: rgba(246, 248, 247, .92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 14px 20px 10px;
  display: flex; align-items: center; gap: 12px;
}
.app-header h1 { font-size: 20px; font-weight: 800; letter-spacing: .01em; }
.app-header .spacer { flex: 1; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--surface); box-shadow: var(--shadow);
  font-size: 18px; flex-shrink: 0;
  transition: transform .12s ease;
}
.icon-btn:active { transform: scale(.94); }
.back-btn { background: none; box-shadow: none; font-size: 22px; width: 36px; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 14px; font-weight: 700; padding: 14px 20px;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--green-600); color: #fff; box-shadow: 0 4px 14px rgba(5, 150, 105, .35); }
.btn-primary:disabled { opacity: .45; box-shadow: none; }
.btn-ghost { background: var(--green-50); color: var(--green-700); }
.btn-outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn-danger-ghost { background: var(--red-bg); color: var(--red); }
.btn-block { width: 100%; }
.btn-sm { padding: 9px 14px; font-size: 13px; border-radius: 11px; }

/* ---------- ログイン ---------- */
#screen-login {
  justify-content: center; padding: 32px 28px calc(32px + var(--safe-b));
  background:
    radial-gradient(1200px 500px at 50% -220px, var(--green-100), transparent 70%),
    var(--bg);
}
.login-logo { text-align: center; margin-bottom: 36px; }
.login-logo .mark {
  width: 76px; height: 76px; margin: 0 auto 16px;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  border-radius: 24px; display: flex; align-items: center; justify-content: center;
  font-size: 36px; box-shadow: 0 10px 30px rgba(5, 150, 105, .35);
}
.login-logo h1 { font-size: 26px; font-weight: 800; letter-spacing: .02em; }
.login-logo p { color: var(--ink-2); font-size: 13px; margin-top: 4px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 700; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 14px 16px; border: 1.5px solid var(--line);
  border-radius: 14px; background: var(--surface); color: var(--ink);
  outline: none; transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%2394a3b8' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--green-500); box-shadow: 0 0 0 4px var(--green-50);
}
.field .hint { font-size: 11.5px; color: var(--ink-3); margin-top: 5px; }
.login-2fa {
  background: var(--green-50); border: 1.5px dashed var(--green-400);
  border-radius: 14px; padding: 14px 16px; margin: 20px 0;
}
.login-2fa .t { font-size: 12.5px; font-weight: 700; color: var(--green-800); display: flex; align-items: center; gap: 6px; }
.login-2fa .d { font-size: 11.5px; color: var(--ink-2); margin: 4px 0 10px; }
.login-error {
  background: var(--red-bg); color: var(--red); border-radius: 12px;
  padding: 12px 14px; font-size: 13px; font-weight: 600; margin-bottom: 14px; display: none;
}
.demo-note { text-align: center; font-size: 11.5px; color: var(--ink-3); margin-top: 22px; line-height: 1.7; }
.demo-note b { color: var(--green-700); }

/* ---------- ホーム ---------- */
.home-hero { padding: 4px 20px 0; }
.home-greet { font-size: 22px; font-weight: 800; line-height: 1.35; }
.home-greet small { display: block; font-size: 12.5px; color: var(--ink-2); font-weight: 600; margin-bottom: 2px; }
.search-launcher {
  margin: 16px 20px 0; padding: 14px 18px;
  background: var(--surface); border-radius: 16px; box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 10px; color: var(--ink-3);
  font-size: 14.5px; width: calc(100% - 40px); text-align: left;
}
.stat-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 16px 20px 0; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); padding: 16px;
  box-shadow: var(--shadow);
}
.stat-card .label { font-size: 12px; color: var(--ink-2); font-weight: 600; display: flex; gap: 6px; align-items: center; }
.stat-card .value { font-size: 26px; font-weight: 800; margin-top: 2px; letter-spacing: -.01em; }
.stat-card .value small { font-size: 13px; font-weight: 700; color: var(--ink-3); }
.stat-card .delta { font-size: 11.5px; color: var(--green-700); font-weight: 700; }

.section { padding: 24px 20px 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 16px; font-weight: 800; }
.section-head .more { font-size: 13px; font-weight: 700; color: var(--green-700); }

.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-item {
  background: var(--surface); border-radius: 16px; padding: 14px 6px 12px;
  box-shadow: var(--shadow); text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  transition: transform .12s ease;
}
.quick-item:active { transform: scale(.95); }
.quick-item .qi { font-size: 22px; width: 42px; height: 42px; border-radius: 13px; background: var(--green-50); display: flex; align-items: center; justify-content: center; }
.quick-item .qt { font-size: 11px; font-weight: 700; color: var(--ink-2); }

/* おすすめカルーセル */
.reco-scroll { display: flex; gap: 12px; overflow-x: auto; padding: 2px 20px 8px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.reco-scroll::-webkit-scrollbar { display: none; }
.reco-card {
  min-width: 240px; scroll-snap-align: start;
  background: var(--surface); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); border-top: 3px solid var(--green-400);
}
.reco-card .why { font-size: 11px; font-weight: 800; color: var(--green-700); background: var(--green-50); border-radius: 999px; padding: 3px 10px; display: inline-block; margin-bottom: 8px; }
.reco-card .who { font-weight: 800; font-size: 15px; }
.reco-card .co { font-size: 12.5px; color: var(--ink-2); margin-top: 1px; }
.reco-card .meta { font-size: 11.5px; color: var(--ink-3); margin-top: 8px; }

/* ---------- 名刺リスト ---------- */
.search-bar { padding: 4px 20px 0; display: flex; gap: 10px; }
.search-bar .search-input {
  flex: 1; display: flex; align-items: center; gap: 8px;
  background: var(--surface); border-radius: 14px; padding: 0 14px;
  box-shadow: var(--shadow); border: 1.5px solid transparent;
}
.search-bar .search-input:focus-within { border-color: var(--green-500); }
.search-bar input { flex: 1; border: none; outline: none; padding: 12px 0; background: none; }
.filter-btn { position: relative; }
.filter-btn .dot {
  position: absolute; top: 7px; right: 7px; width: 9px; height: 9px;
  background: var(--green-500); border-radius: 50%; border: 2px solid var(--surface); display: none;
}
.filter-btn.on .dot { display: block; }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 12px 20px 4px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; padding: 7px 14px; border-radius: 999px; font-size: 12.5px; font-weight: 700;
  background: var(--surface); color: var(--ink-2); box-shadow: var(--shadow);
  border: 1.5px solid transparent; white-space: nowrap;
}
.chip.on { background: var(--green-700); color: #fff; }
.result-meta { padding: 10px 20px 4px; font-size: 12px; color: var(--ink-3); display: flex; justify-content: space-between; align-items: center; }
.result-meta select { border: none; background: none; font-size: 12px; font-weight: 700; color: var(--green-700); outline: none; }

.card-list { padding: 6px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.person-card {
  background: var(--surface); border-radius: var(--radius); padding: 14px;
  box-shadow: var(--shadow); display: flex; gap: 12px; align-items: center;
  width: 100%; text-align: left; transition: transform .1s ease;
}
.person-card:active { transform: scale(.98); }
.avatar {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: 18px; color: #fff;
}
.person-card .info { flex: 1; min-width: 0; }
.person-card .nm { font-weight: 800; font-size: 15px; display: flex; align-items: center; gap: 6px; }
.person-card .co { font-size: 12.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.person-card .sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: 10px; font-weight: 800; padding: 2.5px 8px; border-radius: 999px; white-space: nowrap;
}
.badge-contact { background: var(--green-100); color: var(--green-800); }
.badge-exec { background: var(--amber-bg); color: var(--amber); }
.badge-handover { background: var(--blue-bg); color: var(--blue); }
.badge-new { background: var(--green-600); color: #fff; }
.load-more { margin: 14px 20px 8px; }
.empty-state { text-align: center; padding: 56px 32px; color: var(--ink-3); }
.empty-state .big { font-size: 44px; margin-bottom: 10px; }

/* ---------- フィルターシート / モーダル ---------- */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(15, 23, 42, .45); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .22s ease;
}
.sheet-backdrop.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%);
  width: 100%; max-width: 480px; max-height: 86dvh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; z-index: 100;
  transition: transform .28s cubic-bezier(.32, .72, .28, 1);
  padding: 10px 20px calc(24px + var(--safe-b));
}
.sheet.open { transform: translate(-50%, 0); }
.sheet .grip { width: 40px; height: 4.5px; border-radius: 3px; background: var(--line); margin: 4px auto 14px; }
.sheet h3 { font-size: 17px; font-weight: 800; margin-bottom: 14px; }
.sheet h4 { font-size: 12.5px; font-weight: 800; color: var(--ink-2); margin: 18px 0 8px; }
.opt-wrap { display: flex; flex-wrap: wrap; gap: 8px; }
.opt {
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--bg); color: var(--ink-2); border: 1.5px solid transparent;
}
.opt.on { background: var(--green-50); color: var(--green-800); border-color: var(--green-500); }
.sheet-actions { display: flex; gap: 10px; margin-top: 24px; }
.sheet-actions .btn { flex: 1; }

.modal {
  position: fixed; inset: 0; z-index: 110; display: none;
  align-items: center; justify-content: center; padding: 24px;
  background: rgba(15, 23, 42, .5);
}
.modal.open { display: flex; }
.modal-box {
  background: var(--surface); border-radius: 22px; max-width: 400px; width: 100%;
  padding: 26px 24px; box-shadow: var(--shadow-lg); max-height: 84dvh; overflow-y: auto;
  animation: pop .25s cubic-bezier(.32, .72, .28, 1);
}
@keyframes pop { from { transform: scale(.92); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* HQポップアップ */
.hq-pop .hq-tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--green-700); color: #fff; font-size: 11px; font-weight: 800;
  padding: 4px 12px; border-radius: 999px; margin-bottom: 12px;
}
.hq-pop.warn .hq-tag { background: var(--amber); }
.hq-pop h3 { font-size: 18px; font-weight: 800; line-height: 1.4; margin-bottom: 8px; }
.hq-pop p { font-size: 14px; color: var(--ink-2); }
.hq-pop .meta { font-size: 11.5px; color: var(--ink-3); margin: 14px 0 18px; }

/* ---------- 取り込み（スキャン） ---------- */
.scan-hero {
  margin: 8px 20px 0; border-radius: 20px; overflow: hidden;
  background: linear-gradient(150deg, var(--green-700), var(--green-500));
  color: #fff; padding: 24px 22px; position: relative;
}
.scan-hero h2 { font-size: 19px; font-weight: 800; }
.scan-hero p { font-size: 12.5px; opacity: .92; margin-top: 4px; }
.scan-hero .cam-frame {
  margin-top: 18px; border: 2px dashed rgba(255, 255, 255, .65); border-radius: 16px;
  padding: 26px 16px; text-align: center; font-size: 13px; font-weight: 700;
}
.scan-hero .cam-frame .ic { font-size: 34px; display: block; margin-bottom: 6px; }
.scan-actions { padding: 16px 20px 0; display: flex; flex-direction: column; gap: 10px; }
.scan-tip {
  margin: 18px 20px 0; background: var(--surface); border-radius: var(--radius);
  padding: 14px 16px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--ink-2);
}
.scan-tip b { color: var(--green-700); }
.thumb-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 16px 20px 0; }
.thumb {
  aspect-ratio: 91 / 55; border-radius: 12px; overflow: hidden; position: relative;
  background: var(--line); box-shadow: var(--shadow);
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .st {
  position: absolute; inset: auto 0 0 0; font-size: 10px; font-weight: 800;
  background: rgba(15, 23, 42, .65); color: #fff; text-align: center; padding: 3px 0;
}
.thumb.done .st { background: rgba(5, 150, 105, .9); }
.ocr-progress { padding: 20px; }
.ocr-bar { height: 8px; border-radius: 4px; background: var(--line); overflow: hidden; }
.ocr-bar > div { height: 100%; width: 0; background: linear-gradient(90deg, var(--green-500), var(--green-700)); transition: width .3s ease; border-radius: 4px; }
.ocr-label { font-size: 12.5px; color: var(--ink-2); font-weight: 700; margin-top: 10px; text-align: center; }

/* 取り込み確認フォーム */
.confirm-card {
  margin: 0 20px 14px; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px 16px;
}
.confirm-card .cc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.confirm-card .cc-head .n { font-weight: 800; font-size: 13px; color: var(--green-700); }
.check-row {
  display: flex; align-items: center; gap: 10px; padding: 12px 14px;
  background: var(--green-50); border-radius: 12px; margin-top: 4px;
}
.check-row input { width: 20px; height: 20px; accent-color: var(--green-600); }
.check-row label { font-size: 13.5px; font-weight: 700; color: var(--green-800); flex: 1; }
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---------- 名刺詳細 ---------- */
.detail-hero {
  margin: 4px 20px 0; background: var(--surface); border-radius: 20px;
  box-shadow: var(--shadow); padding: 22px 20px; text-align: center; position: relative;
}
.detail-hero .avatar { width: 64px; height: 64px; margin: 0 auto 10px; font-size: 24px; border-radius: 18px; }
.detail-hero h2 { font-size: 20px; font-weight: 800; }
.detail-hero .kana { font-size: 11.5px; color: var(--ink-3); }
.detail-hero .co { font-size: 14px; color: var(--ink-2); font-weight: 600; margin-top: 4px; }
.detail-hero .role { font-size: 12.5px; color: var(--ink-3); }
.detail-badges { display: flex; gap: 6px; justify-content: center; margin-top: 10px; flex-wrap: wrap; }
.tag-chip { font-size: 11px; font-weight: 700; background: var(--bg); color: var(--ink-2); padding: 3px 10px; border-radius: 999px; }
.action-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 14px 20px 0; }
.action-item {
  background: var(--surface); border-radius: 14px; padding: 12px 4px;
  box-shadow: var(--shadow); text-align: center; font-size: 11.5px; font-weight: 700; color: var(--green-700);
  display: flex; flex-direction: column; gap: 4px; align-items: center;
}
.action-item .ic { font-size: 20px; }
.info-list { margin: 16px 20px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.info-row { display: flex; padding: 13px 16px; border-bottom: 1px solid var(--bg); gap: 12px; align-items: baseline; }
.info-row:last-child { border-bottom: none; }
.info-row .k { width: 84px; flex-shrink: 0; font-size: 12px; color: var(--ink-3); font-weight: 700; }
.info-row .v { flex: 1; font-size: 14px; word-break: break-all; }
.owner-box {
  margin: 16px 20px 0; background: var(--green-50); border-radius: var(--radius);
  padding: 14px 16px; font-size: 12.5px; color: var(--green-800);
}
.owner-box b { font-size: 14px; }
.owner-box .ho { margin-top: 6px; padding-top: 6px; border-top: 1px dashed var(--green-400); color: var(--blue); font-weight: 700; }

/* メモ（やり取り履歴） */
.memo-input { margin: 12px 20px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; }
.memo-input textarea { width: 100%; border: none; outline: none; resize: none; min-height: 60px; background: none; }
.memo-input .mi-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.memo-input select { border: 1.5px solid var(--line); border-radius: 10px; padding: 7px 28px 7px 10px; font-size: 13px; font-weight: 700; color: var(--ink-2); background: var(--bg); outline: none; }
.memo-input .btn { margin-left: auto; }
.memo-timeline { margin: 14px 20px 0; position: relative; padding-left: 18px; }
.memo-timeline::before { content: ''; position: absolute; left: 5px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 1px; }
.memo-item { position: relative; padding-bottom: 16px; }
.memo-item::before {
  content: ''; position: absolute; left: -18px; top: 7px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--green-500); border: 2.5px solid var(--bg);
}
.memo-item .mh { font-size: 11.5px; color: var(--ink-3); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.memo-item .mh .mtype { background: var(--green-50); color: var(--green-800); font-weight: 800; font-size: 10px; padding: 2px 8px; border-radius: 999px; }
.memo-item .mb { background: var(--surface); border-radius: 12px; padding: 10px 14px; margin-top: 6px; box-shadow: var(--shadow); font-size: 13.5px; }

/* ---------- タイムライン ---------- */
.tl-feed { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.tl-item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.tl-head { display: flex; gap: 10px; align-items: center; }
.tl-emoji { width: 40px; height: 40px; border-radius: 12px; background: var(--green-50); display: flex; align-items: center; justify-content: center; font-size: 20px; flex-shrink: 0; }
.tl-head .who { font-weight: 800; font-size: 13.5px; }
.tl-head .when { font-size: 11px; color: var(--ink-3); }
.tl-body { font-size: 13.5px; color: var(--ink-2); margin-top: 8px; }
.tl-body b { color: var(--ink); }
.tl-card-ref {
  margin-top: 10px; background: var(--bg); border-radius: 12px; padding: 10px 12px;
  font-size: 12.5px; display: flex; justify-content: space-between; align-items: center; gap: 8px;
  width: 100%; text-align: left;
}
.tl-card-ref .arrow { color: var(--ink-3); }
.react-row { display: flex; gap: 6px; margin-top: 10px; }
.react-btn {
  font-size: 12px; padding: 4px 10px; border-radius: 999px; background: var(--bg);
  font-weight: 700; color: var(--ink-2); transition: transform .1s ease;
}
.react-btn:active { transform: scale(1.15); }
.react-btn.hit { background: var(--green-100); color: var(--green-800); }

/* ランキング */
.rank-card { margin: 8px 20px 0; background: linear-gradient(150deg, #064e3b, var(--green-700)); color: #fff; border-radius: 20px; padding: 18px 20px; }
.rank-card h3 { font-size: 14px; font-weight: 800; display: flex; align-items: center; gap: 6px; }
.rank-list { margin-top: 12px; display: flex; flex-direction: column; gap: 8px; }
.rank-row { display: flex; align-items: center; gap: 10px; font-size: 13.5px; }
.rank-row .pos { width: 26px; height: 26px; border-radius: 50%; background: rgba(255, 255, 255, .16); display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 12px; flex-shrink: 0; }
.rank-row:first-child .pos { background: #fbbf24; color: #064e3b; }
.rank-row .rn { font-weight: 700; flex: 1; }
.rank-row .rc { font-weight: 800; }
.rank-row .rc small { font-weight: 600; opacity: .8; }

/* ---------- マイページ ---------- */
.mypage-head { margin: 4px 20px 0; background: var(--surface); border-radius: 20px; box-shadow: var(--shadow); padding: 22px 20px; display: flex; gap: 16px; align-items: center; }
.mypage-head .avatar { width: 60px; height: 60px; font-size: 26px; background: var(--green-50); border-radius: 18px; }
.mypage-head h2 { font-size: 18px; font-weight: 800; }
.mypage-head .sub { font-size: 12px; color: var(--ink-2); }
.mypage-head .no { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.menu-list { margin: 16px 20px 0; background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.menu-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 15px 16px;
  border-bottom: 1px solid var(--bg); text-align: left; font-size: 14px; font-weight: 600;
}
.menu-row:last-child { border-bottom: none; }
.menu-row .mi { font-size: 18px; width: 24px; text-align: center; }
.menu-row .arrow { margin-left: auto; color: var(--ink-3); }
.menu-row .count-pill { margin-left: auto; background: var(--green-600); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px; }
.menu-row.danger { color: var(--red); }

/* ---------- 下部タブバー ---------- */
.tab-bar[hidden] { display: none; }
.tab-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px; z-index: 50;
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
  display: grid; grid-template-columns: repeat(5, 1fr);
  padding: 8px 8px calc(8px + var(--safe-b));
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  font-size: 10px; font-weight: 700; color: var(--ink-3); padding: 4px 0;
}
.tab .ti { font-size: 21px; line-height: 1; filter: grayscale(1) opacity(.55); transition: filter .15s ease; }
.tab.active { color: var(--green-700); }
.tab.active .ti { filter: none; }
.tab-fab { position: relative; }
.tab-fab .fab {
  position: absolute; top: -26px; left: 50%; transform: translateX(-50%);
  width: 56px; height: 56px; border-radius: 50%;
  background: linear-gradient(135deg, var(--green-500), var(--green-700));
  color: #fff; font-size: 24px; display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 20px rgba(5, 150, 105, .45); border: 4px solid var(--bg);
  transition: transform .12s ease;
}
.tab-fab .fab:active { transform: translateX(-50%) scale(.92); }
.tab-fab .tl { margin-top: 26px; font-size: 10px; font-weight: 700; color: var(--ink-3); text-align: center; }

/* ---------- トースト ---------- */
#toast {
  position: fixed; bottom: calc(104px + var(--safe-b)); left: 50%; transform: translate(-50%, 20px);
  background: var(--ink); color: #fff; font-size: 13px; font-weight: 700;
  padding: 12px 20px; border-radius: 999px; z-index: 200; opacity: 0;
  pointer-events: none; transition: all .25s ease; max-width: 90%; text-align: center;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* 紙吹雪（遊び心） */
.confetti { position: fixed; top: -12px; z-index: 300; font-size: 20px; pointer-events: none; animation: fall 2.4s ease-in forwards; }
@keyframes fall {
  to { transform: translateY(105vh) rotate(540deg); opacity: .2; }
}

@media (min-width: 500px) {
  body { padding: 0; }
}
