/* ============================================================
   広告買取センター — スタイル
   考え方: 白を基調に余白を広く、1画面1目的。行動導線（CTA）は
           朱赤の全幅ボタンで一つだけ強く見せる。
   ============================================================ */

:root {
  color-scheme: light;

  /* 面 */
  --bg:            #f7f6f4;   /* ページ地。わずかに暖かい灰 */
  --surface:       #ffffff;
  --surface-2:     #faf9f7;
  --surface-3:     #f0efec;
  --line:          #ebeae7;
  --line-strong:   #d9d7d2;

  /* 文字 */
  --ink:           #1a1a1c;
  --ink-2:         #6b6b70;
  --ink-3:         #9a9a9f;

  /* 行動（CTA） */
  --accent:        #ea3a2e;
  --accent-hover:  #cf2c21;
  --accent-on:     #ffffff;
  --accent-soft:   #fdeeec;
  --accent-line:   #f6c9c4;

  /* 判定＝状態色。CTAとは「形」で区別する（淡い背景＋濃い文字のチップ） */
  --sev-fraud:     #d93a32;
  --sev-fraud-ink: #b3261e;
  --sev-fraud-bg:  #fdecea;
  --sev-imp:       #d99000;
  --sev-imp-ink:   #8a5a00;
  --sev-imp-bg:    #fff3dc;
  --sev-ok:        #2a8a4a;
  --sev-ok-ink:    #1e6b34;
  --sev-ok-bg:     #edf6ee;
  --sev-idle:      #9a9a9f;
  --sev-idle-ink:  #6b6b70;
  --sev-idle-bg:   #f0efec;

  /* チャート
     行動を促す朱赤はCTA専用にするため、量を表す棒や線は黒鉛の濃淡で描く。
     判定の色（詐欺・なりすまし・通常）だけが意味を持つ色として残る。 */
  --series-1:      #2f2f34;
  --series-2:      #eb6834;
  --series-3:      #1baf7a;
  --grid:          #f0efec;
  --ramp-1:        #2f2f34;
  --ramp-2:        #4a4a52;
  --ramp-3:        #66666f;
  --ramp-4:        #85858e;
  --ramp-5:        #a4a4ac;
  --ramp-6:        #c2c2c8;

  /* 形 */
  --r-sm: 6px; --r-md: 8px; --r-lg: 12px; --r-xl: 16px;
  --shadow-1: none;
  --shadow-2: 0 4px 20px rgba(26,26,28,.10);
  --shadow-3: 0 18px 48px rgba(26,26,28,.20);

  --font-ui: "Zen Kaku Gothic New", "Hiragino Kaku Gothic ProN", "Yu Gothic UI", Meiryo, system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", "SFMono-Regular", Menlo, Consolas, monospace;

  --sidebar-w: 236px;
  --header-h: 56px;
  --tabbar-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg:          #121213;
    --surface:     #1b1b1d;
    --surface-2:   #202022;
    --surface-3:   #27272a;
    --line:        #2c2c2f;
    --line-strong: #3d3d41;

    --ink:         #f2f1ef;
    --ink-2:       #adadb2;
    --ink-3:       #7c7c81;

    --accent:      #ff5a4d;
    --accent-hover:#ff7568;
    --accent-on:   #1a1a1c;
    --accent-soft: #2e1a18;
    --accent-line: #4a2621;

    --sev-fraud:     #e5615a;
    --sev-fraud-ink: #f0928c;
    --sev-fraud-bg:  #2e1a18;
    --sev-imp:       #d99000;
    --sev-imp-ink:   #e0a94a;
    --sev-imp-bg:    #2b2110;
    --sev-ok:        #3f9e5d;
    --sev-ok-ink:    #74c78d;
    --sev-ok-bg:     #16261b;
    --sev-idle:      #6b6b70;
    --sev-idle-ink:  #adadb2;
    --sev-idle-bg:   #27272a;

    --series-1:    #e6e6ea;
    --series-2:    #d95926;
    --series-3:    #199e70;
    --grid:        #27272a;
    --ramp-1:      #e6e6ea;
    --ramp-2:      #c8c8d0;
    --ramp-3:      #aaaab3;
    --ramp-4:      #8c8c96;
    --ramp-5:      #6e6e79;
    --ramp-6:      #55555f;

    --shadow-2: 0 4px 20px rgba(0,0,0,.5);
    --shadow-3: 0 18px 48px rgba(0,0,0,.6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg:          #121213;
  --surface:     #1b1b1d;
  --surface-2:   #202022;
  --surface-3:   #27272a;
  --line:        #2c2c2f;
  --line-strong: #3d3d41;

  --ink:         #f2f1ef;
  --ink-2:       #adadb2;
  --ink-3:       #7c7c81;

  --accent:      #ff5a4d;
  --accent-hover:#ff7568;
  --accent-on:   #1a1a1c;
  --accent-soft: #2e1a18;
  --accent-line: #4a2621;

  --sev-fraud:     #e5615a;
  --sev-fraud-ink: #f0928c;
  --sev-fraud-bg:  #2e1a18;
  --sev-imp:       #d99000;
  --sev-imp-ink:   #e0a94a;
  --sev-imp-bg:    #2b2110;
  --sev-ok:        #3f9e5d;
  --sev-ok-ink:    #74c78d;
  --sev-ok-bg:     #16261b;
  --sev-idle:      #6b6b70;
  --sev-idle-ink:  #adadb2;
  --sev-idle-bg:   #27272a;

  --series-1:    #e6e6ea;
  --series-2:    #d95926;
  --series-3:    #199e70;
  --grid:        #27272a;
  --ramp-1:      #e6e6ea;
  --ramp-2:      #c8c8d0;
  --ramp-3:      #aaaab3;
  --ramp-4:      #8c8c96;
  --ramp-5:      #6e6e79;
  --ramp-6:      #55555f;

  --shadow-2: 0 4px 20px rgba(0,0,0,.5);
  --shadow-3: 0 18px 48px rgba(0,0,0,.6);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-size-adjust: 100%;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.4; text-wrap: balance; }
p { margin: 0; }
a { color: var(--ink); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.num { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---------- アプリシェル ---------- */
.shell { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100dvh; }

.topbar {
  grid-column: 1 / -1;
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; gap: 14px;
  height: var(--header-h); padding: 0 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; align-items: center; gap: 9px; min-width: 0; }
.brand__mark { width: 28px; height: 28px; flex: none; }
.brand__name { font-weight: 900; font-size: 15px; letter-spacing: .01em; white-space: nowrap; }
.brand__sub { display: none; }
.topbar__spacer { flex: 1 1 auto; }
.topbar__who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar__name { font-size: 12.5px; color: var(--ink-2); max-width: 160px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.iconbtn {
  display: inline-grid; place-items: center; width: 36px; height: 36px;
  border: 0; border-radius: 50%;
  background: transparent; color: var(--ink-2); cursor: pointer;
}
.iconbtn:hover { background: var(--surface-3); color: var(--ink); }

/* ---------- サイドナビ（PC） ---------- */
.sidebar {
  position: sticky; top: var(--header-h); align-self: start;
  height: calc(100dvh - var(--header-h));
  padding: 14px 10px; border-right: 1px solid var(--line);
  background: var(--surface);
  display: flex; flex-direction: column; gap: 2px; overflow-y: auto;
}
.nav__label {
  font-size: 11px; letter-spacing: .04em; color: var(--ink-3);
  padding: 14px 12px 6px; font-weight: 700;
}
.nav__item {
  display: flex; align-items: center; gap: 11px;
  padding: 10px 12px; border-radius: var(--r-md);
  color: var(--ink-2); font-weight: 500; font-size: 14px;
  cursor: pointer; border: 0; background: none; width: 100%; text-align: left;
}
.nav__item:hover { background: var(--surface-3); color: var(--ink); text-decoration: none; }
.nav__item[aria-current="page"] { background: var(--surface-3); color: var(--ink); font-weight: 700; }
.nav__item svg { flex: none; }
.nav__badge {
  margin-left: auto; font-size: 11px; font-weight: 700;
  background: var(--accent); color: var(--accent-on);
  min-width: 20px; text-align: center; padding: 1px 6px; border-radius: 999px;
}
.sidebar__foot { margin-top: auto; padding: 14px 12px 0; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 11.5px; }
.sidebar__foot a { color: var(--ink-3); text-decoration: underline; }

/* ---------- 下部タブバー（モバイル） ---------- */
.tabbar { display: none; }

/* ---------- メイン ---------- */
.main { padding: 24px 28px 72px; min-width: 0; }
.page { max-width: 1080px; margin: 0 auto; display: flex; flex-direction: column; gap: 18px; }
.page--narrow { max-width: 680px; }
.page__head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; }
.page__title { font-size: 22px; font-weight: 900; letter-spacing: .01em; }
.page__lead { color: var(--ink-2); font-size: 13.5px; margin-top: 4px; }
.page__actions { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }

/* ---------- カード ---------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg);
}
.card__head {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 18px 12px;
}
.card__title { font-size: 15px; font-weight: 700; }
.card__hint { font-size: 12px; color: var(--ink-3); }
.card__actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.card__body { padding: 0 18px 18px; }
.card__head + .card__body { padding-top: 0; }
.card__body--flush { padding: 0; }
.card:not(:has(.card__head)) > .card__body { padding: 18px; }

.grid { display: grid; gap: 14px; }
.grid--kpi { grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.grid--2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid--cards { grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); }

/* ---------- 数値タイル ---------- */
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.kpi__label { font-size: 12.5px; color: var(--ink-2); display: flex; align-items: center; gap: 6px; }
.kpi__value { font-size: 26px; font-weight: 900; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.kpi__value small { font-size: 13px; color: var(--ink-2); font-weight: 700; margin-left: 3px; }
.kpi__foot { font-size: 11.5px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; }
.delta { font-size: 11.5px; font-weight: 700; padding: 1px 6px; border-radius: 999px; }
.delta--up { background: var(--sev-fraud-bg); color: var(--sev-fraud-ink); }
.delta--down { background: var(--sev-ok-bg); color: var(--sev-ok-ink); }
.delta--flat { background: var(--sev-idle-bg); color: var(--sev-idle-ink); }

/* ---------- バッジ ---------- */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700;
  white-space: nowrap; line-height: 1.6;
}
.pill svg { flex: none; }
.pill--fraud { background: var(--sev-fraud-bg); color: var(--sev-fraud-ink); }
.pill--imp   { background: var(--sev-imp-bg);   color: var(--sev-imp-ink); }
.pill--ok    { background: var(--sev-ok-bg);    color: var(--sev-ok-ink); }
.pill--idle  { background: var(--sev-idle-bg);  color: var(--sev-idle-ink); }
.pill--accent{ background: var(--accent-soft);  color: var(--accent); }
.pill--outline { background: transparent; border: 1px solid var(--line-strong); color: var(--ink-2); font-weight: 600; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11.5px; padding: 3px 9px; border-radius: 999px;
  background: var(--surface-3); color: var(--ink-2);
}
.tag--mono { font-family: var(--font-mono); }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 40px; padding: 0 18px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong);
  font-weight: 700; font-size: 14px; cursor: pointer;
  background: var(--surface); color: var(--ink); white-space: nowrap;
  transition: background .12s ease, border-color .12s ease;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--primary {
  background: var(--accent); color: var(--accent-on); border-color: var(--accent);
  box-shadow: 0 1px 0 rgba(0,0,0,.04);
}
.btn--primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn--ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn--ghost:hover { background: var(--surface-3); color: var(--ink); }
.btn--danger { background: transparent; color: var(--sev-fraud-ink); border-color: var(--accent-line); }
.btn--danger:hover { background: var(--accent-soft); }
.btn--lg { min-height: 52px; font-size: 16px; padding: 0 24px; border-radius: var(--r-md); }
.btn--block { width: 100%; }
.btn--sm { min-height: 32px; padding: 0 12px; font-size: 12.5px; }

/* 画面下部に貼り付く主要CTA（長いフォームでも押せるように） */
.stickycta {
  position: sticky; bottom: 12px; z-index: 20;
  padding: 14px 0 4px;
  background: linear-gradient(to bottom, transparent, var(--bg) 40%);
}

/* ---------- フォーム ---------- */
.field { display: flex; flex-direction: column; gap: 7px; }
.field__label { font-size: 13px; font-weight: 700; display: flex; align-items: center; gap: 6px; }
.field__req { color: var(--accent); font-size: 10.5px; font-weight: 700; }
.field__opt { color: var(--ink-3); font-size: 10.5px; font-weight: 500; }
.field__help { font-size: 12px; color: var(--ink-3); }
.input, .select, .textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink);
  font-size: 15px;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-3); }
.input:focus, .select:focus, .textarea:focus { border-color: var(--ink); outline: none; }
.textarea { min-height: 100px; resize: vertical; line-height: 1.7; }
.select { appearance: none; padding-right: 34px;
  background-image: linear-gradient(45deg, transparent 50%, var(--ink-3) 50%), linear-gradient(135deg, var(--ink-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 52%, calc(100% - 13px) 52%;
  background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; }
/* 外部サービスでのログイン。行動色（朱赤）はCTA専用なので、ここは無彩色の枠線で */
.oauth { margin-top: 20px; display: grid; gap: 10px; }
.oauth__sep { position: relative; text-align: center; margin-bottom: 2px; }
.oauth__sep::before {
  content: ''; position: absolute; top: 50%; left: 0; right: 0; height: 1px; background: var(--line);
}
.oauth__sep span {
  position: relative; background: var(--surface); padding: 0 12px;
  font-size: 12px; color: var(--ink-3);
}
.oauth__notice {
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 13px 15px; background: var(--bg);
  font-size: 12.5px; line-height: 1.85; color: var(--ink-2);
}
.oauth__notice b { color: var(--ink); }
.oauth__notice ul { margin: 7px 0 9px; padding-left: 18px; }
.oauth__notice li { margin-bottom: 5px; }
.oauth__notice p { margin: 0 0 6px; }
.oauth__notice p:last-child { margin-bottom: 0; }
.oauth__notice a { color: var(--ink); text-decoration: underline; }
.oauth__consent { color: var(--ink); font-weight: 700; }

.oauth__btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 48px; padding: 0 16px; border-radius: var(--r-md);
  border: 1px solid var(--line-strong); background: var(--surface);
  color: var(--ink); font-size: 15px; font-weight: 700; text-decoration: none;
}
.oauth__btn:hover { background: var(--bg); text-decoration: none; }
.oauth__btn svg { flex: none; }

/* パスワード欄の表示切り替え */
.inputwrap { position: relative; }
.input--withbtn { padding-right: 46px; }
.revealbtn {
  position: absolute; top: 50%; right: 6px; transform: translateY(-50%);
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 0; background: none; color: var(--ink-3); cursor: pointer; border-radius: var(--r-md);
}
.revealbtn:hover { color: var(--ink); background: var(--bg); }
.revealbtn[aria-pressed="true"] { color: var(--ink); }

.checkline { display: flex; gap: 11px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.checkline input { margin-top: 3px; accent-color: var(--accent); width: 18px; height: 18px; flex: none; }
.checkline a { color: var(--ink); text-decoration: underline; }
.form-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.filters { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.filters .field { min-width: 150px; }
.filters .field--grow { flex: 1 1 220px; }

/* 画像の投稿枠 */
.drop {
  border: 1.5px dashed var(--line-strong); border-radius: var(--r-lg);
  background: var(--surface-2); padding: 32px 20px; text-align: center;
  display: flex; flex-direction: column; align-items: center; gap: 10px; cursor: pointer;
}
.drop:hover, .drop.is-over { border-color: var(--accent); background: var(--accent-soft); }
.drop__icon { color: var(--ink-3); }
.drop__title { font-weight: 700; font-size: 15px; }
.drop__hint { font-size: 12px; color: var(--ink-3); }
.preview { position: relative; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); background: var(--surface-3); }
.preview img { display: block; width: 100%; max-height: 360px; object-fit: contain; background: var(--surface-3); }
.preview__bar { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-top: 1px solid var(--line); font-size: 12.5px; color: var(--ink-2); background: var(--surface); }

/* ---------- テーブル（業務画面） ---------- */
.tablewrap { overflow-x: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.data th {
  text-align: left; font-size: 11.5px; color: var(--ink-3); font-weight: 700;
  padding: 10px 14px; border-bottom: 1px solid var(--line);
  white-space: nowrap; background: var(--surface);
}
table.data td { padding: 12px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:hover { background: var(--surface-2); }
table.data tbody tr.is-clickable { cursor: pointer; }
table.data tbody tr:last-child td { border-bottom: 0; }
.cell-main { font-weight: 700; }
.cell-sub { font-size: 12px; color: var(--ink-3); }
.thumb { width: 46px; height: 32px; border-radius: var(--r-sm); object-fit: cover; border: 1px solid var(--line); background: var(--surface-3); display: block; }
.right { text-align: right; }

/* ---------- 空状態 ---------- */
.empty { padding: 48px 20px; text-align: center; color: var(--ink-3); display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty__title { font-weight: 700; color: var(--ink); font-size: 15px; }

/* ---------- 判定の演出 ---------- */
.scan { display: flex; flex-direction: column; gap: 16px; padding: 6px 0; }
.scan__step { display: flex; align-items: center; gap: 12px; color: var(--ink-3); font-size: 14px; }
.scan__step[data-state="run"] { color: var(--ink); font-weight: 700; }
.scan__step[data-state="done"] { color: var(--ink-2); }
.scan__dot { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; flex: none; }
.scan__step[data-state="run"] .scan__dot { border-color: var(--accent); border-top-color: transparent; animation: spin .7s linear infinite; }
.scan__step[data-state="done"] .scan__dot { border-color: var(--sev-ok); background: var(--sev-ok); color: #fff; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .scan__step[data-state="run"] .scan__dot { animation: none; }
  * { scroll-behavior: auto !important; }
}

.verdict { display: flex; flex-direction: column; gap: 18px; }
.verdict__head { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.verdict__icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; flex: none; }
.verdict__icon--fraud { background: var(--sev-fraud-bg); color: var(--sev-fraud-ink); }
.verdict__icon--imp { background: var(--sev-imp-bg); color: var(--sev-imp-ink); }
.verdict__icon--ok { background: var(--sev-ok-bg); color: var(--sev-ok-ink); }
.verdict__label { font-size: 21px; font-weight: 900; }
.verdict__sub { font-size: 13px; color: var(--ink-2); }

.meter { height: 8px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }
.meter__fill { height: 100%; border-radius: 999px; }

/* 獲得ポイントの表示。金額のように大きく見せる */
.reward {
  display: flex; align-items: center; gap: 14px; padding: 18px;
  border-radius: var(--r-lg); background: var(--surface-2); border: 1px solid var(--line);
}
.reward__pt { font-size: 34px; font-weight: 900; color: var(--accent); line-height: 1.1; letter-spacing: -.02em; }

/* ---------- ポイント ---------- */
.balance { display: flex; align-items: baseline; gap: 8px; }
.balance__v { font-size: 46px; font-weight: 900; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.balance__u { font-size: 15px; color: var(--ink-2); font-weight: 700; }
.progressline { display: flex; justify-content: space-between; font-size: 12px; color: var(--ink-3); }

.giftgrid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); }
.gift { text-align: left; padding: 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 4px; }
.gift:hover:not(:disabled) { border-color: var(--ink); }
.gift:disabled { opacity: .45; cursor: not-allowed; }
.gift__brand { font-size: 12.5px; color: var(--ink-2); font-weight: 700; }
.gift__amt { font-size: 22px; font-weight: 900; letter-spacing: -.01em; }
.gift__cost { font-size: 12px; color: var(--ink-3); }

/* ---------- タイムライン ---------- */
.timeline { display: flex; flex-direction: column; }
.tl { display: grid; grid-template-columns: 18px 1fr; gap: 12px; padding-bottom: 18px; position: relative; }
.tl:not(:last-child)::before { content: ""; position: absolute; left: 8px; top: 18px; bottom: 0; width: 1.5px; background: var(--line); }
.tl__dot { width: 18px; height: 18px; border-radius: 50%; background: var(--surface); border: 2px solid var(--line-strong); z-index: 1; }
.tl__dot--active { border-color: var(--accent); background: var(--accent); }
.tl__body { font-size: 13px; }
.tl__t { font-weight: 700; font-size: 14px; display: block; }
.tl__m { color: var(--ink-3); font-size: 12px; }

/* ---------- 証拠カード ---------- */
.evidence { display: flex; flex-direction: column; overflow: hidden; }
.evidence__shot { aspect-ratio: 16/10; background: var(--surface-3); border-bottom: 1px solid var(--line); }
.evidence__shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.evidence__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.evidence__meta { font-size: 12px; color: var(--ink-3); display: flex; flex-direction: column; gap: 2px; word-break: break-all; }
.evidence__foot { display: flex; gap: 8px; padding: 12px 14px; border-top: 1px solid var(--line); }

/* ---------- ドロワー / モーダル ---------- */
.scrim { position: fixed; inset: 0; background: rgba(20,20,22,.45); z-index: 60; animation: fade .16s ease; }
@keyframes fade { from { opacity: 0 } }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(560px, 100%);
  background: var(--surface); box-shadow: var(--shadow-3);
  z-index: 61; display: flex; flex-direction: column; animation: slide .2s ease;
}
@keyframes slide { from { transform: translateX(24px); opacity: .4 } }
.modal {
  position: fixed; z-index: 61; top: 50%; left: 50%; transform: translate(-50%,-50%);
  width: min(680px, calc(100vw - 24px)); max-height: calc(100dvh - 48px);
  background: var(--surface); border-radius: var(--r-xl);
  box-shadow: var(--shadow-3); display: flex; flex-direction: column; animation: pop .18s ease;
}
@keyframes pop { from { transform: translate(-50%,-48%) scale(.98); opacity: 0 } }
.sheet__head { display: flex; align-items: center; gap: 12px; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.sheet__title { font-size: 16px; font-weight: 700; }
.sheet__body { padding: 20px; overflow-y: auto; flex: 1; display: flex; flex-direction: column; gap: 18px; }
.sheet__foot { padding: 14px 20px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }

.deflist { display: grid; grid-template-columns: 110px 1fr; gap: 10px 14px; font-size: 13px; align-items: baseline; }
.deflist dt { color: var(--ink-3); }
.deflist dd { margin: 0; word-break: break-all; }

pre.code {
  margin: 0; padding: 14px; background: var(--surface-2); border-radius: var(--r-md);
  font-family: var(--font-mono); font-size: 12px; line-height: 1.8; color: var(--ink-2);
  border: 1px solid var(--line); min-width: 0; max-width: 100%;
  white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
}

/* ---------- トースト ---------- */
#toast-root {
  position: fixed; z-index: 80; bottom: calc(24px + env(safe-area-inset-bottom)); left: 50%;
  transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none;
}
.toast {
  background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 999px;
  font-size: 13.5px; font-weight: 700; box-shadow: var(--shadow-2); animation: pop .18s ease;
  display: flex; align-items: center; gap: 8px; max-width: min(92vw, 420px);
}

/* ---------- チャート ---------- */
.chart { position: relative; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart text { font-family: var(--font-ui); fill: var(--ink-3); font-size: 10.5px; }
.chart .axis-line { stroke: var(--line); stroke-width: 1; }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--ink-2); }
.legend__i { display: inline-flex; align-items: center; gap: 6px; }
.legend__sw { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.tooltip {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
  box-shadow: var(--shadow-2); padding: 8px 11px; font-size: 12px; min-width: 130px;
  transform: translate(-50%, -100%); white-space: nowrap;
}
.tooltip__t { font-weight: 700; margin-bottom: 4px; font-size: 11.5px; }
.tooltip__r { display: flex; align-items: center; gap: 7px; justify-content: space-between; }
.tooltip__r b { font-variant-numeric: tabular-nums; }
.chart-toggle { display: flex; gap: 2px; padding: 3px; background: var(--surface-3); border-radius: 999px; }
.chart-toggle button { border: 0; background: transparent; padding: 4px 12px; border-radius: 999px; font-size: 12px; cursor: pointer; color: var(--ink-3); font-weight: 600; }
.chart-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); font-weight: 700; }

/* ---------- 補足の帯 ---------- */
.banner {
  display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px;
  border-radius: var(--r-lg); font-size: 13px; line-height: 1.7;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--ink-2);
}
.banner--info { background: var(--surface-2); border-color: var(--line); }
.banner--warn { background: var(--sev-imp-bg); border-color: transparent; color: var(--ink-2); }
.banner b { color: var(--ink); }
.banner a { text-decoration: underline; }
.banner svg { flex: none; margin-top: 2px; }

/* ---------- ホームの主役ブロック ---------- */
.hero {
  border-radius: var(--r-xl); padding: 22px;
  background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: 18px;
}
.hero__label { font-size: 13px; color: var(--ink-2); font-weight: 700; }
.steps { display: flex; flex-direction: column; gap: 14px; counter-reset: s; }
.step { display: flex; gap: 12px; align-items: flex-start; font-size: 13px; color: var(--ink-2); }
.step__n {
  counter-increment: s; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); display: grid; place-items: center;
  font-size: 12px; font-weight: 900;
}
.step__n::before { content: counter(s); }
.step b { color: var(--ink); display: block; font-size: 14px; }

/* ---------- 行リスト ---------- */
.rowlist { display: flex; flex-direction: column; }
.rowlist__i {
  display: flex; align-items: center; gap: 12px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); cursor: pointer; text-align: left;
  background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%;
}
.rowlist__i:last-child { border-bottom: 0; }
.rowlist__i:hover { background: var(--surface-2); }
.rowlist__main { min-width: 0; flex: 1; }
.rowlist__t { font-weight: 700; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.rowlist__s { font-size: 12px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

.split { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.split--feature { flex-wrap: nowrap; align-items: flex-start; }
.split--feature > div { flex: 1; min-width: 0; }
.muted { color: var(--ink-3); }
.strong { color: var(--ink); font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- 認証画面 ---------- */
.authwrap { min-height: 100dvh; display: grid; place-items: center; padding: 32px 16px; background: var(--surface); }
.authcard { width: min(400px, 100%); display: flex; flex-direction: column; gap: 20px; }
.authcard--wide { width: min(520px, 100%); }
.authhead { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.authhead .brand__mark { width: 48px; height: 48px; }
.authtitle { font-size: 22px; font-weight: 900; }
.authlead { font-size: 13px; color: var(--ink-2); }
.authform { display: flex; flex-direction: column; gap: 16px; }
.authlinks { display: flex; justify-content: center; gap: 20px; font-size: 13px; flex-wrap: wrap; }
.authlinks a { color: var(--ink-2); text-decoration: underline; }
.field__error { font-size: 12px; color: var(--sev-fraud-ink); font-weight: 700; }
.input.is-error { border-color: var(--accent); }

.demo-accounts { border-top: 1px solid var(--line); padding-top: 16px; }
.demo-accounts summary { font-size: 12.5px; color: var(--ink-2); cursor: pointer; list-style: none; display: flex; align-items: center; gap: 6px; }
.demo-accounts summary::-webkit-details-marker { display: none; }
.demo-accounts summary::before { content: "＋"; color: var(--ink-3); font-size: 11px; }
.demo-accounts[open] summary::before { content: "−"; }
.demo-accounts__list { display: flex; flex-direction: column; gap: 8px; margin-top: 12px; }
.demo-btn {
  display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: var(--r-md);
  border: 1px solid var(--line); background: var(--surface); cursor: pointer; text-align: left; font-size: 12.5px;
}
.demo-btn:hover { border-color: var(--ink); }
.demo-btn b { font-weight: 700; white-space: nowrap; min-width: 64px; }
.demo-btn i { font-style: normal; color: var(--ink-3); }
.demo-btn span { color: var(--ink-3); margin-left: auto; font-family: var(--font-mono); font-size: 11px; }

/* ---------- レスポンシブ ---------- */
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  /* サイドナビは下部タブバーに置き換える */
  .sidebar { display: none; }
  .main { padding: 16px 16px calc(24px + var(--tabbar-h) + env(safe-area-inset-bottom)); }
  .page { gap: 16px; }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar__i {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    height: var(--tabbar-h); color: var(--ink-3); font-size: 10.5px; font-weight: 700;
    text-decoration: none; position: relative;
  }
  .tabbar__i:hover { text-decoration: none; }
  .tabbar__i[aria-current="page"] { color: var(--accent); }
  .tabbar__badge {
    position: absolute; top: 8px; left: 50%; margin-left: 4px;
    background: var(--accent); color: var(--accent-on); font-size: 10px; font-weight: 700;
    min-width: 16px; padding: 0 4px; border-radius: 999px; line-height: 16px; text-align: center;
  }

  /* タブバーに隠れないよう、貼り付くCTAはその上に置く */
  .stickycta { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px); }
  .topbar { padding: 0 16px; gap: 10px; }
  .page__title { font-size: 20px; }
  .deflist { grid-template-columns: 92px 1fr; }
  .grid--kpi { grid-template-columns: 1fr 1fr; }
  .kpi__value { font-size: 22px; }
  .balance__v { font-size: 40px; }
}
@media (max-width: 560px) {
  .topbar__name { display: none; }
  .brand__name { font-size: 14px; }
  .modal { width: calc(100vw - 16px); }
  .drawer { width: 100%; }
  .giftgrid { grid-template-columns: 1fr 1fr; }
  .page__actions { margin-left: 0; width: 100%; }
  .page__actions .field { flex: 1 1 140px; }
}
@media print {
  .topbar, .sidebar, .tabbar, .page__actions, .btn { display: none !important; }
  body { background: #fff; }
  .card { break-inside: avoid; }
}
