/* Strata shell — the bar, the launcher, the account popover, menus and the Ask Strata AI panel.
   Logical properties only (inline-start/end), so Arabic mirrors without extra rules. Needs tokens.css. */
.sbar { position: sticky; top: 0; z-index: 40; height: var(--bar-h); background: var(--bg); display: flex; align-items: center;
  gap: 12px; padding-inline: 16px 12px; font-family: var(--font); color: var(--fg); }
.sbar * { box-sizing: border-box; }
.sbar button { font: inherit; color: inherit; cursor: pointer; }
.sbar svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.sbar .brand { display: flex; align-items: center; gap: 10px; min-width: 0; padding: 4px 8px 4px 4px; border-radius: 12px; text-decoration: none; color: var(--fg); }
.sbar .brand:hover { background: var(--surface); }
.sbar .brand .name { font-size: 21px; font-weight: 500; letter-spacing: -.01em; white-space: nowrap; }
.s-appicon { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; flex: none; }
.s-appicon svg { width: 20px; height: 20px; stroke: #fff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.sbar .crumb { font-size: 15px; color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sbar .crumb:not(:empty)::before { content: "›"; margin-inline: 2px 10px; color: var(--line); }
.sbar .crumb a { color: var(--fg); text-decoration: none; }
.sbar .crumb a:hover { color: var(--brand); }
.sbar .sbadge { font-size: 12px; font-weight: 500; padding: 4px 10px; border-radius: var(--r-pill); background: var(--warn-soft); color: var(--warn); white-space: nowrap; }
.sbar .search { flex: 1; max-width: 720px; margin-inline-start: clamp(0px, 3vw, 48px); display: flex; align-items: center; gap: 10px;
  background: var(--surface-2); border-radius: var(--r-pill); padding: 10px 16px; min-width: 0; color: var(--muted); }
.sbar .search input { border: 0; background: transparent; outline: 0; flex: 1; min-width: 0; font: inherit; font-size: 15px; color: var(--fg); }
.sbar .search:focus-within { background: var(--surface); box-shadow: var(--shadow); }
.sbar .tools { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; }
.sbar .ib { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); position: relative; }
.sbar .ib:hover, .sbar .ib[aria-expanded="true"] { background: var(--surface-2); color: var(--fg); }
.sbar .ib.ask { color: var(--brand); }
.sbar .ib.av { width: 44px; height: 44px; }
.sbar .lang { border: 0; background: transparent; border-radius: var(--r-pill); padding: 8px 12px; font-size: 14px; font-weight: 500; color: var(--brand); white-space: nowrap; }
.sbar .lang:hover { background: var(--surface-2); }
.sbar .lang .short { display: none; }
.s-avatar { width: 36px; height: 36px; border-radius: 50%; background: #7b5ea7; color: #fff; font-weight: 500; display: grid; place-items: center; font-size: 14px; font-family: var(--font); }
.s-avatar.big { width: 72px; height: 72px; font-size: 26px; margin: 6px auto 10px; }
:where(.sbar, .spop, .sask) :focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.s-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* popovers (launcher, account, help, settings) */
.spop { position: fixed; top: calc(var(--bar-h) - 6px); z-index: 60; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pop);
  box-shadow: var(--shadow); width: min(360px, calc(100vw - 32px)); padding: 18px; font-family: var(--font); color: var(--fg); font-size: 14px; }
.spop h3 { margin: 0; font-size: 17px; font-weight: 500; }
.spop .phead { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.spop .tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.spop .tile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 4px; border-radius: 16px; border: 0; background: transparent;
  text-decoration: none; color: var(--fg); position: relative; font: inherit; text-align: center; cursor: pointer; }
.spop .tile:hover { background: var(--surface-2); }
.spop .tile.cur { background: var(--brand-soft); color: var(--sel-fg); }
.spop .tile.off { opacity: .55; cursor: default; }
.spop .tile.off:hover { background: transparent; }
.spop .tile .s-appicon { width: 48px; height: 48px; border-radius: 15px; }
.spop .tile .s-appicon svg { width: 24px; height: 24px; }
.spop .tile span.t { font-size: 13px; }
.spop .tile .pin { position: absolute; top: 6px; inset-inline-end: 10px; width: 22px; height: 22px; border-radius: 50%; display: none; place-items: center;
  background: var(--bg); border: 1px solid var(--line); font-size: 13px; line-height: 1; }
.spop.editing .tile .pin { display: grid; }
.spop.editing .tile { outline: 1px dashed var(--line); }
.spop .more { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.spop .label { font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.spop .pencil { border: 0; background: var(--brand-soft); color: var(--brand); border-radius: var(--r-pill); padding: 6px 12px; font: inherit; font-weight: 500; cursor: pointer; }
.spop .note { font-size: 12px; color: var(--muted); margin: 10px 0 0; }
.spop .acct { text-align: center; }
.spop .acct .who { font-size: 18px; font-weight: 500; }
.spop .acct .mail { color: var(--muted); font-size: 13px; }
.spop .notes { display: flex; flex-direction: column; gap: 6px; margin: 12px 0; text-align: start; }
.spop .notes > * { font-size: 12px; color: var(--muted); background: var(--bg); border-radius: 12px; padding: 8px 12px; }
.spop .list { display: flex; flex-direction: column; gap: 2px; }
.spop .list a, .spop .list button { display: block; text-align: start; font: inherit; padding: 10px 14px; border-radius: 12px; border: 0; background: transparent;
  color: var(--fg); text-decoration: none; cursor: pointer; }
.spop .list a:hover, .spop .list button:hover:not(:disabled) { background: var(--surface-2); }
.spop .list button:disabled { color: #8e918f; cursor: default; }
.spop .outline { display: block; width: 100%; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 10px 14px; background: transparent;
  font: inherit; color: var(--brand); font-weight: 500; cursor: pointer; text-align: center; }
.spop .outline:disabled { color: #8e918f; cursor: default; }

/* Ask Strata AI side panel */
.sask { position: fixed; top: var(--bar-h); bottom: 12px; inset-inline-end: 12px; width: min(380px, calc(100vw - 24px)); z-index: 55; background: var(--surface);
  border-radius: var(--r-pop); box-shadow: var(--shadow); display: flex; flex-direction: column; font-family: var(--font); color: var(--fg); }
.sask header { display: flex; align-items: center; gap: 10px; padding: 16px 16px 8px; }
.sask header b { font-size: 16px; font-weight: 500; flex: 1; }
.sask .ctx { font-size: 12px; color: var(--muted); padding: 0 16px 8px; }
.sask .body { flex: 1; overflow: auto; padding: 8px 16px; display: flex; flex-direction: column; gap: 10px; }
.sask .msg { background: var(--bg); border-radius: 16px; padding: 10px 14px; font-size: 14px; line-height: 1.45; }
.sask form { display: flex; gap: 8px; padding: 12px 16px 16px; }
.sask input { flex: 1; min-width: 0; border: 1px solid var(--line); border-radius: var(--r-pill); padding: 10px 14px; font: inherit; }
.sask .ib { width: 40px; height: 40px; border-radius: 50%; border: 0; background: transparent; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.sask .ib:hover { background: var(--surface-2); }

@media (max-width: 760px) {
  .sbar { gap: 4px; padding-inline: 8px 4px; }
  .sbar .search, .sbar .crumb, .sbar .sbadge { display: none; }
  .sbar .brand { min-width: 0; flex: 0 1 auto; }
  .sbar .brand .name { font-size: 18px; overflow: hidden; text-overflow: ellipsis; }
  .sbar .tools { flex: none; gap: 0; }
  .sbar .lang { padding: 8px; }
  .sbar .lang .long { display: none; }
  .sbar .lang .short { display: inline; }
  .sbar .ib { width: 36px; height: 36px; }
  .sbar .ib.av { width: 40px; height: 40px; }
  .spop { inset-inline: 16px !important; width: auto; }
}
@media (max-width: 420px) {
  .sbar .ib.ask { display: none; }
  .sbar .brand .name { display: none; }
}

/* The AI gauge (30 Nov 2026, ai-gauge.mjs; the same rules in every Strata app's shell): this month's AI questions as a
   ring beside the account button, the percent used inside as a number. Two colours (Ahmed, later that day): the part
   used, teal under 75 % (his sample), amber under 95 %, red from 95 %; and the part left, light blue. A grey ring with
   "—" until GeoStore answers. */
.s-aig-box { display: inline-flex; align-items: center; }
.s-aig-box[hidden] { display: none; }
.s-aig { position: relative; width: 36px; height: 36px; display: inline-grid; place-items: center; border-radius: 50%; color: var(--fg); text-decoration: none; flex: none; margin-inline: 2px; }
.s-aig:hover { background: var(--surface-2); }
.s-aig:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.s-aig svg { position: absolute; inset: 0; width: 100%; height: 100%; }
[dir="rtl"] .s-aig svg { transform: scaleX(-1); }
.s-aig .trk { fill: none; stroke: #8ab4f8; stroke-width: 3.5; }                       /* left */
.s-aig .val { fill: none; stroke: #1ba7a6; stroke-width: 3.5; stroke-linecap: butt; transition: stroke-dasharray .4s ease; }   /* used */
.s-aig.lv-warn .val { stroke: #f29900; }
.s-aig.lv-bad .val { stroke: #d93025; }
.s-aig .pct { position: relative; display: inline-flex; align-items: baseline; line-height: 1; letter-spacing: -.02em; }
.s-aig .pct b { font-size: 11px; font-weight: 600; }
.s-aig .pct small { font-size: 7px; font-weight: 500; margin-inline-start: .5px; }
.s-aig[data-pct="100"] .pct b { font-size: 9.5px; }
.s-aig.lv-bad .pct { color: var(--bad); }
.s-aig.lv-none .pct, .s-aig.lv-unknown .pct { color: var(--muted); font-size: 11px; }
.s-aig.lv-none .trk, .s-aig.lv-unknown .trk { stroke: var(--line); }                  /* nothing known: grey */
.s-aig.lv-none .val, .s-aig.lv-unknown .val, .s-aig[data-pct="0"] .val { stroke: none; }
@media (prefers-reduced-motion: reduce) { .s-aig .val { transition: none; } }
