/* ============================================================
   メール配信アプリ 見た目の決まりごと（第3版）
   参考：shadcn/ui のダッシュボード見本、Plausible の公開デモ（調査メモ：デザイン調査_2026-10-18.md）
   - 外部のフォントやスクリプトは読み込まない（CSPで禁止）
   - アクセント色は利用者ごとに /theme.css で上書きする
   - 赤は「手を打つ必要があるとき」だけ使う
   ============================================================ */
:root {
  --accent: #2f6fde;
  --accent-strong: #2659b6;
  --accent-weak: #dfe9fb;
  --accent-faint: #f0f5fd;

  --bg: #f7f7f8;
  --side: #f0f0f2;
  --surface: #ffffff;
  --surface-sub: #f4f4f5;
  --line: #e4e4e7;
  --line-strong: #d4d4d8;

  --text: #18181b;
  --text-sub: #52525b;
  --text-faint: #a1a1aa;

  --ok: #15803d;       --ok-bg: #ecfdf3;      --ok-line: #bbf7d0;
  --warn: #a16207;     --warn-bg: #fefce8;    --warn-line: #fde68a;
  --danger: #b42318;   --danger-bg: #fef3f2;  --danger-line: #fecdca;

  --radius: 8px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(24, 24, 27, .05);
  --shadow: 0 1px 3px rgba(24, 24, 27, .06), 0 1px 2px rgba(24, 24, 27, .04);
  --sidebar: 268px;
  --font: system-ui, -apple-system, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic UI", Meiryo, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--font); font-size: 16px; line-height: 1.75;
  color: var(--text); background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.35; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 1.9rem; font-weight: 750; }
h2 { font-size: 1.15rem; font-weight: 700; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 .6rem; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code, .mono { font-family: var(--mono); font-size: 1em; }
.num, .tnum, .stat-value, table.list td.num { font-variant-numeric: tabular-nums; }
small, .small { font-size: .9375rem; }
.sub { color: var(--text-sub); }
.faint { color: var(--text-faint); }
.nowrap { white-space: nowrap; }
.mt-s { margin-top: .6rem; } .mt-1 { margin-top: 1rem; } .mt-l { margin-top: 1.5rem; } .mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); border: 0; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.icon { width: 1.1em; height: 1.1em; flex: none; vertical-align: -.18em; }

/* ---------- ボタン ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
  min-height: 38px; padding: .45rem .95rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-sm);
  font: inherit; font-weight: 600; font-size: .9375rem; line-height: 1.2;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .12s, border-color .12s;
}
.btn:hover { background: var(--surface-sub); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-dark { background: var(--text); border-color: var(--text); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-danger { color: var(--danger); border-color: var(--danger-line); }
.btn-danger:hover { background: var(--danger-bg); }
.btn-danger-solid { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-danger-solid:hover { background: #912018; }
.btn-ghost { border-color: transparent; background: transparent; box-shadow: none; color: var(--text-sub); }
.btn-ghost:hover { background: var(--surface-sub); color: var(--text); }
.btn-sm { min-height: 32px; padding: .3rem .7rem; font-size: .9375rem; }
.btn-block { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-row { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.inline { display: inline; }

/* ---------- 札（状態・増減） ---------- */
.badge {
  display: inline-flex; align-items: center; gap: .35rem;
  padding: .08rem .55rem; border: 1px solid var(--line); border-radius: 999px;
  font-size: .9375rem; font-weight: 600; line-height: 1.6; white-space: nowrap;
  background: var(--surface); color: var(--text-sub);
}
.badge::before { content: ""; width: .45rem; height: .45rem; border-radius: 50%; background: var(--text-faint); }
.badge.no-dot::before { display: none; }
.badge-ok { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.badge-ok::before { background: #22c55e; }
.badge-warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-bg); }
.badge-warn::before { background: #eab308; }
.badge-danger { color: var(--danger); border-color: var(--danger-line); background: var(--danger-bg); }
.badge-danger::before { background: #ef4444; }
.badge-accent { color: var(--accent-strong); border-color: var(--accent-weak); background: var(--accent-faint); }
.badge-accent::before { background: var(--accent); }
.trend { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .45rem; border: 1px solid var(--line); border-radius: 6px; font-size: .9375rem; font-weight: 650; color: var(--text-sub); background: var(--surface); white-space: nowrap; font-variant-numeric: tabular-nums; }
.trend.up { color: var(--ok); border-color: var(--ok-line); background: var(--ok-bg); }
.tag { display: inline-flex; align-items: center; gap: .25rem; padding: .05rem .5rem; border-radius: 6px; background: var(--surface-sub); color: var(--text-sub); font-size: .9375rem; font-weight: 600; }

/* ---------- お知らせ ---------- */
.notice { display: flex; gap: .65rem; align-items: flex-start; padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); margin-bottom: 1rem; box-shadow: var(--shadow-sm); }
.notice .icon { margin-top: .2em; }
.notice p { margin: 0; }
.notice ul { margin: .3rem 0 0; padding-left: 1.2rem; }
.notice-good { background: var(--accent-faint); border-color: var(--accent-weak); }
.notice-good .icon { color: var(--accent); }
.notice-ok { background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }
.notice-warn { background: var(--warn-bg); border-color: var(--warn-line); color: var(--warn); }
.notice-danger { background: var(--danger-bg); border-color: var(--danger-line); color: var(--danger); }

/* ---------- カード ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.15rem 1.25rem; box-shadow: var(--shadow); }
.card.flush { padding: 0; overflow: hidden; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .8rem; margin-bottom: .9rem; }
.card-head h2 { display: flex; align-items: center; gap: .45rem; }
.card-head p { margin: .15rem 0 0; color: var(--text-sub); font-size: .9375rem; }
.card-foot { border-top: 1px solid var(--line); margin: 1rem -1.25rem -1.15rem; padding: .7rem 1.25rem; font-size: .9375rem; color: var(--text-sub); background: #fcfcfc; border-radius: 0 0 var(--radius-lg) var(--radius-lg); }
.grid { display: grid; gap: 1rem; }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-2 { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); }
.grid-even { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.stack > * + * { margin-top: 1rem; }

/* 数字カード（右上に増減の札、大きな数字、説明） */
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1rem 1.15rem; box-shadow: var(--shadow); display: flex; flex-direction: column; }
.stat-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.stat-label { color: var(--text-sub); font-size: .9375rem; margin: 0; }
.stat-value { font-size: 2.35rem; font-weight: 750; margin: .35rem 0 .1rem; line-height: 1.15; letter-spacing: -.02em; }
.stat-value small { font-size: 1rem; font-weight: 650; color: var(--text-sub); margin-left: .15rem; letter-spacing: 0; }
.stat-line { font-size: .9375rem; font-weight: 600; margin: .4rem 0 0; display: flex; align-items: center; gap: .3rem; }
.stat-note { font-size: .9375rem; color: var(--text-sub); margin: .05rem 0 0; }
.stat-note.is-warn, .stat-line.is-warn { color: var(--warn); }

/* ---------- グラフ ---------- */
.chart-card .card-head { margin-bottom: .4rem; }
.chart { width: 100%; height: 200px; display: block; overflow: visible; }
.chart .grid-line { stroke: var(--line); stroke-width: 1; stroke-dasharray: 3 4; }
.chart .area { fill: var(--accent); opacity: .12; }
.chart .line { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .dot { fill: var(--surface); stroke: var(--accent); stroke-width: 2; }
.chart .hit { fill: transparent; }
.chart .hit:hover { fill: var(--accent); opacity: .06; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.seg a { white-space: nowrap; padding: .3rem .7rem; font-size: .9375rem; font-weight: 600; color: var(--text-sub); border-left: 1px solid var(--line); }
.seg a:first-child { border-left: 0; }
.seg a:hover { background: var(--surface-sub); text-decoration: none; }
.seg a.is-on { background: var(--surface-sub); color: var(--text); }
.metric-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 0; border-bottom: 1px solid var(--line); margin: -1.15rem -1.25rem 1rem; }
.metric-strip div { padding: .8rem 1.25rem; border-right: 1px solid var(--line); }
.metric-strip div:last-child { border-right: 0; }
.metric-strip span { display: block; font-size: .9375rem; color: var(--text-sub); font-weight: 600; }
.metric-strip strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }

/* ランキング（行の後ろに帯） */
.rank { list-style: none; margin: 0; padding: 0; }
.rank-head { display: flex; justify-content: space-between; font-size: .9375rem; font-weight: 600; color: var(--text-sub); padding: 0 .1rem .35rem; }
.rank li { position: relative; display: flex; justify-content: space-between; gap: .8rem; padding: .42rem .6rem; margin-bottom: 3px; font-size: .9375rem; }
.rank li > span { position: relative; z-index: 1; }
.rank li > span:first-of-type { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank .bar { position: absolute; inset: 0 auto 0 0; z-index: 0; border-radius: 6px; background: var(--accent-faint); }
.rank li.is-top .bar { background: var(--accent-weak); }
.bar.w0 { width: 0; } .bar.w5 { width: 5%; } .bar.w10 { width: 10%; } .bar.w15 { width: 15%; } .bar.w20 { width: 20%; } .bar.w25 { width: 25%; }
.bar.w30 { width: 30%; } .bar.w35 { width: 35%; } .bar.w40 { width: 40%; } .bar.w45 { width: 45%; } .bar.w50 { width: 50%; } .bar.w55 { width: 55%; }
.bar.w60 { width: 60%; } .bar.w65 { width: 65%; } .bar.w70 { width: 70%; } .bar.w75 { width: 75%; } .bar.w80 { width: 80%; } .bar.w85 { width: 85%; }
.bar.w90 { width: 90%; } .bar.w95 { width: 95%; } .bar.w100 { width: 100%; }

/* ---------- 一覧 ---------- */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li { display: flex; gap: .55rem; align-items: flex-start; padding: .55rem 0; border-bottom: 1px solid var(--line); }
.checklist li:last-child { border-bottom: 0; }
.checklist .icon { color: var(--text-faint); margin-top: .25em; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: .45rem 1.2rem; margin: 0; font-size: .9375rem; }
.kv dt { color: var(--text-sub); }
.kv dd { margin: 0; font-variant-numeric: tabular-nums; }

/* ---------- 表 ---------- */
.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow-x: auto; box-shadow: var(--shadow); }
.table-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; border-bottom: 1px solid var(--line); }
table.list { width: 100%; border-collapse: collapse; }
table.list th, table.list td { padding: .7rem 1rem; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.list th { font-size: .9375rem; color: var(--text-sub); font-weight: 600; background: #fafafa; white-space: nowrap; }
table.list tbody tr:hover { background: #fafafa; }
table.list tr:last-child td { border-bottom: 0; }
table.list td.num, table.list th.num { text-align: right; white-space: nowrap; }
table.list a.row-link { color: var(--text); font-weight: 600; }
.who { display: flex; align-items: center; gap: .65rem; min-width: 0; }
.who > span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.avatar { width: 2rem; height: 2rem; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center; font-size: .9375rem; font-weight: 700; color: var(--accent-strong); background: var(--accent-weak); text-transform: uppercase; }

/* 切り替えタブ（下線） */
.tabs { display: flex; flex-wrap: wrap; gap: .2rem 1.2rem; border-bottom: 1px solid var(--line); margin-bottom: 1rem; }
.tabs a { padding: .45rem 0; margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-sub); font-weight: 600; font-size: .9375rem; }
.tabs a:hover { color: var(--text); text-decoration: none; }
.tabs a.is-on { color: var(--text); border-bottom-color: var(--text); }
.tabs .count { margin-left: .3rem; padding: 0 .4rem; border-radius: 999px; background: var(--surface-sub); font-size: .9375rem; color: var(--text-sub); }

/* ---------- 空のとき ---------- */
.empty { text-align: center; padding: 2.6rem 1rem; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 3rem; height: 3rem; border-radius: 12px; background: var(--accent-faint); color: var(--accent); }
.empty-icon .icon { width: 1.5rem; height: 1.5rem; }
.empty h2 { margin: .8rem 0 .3rem; }
.empty p { color: var(--text-sub); max-width: 30rem; margin-left: auto; margin-right: auto; }
.empty .btn-row { justify-content: center; }

/* ---------- 入力 ---------- */
.field { margin-bottom: 1rem; }
.field label, .label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .3rem; }
.field .help { color: var(--text-sub); font-size: .9375rem; margin: .3rem 0 0; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0 1rem; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=datetime-local], input:not([type]), textarea, select {
  width: 100%; min-height: 40px; padding: .5rem .75rem;
  border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface);
}
input[type=file] { font: inherit; font-size: .9375rem; }
textarea { line-height: 1.75; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
input[readonly], textarea[readonly] { background: var(--surface-sub); }
.check { display: flex; gap: .55rem; align-items: flex-start; font-weight: 400; cursor: pointer; }
.check input { width: 1.1rem; height: 1.1rem; margin-top: .3rem; accent-color: var(--accent); flex: none; }
.radio-cards { display: grid; gap: .6rem; }
.radio-card { display: flex; gap: .6rem; align-items: flex-start; padding: .75rem .9rem; border: 1px solid var(--line-strong); border-radius: var(--radius); cursor: pointer; }
.radio-card input { margin-top: .35rem; accent-color: var(--accent); }
.radio-card strong { display: block; font-size: .9375rem; }
.radio-card span { color: var(--text-sub); font-size: .9375rem; }
.counter { float: right; font-weight: 400; font-size: .9375rem; color: var(--text-sub); }
.counter.is-over { color: var(--warn); font-weight: 600; }
.swatches { display: flex; flex-wrap: wrap; gap: .5rem; }
.swatch { display: flex; align-items: center; gap: .4rem; padding: .3rem .7rem .3rem .45rem; border: 1px solid var(--line-strong); border-radius: 999px; cursor: pointer; font-size: .9375rem; }
.swatch input { accent-color: var(--accent); }
.swatch i { width: 1rem; height: 1rem; border-radius: 50%; display: inline-block; }
.c-2f6fde { background: #2f6fde; } .c-0f7a6c { background: #0f7a6c; } .c-6b4fc7 { background: #6b4fc7; }
.c-b4532a { background: #b4532a; } .c-a23b72 { background: #a23b72; } .c-3f4a5a { background: #3f4a5a; }
.code-box { position: relative; }
.code-box pre { margin: 0; padding: .8rem; padding-right: 6.5rem; background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius); font-family: var(--mono); font-size: .9375rem; white-space: pre-wrap; word-break: break-all; }
.code-box .btn { position: absolute; top: .45rem; right: .45rem; }
.hours { display: grid; grid-template-columns: repeat(24, 1fr); gap: 2px; margin-top: .4rem; }
.hours span { height: 10px; border-radius: 2px; background: var(--surface-sub); }
.hours span.on { background: var(--accent); }
.hours-labels { display: flex; justify-content: space-between; font-size: .9375rem; color: var(--text-faint); }
.settings-nav { position: sticky; top: 1rem; display: flex; flex-direction: column; gap: 2px; }
.settings-nav a { padding: .4rem .6rem; border-radius: 6px; color: var(--text-sub); font-size: .9375rem; font-weight: 600; }
.settings-nav a:hover { background: var(--surface-sub); color: var(--text); text-decoration: none; }
.settings-layout { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 1.5rem; align-items: start; }
.section-title { font-size: .9375rem; font-weight: 700; color: var(--text-sub); letter-spacing: .04em; margin: 1.2rem 0 .5rem; }

/* ---------- 管理画面の骨組み ---------- */
.shell { min-height: 100vh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar);
  background: var(--side); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: .9rem .75rem; overflow-y: auto;
}
.workspace { display: flex; align-items: center; gap: .6rem; padding: .55rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-sm); margin-bottom: 1rem; }
.workspace-mark { width: 2rem; height: 2rem; border-radius: 8px; flex: none; display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-weight: 800; font-size: .95rem; }
.workspace-name { font-weight: 700; font-size: .9375rem; line-height: 1.3; min-width: 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.workspace-product { font-size: .9375rem; color: var(--text-sub); line-height: 1.3; }
.nav-group { font-size: .9375rem; font-weight: 700; color: var(--text-faint); letter-spacing: .04em; padding: .9rem .6rem .3rem; }
.nav { display: flex; flex-direction: column; gap: 1px; }
.nav a { display: flex; align-items: center; gap: .6rem; padding: .45rem .6rem; border-radius: var(--radius); color: var(--text-sub); font-weight: 600; font-size: .9375rem; border: 1px solid transparent; }
.nav a .icon { color: var(--text-faint); }
.nav a:hover { background: #e7e7ea; color: var(--text); text-decoration: none; }
.nav a.is-current { background: var(--surface); color: var(--text); border-color: var(--line); box-shadow: var(--shadow-sm); }
.nav a.is-current .icon { color: var(--accent); }
.sidebar-foot { margin-top: auto; padding-top: 1rem; }
.me { display: flex; align-items: center; gap: .55rem; padding: .5rem .6rem; }
.me .avatar { width: 1.8rem; height: 1.8rem; font-size: .9375rem; background: #e4e4e7; color: var(--text-sub); }
.me-mail { font-size: .9375rem; color: var(--text-sub); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.main { margin-left: var(--sidebar); padding: 1.4rem 2.2rem 4rem; max-width: calc(1180px + var(--sidebar)); }
.crumbs { font-size: .9375rem; color: var(--text-faint); margin-bottom: .35rem; display: flex; gap: .4rem; align-items: center; }
.crumbs a { color: var(--text-sub); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: .8rem 1rem; margin-bottom: 1.4rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.page-head p { margin: .3rem 0 0; color: var(--text-sub); }
.page-head > div:first-child { flex: 1 1 20rem; min-width: 0; }
.page-head > .head-actions, .page-head > form, .page-head > a.btn { flex: none; }
.back { display: inline-flex; align-items: center; gap: .2rem; color: var(--text-sub); font-size: .9375rem; margin-bottom: .3rem; }
.mobile-head, .tabbar { display: none; }

/* ---------- ステップメールの流れ ---------- */
.seq-tabs { margin-bottom: 1.2rem; }
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 7.4rem; top: .9rem; bottom: .9rem; width: 2px; background: var(--line); }
.tl-item { display: grid; grid-template-columns: 6.6rem 1.6rem minmax(0, 1fr); align-items: start; padding: .3rem 0; }
.tl-when { text-align: right; padding-top: .95rem; font-size: .9375rem; color: var(--text-sub); font-weight: 650; font-variant-numeric: tabular-nums; }
.tl-dot { position: relative; z-index: 1; width: .85rem; height: .85rem; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--bg); margin: 1.1rem auto 0; }
.tl-item.is-off .tl-dot { background: var(--line-strong); }
.tl-card { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: .8rem 1rem; color: var(--text); box-shadow: var(--shadow); }
a.tl-card:hover { border-color: var(--line-strong); box-shadow: 0 4px 12px rgba(24, 24, 27, .06); text-decoration: none; }
.tl-title { display: flex; justify-content: space-between; gap: .6rem; align-items: baseline; font-weight: 650; }
.tl-num { color: var(--text-faint); font-weight: 700; margin-right: .3rem; font-variant-numeric: tabular-nums; }
.tl-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; font-size: .9375rem; color: var(--text-sub); margin-top: .35rem; font-variant-numeric: tabular-nums; }
.tl-meta b { color: var(--text); font-weight: 650; }
.tl-meta .is-warn, .tl-meta .is-warn b { color: var(--warn); }
.tl-insert { display: grid; grid-template-columns: 6.6rem 1.6rem minmax(0, 1fr); margin: -.1rem 0; }
.tl-insert a { grid-column: 3; justify-self: start; display: inline-flex; align-items: center; gap: .2rem; font-size: .9375rem; font-weight: 600; color: var(--text-faint); padding: .05rem .4rem; border-radius: 6px; }
.tl-insert a:hover { color: var(--accent); background: var(--accent-faint); text-decoration: none; }

/* ---------- 書く画面 ---------- */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 1.5rem; align-items: start; }
/* 本文の書く欄（飾りのボタン付き） */
.rte { border: 1px solid var(--line-strong); border-radius: var(--radius); background: var(--surface); }
.rte:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-weak); }
.rte-bar { display: flex; flex-wrap: wrap; align-items: center; gap: .35rem; padding: .5rem; border-bottom: 1px solid var(--line); background: var(--surface-sub); border-radius: var(--radius) var(--radius) 0 0; position: sticky; top: 0; z-index: 3; }
.rte-btn { display: inline-flex; align-items: center; gap: .3rem; min-height: 2.4rem; padding: .25rem .7rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); color: var(--text); font: inherit; font-size: .9375rem; font-weight: 600; cursor: pointer; }
.rte-btn:hover, .rte-swatch:hover { border-color: var(--accent); background: var(--accent-faint); }
.rte-btn .icon { width: 1rem; height: 1rem; }
.rte-swatch { width: 2.4rem; height: 2.4rem; border: 1px solid var(--line-strong); border-radius: 6px; background: var(--surface); font: inherit; font-size: 1.1rem; font-weight: 800; cursor: pointer; }
.rte-sep { width: 1px; align-self: stretch; background: var(--line-strong); margin: 0 .1rem; }
.rte-label { font-size: .9375rem; color: var(--text-sub); font-weight: 600; }
.rte-area { min-height: 420px; padding: .9rem 1rem; outline: none; position: relative; }
.rte-area.is-empty::before { content: attr(data-placeholder); position: absolute; color: var(--text-faint); pointer-events: none; }
.rte-area .btn-line { cursor: default; }
.rte.is-readonly .rte-area { background: var(--surface-sub); border-radius: var(--radius); }
.rte-dialog { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 1.2rem 1.25rem; width: min(460px, calc(100vw - 32px)); box-shadow: var(--shadow); color: var(--text); }
.rte-dialog::backdrop { background: rgba(24, 24, 27, .4); }
.rte-dialog h3 { margin: 0 0 .9rem; font-size: 1.1rem; }
.rte-dialog .btn-row { justify-content: flex-end; }
.rte-dest { border: 0; padding: 0; margin: 0 0 1rem; }
.rte-import { width: min(680px, calc(100vw - 32px)); }
.rte-import .help { margin: 0 0 .8rem; }
.rte-import .help .chip-code { margin: 0 .1rem; }
.rte-import textarea { min-height: 18rem; font-size: 15px; }
.rte-dest .check { display: flex; margin: .25rem 0; }
.field-error { color: var(--danger, #b42318); font-size: .9375rem; margin: -.4rem 0 .8rem; }
/* メールの本文（書く欄・スマホでの見え方で共通。送るメールでも同じ見た目になる） */
.mail-body { font-size: 1rem; line-height: 1.8; word-break: break-word; }
.mail-body p { margin: 0; }
.mail-body h2 { margin: 1rem 0 .5rem; padding: .1rem 0 .1rem .6rem; border-left: 4px solid var(--accent); font-size: 1.2rem; line-height: 1.5; }
.mail-body hr { border: 0; border-top: 1px solid #dddddd; margin: 1.1rem 0; }
.mail-body a { color: var(--accent); text-decoration: underline; }
.mail-body .btn-line { text-align: center; margin: 1rem 0; }
.mail-body a.cta { display: inline-block; padding: .8rem 1.9rem; border-radius: 8px; background: var(--accent); color: #fff; font-weight: 700; text-decoration: none; }
.mk { background-color: #fff59d; }
.mail-body .sm, .rte-btn .sm { font-size: .8125rem; line-height: 1.7; color: #6b7280; }
.c-red { color: #d32f2f; }
.c-blue { color: #1565c0; }
.c-green { color: #2e7d32; }
.c-orange { color: #d84315; }
.preview-col { position: sticky; top: 1rem; }
.phone { border: 1px solid var(--line-strong); border-radius: 26px; padding: .65rem; background: var(--surface); box-shadow: var(--shadow); }
.phone-screen { border-radius: 18px; background: var(--surface-sub); padding: .9rem .85rem; height: 520px; overflow-y: auto; font-size: .9375rem; line-height: 1.75; }
.phone-from { font-weight: 700; }
.phone-subject { color: var(--text-sub); margin-bottom: .6rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.phone-body { word-break: break-word; }
.phone-body.mail-body { font-size: .9375rem; line-height: 1.75; }
.phone-body.mail-body h2 { font-size: 1.05rem; }
.phone-body.mail-body a.cta { padding: .6rem 1.2rem; }
.phone-footer { white-space: pre-wrap; word-break: break-word; color: var(--text-faint); margin-top: 1rem; }
.lint { margin-top: .8rem; }
.checks { list-style: none; padding: 0; margin: 0 0 1rem; }
.checks li { display: flex; gap: .55rem; align-items: flex-start; padding: .4rem 0; }
.checks .ok { color: var(--ok); }
.checks .ng { color: var(--warn); }

/* ---------- 読者の詳細 ---------- */
.profile { display: flex; align-items: center; gap: .9rem; }
.profile .avatar { width: 3rem; height: 3rem; font-size: 1.1rem; }
.email-title { font-size: 1.6rem; word-break: break-all; }
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history time { color: var(--text-sub); font-size: .9375rem; font-variant-numeric: tabular-nums; }
details.consent { margin-top: .3rem; }
details.consent summary { cursor: pointer; color: var(--accent); font-size: .9375rem; }
details.consent div { white-space: pre-wrap; background: #fafafa; border: 1px solid var(--line); padding: .6rem .8rem; border-radius: var(--radius); font-size: .9375rem; margin-top: .3rem; }
details summary { cursor: pointer; }

/* ---------- その他メニュー（スマホ） ---------- */
.menu-list { list-style: none; padding: 0; margin: 0; }
.menu-list a, .menu-list button { display: flex; align-items: center; gap: .7rem; width: 100%; padding: .9rem 1rem; color: var(--text); font: inherit; font-weight: 600; background: none; border: 0; border-bottom: 1px solid var(--line); text-align: left; cursor: pointer; }
.menu-list li:last-child a, .menu-list li:last-child button { border-bottom: 0; }

/* ---------- ひとつの箱だけの画面（ログインなど） ---------- */
body.bare { display: flex; min-height: 100vh; align-items: center; justify-content: center; padding: 1.5rem 1rem; }
.bare-box { width: 100%; max-width: 420px; }
.bare-brand { display: flex; justify-content: center; margin-bottom: 1.2rem; }
.bare-brand .workspace { margin: 0; }
.secret { font-family: var(--mono); font-size: 1.1rem; letter-spacing: .06em; background: #fafafa; border: 1px solid var(--line); padding: .7rem; border-radius: var(--radius); text-align: center; word-break: break-all; }
.setup-form label { display: block; font-weight: 600; font-size: .9375rem; margin: .9rem 0 .3rem; }
.setup-form button { margin-top: 1.2rem; }
.narrow-card { max-width: 480px; }
.form-preview { width: 100%; height: 600px; border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); background: var(--bg); }

/* ---------- 読者向けの画面 ---------- */
body.public { background: transparent; }
body.public.standalone { background: var(--bg); padding: 1.5rem 1rem; }
.pub-card { max-width: 480px; margin: 0 auto; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; box-shadow: var(--shadow); }
.pub-head { padding: 1.1rem 1.35rem 1rem; border-top: 4px solid var(--accent); border-bottom: 1px solid var(--line); }
.pub-head p { margin: 0; font-size: .9375rem; color: var(--text-sub); font-weight: 600; }
.pub-head h1 { font-size: 1.25rem; margin-top: .15rem; }
.pub-body { padding: 1.35rem; }
.pub-icon { width: 2.6rem; height: 2.6rem; color: var(--accent); display: block; margin-bottom: .5rem; }
.consent-text { font-size: .9375rem; color: var(--text-sub); background: #fafafa; border: 1px solid var(--line); border-radius: var(--radius); padding: .75rem .9rem; margin: .2rem 0 .8rem; white-space: pre-wrap; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.cf-turnstile { margin: .6rem 0; }
.pub-note { font-size: .9375rem; color: var(--text-sub); margin-top: .8rem; }
.pub-body .check { margin: .2rem 0 1rem; }
.error { color: var(--danger); font-weight: 600; }

/* ---------- 画面幅：中くらい ---------- */
@media (max-width: 1180px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-5 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- スマホ ---------- */
@media (max-width: 860px) {
  body { font-size: 16px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding: 1rem 1rem 6rem; }
  h1 { font-size: 1.6rem; }
  .page-head { margin-bottom: 1rem; padding-bottom: .8rem; }
  .crumbs { display: none; }
  .mobile-head { display: flex; align-items: center; gap: .6rem; position: sticky; top: 0; z-index: 5; padding: .6rem 1rem; background: rgba(255, 255, 255, .92); border-bottom: 1px solid var(--line); backdrop-filter: saturate(1.4) blur(8px); }
  .mobile-head .workspace-mark { width: 1.7rem; height: 1.7rem; font-size: .9375rem; }
  .mobile-head .workspace-name { font-size: .9375rem; }
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; inset: auto 0 0 0; z-index: 5; background: rgba(255, 255, 255, .96); border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); backdrop-filter: saturate(1.4) blur(8px); }
  .tabbar a { display: flex; flex-direction: column; align-items: center; gap: .1rem; padding: .45rem 0 .5rem; font-size: .9375rem; font-weight: 650; color: var(--text-faint); }
  .tabbar a .icon { width: 1.4rem; height: 1.4rem; }
  .tabbar a.is-current { color: var(--text); }
  .tabbar a.is-current .icon { color: var(--accent); }
  .grid-4, .grid-3, .grid-2, .grid-even, .settings-layout { grid-template-columns: minmax(0, 1fr); }
  .grid-4.keep-2, .grid-5.keep-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: .85rem .95rem; }
  .stat-value { font-size: 1.9rem; }
  .settings-nav { display: none; }
  .editor { grid-template-columns: minmax(0, 1fr); }
  /* スマホ：上の見出し帯に隠れないよう、書く欄のボタンの列は固定しない */
  .rte-bar { position: static; }
  .rte-sep { display: none; }
  .rte-area { min-height: 320px; }
  .preview-col { position: static; }
  .phone-screen { height: 420px; }
  .chart { height: 160px; }
  .timeline::before { left: 1.05rem; }
  .tl-item { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .tl-when { grid-column: 2; grid-row: 1; text-align: left; padding: .15rem 0 0; }
  .tl-dot { grid-column: 1; grid-row: 1 / span 2; margin-top: .45rem; }
  .tl-card { grid-column: 2; }
  .tl-insert { grid-template-columns: 2.1rem minmax(0, 1fr); }
  .tl-insert a { grid-column: 2; }
  .history li { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
  .metric-strip div { border-right: 0; border-bottom: 1px solid var(--line); }

  table.list thead { display: none; }
  table.list, table.list tbody, table.list tr, table.list td { display: block; width: 100%; }
  table.list tr { padding: .75rem 1rem; border-bottom: 1px solid var(--line); }
  table.list tr:last-child { border-bottom: 0; }
  table.list td { border: 0; padding: .1rem 0; }
  table.list td[data-label]::before { content: attr(data-label) "："; color: var(--text-sub); font-size: .9375rem; }
  table.list td.num { text-align: left; }
  table.list td.hide-sm { display: none; }
}
.min0 { min-width: 0; }

/* ============================================================
   追加の部品（第1弾の機能：タグ・取り込み・フォーム・予約・成績表）
   ============================================================ */
.icon-xs { width: .9em; height: .9em; }
.trend .icon { width: .95em; height: .95em; }
.trend-note { font-weight: 500; color: var(--text-faint); margin-left: .25rem; }
.trend.up .trend-note { color: var(--ok); }
.head-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.badge .icon { width: .95em; height: .95em; }
.chip-code { font-family: var(--mono); font-size: .9375rem; padding: .02rem .35rem; border-radius: 5px; background: var(--surface-sub); border: 1px solid var(--line); color: var(--text); }

/* 線グラフ（線と目盛りは、横に伸ばしても太さを変えない） */
.chart .line, .chart .grid-line { vector-effect: non-scaling-stroke; }
.chart-wrap { position: relative; padding-top: .9rem; }
.chart-y { position: absolute; top: -.1rem; left: 0; font-size: .9375rem; color: var(--text-faint); font-variant-numeric: tabular-nums; }
.chart-x { display: flex; justify-content: space-between; font-size: .9375rem; color: var(--text-faint); margin-top: .4rem; font-variant-numeric: tabular-nums; }
.metric-strip small { display: block; font-size: .9375rem; color: var(--text-faint); font-weight: 500; }
.rank-empty { color: var(--text-sub); font-size: .9375rem; padding: .5rem 0 .2rem; }
.rank a { color: var(--text); }
.rank .sub-line { display: block; font-size: .9375rem; color: var(--text-sub); font-weight: 500; }
.rank li > span.num { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }

/* 表の上の道具（検索・絞り込み） */
.toolbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.search { position: relative; }
.search .icon { position: absolute; left: .65rem; top: 50%; transform: translateY(-50%); color: var(--text-faint); pointer-events: none; }
.toolbar input[type=search] { width: 17rem; min-height: 34px; padding: .3rem .7rem .3rem 2rem; font-size: .9375rem; }
.toolbar select { width: auto; min-height: 34px; padding: .25rem .6rem; font-size: .9375rem; }
.who-main { display: block; font-weight: 650; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who-sub { display: block; font-size: .9375rem; color: var(--text-sub); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.who:hover { text-decoration: none; }
a.who:hover .who-main { color: var(--accent); }
.tags { display: flex; flex-wrap: wrap; gap: .25rem; }
.pager { display: flex; justify-content: space-between; align-items: center; gap: .6rem; padding: .6rem 1rem; border-top: 1px solid var(--line); font-size: .9375rem; color: var(--text-sub); }
.progress { height: 6px; border-radius: 999px; background: var(--surface-sub); overflow: hidden; min-width: 5rem; }
.progress .bar { display: block; height: 100%; background: var(--accent); border-radius: inherit; }

/* タグの付け外し */
.tag-chip { display: inline-flex; align-items: center; gap: .15rem; padding: .1rem .2rem .1rem .6rem; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); font-size: .9375rem; font-weight: 600; }
.tag-chip form { display: inline-flex; }
.tag-chip button { border: 0; background: none; padding: .15rem; border-radius: 50%; color: var(--text-faint); cursor: pointer; display: inline-flex; }
.tag-chip button:hover { background: var(--surface-sub); color: var(--text); }
.inline-form { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.inline-form input, .inline-form select { width: auto; flex: 1 1 9rem; min-height: 36px; padding-top: .35rem; padding-bottom: .35rem; }
.row-actions { display: flex; gap: .3rem; justify-content: flex-end; align-items: center; }
details.inline > summary { list-style: none; display: inline-flex; }
details.inline > summary::-webkit-details-marker { display: none; }
details.inline[open] > summary { margin-bottom: .5rem; }

/* 登録フォームの一覧 */
.form-card { display: flex; flex-direction: column; }
.form-card .kv { font-size: .9375rem; gap: .35rem 1rem; }
.form-card-stats { display: flex; gap: 1.6rem; margin: 1rem 0 0; padding-top: .9rem; border-top: 1px solid var(--line); }
.form-card-stats span { display: block; font-size: .9375rem; color: var(--text-sub); font-weight: 600; }
.form-card-stats strong { font-size: 1.65rem; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.card-actions { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: auto; padding-top: 1rem; }
.hidden-code { display: none; }
.card.strip-only { padding: 0; overflow: hidden; }
.card.strip-only .metric-strip { margin: 0; border-bottom: 0; }

/* ステップメールの見出し */
.seq-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .6rem 1rem; margin-bottom: 1rem; }
.seq-bar h2 { display: flex; align-items: center; gap: .5rem; font-size: 1.05rem; }
.seq-meta { color: var(--text-sub); font-size: .9375rem; display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; align-items: center; }
.seq-meta .icon { color: var(--text-faint); }
.tabs a.tab-add { color: var(--accent); display: inline-flex; align-items: center; gap: .2rem; }
.tabs a .badge { margin-left: .3rem; }

/* 書く画面の補足と、送り方の選択 */
.radio-card:has(input:checked) { border-color: var(--accent); background: var(--accent-faint); box-shadow: 0 0 0 1px var(--accent) inset; }
.field-group { padding-top: 1rem; margin-top: 1rem; border-top: 1px solid var(--line); }
.when-later { margin: .6rem 0 0 1.7rem; max-width: 16rem; }
.step-num { display: inline-flex; width: 1.35rem; height: 1.35rem; border-radius: 50%; background: var(--text); color: #fff; font-size: .9375rem; font-weight: 700; align-items: center; justify-content: center; margin-right: .45rem; flex: none; }
.file-pick { display: flex; align-items: center; gap: .7rem; padding: .8rem .9rem; border: 1px dashed var(--line-strong); border-radius: var(--radius); background: #fcfcfc; }
.file-pick .icon { color: var(--text-faint); width: 1.4rem; height: 1.4rem; }
.or { display: flex; align-items: center; gap: .7rem; color: var(--text-faint); font-size: .9375rem; margin: .8rem 0; }
.or::before, .or::after { content: ""; flex: 1; border-top: 1px solid var(--line); }

/* 設定の保存バー（画面の下に付いてくる） */
.save-bar { position: sticky; bottom: 1rem; z-index: 3; display: flex; justify-content: space-between; gap: .6rem; align-items: center; padding: .7rem .9rem .7rem 1.1rem; margin-top: 1rem; background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: 0 6px 20px rgba(24, 24, 27, .08); backdrop-filter: blur(8px); }
.save-bar p { margin: 0; color: var(--text-sub); font-size: .9375rem; }
.settings-nav .nav-group { padding-left: .6rem; }
section[id] { scroll-margin-top: 1rem; }

/* 読者の詳細 */
.profile-meta { display: flex; flex-wrap: wrap; gap: .3rem 1.1rem; color: var(--text-sub); font-size: .9375rem; margin-top: .35rem; align-items: center; }
.profile-meta .icon { color: var(--text-faint); }

@media (max-width: 860px) {
  .toolbar, .search { width: 100%; }
  .toolbar input[type=search] { width: 100%; }
  .toolbar select { flex: 1; }
  .head-actions { width: 100%; }
  .save-bar { bottom: 4.6rem; }
  .form-card-stats { gap: 1.2rem; }
  .when-later { margin-left: 0; }
  .checklist-table li { grid-template-columns: 1.4rem minmax(0, 1fr); }
  .checklist-table .ck-value { grid-column: 2; }
  .feed li { grid-template-columns: 1.8rem minmax(0, 1fr); }
  .feed time { grid-column: 2; }
  .bulk-bar { padding: .6rem .8rem; }
}

/* 送る前のチェックリスト・プレビューの選択・ランキングの操作 */
.checklist-table { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.checklist-table li { display: grid; grid-template-columns: 1.6rem 7.5rem minmax(0, 1fr); gap: .5rem; align-items: start; padding: .55rem .8rem; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.checklist-table li:last-child { border-bottom: 0; }
.checklist-table .ck-icon { color: var(--ok); padding-top: .1rem; }
.checklist-table li.is-ng { background: var(--warn-bg); }
.checklist-table li.is-ng .ck-icon { color: var(--warn); }
.checklist-table .ck-item { font-weight: 650; }
.checklist-table .ck-value { min-width: 0; overflow-wrap: anywhere; }
.checklist-table .ck-value .small { display: block; }
.rank-action { margin-left: .4rem; font-size: .9375rem; font-weight: 600; white-space: nowrap; }
.pv-who { margin-bottom: .6rem; }
.pv-who select { min-height: 34px; padding: .25rem .6rem; font-size: .9375rem; }

/* 読者の一覧：まとめて操作 */
.bulk-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; padding: .6rem 1rem; border-bottom: 1px solid var(--line); background: var(--accent-faint); font-size: .9375rem; }
.bulk-bar select { width: auto; min-height: 32px; padding: .2rem .5rem; font-size: .9375rem; }
.bulk-bar .selected { font-weight: 650; margin-right: .3rem; }
.bulk-group { display: inline-flex; flex-wrap: wrap; gap: .4rem; align-items: center; padding-left: .5rem; border-left: 1px solid var(--line); }
.seq-cell { display: flex; flex-direction: column; line-height: 1.45; }
.dist-list { list-style: none; margin: 0; padding: 0; display: grid; gap: .45rem; }
.dist-list li { display: grid; grid-template-columns: 6.5rem 1fr 4rem; gap: .7rem; align-items: center; font-size: .9375rem; }
.dist-list .progress { height: 10px; }
.dist-list .dist-n { text-align: right; font-variant-numeric: tabular-nums; }
.dist-list li.is-done .bar { background: var(--ok, #15803d); }
.switch-target { border: 0; padding: 0; margin: 0 0 .8rem; }
.switch-target .check { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin: .35rem 0; }
.switch-target select { width: auto; max-width: 100%; }
table.list td.pick, table.list th.pick { width: 2.4rem; padding-right: 0; }
table.list input[type=checkbox] { width: 1rem; height: 1rem; accent-color: var(--accent); }

/* 読者の詳細：進み具合と履歴 */
.progress-list { list-style: none; margin: 0; padding: 0; }
.progress-list li { padding: .6rem 0; border-bottom: 1px solid var(--line); }
.progress-list li:last-child { border-bottom: 0; }
.progress-list .row { display: flex; justify-content: space-between; gap: .6rem; font-size: .9375rem; }
.progress-list .progress { margin-top: .35rem; }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li { display: grid; grid-template-columns: 1.8rem minmax(0, 1fr) auto; gap: .55rem; align-items: start; padding: .55rem 0; border-bottom: 1px solid var(--line); font-size: .9375rem; }
.feed li:last-child { border-bottom: 0; }
.feed .feed-icon { width: 1.8rem; height: 1.8rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface-sub); color: var(--text-sub); }
.feed li.k-click .feed-icon { background: var(--accent-faint); color: var(--accent); }
.feed li.k-tag .feed-icon { background: var(--ok-bg); color: var(--ok); }
.feed time { font-size: .9375rem; color: var(--text-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed .feed-sub { display: block; font-size: .9375rem; color: var(--text-sub); }
.danger-zone { border-color: var(--danger-line); }
.danger-zone h2 { color: var(--danger); }

/* 読者側：申込直後の案内 */
.pub-steps { margin-top: 1rem; padding: .9rem 1rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fafafa; font-size: .9375rem; }
.pub-steps-head { font-weight: 700; margin-bottom: .4rem; }
.pub-steps ol { margin: 0 0 .4rem; padding-left: 1.3rem; }
.consent-text a { display: inline-block; margin-top: .3rem; font-weight: 600; }

/* 届きやすさ */
.check-rows { list-style: none; margin: 0; padding: 0; }
.check-rows li { display: grid; grid-template-columns: 1.6rem minmax(0, 1fr); gap: .5rem; padding: .75rem 0; border-bottom: 1px solid var(--line); }
.check-rows li:last-child { border-bottom: 0; }
.check-rows .ok { color: var(--ok); } .check-rows .ng { color: var(--warn); }
.check-rows code { display: block; margin-top: .2rem; padding: .3rem .5rem; background: #fafafa; border: 1px solid var(--line); border-radius: 6px; font-size: .9375rem; overflow-wrap: anywhere; }
td.is-over { color: var(--warn); font-weight: 650; }

/* スマホ向けの上書き（あとから足した部品の分。ファイルの最後に置いて、先の指定より優先させる） */
@media (max-width: 860px) {
  .checklist-table li { grid-template-columns: 1.4rem minmax(0, 1fr); gap: .1rem .5rem; }
  .checklist-table .ck-value { grid-column: 2; }
  .feed li { grid-template-columns: 1.8rem minmax(0, 1fr); }
  .feed time { grid-column: 2; }
  .save-bar { justify-content: flex-end; padding: .45rem; bottom: 4.4rem; width: max-content; margin-left: auto; }
  .save-bar p { display: none; }
}

/* ============================================================
   色分け（2026-10-18 社長「同じ配色ばかりでテンションが上がらない」）
   役割ごとに色を決める：読者=青、本登録=青緑、クリック=紫、配信停止=橙、一斉配信=桃、フォーム=空色、届きやすさ=緑
   赤は「危ないとき」だけに使う（この中には入れない）
   ============================================================ */
:root {
  --c1: #3b82f6; --c1-bg: #eff6ff; --c1-ink: #1d4ed8;
  --c2: #14b8a6; --c2-bg: #f0fdfa; --c2-ink: #0f766e;
  --c3: #8b5cf6; --c3-bg: #f5f3ff; --c3-ink: #6d28d9;
  --c4: #f59e0b; --c4-bg: #fffbeb; --c4-ink: #b45309;
  --c5: #ec4899; --c5-bg: #fdf2f8; --c5-ink: #be185d;
  --c6: #0ea5e9; --c6-bg: #f0f9ff; --c6-ink: #0369a1;
  --c7: #22c55e; --c7-bg: #f0fdf4; --c7-ink: #15803d;
}
.c1 { --c: var(--c1); --c-bg: var(--c1-bg); --c-ink: var(--c1-ink); }
.c2 { --c: var(--c2); --c-bg: var(--c2-bg); --c-ink: var(--c2-ink); }
.c3 { --c: var(--c3); --c-bg: var(--c3-bg); --c-ink: var(--c3-ink); }
.c4 { --c: var(--c4); --c-bg: var(--c4-bg); --c-ink: var(--c4-ink); }
.c5 { --c: var(--c5); --c-bg: var(--c5-bg); --c-ink: var(--c5-ink); }
.c6 { --c: var(--c6); --c-bg: var(--c6-bg); --c-ink: var(--c6-ink); }
.c7 { --c: var(--c7); --c-bg: var(--c7-bg); --c-ink: var(--c7-ink); }

/* 数字カード：上に色の帯、左上に色のアイコン */
.stat[class*=" c"] { border-top: 3px solid var(--c, var(--line)); }
.stat-label { display: flex; align-items: center; gap: .5rem; }
.stat-icon { width: 2.2rem; height: 2.2rem; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-bg, var(--accent-faint)); color: var(--c-ink, var(--accent)); flex: none; }
.stat-icon .icon { width: 1.2rem; height: 1.2rem; }

/* メニューのアイコンにも色 */
.nav a .icon { color: var(--c, var(--text-faint)); }
.nav a.is-current { box-shadow: var(--shadow-sm), inset 3px 0 0 var(--c, var(--accent)); }
.nav a.is-current .icon { color: var(--c, var(--accent)); }
.tabbar a.is-current .icon { color: var(--c, var(--accent)); }
.workspace-mark { background: linear-gradient(135deg, var(--accent), var(--c3)); }

/* ページの見出しの横の色アイコン */
.page-title { display: flex; align-items: center; gap: .7rem; }
.page-icon { width: 2.6rem; height: 2.6rem; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-bg, var(--accent-faint)); color: var(--c-ink, var(--accent)); flex: none; }
.page-icon .icon { width: 1.4rem; height: 1.4rem; }

/* ランキングの帯の色 */
.rank[class*=" c"] .bar { background: var(--c-bg); }
.rank[class*=" c"] li.is-top .bar { background: color-mix(in srgb, var(--c) 22%, white); }
.rank[class*=" c"] li .num { color: var(--c-ink); }

/* 数字の帯：見出しの前に色の点 */
.metric-strip span[class^="c"]::before { content: ""; display: inline-block; width: .6rem; height: .6rem; border-radius: 50%; background: var(--c); margin-right: .4rem; vertical-align: .05em; }

/* グラフ：2本目の線と凡例 */
.chart .line.s2 { stroke: var(--c4); stroke-width: 2; }
.legend { display: flex; flex-wrap: wrap; gap: .3rem 1rem; color: var(--text-sub); }
.legend span { display: inline-flex; align-items: center; gap: .4rem; }
.legend i { width: .8rem; height: .8rem; border-radius: 3px; display: inline-block; background: var(--c, var(--accent)); }

/* タグの色（名前ごとに決まる） */
.tag.c1, .tag.c2, .tag.c3, .tag.c4, .tag.c5, .tag.c6, .tag.c7 { background: var(--c-bg); color: var(--c-ink); }
.tag-chip[class*=" c"] { border-color: color-mix(in srgb, var(--c) 35%, white); background: var(--c-bg); color: var(--c-ink); }

/* 良い知らせ・空のときのアイコン */
.notice-good { background: linear-gradient(90deg, var(--c1-bg), var(--c3-bg)); border-color: color-mix(in srgb, var(--c3) 25%, white); }
.notice-good .icon { color: var(--c3); }
.empty-icon[class*=" c"] { background: var(--c-bg); color: var(--c-ink); }

/* ============================================================
   ツールチップ（マウスを乗せる・タップすると吹き出しで説明や数字を出す）
   ============================================================ */
.tip-bubble { position: fixed; z-index: 60; max-width: 20rem; padding: .55rem .75rem; border-radius: 10px; background: #18181b; color: #fff; font-size: .9375rem; line-height: 1.55; box-shadow: 0 10px 28px rgba(0, 0, 0, .2); pointer-events: none; opacity: 0; transform: translateY(4px); transition: opacity .12s, transform .12s; }
.tip-bubble.is-on { opacity: 1; transform: none; }
.tip-bubble .tip-title { font-weight: 700; margin-bottom: .15rem; }
.tip-bubble .tip-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.tip-bubble .tip-row span { display: inline-flex; align-items: center; gap: .4rem; color: #d4d4d8; }
.tip-bubble .tip-row i { width: .65rem; height: .65rem; border-radius: 50%; display: inline-block; }
.tip-bubble .tip-row b { font-variant-numeric: tabular-nums; }
.hint { display: inline-flex; align-items: center; justify-content: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; border: 1px solid var(--line-strong); color: var(--text-sub); font-size: .9375rem; font-weight: 700; line-height: 1; cursor: help; background: var(--surface); flex: none; }
.hint:hover, .hint:focus-visible { border-color: var(--accent); color: var(--accent); }
[data-tip] { cursor: help; }
a[data-tip], button[data-tip] { cursor: pointer; }
.chart-wrap { touch-action: pan-y; }
.chart-cursor { position: absolute; width: 1px; background: var(--text-faint); opacity: .6; pointer-events: none; display: none; }
.chart-dot { position: absolute; width: .8rem; height: .8rem; border-radius: 50%; background: var(--surface); border: 2.5px solid var(--accent); transform: translate(-50%, -50%); pointer-events: none; display: none; }
.chart-dot.s2 { border-color: var(--c4); }
.chart-wrap.is-hover .chart-cursor, .chart-wrap.is-hover .chart-dot { display: block; }
.tip-bubble .tip-row i.s1 { background: var(--accent); }
.tip-bubble .tip-row i.s2 { background: var(--c4); }
.legend span.c1 i { background: var(--accent); }
.stat-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; }
.stat-row .trend { position: relative; top: -.2rem; }
.stat-label { flex-wrap: wrap; }
.timeline .tl-dot { background: var(--c3); }
.tl-num { color: var(--c3-ink); }
.metric-strip span[data-tip] { cursor: help; }
.avatar[class*=" c"] { background: var(--c-bg); color: var(--c-ink); }
@media (max-width: 520px) {
  .grid-4.keep-2, .grid-5.keep-2 { grid-template-columns: minmax(0, 1fr); }
}

/* ============================================================
   全画面の見やすさの仕上げ（2026-10-18）
   ============================================================ */
:root { --c8: #64748b; --c8-bg: #f1f5f9; --c8-ink: #334155; }
.c8 { --c: var(--c8); --c-bg: var(--c8-bg); --c-ink: var(--c8-ink); }

/* カードの上の色の帯・見出しの色アイコン */
.card.top-line[class*=" c"] { border-top: 3px solid var(--c); }
.head-icon { width: 2rem; height: 2rem; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center; background: var(--c-bg, var(--surface-sub)); color: var(--c-ink, var(--text-sub)); flex: none; }
.head-icon .icon { width: 1.1rem; height: 1.1rem; }
.card-head h2 .head-icon { margin-right: .1rem; }

/* 表の中の小さな棒（割合を目で比べる） */
.mini { display: inline-flex; align-items: center; gap: .5rem; justify-content: flex-end; }
.mini-bar { width: 3.2rem; height: .5rem; border-radius: 999px; background: var(--surface-sub); overflow: hidden; display: inline-block; }
.mini-bar .bar { display: block; height: 100%; background: var(--c, var(--accent)); border-radius: inherit; }

/* 数字の帯だけのカード（一覧の上のまとめ） */
.summary { margin-bottom: 1rem; }

/* 履歴：日時を上、内容を下に（狭い列でも読みやすく） */
.history.stacked li { grid-template-columns: minmax(0, 1fr); gap: .15rem; }
.history.stacked time { font-weight: 600; }

/* 設定の目次：色のアイコンつき */
.settings-nav a { display: flex; align-items: center; gap: .55rem; padding: .45rem .6rem; }
.settings-nav a .icon { color: var(--c, var(--text-faint)); width: 1.05rem; height: 1.05rem; }
.settings-nav a:hover .icon { color: var(--c-ink, var(--text)); }

/* 操作記録の札 */
.badge[class*=" c"] { color: var(--c-ink); background: var(--c-bg); border-color: color-mix(in srgb, var(--c) 30%, white); }
.badge[class*=" c"]::before { background: var(--c); }

/* その他メニュー（スマホ）の色アイコン */
.menu-list .head-icon { width: 2.1rem; height: 2.1rem; }

/* ログインなど、1つの箱だけの画面 */
body.bare { background: radial-gradient(1200px 600px at 10% -10%, var(--c1-bg), transparent 60%), radial-gradient(900px 500px at 110% 110%, var(--c3-bg), transparent 60%), var(--bg); }
.bare-box .card { border-top: 3px solid var(--accent); padding: 1.6rem 1.6rem 1.4rem; }
.bare-box h1 { font-size: 1.5rem; margin-bottom: .3rem; }

/* 見出しの説明が長いときも、右のボタンが下に回り込みすぎないように */
.page-title { min-width: 0; }
.page-title > div { min-width: 0; }

/* 読者向けの画面：上の色の帯と背景 */
body.public.standalone { background: radial-gradient(900px 500px at 50% -20%, var(--accent-faint), transparent 70%), var(--bg); }
.pub-icon { width: 2.8rem; height: 2.8rem; padding: .55rem; border-radius: 14px; background: var(--accent-faint); }
.auth-head { display: flex; align-items: center; gap: .8rem; margin-bottom: 1rem; }
.auth-head p { margin: .2rem 0 0; }
.auth-steps { display: flex; gap: .5rem; list-style: none; padding: 0; margin: 0 0 1.2rem; counter-reset: st; }
.auth-steps li { counter-increment: st; flex: 1; display: flex; align-items: center; gap: .45rem; padding: .45rem .7rem; border-radius: 10px; background: var(--surface-sub); color: var(--text-sub); font-weight: 600; }
.auth-steps li::before { content: counter(st); width: 1.5rem; height: 1.5rem; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; background: var(--surface); border: 1px solid var(--line-strong); }
.auth-steps li.is-on { background: var(--accent-faint); color: var(--accent-strong); }
.auth-steps li.is-on::before { background: var(--accent); border-color: var(--accent); color: #fff; }
.auth-steps li.is-done { color: var(--ok); }
.auth-steps li.is-done::before { content: "✓"; background: var(--ok-bg); border-color: var(--ok-line); color: var(--ok); }

/* ---- 2段階認証（メールの確認コード・予備のコード） ---- */
.recovery-codes { list-style: none; margin: .8rem 0 .6rem; padding: .9rem 1rem; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .45rem 1rem; font-family: var(--mono); font-size: 1.1rem; letter-spacing: .08em; text-align: center; background: var(--surface-sub); border: 1px dashed var(--line-strong); border-radius: var(--radius); }
.auth-more { margin-top: 1.2rem; padding-top: 1rem; border-top: 1px solid var(--line); }
.auth-more summary { color: var(--text-sub); font-weight: 600; }
.mfa-kv { display: grid; grid-template-columns: max-content 1fr; gap: .5rem 1.2rem; margin: 0 0 1rem; }
.mfa-kv dt { color: var(--text-sub); }
.mfa-kv dd { margin: 0; font-weight: 600; }

/* ---------- 読者が自分で使う手続きのページ（配信の解除・メールアドレスの変更） ---------- */
body.sheet { margin: 0; min-height: 100vh; display: flex; flex-direction: column; background: #fff; color: var(--text); border-top: 4px solid var(--accent); }
.sheet-band { margin-top: 2.5rem; padding: 1.7rem 1rem; text-align: center; color: #fff; background: linear-gradient(90deg, var(--accent-strong), var(--accent)); }
.sheet-band h1 { margin: 0; font-size: 1.4rem; font-weight: 800; letter-spacing: .03em; line-height: 1.4; }
.sheet-main { flex: 1; width: min(640px, calc(100% - 32px)); margin: 1.4rem auto 3.5rem; }
.sheet-lead { margin: 0 0 .5rem; font-size: .9375rem; }
.sheet-note { margin: .8rem 0 0; font-size: .9375rem; color: var(--text-sub); }
.sheet-table { width: 100%; border-collapse: collapse; border-top: 2px solid var(--line-strong); }
.sheet-table th { width: 36%; padding: .95rem .9rem; background: var(--accent-faint); text-align: left; vertical-align: middle; font-size: .9375rem; font-weight: 700; border-bottom: 1px solid var(--line-strong); }
.sheet-table th label { font-weight: 700; }
.sheet-table td { padding: .65rem .9rem; border-bottom: 1px solid var(--line-strong); word-break: break-all; }
.sheet-table input { width: 100%; }
.sheet-warn { margin: 1.4rem 0 0; text-align: center; color: var(--danger); font-weight: 700; }
.sheet-actions { margin-top: 1.6rem; text-align: center; }
.btn-sheet { min-width: 11rem; padding: .8rem 2.2rem; border: 0; border-radius: 4px; background: #231815; color: #fff; font: inherit; font-size: 1.25rem; font-weight: 800; letter-spacing: .05em; cursor: pointer; }
.btn-sheet:hover { background: #000; }
.btn-sheet:disabled { opacity: .45; cursor: not-allowed; }
.sheet-message { display: flex; gap: .7rem; align-items: flex-start; padding: 1.2rem 1.25rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface-sub); }
.sheet-message.is-ok { background: var(--accent-faint); border-color: var(--accent-weak); }
.sheet-message p { margin: 0; line-height: 1.8; }
.sheet-icon { flex: none; width: 1.4rem; height: 1.4rem; margin-top: .2rem; color: var(--accent); }
.sheet-main .notice { margin-bottom: 1rem; }
.sheet-foot { min-height: 64px; background: #333; }
@media (max-width: 520px) {
  .sheet-band { margin-top: 1.2rem; padding: 1.3rem 1rem; }
  .sheet-band h1 { font-size: 1.2rem; }
  .sheet-table th, .sheet-table td { display: block; width: auto; }
  .sheet-table th { padding-bottom: .5rem; border-bottom: 0; }
}
