/* ==========================================================================
   資格手帳 - デザイントークン
   モチーフ: 電気・設備の現場でよく見る「検査票／下げ札」
   暗い道具箱の中に、色分けされた紙タグが並んでいるイメージ
   ========================================================================== */
:root {
  --bg-base: #1b1d21;
  --bg-elevated: #24272c;
  --bg-elevated-2: #2c3036;
  --line-on-dark: #3a3e45;

  --tag-surface: #f2ecdc;
  --tag-surface-2: #ece4cf;
  --ink: #24211a;
  --ink-soft: #6b6455;

  --text-on-dark: #e8e6df;
  --text-on-dark-soft: #9c9c94;

  --accent-license: #3a5a86;    /* 資格 */
  --accent-license-soft: #cdd8e6;
  --accent-training: #c4881f;   /* 講習 */
  --accent-training-soft: #ecdcb6;
  --accent-competition: #7a3352; /* 大会 */
  --accent-competition-soft: #e3c9d4;

  --status-valid: #3e7a56;
  --status-soon: #c2691b;
  --status-expired: #b0422f;
  --status-none: #8b8579;

  --radius-tag: 14px;
  --radius-sm: 8px;
  --shadow-tag: 0 6px 16px rgba(0, 0, 0, 0.35), 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-pop: 0 12px 32px rgba(0, 0, 0, 0.5);

  --font-display: 'Zen Kaku Gothic New', 'Noto Sans JP', sans-serif;
  --font-body: 'Noto Sans JP', 'Zen Kaku Gothic New', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, monospace;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-base);
  color: var(--text-on-dark);
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: contain;
}
body {
  min-height: 100vh;
  min-height: 100dvh;
}
button { font-family: inherit; }
input, textarea, select { font-family: inherit; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; }
a { color: inherit; }

::selection { background: var(--accent-license); color: #fff; }

:focus-visible {
  outline: 2px solid var(--accent-training);
  outline-offset: 2px;
}

.hidden { display: none !important; }

/* ---------- レイアウト共通 ---------- */
.app-shell {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
}

/* ---------- 共通ボタン ---------- */
.btn-primary {
  width: 100%;
  padding: 13px 16px;
  border: none;
  border-radius: var(--radius-sm);
  background: var(--accent-license);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease;
  margin-top: 8px;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:hover { background: #32507c; }

/* ---------- ログイン / 初期設定 ---------- */
.gate-screen {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.gate-card {
  width: 100%;
  max-width: 360px;
  background: var(--tag-surface);
  color: var(--ink);
  border-radius: var(--radius-tag);
  box-shadow: var(--shadow-pop);
  padding: 32px 28px;
  position: relative;
  overflow: hidden;
}
.gate-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 6px;
  background: var(--accent-license);
}
.gate-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.gate-card h1 {
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 4px;
}
.gate-sub {
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 24px;
  line-height: 1.6;
}
.gate-card label {
  display: block;
  font-size: 12px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  font-weight: 700;
}
.gate-card input[type="password"] {
  width: 100%;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  border: 1.5px solid #d8d0ba;
  background: #fff;
  color: var(--ink);
  font-size: 16px;
  margin-bottom: 8px;
}
.gate-error {
  color: var(--status-expired);
  font-size: 12.5px;
  min-height: 18px;
  margin-bottom: 8px;
  font-weight: 700;
}

/* 生体認証ボタン */
.btn-biometric {
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid var(--accent-license);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--accent-license);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.08s ease, background 0.15s ease;
}
.btn-biometric:active { transform: scale(0.98); }
.btn-biometric:hover { background: #eef2f6; }
.btn-biometric .biometric-icon { font-size: 17px; }
.gate-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  font-family: var(--font-mono);
}
.gate-divider::before,
.gate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: #d8d0ba;
}

/* ---------- ヘッダー ---------- */
.app-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--line-on-dark);
  padding: 18px 20px 14px;
}
.app-header .brand-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}
.app-header h1 {
  font-size: 20px;
  font-weight: 900;
  letter-spacing: 0.01em;
}
.app-header .brand-mark {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-on-dark-soft);
  letter-spacing: 0.1em;
}
.icon-btn {
  background: none;
  border: none;
  color: var(--text-on-dark-soft);
  cursor: pointer;
  font-size: 13px;
  padding: 6px 8px;
  border-radius: var(--radius-sm);
}
.icon-btn:hover { color: var(--text-on-dark); background: var(--bg-elevated-2); }
.header-actions { display: flex; gap: 10px; align-items: flex-start; }
.header-actions-stack {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
/* 統計だけは枠付きで、押せるボタンだと分かるようにする */
.btn-stats {
  flex: 0 0 auto;
  padding: 7px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-on-dark);
  background: var(--bg-elevated-2);
  color: var(--text-on-dark);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.btn-stats:hover { background: var(--bg-base); border-color: var(--text-on-dark-soft); }
.btn-stats:active { transform: scale(0.97); }

/* オーバーレイ表示中は背後をスクロールさせない */
body.overlay-open { overflow: hidden; }

/* サマリー行 */
.summary-row {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  overflow-x: auto;
  padding-bottom: 2px;
}
.summary-chip {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-on-dark);
  color: var(--text-on-dark-soft);
  white-space: nowrap;
}
.summary-chip b { color: var(--text-on-dark); font-weight: 700; }
.summary-chip.warn { border-color: var(--status-expired); color: #e7a897; }

/* フィルタタブ */
.filter-tabs {
  display: flex;
  gap: 6px;
  margin-top: 14px;
}
.filter-tab {
  flex: 1;
  text-align: center;
  padding: 9px 6px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-on-dark);
  background: transparent;
  color: var(--text-on-dark-soft);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
.filter-tab.active {
  background: var(--tag-surface);
  color: var(--ink);
  border-color: var(--tag-surface);
}

/* ---------- リスト ---------- */
.list-scroll {
  flex: 1;
  padding: 18px 16px 100px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.empty-state {
  margin-top: 40px;
  text-align: center;
  color: var(--text-on-dark-soft);
  padding: 0 20px;
}
.empty-state .empty-mark {
  font-family: var(--font-mono);
  font-size: 34px;
  color: var(--line-on-dark);
  margin-bottom: 10px;
}
.empty-state p { font-size: 13.5px; line-height: 1.7; }

/* ---------- タグカード ---------- */
.tag-card {
  position: relative;
  background: var(--tag-surface);
  color: var(--ink);
  border-radius: var(--radius-tag);
  box-shadow: var(--shadow-tag);
  padding: 16px 18px 16px 30px;
  cursor: pointer;
  border-left: 6px solid var(--accent-license);
  transition: transform 0.1s ease;
}
.tag-card:active { transform: scale(0.985); }
.tag-card.cat-training { border-left-color: var(--accent-training); }
.tag-card.cat-competition { border-left-color: var(--accent-competition); }

/* 綴じ穴 */
.tag-card::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--bg-base);
  border: 2px solid rgba(0,0,0,0.25);
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.4);
}

.tag-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
}
.tag-cat {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
  margin-bottom: 3px;
}
.tag-name {
  font-size: 16.5px;
  font-weight: 700;
  line-height: 1.4;
}
.tag-issuer {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 2px;
}

.status-stamp {
  flex: 0 0 auto;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1.5px solid currentColor;
  white-space: nowrap;
}
.status-stamp.valid { color: var(--status-valid); }
.status-stamp.soon { color: var(--status-soon); }
.status-stamp.expired { color: var(--status-expired); }
.status-stamp.none { color: var(--status-none); }
.status-stamp.competition { color: var(--accent-competition); }

.tag-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 12px;
  font-size: 12px;
  color: var(--ink-soft);
}
.tag-meta span b { color: var(--ink); font-family: var(--font-mono); font-weight: 500; }

.tag-attach-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 10px;
  font-size: 11.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
}

/* ---------- FAB ---------- */
.fab {
  position: fixed;
  /* 画面幅が広いときはアプリ本体(最大560px)の右下に寄せる */
  right: max(20px, calc(50% - 280px + 20px));
  bottom: 24px;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--accent-training);
  color: #221a09;
  border: none;
  font-size: 28px;
  font-weight: 400;
  box-shadow: var(--shadow-pop);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  /* スクロール中に影の再描画が起きないよう、独立したレイヤーに載せる */
  will-change: transform;
  transition: transform 0.26s cubic-bezier(0.3, 0.8, 0.3, 1), opacity 0.2s ease;
}
.fab:active { transform: scale(0.92); }
/* 下スクロールでヒョコっと沈み、上スクロールで戻ってくる */
.fab.fab-hidden {
  transform: translateY(110px);
  opacity: 0;
  pointer-events: none;
}
@media (prefers-reduced-motion: reduce) {
  .fab { transition: none; }
}

/* ---------- 詳細/編集オーバーレイ ---------- */
.overlay {
  position: fixed;
  inset: 0;
  background: var(--bg-base);
  z-index: 50;
  display: flex;
  flex-direction: column;
  max-width: 560px;
  margin: 0 auto;
  animation: slide-up 0.22s cubic-bezier(0.2, 0.7, 0.3, 1);
}
@keyframes slide-up {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .overlay { animation: none; }
}
.overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 14px;
  border-bottom: 1px solid var(--line-on-dark);
  background: var(--bg-elevated);
}
.overlay-header h2 { font-size: 16px; }
.overlay-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 18px 40px;
}

.detail-tag-head {
  background: var(--tag-surface);
  color: var(--ink);
  border-radius: var(--radius-tag);
  padding: 20px;
  box-shadow: var(--shadow-tag);
  border-left: 6px solid var(--accent-license);
  margin-bottom: 24px;
}
.detail-tag-head.cat-training { border-left-color: var(--accent-training); }
.detail-tag-head.cat-competition { border-left-color: var(--accent-competition); }
.detail-tag-head h3 { font-size: 19px; font-weight: 900; margin-bottom: 10px; line-height: 1.4; }
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 16px;
  margin-top: 14px;
  font-size: 13px;
}
.detail-grid .field-label {
  font-size: 10.5px;
  color: var(--ink-soft);
  font-family: var(--font-mono);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 2px;
}
.detail-grid .field-value { font-weight: 600; }
.detail-notes {
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink-soft);
  white-space: pre-wrap;
  line-height: 1.6;
}

.section-label {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-label::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--line-on-dark);
}

/* 添付グリッド */
.attach-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-bottom: 18px;
}
.attach-thumb {
  position: relative;
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-elevated-2);
  border: 1px solid var(--line-on-dark);
  cursor: pointer;
}
.attach-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.attach-thumb .pdf-badge {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  flex-direction: column;
  gap: 6px;
  color: var(--text-on-dark-soft);
  font-size: 10px;
  font-family: var(--font-mono);
}
.attach-thumb .del-x {
  position: absolute;
  top: 3px; right: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(0,0,0,0.55);
  color: #fff;
  border: none;
  font-size: 12px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.attach-label {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 4px 6px;
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  color: #fff;
  background: rgba(0,0,0,0.6);
  cursor: pointer;
}
.attach-label-empty { color: #cfcabb; font-weight: 500; background: rgba(0,0,0,0.45); }

/* ラベル選択シート */
.label-sheet {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.label-sheet-inner {
  width: 100%;
  max-width: 480px;
  background: var(--bg-elevated);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  padding: 14px 14px calc(14px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.label-sheet-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-on-dark-soft);
  text-align: center;
  padding: 6px 0 8px;
}
.label-opt {
  width: 100%;
  padding: 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-on-dark);
  background: var(--bg-elevated-2);
  color: var(--text-on-dark);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}
.label-opt:active { transform: scale(0.99); }
.label-opt-clear { color: var(--status-expired); border-color: var(--status-expired); background: transparent; }
.label-opt-cancel { background: transparent; color: var(--text-on-dark-soft); }

.upload-tile {
  aspect-ratio: 1/1;
  border-radius: var(--radius-sm);
  border: 1.5px dashed var(--line-on-dark);
  color: var(--text-on-dark-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 11px;
  cursor: pointer;
  background: none;
  font-family: var(--font-mono);
}
.upload-tile:hover { border-color: var(--accent-training); color: var(--text-on-dark); }
.upload-tile .plus { font-size: 22px; line-height: 1; }

.detail-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
}
.btn-ghost {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-on-dark);
  background: transparent;
  color: var(--text-on-dark);
  font-weight: 700;
  font-size: 13.5px;
  cursor: pointer;
}
.btn-ghost:hover { background: var(--bg-elevated-2); }
.btn-danger {
  color: var(--status-expired);
  border-color: var(--status-expired);
}

/* ---------- フォーム ---------- */
.form-field { margin-bottom: 16px; }
.form-field label {
  display: block;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-on-dark-soft);
  margin-bottom: 6px;
}
.form-field input[type="text"],
.form-field input[type="date"],
.form-field textarea,
.form-field select {
  width: 100%;
  padding: 12px 13px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-on-dark);
  background: var(--bg-elevated);
  color: var(--text-on-dark);
  font-size: 15px;
}
.form-field textarea { min-height: 70px; resize: vertical; }
.category-toggle {
  display: flex;
  gap: 8px;
}
.category-toggle button {
  flex: 1;
  padding: 12px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--line-on-dark);
  background: var(--bg-elevated);
  color: var(--text-on-dark-soft);
  font-weight: 700;
  cursor: pointer;
}
.category-toggle button.active.cat-license {
  background: var(--accent-license);
  border-color: var(--accent-license);
  color: #fff;
}
.category-toggle button.active.cat-training {
  background: var(--accent-training);
  border-color: var(--accent-training);
  color: #221a09;
}
.category-toggle button.active.cat-competition {
  background: var(--accent-competition);
  border-color: var(--accent-competition);
  color: #fff;
}

/* ---------- ライトボックス ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.92);
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 16px;
}
.lightbox img { max-width: 100%; max-height: 78vh; object-fit: contain; }
.lightbox iframe { width: 100%; height: 78vh; border: none; border-radius: 6px; background: #fff; }
.lightbox-close {
  position: absolute;
  top: 16px; right: 16px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-elevated);
  color: var(--text-on-dark);
  border: none;
  font-size: 18px;
  cursor: pointer;
}
.lightbox-caption {
  margin-top: 14px;
  color: var(--text-on-dark-soft);
  font-size: 12.5px;
  font-family: var(--font-mono);
  text-align: center;
}

/* トースト */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--tag-surface);
  color: var(--ink);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: var(--shadow-pop);
  z-index: 100;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-6px); }

.spinner {
  width: 18px; height: 18px;
  border: 2.5px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (min-width: 561px) {
  .app-shell { box-shadow: 0 0 60px rgba(0,0,0,0.5); }
}

/* ---------- 統計（年間取得数・取得タイムライン） ---------- */
.stats-hero {
  position: relative;
  overflow: hidden;
  background: var(--tag-surface);
  color: var(--ink);
  border-radius: var(--radius-tag);
  box-shadow: var(--shadow-tag);
  padding: 20px 20px 20px 26px;
  margin-bottom: 26px;
}
/* 3カテゴリ合算であることを示す3色の帯（単色だと「講習」と紛らわしいため） */
.stats-hero::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  background: linear-gradient(
    180deg,
    var(--accent-license) 0%,
    var(--accent-license) 33.33%,
    var(--accent-training) 33.33%,
    var(--accent-training) 66.66%,
    var(--accent-competition) 66.66%,
    var(--accent-competition) 100%
  );
}
.stats-hero .stats-hero-label {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  text-transform: uppercase;
}
.stats-hero .stats-hero-num {
  font-family: var(--font-display);
  font-size: 40px;
  font-weight: 900;
  line-height: 1.2;
  margin-top: 2px;
}
.stats-hero .stats-hero-num span { font-size: 16px; font-weight: 700; margin-left: 4px; }
.stats-hero .stats-hero-sub {
  font-size: 12px;
  color: var(--ink-soft);
  margin-top: 6px;
}

.stats-legend {
  display: flex;
  gap: 16px;
  margin-bottom: 14px;
  font-size: 12px;
  color: var(--text-on-dark-soft);
}
.stats-legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend-dot { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.legend-dot.license { background: var(--accent-license); }
.legend-dot.training { background: var(--accent-training); }
.legend-dot.competition { background: var(--accent-competition); }

.stats-chart {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  height: 150px;
  padding: 0 4px 8px;
  margin-bottom: 30px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-on-dark);
}
.stats-bar-col {
  flex: 1 0 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  gap: 6px;
}
.stats-bar-count {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-on-dark);
  min-height: 16px;
}
.stats-bar-track {
  position: relative;
  width: 26px;
  min-height: 3px;
  border-radius: 4px 4px 2px 2px;
  overflow: hidden;
  background: var(--bg-elevated-2);
}
.bar-seg { position: absolute; left: 0; width: 100%; }
.bar-seg.license { background: var(--accent-license); bottom: 0; }
.bar-seg.training { background: var(--accent-training); }
.bar-seg.competition { background: var(--accent-competition); }
.stats-bar-year {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-on-dark-soft);
}

.timeline-year-header {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  color: var(--text-on-dark);
  margin: 22px 0 10px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.timeline-year-header::after { content: ''; flex: 1; height: 1px; background: var(--line-on-dark); }
.timeline-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 4px;
  border-bottom: 1px solid var(--line-on-dark);
  cursor: pointer;
}
.timeline-item:hover { background: var(--bg-elevated); }
.timeline-dot { width: 9px; height: 9px; border-radius: 50%; flex: 0 0 auto; }
.timeline-dot.license { background: var(--accent-license); }
.timeline-dot.training { background: var(--accent-training); }
.timeline-dot.competition { background: var(--accent-competition); }
.timeline-date {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-on-dark-soft);
  flex: 0 0 52px;
}
.timeline-name { font-size: 13.5px; color: var(--text-on-dark); }
.timeline-empty-note {
  font-size: 12.5px;
  color: var(--text-on-dark-soft);
  line-height: 1.7;
  margin-top: 10px;
}

/* ---------- 生体認証端末の管理 ---------- */
.devices-intro {
  font-size: 13px;
  color: var(--text-on-dark-soft);
  line-height: 1.7;
  margin: 0 0 20px;
}
.device-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 4px;
  border-bottom: 1px solid var(--line-on-dark);
}
.device-name { font-size: 14px; font-weight: 700; color: var(--text-on-dark); }
.device-date { font-family: var(--font-mono); font-size: 11px; color: var(--text-on-dark-soft); margin-top: 2px; }
.device-remove { flex: 0 0 auto; padding: 8px 14px; font-size: 12.5px; }
