:root {
  color-scheme: light;
  --ink: #142033;
  --muted: #64748b;
  --line: #d9e2ec;
  --brand: #176b87;
  --brand-dark: #0e4e65;
  --bg: #f5f8fb;
  --card: #ffffff;
  --danger: #b42318;
  --success: #087443;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.topbar { height: 68px; padding: 0 5vw; display: flex; align-items: center; justify-content: space-between; background: #fff; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: .04em; color: var(--ink); }
.brand-logo { width: 40px; height: 40px; flex: 0 0 40px; object-fit: contain; object-position: center; border-radius: 8px; }
/* The original brand asset is now embedded in index.html; never show the legacy G placeholder. */
.brand-mark-fallback { display: none !important; }
nav { display: flex; gap: 20px; font-size: 14px; }
.container { max-width: 1000px; margin: 0 auto; padding: 56px 20px 80px; }
.hero { display: grid; grid-template-columns: 1.15fr .85fr; gap: 28px; align-items: center; }
.hero h1 { margin: 0 0 16px; font-size: clamp(34px, 5vw, 64px); line-height: 1.05; letter-spacing: -.04em; }
.hero p { color: var(--muted); font-size: 18px; line-height: 1.7; }
.eyebrow { color: var(--brand); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.card { padding: 26px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 12px 30px rgba(20,32,51,.06); }
.card + .card { margin-top: 18px; }
.grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 30px; }
.grid .card { box-shadow: none; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
button, .button { border: 0; border-radius: 10px; background: var(--brand); color: #fff; padding: 12px 16px; font-weight: 700; cursor: pointer; display: inline-block; }
button:hover, .button:hover { background: var(--brand-dark); text-decoration: none; }
.button.secondary, button.secondary { background: #e8f1f4; color: var(--brand-dark); }
.button.danger, button.danger { background: var(--danger); }
form { display: grid; gap: 14px; }
label { display: grid; gap: 6px; font-size: 14px; font-weight: 700; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 11px 12px; font: inherit; color: var(--ink); background: #fff; }
textarea { min-height: 96px; resize: vertical; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.full { grid-column: 1 / -1; }
.check-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 20px; padding: 12px; background: #f8fafc; border-radius: 12px; }
.check-grid label { display: flex; grid-template-columns: none; flex-direction: row; align-items: center; gap: 8px; font-weight: 500; }
.check-grid input { width: auto; }
.notice { padding: 13px 15px; border-radius: 10px; background: #eef6f8; color: var(--brand-dark); margin: 14px 0; }
.notice.error { background: #fff0ef; color: var(--danger); }
.notice.success { background: #eaf8f1; color: var(--success); }
.emergency { border-top: 8px solid #d73535; }
.emergency h1 { margin-top: 0; }
.language-switcher { display: grid; justify-items: start; gap: 6px; margin-bottom: 16px; color: var(--muted); font-size: 13px; }
.language-label { font-weight: 700; line-height: 1.25; }
.language-options { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; }
.language-switcher a[aria-current="true"] { font-weight: 800; color: var(--brand-dark); text-decoration: underline; }
.language-switcher select { width: auto; min-width: 108px; padding: 8px 10px; }
.owner-entry { margin-top: 24px; padding: 18px; border: 1px solid #b7d9e3; border-radius: 14px; background: #eef8fa; }
.owner-entry h2 { margin: 0 0 8px; font-size: 20px; }
.critical { padding: 16px; background: #fff7ed; border: 1px solid #fed7aa; border-radius: 12px; }
.field { padding: 15px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: 0; }
.field strong { display: block; font-size: 13px; color: var(--muted); margin-bottom: 5px; }
.field span, .field p { white-space: pre-wrap; line-height: 1.6; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.result { margin-top: 18px; }
.label-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 18px; }
.label-card { display: grid; justify-items: center; gap: 0.3mm; padding: 14px; border: 1px dashed #9aa9b8; border-radius: 12px; background: #fff; text-align: center; }
.label-card .qr-image { width: 150px; height: 150px; image-rendering: pixelated; }
.scan-me-svg { display: block; flex: 0 0 auto; }
.label-card .mono { max-width: 100%; overflow-wrap: anywhere; color: var(--muted); }
.inline-field { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 12px; font-weight: 500; }
.inline-field input { width: 76px; padding: 8px; }
.table-wrap { overflow-x: auto; }
/* Keep long admin lists usable without making the whole dashboard excessively tall. */
.admin-tables .table-wrap,
.operations-panel > .table-wrap { max-height: 340px; overflow: auto; border: 1px solid var(--line); border-radius: 10px; }
.operations-panel .production-dates { max-height: 380px; overflow-y: auto; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; }
.operations-panel .production-date-group .table-wrap { max-height: 240px; }
.admin-tables th,
.operations-panel th { position: sticky; top: 0; z-index: 1; background: #fff; }
.operations-panel > .actions { position: sticky; top: 0; z-index: 2; padding: 10px 0; background: var(--card); }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; }
.case-panel { margin-top: 18px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfc; }
.case-form { margin-top: 14px; }
.case-list { display: grid; gap: 12px; margin-top: 16px; }
.case-card { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #fff; }
.case-meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 12px; }
.case-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 12px 0; }
.case-card p { white-space: pre-wrap; line-height: 1.6; }
.analytics-panel { margin: 24px 0; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfc; }
.analytics-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.analytics-head h2 { margin: 0 0 4px; }
.analytics-rate { padding: 8px 12px; border-radius: 999px; background: #e8f6ef; color: var(--success); font-weight: 800; white-space: nowrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin: 16px 0 22px; }
.stat { padding: 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.stat span, .stat small { display: block; color: var(--muted); }
.stat strong { display: block; margin: 4px 0; font-size: 25px; }
.stat small { font-size: 12px; line-height: 1.45; }
.trend-table th, .trend-table td { white-space: nowrap; }
.pin-pool { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; margin: 16px 0; padding: 14px 16px; border: 1px solid #b7d9e3; border-radius: 12px; background: #eef8fa; color: var(--brand-dark); }
.pin-pool strong { margin-right: 8px; }
.footer { padding: 20px; text-align: center; color: var(--muted); font-size: 12px; }
@media (max-width: 760px) { .hero, .grid, .form-grid, .label-grid, .case-grid, .stats-grid { grid-template-columns: 1fr; } .analytics-head { display: block; } .analytics-rate { display: inline-block; margin-top: 8px; } nav { gap: 10px; font-size: 12px; } .topbar { padding: 0 18px; } .container { padding-top: 30px; } }
.finder-contact { margin-top: 20px; }
.lost-banner { margin-bottom: 16px; border-color: #b42318; color: #b42318; }
#lifecycle-v2 { margin-top: 18px; }
.operations-panel { margin-top: 18px; }
.production-dates { margin-top: 18px; }
.privacy-request-actions { margin-top: 0; gap: 6px; }
.privacy-request-reason { min-width: 180px; white-space: pre-wrap; }
.status-pills { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.status-pill { padding: 8px 10px; border-radius: 999px; background: #eef8fa; color: var(--brand-dark); font-size: 13px; }

.recovery-codes {
  white-space: pre-wrap;
  background: #f4f7f9;
  border: 1px solid #d8e1e7;
  border-radius: 12px;
  padding: 16px;
  font: 600 1rem/1.9 ui-monospace, SFMono-Regular, Consolas, monospace;
  letter-spacing: .04em;
}

details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid #d8e1e7;
}

details summary {
  cursor: pointer;
  color: #0b7087;
  font-weight: 700;
}

/* The administrator entry remains reachable at /admin but is never exposed in the public navigation. */
.topbar nav a[href="/admin"], a.button[href="/admin"] { display: none; }
.tutorial { margin: 18px 0; padding: 18px 24px; border: 1px solid #b7d9e3; border-radius: 14px; background: #eef8fa; line-height: 1.8; }
.tutorial li + li { margin-top: 6px; }
.contact-editor { grid-column: 1 / -1; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfe; }
.contact-editor h3 { margin: 0 0 6px; }
.contact-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.contact-row label { font-size: 12px; font-weight: 600; }
.policy h2 { margin-top: 24px; }
.policy p, .policy li { line-height: 1.75; }
@media (max-width: 760px) { .contact-row { grid-template-columns: 1fr; } }
html[dir="rtl"] .language-switcher { justify-content: flex-start; }
html[dir="rtl"] .topbar nav { flex-direction: row-reverse; }
@media (max-width: 640px) {
  .topbar { height: 60px; padding: 0 16px; }
  .brand { gap: 8px; font-size: 18px; }
  .brand-logo { width: 34px; height: 34px; flex-basis: 34px; border-radius: 7px; }
}
