/* 関吹ポータル v2.9 デザイントークン「演奏会プログラム」 */
:root {
  --ink: #232A36; --ink-muted: #6B7280;
  --paper: #F7F5F0; --card: #FFFFFF; --line: #E5E1D8; --thead: #F0EDE4;
  --navy: #2E5698; --brass: #96721F; --brass-deep: #7A5C19;
  --ok: #1A7F37; --error: #B00020;
  --radius: 12px; --shadow: 0 2px 8px rgba(35,42,54,.08);
  --font-body: -apple-system, "Hiragino Sans", "Yu Gothic", sans-serif;
  --font-display: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  color-scheme: light;
}
* { box-sizing: border-box; }
body { font-family: var(--font-body); margin: 0; background: var(--paper); color: var(--ink); }
.wrap { max-width: 960px; margin: 0 auto; padding: 20px 16px 48px; }
.wrap-narrow { max-width: 640px; }

/* 題字＋五線罫 */
.page-title { font-family: var(--font-display); font-weight: 600; font-size: 1.45rem; margin: 0 0 2px; letter-spacing: .02em; }
.staff-rule { height: 17px; margin: 6px 0 18px; background: repeating-linear-gradient(to bottom, var(--line) 0 1px, transparent 1px 5px); background-size: 100% 17px; background-repeat: no-repeat; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }
h3 { font-size: .95rem; margin: 20px 0 8px; }

.card { background: var(--card); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); margin-bottom: 16px; }
.muted { color: var(--ink-muted); font-size: .85rem; }
.ok { color: var(--ok); } .error { color: var(--error); }
a { color: var(--navy); }
a.back { color: var(--brass-deep); margin-right: 12px; text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }

/* ボタン・入力（タッチ44px・iOSズーム防止16px） */
button, .btn { min-height: 44px; padding: 10px 18px; border: 0; border-radius: 8px; background: var(--brass); color: #fff; cursor: pointer; font-size: 16px; font-family: inherit; }
button:hover, .btn:hover { background: var(--brass-deep); }
button.small { min-height: 36px; padding: 6px 12px; font-size: .85rem; }
button.ghost { background: transparent; color: var(--brass-deep); border: 1px solid var(--brass-deep); }
button.ghost:hover { background: var(--brass-deep); color: #fff; }
label { display: block; margin: 10px 0 4px; font-size: .9rem; }
input, select { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 16px; font-family: inherit; background: #fff; }
input.cell { min-height: 36px; padding: 4px 6px; font-size: 16px; width: 4.2em; }
input.edit-cell { min-height: 40px; padding: 6px 8px; font-size: 16px; width: 100%; min-width: 8em; }
select.wide, input.wide { width: 100%; }

/* テーブル */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; background: var(--card); }
th, td { padding: 8px 10px; border-bottom: 1px solid var(--line); font-size: .85rem; text-align: left; vertical-align: middle; white-space: nowrap; }
th { background: var(--thead); font-weight: 600; }
.rank-badge { display: inline-block; min-width: 1.6em; text-align: center; font-weight: bold; color: var(--brass-deep); font-variant-numeric: tabular-nums; }

/* グラフ・折りたたみ表 */
.chart-block { margin: 14px 0; }
.chart-block svg { display: block; width: 100%; height: auto; }
.chart-block text { fill: var(--ink); font-family: var(--font-body); }
details.table-fold { margin: 4px 0 14px; }
details.table-fold > summary { cursor: pointer; color: var(--navy); font-size: .9rem; padding: 10px 0; list-style-position: inside; }

/* ステータス行・バッジ（ハブ／報告） */
.status-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: .95rem; flex-wrap: wrap; }
.status-row:last-child { border-bottom: 0; }
.status-value { font-family: var(--font-display); font-size: 1.1rem; }
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .8rem; background: var(--brass); color: #fff; }
.badge.done { background: var(--ok); }

/* ナビタイル（ハブ・ポータル） */
.nav-primary { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; border-radius: var(--radius); background: var(--brass); color: #fff; text-decoration: none; font-size: 1.05rem; font-weight: 600; }
.nav-primary:hover { background: var(--brass-deep); }
.nav-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 12px; }
.nav-tile { display: flex; flex-direction: column; gap: 6px; background: var(--card); border-radius: var(--radius); padding: 16px 14px; text-decoration: none; color: inherit; box-shadow: var(--shadow); min-height: 44px; }
.nav-tile:hover, .nav-tile:focus-visible { box-shadow: 0 4px 12px rgba(35,42,54,.15); }
.nav-tile .tile-icon { font-size: 1.5rem; line-height: 1; }
.nav-tile .tile-name { font-size: .95rem; font-weight: 600; }
.nav-tile .tile-desc { font-size: .78rem; color: var(--ink-muted); }

/* タブ（集計） */
.tabs { display: flex; gap: 2px; overflow-x: auto; border-bottom: 1px solid var(--line); margin-bottom: 16px; }
.tab { min-height: 44px; padding: 10px 14px; background: transparent; color: var(--ink-muted); border: 0; border-bottom: 3px solid transparent; border-radius: 0; font-size: .95rem; white-space: nowrap; cursor: pointer; }
.tab:hover { background: transparent; color: var(--ink); }
.tab[aria-selected="true"] { color: var(--ink); font-weight: 700; border-bottom-color: var(--brass); }

/* 期間タイル（報告） */
.period-tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.period-tile { display: flex; flex-direction: column; gap: 4px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); color: var(--ink); cursor: pointer; font-size: .9rem; text-align: left; }
.period-tile.active { border-color: var(--brass); background: var(--brass); color: #fff; }
.period-tile.active .muted, .period-tile.active .tile-status { color: #f5edda; }
.tile-status { font-size: .8rem; color: var(--ink-muted); }

.hm-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.hm-row input { width: 5em; }
.hm-pair { display: inline-flex; gap: 4px; align-items: center; }
.sub-card { border: 1px solid var(--line); border-radius: 8px; padding: 14px; margin-top: 14px; background: #FBFAF6; }
.summary { margin: 8px 0; font-size: .9rem; }
[hidden] { display: none !important; }

@media (max-width: 480px) {
  .wrap { padding: 16px 12px 40px; }
  .card { padding: 16px; }
  .nav-tiles { grid-template-columns: repeat(2, 1fr); }
}
