/* ==========================================================================
   pkg-inspector UI
   DESIGN.md（SmartHR ベース）のトークンとコンポーネント定義。
   - Tailwind（Play CDN）はレイアウト用ユーティリティにのみ使う
   - 見た目を持つ部品（ボタン / 入力 / テーブル / バッジ / カード等）はここで定義する
   ========================================================================== */

/* ---- 和文フォント: Windows で游ゴシック Medium を 400 に割り当てる ---- */
@font-face { font-family: AdjustedYuGothic; font-weight: 400; src: local("Yu Gothic Medium"); }
@font-face { font-family: AdjustedYuGothic; font-weight: 700; src: local("Yu Gothic Bold"); }

/* ---- Tokens ---- */
:root {
  --font-sans: AdjustedYuGothic, "Yu Gothic", YuGothic, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Noto Sans JP", system-ui, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  /* カラーは本番の配色（slate ニュートラル + blue-600 系）に合わせている。
     背景は旧 UI と同じ slate-50 → indigo-50 のグラデーション（body に指定） */
  --c-bg: #f8fafc;
  --c-bg-to: #eef2ff;
  --c-surface: #ffffff;
  --c-surface-alt: #f1f5f9;
  --c-head: #f1f5f9;
  --c-border: #e2e8f0;
  --c-border-strong: #cbd5e1;
  --c-text: #0f172a;
  --c-text-strong: #334155;
  --c-text-sub: #64748b;
  --c-text-disabled: #94a3b8;

  --c-brand: #06b6d4;
  --c-primary: #2563eb;
  --c-primary-hover: #1d4ed8;
  --c-primary-soft: #e0eaff;
  --c-primary-text: #1e40af;
  --c-link: #2563eb;

  --c-danger: #dc2626;
  --c-danger-hover: #b91c1c;
  --c-danger-soft: #fee2e2;
  --c-danger-text: #b91c1c;
  --c-warning: #f59e0b;
  --c-warning-soft: #fef3c7;
  --c-warning-text: #92400e;
  --c-success: #16a34a;
  --c-success-hover: #15803d;
  --c-success-soft: #dcfce7;
  --c-success-text: #15803d;
  --c-accent: #f97316;
  --c-accent-soft: #ffedd5;
  --c-accent-text: #c2410c;

  --radius: 6px;
  --radius-lg: 10px;
  --shadow-1: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
  --shadow-2: 0 10px 30px rgba(15, 23, 42, .15);
  --ring: 0 0 0 3px rgba(37, 99, 235, .3);

  --sidebar-w: 240px;
  --topbar-h: 56px;
  --control-h: 40px;
  --control-h-sm: 32px;
}

/* ---- Base ---- */
html { font-size: 16px; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--c-text);
  background: linear-gradient(180deg, var(--c-bg), var(--c-bg-to)) fixed;
  overflow-wrap: break-word;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
h1, h2, h3, h4 { margin: 0; font-weight: 700; line-height: 1.25; }
p { margin: 0; }
svg.icon { width: 1.1em; height: 1.1em; flex: none; }
.link { color: var(--c-link); text-decoration: underline; text-underline-offset: 2px; }
.link:hover { color: var(--c-primary-hover); }
.mono { font-family: var(--font-mono); font-size: .8125rem; }
.text-sub { color: var(--c-text-sub); }
.divider { height: 1px; background: var(--c-border); }

/* ---- App layout ---- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  position: sticky; top: 0;
  height: 100vh;
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  display: flex; flex-direction: column;
  background: var(--c-surface);
  border-right: 1px solid var(--c-border);
  overflow-y: auto;
  z-index: 40;
}
.sidebar-brand { display: flex; align-items: center; gap: 10px; padding: 16px 16px 12px; }
.sidebar-brand a { display: flex; align-items: center; gap: 10px; color: inherit; text-decoration: none; min-width: 0; }
.sidebar-brand img { width: 36px; height: 36px; object-fit: contain; flex: none; }
.sidebar-brand-name { font-weight: 700; font-size: .9375rem; line-height: 1.2; }
.sidebar-brand-sub { font-size: .6875rem; color: var(--c-text-sub); }
.sidebar .sidebar-close { margin-left: auto; display: none; }

.sidebar-tenant { margin: 4px 12px 8px; padding: 10px 12px; background: var(--c-surface-alt); border-radius: var(--radius); }
.sidebar-tenant-label { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; color: var(--c-text-sub); margin-bottom: 4px; }
.sidebar-tenant-name { font-size: .875rem; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-tenant .select { width: 100%; }

.sidebar-nav { display: flex; flex-direction: column; gap: 2px; padding: 4px 12px; }
.sidebar-section { padding: 14px 12px 4px; font-size: .6875rem; font-weight: 700; letter-spacing: .08em; color: var(--c-text-sub); }
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius);
  color: var(--c-text); font-size: .9375rem; font-weight: 500; text-decoration: none;
  transition: background .12s;
}
.nav-link svg { width: 18px; height: 18px; flex: none; color: var(--c-text-sub); }
.nav-link:hover { background: var(--c-surface-alt); }
.nav-link.is-active { background: var(--c-primary-soft); color: var(--c-primary); font-weight: 700; }
.nav-link.is-active svg { color: var(--c-primary); }

.sidebar-footer { margin-top: auto; padding: 12px; border-top: 1px solid var(--c-border); }
.usage { padding: 4px 4px 8px; }
.usage-title { font-size: .6875rem; font-weight: 700; letter-spacing: .06em; color: var(--c-text-sub); margin-bottom: 2px; }
.usage-row { display: flex; justify-content: space-between; font-size: .75rem; color: var(--c-text-sub); margin-top: 6px; }
.usage-row strong { color: var(--c-text); font-variant-numeric: tabular-nums; }
.progress { height: 6px; background: var(--c-surface-alt); border-radius: 999px; overflow: hidden; margin-top: 4px; }
.progress-bar { height: 100%; width: 0; background: var(--c-primary); border-radius: 999px; transition: width .3s; }
.progress-bar.is-alt { background: var(--c-brand); }
.sidebar-user { display: flex; align-items: center; gap: 10px; margin-top: 8px; padding: 6px 4px; min-width: 0; }
.sidebar-user a { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; color: inherit; text-decoration: none; }
.sidebar-user a:hover .sidebar-user-mail { color: var(--c-primary); }
.avatar {
  width: 32px; height: 32px; border-radius: 999px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary);
  font-size: .8125rem; font-weight: 700; text-transform: uppercase;
}
.sidebar-user-mail { font-size: .8125rem; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-user-role { font-size: .6875rem; color: var(--c-text-sub); }

.main { flex: 1; min-width: 0; padding: 24px 32px 48px; }
.main-inner { max-width: 1280px; margin: 0 auto; }
.main-inner.is-narrow { max-width: 40rem; }
.main-inner.is-medium { max-width: 56rem; }

.topbar { display: none; }
.sidebar-backdrop { display: none; }

@media (max-width: 959px) {
  .app { flex-direction: column; }
  .topbar {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 8px;
    height: var(--topbar-h); padding: 0 8px 0 4px;
    background: var(--c-surface); border-bottom: 1px solid var(--c-border);
  }
  .topbar-brand { display: flex; align-items: center; gap: 8px; color: inherit; text-decoration: none; font-weight: 700; font-size: .9375rem; min-width: 0; }
  .topbar-brand img { width: 28px; height: 28px; }
  .sidebar {
    position: fixed; top: 0; left: 0; height: 100vh; height: 100dvh;
    transform: translateX(-100%); transition: transform .2s ease; z-index: 50;
  }
  .sidebar.is-open { transform: translateX(0); box-shadow: var(--shadow-2); }
  .sidebar .sidebar-close { display: inline-flex; }
  .sidebar-backdrop { position: fixed; inset: 0; z-index: 45; background: rgba(15, 23, 42,.45); }
  .sidebar-backdrop.is-open { display: block; }
  .main { padding: 16px 16px 40px; }
}

/* ---- Page header / sections ---- */
.page-header { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin-bottom: 20px; }
.page-title { font-size: 1.5rem; font-weight: 700; line-height: 1.25; }
.page-subtitle { margin-top: 4px; font-size: .875rem; color: var(--c-text-sub); }
.page-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.page-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.section-title { font-size: 1.125rem; font-weight: 700; margin-bottom: 12px; }

/* ---- Card ---- */
.card { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.card-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; padding: 14px 20px; border-bottom: 1px solid var(--c-border); }
.card-title { font-size: 1rem; font-weight: 700; }
.card-body { padding: 20px; }
.card-footer { padding: 12px 20px; border-top: 1px solid var(--c-border); background: var(--c-bg); border-radius: 0 0 var(--radius-lg) var(--radius-lg); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: var(--control-h); padding: 0 16px;
  border-radius: var(--radius); border: 1px solid transparent;
  font: inherit; font-size: .9375rem; font-weight: 700; line-height: 1; white-space: nowrap;
  color: var(--c-text); background: transparent;
  cursor: pointer; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s;
  -webkit-appearance: none; appearance: none;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible { outline: none; box-shadow: var(--ring); }
.btn:disabled, .btn[aria-disabled="true"], .btn.is-disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn-primary { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); }
.btn-secondary { background: var(--c-surface); color: var(--c-primary); border-color: var(--c-primary); }
.btn-secondary:hover { background: var(--c-primary-soft); }
.btn-ghost { background: var(--c-surface); color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface-alt); border-color: var(--c-border-strong); }
.btn-danger { background: var(--c-danger); color: #fff; border-color: var(--c-danger); }
.btn-danger:hover { background: var(--c-danger-hover); border-color: var(--c-danger-hover); }
.btn-danger-ghost { background: var(--c-surface); color: var(--c-danger); border-color: var(--c-border); }
.btn-danger-ghost:hover { background: var(--c-danger-soft); border-color: var(--c-danger); }
.btn-success { background: var(--c-success); color: #fff; border-color: var(--c-success); }
.btn-success:hover { background: var(--c-success-hover); border-color: var(--c-success-hover); }
.btn-text { background: transparent; color: var(--c-link); padding: 0 8px; }
.btn-text:hover { background: var(--c-primary-soft); }
.btn-sm { height: var(--control-h-sm); padding: 0 12px; font-size: .8125rem; }
.btn-sm svg { width: 14px; height: 14px; }
.btn-lg { height: 48px; padding: 0 24px; font-size: 1rem; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon.btn-sm { width: var(--control-h-sm); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; border-radius: var(--radius); border: 0;
  background: transparent; color: var(--c-text); cursor: pointer;
}
.icon-btn:hover { background: var(--c-surface-alt); }
.icon-btn svg { width: 22px; height: 22px; }

/* ---- Forms ---- */
.input, .select, .textarea {
  display: block; width: 100%; height: var(--control-h); padding: 0 12px;
  font: inherit; font-size: .9375rem; line-height: 1.5; color: var(--c-text);
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius);
  transition: border-color .12s, box-shadow .12s;
  -webkit-appearance: none; appearance: none;
}
.textarea { height: auto; min-height: 6rem; padding: 8px 12px; resize: vertical; }
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px;
}
.input::placeholder, .textarea::placeholder { color: var(--c-text-disabled); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--c-primary); box-shadow: var(--ring); }
.input:disabled, .select:disabled { background: var(--c-surface-alt); color: var(--c-text-sub); }
.input.is-invalid, .textarea.is-invalid { border-color: var(--c-danger); }
.input-sm, .select-sm { height: var(--control-h-sm); font-size: .875rem; padding-left: 10px; padding-right: 10px; }
.select-sm { padding-right: 30px; width: auto; }
.field { margin-bottom: 16px; }
.field:last-child { margin-bottom: 0; }
.label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 700; color: var(--c-text); }
.label .req { margin-left: 4px; font-size: .75rem; color: var(--c-danger); }
.help { margin-top: 6px; font-size: .8125rem; color: var(--c-text-sub); }
.field-error { margin-top: 6px; font-size: .8125rem; color: var(--c-danger); }
.input-affix { position: relative; }
.input-affix .input { padding-right: 44px; }
.input-affix-btn {
  position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
  width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--c-text-sub); cursor: pointer;
}
.input-affix-btn:hover { background: var(--c-surface-alt); color: var(--c-text); }
.input-affix-btn svg { width: 20px; height: 20px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: .9375rem; cursor: pointer; }
.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--c-primary); }
.check-group { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.checkbox { width: 18px; height: 18px; margin: 0; accent-color: var(--c-primary); cursor: pointer; vertical-align: middle; }
.file { display: block; width: 100%; font-size: .875rem; color: var(--c-text-sub); }
.file::file-selector-button {
  margin-right: 12px; height: var(--control-h-sm); padding: 0 12px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text);
  font: inherit; font-size: .8125rem; font-weight: 700; cursor: pointer;
}
.file::file-selector-button:hover { background: var(--c-surface-alt); }
.form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 24px; }

/* ---- Filter bar ---- */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
/* :where で詳細度を下げ、Tailwind の w-* が上書きできるようにする */
:where(.filter-bar) .input, :where(.filter-bar) .select { width: auto; }
.filter-bar .spacer { flex: 1 1 auto; }
.filter-range { display: inline-flex; align-items: center; gap: 6px; }
.filter-range .sep { color: var(--c-text-sub); }
@media (max-width: 599px) {
  .filter-bar .input, .filter-bar .select, .filter-range { width: 100%; }
  .filter-range .input { flex: 1; width: auto; min-width: 0; }
}

/* ---- Table ---- */
.table-wrap { background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); overflow-x: auto; }
/* table-layout: fixed — 列幅は見出し（th）の指定だけで決まり、行の内容やページによって動かない。
   幅が足りないときは .table-wrap 内で横スクロールする */
.table { width: 100%; min-width: 52rem; border-collapse: collapse; font-size: .875rem; table-layout: fixed; }
.table thead th {
  background: var(--c-head); color: var(--c-text-strong);
  font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-align: left; white-space: nowrap;
  padding: 10px 16px; border-bottom: 1px solid var(--c-border);
}
.table tbody td { padding: 12px 16px; border-bottom: 1px solid var(--c-border); vertical-align: middle; overflow-wrap: anywhere; }
.table tbody tr:last-child td { border-bottom: 0; }
.table tbody tr:hover td { background: var(--c-bg); }
.table .fit { white-space: nowrap; }
/* 列幅クラス（th に付ける。幅を指定しない列は残り幅を等分する） */
.table .col-id { width: 4rem; white-space: nowrap; }
.table .col-badge { width: 6.5rem; white-space: nowrap; }
.table .col-date { width: 10rem; white-space: nowrap; }
.table .col-check { width: 4rem; white-space: nowrap; }
.table .col-thumb { width: 9.5rem; white-space: nowrap; }
.table .col-actions-s { width: 7rem; white-space: nowrap; }   /* 小ボタン 1 つ */
.table .col-actions-l { width: 17rem; white-space: nowrap; }  /* 小ボタン 2〜3 つ */
.table .col-form-m { width: 16rem; white-space: nowrap; }     /* 小入力 + 小ボタン */
.table .col-form-l { width: 18rem; white-space: nowrap; }     /* 幅広入力 + 小ボタン */
.table .num { text-align: right; font-variant-numeric: tabular-nums; }
.table .center { text-align: center; }
.table .nowrap { white-space: nowrap; }
.table .actions { text-align: right; white-space: nowrap; }
.table .actions > * + * { margin-left: 6px; }
.table .actions form { display: inline-flex; align-items: center; gap: 6px; margin: 0; vertical-align: middle; }
.table .mono { font-family: var(--font-mono); font-size: .8125rem; }
.table .empty { padding: 40px 16px; text-align: center; color: var(--c-text-sub); }
.table .thumb {
  display: block; height: 80px; width: auto; max-width: 120px; object-fit: contain;
  border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface-alt); cursor: zoom-in;
}
.table-sort { display: inline-flex; align-items: center; gap: 4px; color: inherit; text-decoration: none; }
.table-sort:hover { color: var(--c-primary); }
.table-sort svg { width: 12px; height: 12px; }
.table-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; font-size: .8125rem; color: var(--c-text-sub); }

/* ---- Badges ---- */
.badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: .75rem; font-weight: 700; line-height: 1; white-space: nowrap;
  background: var(--c-surface-alt); color: var(--c-text-sub);
}
.badge-sm { height: 18px; padding: 0 6px; font-size: .6875rem; }
.badge-success { background: var(--c-success-soft); color: var(--c-success-text); }
.badge-danger { background: var(--c-danger-soft); color: var(--c-danger-text); }
.badge-warning { background: var(--c-warning-soft); color: var(--c-warning-text); }
.badge-info { background: var(--c-primary-soft); color: var(--c-primary-text); }
.badge-accent { background: var(--c-accent-soft); color: var(--c-accent-text); }
.badge-dark { background: var(--c-text); color: #fff; }
.badge-outline { background: var(--c-surface); border: 1px solid var(--c-border); color: var(--c-text); }
.badge .dot { width: 6px; height: 6px; border-radius: 999px; background: currentColor; }
.score { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

/* ---- Pagination ---- */
.pagination { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.page-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 32px; height: 32px; padding: 0 8px;
  border: 1px solid var(--c-border); border-radius: var(--radius);
  background: var(--c-surface); color: var(--c-text); font-size: .8125rem; text-decoration: none;
}
.page-btn svg { width: 14px; height: 14px; }
.page-btn:hover { background: var(--c-surface-alt); }
.page-btn.is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.page-btn.is-disabled { color: var(--c-text-disabled); pointer-events: none; }
.page-gap { padding: 0 4px; color: var(--c-text-sub); }

/* ---- Modal ---- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  display: flex; align-items: center; justify-content: center; padding: 16px;
  background: rgba(15, 23, 42,.5);
}
.modal.hidden { display: none; }
.modal-panel { width: 100%; max-width: 28rem; padding: 24px; background: var(--c-surface); border-radius: var(--radius-lg); box-shadow: var(--shadow-2); }
.modal-panel.is-wide { max-width: 36rem; }
.modal-title { font-size: 1.125rem; font-weight: 700; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }

/* ---- Notices ---- */
.notice { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border: 1px solid; border-radius: var(--radius); font-size: .875rem; }
.notice svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.notice-danger { background: var(--c-danger-soft); border-color: #fca5a5; color: var(--c-danger-text); }
.notice-warning { background: var(--c-warning-soft); border-color: #fcd34d; color: var(--c-warning-text); }
.notice-info { background: var(--c-primary-soft); border-color: #93c5fd; color: var(--c-primary-text); }
.notice-success { background: var(--c-success-soft); border-color: #86efac; color: var(--c-success-text); }

/* ---- Description list ---- */
.dl { margin: 0; }
.dl-row { display: grid; grid-template-columns: 1fr; gap: 4px; padding: 14px 20px; border-bottom: 1px solid var(--c-border); }
.dl-row:last-child { border-bottom: 0; }
.dl-row dt { font-size: .8125rem; font-weight: 700; color: var(--c-text-sub); }
.dl-row dd { margin: 0; font-size: .9375rem; overflow-wrap: anywhere; }
@media (min-width: 600px) { .dl-row { grid-template-columns: 11rem 1fr; gap: 16px; align-items: center; } }

/* ---- Stats / timeline / misc ---- */
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-label { font-size: .75rem; font-weight: 700; letter-spacing: .04em; color: var(--c-text-sub); }
.stat-value { font-size: 1.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: grid; grid-template-columns: 9.5rem 1fr; gap: 12px; padding: 10px 20px; border-bottom: 1px solid var(--c-border); font-size: .875rem; }
.timeline li:last-child { border-bottom: 0; }
.timeline time { color: var(--c-text-sub); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 599px) { .timeline li { grid-template-columns: 1fr; gap: 2px; } }
.empty-state { padding: 48px 16px; text-align: center; color: var(--c-text-sub); }

/* ---- Images ---- */
.face-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 600px) { .face-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1200px) { .face-grid { grid-template-columns: repeat(6, 1fr); } }
.face-card { margin: 0; padding: 8px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); }
.face-card img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--c-surface-alt); border-radius: var(--radius); cursor: zoom-in; }
.face-card figcaption { margin-top: 8px; text-align: center; font-size: .8125rem; font-weight: 700; color: var(--c-text-strong); }
.camera-preview { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: #000; border: 1px solid var(--c-border); border-radius: var(--radius); }
.preview-img { display: block; width: 16rem; height: 16rem; object-fit: cover; border: 1px solid var(--c-border); border-radius: var(--radius); background: var(--c-surface-alt); }

/* ---- Auth shell (login / signup / onboarding / invite) ---- */
.auth-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px 16px; }
.auth-card { width: 100%; max-width: 28rem; padding: 32px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); box-shadow: var(--shadow-1); }
.auth-card.is-wide { max-width: 32rem; }
.auth-brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 24px; }
.auth-brand img { height: 96px; width: auto; }
.auth-title { font-size: 1.25rem; font-weight: 700; text-align: center; }
.auth-lead { margin-top: 4px; font-size: .875rem; color: var(--c-text-sub); text-align: center; }
.auth-footer { margin-top: 20px; text-align: center; font-size: .875rem; color: var(--c-text-sub); }
@media (max-width: 599px) { .auth-card { padding: 24px 20px; } }

/* ---- Plan cards ---- */
.plan-card { position: relative; display: block; cursor: pointer; }
.plan-card input { position: absolute; opacity: 0; width: 0; height: 0; }
.plan-card-body { padding: 16px; background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg); transition: border-color .12s, box-shadow .12s; }
.plan-card input:checked + .plan-card-body { border-color: var(--c-primary); box-shadow: 0 0 0 2px var(--c-primary-soft), var(--c-primary) 0 0 0 1px inset; }
.plan-card input:focus-visible + .plan-card-body { box-shadow: var(--ring); }
.plan-card-body:hover { border-color: var(--c-border-strong); }
.switch { position: relative; display: inline-flex; width: 44px; height: 24px; padding: 0; border: 0; border-radius: 999px; background: var(--c-border); cursor: pointer; transition: background .15s; }
.switch.is-on { background: var(--c-primary); }
.switch-knob { position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 999px; background: #fff; box-shadow: var(--shadow-1); transition: transform .15s; }
.switch.is-on .switch-knob { transform: translateX(20px); }
