:root {
  color-scheme: light;
  --background: #f3f5f0;
  --surface: #fff;
  --ink: #18251f;
  --muted: #506257;
  --accent: #145c44;
  --accent-strong: #0b4030;
  --border: #d8dfd7;
  --alert: #854416;
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--background);
  color: var(--ink);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.topbar { min-height: 68px; padding: 12px max(24px, calc((100vw - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 1rem; color: #fff; background: #102e24; }
.brand { display: flex; align-items: center; gap: 12px; font-size: 1.02rem; font-weight: 700; }
.brand-mark { width: 20px; height: 20px; border: 2px solid #98e5af; border-radius: 5px; background: radial-gradient(circle, #98e5af 0 3px, transparent 4px); }
#session-actions { display: flex; align-items: center; gap: .9rem; font-size: .85rem; }
main { max-width: 1248px; padding: 36px 24px 64px; margin: auto; }
.heading { display: flex; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 22px; }
h1, h2, h3 { margin: 0; line-height: 1.18; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.05em; }
h2 { font-size: 1.2rem; letter-spacing: -.02em; }
h3 { font-size: 1rem; }
p { line-height: 1.55; margin: .55rem 0; }
.muted, .heading p { color: var(--muted); }
.navigation { display: flex; flex-wrap: wrap; gap: 6px; padding-bottom: 12px; margin-bottom: 20px; border-bottom: 1px solid var(--border); }
.navigation button { color: var(--muted); background: transparent; }
.navigation button[aria-current="page"] { color: var(--accent-strong); background: #dbecde; }
.content { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; }
.panel { grid-column: 1 / -1; padding: 20px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; min-width: 0; }
.panel > h2 { margin-bottom: 14px; }
.panel.half { grid-column: span 6; }
.panel.half:has(details[id^="telegram-prompt-"][open]) { grid-column: 1 / -1; }
.login { max-width: 420px; margin: min(12vh, 100px) auto 0; padding: 30px; }
.login h1 { font-size: 2rem; margin-bottom: 22px; }
.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.stat { padding: 16px; border-radius: 9px; background: #edf4ec; }
.stat strong { display: block; font-size: 1.8rem; font-variant-numeric: tabular-nums; }
label { display: grid; gap: 6px; color: var(--muted); font-weight: 650; font-size: .85rem; }
input, select, textarea, button { font: inherit; }
input, select, textarea { width: 100%; min-width: 0; padding: 9px 10px; color: var(--ink); background: #fff; border: 1px solid #aab9ae; border-radius: 7px; }
input[type="checkbox"] { width: auto; justify-self: start; }
textarea { min-height: 75px; resize: vertical; }
.account-picker { min-width: min(240px, 100%); }
button { width: fit-content; padding: 8px 13px; color: #fff; font-weight: 650; background: var(--accent); border: 1px solid transparent; border-radius: 7px; cursor: pointer; }
button:hover { background: var(--accent-strong); }
button:disabled { opacity: .6; cursor: wait; }
button.quiet { background: transparent; border-color: currentColor; color: inherit; }
button.secondary { color: var(--accent-strong); background: #edf4ec; }
:focus-visible { outline: 3px solid #a96c0b; outline-offset: 2px; }
form { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; }
form label { flex: 1 1 150px; }
form[data-action="retention"] label { flex: 0 1 190px; }
form[data-action="retention"] input { max-width: 110px; }
.camera-auth-fields { display: flex; flex: 1 0 100%; flex-wrap: wrap; gap: 12px; }
.camera-auth-fields p { flex: 1 0 100%; margin: 0; }
.camera-auth-fields[hidden] { display: none; }
.prompt-editor form label { flex: 1 0 100%; }
.prompt-editor textarea { font-weight: 400; }
.prompt-editor textarea[name="instructions"] { min-height: 18rem; }
.login form { display: grid; }
details { border-top: 1px solid var(--border); margin-top: 12px; padding-top: 12px; }
details > summary { cursor: pointer; font-weight: 650; color: var(--accent-strong); }
details > :not(summary) { margin-top: 12px; }
.items { display: grid; gap: 0; padding: 0; list-style: none; margin: 0; }
.item { padding: 12px 0; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.item:last-child { border-bottom: 0; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 10px; }
.report-picker { margin: 16px 0; padding: 12px; background: #f4f8f4; border-radius: 8px; }
.report-picker form label { flex: 0 1 180px; }
.report-picker [role="status"]:empty { display: none; }
.archive-search { margin-top: 12px; padding: 12px; background: #f4f8f4; border-radius: 8px; }
.feedback { position: fixed; z-index: 1; bottom: 10px; right: 12px; max-width: min(500px, calc(100vw - 24px)); background: #e7f0e7; border: 1px solid #83a68b; border-radius: 9px; padding: 12px 16px; box-shadow: 0 4px 20px #102e2420; }
.feedback.error, .warning { color: var(--alert); background: #fff5e7; }
.warning { border-radius: 7px; padding: 8px 12px; }
.table-wrap { overflow-x: auto; }
.construction-scroll { max-height: min(65vh, 42rem); overflow: auto; border: 1px solid var(--border); border-radius: 9px; margin: 12px 0; }
.construction-row { padding: 14px; border-bottom: 1px solid var(--border); overflow-wrap: anywhere; }
.construction-row:last-child { border-bottom: 0; }
.construction-scroll > h4 { margin: 0; padding: 12px 14px; background: #edf4ec; color: var(--accent-strong); }
.construction-event { margin: 10px; padding: 14px; border: 1px solid var(--border); background: #f9fbf8; border-radius: 8px; overflow-wrap: anywhere; }
.construction-event p { margin: .4rem 0; }
table { width: 100%; border-collapse: collapse; text-align: left; white-space: nowrap; }
th, td { border-bottom: 1px solid var(--border); padding: 9px 12px 9px 0; }
th { color: var(--muted); font-size: .86rem; }
a { color: var(--accent-strong); }
#admin-actions > .panel { margin-bottom: 16px; }
@media (max-width: 650px) {
  main { padding: 24px 14px 52px; }
  .topbar { padding: 12px 14px; }
  .heading { display: block; }
  .account-picker { margin-top: 14px; }
  .panel.half { grid-column: 1 / -1; }
  .stat { padding: 10px; font-size: .85rem; }
  .topbar, #session-actions { flex-wrap: wrap; }
}
