/* The navigation shared by Meetings, Write, Translate, Interpret, Apps and Team (shell.js).
   Colours come from each page's own :root tokens (base.css, or the inline copy in
   index.html and editor.html), so only token names that every page defines are
   used here, with a fallback where a token is new.

   Wide screens: a sidebar, collapsible to a column of icons ("rail"; kept in
   localStorage as `nav`). 561-900 px: one row across the top. 560 px and less
   (phones, 320 px up): logo, a menu of the five sections, New, and the account
   menu. Do not name a class `.app` in here: index.html uses it for the page grid. */
:root{--side:252px}
@media(min-width:901px){:root[data-nav=rail]{--side:60px}}
/* The woven stripe is retired on every page, including the ones that still draw it inline. */
body>.selvage{display:none}
.side{position:sticky;top:0;height:100vh;height:100dvh;display:flex;flex-direction:column;background:var(--panel);border-right:1px solid var(--border);padding:12px 10px 10px;min-width:0;overflow:hidden}
.app.rec .side{pointer-events:none;opacity:.45}
.shead{display:flex;align-items:center;gap:4px;padding:0 0 12px;min-width:0}
.brand{display:flex;align-items:center;gap:10px;cursor:pointer;font-weight:600;font-size:14px;padding:2px 6px;line-height:1.25;flex:1;min-width:0;white-space:nowrap;border-radius:8px;color:var(--fg)}
.logo{width:30px;height:30px;flex:none;display:block;background:url("data:image/svg+xml,%3Csvg%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%2064%2064'%3E%3Cpath%20fill='%23f2b20f'%20d='M19%202h26a17%2017%200%200%201%2017%2017v20a17%2017%200%200%201-13%2016.500l2.200%206.200a1.200%201.200%200%200%201-1.700%201.400L38%2056H19A17%2017%200%200%201%202%2039V19A17%2017%200%200%201%2019%202z'/%3E%3Crect%20x='16.500'%20y='15'%20width='31'%20height='9.500'%20rx='2.600'%20fill='%231a1a1a'/%3E%3Crect%20x='27.200'%20y='15'%20width='9.600'%20height='32'%20rx='2.600'%20fill='%231a1a1a'/%3E%3C/svg%3E") center/contain no-repeat;color:transparent;font-size:0;text-decoration:none;overflow:hidden}
.brand small{display:block;font:400 12px/1.3 var(--sans);color:var(--subtle)}
.navtgl{color:var(--subtle);flex:none}
.btn.snew{width:100%;justify-content:flex-start;gap:8px}.btn.snew .lbl{flex:1;text-align:left}
.sapps{display:grid;gap:2px;margin-top:10px}
.slabel{font:500 12px/1.2 var(--sans);color:var(--subtle);padding:16px 8px 6px;white-space:nowrap}
.sspace{flex:1;min-height:12px}
.sitem{display:flex;align-items:center;gap:9px;padding:6px 8px;border-radius:8px;color:var(--muted);font-size:13px;text-decoration:none;min-width:0;transition:background-color .16s,color .16s}
.sitem span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.sitem:hover{background:var(--hover);color:var(--fg)}.sitem.on{background:var(--el2);color:var(--fg);box-shadow:inset 2px 0 0 var(--accent)}
.sitem.sapp{padding:8px 10px;font-size:13.5px;font-weight:500}
/* The page you are on: blue text on a soft blue fill, plus aria-current for screen readers. */
.sitem.sapp.on,.sitem.sapp[aria-current=page]{color:var(--accent);background:var(--accent-soft);box-shadow:none;font-weight:600}
.sitem svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.sfold{display:grid;gap:1px;overflow-y:auto;min-height:0;margin:0 -2px;padding:0 2px}
.sfold .sitem{padding:5px 8px}.sfold .sitem small{font:500 11px/1 var(--mono);color:var(--faint)}
.sfold .sitem .fsw{width:9px;height:9px;border-radius:3px;flex:none;margin:0 4px 0 3px}
.sfold .sitem svg{width:15px;height:15px}
.sfold .sadd{color:var(--subtle);background:none;border:0;cursor:pointer;font:inherit;font-size:13px;text-align:left;width:100%}
.sfold .sitem.drop{background:var(--accent-soft);box-shadow:inset 0 0 0 1px var(--accent-b)}
.sdot{width:7px;height:7px;border-radius:50%;flex:none;background:var(--faint);display:inline-block}
.sdot.done{background:var(--ok)}.sdot.failed{background:var(--danger)}.sdot.busy{background:var(--accent);animation:pulse 1.2s infinite}
.sfoot{display:flex;align-items:center;gap:6px;padding:10px 0 0;border-top:1px solid var(--hair);margin-top:8px;min-width:0}
/* The account button: avatar, name and organisation; opens the account menu. */
.sfoot .me{display:flex;align-items:center;gap:9px;flex:1;min-width:0;text-decoration:none;color:inherit;border-radius:8px;padding:6px;background:none;border:0;cursor:pointer;text-align:left;font:inherit}
.sfoot .me:hover,.sfoot .me[aria-expanded=true]{background:var(--hover)}
.sfoot .me .chev{width:16px;height:16px;flex:none;stroke:var(--subtle);fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.who{display:block;flex:1;min-width:0;font-size:13px;line-height:1.3}.who span{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.who .n{color:var(--fg);font-weight:500}.who .o{color:var(--subtle);font-size:12px}
.av{width:30px;height:30px;border-radius:50%;display:grid;place-items:center;font:600 11px/1 var(--sans);background:var(--accent-soft);color:var(--accent);border:1px solid var(--accent-b);flex:none}
/* The section menu button: only on phones (see below). */
.secbtn{display:none;align-items:center;gap:6px;background:none;border:1px solid var(--border);border-radius:8px;padding:6px 10px;min-height:36px;font:600 14px/1 var(--sans);color:var(--fg);cursor:pointer;white-space:nowrap;min-width:0}
.secbtn:hover,.secbtn[aria-expanded=true]{background:var(--hover)}
.secbtn svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.secbtn .chev{stroke:var(--subtle)}

/* Hidden from the eye, read by screen readers. (Not .vh: the pages define their own.) */
.s-vh{position:absolute!important;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap;border:0}
.side a,.side button,.side [role=link],.smenu [role=menuitem]{-webkit-tap-highlight-color:transparent}

/* Skip link: the first thing Tab reaches on every page. Out of sight until it has the
   focus, shadow included (the shadow is only drawn while it shows). */
.skip{position:fixed;left:12px;top:12px;z-index:100;transform:translateY(-200px);background:var(--accent);color:var(--on-accent);border-radius:8px;padding:10px 16px;font:600 14px/1.2 var(--sans);text-decoration:none;white-space:nowrap}
.skip:focus,.skip:focus-visible{transform:none;box-shadow:0 8px 24px var(--shadow);outline:2px solid var(--on-accent);outline-offset:-4px}

/* Menus (sections, account): fixed popovers placed by shell.js. */
.smenu{position:fixed;z-index:60;min-width:220px;max-width:calc(100vw - 16px);max-height:calc(100dvh - 16px);overflow:auto;background:var(--el);border:1px solid var(--strong);border-radius:12px;padding:6px;box-shadow:0 14px 40px var(--shadow);font:14px/1.3 var(--sans);color:var(--fg)}
.smenu[hidden]{display:none}
.smenu .smhead{padding:8px 10px 10px;border-bottom:1px solid var(--hair);margin-bottom:4px;min-width:0}
.smenu .smhead b{display:block;font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.smenu .smhead span{display:block;color:var(--subtle);font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.smenu [role=menuitem]{display:flex;align-items:center;gap:10px;width:100%;min-height:40px;padding:8px 10px;border:0;border-radius:8px;background:none;color:inherit;font:inherit;text-align:left;text-decoration:none;cursor:pointer}
.smenu [role=menuitem]:hover,.smenu [role=menuitem]:focus-visible{background:var(--hover);outline:none}
.smenu [role=menuitem]:focus-visible{box-shadow:inset 0 0 0 2px var(--focus,var(--accent))}
.smenu [role=menuitem][aria-current=page]{color:var(--accent);background:var(--accent-soft);font-weight:600}
.smenu [role=menuitem] svg{width:18px;height:18px;flex:none;stroke:currentColor;fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.smenu hr{border:0;border-top:1px solid var(--hair);margin:4px 0}
/* The theme item shows where it goes: a moon ("Dark theme") in light, a sun in dark. */
.smenu .tgl .sun{display:block}.smenu .tgl .moon{display:none}:root[data-theme=light] .smenu .tgl .sun{display:none}:root[data-theme=light] .smenu .tgl .moon{display:block}
.tgl .sun{display:none}:root[data-theme=light] .tgl .sun{display:block}:root[data-theme=light] .tgl .moon{display:none}

/* Offline notice: informational only, so it never blocks a tap. */
.soffline{position:fixed;top:calc(8px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);z-index:70;display:flex;align-items:center;gap:8px;max-width:calc(100vw - 24px);background:var(--fg);color:var(--bg);border-radius:999px;padding:8px 16px;font:500 13px/1.35 var(--sans);box-shadow:0 8px 28px var(--shadow);pointer-events:none}
.soffline[hidden]{display:none}
.soffline svg{width:16px;height:16px;flex:none;stroke:currentColor;fill:none;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}

/* Shell.toast(): a stack at the bottom; --toast-bottom lifts it over a page's own dock. */
.stoasts{position:fixed;left:50%;bottom:calc(var(--toast-bottom,24px) + env(safe-area-inset-bottom,0px));transform:translateX(-50%);z-index:65;display:grid;gap:8px;justify-items:center;width:max-content;max-width:calc(100vw - 24px);pointer-events:none}
.stoast{display:flex;align-items:center;gap:12px;background:var(--fg);color:var(--bg);border-radius:10px;padding:10px 12px 10px 16px;font:500 13.5px/1.4 var(--sans);box-shadow:0 10px 30px var(--shadow);pointer-events:auto;max-width:100%;animation:stoast-in .18s ease-out}
.stoast.error{background:var(--danger);color:var(--bg)}   /* --bg: white on red in light, near-black on the light red of dark (7.8:1) */
.stoast .msg{min-width:0;overflow-wrap:anywhere}
.stoast button{background:none;border:0;color:inherit;font:600 13px/1 var(--sans);cursor:pointer;padding:8px 10px;border-radius:6px;min-height:32px;white-space:nowrap}
.stoast button:hover{background:rgba(255,255,255,.14)}.stoast button:focus-visible{outline:2px solid currentColor;outline-offset:1px}
.stoast .act{text-decoration:underline;text-underline-offset:2px}
.stoast .x{font-size:18px;line-height:1;padding:6px 9px;opacity:.85}
@keyframes stoast-in{from{opacity:0;transform:translateY(8px)}}

/* collapsed: icons only */
@media(min-width:901px){
 :root[data-nav=rail] .side{padding:12px 8px 10px;align-items:center}
 :root[data-nav=rail] .shead{flex-direction:column;gap:8px}
 :root[data-nav=rail] .brand{padding:0;flex:none}
 :root[data-nav=rail] .brand>div:not(.logo),:root[data-nav=rail] .snew .lbl,:root[data-nav=rail] .snew kbd,:root[data-nav=rail] .sitem.sapp span,
 :root[data-nav=rail] .slabel,:root[data-nav=rail] .snav>*,:root[data-nav=rail] .who,:root[data-nav=rail] .sfoot .chev{display:none}
 :root[data-nav=rail] .btn.snew{width:40px;min-height:36px;padding:0;justify-content:center}
 :root[data-nav=rail] .sapps{width:40px}
 :root[data-nav=rail] .sitem.sapp{justify-content:center;padding:10px 0}
 :root[data-nav=rail] .sfoot{flex-direction:column;padding:10px 0 2px;gap:4px;align-self:stretch}
 :root[data-nav=rail] .sfoot .me{flex:none;margin:0;justify-content:center;padding:4px}
 :root[data-nav=rail] .navtgl svg{transform:scaleX(-1)}
}
/* narrow screens: one row across the top */
@media(max-width:900px){
 .side{position:static;height:auto;flex-direction:row;align-items:center;gap:6px;border-right:0;border-bottom:1px solid var(--border);padding:8px 12px;padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px));overflow:visible}
 .shead{padding:0;flex:1;min-width:0;gap:8px}.brand{padding:0;flex:none}.brand small,.shead .navtgl{display:none}.sspace{display:none}
 .side .slabel,.side .snav,.who,.snew kbd,.sfoot .chev{display:none}
 .btn.snew{width:auto;flex:none}.sapps{display:flex;margin:0;flex:none}.sitem.sapp span{display:none}.sitem.sapp{padding:8px;justify-content:center;min-width:36px;min-height:36px}
 .sfoot{border:0;margin:0;padding:0;gap:2px;flex:none}
 .sfoot .me{flex:none;padding:3px}
 .app.doc>.side{display:none}
 /* The page grid (every page's .app): the bar keeps its own height and the page takes the
    rest. Without this a short page (Translate on a tablet) stretched the bar to 160 px. */
 .app{grid-template-rows:auto 1fr}
}
/* phones: the five sections move into one menu, so the row fits from 320 px */
@media(max-width:560px){
 .brand>div:not(.logo){display:none}
 .brand{justify-content:center}
 .side .sapps{display:none}
 .secbtn{display:inline-flex;overflow:hidden}
 .secbtn .lbl{overflow:hidden;text-overflow:ellipsis}
 /* New: a 44 px square with the + in the middle (its name is the aria-label). The same
    on every page, whichever .btn rules the page has. */
 .snew .lbl{display:none}
 .btn.snew{width:var(--tap,44px);height:var(--tap,44px);min-width:var(--tap,44px);min-height:var(--tap,44px);padding:0;gap:0;justify-content:center;flex:none}
 .btn.snew svg{width:18px;height:18px}
 /* the rest of the row the same height, so nothing sits a few pixels off */
 .secbtn{min-height:var(--tap,44px)}
 .brand{min-width:var(--tap,44px);min-height:var(--tap,44px)}
 .sfoot .me{min-width:var(--tap,44px);min-height:var(--tap,44px);justify-content:center}
}
@media(pointer:coarse){
 .sitem.sapp{min-height:var(--tap,44px);min-width:var(--tap,44px)}
 .sfoot .me{min-height:var(--tap,44px);min-width:var(--tap,44px);justify-content:center}
 .secbtn{min-height:var(--tap,44px)}
 .btn.snew{min-height:var(--tap,44px);min-width:var(--tap,44px)}
 .smenu [role=menuitem]{min-height:var(--tap,44px)}
 .brand{min-height:var(--tap,44px)}
}
@media(pointer:coarse) and (max-width:560px){.brand{min-width:var(--tap,44px)}}
/* A touch screen 561-620 px wide (a phone on its side): five 44 px sections and New leave no
   room for the words "Tetun Tools", which ran under New. The logo stays, as on phones. */
@media(pointer:coarse) and (max-width:620px){.brand>div:not(.logo){display:none}}

/* The organisation's credits (shell.js paintCredits): wide screens at the top right of the
   page (it scrolls away with it, so it never covers anything), narrow ones in the top bar.
   Class names start with cc: plain .desk/.mob clashed with Write's own .desk (the document
   desk), whose padding and background turned the pill into a large oval. */
.ccwrap{position:relative;height:0;z-index:20}
.ccred{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 12px 0 10px;border:1px solid var(--border);border-radius:999px;background:var(--el);color:var(--fg);font:500 13px/1 var(--sans);text-decoration:none;white-space:nowrap;transition:border-color .16s,background-color .16s}
.ccred:hover{border-color:var(--accent);background:var(--accent-soft,var(--hover))}
.ccred svg{width:15px;height:15px;flex:none;stroke:var(--accent);fill:none;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}
.ccred .cn{font-weight:600}.ccred .cl{color:var(--subtle);font-weight:400}
.ccred.low{border-color:var(--danger);color:var(--danger)}.ccred.low svg{stroke:var(--danger)}
.ccred[hidden],.ccred.ccmob{display:none}
.ccred.ccdesk{position:absolute;top:14px;right:24px}
.app.doc .ccwrap{display:none}   /* an open document in Write: its own toolbar is up there */
@media(max-width:900px){.ccwrap{display:none}.ccred.ccmob:not([hidden]){display:inline-flex;flex:none}}
@media(max-width:560px){.ccred.ccmob .cl{display:none}.ccred.ccmob{padding:0 10px}}
@media(pointer:coarse){.ccred.ccmob{height:var(--tap,44px)}}

/* Skeleton placeholders while a list loads (every page loads this file). */
.skel{display:block;border-radius:6px;background:linear-gradient(90deg,var(--el3) 25%,var(--el2) 37%,var(--el3) 63%);background-size:400% 100%;animation:skel 1.3s ease-in-out infinite}
.skel.bar{height:12px}
@keyframes skel{0%{background-position:100% 50%}100%{background-position:0 50%}}
@media(prefers-reduced-motion:reduce){.skel,.sdot.busy,.stoast{animation:none}.sitem{transition:none}}
