/* ICHI OS の画面の見た目。色は役割（--surface など）で指定し、明るい画面・暗い画面の値はここだけで切り替える。 */
:root {
  color-scheme: light;
  --page: #f4f3f0;
  --surface: #fcfcfb;
  --line: #e3e1db;
  --text: #0b0b0b;
  --text-2: #52514e;
  --text-3: #7a7872;
  --accent: #2a78d6;
  --accent-ink: #ffffff;
  /* 店舗の色（店舗ごとに固定。並び順や絞り込みで変わらない） */
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100; --s5: #e87ba4; --s6: #008300;
  /* 濃淡（少ない → 多い） */
  --q0: #eeedea; --q1: #cde2fb; --q2: #9ec5f4; --q3: #6da7ec; --q4: #3987e5; --q5: #256abf; --q6: #104281;
  --good: #0ca30c; --warn: #fab219; --bad: #d03b3b;
  --warn-bg: #fff6df; --bad-bg: #fdecec;
  --radius: 10px;
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", "Noto Sans JP", Meiryo, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #111110;
    --surface: #1a1a19;
    --line: #33332f;
    --text: #ffffff;
    --text-2: #c3c2b7;
    --text-3: #8f8e85;
    --accent: #3987e5;
    --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500; --s5: #d55181; --s6: #008300;
    --q0: #262624; --q1: #0d366b; --q2: #184f95; --q3: #256abf; --q4: #3987e5; --q5: #6da7ec; --q6: #9ec5f4;
    --warn-bg: #3a2f10; --bad-bg: #3d1b1b;
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--text); font-size: 15px; line-height: 1.6; }
a { color: var(--accent); }
h1 { font-size: 20px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 10px; }
h3 { font-size: 14px; margin: 16px 0 6px; }
p { margin: 0 0 10px; }
code { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 13px; }
.muted { color: var(--text-2); }
.small { font-size: 13px; }
.num { font-variant-numeric: tabular-nums; }

.top { display: flex; align-items: center; gap: 16px; padding: 10px 16px; background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.brand { font-weight: 700; letter-spacing: .04em; color: var(--text); text-decoration: none; white-space: nowrap; }
.tabs { display: flex; gap: 2px; overflow-x: auto; flex: 1; scrollbar-width: none; }
.tabs a { padding: 6px 12px; border-radius: 999px; color: var(--text-2); text-decoration: none; white-space: nowrap; font-size: 14px; }
.tabs a[aria-current="page"] { background: var(--text); color: var(--surface); }
.who { font-size: 13px; color: var(--text-2); white-space: nowrap; }
.who a { margin-left: 8px; }

.banner { margin: 12px 16px 0; padding: 10px 14px; border-radius: var(--radius); background: var(--warn-bg); border: 1px solid var(--warn); font-size: 14px; }
.banner.bad { background: var(--bad-bg); border-color: var(--bad); }
.view > .banner { margin: 0 0 16px; }
.view { padding: 16px; max-width: 1120px; margin: 0 auto; }
.foot { max-width: 1120px; margin: 0 auto; padding: 0 16px 40px; color: var(--text-2); font-size: 13px; }
.foot dt { font-weight: 600; color: var(--text); margin-top: 8px; }
.foot dd { margin: 0; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 16px; }
.head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 16px; margin-bottom: 12px; }
.controls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; }
.controls label { font-size: 13px; color: var(--text-2); display: flex; gap: 6px; align-items: center; }
select, input, textarea, button { font: inherit; color: inherit; }
select, input, textarea { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 6px 10px; max-width: 100%; }
textarea { width: 100%; min-height: 72px; }
.btn, button { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 0; border-radius: 8px; padding: 8px 14px; cursor: pointer; text-decoration: none; font-weight: 600; }
button.ghost { background: transparent; color: var(--accent); border: 1px solid var(--line); font-weight: 500; }
button:disabled { opacity: .5; cursor: default; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 今日 */
.hero { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.hero .big { font-size: 34px; font-weight: 700; line-height: 1.2; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; margin-top: 16px; }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.tile .name { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.tile .sales { font-size: 26px; font-weight: 700; margin: 4px 0 2px; }
.tile .sub { display: flex; gap: 14px; color: var(--text-2); font-size: 13px; }
.delta { font-size: 13px; }
.delta.up::before { content: "▲ "; color: var(--good); }
.delta.down::before { content: "▼ "; color: var(--bad); }
.dot { width: 10px; height: 10px; border-radius: 3px; flex: none; display: inline-block; }
.c1 { background: var(--s1); } .c2 { background: var(--s2); } .c3 { background: var(--s3); }
.c4 { background: var(--s4); } .c5 { background: var(--s5); } .c6 { background: var(--s6); }
.note { font-size: 13px; color: var(--text-2); margin-top: 12px; }

/* グラフ */
.chart { width: 100%; height: auto; display: block; overflow: visible; }
.chart text { fill: var(--text-2); font-size: 11px; }
.chart .grid { stroke: var(--line); stroke-width: 1; }
.chart .axis { stroke: var(--text-3); stroke-width: 1; }
.chart .line { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .l1 { stroke: var(--s1); } .chart .l2 { stroke: var(--s2); } .chart .l3 { stroke: var(--s3); }
.chart .l4 { stroke: var(--s4); } .chart .l5 { stroke: var(--s5); } .chart .l6 { stroke: var(--s6); }
.chart .f1 { fill: var(--s1); } .chart .f2 { fill: var(--s2); } .chart .f3 { fill: var(--s3); }
.chart .f4 { fill: var(--s4); } .chart .f5 { fill: var(--s5); } .chart .f6 { fill: var(--s6); }
.chart .marker { stroke: var(--surface); stroke-width: 2; }
.chart .cross { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .endlabel { fill: var(--text); font-size: 12px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; margin-bottom: 8px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }

.heat { width: 100%; border-collapse: separate; border-spacing: 2px; table-layout: fixed; }
.heat th { font-size: 11px; font-weight: 500; color: var(--text-2); padding: 0; }
.heat th.rh { width: 28px; text-align: left; }
.heat td { height: 26px; border-radius: 4px; padding: 0; }
.heat td:hover { outline: 2px solid var(--text); }
.q0 { background: var(--q0); } .q1 { background: var(--q1); } .q2 { background: var(--q2); } .q3 { background: var(--q3); }
.q4 { background: var(--q4); } .q5 { background: var(--q5); } .q6 { background: var(--q6); }
.scale { display: flex; flex-wrap: wrap; white-space: nowrap; align-items: center; gap: 4px; font-size: 12px; color: var(--text-2); margin-top: 8px; }
.scale i { width: 22px; height: 12px; border-radius: 3px; display: inline-block; }
.scroll-x { overflow-x: auto; }
.scroll-x > .heat { min-width: 620px; }

.bars { display: grid; grid-template-columns: minmax(90px, 220px) 1fr auto auto; gap: 6px 12px; align-items: center; font-size: 14px; }
.bars .track { height: 14px; }
.bars .bar { height: 14px; border-radius: 0 4px 4px 0; background: var(--s1); min-width: 2px; }
.bars .v { text-align: right; }

table.data { width: 100%; border-collapse: collapse; font-size: 14px; }
table.data th, table.data td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.data th { font-weight: 600; color: var(--text-2); font-size: 13px; white-space: nowrap; }
table.data td.r, table.data th.r { text-align: right; }
details > summary { cursor: pointer; color: var(--text-2); font-size: 13px; margin: 8px 0; }

.pill { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; border: 1px solid var(--line); color: var(--text-2); white-space: nowrap; }
.pill.good { border-color: var(--good); } .pill.bad { border-color: var(--bad); } .pill.warn { border-color: var(--warn); }
.voice { padding: 10px 0; border-bottom: 1px solid var(--line); }
.voice:last-child { border-bottom: 0; }
.voice .meta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--text-2); margin-bottom: 2px; }
.form { display: grid; gap: 10px; max-width: 560px; }
.form label { display: grid; gap: 4px; font-size: 13px; color: var(--text-2); }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.form .row.small { align-items: center; gap: 6px 14px; }
.form .row.small label { display: inline-flex; align-items: center; gap: 4px; color: var(--text); }
.compare { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.compare .k { font-size: 12px; color: var(--text-2); }
.compare .val { font-size: 20px; font-weight: 700; }
.list-btn { display: block; width: 100%; text-align: left; background: transparent; color: inherit; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 10px 0; font-weight: 400; }
.list-btn:hover { background: var(--page); }
.msg { font-size: 13px; margin-top: 6px; }
.msg.err { color: var(--bad); }
.copy { width: 100%; font-family: ui-monospace, Menlo, monospace; font-size: 12px; }

.tip { position: fixed; z-index: 20; pointer-events: none; background: var(--text); color: var(--surface); padding: 6px 10px; border-radius: 8px; font-size: 12px; line-height: 1.5; max-width: 260px; white-space: pre-line; }

/* ログインや許可の案内ページ */
body.plain { display: grid; place-items: center; min-height: 100vh; padding: 16px; }
.plain-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; max-width: 520px; width: 100%; }
.plain-card .brand { font-size: 13px; color: var(--text-2); margin-bottom: 8px; }
.plain-card h2 { margin-top: 16px; font-size: 14px; }
.plain-card ul { margin: 0 0 10px; padding-left: 20px; }

@media (max-width: 640px) {
  .who .name { display: none; }
  .hero .big { font-size: 28px; }
  .bars { grid-template-columns: minmax(80px, 120px) 1fr auto; }
  .bars .q { display: none; }
}
