/* Testing Tracker — "site board" style. Green accent, photo-forward site
   cards, light/dark. Status is never color-only: it always carries a label
   and an icon glyph. */

:root {
  --bg: #f1f4f1;
  --surface: #ffffff;
  --surface-2: #e9eee9;
  --border: #e1e7e1;
  --border-strong: #cdd5cd;
  --text: #17201a;
  --text-muted: #5c6b60;
  --accent: #2e7d32;
  --accent-hover: #256428;
  --accent-soft: #e6f0e7;
  --accent-contrast: #ffffff;

  --ok-fg: #1b7a3d;
  --ok-bg: #d9f2e0;
  --soon-fg: #8a5a00;
  --soon-bg: #fdeecb;
  --overdue-fg: #b3261e;
  --overdue-bg: #fbe0de;

  --danger: #c62828;
  --shadow: 0 1px 2px rgba(16, 24, 20, 0.04), 0 4px 16px rgba(16, 24, 20, 0.07);
  --radius: 16px;
  --radius-sm: 10px;
  --maxw: 780px;
  font-synthesis: none;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1512;
    --surface: #18211b;
    --surface-2: #1f2a22;
    --border: #29352c;
    --border-strong: #38473b;
    --text: #e6ece7;
    --text-muted: #9aa89e;
    --accent: #5cc878;
    --accent-hover: #74d68d;
    --accent-soft: #16241a;
    --accent-contrast: #0c130e;

    --ok-fg: #74e0a0;
    --ok-bg: rgba(46, 199, 120, 0.14);
    --soon-fg: #fcd34d;
    --soon-bg: rgba(245, 158, 11, 0.15);
    --overdue-fg: #f4a7a1;
    --overdue-bg: rgba(239, 68, 68, 0.15);

    --danger: #f0857e;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.35), 0 8px 24px rgba(0, 0, 0, 0.4);
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Ubuntu,
    Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 16px calc(env(safe-area-inset-bottom) + 100px);
}

/* --------------------------------- hero --------------------------------- */

.hero { padding: 22px 2px 4px; }
.hero-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.eyebrow {
  color: var(--accent);
  font-size: 0.74rem; font-weight: 800; letter-spacing: 0.14em;
}
.hero-title {
  margin: 3px 0 0; font-size: 2rem; font-weight: 800; letter-spacing: -0.02em;
}
.hero-sub { color: var(--text-muted); font-size: 0.9rem; margin-top: 8px; }
.hero-btn {
  flex: none;
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong); border-radius: 10px;
  padding: 8px 14px; font: inherit; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; gap: 7px;
}
.hero-btn:hover { background: var(--surface-2); }
.hero-btn .ico { width: 17px; height: 17px; }

.footnote { color: var(--text-muted); font-size: 0.85rem; margin: 22px 2px 0; }

/* ------------------------------- buttons -------------------------------- */

.btn {
  appearance: none;
  border: 1px solid transparent; border-radius: 10px;
  padding: 10px 16px; font-size: 0.95rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  transition: background 0.15s, border-color 0.15s, opacity 0.15s, transform 0.05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-contrast); }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: var(--surface); color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { background: var(--surface-2); }
.btn-danger { background: transparent; color: var(--danger); border-color: transparent; }
.btn-danger:hover { background: var(--overdue-bg); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }
.btn-sm { padding: 7px 11px; font-size: 0.85rem; border-radius: 9px; }
.btn-block { width: 100%; }

.icon-btn {
  appearance: none; border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text);
  border-radius: 10px; height: 40px; min-width: 40px; padding: 0 12px;
  font-size: 0.92rem; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
}
.icon-btn:hover { background: var(--surface-2); }

/* -------------------------------- banners ------------------------------- */

.banner {
  display: flex; align-items: center; gap: 12px;
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface); box-shadow: var(--shadow); font-size: 0.92rem;
}
.banner .banner-text { flex: 1; }
.banner.warn { border-color: color-mix(in srgb, var(--soon-fg) 40%, var(--border)); }

/* ------------------------------ site cards ------------------------------ */

.site-cards { display: flex; flex-direction: column; gap: 16px; margin-top: 14px; }

.site-card {
  display: block; width: 100%; text-align: left; padding: 0;
  border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; background: var(--surface); box-shadow: var(--shadow);
  cursor: pointer; transition: transform 0.06s, box-shadow 0.15s;
}
.site-card:hover { box-shadow: 0 8px 26px rgba(0, 0, 0, 0.14); }
.site-card:active { transform: scale(0.995); }

.site-photo {
  position: relative; height: 158px;
  background-size: cover; background-position: center;
  display: flex; align-items: flex-end; justify-content: flex-end; padding: 12px;
}
.site-initials {
  position: absolute; inset: 0; display: grid; place-items: center;
  font-size: 2.6rem; font-weight: 800; color: rgba(255, 255, 255, 0.82);
  letter-spacing: 0.06em; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.site-foot { padding: 13px 16px 15px; }
.site-name { font-weight: 750; font-size: 1.15rem; color: var(--accent); }
.site-open {
  margin-top: 3px; color: var(--text-muted); font-size: 0.9rem;
  display: flex; align-items: center; gap: 3px;
}
.site-open .ico { width: 15px; height: 15px; }

/* ------------------------------ detail hero ----------------------------- */

.back-btn {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; color: var(--accent);
  font: inherit; font-weight: 650; cursor: pointer; padding: 10px 2px 6px;
}
.back-btn .ico { width: 18px; height: 18px; }

.detail-hero {
  position: relative; height: 190px; border-radius: var(--radius);
  overflow: hidden; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; box-shadow: var(--shadow);
}
.detail-hero-scrim {
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.06) 58%, rgba(0, 0, 0, 0.2));
}
.detail-hero-cap { position: relative; padding: 16px 18px; color: #fff; }
.detail-hero-cap h1 {
  margin: 8px 0 0; font-size: 1.7rem; color: #fff;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.55);
}
.detail-hero-sub { color: rgba(255, 255, 255, 0.86); font-size: 0.85rem; margin-top: 2px; }
.hero-edit {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  background: rgba(255, 255, 255, 0.94); color: #17201a; border: none;
  border-radius: 10px; padding: 7px 12px; font: inherit; font-weight: 600;
  cursor: pointer; display: inline-flex; align-items: center; gap: 6px;
}
.hero-edit .ico { width: 16px; height: 16px; }

/* -------------------------------- tests --------------------------------- */

.list { margin-top: 14px; display: flex; flex-direction: column; gap: 10px; }

.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow);
  display: grid; grid-template-columns: 1fr auto; gap: 10px 14px; align-items: center;
}
.card.status-overdue { border-left: 4px solid var(--overdue-fg); }
.card.status-due_soon { border-left: 4px solid var(--soon-fg); }
.card.status-ok { border-left: 4px solid var(--ok-fg); }
.card .main { min-width: 0; }
.card .name { font-weight: 650; font-size: 1.02rem; }
.card .meta {
  margin-top: 3px; font-size: 0.85rem; color: var(--text-muted);
  display: flex; flex-wrap: wrap; gap: 6px 12px;
}
.card .meta span { display: inline-flex; align-items: center; gap: 5px; }
.card .notes { margin-top: 6px; font-size: 0.85rem; color: var(--text-muted); }
.card .side { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.card .actions { display: flex; gap: 6px; }

@media (max-width: 560px) {
  .card { grid-template-columns: 1fr; }
  .card .side { flex-direction: row; align-items: center; justify-content: space-between; }
}

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 0.78rem; font-weight: 650; white-space: nowrap;
}
.pill.overdue { background: var(--overdue-bg); color: var(--overdue-fg); }
.pill.due_soon { background: var(--soon-bg); color: var(--soon-fg); }
.pill.ok { background: var(--ok-bg); color: var(--ok-fg); }

/* On a photo, pills go solid with white text so they read on any image. */
.pill.on-photo { box-shadow: 0 2px 8px rgba(0, 0, 0, 0.28); }
.pill.on-photo.overdue { background: #c62828; color: #fff; }
.pill.on-photo.due_soon { background: #b45309; color: #fff; }
.pill.on-photo.ok { background: #2e7d32; color: #fff; }

.empty {
  text-align: center; color: var(--text-muted); padding: 44px 16px;
  border: 1px dashed var(--border-strong); border-radius: var(--radius); margin-top: 14px;
}

/* --------------------------------- FAB ---------------------------------- */

.fab {
  position: fixed;
  right: max(18px, env(safe-area-inset-right));
  bottom: max(18px, env(safe-area-inset-bottom));
  z-index: 30; height: 56px; padding: 0 22px 0 18px;
  border: none; border-radius: 999px;
  background: var(--accent); color: var(--accent-contrast);
  font-size: 1rem; font-weight: 650;
  box-shadow: 0 8px 24px rgba(46, 125, 50, 0.4);
  cursor: pointer; display: inline-flex; align-items: center; gap: 8px;
}

/* -------------------------------- dialog -------------------------------- */

dialog {
  border: 1px solid var(--border); border-radius: 18px; padding: 0;
  width: min(520px, calc(100vw - 24px));
  background: var(--surface); color: var(--text);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
dialog::backdrop { background: rgba(6, 12, 8, 0.55); backdrop-filter: blur(2px); }
.dialog-head { padding: 18px 20px 6px; display: flex; align-items: center; justify-content: space-between; }
.dialog-head h3 { margin: 0; font-size: 1.15rem; }
.dialog-body { padding: 8px 20px 4px; }
.dialog-foot { padding: 14px 20px 18px; display: flex; gap: 10px; justify-content: flex-end; }
.field { margin-top: 14px; }
.field:first-child { margin-top: 4px; }
.field label { display: block; font-size: 0.85rem; font-weight: 600; margin-bottom: 6px; }
.field .hint { font-size: 0.78rem; color: var(--text-muted); margin-top: 5px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

select, input[type="text"], input[type="date"], input[type="password"], textarea {
  font: inherit; color: var(--text); background: var(--surface);
  border: 1px solid var(--border-strong); border-radius: 10px; padding: 9px 11px; width: 100%;
}
select:focus, input:focus, textarea:focus {
  outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
  outline-offset: 1px; border-color: var(--accent);
}
textarea { min-height: 64px; resize: vertical; }

.form-error { color: var(--danger); font-size: 0.85rem; margin: 12px 20px 0; min-height: 1em; }

.photo-picker { display: flex; gap: 14px; align-items: center; }
.photo-preview {
  width: 100px; height: 74px; border-radius: 10px; flex: none;
  border: 1px dashed var(--border-strong); background: var(--surface-2);
  background-size: cover; background-position: center; display: grid; place-items: center;
}
.photo-preview.has-photo { border-style: solid; }
.photo-empty { font-size: 0.72rem; color: var(--text-muted); }
.photo-actions { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; }
.photo-actions .btn { cursor: pointer; }

/* -------------------------------- login --------------------------------- */

.login-shell { min-height: 100dvh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: min(400px, 100%); background: var(--surface); border: 1px solid var(--border);
  border-radius: 20px; box-shadow: var(--shadow); padding: 28px 26px 24px;
}
.login-card .logo-lg {
  width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center;
  background: var(--accent); color: var(--accent-contrast); margin-bottom: 14px;
}
.login-card h1 { margin: 0 0 4px; font-size: 1.35rem; }
.login-card p.sub { margin: 0 0 20px; color: var(--text-muted); font-size: 0.9rem; }

/* -------------------------------- toast --------------------------------- */

.toast-wrap {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: max(84px, calc(env(safe-area-inset-bottom) + 84px));
  z-index: 50; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast {
  background: #111814; color: #f2f6f3; border-radius: 10px; padding: 10px 16px;
  font-size: 0.9rem; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  animation: toast-in 0.18s ease-out;
}
.toast.error { background: var(--danger); color: #fff; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; } }

/* -------------------------------- icons --------------------------------- */

.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -0.14em; flex: none; }
.brand .logo .ico { width: 18px; height: 18px; }
.icon-btn .ico { width: 19px; height: 19px; }
.icon-btn .lbl-icon .ico, .btn .lbl-icon .ico { width: 16px; height: 16px; }
.btn .ico { width: 15px; height: 15px; }
.fab .fab-ico .ico { width: 21px; height: 21px; }
.meta .ico { width: 15px; height: 15px; color: var(--text-muted); }
.pill .ico { width: 14px; height: 14px; }
.login-card .logo-lg .ico { width: 30px; height: 30px; }
.hero-btn .ico { width: 17px; height: 17px; }
.hero-edit .ico { width: 16px; height: 16px; }
.download .ico, a.btn .ico { width: 15px; height: 15px; }

/* ------------------------- new-model components -------------------------- */

.hero-actions { display: flex; gap: 8px; }
.page-title { font-size: 1.6rem; font-weight: 800; margin: 8px 2px 4px; }
.page-title-sub { color: var(--text-muted); font-weight: 600; font-size: 1rem; }
.opt { font-weight: 400; color: var(--text-muted); }
.muted { color: var(--text-muted); }
dialog hr { border: none; border-top: 1px solid var(--border); margin: 16px 0; }

.cadence-row { display: flex; align-items: center; gap: 10px; }
.cadence-row input[type="number"] { width: 84px; flex: none; }
.cadence-row select { width: auto; flex: 1; }
.cadence-lead { color: var(--text-muted); font-size: 0.9rem; white-space: nowrap; }
#f-lead { width: 60px; }

.prio { font-size: 0.66rem; font-weight: 750; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; }
.prio-high { background: var(--soon-bg); color: var(--soon-fg); }
.prio-critical { background: var(--overdue-bg); color: var(--overdue-fg); }
.prio-low, .prio-medium { background: var(--surface-2); color: var(--text-muted); }
.card.archived { opacity: 0.55; }
.badge-archived { font-size: 0.66rem; font-weight: 750; letter-spacing: 0.03em; padding: 2px 7px; border-radius: 6px; text-transform: uppercase; background: var(--surface-2); color: var(--text-muted); }
.check-row { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.check-row input { width: auto; flex: none; }

.name-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.chips { margin-top: 6px; display: flex; gap: 6px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 4px; font-size: 0.76rem; color: var(--text-muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }
.chip .ico { width: 12px; height: 12px; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; margin-top: 16px; gap: 2px; }
.seg-btn { appearance: none; border: none; background: transparent; color: var(--text-muted); font: inherit; font-weight: 600; font-size: 0.9rem; padding: 6px 18px; border-radius: 8px; cursor: pointer; }
.seg-btn.is-active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }

.detail-hero-tools { position: absolute; top: 12px; right: 12px; z-index: 2; display: flex; gap: 8px; }
.detail-hero-tools .hero-edit { position: static; }

.td-dl { margin: 4px 0 0; }
.td-row { display: grid; grid-template-columns: 116px 1fr; gap: 4px 12px; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.92rem; align-items: center; }
.td-row dt { color: var(--text-muted); margin: 0; }
.td-row dd { margin: 0; }
.td-proc { margin-top: 14px; background: var(--surface-2); border-radius: 10px; padding: 12px 14px; font-size: 0.9rem; white-space: pre-wrap; }
.td-proc-h { font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 6px; }
.td-hist-h { font-weight: 700; margin: 18px 0 8px; }
.c-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.c-list li { position: relative; background: var(--surface-2); border-radius: 10px; padding: 10px 40px 10px 12px; font-size: 0.9rem; }
.c-list li.c-empty { color: var(--text-muted); background: transparent; padding: 8px 0; }
.c-notes { color: var(--text-muted); margin-top: 3px; }
.c-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; color: var(--text-muted); cursor: pointer; padding: 4px; border-radius: 6px; }
.c-del:hover { color: var(--danger); background: var(--overdue-bg); }
.c-del .ico { width: 16px; height: 16px; }
.log-for { font-weight: 650; margin: 2px 0 4px; }

/* -------------------------------- calendar ------------------------------- */

.cal-mount { margin-top: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.cal-month { font-weight: 750; font-size: 1.05rem; }
.cal-nav { appearance: none; background: var(--surface); border: 1px solid var(--border-strong); border-radius: 9px; width: 38px; height: 38px; cursor: pointer; color: var(--text); display: inline-flex; align-items: center; justify-content: center; }
.cal-nav:hover { background: var(--surface-2); }
.cal-nav .ico { width: 18px; height: 18px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin-bottom: 4px; }
.cal-weekdays div { text-align: center; font-size: 0.72rem; font-weight: 600; color: var(--text-muted); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { position: relative; aspect-ratio: 1 / 1; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; cursor: pointer; display: flex; flex-direction: column; align-items: center; padding: 6px 0 0; font: inherit; color: var(--text); }
.cal-cell.out { opacity: 0.36; }
.cal-cell.today { border-color: var(--accent); }
.cal-cell.today .cal-num { color: var(--accent); font-weight: 750; }
.cal-cell.sel { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal-num { font-size: 0.82rem; font-weight: 600; }
.cal-dots { position: absolute; bottom: 6px; display: flex; gap: 3px; }
.cd { width: 6px; height: 6px; border-radius: 999px; display: inline-block; }
.cd-overdue { background: var(--overdue-fg); }
.cd-pending { background: var(--soon-fg); }
.cd-done { background: var(--ok-fg); }
.cal-legend { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; margin-top: 12px; font-size: 0.8rem; color: var(--text-muted); }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-panel { margin-top: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); }
.cal-panel-h { font-weight: 700; margin-bottom: 8px; }
.dp-row { display: flex; align-items: center; gap: 10px; padding: 6px 0; }
.dp-row[data-open] { cursor: pointer; }
.dp-row[data-open]:hover .dp-name { text-decoration: underline; }
.dp-name { font-size: 0.9rem; }

/* --------------------- mobile: tab bar + ergonomics ---------------------- */

body { -webkit-tap-highlight-color: transparent; }
.btn, .icon-btn, .seg-btn, .tab, .fab, .cal-nav, .cal-cell, .site-card { touch-action: manipulation; }
.btn { min-height: 44px; }
.btn-sm { min-height: 38px; }

.wrap { padding-top: env(safe-area-inset-top); padding-bottom: calc(env(safe-area-inset-bottom) + 88px); }
.add-btn { margin-top: 12px; }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  flex: 1; appearance: none; background: none; border: none; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 0 8px; color: var(--text-muted);
  font: inherit; font-size: 0.7rem; font-weight: 600;
}
.tab .tab-ico .ico { width: 23px; height: 23px; }
.tab.is-active { color: var(--accent); }

.toast-wrap { bottom: calc(env(safe-area-inset-bottom) + 78px); }

/* ------------------------------- more page ------------------------------- */

.more-h { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; color: var(--text-muted); margin: 20px 2px 8px; }
.more-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px 16px; }
.more-card .hint { margin-top: 0; }
.more-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.more-actions .btn { flex: 1; min-width: 130px; }
.more-site-name { font-weight: 700; font-size: 1.1rem; }
.more-card input[type="password"] { width: 100%; }
#more-user { margin-top: 22px; }

/* --------------------- mobile: dialogs dock to the bottom ---------------- */

@media (max-width: 600px) {
  dialog {
    position: fixed; inset: auto 0 0 0; margin: 0;
    width: 100%; max-width: 100%;
    border-radius: 20px 20px 0 0; border-bottom: none;
    max-height: 92vh; overflow: auto;
    animation: sheet-up 0.2s ease-out;
  }
  dialog::backdrop { animation: fade-in 0.2s ease-out; }
  .dialog-foot {
    position: sticky; bottom: 0; background: var(--surface);
    padding-bottom: calc(16px + env(safe-area-inset-bottom));
  }
}
@keyframes sheet-up { from { transform: translateY(26px); opacity: 0.7; } to { transform: translateY(0); opacity: 1; } }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.hidden { display: none !important; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
