/* note社内報ダッシュボード */
:root {
  --ink: #1c1c1e;
  --muted: #6b6b70;
  --line: #e3e3e6;
  --bg: #f7f7f8;
  --card: #ffffff;
  --warn-bg: #fdecea;
  --warn-ink: #a3261c;
  --warn-line: #f0b4ad;
  /* dataviz スキルの検証済みパレット slot1（青）。月次推移の折れ線は
     単一系列なので、この1色だけを一貫して使う（凡例は不要）。 */
  --chart-accent: #2a78d6;
  /* 散布図の「AZism人（社員）」「AZism人 アルバイト編」を見分けるための2色。
     dataviz検証スクリプトで --pairs all（散布図向け・どの2点が隣り合っても
     区別できる基準）を通過済み（CVD ΔE 24.7、通常視ΔE 33.6、light/dark双方）。
     サイト全体はダークモード非対応のため今はlight値のみを使うが、値自体は
     dark面（#1a1a19）に対しても同様に検証済みなので、将来ダークモードを
     追加する際にそのまま使い回せる。 */
  --series-staff: #2a78d6;
  --series-parttime: #eb6834;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 0 4rem;
  font-family: "Meiryo", "Hiragino Kaku Gothic ProN", system-ui, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.7;
}

header {
  padding: 1.5rem 2rem 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--line);
}

h1 { margin: 0 0 .25rem; font-size: 1.25rem; }

#freshness {
  margin: 0;
  font-size: .8125rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

#alert {
  margin: 0;
  padding: .875rem 2rem;
  background: var(--warn-bg);
  color: var(--warn-ink);
  border-bottom: 1px solid var(--warn-line);
  font-weight: 700;
}

section {
  margin: 1.5rem 2rem;
  padding: 1.5rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: .5rem;
}

section > h2 { margin: 0 0 1rem; font-size: 1rem; }

#no-data code {
  padding: .125rem .375rem;
  background: var(--bg);
  border-radius: .25rem;
}

[hidden] { display: none !important; }

.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; }
.card { padding: 1rem; background: var(--bg); border-radius: .375rem; }
.card .label { display: block; font-size: .75rem; color: var(--muted); }
.card .value { display: block; font-size: 1.75rem; font-variant-numeric: tabular-nums; }
.card .sub { display: block; font-size: .75rem; color: var(--muted); }

.bar { display: flex; height: 1.75rem; margin: 1.5rem 0 .75rem; border-radius: .25rem; overflow: hidden; }
.bar .seg { height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1rem; padding: 0; list-style: none; font-size: .8125rem; }
.legend i { display: inline-block; width: .75rem; height: .75rem; margin-right: .375rem; border-radius: .125rem; }

table { width: 100%; border-collapse: collapse; font-size: .875rem; }
th, td { padding: .5rem .75rem; border-bottom: 1px solid var(--line); text-align: left; }
th { font-size: .75rem; color: var(--muted); font-weight: 600; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.total td { font-weight: 700; border-top: 2px solid var(--ink); }

.note { font-size: .75rem; color: var(--muted); }

.slider { display: grid; grid-template-columns: 6rem 1fr 8rem; align-items: center; gap: .75rem; margin: .5rem 0; }
.slider output { text-align: right; font-variant-numeric: tabular-nums; font-size: .8125rem; }

#rate-controls summary { cursor: pointer; font-size: .875rem; margin-top: 1rem; }

/* 横に長い表・グラフは、ページ本体ではなく自分の中でスクロールさせる */
#cost-table, #magazine-table, #ranking, #monthly-chart, #scatter-chart { overflow-x: auto; }

/* ゾーンC: グラフ・表 */
h3 { margin: 1.5rem 0 .5rem; font-size: .875rem; color: var(--muted); }

svg { width: 100%; height: auto; min-width: 600px; }
.grid { stroke: var(--line); stroke-width: 1; }
.axis { stroke: var(--muted); stroke-width: 1; }
.line { fill: none; stroke: var(--chart-accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.end-mark { fill: var(--chart-accent); stroke: var(--card); stroke-width: 2; }

/* 散布図の点。「その他の記事」は控えめに、2つのインタビュー系列は
   色（identity）+ 形（丸/ひし形）の二重エンコーディングで目立たせる */
.dot-other { fill: var(--muted); fill-opacity: .28; }
.dot-staff { fill: var(--series-staff); fill-opacity: .85; stroke: var(--card); stroke-width: 1.5; }
.dot-parttime { fill: var(--series-parttime); fill-opacity: .85; stroke: var(--card); stroke-width: 1.5; }
/* 上限を超えてピン留めされた点（三角）。系列色は保ったまま、
   「その他」でもここだけは少し濃くして「切り詰めた」ことを目立たせる */
.dot-clip { stroke: var(--card); stroke-width: 1.5; }
.dot-other.dot-clip { fill-opacity: .55; }

.scatter-legend .swatch-staff { background: var(--series-staff); border-radius: 50%; }
.scatter-legend .swatch-parttime { background: var(--series-parttime); border-radius: 2px; transform: rotate(45deg); }
.scatter-legend .swatch-other { background: var(--muted); opacity: .45; border-radius: 50%; }
.tick { font-size: 10px; fill: var(--muted); text-anchor: end; font-variant-numeric: tabular-nums; }
.tick.mid { text-anchor: middle; }
.tick.end { text-anchor: end; }
.tick.start { text-anchor: start; }
.end-label { fill: var(--ink); font-weight: 700; }

/* 散布図の「右下＝手間をかけたのに読まれていない」領域を先に目立たせる注釈 */
.zone-hint { fill: var(--line); opacity: .6; }
.zone-hint-label { font-size: 10px; fill: var(--muted); }

.tabs { display: flex; gap: .5rem; margin-bottom: .5rem; }
.tabs button {
  padding: .25rem .75rem; font: inherit; font-size: .8125rem; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
}
.tabs button.on { background: var(--ink); color: #fff; border-color: var(--ink); }

#ranking a { color: inherit; }

/* プリセット切替ボタン（控えめ / 一般的な相場） */
#preset-buttons {
  display: flex; align-items: center; flex-wrap: wrap;
  gap: .5rem; margin: 1rem 0 .25rem;
}
#preset-buttons .preset-label { font-size: .75rem; color: var(--muted); }
#preset-buttons button {
  padding: .25rem .75rem; font: inherit; font-size: .8125rem; cursor: pointer;
  background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
}
#preset-buttons button.on { background: var(--ink); color: #fff; border-color: var(--ink); }
#preset-custom { font-size: .75rem; color: var(--warn-ink); }
