/* Filific — one stylesheet for the site and the admin.
   System fonts (nothing to download, nothing to shift), light + dark themes,
   8-12px corners (no pill shapes). */

:root {
  --bg: #f6f8f9;
  --surface: #ffffff;
  --surface-2: #f0f4f5;
  --border: #dfe5e8;
  --border-strong: #b9c6cb;
  --text: #0f1a1c;
  --text-2: #334246;
  --muted: #56666b;
  --accent: #0f766e;
  --accent-hover: #115e59;
  --accent-soft: #e6f4f2;
  --accent-text: #0f766e;
  --on-accent: #ffffff;
  --danger: #b42318;
  --danger-hover: #912018;
  --danger-soft: #fef3f2;
  --warn-text: #93370d;
  --warn-soft: #fffaeb;
  --ok-text: #067647;
  --ok-soft: #ecfdf3;
  --shadow: 0 1px 2px rgba(16, 24, 40, 0.05), 0 8px 24px rgba(16, 24, 40, 0.06);
  --radius: 12px;
  --radius-sm: 8px;
  --check-a: #ffffff;
  --check-b: #eceff1;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1113;
    --surface: #121a1d;
    --surface-2: #182327;
    --border: #26343a;
    --border-strong: #3a4c53;
    --text: #e8eef0;
    --text-2: #c2ced2;
    --muted: #93a4aa;
    --accent: #2dd4bf;
    --accent-hover: #5eead4;
    --accent-soft: #10302d;
    --accent-text: #5eead4;
    --on-accent: #06201d;
    --danger: #f97066;
    --danger-hover: #fda29b;
    --danger-soft: #2d1614;
    --warn-text: #fec84b;
    --warn-soft: #2b2110;
    --ok-text: #75e0a7;
    --ok-soft: #0f2a1e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    --check-a: #182225;
    --check-b: #1f2b2f;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; }
a { color: var(--accent-text); text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3 { line-height: 1.25; margin: 0; letter-spacing: -0.01em; }
p { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
code, .mono { font-family: var(--mono); font-size: 0.92em; }
.icon { flex: none; }

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 16px; top: -48px; z-index: 10;
  background: var(--accent); color: var(--on-accent); padding: 8px 14px; border-radius: var(--radius-sm);
}
.skip:focus { top: 12px; }
main { flex: 1 0 auto; }

.container { width: 100%; max-width: 1120px; margin: 0 auto; padding-left: 16px; padding-right: 16px; }
.narrow { max-width: 760px; }
.narrow-xs { max-width: 420px; margin: 0 auto; }
.narrow-sm { max-width: 480px; }
.page-pad { padding-top: 40px; padding-bottom: 64px; }
@media (min-width: 720px) { .container { padding-left: 24px; padding-right: 24px; } }

/* ---------- buttons, inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 16px; border: 1px solid transparent; border-radius: var(--radius-sm);
  font-weight: 600; font-size: 0.95rem; line-height: 1.2; text-decoration: none;
  cursor: pointer; white-space: nowrap; transition: background-color .15s, border-color .15s, color .15s;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--border-strong); background: var(--surface-2); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover { background: var(--danger-hover); }
@media (prefers-color-scheme: dark) { .btn-danger { color: #1f0a08; } }
.btn-sm { padding: 7px 12px; font-size: 0.875rem; }
.btn-lg { padding: 13px 20px; font-size: 1rem; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.link-btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 0; border-radius: 6px;
  background: none; color: var(--accent-text); font-weight: 600; font-size: 0.9rem; cursor: pointer;
}
.link-btn:hover { background: var(--accent-soft); }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px;
  border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }

.field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.label {
  display: flex; align-items: center; gap: 6px; margin: 0 0 6px; padding: 0;
  font-size: 0.875rem; font-weight: 600; color: var(--text-2);
}
.optional { font-weight: 400; color: var(--muted); }
.input {
  display: block; width: 100%; min-width: 0; padding: 10px 12px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm);
  font-size: 0.95rem;
}
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea.input { resize: vertical; min-height: 120px; }
.input.mono { font-size: 0.875rem; }
.hint { font-size: 0.85rem; color: var(--muted); margin-top: 6px; }
.copy-row { display: flex; gap: 8px; align-items: stretch; }
.copy-row .input { flex: 1; }

.seg { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.seg-item { position: relative; }
.seg-item input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg-item span {
  display: block; text-align: center; padding: 9px 8px; font-size: 0.9rem; font-weight: 600;
  border: 1px solid var(--border-strong); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-2);
}
.seg-item input:checked + span { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.seg-item input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.notice, .form-error {
  display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px; border-radius: var(--radius-sm);
  font-size: 0.9rem; margin: 0 0 16px;
}
.notice .icon, .form-error .icon { margin-top: 3px; }
.notice-warn { background: var(--warn-soft); color: var(--warn-text); }
.notice-ok { background: var(--ok-soft); color: var(--ok-text); }
.form-error { background: var(--danger-soft); color: var(--danger); }
.tag {
  display: inline-block; padding: 2px 8px; border-radius: 6px; font-size: 0.78rem; font-weight: 600;
  background: var(--surface-2); color: var(--text-2); border: 1px solid var(--border);
}
.tag-ready, .tag-actioned { background: var(--ok-soft); color: var(--ok-text); border-color: transparent; }
.tag-open, .tag-uploading { background: var(--warn-soft); color: var(--warn-text); border-color: transparent; }
.tag-deleted, .tag-dismissed { background: var(--surface-2); color: var(--muted); }

.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 24px;
}
@media (max-width: 520px) { .card { padding: 18px; } }

/* ---------- header / footer ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--border); }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 64px; }
.brand {
  display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none;
  font-weight: 800; font-size: 1.25rem; letter-spacing: -0.02em;
}
.brand-mark { border-radius: 7px; }
.brand-sub { font-weight: 500; color: var(--muted); }
.brand-sm { font-size: 1.05rem; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav form { margin: 0 0 0 6px; }
.nav-link {
  padding: 8px 10px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none;
  font-size: 0.925rem; font-weight: 500;
}
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link[aria-current="page"] { color: var(--accent-text); background: var(--accent-soft); }
.nav .btn { margin-left: 6px; }
@media (max-width: 420px) { .nav-link[href="/report"] { display: none; } }
@media (max-width: 560px) {
  .nav-link[href="/about"] { display: none; }
  .nav .btn span { display: none; }
  .nav .btn { padding: 8px; }
}

.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 24px; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 16px; }
.footer-tag { color: var(--muted); font-size: 0.9rem; margin-top: 8px; max-width: 360px; }
.footer-links { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.footer-links a { color: var(--text-2); text-decoration: none; font-size: 0.925rem; }
.footer-links a:hover { color: var(--accent-text); text-decoration: underline; }
.footer-copy { color: var(--muted); font-size: 0.85rem; padding-bottom: 28px; }

/* ---------- home ---------- */
.hero { padding: 48px 0 56px; }
.hero-grid { display: grid; gap: 32px; align-items: start; }
@media (min-width: 960px) {
  .hero { padding: 72px 0 80px; }
  .hero-grid { grid-template-columns: 1fr 480px; gap: 56px; }
  .hero-copy { padding-top: 24px; }
}
.hero h1 { font-size: clamp(2.1rem, 5vw, 3.25rem); font-weight: 800; letter-spacing: -0.03em; }
.quick-answer { font-size: 1.125rem; color: var(--text-2); margin-top: 16px; }
.hero .quick-answer { max-width: 560px; }
.hero-points { list-style: none; padding: 0; margin: 24px 0 0; display: grid; gap: 10px; }
@media (min-width: 520px) { .hero-points { grid-template-columns: 1fr 1fr; } }
.hero-points li { display: flex; align-items: center; gap: 8px; font-weight: 500; color: var(--text-2); }
.hero-points .icon { color: var(--accent-text); }

.uploader { padding: 20px; scroll-margin-top: 16px; }
@media (min-width: 520px) { .uploader { padding: 24px; } }
.drop {
  position: relative; border: 2px dashed var(--border-strong); border-radius: var(--radius);
  background: var(--surface-2); transition: border-color .15s, background-color .15s; margin-bottom: 18px;
}
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.drop-label {
  display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 32px 16px;
  text-align: center; cursor: pointer;
}
.drop-icon {
  display: inline-flex; width: 52px; height: 52px; align-items: center; justify-content: center;
  border-radius: var(--radius); background: var(--surface); color: var(--accent-text); border: 1px solid var(--border);
  margin-bottom: 6px;
}
.drop-title { font-weight: 600; font-size: 1.05rem; }
.drop-browse { color: var(--accent-text); text-decoration: underline; text-underline-offset: 2px; }
.drop-hint { color: var(--muted); font-size: 0.875rem; }
.drop.drop-compact .drop-label { padding: 16px; flex-direction: row; justify-content: center; }
.drop.drop-compact .drop-icon { width: 36px; height: 36px; margin: 0; }
.drop.drop-compact .drop-hint { display: none; }

.selected { margin: -6px 0 18px; }
.selected-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.selected-count { font-size: 0.875rem; font-weight: 600; color: var(--text-2); }
.file-list {
  list-style: none; margin: 0; padding: 0; max-height: 228px; overflow-y: auto;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
}
.file-row { display: flex; align-items: center; gap: 10px; padding: 6px 6px 6px 12px; border-bottom: 1px solid var(--border); }
.file-row:last-child { border-bottom: 0; }
.file-icon { color: var(--muted); display: inline-flex; }
.file-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.925rem; }
.file-size { color: var(--muted); font-size: 0.85rem; white-space: nowrap; }
.fineprint { font-size: 0.8rem; color: var(--muted); margin-top: 12px; text-align: center; }
.account-hint { font-size: 0.85rem; color: var(--text-2); margin-top: 8px; text-align: center; }

.progress { padding: 6px 0 2px; }
.progress-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 10px; }
.progress-title { font-weight: 700; font-size: 1.05rem; }
.progress-pct { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-text); }
.bar { height: 10px; border-radius: 6px; background: var(--surface-2); overflow: hidden; border: 1px solid var(--border); }
.bar-fill { height: 100%; width: 0; background: var(--accent); transition: width .25s ease; }
.progress-meta {
  display: flex; justify-content: space-between; gap: 12px; margin-top: 8px;
  font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums;
}
.progress-file { margin-top: 14px; font-size: 0.9rem; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.progress .hint { margin-bottom: 16px; }

.result-head { display: flex; gap: 12px; align-items: center; margin-bottom: 18px; }
.result-icon {
  display: inline-flex; width: 42px; height: 42px; flex: none; align-items: center; justify-content: center;
  border-radius: 50%; background: var(--ok-soft); color: var(--ok-text);
}
.result-title { font-size: 1.25rem; }
.result-sub { color: var(--muted); font-size: 0.9rem; }
.result-grid { display: flex; gap: 16px; align-items: center; margin: 16px 0; }
.qr { background: #fff; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 6px; flex: none; }
.result-facts { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 0.9rem; color: var(--text-2); }
.result-facts li { display: flex; gap: 8px; align-items: center; }
.result-facts .icon { color: var(--muted); }
.delete-box { border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }
.delete-box .hint { margin: -2px 0 8px; }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.result-actions .btn { flex: 1; }
.status { min-height: 1.4em; margin-top: 12px; font-size: 0.9rem; color: var(--muted); text-align: center; }
.status:empty { display: none; }
.status-error { color: var(--danger); }

.section { padding: 56px 0; }
.section-alt { background: var(--surface); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-title { font-size: clamp(1.5rem, 3vw, 1.9rem); font-weight: 800; letter-spacing: -0.02em; margin-bottom: 28px; }
.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 16px; }
@media (min-width: 760px) { .steps { grid-template-columns: repeat(3, 1fr); } }
.step { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; scroll-margin-top: 24px; }
.step-num {
  display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); font-weight: 800; margin-bottom: 12px;
}
.step h3, .feature h3 { font-size: 1.05rem; margin-bottom: 6px; }
.step p, .feature p { color: var(--text-2); font-size: 0.95rem; }
.features { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.feature { padding: 4px 0; }
.feature-icon {
  display: inline-flex; width: 42px; height: 42px; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); background: var(--accent-soft); color: var(--accent-text); margin-bottom: 12px;
}
.faq-item { padding: 18px 0; border-bottom: 1px solid var(--border); }
.faq-item:first-child { padding-top: 0; }
.faq-item h3 { font-size: 1.05rem; margin-bottom: 6px; }
.faq-item p { color: var(--text-2); }

/* ---------- share page ---------- */
.share-card { padding: 0; overflow: hidden; }
.share-head { display: flex; gap: 14px; align-items: flex-start; padding: 24px 24px 18px; }
.share-icon {
  display: inline-flex; width: 48px; height: 48px; flex: none; align-items: center; justify-content: center;
  border-radius: var(--radius); background: var(--accent-soft); color: var(--accent-text);
}
.share-title { font-size: 1.35rem; }
.share-sub { color: var(--muted); font-size: 0.9rem; margin-top: 4px; }
.share-card .notice { margin: 0 24px 16px; }
.unlock { padding: 0 24px 24px; }
.unlock .form-error { margin: 12px 0 0; }
.dl-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--border); }
.dl-item { display: flex; align-items: center; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--border); }
.dl-icon { color: var(--muted); display: inline-flex; }
.dl-info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.dl-name { font-weight: 600; overflow-wrap: anywhere; }
.dl-meta { font-size: 0.85rem; color: var(--muted); }
.dl-item form { margin: 0; }
.share-foot { display: flex; gap: 16px; align-items: flex-end; padding: 20px 24px 24px; background: var(--surface-2); }
.share-link { flex: 1; min-width: 0; }
.qr-sm { padding: 4px; }
.safety { display: flex; gap: 8px; align-items: flex-start; margin-top: 16px; font-size: 0.875rem; color: var(--muted); }
.safety .icon { margin-top: 3px; }
@media (max-width: 520px) {
  .share-head, .dl-item { padding-left: 16px; padding-right: 16px; }
  .unlock, .share-foot { padding-left: 16px; padding-right: 16px; }
  .share-card .notice { margin-left: 16px; margin-right: 16px; }
  .qr-sm { display: none; }
  .btn-text { display: none; }
}

/* ---------- images: grid on the share page, the image page ---------- */
.thumbs {
  list-style: none; margin: 0; padding: 16px 24px; display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); border-top: 1px solid var(--border);
}
.thumb { display: flex; flex-direction: column; gap: 6px; color: var(--text); text-decoration: none; min-width: 0; }
.thumb-img {
  display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3; overflow: hidden;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background-color: var(--check-a);
  background-image:
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 16px 16px;
  background-position: 0 0, 8px 8px;
}
.thumb-img img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.thumb:hover .thumb-img { border-color: var(--accent); }
.thumb-name { font-size: 0.85rem; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thumb-size { font-size: 0.8rem; color: var(--muted); margin-top: -4px; }
@media (max-width: 520px) { .thumbs { padding: 12px 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.img-page { max-width: 1320px; margin: 0 auto; padding: 20px 16px 48px; display: flex; flex-direction: column; gap: 16px; }
@media (min-width: 720px) { .img-page { padding: 24px 24px 56px; } }
.img-stage { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-items: start; }
.img-frame {
  margin: 0; min-height: 220px; display: flex; align-items: center; justify-content: center; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius);
  background-color: var(--check-a);
  background-image:
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%),
    linear-gradient(45deg, var(--check-b) 25%, transparent 25%, transparent 75%, var(--check-b) 75%);
  background-size: 20px 20px;
  background-position: 0 0, 10px 10px;
}
.img-main { max-width: 100%; max-height: 80vh; width: auto; height: auto; object-fit: contain; }
@media (min-width: 960px) {
  .img-stage.with-side { grid-template-columns: auto minmax(0, 1fr) auto; }
  .img-stage.with-side .img-frame { grid-column: 2; }
}
.img-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; }
.img-meta { min-width: 0; }
.img-title { font-size: 1.15rem; font-weight: 700; overflow-wrap: anywhere; }
.img-sub { color: var(--muted); font-size: 0.875rem; margin-top: 2px; }
.img-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.img-actions form { margin: 0; }
.img-links { display: flex; flex-wrap: wrap; gap: 8px 20px; align-items: center; font-size: 0.9rem; }
.img-links a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; }
.img-links a:hover { color: var(--accent-text); text-decoration: underline; }
.img-page .safety { margin-top: 0; }

/* ---------- ad slots (image pages) ----------
   Plain blocks, not flex: responsive AdSense units measure their container's
   width, and a flex item without content has none. Reserved heights keep the
   page from jumping when an ad arrives. */
.ad-slot { display: block; text-align: center; overflow: hidden; min-width: 0; }
.ad-slot > * { margin-left: auto; margin-right: auto; }
.ad-slot-1, .ad-slot-4 { min-height: 90px; }
.ad-slot-2, .ad-slot-3 { width: 160px; min-height: 600px; }
.ad-slot-5, .ad-slot-6 { min-height: 250px; }
.ad-pair { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); }
.ad-pair:empty { display: none; }
@media (max-width: 959px) { .ad-desktop { display: none !important; } .ad-slot-2, .ad-slot-3 { width: auto; min-height: 250px; } }
@media (min-width: 960px) { .ad-mobile { display: none !important; } }
.ad-placeholder {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 10px;
  border: 2px dashed var(--warn-text); border-radius: var(--radius-sm); background: var(--warn-soft);
  color: var(--warn-text); font-size: 0.85rem; text-decoration: none;
}
.ad-placeholder strong { font-size: 0.95rem; }
.ad-placeholder:hover { text-decoration: underline; }

/* ---------- empty / status pages ---------- */
.empty-card { text-align: center; padding: 40px 24px; }
.empty-card h1 { font-size: 1.5rem; margin: 14px 0 8px; }
.empty-card p { color: var(--text-2); max-width: 480px; margin: 0 auto 20px; }
.empty-card .hint { margin: 16px auto 0; }
.empty-card form { display: flex; justify-content: center; }
.empty-icon {
  display: inline-flex; width: 60px; height: 60px; align-items: center; justify-content: center;
  border-radius: var(--radius); background: var(--surface-2); color: var(--muted);
}
.empty-icon.ok { background: var(--ok-soft); color: var(--ok-text); }
.empty-icon.danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- prose pages ---------- */
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 0.875rem; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); }
.prose h1 { font-size: clamp(1.9rem, 4vw, 2.4rem); font-weight: 800; letter-spacing: -0.02em; }
.prose h2 { font-size: 1.25rem; margin: 32px 0 10px; }
.prose p, .prose li { color: var(--text-2); }
.prose p + p { margin-top: 12px; }
.prose ul { padding-left: 1.25rem; margin: 10px 0 0; }
.prose li { margin: 6px 0; }
.prose .quick-answer { margin-bottom: 8px; }
.updated { margin-top: 40px; font-size: 0.875rem; color: var(--muted); }
.contact-grid { display: grid; gap: 16px; margin-top: 28px; }
@media (min-width: 640px) { .contact-grid { grid-template-columns: 1fr 1fr; } }
.contact-card h2 { margin: 0 0 4px; font-size: 1.1rem; }
.form-card { margin-top: 20px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.report-note { margin-top: 20px; }

/* ---------- accounts ---------- */
.account-card h1 { font-size: 1.6rem; font-weight: 800; letter-spacing: -0.02em; margin-bottom: 8px; }
.account-sub { color: var(--text-2); margin-bottom: 18px; }
.account-card .form-error { margin-bottom: 16px; }
.account-switch { margin: 16px 0 6px; font-size: 0.925rem; color: var(--text-2); text-align: center; }
.account-card > .hint { text-align: center; }
.account-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.my-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.my-title { font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 800; letter-spacing: -0.02em; }
.my-sub { color: var(--muted); font-size: 0.9rem; margin-top: 4px; overflow-wrap: anywhere; }
.my-actions { display: flex; gap: 8px; align-items: center; }
.my-actions form { margin: 0; }
.table .link-btn { font-size: 0.8rem; padding: 2px 4px; margin-left: 4px; }

/* ---------- admin ---------- */
.admin-main { padding-top: 28px; padding-bottom: 64px; }
.admin-title { font-size: 1.6rem; font-weight: 800; margin-bottom: 20px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.admin-section { margin-top: 36px; }
.admin-section h2 { font-size: 1.15rem; margin-bottom: 12px; }
.admin-section-head { display: flex; justify-content: space-between; align-items: baseline; }
.stats { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stat {
  display: flex; flex-direction: column; gap: 2px; padding: 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat-label { font-size: 0.8rem; color: var(--muted); font-weight: 600; }
.stat-value { font-size: 1.5rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat-sub { font-size: 0.8rem; color: var(--muted); }
.stat-warn .stat-value { color: var(--warn-text); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.table th, .table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.table th { font-size: 0.8rem; color: var(--muted); font-weight: 600; background: var(--surface-2); }
.table tr:last-child td { border-bottom: 0; }
.table .details { max-width: 420px; overflow-wrap: anywhere; }
.table .actions form { margin: 0; }
.cell-sub { display: block; font-size: 0.8rem; color: var(--muted); }
.nowrap { white-space: nowrap; }
.small { font-size: 0.85rem; overflow-wrap: anywhere; }
.lock-mark { display: inline-flex; vertical-align: -2px; margin-left: 6px; color: var(--muted); }
.empty { color: var(--muted); padding: 16px 0; }
.tabs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.tab {
  padding: 7px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); color: var(--text-2); text-decoration: none; font-size: 0.9rem; font-weight: 500;
}
.tab[aria-current="page"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); }
.search-row { display: flex; gap: 8px; margin-bottom: 16px; max-width: 560px; }
.search-row .input { flex: 1; }
.detail-grid { display: grid; gap: 20px; align-items: start; }
@media (min-width: 900px) { .detail-grid { grid-template-columns: 1fr 340px; } }
.facts {
  display: grid; grid-template-columns: 140px 1fr; gap: 8px 16px; margin: 0; padding: 20px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.facts dt { color: var(--muted); font-size: 0.875rem; }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.danger-card h2 { font-size: 1.1rem; margin-bottom: 8px; }
.danger-card p { color: var(--text-2); font-size: 0.9rem; margin-bottom: 14px; }
@media (max-width: 520px) { .facts { grid-template-columns: 1fr; } .facts dt { margin-top: 6px; } }
@media (max-width: 640px) {
  .admin .header-inner { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .admin .nav { flex-wrap: wrap; }
}

@media (max-width: 520px) {
  .field-row { grid-template-columns: 1fr; gap: 0; }
  .result-grid { align-items: flex-start; }
}

/* admin: settings, members */
.tier-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr)); }
.tier-card h2, .signup-card h2 { font-size: 1.15rem; margin-bottom: 4px; }
.tier-card .hint { margin: 0 0 14px; }
.tier-card .field .hint { margin: 6px 0 0; }
.expiry-grid { display: grid; gap: 6px 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.expiry-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px;
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface-2); }
.radio-default { display: inline-flex; gap: 6px; align-items: center; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.signup-card { margin: 16px 0; max-width: 760px; }
.signup-card .hint { margin-top: 8px; }
.reset-form { display: flex; gap: 6px; align-items: center; margin: 0; }
.reset-form .input-sm { width: 190px; }

/* admin: ads */
.ads-intro { color: var(--text-2); max-width: 860px; margin-bottom: 20px; }
.ad-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); }
.ad-card { padding: 18px; scroll-margin-top: 16px; }
.ad-card:target { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ad-card-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.ad-card-head h2 { font-size: 1.05rem; }
.ad-card-where { color: var(--text-2); font-size: 0.9rem; }
.ad-card .hint { margin: 2px 0 10px; }
.ad-card-controls { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: center; margin-bottom: 10px; }
.check { display: inline-flex; gap: 8px; align-items: center; font-weight: 600; font-size: 0.9rem; cursor: pointer; }
.inline-field { display: inline-flex; gap: 8px; align-items: center; font-size: 0.9rem; color: var(--text-2); }
.input.input-sm { display: inline-block; width: auto; padding: 6px 8px; font-size: 0.875rem; }
.ad-code { min-height: 150px; font-size: 0.8rem; }
.ads-settings { margin: 16px 0; max-width: 760px; }
.ads-settings h2 { font-size: 1.1rem; margin-bottom: 12px; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
