/* ==========================================================================
   Labour Life practice system: the shell (SPEC 7.3). Owner: core (M0).
   The coal top bar, the main menu (from 960px a black panel of 208px under
   the coal bar, the icon and the label side by side and the open item a red
   pill, Jose's mock-up of 25 Oct 2026; a drawer from the right under it),
   the phone bottom bar, the content area and the account menu. Markup comes from js/views/shell.js. The signed-out screens
   reuse .top and .brand for their bar (js/views/auth.js, setup.js).

   Only .content scrolls. The page itself never does, so the top bar, the
   rail and the bottom bar stay put.

   Phone first: the base styles are the phone. 960 is also in shell.js
   (matchMedia). Change both together.

   Flags on <html>: .menu-open (the drawer is open), .kb-open (the on-screen
   keyboard is open), .has-modal-full (a full-screen modal is open, set by
   components/modal.js). Flag on <body>: .has-shell.
   ========================================================================== */

/* ---------- the frame ---------- */

body.has-shell { overflow: hidden; }

body.has-shell #app {
  display: flex; flex-direction: column;
  height: 100vh; height: 100dvh;
}

.shell { display: flex; align-items: stretch; flex: 1; min-height: 0; width: 100%; }

.content {
  position: relative;
  flex: 1; min-width: 0;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--bg);
}

/* ---------- the top bar (coal) ---------- */

.top {
  position: relative; z-index: var(--z-top); flex: none;
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  background: var(--chrome-bg); color: var(--chrome-text);
  /* A shadow hairline, not a border: a border would add 1px to the bar. */
  box-shadow: 0 1px 0 var(--chrome-line);
}
.top__in {
  position: relative;
  display: flex; align-items: center; gap: var(--s1);
  height: var(--top-h);
  padding: 0 var(--s2) 0 var(--s3);
}
.top__sp { flex: 1; min-width: var(--s1); }

/* The logo: the mark and the wordmark, as two images. Never recoloured,
   never typed as text. The mark is 221 by 242, so only its height is set. */
.brand {
  display: inline-flex; align-items: center; gap: .625rem; flex: none;
  /* min-width: under 480px the wordmark goes and the mark alone is 37px wide. */
  min-height: var(--tap); min-width: var(--tap); justify-content: center; padding: 0 var(--s1);
  border-radius: var(--r-sm);
  text-decoration: none;
}
.brand__mark { height: 32px; width: auto; flex: none; }
.brand__word { height: 13px; width: auto; flex: none; }
/* 520 (480 before the Claude button of 23 Nov 2026, 420 before the ? of 14 Nov): seven buttons and the wordmark need about 490px. */
@media (max-width: 519px) { .brand__word { display: none; } }

.top__btn {
  position: relative; flex: none;
  display: inline-grid; place-items: center;
  width: var(--tap); height: var(--tap); padding: 0;
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--chrome-text); text-decoration: none;
}
.top__btn:hover, .top__btn[aria-expanded="true"] { background: var(--chrome-hover); }

/* The account button holds the initials. On coal the tile needs an edge. */
.top__me .mono {
  pointer-events: none;
  background: var(--chrome-bg-2); color: var(--chrome-text);
  box-shadow: inset 0 0 0 1px var(--chrome-field-line);
}

/* "New": the one red button of the bar. It lives in the bottom bar on a phone. */
.top__new {
  display: none;
  align-items: center; justify-content: center; gap: var(--s2); flex: none;
  min-height: var(--control-h-sm); padding: 0 var(--s4) 0 var(--s3); margin: 0 var(--s2);
  border: 1px solid var(--red); border-radius: var(--r-sm);
  background: var(--red); color: var(--on-red);
  font: 600 var(--fs-body)/1.2 var(--font-body);
}
.top__new:hover { background: var(--red-hover); border-color: var(--red-hover); }
.top__new:active { background: var(--red-active); border-color: var(--red-active); }
@media (pointer: coarse) { .top__new { min-height: var(--tap); } }

/* ---------- search in the bar ----------
   Under 720px an icon opens the box over the whole bar. From 720px the box
   sits in the bar. The box itself is components/search-box.js (.sbox),
   coloured for coal here. */

.top__search { display: none; }
.top__search .sbox { flex: 1; min-width: 0; }
.top__search .sbox .input {
  min-height: var(--control-h-sm);
  border-color: var(--chrome-field-line);
  background: var(--chrome-bg-2); color: var(--chrome-text);
}
.top__search .sbox .input::placeholder { color: var(--chrome-placeholder); }
.top__search .sbox .input:hover { border-color: var(--chrome-soft); }
.top__search .sbox .input:focus,
.top__search .sbox .input:focus-visible {
  border-color: var(--chrome-text);
  box-shadow: 0 0 0 3px rgb(236 234 230 / .22);
}
.top__search .sbox__i { color: var(--chrome-soft); }
.top__search .sbox button { color: var(--chrome-text); }
@media (pointer: coarse) { .top__search .sbox .input { min-height: var(--tap); } }

@media (max-width: 719px) {
  .top.is-searching .top__search {
    display: flex; align-items: center; gap: var(--s1);
    position: absolute; z-index: 2;
    top: env(safe-area-inset-top, 0px); right: 0; bottom: 0; left: 0;
    padding: 0 var(--s2) 0 var(--s3);
    background: var(--chrome-bg);
    animation: llFade var(--dur-1) ease both;
  }
}

@media (min-width: 720px) {
  .top__in { padding: 0 var(--s3) 0 var(--s4); }
  .top__search {
    display: flex; align-items: center;
    width: clamp(240px, 34vw, 440px); margin-right: var(--s2);
  }
  .top__search-open, .top__search-x { display: none; }
}

/* ---------- the main menu ----------
   Under 960px it is a drawer from the right, opened by "More" in the bottom
   bar. visibility: hidden while closed keeps its links out of the tab order.
   The delay lets the slide finish first. */

.side {
  position: fixed; z-index: var(--z-side);
  top: 0; right: 0; bottom: 0;
  width: min(320px, 88vw);
  display: flex; flex-direction: column;
  padding: calc(var(--s2) + env(safe-area-inset-top, 0px)) calc(var(--s3) + env(safe-area-inset-right, 0px)) calc(var(--s4) + env(safe-area-inset-bottom, 0px)) var(--s3);
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--nav-bg); color: var(--nav-text);
  border-left: 1px solid var(--nav-line);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform var(--dur-2) var(--ease-out), visibility 0s linear var(--dur-2);
}
.menu-open .side {
  transform: none; visibility: visible; box-shadow: var(--shadow-drawer);
  transition: transform var(--dur-2) var(--ease-out), visibility 0s;
}

.scrim {
  position: fixed; z-index: var(--z-scrim); inset: 0;
  background: var(--scrim);
  animation: llFade var(--dur-2) ease both;
}

.side__head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex: none;
  min-height: var(--tap); padding: 0 0 var(--s2) var(--s3);
}
.side__x { width: var(--tap); height: var(--tap); }

.side__list { display: grid; gap: 2px; }
.side__main { flex: 1 0 auto; align-content: start; }

/* One link per item (item 113, 19 Oct 2026): no rows under a parent. In the
   drawer the icon, the label and the count sit in one row. .side__i holds
   the icon and the count bubble; here it is display: contents, so its two
   children take part in the row and `order` puts the bubble at the end. */
.side__a {
  position: relative;
  display: flex; align-items: center; gap: var(--s3);
  width: 100%; min-height: var(--control-h); padding: var(--s2) var(--s3);
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--nav-text); font: 500 var(--fs-body)/1.3 var(--font-body);
  text-align: left; text-decoration: none; cursor: pointer;
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
.side__i { display: contents; }
.side__a svg { flex: none; color: var(--ink-mute); }
.side__a:hover { background: var(--nav-hover-bg); color: var(--nav-text-on); }
.side__a.is-on { background: var(--nav-on-bg); color: var(--nav-text-on); font-weight: 600; }
.side__a.is-on svg { color: var(--nav-text-on); }
/* One band of the logo on the left edge of the active row. */
.side__a.is-on::before {
  content: ""; position: absolute; left: 0; top: 50%; margin-top: -11px;
  width: 4px; height: 22px; border-radius: 1px 1px 3px 3px; background: var(--band);
}
.side__a:focus-visible { outline-offset: -3px; }
.side__t { flex: 1; min-width: 0; order: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* The count bubble: white on red. */
.side__n, .tabbar__n {
  flex: none;
  display: inline-grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--r-pill);
  background: var(--red); color: var(--on-red);
  font: 600 var(--fs-label)/1 var(--font-body); font-variant-numeric: tabular-nums;
}
.side__n { order: 2; margin-left: auto; }

/* My account and Sign out: in the drawer on a phone, in the top bar on a computer. */
.side__foot {
  flex: none; display: grid; gap: 2px;
  margin-top: var(--s4); padding-top: var(--s3);
  border-top: 1px solid var(--nav-line);
}
.side__me { display: flex; align-items: center; gap: var(--s3); min-width: 0; padding: var(--s2) var(--s3) var(--s3); }

/* The line above Admin (25 Oct 2026). */
.side__sep { height: 1px; margin: var(--s2) var(--s3); background: var(--nav-line); }
.side__me-t { min-width: 0; }
.side__me-name { font-weight: 600; color: var(--ink); line-height: var(--lh-snug); }

/* ---------- the phone bottom bar ----------
   Five items, each an icon over a 13px label, at least 44px wide. It is part
   of the column (not fixed), so .content ends where the bar begins. */

.tabbar {
  position: relative; z-index: var(--z-bottom); flex: none;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr);
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0px));
  padding: 0 env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  background: var(--nav-bg);
  border-top: 1px solid var(--nav-line);
}
.tabbar__a {
  position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  min-width: var(--tap); min-height: var(--tap); padding: 0 2px;
  border: 0; background: transparent;
  color: var(--nav-text); text-decoration: none;
  font: 500 var(--fs-label)/1 var(--font-body);
}
.tabbar__a:focus-visible { outline-offset: -3px; }
.tabbar__i { position: relative; display: grid; place-items: center; }
.tabbar__t { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tabbar__a.is-on { color: var(--red-ink); font-weight: 600; }
/* A 3px band on the top edge of the active item. */
.tabbar__a.is-on::before {
  content: ""; position: absolute; top: -1px; left: 50%; margin-left: -18px;
  width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--band);
}
.tabbar__more[aria-expanded="true"] { color: var(--nav-text-on); }
.tabbar__n {
  position: absolute; top: -7px; left: 50%; margin-left: 4px;
  min-width: 18px; height: 18px; padding: 0 5px;
  box-shadow: 0 0 0 2px var(--nav-bg);
}

/* "New": a 48px red button with a white plus. */
.tabbar__plus {
  display: grid; place-items: center;
  width: 48px; height: 48px;
  border-radius: var(--r-lg);
  background: var(--red); color: var(--on-red);
  transition: background-color var(--dur-1) ease;
}
.tabbar__a--new:hover .tabbar__plus { background: var(--red-hover); }
.tabbar__a--new:active .tabbar__plus,
.tabbar__a--new[aria-expanded="true"] .tabbar__plus { background: var(--red-active); }

/* The bar gives way to the on-screen keyboard and to a full-screen modal. */
.kb-open .tabbar, .has-modal-full .tabbar { display: none; }

/* ---------- from 960px: the menu is a fixed rail, the bottom bar is gone ---------- */

@media (min-width: 960px) {
  .top__new { display: inline-flex; }
  .top__new[hidden] { display: none; }

  /* The black panel (Jose's mock-up of 25 Oct 2026): under the coal top bar,
     the icon and the label side by side in white, the open item a red pill
     with white words, the counts as bubbles at the end of the row, Admin
     under a line. --side-w is 208px. The phone drawer and the bottom bar
     keep their light look (the --nav tokens). */
  .side {
    position: relative; top: auto; right: auto; bottom: auto; z-index: auto;
    flex: none; width: var(--side-w);
    padding: var(--s4) var(--s3);
    background: var(--rail-bg); color: var(--rail-text);
    border-left: 0; border-right: 0;
    transform: none; visibility: visible; box-shadow: none; transition: none;
    scrollbar-color: var(--rail-line) transparent;
  }
  .side__list { gap: var(--s1); }
  .side__a {
    gap: var(--s3); min-height: var(--control-h); padding: var(--s2) var(--s3);
    border-radius: var(--r-md);
    color: var(--rail-text); font: 500 var(--fs-body)/1.3 var(--font-body);
  }
  .side__a svg { color: var(--rail-soft); }
  .side__a:hover { background: var(--rail-hover); color: var(--rail-text-on); }
  .side__a:hover svg { color: var(--rail-text-on); }
  .side__a.is-on { background: var(--red); color: var(--on-red); font-weight: 600; }
  .side__a.is-on svg { color: var(--on-red); }
  .side__a.is-on:hover { background: var(--red-hover); }
  /* The pill says which item is open: no band on the edge. */
  .side__a.is-on::before { display: none; }
  .side__a:focus-visible { outline: 2px solid var(--rail-text-on); outline-offset: -2px; }
  /* A red bubble on the red pill turns white. */
  .side__a.is-on .side__n { background: var(--on-red); color: var(--red); }
  .side__sep { margin: var(--s3) var(--s3); background: var(--rail-line); }
  .side__head, .side__foot { display: none; }
  .scrim { display: none !important; }
  .tabbar { display: none; }
  /* Night mode (decision 494): the page is as dark as the menu, so a hairline parts them. */
  html.is-dark .side { box-shadow: 1px 0 0 var(--rail-line); }
}

/* ---------- the account menu (in a popover) ---------- */

.me-pop__head {
  display: flex; align-items: center; gap: var(--s3); min-width: 0;
  padding: var(--s3); margin-bottom: var(--s1);
  border-bottom: 1px solid var(--line);
}
.me-pop__who { min-width: 0; }
.me-pop__name { font: 700 var(--fs-lg)/var(--lh-snug) var(--font-display); color: var(--ink); }

/* ---------- the sign-in code banner (9 Oct 2026) ----------
   Under the top bar while the session may still work without the code
   (js/views/shell.js, me.second_step_soon). It does not scroll: #app is a
   column and the banner takes its own height. */

.ss-banner {
  flex: none; position: relative; z-index: calc(var(--z-top) - 1);
  background: var(--warning-bg); color: var(--warning-ink);
  border-bottom: 1px solid var(--warning-line);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.ss-banner[hidden] { display: none; }
.ss-banner__in {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s2) var(--s3);
}
.ss-banner__i { display: inline-flex; flex: none; }
.ss-banner__t { flex: 1 1 14rem; min-width: 0; margin: 0; font-size: var(--fs-sm); line-height: var(--lh-snug); font-weight: 600; }
.ss-banner__b { flex: none; min-height: var(--tap); }

/* ---------- View as (2 Nov 2026, decision 369) ----------
   Under the top bar while an admin views the system as someone
   (js/views/shell.js, me.view_as). Blue, so it is never mistaken for a
   warning about the admin's own account. */

.va-banner {
  flex: none; position: relative; z-index: calc(var(--z-top) - 1);
  background: var(--info-bg); color: var(--info-ink);
  border-bottom: 1px solid var(--info-line);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
.va-banner[hidden] { display: none; }
.va-banner__in {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s2) var(--s3);
}
.va-banner__i { display: inline-flex; flex: none; }
.va-banner__t { flex: 1 1 14rem; min-width: 0; margin: 0; font-size: var(--fs-sm); line-height: var(--lh-snug); }
.va-banner__until { white-space: nowrap; }
.va-banner__b { flex: none; min-height: var(--tap); }

/* ---------- the birthdays bell (2 Nov 2026, decision 371) ----------
   Beside New, on every width. The count is a small red bubble on the bell. */

.top__n {
  position: absolute; top: 4px; right: 2px;
  display: inline-grid; place-items: center;
  min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: var(--r-pill);
  background: var(--red); color: var(--on-red);
  box-shadow: 0 0 0 2px var(--chrome-bg);
  font: 600 var(--fs-label)/1 var(--font-body); font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.top__n[hidden] { display: none; }

/* No scroll of its own: the pop-over around it scrolls (two scroll bars before, Franro 15 Nov 2026). */
.bday { display: grid; gap: var(--s3); padding: var(--s3); }
.bday__head { display: grid; gap: 2px; }
.bday__title { margin: 0; font: 700 var(--fs-lg)/var(--lh-snug) var(--font-display); color: var(--ink); }
.bday__head .fine { margin: 0; }
.bday__days { display: grid; gap: var(--s3); }
.bday__day { display: grid; gap: var(--s1); }
.bday__d { margin: 0; }
.bday__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bday__a {
  display: flex; align-items: center; gap: var(--s2); min-height: var(--tap);
  padding: var(--s1) var(--s2); border-radius: var(--r-sm);
  color: var(--ink); text-decoration: none;
}
.bday__a svg { flex: none; color: var(--ink-mute); }
a.bday__a:hover { background: var(--tint); }
.bday__who { display: grid; min-width: 0; }
.bday__n { font-weight: 600; overflow-wrap: anywhere; }
.bday__c { overflow-wrap: anywhere; }
.bday__more, .bday__wait { margin: 0; }

/* ---------- help (14 Nov 2026, decision 498) ----------
   The ? button between the bell and day or night opens
   js/components/help-panel.js: a panel on the right under the top bar from
   720px (the page stays usable beside it), the whole screen under 720px.
   Day and night by the tokens only. */

.hlp {
  position: fixed; z-index: calc(var(--z-panel) + 1);
  top: calc(var(--top-h) + env(safe-area-inset-top, 0px)); right: 0; bottom: 0;
  width: min(420px, 100vw);
  display: flex; flex-direction: column;
  padding-right: env(safe-area-inset-right, 0px);
  background: var(--surface); color: var(--ink);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow-drawer);
  animation: llFade var(--dur-2) ease both;
}
.hlp[hidden] { display: none; }
@media (max-width: 719px) {
  .hlp {
    z-index: var(--z-side);
    top: 0; width: 100%; border-left: 0;
    padding-top: env(safe-area-inset-top, 0px);
    padding-bottom: env(safe-area-inset-bottom, 0px);
    padding-left: env(safe-area-inset-left, 0px);
  }
}
/* On a wide screen the page makes room for the help, so nothing of it is under the panel
   (Franro's check of 15 Nov 2026: the company's Edit button was covered). */
@media (min-width: 1100px) {
  html.help-open .content { margin-right: min(420px, 100vw); }
}

.hlp__head {
  flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: var(--tap); padding: var(--s2) var(--s2) 0 var(--s4);
}
.hlp__title {
  display: flex; align-items: center; gap: var(--s2); margin: 0;
  font: 700 var(--fs-lg)/var(--lh-snug) var(--font-display); color: var(--ink);
}
.hlp__title svg { flex: none; color: var(--red-ink); }
.hlp__x { width: var(--tap); height: var(--tap); }

.hlp__tabs { flex: none; padding: 0 var(--s3); }
.hlp__tab { border: 0; background: transparent; font: inherit; font-weight: 600; cursor: pointer; }

.hlp__body {
  flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s4) var(--s4) var(--s5);
}
.hlp__body:focus { outline: none; }
.hlp__keys { flex: none; margin: 0; padding: var(--s2) var(--s4); border-top: 1px solid var(--line); }
@media (hover: none), (pointer: coarse) { .hlp__keys { display: none; } }

.hlp__wait { display: grid; justify-items: start; gap: var(--s3); margin: 0; }
.hlp__nopage, .hlp__lead, .hlp__none { margin: 0 0 var(--s3); }

.hlp__entry { display: grid; gap: var(--s4); }
.hlp__h { margin: 0; font: 700 var(--fs-h3)/var(--lh-snug) var(--font-display); color: var(--ink); }
.hlp__h:focus, .hlp__sec-t:focus { outline: none; }
.hlp__h:focus-visible, .hlp__sec-t:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.hlp__intro { margin: calc(-1 * var(--s2)) 0 0; color: var(--ink-soft); }
.hlp__sec { display: grid; gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line); scroll-margin-top: var(--s2); }
.hlp__sec.is-hit .hlp__sec-t { color: var(--red-ink); }
.hlp__sec-t { margin: 0; font: 700 var(--fs-body)/var(--lh-snug) var(--font-body); color: var(--ink); }
.hlp__p { margin: 0; }
/* base.css takes the markers off every list: the steps get their numbers back, the tips their dots. */
.hlp__steps { margin: 0; padding-left: 1.5rem; display: grid; gap: var(--s1); list-style: decimal; }
.hlp__steps li { padding-left: var(--s1); }
.hlp__steps li::marker { font-weight: 700; color: var(--ink-soft); }
.hlp__tips {
  display: grid; gap: var(--s1);
  padding: var(--s2) var(--s3); border-radius: var(--r-md); background: var(--sunken);
}
.hlp__tips-t { margin: 0; }
.hlp__tips ul { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s1); list-style: disc; }
.hlp strong { font-weight: 700; color: var(--ink); }

.hlp__back { justify-self: start; margin: calc(-1 * var(--s2)) 0 var(--s3) calc(-1 * var(--s2)); }

.hlp__find { position: relative; margin-bottom: var(--s3); }
.hlp__find > svg { position: absolute; left: 12px; top: 50%; margin-top: -9px; color: var(--ink-mute); pointer-events: none; }
.hlp__q.input { width: 100%; padding-left: 40px; }

.hlp__topics, .hlp__see ul, .hlp__subs { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.hlp__topic, .hlp__sub {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  width: 100%; min-height: var(--tap); padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border: 0; border-radius: var(--r-sm); background: transparent;
  color: var(--ink); font: inherit; text-align: left; cursor: pointer;
}
.hlp__topic:hover, .hlp__sub:hover { background: var(--tint); }
.hlp__topic > svg { flex: none; color: var(--ink-mute); }
.hlp__topic-w { display: grid; gap: 2px; min-width: 0; }
.hlp__topic-t { font-weight: 600; overflow-wrap: anywhere; }
.hlp__topic-i { overflow-wrap: anywhere; }
.hlp__subs { margin: 0 0 var(--s2) var(--s4); padding-left: var(--s2); border-left: 2px solid var(--line); }
.hlp__sub { min-height: 36px; color: var(--ink-soft); font-size: var(--fs-sm); }
@media (pointer: coarse) { .hlp__sub { min-height: var(--tap); } }
.hlp__see { display: grid; gap: var(--s1); padding-top: var(--s3); border-top: 1px solid var(--line); }
.hlp__see .label { margin: 0; }

/* ---------- motion, contrast, print ---------- */

@media (prefers-reduced-motion: reduce) {
  .side, .menu-open .side { transition: none; }
}

@media (forced-colors: active) {
  .top { border-bottom: 1px solid; }
  .ss-banner, .va-banner { border-bottom: 1px solid; }
  .hlp { border: 1px solid CanvasText; }
  .top__n { border: 1px solid ButtonText; }
  .top__new, .tabbar__plus, .side__n, .tabbar__n { border: 1px solid ButtonText; }
  .side__a.is-on, .tabbar__a.is-on { outline: 1px solid Highlight; outline-offset: -3px; }
  .side__sep { background: CanvasText; }
  .side__a.is-on::before, .tabbar__a.is-on::before { background: Highlight; }
}

@media print {
  .top, .side, .scrim, .tabbar, .ss-banner, .va-banner, .hlp { display: none !important; }
  body.has-shell { overflow: visible; }
  body.has-shell #app { display: block; height: auto; }
  .content { overflow: visible; }
}

/* ---------- an email opened in a tab of its own (27 Oct 2026) ----------
   Only the email (html.is-solo, set by views/email.js for ?solo=1): no top
   bar, no menu, no bottom bar and no reminder window, so nobody works in a
   second copy of the system. The person closes the tab when done. */
html.is-solo .top, html.is-solo .side, html.is-solo .scrim, html.is-solo .tabbar, html.is-solo .rmd { display: none !important; }

/* ==========================================================================
   Claude in the Hub (9 Nov 2026, SPEC 6.33): js/components/ai-chat.js.
   Every class starts with aic-. The bubble at the bottom right, the chat as
   a panel beside the page (a sheet over the whole screen under 600px, the
   whole window in full screen), the Markdown of an answer
   (js/core/ai-markdown.js), the tool chips, the card that asks to Allow a
   change, and the admin card (.aic-adm, Admin, Settings, AI apps).

   The look is the shell's own: the coal bar and the red of the mark. One
   thing moves on purpose: the spark of its button in the top bar (decision 515)
   turns while Claude works, and the spark beside an answer that is coming.
   Day and night by the tokens (decision 494): the person's own message, a
   block of code and the veil of a drop have tokens of their own.
   The brand has no italics: emphasis is a red highlighter line.
   ========================================================================== */

.aic {
  --aic-band: linear-gradient(140deg, var(--ll-mark-top) 0%, var(--ll-mark-bottom) 62%, var(--ll-oxblood) 100%);
  --aic-gap: 24px;
  --aic-w: 420px;
  --aic-h: 640px;
  --aic-r: 14px;
  --aic-read: 46rem;
}

/* ---------- the button in the top bar (23 Nov 2026, decision 515) ----------
   Jose: the round bubble lay over a page's own buttons. Claude opens from the
   bar now, beside the ?: the spark in the red of the mark, a dot while a
   change waits for Allow, and the spark turns while Claude works. */

.top__ai { color: var(--ll-mark-top); }
.top__ai[hidden] { display: none; }
.top__ai-core { display: grid; place-items: center; transition: transform .7s var(--ease-out); }
.top__ai:hover .top__ai-core, .top__ai:focus-visible .top__ai-core { transform: rotate(45deg); }
.top__ai.is-working .top__ai-core { animation: aicSpin 1.6s linear infinite; }
.top__ai-dot {
  position: absolute; top: 7px; right: 7px;
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--red); box-shadow: 0 0 0 2px var(--chrome-bg);
}
.top__ai-dot[hidden] { display: none; }

/* ---------- the panel ---------- */

.aic-panel {
  position: fixed; z-index: var(--z-panel);
  /* Under the top bar, at the right, below its button (decision 515). */
  top: calc(var(--top-h) + env(safe-area-inset-top, 0px) + var(--aic-gap) / 2);
  right: calc(var(--aic-gap) + env(safe-area-inset-right, 0px));
  width: min(var(--aic-w), calc(100vw - 2 * var(--aic-gap)));
  height: min(var(--aic-h), calc(100vh - var(--top-h) - 2 * var(--aic-gap)));
  height: min(var(--aic-h), calc(100dvh - var(--top-h) - 2 * var(--aic-gap)));
  display: flex; flex-direction: column;
  background: var(--surface); color: var(--ink);
  border-radius: var(--aic-r);
  box-shadow: 0 0 0 1px var(--edge), 0 32px 72px -22px rgb(12 12 13 / .5), 0 12px 26px -14px rgb(12 12 13 / .24);
  overflow: hidden;
  transform-origin: 100% 0;
  animation: aicOpen var(--dur-3) var(--ease-out) both;
}

/* ---------- its header: the coal of the top bar, the band along its top ---------- */

.aic-head {
  position: relative; flex: none;
  display: flex; align-items: center; justify-content: space-between; gap: var(--s2);
  min-height: 60px; padding: 3px var(--s2) 0 var(--s3);
  background: var(--ll-coal); color: var(--ll-bone);
}
.aic-head::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px;
  background: linear-gradient(90deg, var(--ll-mark-top), var(--ll-mark-bottom) 55%, var(--ll-oxblood));
}
.aic-head__id { display: flex; align-items: center; gap: var(--s2); min-width: 0; }
.aic-tile {
  flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: 9px;
  background: var(--aic-band); color: var(--on-red);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 6px 14px -6px rgb(213 26 26 / .7);
}
.aic-head__name { margin: 0; font: 700 1.375rem/1 var(--font-display); letter-spacing: .01em; color: var(--ll-bone); }
.aic-head__model {
  display: inline-flex; align-items: center; min-height: 22px; padding: 0 8px; min-width: 0;
  border: 1px solid var(--ll-coal-line); border-radius: var(--r-pill);
  color: var(--ll-mist); font: 600 .75rem/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.aic-head__btns { flex: none; display: flex; align-items: center; gap: 2px; }
.aic-ibtn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-width: 40px; height: 40px; padding: 0 var(--s2);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--ll-bone);
  font: 600 var(--fs-sm)/1 var(--font-body);
}
.aic-ibtn:hover { background: var(--chrome-hover); }
.aic-ibtn[aria-expanded="true"] { background: rgb(236 234 230 / .14); }
.aic-ibtn__t { display: none; }
.aic-head :focus-visible { outline-color: var(--focus-on-dark); outline-offset: -2px; }
@media (pointer: coarse) { .aic-ibtn { min-width: var(--tap); height: var(--tap); } }

/* ---------- the body: the list of chats and the conversation ---------- */

.aic-body { position: relative; flex: 1; min-height: 0; display: flex; }
.aic-main { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.aic-log {
  flex: 1; min-height: 0;
  overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain;
  padding: var(--s4) var(--s4) var(--s3);
}
.aic-wait { display: grid; place-items: center; min-height: 160px; }
.aic-fail { display: grid; justify-items: center; gap: var(--s3); padding: var(--s6) var(--s4); text-align: center; color: var(--ink-soft); }

/* The list: over the conversation in the panel, a column of its own in full screen. */
.aic-side {
  position: absolute; inset: 0; z-index: 2;
  display: none; flex-direction: column; min-width: 0;
  background: var(--surface);
}
.aic.is-list .aic-side { display: flex; animation: aicSlide var(--dur-2) var(--ease-out) both; }
.aic-side__top { flex: none; display: flex; align-items: center; gap: var(--s2); padding: var(--s2) var(--s3) 0; }
.aic-side__h { margin: 0; font: 700 var(--fs-lg)/1.2 var(--font-display); color: var(--ink); }
/* Over the conversation the header's pressed button says what this is: the heading is for a screen reader. */
.aic-side__back + .aic-side__h {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; border: 0;
}
.aic-side__back {
  display: inline-flex; align-items: center; gap: var(--s2); min-height: var(--tap); padding: 0 var(--s2);
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-soft); font-weight: 600;
}
.aic-side__back:hover { background: var(--tint); color: var(--ink); }
.aic-side__find { position: relative; flex: none; margin: var(--s3); }
.aic-side__find > svg { position: absolute; left: 12px; top: 50%; margin-top: -9px; color: var(--ink-mute); pointer-events: none; }
.aic-side__q.input { padding-left: 40px; border-radius: var(--r-pill); }
.aic-side__list { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 2px; padding: 0 var(--s2) var(--s2); }
.aic-side__wait { display: grid; place-items: center; padding: var(--s5); }
.aic-side__empty { padding: var(--s4) var(--s3); color: var(--ink-mute); font-size: var(--fs-sm); }
.aic-side__note {
  flex: none; display: flex; align-items: center; gap: var(--s2);
  padding: var(--s3) var(--s4); border-top: 1px solid var(--line);
  color: var(--ink-mute); font-size: var(--fs-sm);
}
.aic-side__note svg { flex: none; }
.aic-chat { position: relative; display: flex; align-items: stretch; border-radius: var(--r-md); }
.aic-chat:hover { background: var(--tint); }
.aic-chat.is-on { background: var(--red-wash); }
.aic-chat.is-on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--band); }
.aic-chat__open {
  flex: 1; min-width: 0; display: grid; gap: 2px; align-content: center;
  min-height: 56px; padding: var(--s2) var(--s2) var(--s2) var(--s3);
  border: 0; border-radius: var(--r-md); background: transparent; text-align: left; color: var(--ink);
}
.aic-chat__open:focus-visible, .aic-chat__more:focus-visible { outline-offset: -3px; }
.aic-chat__t { font-weight: 600; line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-chat__m { display: flex; flex-wrap: wrap; gap: 2px var(--s2); font-size: var(--fs-sm); line-height: 1.3; color: var(--ink-mute); }
.aic-chat__wait { display: inline-flex; align-items: center; gap: 5px; color: var(--warning-ink); font-weight: 600; }
.aic-chat__wait::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red-ink); }
.aic-chat__more {
  flex: none; display: grid; place-items: center; width: 40px;
  border: 0; border-radius: var(--r-md); background: transparent; color: var(--ink-mute);
  opacity: 0; transition: opacity var(--dur-1) ease;
}
.aic-chat:hover .aic-chat__more, .aic-chat:focus-within .aic-chat__more, .aic-chat.is-on .aic-chat__more,
.aic-chat__more[aria-expanded="true"] { opacity: 1; }
.aic-chat__more:hover { background: var(--tint-2); color: var(--ink); }
@media (pointer: coarse) { .aic-chat__more { opacity: 1; width: var(--tap); } }

/* ---------- the greeting ---------- */

.aic-hello { display: grid; gap: var(--s3); padding: var(--s2) var(--s1) var(--s2); animation: aicRise .5s var(--ease-out) both; }
.aic-hello__mark {
  display: grid; place-items: center; width: 50px; height: 50px; border-radius: 14px;
  background: var(--aic-band); color: var(--on-red);
  box-shadow: inset 0 1px 0 rgb(255 255 255 / .2), 0 14px 28px -14px rgb(200 25 27 / .8);
}
.aic-hello__h { margin-top: var(--s1); font: 700 clamp(1.75rem, 1.45rem + 1vw, 2.125rem)/1.05 var(--font-display); color: var(--ink); }
.aic-hello__lead { max-width: 42ch; color: var(--ink-soft); font-size: .9375rem; line-height: 1.55; }
.aic-hello__group { display: grid; gap: var(--s2); margin-top: var(--s2); }
.aic-sugs { display: grid; gap: 6px; }
.aic-sug {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s3);
  width: 100%; min-height: var(--tap); padding: var(--s2) var(--s3) var(--s2) var(--s4);
  border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface);
  color: var(--ink); font-weight: 500; line-height: 1.35; text-align: left;
  box-shadow: var(--shadow-soft);
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease, transform var(--dur-1) ease;
  animation: aicRise .45s var(--ease-out) both;
}
.aic-sugs li:nth-child(2) .aic-sug { animation-delay: 60ms; }
.aic-sugs li:nth-child(3) .aic-sug { animation-delay: 120ms; }
.aic-sug:hover { border-color: rgb(200 25 27 / .45); box-shadow: var(--shadow-lift); }
.aic-sug:active { transform: scale(.99); }
.aic-sug__i { flex: none; display: grid; place-items: center; color: var(--ink-mute); transition: transform var(--dur-2) var(--ease-out), color var(--dur-1) ease; }
.aic-sug:hover .aic-sug__i { color: var(--red-ink); transform: translateX(3px); }
.aic-sug--fill:hover .aic-sug__i { transform: rotate(-10deg); }

/* ---------- the conversation ---------- */

.aic-thread { display: grid; gap: var(--s5); }
.aic-msg { min-width: 0; }
.aic-msg--me { display: grid; justify-items: end; gap: var(--s1); margin-left: 14%; }
.aic-me {
  max-width: 100%; padding: 10px 14px;
  border-radius: 16px 16px 4px 16px;
  background: var(--bubble-bg); color: var(--bubble-ink);
  font-size: .9375rem; line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere;
  box-shadow: 0 1px 2px rgb(12 12 13 / .14);
  animation: aicPop var(--dur-2) var(--ease-out) both;
}
.aic-msg--me.is-failed .aic-me { background: var(--surface); color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--danger-line); }
.aic-msg__err { display: flex; align-items: flex-start; gap: 6px; max-width: 100%; color: var(--danger-ink); font-size: var(--fs-sm); line-height: 1.4; text-align: right; }
.aic-msg__err svg { flex: none; margin-top: 2px; }

.aic-msg--ai { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: var(--s3); align-items: start; }
.aic-ai__mark {
  position: relative; display: grid; place-items: center;
  width: 26px; height: 26px; margin-top: 1px; border-radius: 8px;
  background: var(--aic-band); color: var(--on-red);
}
.aic-msg--ai.is-live .aic-ai__mark { animation: aicGlow 1.6s ease-in-out infinite; }
.aic-msg--ai.is-live .aic-ai__mark svg { animation: aicSpin 3s linear infinite; }
.aic-ai__col { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s2); }
/* One column no wider than the answer: a long chip ("Searching the web: ...", 20 Nov 2026) is cut with
   an ellipsis instead of widening the answer past the panel. */
.aic-ai__body { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s3); }
.aic-ai__body > * { min-width: 0; }
.aic-ai__tail { display: flex; gap: var(--s1); margin-left: -10px; }
.aic-copy {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px;
  border: 0; border-radius: var(--r-pill); background: transparent;
  color: var(--ink-mute); font-size: .8125rem; font-weight: 500;
}
.aic-copy:hover { background: var(--tint); color: var(--ink); }
@media (pointer: coarse) { .aic-copy { min-height: var(--tap); } }

/* "Thinking": a light that runs through the word while Claude has not written yet. */
.aic-think { font: 600 .8125rem/1.3 var(--font-display); letter-spacing: .1em; text-transform: uppercase; color: var(--ink-mute); }
.aic-think > span {
  background: linear-gradient(90deg, var(--ink-mute) 0%, var(--ink-mute) 38%, var(--red-ink) 50%, var(--ink-mute) 62%, var(--ink-mute) 100%);
  background-size: 260% 100%;
  -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: aicShimmer 1.9s linear infinite;
}

/* The caret at the end of the words as they come. */
.aic-caret {
  display: inline-block; width: .55em; height: 1.05em; margin-left: 3px; vertical-align: -.17em;
  border-radius: 2px; background: var(--red-ink);
  animation: aicCaret .9s ease-in-out infinite;
}

/* ---------- the Markdown of an answer ---------- */

.aic-md { min-width: 0; font-size: .9375rem; line-height: 1.6; color: var(--ink); overflow-wrap: anywhere; }
.aic-md > * + * { margin-top: .7em; }
.aic-md h3, .aic-md h4, .aic-md h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; color: var(--ink); }
.aic-md * + h3, .aic-md * + h4, .aic-md * + h5 { margin-top: 1.1em; }
.aic-md h3 { font-size: 1.3125rem; }
.aic-md h4 { font-size: 1.125rem; }
.aic-md h5 { font-size: .8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-soft); }
.aic-md strong { font-weight: 600; }
/* No italics in the brand: a highlighter line instead. */
.aic-md em { font-style: normal; padding: 0 .08em; background: linear-gradient(transparent 58%, rgb(200 25 27 / .16) 58%); }
.aic-md del { color: var(--ink-mute); }
.aic-md code { padding: .1em .35em; border-radius: var(--r-xs); background: var(--sunken); color: var(--ink); font-size: .85em; }
.aic-md pre { padding: var(--s3) var(--s4); border-radius: var(--r-md); background: var(--code-bg); color: var(--code-ink); font-size: .8125rem; line-height: 1.55; }
.aic-md pre code { padding: 0; background: none; color: inherit; font-size: inherit; }
.aic-md ul, .aic-md ol { display: grid; gap: .3em; padding-left: 1.4em; }
.aic-md ul { list-style: disc; }
.aic-md ul ul { list-style: circle; }
.aic-md ol { list-style: decimal; }
.aic-md li { padding-left: .15em; }
.aic-md li::marker { color: var(--red-ink); font-weight: 600; }
.aic-md li > ul, .aic-md li > ol, .aic-md li > p, .aic-md li > pre { margin-top: .3em; }
.aic-md blockquote { padding: .15em 0 .15em var(--s3); border-left: 3px solid var(--line-strong); color: var(--ink-soft); }
.aic-md blockquote > * + * { margin-top: .5em; }
.aic-md hr { margin: 1em 0; border-top-color: var(--line-strong); }
.aic-link { color: var(--link); font-weight: 500; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.aic-link:hover { color: var(--link-hover); text-decoration-thickness: 2px; }
.aic-md .aic-table {
  max-width: 100%; overflow-x: auto;
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface);
}
.aic-md .aic-table:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.aic-md table { width: 100%; font-size: .875rem; line-height: 1.4; overflow-wrap: normal; }
.aic-md th {
  padding: 8px 12px; background: var(--sunken); border-bottom: 1px solid var(--line-strong);
  font: 600 .75rem/1.25 var(--font-display); letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-soft); white-space: nowrap; text-align: left;
}
/* A cell keeps room for a date or a short name; a wider table scrolls in its box. */
.aic-md td { min-width: 7.5em; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.aic-md tbody tr:last-child td { border-bottom: 0; }
.aic-md tbody tr:nth-child(even) td { background: var(--stripe); }
.aic-md .is-right { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aic-md .is-center { text-align: center; }

/* ---------- tool chips, notices ---------- */

.aic-tools { display: flex; flex-wrap: wrap; gap: 6px; }
.aic-tool {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 28px;
  padding: 3px 11px 3px 8px;
  border: 1px solid var(--line-strong); border-radius: var(--r-pill); background: var(--surface);
  color: var(--ink-soft); font-size: .8125rem; line-height: 1.2;
  animation: aicPop var(--dur-2) var(--ease-out) both;
}
.aic-tool__i { flex: none; display: grid; place-items: center; width: 16px; height: 16px; }
.aic-tool__t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-tool--run { color: var(--ink); border-color: var(--field-line); }
.aic-tool--ok .aic-tool__i { color: var(--success); }
.aic-tool--error { border-color: var(--danger-line); background: var(--danger-bg); color: var(--danger-ink); }
.aic-tool--wait { border-color: var(--warning-line); background: var(--warning-bg); color: var(--warning-ink); }
.aic-tool--no { border-style: dashed; color: var(--ink-mute); }
.aic-spin {
  width: 12px; height: 12px; border-radius: 50%;
  border: 2px solid var(--line-strong); border-top-color: var(--red-ink);
  animation: llSpin .7s linear infinite;
}
.aic-notice, .aic-err {
  display: flex; align-items: flex-start; flex-wrap: wrap; gap: 4px var(--s2);
  padding: var(--s2) var(--s3); border-radius: var(--r-md);
  font-size: var(--fs-sm); line-height: 1.45;
}
.aic-notice { background: var(--sunken); color: var(--ink-soft); }
.aic-err { background: var(--danger-bg); color: var(--danger-ink); box-shadow: inset 0 0 0 1px var(--danger-line); }
.aic-notice > svg, .aic-err > svg { flex: none; margin-top: 2px; }
.aic-notice > span, .aic-err > span { flex: 1 1 12rem; min-width: 0; }
.aic-err__a { font-weight: 600; color: var(--danger-ink); }

/* ---------- the card that asks to Allow a change ---------- */

.aic-slip {
  position: relative; display: grid; gap: var(--s3);
  padding: var(--s3) var(--s4) var(--s4) calc(var(--s4) + 4px);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-lift); overflow: hidden;
  animation: aicPop var(--dur-3) var(--ease-out) both;
}
.aic-slip::before { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 4px; background: var(--band); }
.aic-slip__k { display: flex; align-items: center; gap: 6px; font: 700 .8125rem/1.2 var(--font-display); letter-spacing: .08em; text-transform: uppercase; color: var(--red-ink); }
.aic-slip__k svg { flex: none; }
.aic-slip__acts { display: grid; gap: var(--s3); }
.aic-slip__what { display: block; font: 700 1.1875rem/1.2 var(--font-display); color: var(--ink); }
.aic-slip__dl { display: grid; margin-top: 6px; }
.aic-slip__row {
  display: grid; grid-template-columns: minmax(5.5rem, 36%) minmax(0, 1fr); gap: var(--s3);
  padding: 5px 0; border-top: 1px dashed var(--line-strong);
  font-size: var(--fs-sm); line-height: 1.4;
}
.aic-slip__row dt { color: var(--ink-mute); overflow-wrap: anywhere; }
.aic-slip__row dd {
  color: var(--ink); overflow-wrap: anywhere;
  display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden;
}
.aic-slip__foot { display: grid; gap: var(--s3); }
.aic-slip__lead { color: var(--ink-soft); font-size: var(--fs-sm); }
.aic-slip__btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--s2); }
.aic-slip__btns .btn { min-height: var(--tap); }
.aic-slip__said { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-soft); }
.aic-slip__said svg { flex: none; }
.aic-slip__said.is-allowed { color: var(--success-ink); }
.aic-slip__said.is-error { color: var(--danger-ink); }
/* Once answered the card steps back. */
.aic-slip:not(.is-wait):not(.is-busy) { box-shadow: none; background: transparent; }
.aic-slip:not(.is-wait):not(.is-busy)::before { background: var(--line-strong); }
.aic-slip.is-allowed:not(.is-wait)::before { background: var(--success); }

/* ---------- the box ---------- */

.aic-dock {
  flex: none; display: grid; gap: 6px;
  padding: var(--s2) var(--s3) calc(var(--s2) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--line); background: var(--surface);
}
.aic-off {
  padding: var(--s2) var(--s3); border: 1px solid var(--warning-line); border-radius: var(--r-md);
  background: var(--warning-bg); color: var(--warning-ink); font-size: var(--fs-sm); line-height: 1.4;
}
.aic-compose { margin: 0; }
.aic-compose__box {
  display: flex; align-items: flex-end; gap: var(--s2);
  padding: 6px 6px 6px 14px;
  border: 1px solid var(--field-line); border-radius: 16px; background: var(--surface);
  transition: border-color var(--dur-1) ease, box-shadow var(--dur-1) ease;
}
.aic-compose__box:hover { border-color: var(--field-line-hover); }
.aic-compose__box:focus-within { border-color: var(--ink); box-shadow: var(--focus-ring); }
.aic-in {
  flex: 1; min-width: 0; min-height: 34px; max-height: 200px; padding: 6px 0;
  border: 0; outline: 0; resize: none; background: transparent;
  color: var(--ink); font-size: 1rem; line-height: 1.45;
}
.aic-in:focus-visible { outline: 0; }
.aic-in:disabled { color: var(--ink-disabled); }
.aic-send {
  position: relative; flex: none; display: grid; place-items: center;
  width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: var(--red); color: var(--on-red);
  transition: background-color var(--dur-1) ease, transform var(--dur-1) ease;
}
.aic-send svg { transform: rotate(-90deg); }
.aic-send:hover:not(:disabled) { background: var(--red-hover); }
.aic-send:active:not(:disabled) { transform: scale(.94); }
.aic-send:disabled { background: var(--sunken); color: var(--ink-disabled); }
.aic-send.is-busy { background: var(--coal-fill); }
.aic-send.is-busy svg { visibility: hidden; }
.aic-send.is-busy::after {
  content: ""; position: absolute; top: 50%; left: 50%; width: 18px; height: 18px; margin: -9px 0 0 -9px;
  border-radius: 50%; border: 2px solid rgb(236 234 230 / .3); border-top-color: var(--ll-bone);
  animation: llSpin .7s linear infinite;
}
@media (pointer: coarse) { .aic-send { width: var(--tap); height: var(--tap); } }

.aic-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 2px var(--s3);
  padding: 0 4px; color: var(--ink-mute); font-size: .75rem; line-height: 1.35;
}
.aic-foot__u { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.aic-foot__meter { display: block; width: 32px; height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.aic-foot__fill { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--ink-soft); transition: width var(--dur-3) var(--ease-out); }
.aic-foot.is-high .aic-foot__fill { background: var(--warning); }
.aic-foot.is-full .aic-foot__fill { background: var(--danger); }
.aic-foot.is-full .aic-foot__used { color: var(--danger-ink); font-weight: 600; }

/* ---------- full screen (from 600px; a phone has the sheet) ---------- */

@media (min-width: 600px) {
  .aic[data-mode="full"] .aic-panel {
    top: 0; right: 0; bottom: 0; left: 0; width: auto; height: auto;
    border-radius: 0; box-shadow: none; animation-name: aicFull;
  }
  .aic[data-mode="full"] .aic-head { min-height: 64px; padding-left: var(--s4); padding-right: var(--s3); }
  .aic[data-mode="full"] .aic-ibtn--list { display: none; }
  .aic[data-mode="full"] .aic-ibtn--new { padding: 0 var(--s3) 0 var(--s2); }
  .aic[data-mode="full"] .aic-ibtn--new .aic-ibtn__t { display: inline; }
  .aic[data-mode="full"] .aic-side {
    position: relative; inset: auto; z-index: auto;
    display: flex; flex: none; width: 300px;
    border-right: 1px solid var(--line); animation: none;
  }
  .aic[data-mode="full"] .aic-side__back { display: none; }
  .aic[data-mode="full"] .aic-side__back + .aic-side__h {
    position: static; width: auto; height: auto; margin: 0; overflow: visible; clip: auto; clip-path: none; white-space: normal;
  }
  .aic[data-mode="full"] .aic-side__top { padding: var(--s4) var(--s4) 0; }
  .aic[data-mode="full"] .aic-log { padding: var(--s6) var(--s5) var(--s4); }
  .aic[data-mode="full"] .aic-log.is-empty { display: grid; align-content: center; }
  .aic[data-mode="full"] .aic-thread,
  .aic[data-mode="full"] .aic-hello,
  .aic[data-mode="full"] .aic-dock > * { width: 100%; max-width: var(--aic-read); margin-left: auto; margin-right: auto; }
  .aic[data-mode="full"] .aic-dock { padding: var(--s3) var(--s5) calc(var(--s3) + env(safe-area-inset-bottom, 0px)); border-top: 0; background: var(--bg); }
  .aic[data-mode="full"] .aic-compose__box { box-shadow: var(--shadow-lift); }
  .aic[data-mode="full"] .aic-compose__box:focus-within { box-shadow: var(--focus-ring), var(--shadow-lift); }
  .aic[data-mode="full"] .aic-md { font-size: 1rem; }
  .aic[data-mode="full"] .aic-me { font-size: 1rem; }
  .aic[data-mode="full"] .aic-msg--me { margin-left: 20%; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .aic[data-mode="full"] .aic-side { width: 240px; }
}

/* ---------- a tablet: above the bottom bar ---------- */

@media (max-width: 959px) {
  .aic { --aic-gap: 16px; }
  .aic-panel {
    height: min(var(--aic-h), calc(100vh - var(--top-h) - var(--bottom-h) - 2 * var(--aic-gap)));
    height: min(var(--aic-h), calc(100dvh - var(--top-h) - var(--bottom-h) - 2 * var(--aic-gap)));
  }
}

/* ---------- a phone: a sheet over the whole screen, above the keyboard ---------- */

@media (max-width: 599px) {
  .aic-panel, .aic[data-mode="full"] .aic-panel {
    top: var(--aic-vvt, 0px); right: 0; bottom: auto; left: 0;
    width: 100%; height: 100vh; height: var(--aic-vvh, 100dvh);
    border-radius: 0; box-shadow: none;
    animation: llSheet var(--dur-3) var(--ease-out) both;
  }
  .aic-head { padding-top: calc(3px + env(safe-area-inset-top, 0px)); min-height: calc(60px + env(safe-area-inset-top, 0px)); }
  .aic-ibtn--full { display: none; }
  .aic-log { padding: var(--s4) var(--s3) var(--s3); }
  .aic-msg--me { margin-left: 10%; }
  .aic-foot__care { flex-basis: 100%; }
}
@media (max-width: 359px) {
  .aic-head__model { display: none; }
}

/* ---------- files in the chat (12 Nov 2026, decisions 484 and 485): js/components/ai-files.js ---------- */

/* The paperclip in the box, and the one line of what Claude reads. */
.aic-attach__w { flex: none; display: flex; margin-left: -8px; }
.aic-attach {
  display: grid; place-items: center; width: 40px; height: 40px; padding: 0;
  border: 0; border-radius: 12px; background: transparent; color: var(--ink-soft);
  transition: background-color var(--dur-1) ease, color var(--dur-1) ease;
}
.aic-attach:hover:not(:disabled) { background: var(--tint); color: var(--ink); }
.aic-attach:disabled { color: var(--ink-disabled); }
@media (pointer: coarse) { .aic-attach { width: var(--tap); height: var(--tap); } }
.aic-hint { margin: 0; padding: 0 4px; color: var(--ink-mute); font-size: .75rem; line-height: 1.35; }

/* The files of the message being written: chips above the box. */
.aic-atts { display: flex; flex-wrap: wrap; gap: 6px; max-height: 148px; margin: 0 0 6px; overflow-y: auto; overscroll-behavior: contain; }
.aic-att {
  display: flex; align-items: center; gap: 8px; min-width: 0; max-width: 100%;
  padding: 4px 4px 4px 6px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface);
  font-size: .8125rem; line-height: 1.25;
}
.aic-att.is-new { animation: aicPop var(--dur-2) var(--ease-out) both; }
.aic-att__i {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--sunken); color: var(--ink-soft); overflow: hidden;
}
.aic-att__pic { display: block; width: 100%; height: 100%; object-fit: cover; }
.aic-att__id { min-width: 0; display: grid; }
.aic-att__n { max-width: 13rem; font-weight: 600; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-att__s { color: var(--ink-mute); }
.aic-att__e { max-width: 17rem; color: var(--danger-ink); overflow-wrap: anywhere; }
.aic-att.is-err { border-color: var(--danger-line); background: var(--danger-bg); }
.aic-att.is-err .aic-att__i { background: transparent; color: var(--danger-ink); }
.aic-att__x {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0;
  border: 0; border-radius: 8px; background: transparent; color: var(--ink-mute);
}
.aic-att__x:hover { background: var(--tint-2); color: var(--ink); }
@media (pointer: coarse) { .aic-att__x { width: var(--tap); height: var(--tap); } }

/* Files dragged over the chat. It takes no pointer: the drop lands on the panel under it. */
.aic-drop {
  position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; padding: var(--s4);
  background: var(--veil); pointer-events: none;
}
.aic-drop__in {
  display: grid; justify-items: center; gap: var(--s2); padding: var(--s5) var(--s6); text-align: center;
  border: 2px dashed var(--red-ink); border-radius: var(--r-lg); background: var(--surface);
  color: var(--ink); font: 700 1.25rem/1.2 var(--font-display);
}
.aic-drop__in svg { color: var(--red-ink); }

/* The files of a message of the person: a picture small, any other file by its name and size. */
.aic-sent { display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: flex-end; gap: 6px; max-width: 100%; }
.aic-sent__i { min-width: 0; max-width: 100%; }
.aic-sent__pic {
  display: grid; place-items: center; width: 96px; height: 96px; padding: 0; overflow: hidden;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--sunken); color: var(--ink-mute);
}
.aic-sent__pic img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aic-sent__pic:hover, .aic-sent__file:hover { border-color: var(--ink-soft); }
.aic-sent__file {
  display: flex; align-items: center; gap: 8px; max-width: 100%; min-height: 40px; padding: 4px 12px 4px 6px;
  border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink);
  font-size: .8125rem; line-height: 1.25; text-align: left;
}
.aic-sent__file.is-busy { opacity: .55; }
.aic-sent__ic {
  flex: none; display: grid; place-items: center; width: 30px; height: 30px;
  border-radius: 8px; background: var(--sunken); color: var(--ink-soft);
}
.aic-sent__n { min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aic-sent__s { flex: none; color: var(--ink-mute); white-space: nowrap; }
@media (pointer: coarse) { .aic-sent__file { min-height: var(--tap); } }

/* A file Claude made: a card in the answer, with Download for who may download. */
.aic-made { display: grid; gap: var(--s2); }
.aic-file {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: var(--s2) var(--s3);
  padding: var(--s2) var(--s3) var(--s2) var(--s2);
  border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface);
  box-shadow: var(--shadow-soft);
  animation: aicPop var(--dur-2) var(--ease-out) both;
}
.aic-file__ic {
  display: grid; place-items: center; width: 42px; height: 42px;
  border-radius: 10px; background: var(--red-wash); color: var(--red-ink);
}
.aic-file__id { min-width: 0; display: grid; gap: 1px; }
.aic-file__n { font-weight: 600; line-height: 1.3; color: var(--ink); overflow-wrap: anywhere; }
.aic-file__s { color: var(--ink-mute); font-size: var(--fs-sm); line-height: 1.3; }
.aic-file__dl { gap: 6px; }
.aic-file__no { grid-column: 1 / -1; margin: 0; color: var(--ink-mute); font-size: var(--fs-sm); line-height: 1.4; }
@media (max-width: 359px) {
  .aic-file { grid-template-columns: auto minmax(0, 1fr); }
  .aic-file__dl { grid-column: 1 / -1; justify-self: start; }
}

/* A picture of a message, opened large. */
.aic-pic__box { display: grid; place-items: center; min-height: 120px; }
.aic-pic__img { display: block; max-width: 100%; max-height: 68vh; border-radius: var(--r-md); }

/* ---------- the chat in a tab of its own (12 Nov 2026, decision 483): js/views/chat.js ----------
   The page is the chat: the layout of full screen, with no entrance, the
   Hub's name beside Claude's, and Close (it closes the tab). */
.aic.is-tab .aic-panel { animation: none; }
.aic-head__hub {
  margin: 0 0 0 var(--s1); padding-left: var(--s3); border-left: 1px solid var(--ll-coal-line);
  color: var(--ll-mist); font: 600 .8125rem/1.6 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
@media (min-width: 600px) {
  .aic.is-tab .aic-ibtn--shut { padding: 0 var(--s3) 0 var(--s2); }
  .aic.is-tab .aic-ibtn--shut .aic-ibtn__t { display: inline; }
}
@media (max-width: 599px) {
  .aic-head__hub { display: none; }
}

/* ---------- Admin, Settings, AI apps: the card "Claude in the Hub" ---------- */

.aic-adm { display: grid; gap: var(--s4); }
.aic-adm > * { min-width: 0; }
.aic-adm__head { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; }
.aic-adm__title { margin: 0; flex: 1 1 auto; display: flex; align-items: center; gap: var(--s3); font-size: var(--fs-h3); }
.aic-adm__title .aic-tile { width: 32px; height: 32px; }
.aic-adm__state {
  display: inline-flex; align-items: center; gap: 6px; min-height: 26px; padding: 0 10px;
  border-radius: var(--r-pill); background: var(--neutral-bg); color: var(--ink-soft);
  font: 600 .8125rem/1 var(--font-display); letter-spacing: .08em; text-transform: uppercase;
}
.aic-adm__state::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ink-disabled); }
.aic-adm__state.is-on { background: var(--success-bg); color: var(--success-ink); }
.aic-adm__state.is-on::before { background: var(--success); }
.aic-adm__part { display: grid; gap: var(--s3); padding-top: var(--s4); border-top: 1px solid var(--line); }
.aic-adm__part > .field, .aic-adm__part > .adm-choice { margin-bottom: 0; }
.aic-adm__h3 { margin: 0; font-size: var(--fs-lg); }
.aic-adm__key { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2) var(--s3); }
.aic-adm__end { display: inline-flex; align-items: center; gap: var(--s2); font-weight: 600; }
.aic-adm__end svg { color: var(--success); }
.aic-adm__part > .field .pw { max-width: 32rem; }
.aic-adm__nums { display: grid; align-items: start; gap: var(--s3) var(--s4); grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.aic-adm__nums .field { margin-bottom: 0; }
.aic-adm__nums .input { max-width: 12rem; }
.aic-adm__use { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
.aic-adm__use .tbl td, .aic-adm__use .tbl th { white-space: nowrap; }
.aic-adm__use .tbl .num { text-align: right; }
.aic-adm__use .tbl tfoot td { font-weight: 600; border-top: 1px solid var(--line-strong); border-bottom: 0; background: var(--sunken); }

/* ---------- keyframes, motion, contrast, print ---------- */

@keyframes aicSpin { to { transform: rotate(360deg); } }
@keyframes aicOpen { from { opacity: 0; transform: translateY(-10px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes aicFull { from { opacity: 0; transform: scale(.985); } to { opacity: 1; transform: none; } }
@keyframes aicSlide { from { opacity: 0; transform: translateX(-14px); } to { opacity: 1; transform: none; } }
@keyframes aicPop { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }
@keyframes aicRise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes aicCaret { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
@keyframes aicShimmer { from { background-position: 100% 0; } to { background-position: -160% 0; } }
@keyframes aicGlow { 0%, 100% { box-shadow: 0 0 0 0 rgb(200 25 27 / .45); } 60% { box-shadow: 0 0 0 6px rgb(200 25 27 / 0); } }

@media (prefers-reduced-motion: reduce) {
  .top__ai:hover .top__ai-core, .top__ai:focus-visible .top__ai-core { transform: none; }
  .top__ai.is-working .top__ai-core { animation: none; }
  .aic-think > span { background: none; color: var(--ink-mute); }
  .aic-caret { opacity: .6; }
}

@media (forced-colors: active) {
  .aic-panel, .aic-tool, .aic-slip, .aic-sug, .aic-compose__box { border: 1px solid CanvasText; }
  .aic-send, .top__ai-dot { border: 1px solid ButtonText; }
}

@media print {
  .aic { display: none !important; }
}
html.is-solo .aic { display: none !important; }

/* ---------- the chat with Claude in a tab of its own (12 Nov 2026, decision 483) ----------
   Only the chat (html.is-chat-tab, set by views/chat.js): no top bar, no
   menu, no bottom bar, no reminder window and no bubble of the page. */
html.is-chat-tab .top, html.is-chat-tab .side, html.is-chat-tab .scrim, html.is-chat-tab .tabbar, html.is-chat-tab .rmd { display: none !important; }
html.is-chat-tab body > .aic { display: none !important; }

/* ---------- a Word, Excel or PowerPoint file in the editor (24 Nov 2026, decision 520) ----------
   Only the editor (html.is-office-tab, set by views/office.js): a thin bar with the
   file's name and Close, and Collabora Online filling the rest of the tab. */
html.is-office-tab .top, html.is-office-tab .side, html.is-office-tab .scrim, html.is-office-tab .tabbar,
html.is-office-tab .rmd, html.is-office-tab body > .aic { display: none !important; }
.ofc { position: fixed; inset: 0; z-index: var(--z-panel); display: flex; flex-direction: column; background: var(--bg); }
.ofc__bar {
  flex: none; display: flex; align-items: center; gap: var(--s2); min-height: 48px;
  padding: 0 var(--s2) 0 var(--s3); padding-top: env(safe-area-inset-top, 0px);
  background: var(--chrome-bg); color: var(--chrome-text);
}
.ofc__name { flex: 1; min-width: 0; margin: 0; font: 600 var(--fs-body)/1.2 var(--font-body); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ofc__mode { flex: none; color: var(--chrome-soft); font-size: var(--fs-sm); }
.ofc__frame { flex: 1; width: 100%; min-height: 0; border: 0; background: var(--paper); }
.ofc__wait { flex: 1; display: grid; place-content: center; justify-items: center; gap: var(--s3); color: var(--ink-soft); }

/* ---------- the red flow (Jose's mock-up of 16 Nov 2026, core/flow-art.js) ----------
   Three ribbons of red and three thin bright lines, waves along one track
   from the bottom left corner of the window to the top right one, moving
   slowly as one (decisions 502 and 503; Franro: "corner to corner behind
   everything not obscuring anything"). Home lays it down (mountPageFlow())
   and takes it away again. It is a fixed layer under everything (z-index
   -1, over the page's own colour only): while it is there the content and
   the black menu are open to it, and the layer itself paints the menu's
   coal on the left, so the flow runs on under the menu items. Cards, the
   top bar, the band's words and the weather card stand on top of it.
   Colours by tokens only (--flow-*, a day and a night value). A picture only. */

.pgflow { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.pgflow__track {
  position: absolute; left: 50%; top: 50%;
  width: var(--pgflow-len, 150vw); height: clamp(260px, 38vh, 420px);
  overflow: hidden;
  transform: translate(-50%, -50%) rotate(var(--pgflow-angle, -30deg));
}
.pgflow__track > .flow {
  position: absolute; top: 0; left: 0; width: 200%; max-width: none; height: 100%;
  animation: pgFlow 48s linear infinite;
  will-change: transform;
}
/* Along the track from the bottom left to the top right, by one track-length, then again. */
@keyframes pgFlow { from { transform: translateX(-50%); } to { transform: translateX(0); } }
html.has-pgflow .content { background: transparent; }
@media (min-width: 960px) {
  html.has-pgflow .side { background: transparent; }
  .pgflow { background: linear-gradient(90deg, var(--rail-bg) 0, var(--rail-bg) var(--side-w), transparent var(--side-w)); }
}
@media (prefers-reduced-motion: reduce) {
  .pgflow__track > .flow { animation: none; transform: translateX(-25%); }
}

.flow { pointer-events: none; }
.flow__ribbon--back { fill: var(--flow-back); }
.flow__ribbon--mid { fill: var(--flow-mid); }
.flow__ribbon--front { fill: var(--flow-front); }
.flow__lines path { fill: none; stroke: var(--flow-line); stroke-width: 1.2; stroke-linecap: round; }
@media (forced-colors: active) { .pgflow { display: none; } }
@media print { .pgflow { display: none; } }
