/* スマホの更新あと何年：黒地に機種（メーカー）の色の帯。年表と残りのメーター */
:root {
  --bg: #0b0d12; --fg: #e6e9ef; --muted: #9aa3b2; --line: #262b36; --card: #141821;
  --accent: #5eead4;
  --ok: #5eead4; --warn: #fbbf24; --end: #f87171;
}
body { background: var(--bg); color: var(--fg); }
.site-header { border-bottom: 1px solid var(--line); background: #07080c; }
.site-header .site-name { color: #fff; letter-spacing: 0.02em; }
h1 { font-size: 1.45rem; }
h2 { border-left: none; padding-left: 0; font-size: 1.15rem; letter-spacing: 0.02em; }
h2::before { content: ""; display: inline-block; width: 18px; height: 4px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin-right: 8px; }
a { color: var(--accent); }
th { background: #10131a; }
th, td { border-color: var(--line); }
select { background: #0f1218; color: var(--fg); border-color: #333a48; }
.lead { color: var(--muted); }

/* 早見のパネル */
.finder { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 16px; margin: 16px 0; }
.finder .row { display: grid; grid-template-columns: 1fr; gap: 10px; }
.finder label { margin-top: 0; font-size: 0.85rem; color: var(--muted); }

.result { margin-top: 16px; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #0f1218; }
.result[hidden] { display: none; }
.band { height: 10px; background: var(--maker, var(--accent)); }
.result-body { padding: 14px 16px 16px; }
.result .model { font-weight: 700; font-size: 1.05rem; margin: 0; }
.result .remain-label { margin: 10px 0 0; color: var(--muted); font-size: 0.85rem; }
.result .remain { margin: 0; font-size: 2.3rem; line-height: 1.2; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--state, var(--ok)); }
.result .remain small { font-size: 1rem; font-weight: 600; color: var(--muted); margin-left: 4px; }
.result[data-status="ended"] { --state: var(--end); }
.result[data-status="soon"] { --state: var(--warn); }
.result[data-status="unknown"] { --state: var(--muted); }

/* 残りのメーター（使った期間 → 残り） */
.meter { position: relative; height: 14px; border-radius: 7px; background: #232836; margin: 12px 0 4px; overflow: hidden; }
.meter .used { position: absolute; inset: 0 auto 0 0; background: repeating-linear-gradient(135deg, #3a4152 0 6px, #2f3544 6px 12px); }
.meter .left { position: absolute; top: 0; bottom: 0; right: 0; background: var(--state, var(--ok)); }
.meter-scale { display: flex; justify-content: space-between; font-size: 0.75rem; color: var(--muted); font-variant-numeric: tabular-nums; }

.facts-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 14px 0 0; }
.facts-grid div { background: var(--card); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.facts-grid dt { font-size: 0.75rem; color: var(--muted); }
.facts-grid dd { margin: 0; font-weight: 700; font-variant-numeric: tabular-nums; }
.source { font-size: 0.8rem; color: var(--muted); margin: 10px 0 0; overflow-wrap: anywhere; }

/* 年表（タイムライン）：横軸は年。機種ごとに発売→保証の終わりの帯 */
.timeline { margin: 12px 0 8px; }
.tl-axis, .tl-row { display: grid; grid-template-columns: 8.5em 1fr; align-items: center; gap: 8px; }
.tl-axis { font-size: 0.7rem; color: var(--muted); position: sticky; top: 0; background: var(--bg); padding: 4px 0; z-index: 1; }
.tl-years { position: relative; height: 1.2em; }
.tl-years span { position: absolute; transform: translateX(-50%); }
.tl-row { padding: 3px 0; border-top: 1px solid #171b24; }
.tl-name { font-size: 0.8rem; line-height: 1.3; overflow-wrap: anywhere; }
.tl-track { position: relative; height: 12px; background: repeating-linear-gradient(90deg, #1a1e28 0 1px, transparent 1px calc(100% / var(--span, 14))); border-radius: 3px; }
.tl-bar { position: absolute; top: 1px; bottom: 1px; border-radius: 3px; background: var(--maker, var(--accent)); }
.tl-bar.ended { opacity: 0.35; }
.tl-bar.unknown { background: repeating-linear-gradient(90deg, var(--maker) 0 4px, transparent 4px 7px); }
.tl-today { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; box-shadow: 0 0 0 1px #0b0d12; }
.tl-maker { margin: 18px 0 4px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tl-maker::before { content: ""; width: 12px; height: 12px; border-radius: 3px; background: var(--maker); }
.legend { font-size: 0.8rem; color: var(--muted); }
.legend i { display: inline-block; width: 18px; height: 8px; border-radius: 2px; background: var(--accent); vertical-align: middle; margin: 0 4px 0 8px; }
.legend i.ended { opacity: 0.35; }
.legend i.unknown { background: repeating-linear-gradient(90deg, var(--accent) 0 4px, transparent 4px 7px); }
.legend i.today { width: 2px; height: 12px; background: #fff; }

/* メーカー別ランキング */
.rank { list-style: none; padding: 0; margin: 12px 0; }
.rank li { background: var(--card); border: 1px solid var(--line); border-left: 6px solid var(--maker); border-radius: 12px; padding: 10px 12px; margin-bottom: 10px; }
.rank .head { display: flex; align-items: baseline; gap: 10px; }
.rank .pos { font-weight: 800; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank .name { font-weight: 700; flex: 1; }
.rank .years { font-size: 1.6rem; font-weight: 800; font-variant-numeric: tabular-nums; color: #fff; }
.rank .bar { height: 8px; border-radius: 4px; background: #232836; margin: 6px 0; overflow: hidden; }
.rank .bar span { display: block; height: 100%; background: var(--maker); }
.rank .detail, .rank-ref .detail { font-size: 0.8rem; color: var(--muted); margin: 0; }
/* 参考（約束の無いメーカーの実績）：順位の枠と見分けがつくよう、点線の枠・小さめの数字 */
.rank-ref { border: 1px dashed #3a4152; border-left: 6px dashed var(--maker); border-radius: 12px; padding: 10px 12px; margin: 4px 0 12px; }
.rank-ref .head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 4px; }
.rank-ref .pos { font-size: 0.75rem; font-weight: 700; color: #0b0d12; background: var(--muted); border-radius: 4px; padding: 0 6px; }
.rank-ref .name { font-weight: 700; flex: 1; }
.rank-ref .years { font-size: 1.1rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.rank-ref .years small { font-size: 0.75rem; margin-left: 2px; }

.sources { padding-left: 1.2em; font-size: 0.88rem; }
.sources li { margin-bottom: 10px; overflow-wrap: anywhere; }
.note { font-size: 0.85rem; color: var(--muted); }
.table-wrap td { white-space: normal; }
