/* gossnip: shared styles for our pages (/login/, /inside/, /moderator/).
   Load:  <link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Schibsted+Grotesk:wght@800&display=swap">
          <link rel="stylesheet" href="/_app/app.css">
   Copied from the blue site's kit and its /inside/ mock (public/inside/index.html), without the
   mock's ".ap-one" prefix on each rule: write the classes as the mock does, wrap the page in .ap-one.
   No inline styles anywhere (CSP): set widths from JS (el.style.width) or use the classes below.

   CLASSES YOU CAN USE
   Kit:      .group (white 12px block)  .pad (12px padded column)  .cap (small caps label)
             .note (12px footnote)  .tile (blue 28px icon tile, put an <svg> in it)  .wordmark
             .row (44px row; a.row/button.row get a chevron; add .plain for none)  .row > b / .row > span
             .btn (blue filled, full width by default)  .btn.soft (tint)
             .btn.danger (ink text on tint with an ink outline, no red: for Discard/Remove/Delete/Take down;
                          the label must say what it does)
             .btn.small (36px, auto width; 44px on phones)  .btn.auto (auto width)  .btn.full (full width)
             .link (text button/link in blue)  .muted (mute colour)  .sr-only  .spacer
             Every inline <svg> is a 16px line icon (stroke currentColor) unless a rule says otherwise.
             Use the hidden attribute to hide things ([hidden] always wins).
   Inside layout (from the mock): .ap-one (page wrapper)
             .ap-top > .ap-top-in > .ap-school | nav.ap-tabs (<a> with aria-current) | .ap-me
                 .ap-me holds, in this order: .ap-pending (optional), button.btn.ap-write,
                 .ap-who (optional, no longer used on /inside/: <b>name</b><small>...</small>), a.ap-link
                 (optional: "Moderator" / "Your school"), button.ap-out (Log out; add data-logout and
                 common.js wires it). A crowded right side wraps instead of overlapping.
             .ap-tabs a .count (number badge in a tab)   .ap-top.many (5 tabs: the moderator page)
             .ap-page (main)  .ap-panel (one tab panel; switch with the hidden attribute)
             .ap-feed (lead + list, two columns)  .ap-lead (big card: .ap-meta, h1, p, .ap-foot;
                 h1.long for a headline over 60 characters)
             .ap-list (group of .ap-item)  .ap-item (.ap-m meta line, h3, p, .ap-bar)  .ap-more ("Show more posts")
             .ap-head (tile + .cap + .ap-note)  .ap-note  .ap-under (two columns)  .ap-box (padded group, h2)
             .ap-stick (sticker box)  .ap-poll  .ap-opt (the mock's result row; .ap-mine)
             .ap-send (button + note on one line)  .ap-pending ("Waiting for the moderator: N")
   Like and comment bar (from the mock): .pa-box > .pa (.pa-b.pa-like[aria-pressed] .pa-b.pa-talk[aria-expanded],
             each <svg> + <span>Like</span> + optional <span class="pa-n">12</span>)
             .pa-more[hidden] > ul.pa-list > li.pa-c (<b>name · ago</b><span>text</span>; add .has-del and a
             button.pa-del for Delete) ; form.pa-form > input.pa-in + button.pa-send ; p.pa-fact (the
             "A comment shows at once..." line) ; p.pa-note (status under the bar)
   People:   span.av (G.avatar: round picture or letter tile; sizes .av-20 .av-24 .av-40 .av-48)
             a.who (avatar + <b>name</b>, links to /inside/#user/<name>; 44px tall on phones)
   Forms:    .form (column of fields, 16px gaps)  .f (one field: <label> + input/textarea/select + .help + .err)
             .f.row-f (input and button side by side, e.g. a poll choice with Remove)
             .in (the input look; .f input/textarea/select get it automatically) ; [aria-invalid="true"]
             .help (help text)  .err (error text, the sign-up page's #b3202a; :empty takes no space)
             .count-line (live counter, right-aligned)  .actions (buttons in a row, wrap on phones)
             .pw (password with Show/Hide inside: .pw > input + button.pw-t)
   Dialog:   <dialog class="dlg"><div class="dlg-in"> h2, fields, .actions </div></dialog>
   Composer: ul.att-tray > li.att-item (img or video, span.att-len "0:42", button.att-rm Remove; li.att-sticker)
             .att-add (two .btn.soft)  .att-pick > ul.att-grid > li > button.att-s[aria-pressed] > img
   Post media: .pm-media (img / video; .two for two columns)  .pm-stickers > img (96px)
   States:   .empty (empty-state text, put it in a .group)  .status (status line with role="status": keep
             it in the page while empty, fill it with G.status; .status.bad for an error)
             .confirm (inline ask: <span>Discard this submission?</span> + .btn.danger + .btn.soft)
             .count (number badge, hidden while empty)  .badge (small label, e.g. "Closed"; .badge.ink)
   Polls:    .poll-top (question + .badge)  .choices > button.choice (one per choice, to vote)
             .bar (result row: <i> whose width JS sets, <span>label <em>Your choice</em></span>,
             <b>58% <small>· 120</small></b>; .bar.mine for the choice just picked)
   Stickers: ul.stick-grid > li.stick-c > .stick-img > img, then .stick-meta, .stick-acts (buttons)
             .hide-img on .stick-img (or the img) blurs it until the class is removed
   Login:    .card-page (centred on the ground) > main.card (white group: a.wordmark, h1, .form, .card-alt
             "New here? Sign up") + nav.card-links (Home, Privacy)
   Moderator: the same .ap-one / .ap-top.many / .ap-page; .mod-list > .mod-item (white group: .mod-row,
             .ap-m meta line, h3, p or .body, .form, .actions)
*/

/* ---------- tokens and reset ---------- */
:root{
  --blue:#1257ff; --blue-d:#0c46d6; --ink:#0b1533; --mute:#5b6685;
  --ground:#eef3ff; --tint:#dfe8ff; --line:#d9e1f5; --white:#fff;
  --text:#2a3558; --press:#0a3ab3; --err:#b3202a;
  --head:"Schibsted Grotesk",system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,sans-serif;
}
*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%;text-size-adjust:100%}
html,body{margin:0;padding:0}
body{min-height:100vh;background:var(--ground);color:var(--ink);font:400 15px/1.45 var(--sans);-webkit-font-smoothing:antialiased;overflow-x:hidden;overflow-wrap:break-word}
a{color:inherit;text-decoration:none}
h1,h2,h3,p,ol,ul{margin:0;padding:0}
ol,ul{list-style:none}
img{max-width:100%;height:auto}
button,input,select,textarea{font:inherit;color:inherit}
button{cursor:pointer}
button:disabled{cursor:default}
[hidden]{display:none!important}
:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
svg{width:16px;height:16px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;flex:none}
.sr-only{position:absolute!important;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap}
.muted{color:var(--mute)}
.spacer{flex:1}

/* ---------- kit parts (blue site) ---------- */
.wordmark{font:800 22px/1.1 var(--head);letter-spacing:-.02em;color:var(--blue)}
a.wordmark:hover{color:var(--blue-d)}
a.wordmark:active{color:var(--press)}
.wordmark .logo{display:block;width:auto;height:28px}   /* the logo (public/brand/, from the blue site's www/brand/): 133 x 28 */
a.wordmark:hover .logo{opacity:.8}
a.wordmark:active .logo{opacity:.65}
.cap{display:block;font-size:12px;font-weight:600;letter-spacing:.04em;text-transform:uppercase;color:var(--mute);padding:8px 16px 0}
.note{font-size:12px;line-height:1.35;color:var(--mute);padding:0 16px 8px}
.group{background:var(--white);border-radius:12px;overflow:hidden}
.pad{padding:12px;display:flex;flex-direction:column;gap:8px}
.row{position:relative;display:flex;align-items:center;gap:12px;min-height:44px;padding:10px 40px 10px 16px;width:100%;border:0;background:none;font:inherit;color:inherit;text-align:left}
.row + .row::before{content:"";position:absolute;left:16px;right:0;top:0;height:1px;background:var(--line)}
a.row::after,button.row::after{content:"";position:absolute;right:18px;top:50%;width:7px;height:7px;margin-top:-4px;border:solid #a9b5d6;border-width:2px 2px 0 0;transform:rotate(45deg)}
a.row,button.row{cursor:pointer;transition:background .12s}
a.row:hover,button.row:hover{background:#f5f8ff}
a.row:active,button.row:active{background:var(--tint)}
a.row:focus-visible,button.row:focus-visible{outline-offset:-2px}
.row > b{font-weight:500;flex:1;min-width:0}
.row > span{color:var(--mute);text-align:right}
.row[aria-current]{color:var(--blue)}
.row[aria-current] > b{font-weight:700}
.row.plain{padding-right:16px}
.row.plain::after{display:none}
.tile{flex:none;width:28px;height:28px;border-radius:7px;background:var(--blue);color:var(--white);display:flex;align-items:center;justify-content:center;font-style:normal}
.tile svg{width:16px;height:16px;fill:none;stroke:#fff;stroke-width:1.8}

/* buttons: filled, 12px radius, 44px. In the blue and ink only: .danger is ink on tint, its label says what it does */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:44px;margin:0;padding:0 16px;border:0;border-radius:12px;background:var(--blue);color:var(--white);font:600 15px/1.2 var(--sans);text-align:center;cursor:pointer;transition:background .12s,transform .08s}
.btn:hover{background:var(--blue-d)}
.btn:active{background:var(--press);transform:scale(.985)}
.btn:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.btn.soft{background:var(--tint);color:var(--blue-d)}
.btn.soft:hover{background:#d0dcff}
.btn.soft:active{background:#bfd0ff}
.btn.danger{background:var(--tint);color:var(--ink);border:1.5px solid var(--ink)}
.btn.danger:hover{background:#d0dcff}
.btn.danger:active{background:#bfd0ff}
.btn.auto,.btn.small{width:auto;flex:none;white-space:nowrap}
.btn.small{min-height:36px;padding:0 14px;font-size:14px;border-radius:10px}
.btn.full{width:100%}
.btn:disabled,.btn[aria-disabled="true"]{background:var(--tint);color:var(--mute);border-color:transparent;cursor:default;transform:none}
.link{display:inline-flex;align-items:center;min-height:44px;padding:0 2px;border:0;background:none;font:inherit;font-weight:600;color:var(--blue-d);cursor:pointer}
.link:hover{text-decoration:underline}
.link:active{color:var(--ink)}
.link:focus-visible{outline:2px solid var(--blue);outline-offset:-2px;border-radius:6px}

/* ---------- the inside layout (from the /inside/ mock) ---------- */
.ap-one{min-height:100vh;padding-bottom:24px;color:var(--ink)}
.ap-one .cap{padding:0}
.ap-top{position:sticky;top:0;z-index:3;background:var(--white);border-bottom:1px solid var(--line)}
/* one line: school | tabs (centred) | me. Flex, not grid, so a crowded bar wraps the right side instead of overlapping */
.ap-top-in{max-width:1168px;margin:0 auto;padding:0 24px;min-height:64px;display:flex;align-items:center;gap:16px}
.ap-school{flex:0 1 auto;font:800 22px/1.1 var(--head);letter-spacing:-.01em}
a.ap-school:hover{color:var(--blue-d)}
.ap-tabs{display:flex;flex:1 1 auto;justify-content:center;align-self:stretch}
.ap-tabs a{display:flex;align-items:center;gap:8px;padding:0 18px;font-weight:600;color:var(--mute);border-bottom:3px solid transparent;border-top:3px solid transparent;white-space:nowrap;transition:color .12s}
.ap-tabs a:hover{color:var(--ink)}
.ap-tabs a:active{color:var(--blue-d);background:#f5f8ff}
.ap-tabs a[aria-current]{color:var(--blue);border-bottom-color:var(--blue)}
.ap-tabs a:focus-visible{outline-offset:-4px}
.ap-tabs .count{margin-left:-2px}
.ap-me{flex:0 1 auto;display:flex;flex-wrap:wrap;align-items:center;justify-content:flex-end;gap:4px 14px;text-align:right}
.ap-me b{display:block;font-weight:600;font-size:14px}
.ap-me small{display:block;font-size:12px;color:var(--mute);white-space:nowrap}
.ap-who{padding-right:14px;border-right:1px solid var(--line);min-width:0;max-width:16em}
.ap-who b{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.ap-out,.ap-link{display:inline-flex;align-items:center;gap:7px;min-height:44px;padding:0 2px;border:0;background:none;font:600 14px/1.2 var(--sans);color:var(--blue-d);flex:none;cursor:pointer;white-space:nowrap}
.ap-out:hover,.ap-link:hover{text-decoration:underline}
.ap-out:active,.ap-link:active{color:var(--ink)}
.ap-out:focus-visible,.ap-link:focus-visible{outline:2px solid var(--blue);outline-offset:2px;border-radius:6px}
.btn.ap-write{width:auto;flex:none;min-height:40px;height:40px;padding:0 16px;font-size:14px;border-radius:10px;gap:8px;white-space:nowrap}
.ap-pending{font-size:13px;line-height:1.3;font-weight:600;color:var(--blue-d)}
.ap-me .ap-pending{max-width:11em;text-align:right}
.ap-page{max-width:1168px;margin:0 auto;padding:20px 24px 0;display:grid;gap:16px;min-width:0}
.ap-page > *{min-width:0}
.ap-panel{display:grid;gap:16px;min-width:0;scroll-margin-top:80px}
.ap-panel > *{min-width:0}
.ap-feed{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px;scroll-margin-top:80px}
.ap-lead{display:flex;flex-direction:column;padding:26px 32px 20px}
.ap-meta{display:flex;align-items:center;justify-content:space-between;gap:10px;font-size:14px;color:var(--mute);min-width:0}
.ap-lead h1{font:800 66px/1 var(--head);letter-spacing:-.025em;margin-top:14px;max-width:11em;overflow-wrap:anywhere;text-wrap:balance}
.ap-lead h1.long{font-size:44px;line-height:1.05;max-width:16em}   /* add .long to a headline over 60 characters */
.ap-lead > p{font-size:23px;line-height:1.42;margin-top:20px;max-width:27em;white-space:pre-line}
.ap-foot{margin-top:14px;padding-top:12px}
.ap-head{display:flex;align-items:center;gap:10px;padding:14px 16px 6px}
.ap-head .ap-note{margin-top:1px}
.ap-head > div{min-width:0}
.ap-note{font-size:13px;line-height:1.4;color:var(--mute)}
.ap-item{position:relative;padding:11px 12px 11px 16px;display:grid;grid-template-columns:minmax(0,1fr) auto;column-gap:14px;align-items:center}
.ap-item > *{grid-column:1}
.ap-item .ap-bar,.ap-item .pa-box{display:contents}
.ap-item + .ap-item::before{content:"";position:absolute;left:16px;right:0;top:0;height:1px;background:var(--line)}
.ap-item h3{font-size:16px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
.ap-item > p{font-size:14px;line-height:1.4;color:var(--mute);margin-top:2px;white-space:pre-line;overflow-wrap:anywhere}
.ap-m{display:block;font-size:13px;font-weight:400;color:var(--mute);margin-bottom:1px}
.ap-by b,.ap-m b{font-weight:600;color:var(--ink)}
.ap-more{display:flex;justify-content:center;padding:12px 16px}
.ap-list > .ap-more{border-top:1px solid var(--line)}
.ap-under{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:16px}
.ap-stick{display:flex;flex-direction:column}
.ap-box{padding:0 16px 18px;scroll-margin-top:80px}
.ap-box .ap-head{padding:16px 0 10px}
.ap-box h2{font:800 24px/1.1 var(--head);letter-spacing:-.015em;margin-bottom:14px;overflow-wrap:anywhere}
.ap-poll .ap-note{margin-top:12px}
.ap-opt{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;padding:8px 14px;border-radius:9px;background:var(--ground);overflow:hidden;margin-bottom:7px;font-weight:600;font-size:14px}
.ap-opt i{position:absolute;left:0;top:0;bottom:0;width:0;background:var(--tint)}
.ap-opt span,.ap-opt b{position:relative;min-width:0}
.ap-opt em{font-style:normal;font-weight:600;font-size:12px;color:var(--blue-d);margin-left:10px}
.ap-opt.ap-mine{outline:2px solid var(--blue);outline-offset:-2px}
.ap-opt.ap-mine b{color:var(--blue-d)}
.ap-opt.ap-mine i{border:2px solid var(--blue);border-right:0;border-radius:9px 0 0 9px}
.ap-send{display:flex;align-items:center;gap:14px}
.ap-send .btn{width:auto;flex:none;min-height:38px;height:38px;padding:0 16px;font-size:14px;border-radius:10px;gap:8px}

/* ---------- like and comment bar (from the mock: the shared .pa bar with the inside look) ---------- */
.pa{display:flex;align-items:center;gap:2px;margin:0 0 0 -8px}
.pa-b{position:relative;display:inline-flex;align-items:center;gap:7px;min-height:36px;padding:0 8px;border:0;border-radius:8px;background:none;font:600 14px/1 var(--sans);color:var(--mute);cursor:pointer}
.pa-b::before{content:"";position:absolute;inset:0;border-radius:8px}
.pa-b svg,.pa-b span{position:relative}
.pa-b svg{width:18px;height:18px;stroke-width:1.6}
@media (hover:hover){   /* a phone keeps :hover after a tap, so the hover look is for a mouse only */
  .pa-b:hover{color:var(--blue-d)}
  .pa-b:hover::before{background:var(--ground)}
}
.pa-b:active::before{background:var(--tint)}
.pa-b:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
.pa-b:disabled{cursor:default}
.pa-like[aria-pressed="true"],.pa-talk[aria-expanded="true"]{color:var(--blue-d)}
.pa-like[aria-pressed="true"] svg{fill:currentColor}
.pa-n{font-variant-numeric:tabular-nums}
.pa-more{padding-top:0}
.pa-list{margin:0;padding:0;list-style:none}
.pa-c{position:relative;margin:0 0 8px;padding:9px 12px;border-radius:10px;background:var(--ground)}
.pa-c b{display:block;font-size:12px;line-height:1.4;font-weight:600;color:var(--mute)}
.pa-c span{display:block;font-size:15px;line-height:1.4;color:var(--ink);overflow-wrap:anywhere;white-space:pre-line}
.pa-c.has-del{padding-right:84px}
.pa-del{position:absolute;top:0;right:4px;display:inline-flex;align-items:center;min-height:44px;padding:0 10px;border:0;border-radius:8px;background:none;font:600 13px/1 var(--sans);color:var(--blue-d);cursor:pointer}
.pa-del:hover{text-decoration:underline}
.pa-del:active{color:var(--ink)}
.pa-del:focus-visible{outline:2px solid var(--blue);outline-offset:-6px}
.pa-c .confirm{margin-top:6px}
.pa-form{display:flex;gap:8px;margin:0}
.pa-in{flex:1;min-width:0;height:44px;padding:0 14px;border:1px solid var(--line);border-radius:10px;background:var(--ground);font:inherit;font-size:16px;color:var(--ink)}
.pa-in::placeholder{color:var(--mute);opacity:1}
.pa-in:hover{border-color:var(--mute)}
.pa-in:focus{outline:2px solid var(--blue);outline-offset:-2px;border-color:var(--blue)}
.pa-send{flex:none;height:44px;padding:0 18px;border:0;border-radius:10px;background:var(--tint);color:var(--blue-d);font:600 14px/1 var(--sans);cursor:pointer}
.pa-send:hover{background:var(--line)}
.pa-send:active{background:var(--blue);color:var(--white)}
.pa-send:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.pa-send:disabled{background:var(--tint);color:var(--mute);cursor:default}
.pa-note,.pa-fact{margin:8px 0 0;font-size:13px;line-height:1.4;color:var(--mute)}
.pa-note:empty{margin:0}
.pa-more:not([hidden]) + .pa-note{margin-top:2px}
.ap-lead .pa-more{margin-top:4px;padding-top:12px;border-top:1px solid var(--line)}
.ap-item .pa{grid-column:2;grid-row:1/span 3;flex-direction:column;align-items:flex-start;margin:0}
.ap-item .pa-b{min-height:28px;font-size:13px}
/* auto rows: the thread and the note come after the post's photos and stickers, however many rows those take */
.ap-item .pa-more{grid-column:1/-1;grid-row:auto;padding-top:10px}
.ap-item .pa-note{grid-column:1/-1;grid-row:auto}

/* ---------- a student's round picture or letter tile (G.avatar in common.js) ---------- */
.av{position:relative;display:inline-flex;align-items:center;justify-content:center;flex:none;width:24px;height:24px;border-radius:50%;overflow:hidden;background:var(--tint);color:var(--white);font:800 12px/1 var(--head);vertical-align:middle;user-select:none}
.av img{display:block;width:100%;height:100%;max-width:none;object-fit:cover}
.av.av-20{width:20px;height:20px;font-size:11px}
.av.av-24{width:24px;height:24px;font-size:12px}
.av.av-40{width:40px;height:40px;font-size:17px}
.av.av-48{width:48px;height:48px;font-size:20px}
/* a name that links to a profile: picture + name, 44px tall to tap on a phone */
a.who{display:inline-flex;align-items:center;gap:7px;min-width:0;max-width:100%;border-radius:8px;color:var(--ink);vertical-align:middle}
a.who b{font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
a.who:hover b{text-decoration:underline;color:var(--blue-d)}
a.who:active b{color:var(--press)}
a.who:focus-visible{outline:2px solid var(--blue);outline-offset:2px}

/* ---------- forms (the sign-up page's fields) ---------- */
.form{display:flex;flex-direction:column;gap:16px;min-width:0}
.f{display:flex;flex-direction:column;gap:6px;min-width:0}
.f > label,.f > .lbl{font-size:14px;line-height:1.3;font-weight:600;color:var(--ink)}
.f.row-f{flex-direction:row;flex-wrap:wrap;align-items:flex-end;gap:8px}
.f.row-f > :is(input,select,textarea,.in){flex:1 1 180px;width:auto}
.in,.f input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),.f textarea,.f select{display:block;width:100%;min-height:48px;margin:0;padding:0 12px;border:1.5px solid #7f8bb0;border-radius:10px;background:var(--white);font:inherit;font-size:16px;line-height:1.4;color:var(--ink)}
textarea.in,.f textarea{min-height:120px;padding:10px 12px;resize:vertical}
select.in,.f select{-webkit-appearance:none;appearance:none;padding-right:40px;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='%235b6685' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 12px center;background-size:16px;cursor:pointer}
.in::placeholder,.f input::placeholder,.f textarea::placeholder{color:var(--mute);opacity:1}
.in:hover,.f input:hover,.f textarea:hover,.f select:hover{border-color:var(--mute)}
.in:focus,.f input:focus,.f textarea:focus,.f select:focus{outline:2px solid var(--blue);outline-offset:-2px;border-color:var(--blue)}
.in:disabled,.f input:disabled,.f textarea:disabled,.f select:disabled{background:var(--ground);color:var(--mute)}
[aria-invalid="true"]{border-color:var(--err)!important}
[aria-invalid="true"]:focus{outline-color:var(--err)}
.help{margin:0;font-size:13px;line-height:1.4;color:var(--mute)}
.err{margin:0;font-size:13px;line-height:1.4;font-weight:600;color:var(--err)}
.err:empty{display:none}
[aria-invalid="true"] ~ .help{display:none}   /* the error says the same and more */
.count-line{margin:0;font-size:12px;line-height:1.4;color:var(--mute);text-align:right;font-variant-numeric:tabular-nums}
.actions{display:flex;flex-wrap:wrap;align-items:center;gap:8px}
.actions .btn{width:auto;flex:none}
.pw{position:relative;display:block}
.pw > input{padding-right:84px!important}
.pw-t{position:absolute;top:2px;right:2px;bottom:2px;min-width:72px;padding:0 12px;border:0;border-radius:8px;background:none;font:600 14px/1 var(--sans);color:var(--blue-d);cursor:pointer}
.pw-t:hover{background:var(--ground)}
.pw-t:active{background:var(--tint)}
.pw-t:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}

/* ---------- dialog: a white group in the middle of the screen ---------- */
dialog.dlg{width:min(560px,calc(100vw - 24px));max-width:none;max-height:calc(100vh - 24px);margin:auto;padding:0;border:0;border-radius:12px;background:var(--white);color:var(--ink);overflow:auto}
dialog.dlg::backdrop{background:rgba(11,21,51,.45)}
.dlg-in{display:flex;flex-direction:column;gap:12px;padding:20px}
.dlg h2{font:800 24px/1.1 var(--head);letter-spacing:-.015em}
.dlg .help,.dlg .ap-note{margin:0}
.dlg .actions{justify-content:flex-end;padding-top:4px}

/* ---------- the composer's photos, video and stickers (ATTACHMENTS-SPEC.md) ---------- */
/* the tray: square thumbnails, each with a 44px Remove button under it */
.att-tray{display:grid;grid-template-columns:repeat(auto-fill,minmax(104px,1fr));gap:8px;margin:0;padding:0;list-style:none}
.att-item{position:relative;display:flex;flex-direction:column;gap:4px;min-width:0}
.att-item > img,.att-item > video{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:cover;border-radius:10px;background:var(--ground)}
.att-sticker > img{object-fit:contain}
.att-len{position:absolute;left:6px;top:6px;padding:2px 6px;border-radius:6px;background:var(--ink);color:var(--white);font:600 12px/1.3 var(--sans);font-variant-numeric:tabular-nums}
.att-rm{display:inline-flex;align-items:center;justify-content:center;min-height:44px;padding:0 8px;border:0;border-radius:8px;background:none;font:600 13px/1 var(--sans);color:var(--blue-d);cursor:pointer}
.att-rm:hover{background:var(--ground);text-decoration:underline}
.att-rm:active{background:var(--tint);color:var(--ink)}
.att-rm:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
/* "Add photo or video" and "Add sticker" side by side */
.att-add{display:flex;flex-wrap:wrap;gap:8px}
.att-add .btn{width:auto;flex:1 1 180px}
.att-add .btn[aria-expanded="true"]{background:#d0dcff;color:var(--ink)}
/* the sticker picker: one toggle button per approved sticker */
.att-pick{display:flex;flex-direction:column;gap:8px;padding:10px;border-radius:10px;background:var(--ground)}
.att-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(76px,1fr));gap:8px;margin:0;padding:0;list-style:none}
.att-s{display:flex;align-items:center;justify-content:center;width:100%;aspect-ratio:1/1;min-height:44px;padding:6px;border:2px solid transparent;border-radius:10px;background:var(--white);cursor:pointer}
.att-s img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain}
.att-s:hover{border-color:var(--line)}
.att-s:active{background:var(--tint)}
.att-s:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.att-s[aria-pressed="true"]{border-color:var(--blue);background:var(--tint)}
/* while a post is sending: Remove, the sticker toggles and the add buttons look disabled (aria-disabled) */
.att-rm[aria-disabled="true"],.att-rm[aria-disabled="true"]:hover,.att-rm[aria-disabled="true"]:active{background:none;color:var(--mute);text-decoration:none;cursor:default}
.att-s[aria-disabled="true"]{cursor:default}
.att-s[aria-disabled="true"] img{opacity:.5}
.att-s[aria-disabled="true"]:hover{border-color:transparent}
.att-s[aria-disabled="true"][aria-pressed="true"]:hover{border-color:var(--blue)}
.att-s[aria-disabled="true"]:active{background:var(--white)}
.att-s[aria-disabled="true"][aria-pressed="true"]:active{background:var(--tint)}
.att-add .btn[aria-disabled="true"],.att-add .btn[aria-disabled="true"]:hover,.att-add .btn[aria-disabled="true"]:active{background:var(--tint);color:var(--mute);cursor:default;transform:none}

/* ---------- photos, the video and stickers in a post (feed) ---------- */
.pm-media{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;margin-top:12px;min-width:0}
.pm-media.two{grid-template-columns:repeat(2,minmax(0,1fr))}
.pm-media > img,.pm-media > video{display:block;width:100%;height:auto;max-height:520px;object-fit:contain;border-radius:10px;background:var(--ground)}
.pm-stickers{display:flex;flex-wrap:wrap;gap:8px;margin-top:10px}
.pm-stickers > img{display:block;width:96px;height:96px;object-fit:contain;border-radius:10px;background:var(--ground)}

/* ---------- states ---------- */
.empty{padding:24px 16px;text-align:center;font-size:15px;line-height:1.45;color:var(--text)}
.status{margin:0;font-size:14px;line-height:1.4;font-weight:600;color:var(--ink)}
.status:not(:empty){padding:10px 14px;border-radius:10px;background:var(--tint)}
.status.bad:not(:empty){color:var(--err);background:var(--white);border:1.5px solid var(--err)}
.confirm{display:flex;flex-wrap:wrap;align-items:center;gap:8px;padding:8px 10px;border-radius:10px;background:var(--ground)}
.confirm > span{flex:1 1 160px;min-width:0;font-weight:600;color:var(--ink)}
.confirm .btn{width:auto;flex:none;min-height:36px;padding:0 14px;font-size:14px;border-radius:10px}
.count{display:inline-flex;align-items:center;justify-content:center;min-width:22px;height:22px;padding:0 7px;border-radius:11px;background:var(--blue);color:var(--white);font:700 12px/1 var(--sans);font-variant-numeric:tabular-nums}
.count:empty{display:none}
.badge{display:inline-flex;align-items:center;height:22px;padding:0 8px;border-radius:6px;background:var(--tint);color:var(--blue-d);font:600 12px/1 var(--sans)}
.badge.ink{background:var(--ground);color:var(--ink);border:1px solid var(--line)}

/* ---------- polls: choice buttons and result bars ---------- */
.choices{display:flex;flex-direction:column;gap:7px}
.choice{display:flex;align-items:center;width:100%;min-height:44px;padding:8px 14px;border:1.5px solid var(--line);border-radius:9px;background:var(--white);font:600 14px/1.3 var(--sans);color:var(--ink);text-align:left;cursor:pointer;transition:background .12s,border-color .12s}
.choice:hover{border-color:var(--blue);background:#f5f8ff}
.choice:active{background:var(--tint)}
.choice:focus-visible{outline:2px solid var(--blue);outline-offset:2px}
.choice:disabled{cursor:default;color:var(--mute);border-color:var(--line);background:var(--ground)}
.bar{position:relative;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:42px;margin-bottom:7px;padding:8px 14px;border-radius:9px;background:var(--ground);overflow:hidden;font-weight:600;font-size:14px;line-height:1.3}
.bar > i{position:absolute;left:0;top:0;bottom:0;width:0;max-width:100%;background:var(--tint);transition:width .4s ease-out}
.bar > span,.bar > b{position:relative;min-width:0}
.bar > span{overflow-wrap:anywhere}
.bar > b{flex:none;font-variant-numeric:tabular-nums;white-space:nowrap}
.bar small{font-size:12px;font-weight:600;color:var(--mute)}
.bar em{font-style:normal;font-weight:600;font-size:12px;color:var(--blue-d);margin-left:10px;white-space:nowrap}
.bar.mine{outline:2px solid var(--blue);outline-offset:-2px}
.bar.mine > b{color:var(--blue-d)}
.poll-top{display:flex;align-items:flex-start;justify-content:space-between;gap:10px}
.poll-top h2,.poll-top h3{flex:1;min-width:0}

/* ---------- stickers ---------- */
.stick-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(132px,1fr));align-items:start;gap:10px;margin:0;padding:0;list-style:none}
.stick-c{position:relative;display:flex;flex-direction:column;gap:8px;min-width:0;padding:8px;border-radius:12px;background:var(--ground)}
.stick-img{position:relative;display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;border-radius:8px;background:var(--white);overflow:hidden}
.stick-c img,.stick-img img{display:block;max-width:100%;max-height:100%;width:auto;height:auto;object-fit:contain;margin:auto}
.stick-grid > li > img,.stick-grid > img{display:block;width:100%;height:auto;aspect-ratio:1/1;object-fit:contain;border-radius:12px;background:var(--ground)}
.stick-meta{font-size:12px;line-height:1.35;color:var(--mute)}
.stick-acts{display:flex;flex-wrap:wrap;gap:6px}
.stick-acts .btn{width:auto;flex:1 1 auto;min-height:36px;padding:0 10px;font-size:13px;border-radius:9px}
/* the moderator's preview of a pending sticker: blurred until "Show" is pressed (the one blur allowed) */
.hide-img{position:relative;overflow:hidden}
.hide-img img{filter:blur(18px);transform:scale(1.1)}
.hide-img::after{content:"Hidden";position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:4px 10px;border-radius:6px;background:var(--white);color:var(--ink);font:600 12px/1.3 var(--sans);pointer-events:none}
img.hide-img{filter:blur(18px)}

/* ---------- log-in: a centred white card on the pale blue ground ---------- */
.card-page{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:12px;padding:24px 16px}
.card{width:100%;max-width:420px;display:flex;flex-direction:column;gap:16px;padding:24px;background:var(--white);border-radius:12px}
.card .wordmark{align-self:flex-start;display:inline-flex;align-items:center;min-height:44px;margin:-10px 0 -6px}
.card h1{font:800 36px/1.1 var(--head);letter-spacing:-.02em;color:var(--ink)}
.card .btn{width:100%;min-height:48px;font-size:16px}
.card-alt{margin:0;font-size:15px;line-height:1.4;color:var(--text)}
.card-alt a,.card-links a{display:inline-flex;align-items:center;min-height:44px;padding:0 2px;font-weight:600;color:var(--blue-d)}
.card-alt a{margin:-12px 0}
.card-alt a:hover,.card-links a:hover{text-decoration:underline}
.card-alt a:active,.card-links a:active{color:var(--ink)}
.card-alt a:focus-visible,.card-links a:focus-visible{outline:2px solid var(--blue);outline-offset:-2px;border-radius:6px}
.card-links{display:flex;flex-wrap:wrap;justify-content:center;gap:4px 16px;font-size:13px}
.card-links a{font-weight:600}

/* ---------- moderator: one item per group row ---------- */
.mod-list{display:flex;flex-direction:column;gap:12px;min-width:0}
.mod-item{display:flex;flex-direction:column;gap:12px;padding:16px;background:var(--white);border-radius:12px;min-width:0}
.mod-item + .mod-item{margin-top:0}
.mod-item .ap-m{margin:0}
.mod-item h3{font-size:16px;font-weight:700;line-height:1.3;overflow-wrap:anywhere}
.mod-item > p,.mod-item .body{color:var(--text);white-space:pre-line;overflow-wrap:anywhere}
.mod-item .actions{padding-top:2px}
.mod-row{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:8px 12px;min-width:0}
.mod-row > :first-child{flex:1 1 200px;min-width:0}

/* ---------- 761 to 1080 px: tabs on their own line under the school name ---------- */
@media (min-width:761px) and (max-width:1080px){
  .ap-top-in{flex-wrap:wrap;row-gap:0}
  .ap-school{order:1;flex:1 1 auto}
  .ap-me{order:2;min-height:64px}
  .ap-tabs{order:3;flex:1 0 100%;height:48px;justify-content:flex-start;margin-left:-18px}
  .ap-feed,.ap-box,.ap-panel{scroll-margin-top:128px}
}
/* the moderator's five tabs (.ap-top.many) need the two-line top bar a little longer */
@media (min-width:761px) and (max-width:1260px){
  .ap-top.many .ap-top-in{flex-wrap:wrap;row-gap:0}
  .ap-top.many .ap-school{order:1;flex:1 1 auto}
  .ap-top.many .ap-me{order:2;min-height:64px}
  .ap-top.many .ap-tabs{order:3;flex:1 0 100%;height:48px;justify-content:flex-start;margin-left:-18px}
}

/* ---------- phones, up to 760 px ---------- */
@media (max-width:760px){
  .ap-one{padding-bottom:28px}
  .ap-top{position:static}
  .ap-top-in{display:grid;min-height:0;padding:6px 16px 0;grid-template-columns:minmax(0,1fr) auto;gap:0 12px}
  .ap-school{grid-column:1;grid-row:1}
  .ap-school{font-size:21px;align-self:center}
  .ap-me{display:contents;text-align:left}
  .ap-out{grid-column:2;grid-row:1}
  .ap-link{grid-column:2;grid-row:2;justify-self:end;align-self:start}
  .ap-who{grid-column:1;grid-row:2;max-width:none;padding:2px 0 8px;border-right:0}
  .ap-me b{font-size:15px}
  .ap-me small{font-size:13px;margin-top:1px;white-space:normal}
  .ap-tabs{grid-column:1/-1;grid-row:3;margin:0 -8px;border-top:1px solid var(--line);border-bottom:1px solid var(--line);justify-self:stretch}
  .ap-tabs a{flex:1 1 0;min-width:0;justify-content:center;gap:6px;padding:0 4px;height:46px;font-size:14px;border-top:0}
  .btn.ap-write{grid-column:1/-1;grid-row:4;width:100%;height:48px;min-height:48px;font-size:15px;margin:12px 0}
  .ap-me .ap-pending,.ap-pending{grid-column:1/-1;grid-row:5;max-width:none;padding-bottom:10px;text-align:left}
  .ap-top.many .ap-tabs{flex-wrap:wrap}
  .ap-top.many .ap-tabs a{flex:1 1 auto;padding:0 8px}
  .ap-head .ap-note{font-size:12px}
  .ap-page{padding:12px 12px 0;gap:12px}
  .ap-panel{gap:12px;scroll-margin-top:12px}
  .ap-feed,.ap-under{grid-template-columns:minmax(0,1fr);gap:12px}
  .ap-feed,.ap-box{scroll-margin-top:12px}
  .ap-box{padding-bottom:14px}
  .ap-box .ap-head{padding:12px 0 8px}
  .ap-lead{padding:18px 16px 16px}
  .ap-lead h1{font-size:32px;margin-top:10px}
  .ap-lead h1.long{font-size:26px}
  .ap-lead > p{font-size:17px;margin-top:10px}
  .ap-meta{font-size:13px}
  .ap-foot{margin-top:0;padding-top:6px}
  .ap-lead .pa-more{margin-top:2px;padding-top:12px}
  .ap-item,.ap-list .ap-item{grid-template-columns:minmax(0,1fr);padding:12px 16px 2px}
  .ap-item .pa{grid-column:1;grid-row:auto;flex-direction:row;margin-left:-8px}
  .pa-b,.ap-item .pa-b{min-height:44px;padding:0 10px;font-size:14px}
  .ap-item .pa-more,.ap-item .pa-note{grid-column:1;grid-row:auto}
  .ap-item .pa-more{padding:0}
  .ap-item .pa-note:not(:empty){margin:0 0 10px}
  .ap-send{flex-direction:column;align-items:flex-start;gap:8px}
  .ap-send .btn{height:44px;min-height:44px}
  .ap-opt,.bar{min-height:44px}
  /* 44px to tap on a phone */
  .btn.small,.confirm .btn,.stick-acts .btn{min-height:44px}
  .att-tray{grid-template-columns:repeat(auto-fill,minmax(76px,1fr))}
  .ap-tabs a,.pa-del,.link,.ap-out,.ap-link,a.who{min-height:44px}
  .card{padding:20px 16px}
  .card h1{font-size:30px}
  .dlg-in{padding:16px}
  .dlg .actions .btn{flex:1 1 auto}
  .mod-item{padding:14px}
  .stick-grid{grid-template-columns:repeat(auto-fill,minmax(120px,1fr));gap:8px}
}
/* a 320px phone: the tab labels and icons still fit on one line */
@media (max-width:360px){
  .ap-top-in{padding-left:12px;padding-right:12px}
  .ap-tabs{margin:0 -4px}
  .ap-tabs a{gap:4px;font-size:13px}
  .ap-tabs a svg{width:14px;height:14px}
  .ap-school{font-size:19px}
  .ap-page{padding-left:8px;padding-right:8px}
  .pa-c.has-del{padding-right:12px;padding-bottom:44px}
  .pa-del{top:auto;bottom:0}
  .stick-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}

/* ---------- nothing moves when the system asks for less motion ---------- */
@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none!important;animation:none!important;scroll-behavior:auto!important}
  .btn:active{transform:none}
}
