/* Privacy and Terms (backend/app/legal/*.html) and the operator's page (GET /admin/overview).
   The app's own look: every colour is a name from tokens.css, so the page is dark or light with the phone and needs no
   script. The only colours written here are for paper, under @media print. Text is never under 15 px. */
html{-webkit-text-size-adjust:100%;scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--cream);font:400 17px/1.6 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
main{max-width:680px;margin:0 auto;padding:28px 20px 56px}
h1{font-size:32px;line-height:1.15;font-weight:600;letter-spacing:-.02em;margin:0 0 8px}
h2{font-size:20px;line-height:1.3;font-weight:600;margin:30px 0 8px;scroll-margin-top:16px}
p{margin:0 0 14px}
strong{font-weight:600}
.meta{color:var(--muted);margin:0 0 20px;font-size:15px}
li{margin:8px 0}
a{color:var(--ember-hi);text-underline-offset:3px}
a:focus-visible{outline:2px solid var(--ember-hi);outline-offset:3px;border-radius:6px}

/* The top of a legal page: the mark leads back to the app; the two pages are a pair of chips, the open one is chosen. */
.top{display:flex;align-items:center;justify-content:space-between;gap:12px;max-width:680px;margin:0 auto;padding:max(14px,env(safe-area-inset-top)) 20px 14px;border-bottom:1px solid var(--line)}
.brand{position:relative;display:flex;align-items:center;border-radius:8px}
.brand:after{content:"";position:absolute;inset:-9px -4px} /* 44 px to the finger */
.brand img{display:block;height:28px;width:auto}
.pages{display:flex;gap:8px}
.pages a{position:relative;display:inline-flex;align-items:center;height:34px;padding:0 14px;border:1px solid var(--ghost-line);border-radius:17px;color:var(--cream);font-size:15px;line-height:1;font-weight:500;text-decoration:none}
.pages a:after{content:"";position:absolute;inset:-5px 0} /* 44 px to the finger */
.pages a[aria-current=page]{background:var(--sel);border-color:var(--sel);color:var(--sel-ink)}

/* A legal page itself: numbered sections under thin rules, a list of them at the top, the lines that matter most set off. */
.legal .lead{font-size:18px;line-height:1.55}
.legal main{counter-reset:part}
.legal main>h2{counter-increment:part;margin:34px 0 10px;padding-top:26px;border-top:1px solid var(--line)}
.legal main>h2:before{content:counter(part) ". ";color:var(--muted);font-weight:500}
/* The sections of the page. On a phone: one row of chips that scrolls sideways, edge to edge, like the app's own rows of
   chips, so the first section stays on the first screen. On a wide window: a card with the list in two columns. */
.toc{margin:22px 0 0}
.toc-t{margin:0 0 6px;color:var(--muted);font-size:15px;font-weight:600}
.toc ol{display:flex;gap:8px;margin:0 -20px;padding:5px 20px;list-style:none;overflow-x:auto;scrollbar-width:none}
.toc ol::-webkit-scrollbar{display:none}
.toc li{flex:none;margin:0}
.toc a{position:relative;display:inline-flex;align-items:center;height:34px;padding:0 14px;border:1px solid var(--ghost-line);border-radius:17px;color:var(--cream);font-size:15px;line-height:1;white-space:nowrap;text-decoration:none}
.toc a:after{content:"";position:absolute;inset:-5px 0} /* 44 px to the finger */
.key{margin:16px 0;padding:14px 16px;border:1px solid var(--line);border-left:3px solid var(--ember);border-radius:12px;background:var(--coal);font-weight:500}
.key>:last-child{margin-bottom:0}
.legal ul{margin:0 0 14px;padding:0;list-style:none}
.legal ul li{margin:0;padding:12px 0;border-top:1px solid var(--line)}
.legal ul li:first-child{border-top:0;padding-top:2px}
/* a list inside the set-off lines: plain dots, no rules */
.legal .key ul{margin:0 0 12px;padding:0 0 0 20px;list-style:disc}
.legal .key ul li,.legal .key ul li:first-child{margin:6px 0;padding:0;border:0}
.foot{display:flex;flex-wrap:wrap;gap:4px 20px;max-width:680px;margin:0 auto;padding:10px 20px max(28px,env(safe-area-inset-bottom));border-top:1px solid var(--line);font-size:15px}
.foot a{display:inline-flex;align-items:center;min-height:44px;color:var(--muted)}
@media (min-width:600px){
  main{padding-top:40px}
  h1{font-size:40px}
  .toc{margin-bottom:4px;padding:14px 18px 8px;border:1px solid var(--line);border-radius:16px;background:var(--coal);box-shadow:var(--paper-shadow)}
  .toc-t{margin-bottom:2px}
  .toc ol{display:block;columns:2;column-gap:32px;margin:0;padding:0 0 0 24px;list-style:decimal;overflow:visible}
  .toc li{break-inside:avoid}
  .toc li::marker{color:var(--muted)}
  .toc a{display:block;height:auto;padding:10px 0;border:0;border-radius:0;line-height:24px;white-space:normal}
  .toc a:after{content:none}
  .toc a:hover{text-decoration:underline}
}
@media (prefers-reduced-motion:reduce){html{scroll-behavior:auto}}
/* On paper: black on white, without the bar, the list of sections and the links at the foot. */
@media print{
  body{background:#fff;color:#000}
  .top,.toc,.foot{display:none}
  a{color:#000}
  .meta,.legal main>h2:before{color:#444}
  .key{background:none;border-color:#000}
  .legal main>h2,.legal ul li{border-color:#bbb}
}

/* The operator's page: the same look, wider, with tables. */
body.wide main{max-width:1100px}
table{width:100%;border-collapse:collapse;font-size:14px;line-height:1.4}
th,td{text-align:left;vertical-align:top;padding:6px 10px 6px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
th{color:var(--muted);font-weight:600}
/* The ideas board's team page (GET /admin/ideas/page, plan v21): the app's card rows. A waiting idea has a cross and a
   tick, a decided one a switch like the app's settings. Sizes from the owner's mock-up (option B, way 1). */
.op-page main{max-width:560px;padding-top:22px}
.op-page h1{font-size:28px;line-height:34px;margin:0}
.op-add{display:flex;gap:8px;margin:14px 0 0}
.op-add input{flex:1;min-width:0;min-height:48px;padding:10px 14px;border:0;border-radius:14px;box-shadow:inset 0 0 0 1px var(--field-edge);background:var(--white);color:var(--ink);color-scheme:light;font:400 16px/20px Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.op-add input::placeholder{color:var(--muted-ink);opacity:1}
.op-add button{flex:none;min-height:48px;padding:0 20px;border:0;border-radius:14px;background:linear-gradient(180deg,var(--btn-top) 0%,var(--btn-bottom) 100%);color:var(--btn-ink);box-shadow:inset 0 1px 0 var(--btn-shine),0 8px 20px var(--btn-glow);font:600 15px/1 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif;cursor:pointer}
.op-say{margin:6px 0 0;min-height:0;color:var(--muted);font-size:15px}
.op-say:empty{display:none}
.op-sec{margin:16px 0 8px;font-size:15px;line-height:20px;font-weight:600;color:var(--muted)}
.op-card{padding:2px 16px;border:1px solid var(--line);border-radius:20px;background:var(--coal)}
.op-row{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 0;border-bottom:1px solid var(--line)}
.op-row:last-child{border-bottom:0}
.op-t{min-width:0}
.op-title{font-size:16px;line-height:22px;font-weight:600;overflow-wrap:anywhere}
.op-row.hidden .op-title{color:var(--muted);font-weight:500}
.op-meta{margin-top:2px;font-size:15px;line-height:20px;color:var(--muted)}
.op-acts{display:flex;gap:8px;flex:none}
.op-btn{position:relative;display:grid;place-items:center;width:40px;height:40px;padding:0;border:0;border-radius:50%;background:var(--cocoa);color:var(--cream);cursor:pointer}
.op-btn:after{content:"";position:absolute;inset:-2px} /* 44 px to the finger */
.op-btn.ok{background:var(--ember);color:var(--on-ember)}
.op-sw{position:relative;flex:none;width:48px;height:28px;padding:0;border-radius:999px;background:var(--cocoa);border:1px solid var(--muted-ink);cursor:pointer}
.op-sw:before{content:"";position:absolute;inset:-9px -2px} /* 44 px to the finger */
.op-sw:after{content:"";position:absolute;top:2px;left:2px;width:22px;height:22px;border-radius:50%;background:var(--knob)}
.op-sw[aria-checked=true]{background:var(--sel);border-color:var(--sel)}
.op-sw[aria-checked=true]:after{transform:translateX(20px);background:var(--knob-on)}
.op-sw[aria-busy=true],.op-btn[aria-busy=true]{opacity:.6}
.op-btn:focus-visible,.op-sw:focus-visible,.op-add button:focus-visible{outline:2px solid var(--ember-hi);outline-offset:3px}
.op-foot{margin:22px 0 0}
@media (prefers-reduced-motion:no-preference){.op-sw,.op-sw:after{transition:transform .15s ease,background-color .15s ease,border-color .15s ease}}
/* The page a Telegram sign-in link opens (GET /auth/telegram/callback): one question, one button, a way back. */
.signin main{padding-top:40px}
.signin h1{font-size:28px}
.signin form{margin:24px 0 4px}
.go{display:flex;align-items:center;justify-content:center;width:100%;height:48px;padding:0 18px;border:0;border-radius:14px;cursor:pointer;
  background:linear-gradient(180deg,var(--btn-top) 0%,var(--btn-bottom) 100%);color:var(--btn-ink);box-shadow:inset 0 1px 0 var(--btn-shine),0 8px 20px var(--btn-glow);
  font:600 16px/1 Inter,system-ui,-apple-system,Segoe UI,Roboto,sans-serif}
.go:active{filter:brightness(.94)}
.go:focus-visible{outline:2px solid var(--ember-hi);outline-offset:3px}
.not-now{display:flex;align-items:center;justify-content:center;min-height:44px;color:var(--muted)}
