/* Apollo — companion app styles.
   The Giorgetti MATRIX register (Italo Lupi): paper-white ground, ink-black
   type, hairline rules, italic Fraunces titles sitting ON a hard hairline
   (never text-underline), Karla for UI text, Sometype Mono for eyebrows and
   figures. Color appears ONLY as tiny chips of Apollo amber and IKB blue.
   Colors come from the storefront's tokens.css verbatim; --amber is the one
   app-local addition (the storefront never tokenized its brand amber). */

:root {
  --mono: 'Sometype Mono', ui-monospace, monospace;
  --sans: 'Karla', system-ui, sans-serif;
  --serif: 'Fraunces', serif;
  --amber: #eb9f37;

  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --sar: env(safe-area-inset-right, 0px);
  --sal: env(safe-area-inset-left, 0px);
  /* visualViewport-driven geometry; main.js keeps both current. The shell is
     fixed, and `position: fixed` resolves against the LAYOUT viewport — which
     iOS does not shrink for the keyboard. Instead it shrinks the VISUAL
     viewport and scrolls it down to reveal the focused field, so a shell
     pinned to the layout viewport slides off the top of the screen. --vvh is
     the visible height, --vvo the visual viewport's offset within the layout
     viewport; every fixed layer offsets by --vvo to ride the visible area. */
  --vvh: 100dvh;
  --vvo: 0px;
  /* Layout-viewport space below the visible area (the keyboard). */
  --vvb: 0px;
  /* Bottom safe area, but zero while the keyboard is up: the home indicator
     is behind the keyboard, so reserving for it would leave a dead gap. */
  --sab-live: var(--sab);
  /* The fixed top banner (storefront nav port): 52px bar + the notch. */
  --topnav-h: calc(var(--sat) + 52px);
}

* { box-sizing: border-box; }

/* The screens/sign-in set display:flex|grid, which would otherwise defeat the
   hidden attribute. */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--paper);
  color: var(--ink);
  overscroll-behavior: none;
}

body {
  font: 15px/1.5 var(--sans);
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  /* App, not page: no double-tap or pinch zoom (panning/scrolling unaffected;
     the preview canvas keeps its own touch-action for orbit gestures), and no
     long-press text selection or iOS callout on UI chrome — content that's
     genuinely copyable opts back in below. */
  touch-action: manipulation;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

/* Real content stays selectable/copyable: message + mail bodies, order
   facts (emails, tracking numbers), and anything being typed. */
input, textarea, .msg-body, .mail-text, .mail-msg-head, .kv dd {
  -webkit-user-select: text;
  user-select: text;
}

em { font-family: var(--serif); font-style: italic; } /* Karla has no italic */

h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }

button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }

/* ---- shared vocabulary ---- */

.kicker {
  display: block;
  font: 500 10px/1.3 var(--mono);
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--ikb);
  margin-bottom: 10px;
}

.rule { height: 1px; background: var(--line-dark); border: 0; margin: 0; }

.screen-head {
  padding: 16px calc(var(--sar) + 20px) 12px calc(var(--sal) + 20px);
  border-bottom: 1px solid var(--line-dark);
  background: var(--paper);
}
.screen-head h1 {
  margin: 0;
  font: italic 350 34px/1.02 var(--serif);
  letter-spacing: -.015em;
}
.screen-head .head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }

.eyebrow-note { font: 10px/1.4 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }

.btn {
  display: inline-block;
  padding: 10px 20px;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  font: 500 12px/1.2 var(--mono);
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  text-align: center;
}
.btn { transition: background-color .12s ease, color .12s ease, transform .12s ease, opacity .12s ease; }
.btn.is-pressed { transform: scale(.96); }
.btn.ghost { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 1px var(--line-dark); }
/* Press/hover feedback: outline buttons fill ink and go paper-white; solid
   buttons dim slightly so the press reads without inverting. */
.btn.ghost.is-pressed { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
.btn:not(.ghost).is-pressed { opacity: .75; }
@media (hover: hover) {
  .btn.ghost:hover { background: var(--ink); color: var(--paper); box-shadow: inset 0 0 0 1px var(--ink); }
  .btn:not(.ghost):hover { opacity: .85; }
}
.btn.danger { background: var(--red); }
.btn.danger.ghost.is-pressed { background: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.small { padding: 7px 14px; font-size: 10px; }
.btn:disabled { opacity: .4; }

input, textarea, select {
  font: 16px/1.4 var(--sans); /* ≥16px: no iOS focus zoom */
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 10px 12px;
  width: 100%;
  appearance: none;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--ink); }
label.field { display: block; margin: 0 0 12px; }
label.field > span {
  display: block;
  font: 10px/1.4 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 5px;
}

/* Tiny chips — the only color in the app. */
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; vertical-align: 1px; }
.dot.ikb { background: var(--ikb); }
.dot.amber { background: var(--amber); }

/* Status vocabulary rhymes with the desktop panel; re-voiced as ink-on-paper
   pills with a colored chip instead of tinted backgrounds. */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font: 11px/1 var(--mono);
  letter-spacing: .06em;
  padding: 4px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  white-space: nowrap;
  color: var(--ink-dim);
}
.tag::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-faint); }
.tag.paid::before, .tag.delivered::before, .tag.completed::before, .tag.active::before, .tag.unused::before { background: var(--green); }
.tag.printing::before, .tag.busy::before, .tag.shipped::before, .tag.label_created::before, .tag.printed::before, .tag.sliced::before, .tag.assigned::before { background: var(--ikb); }
.tag.pending::before, .tag.authorized::before, .tag.awaiting_clearance::before, .tag.paused::before, .tag.queued::before { background: var(--amber); }
.tag.failed::before, .tag.error::before, .tag.offline::before, .tag.refunded::before, .tag.cancelled::before, .tag.expired::before, .tag.revoked::before, .tag.aborting::before { background: var(--red); }

.mono { font-family: var(--mono); }
.dim { color: var(--ink-dim); }
.faint { color: var(--ink-faint); }
.num { font-variant-numeric: tabular-nums; }

/* ---- sign-in ---- */

#signin {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: calc(var(--sat) + 24px) 24px calc(var(--sab) + 24px);
}
.signin-inner { display: grid; justify-items: center; gap: 44px; }
.signin-mark { width: 118px; color: var(--ink); }

/* ---- shell: top banner + screens ---- */

#screens {
  position: fixed;
  left: 0;
  right: 0;
  top: calc(var(--vvo) + var(--topnav-h));
  height: calc(var(--vvh) - var(--topnav-h));
}
.screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.screen-body {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 calc(var(--sar) + 20px) calc(var(--sab-live) + 24px) calc(var(--sal) + 20px);
}

/* The top banner, ported from the storefront's nav.js: fixed frosted-paper
   bar, brand mark left, centered hamburger that morphs to an X and drops a
   panel of section rows in the Gallery register. */
#topnav {
  position: fixed;
  top: var(--vvo);
  left: 0;
  right: 0;
  z-index: 40;
  height: var(--topnav-h);
  padding-top: var(--sat);
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(250, 248, 244, 0.92);
  -webkit-backdrop-filter: blur(10px) saturate(118%);
  backdrop-filter: blur(10px) saturate(118%);
  border-bottom: 1px solid var(--line-dark);
  font-family: var(--mono);
}
#topnav-logo {
  position: absolute;
  left: calc(var(--sal) + 14px);
  top: calc(var(--sat) + 26px);
  transform: translateY(-50%);
  display: block;
  padding: 5px 8px;
  line-height: 0;
  color: var(--ink);
}
#topnav-logo svg { display: block; height: 34px; width: auto; overflow: visible; }
.tnav-logo-st {
  fill: none; stroke: currentColor; stroke-width: 9;
  stroke-linecap: round; stroke-linejoin: round;
}
.tnav-logo-sun { fill: none; stroke: var(--amber); stroke-width: 9; stroke-linecap: round; }
.tnav-logo-dot { fill: var(--amber); }
#topnav-burger {
  position: relative;
  padding: 14px;
  color: var(--ink);
  line-height: 0;
  transition: color .15s ease;
}
#topnav-burger.is-pressed { color: var(--ikb); }
.tnav-bars { display: inline-flex; flex-direction: column; gap: 5px; width: 23px; }
.tnav-bars > span {
  display: block;
  height: 2px;
  background: currentColor;
  border-radius: 1px;
  transition: transform 240ms cubic-bezier(.5,.05,.2,1), opacity 160ms ease;
  transform-origin: 50% 50%;
}
#topnav-burger.is-open .tnav-bars > span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
#topnav-burger.is-open .tnav-bars > span:nth-child(2) { opacity: 0; transform: scaleX(0); }
#topnav-burger.is-open .tnav-bars > span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
/* Attention dot on the closed burger: something inside the menu is unread. */
.tnav-dot {
  position: absolute;
  top: 10px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ikb);
}
.tnav-dot.amber { background: var(--amber); }
#topnav-burger.is-open .tnav-dot { opacity: 0; }
/* Account button: top-right, the slot the storefront gives its cart. */
#topnav-account {
  position: absolute;
  right: calc(var(--sar) + 14px);
  top: calc(var(--sat) + 26px);
  transform: translateY(-50%);
  padding: 9px 10px;
  color: var(--ink);
  line-height: 0;
  transition: color .15s ease;
}
#topnav-account.is-pressed, #topnav-account.is-open { color: var(--ikb); }
#topnav-account svg {
  display: block;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* Transparent containers — fill + separators live on the rows (storefront
   nav.js pattern) so they fade WITH the rows on close. */
.tnav-panel {
  position: absolute;
  top: calc(100% + 1px);
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0s linear .26s;
}
.tnav-panel.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.tnav-item {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 50px;
  padding: 0 16px;
  font: 400 13px/1 var(--mono);
  letter-spacing: .22em;
  text-indent: .22em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink);
  border-top: 1px solid var(--line);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(.5,.05,.2,1),
              background .15s ease, color .15s ease;
}
.tnav-panel > :first-child { border-top: none; }
.tnav-panel > :last-child { border-bottom: 1px solid var(--line); }
.tnav-panel.is-open .tnav-item { opacity: 1; transform: translateY(0); }
.tnav-panel.is-open > :nth-child(2) { transition-delay: 45ms; }
.tnav-panel.is-open > :nth-child(3) { transition-delay: 90ms; }
.tnav-panel.is-open > :nth-child(4) { transition-delay: 135ms; }
.tnav-panel.is-open > :nth-child(5) { transition-delay: 180ms; }
.tnav-item.is-pressed { background: var(--panel); color: var(--ikb); }
.tnav-item[aria-current="true"] { color: var(--ikb); font-weight: 500; }
/* The rail's bespoke section glyphs, riding beside the row labels. */
.tnav-glyph {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-right: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.tnav-glyph--admin { stroke-width: 11; }
.tnav-glyph--admin .tnav-glyph-sun { fill: currentColor; stroke: none; }
/* Account panel: identity row above the sign-out row. */
.tnav-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 50px;
  padding: 10px 16px;
  background: var(--paper);
  opacity: 0;
  transform: translateY(-8px);
  transition: opacity 240ms ease, transform 240ms cubic-bezier(.5,.05,.2,1);
}
.tnav-panel.is-open .tnav-info { opacity: 1; transform: translateY(0); }
.acct-name { font: 500 12px/1 var(--mono); letter-spacing: .2em; text-indent: .2em; text-transform: uppercase; }
.acct-email { font: 11px/1.3 var(--mono); letter-spacing: .06em; color: var(--ink-dim); }
.tnav-chip {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ikb);
  margin-left: 9px;
  /* cancel the letter-spacing indent so the pair still reads centered */
  margin-right: -.22em;
}
.tnav-chip.amber { background: var(--amber); }

/* ---- generic list rows (hairline-separated, editorial) ---- */

.rows { margin: 0; padding: 0; list-style: none; }
.row {
  display: block;
  width: 100%;
  text-align: left;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
}
.row.is-pressed { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.row-top { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.row-title { font-weight: 700; }
.row-sub { color: var(--ink-dim); font-size: 13px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; }
.row-when { font: 11px/1.4 var(--mono); color: var(--ink-faint); white-space: nowrap; font-variant-numeric: tabular-nums; }

.empty {
  padding: 44px 8px;
  text-align: center;
  color: var(--ink-faint);
}
.empty .kicker { color: var(--ink-faint); }

.section-label {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin: 26px 0 4px;
  font: 500 10px/1.3 var(--mono);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-dim);
}
.section-label::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* ---- messenger ---- */

.msg-list { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 12px calc(var(--sar) + 20px) 8px calc(var(--sal) + 20px); }
.msg {
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.msg-meta {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font: 10px/1.4 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-bottom: 3px;
}
.msg-body { white-space: pre-wrap; word-wrap: break-word; }
.msg.pending { opacity: .45; }
.msg.queued .msg-meta::after { content: 'queued — will retry'; color: var(--amber); letter-spacing: .08em; }
.msg-photos { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.msg-photos img {
  width: 108px; height: 108px; object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel);
}
.composer {
  border-top: 1px solid var(--line-dark);
  background: var(--paper);
  padding: 8px calc(var(--sar) + 12px) calc(var(--sab-live) + 8px) calc(var(--sal) + 12px);
  display: flex;
  gap: 8px;
  align-items: flex-end;
}
.composer textarea {
  flex: 1;
  border: 1px solid var(--line);
  background: var(--panel);
  resize: none;
  max-height: 7.5rem;
  padding: 9px 12px;
}
.composer .icon-btn {
  width: 40px; height: 40px;
  display: grid; place-items: center;
  color: var(--ink);
  flex-shrink: 0;
}
.composer .icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.composer .send-btn { color: var(--paper); background: var(--ink); border-radius: 50%; }
.composer .send-btn:disabled { opacity: .35; }
.compose-previews { display: flex; gap: 6px; padding: 6px calc(var(--sar) + 12px) 0 calc(var(--sal) + 12px); background: var(--paper); }
.compose-previews:empty { display: none; }
.compose-previews .pv { position: relative; }
.compose-previews img { width: 52px; height: 52px; object-fit: cover; border: 1px solid var(--line-dark); }
.compose-previews button {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: var(--paper);
  font-size: 11px; line-height: 1;
}

.photo-overlay {
  position: fixed; left: 0; right: 0; top: var(--vvo); bottom: var(--vvb); z-index: 90;
  background: var(--paper);
  display: grid; place-items: center;
  padding: calc(var(--sat) + 16px) 16px calc(var(--sab) + 16px);
}
.photo-overlay img { max-width: 100%; max-height: 100%; border: 1px solid var(--line-dark); }
.photo-overlay .close-x { position: absolute; top: calc(var(--sat) + 10px); right: 14px; font: 22px/1 var(--sans); padding: 10px; }

/* ---- subviews (thread, order detail, project…) ---- */

.subview {
  position: absolute;
  inset: 0;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.subview-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 8px calc(var(--sar) + 14px) 8px calc(var(--sal) + 6px);
  border-bottom: 1px solid var(--line-dark);
}
.subview-head .back {
  padding: 9px 10px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ikb);
}
.subview-head .sv-title {
  flex: 1;
  font: italic 350 19px/1.1 var(--serif);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* Overflowing titles drift slowly back and forth so the whole subject is
   readable; still, fitting titles never move. */
.sv-title.marquee { text-overflow: clip; }
.sv-title .marquee-inner { display: inline-block; }
.sv-title.marquee .marquee-inner {
  animation: sv-marquee 8s ease-in-out infinite alternate;
}
@keyframes sv-marquee {
  0%, 22% { transform: translateX(0); }
  78%, 100% { transform: translateX(var(--marquee-shift)); }
}
@media (prefers-reduced-motion: reduce) {
  .sv-title.marquee { text-overflow: ellipsis; }
  .sv-title.marquee .marquee-inner { animation: none; }
}
.subview-body { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 14px calc(var(--sar) + 20px) calc(var(--sab) + 24px) calc(var(--sal) + 20px); }

/* ---- inbox ---- */

.view-tabs { display: flex; gap: 0; margin-top: 12px; }
.view-tab {
  padding: 7px 16px 8px;
  font: 500 11px/1 var(--mono);
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.view-tab[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
/* Personal views | shared support queue — a hairline keeps them read as
   two territories on one rail. */
.tab-sep { width: 1px; align-self: stretch; margin: 3px 14px 4px; background: var(--line); }

/* Inbox search (spans all four sort buckets; hidden on Sent/Support). */
.mail-search { margin-top: 10px; }
.mail-search input {
  padding: 8px 12px;
  font-size: 16px; /* ≥16px: no iOS focus zoom */
}
.mail-search input::-webkit-search-cancel-button { -webkit-appearance: none; }

/* The bottom bucket bar: Inbox / red ! / blue dot / Archive. Only the Inbox
   view wears it — Support and Sent stay untouched. Selected bucket at full
   strength, the rest recede; the !/● hues are the buckets' identity, so they
   keep their color and fade by opacity only. */
.bucket-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line-dark);
  background: var(--paper);
  padding-bottom: var(--sab-live);
}
.bucket-btn {
  position: relative;
  height: 54px;
  display: grid;
  place-items: center;
  color: var(--ink);
  opacity: .4;
  transition: opacity .15s ease;
}
.bucket-btn[aria-selected="true"] { opacity: 1; }
.bucket-btn.is-pressed { opacity: .75; }
.bucket-btn svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.bucket-glyph-bang { color: var(--red); font: 700 19px/1 var(--mono); }
.bucket-glyph-dot { width: 13px; height: 13px; border-radius: 50%; background: var(--ikb); }
/* Unread chip: something new landed in this bucket. */
.bucket-chip {
  position: absolute;
  top: 10px;
  right: calc(50% - 18px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ikb);
}

/* Swipe-to-reveal actions (iOS Mail idiom): the row slides left over a strip
   of four buttons — … / ! / ● / archive. One row open at a time (inbox.js). */
.swipe-li { position: relative; overflow: hidden; }
.swipe-li .mail-row {
  position: relative;
  z-index: 1;
  background: var(--paper);
  touch-action: pan-y; /* horizontal drags are ours; vertical stays scroll */
  will-change: transform;
}
.swipe-li .mail-row.snap { transition: transform .18s ease; }
.swipe-actions {
  position: absolute;
  top: 0;
  bottom: 1px; /* keep the row's hairline visible under the strip */
  right: 0;
  display: flex;
  z-index: 0;
}
.swipe-act {
  width: 56px;
  display: grid;
  place-items: center;
  border-left: 1px solid var(--line);
  background: var(--panel);
  color: var(--ink);
}
.swipe-act.is-pressed { background: color-mix(in oklab, var(--ink) 8%, var(--panel)); }
.act-more { font: 700 15px/1 var(--mono); letter-spacing: .08em; }
.act-bang { color: var(--red); font: 700 18px/1 var(--mono); }
.act-dot i { display: block; width: 12px; height: 12px; border-radius: 50%; background: var(--ikb); }
.act-archive svg {
  width: 19px;
  height: 19px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
/* A sorted row folds shut before the list re-renders. */
.swipe-li.removing {
  transition: height .18s ease, opacity .18s ease;
  height: 0 !important;
  opacity: 0;
}

/* Search results: a tiny marker says which bucket a match lives in. */
.row-bucket { font: 700 12px/1 var(--mono); margin-right: 7px; }
.row-bucket.rb-bang { color: var(--red); }
.row-bucket.rb-dot { color: var(--ikb); }
.row-bucket.rb-archive { color: var(--ink-faint); }

/* The "More" action sheet (Forward / Mark as unread). */
.sheet-overlay {
  position: fixed;
  left: 0;
  right: 0;
  top: var(--vvo);
  bottom: var(--vvb);
  z-index: 80;
  background: color-mix(in oklab, var(--ink) 30%, transparent);
  display: flex;
  align-items: flex-end;
}
.sheet {
  width: 100%;
  background: var(--paper);
  border-top: 1px solid var(--line-dark);
  padding: 0 0 calc(var(--sab-live) + 6px);
}
.sheet-title {
  padding: 14px 22px 12px;
  font: italic 350 16px/1.3 var(--serif);
  text-align: center;
  color: var(--ink-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-item {
  display: block;
  width: 100%;
  padding: 16px 22px;
  text-align: center;
  font: 500 12px/1 var(--mono);
  letter-spacing: .18em;
  text-indent: .18em;
  text-transform: uppercase;
  border-top: 1px solid var(--line);
}
.sheet-item.is-pressed { background: var(--panel); color: var(--ikb); }
.sheet-item.cancel { color: var(--ink-faint); }

.attach-row { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; }
.attach-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.attach-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--line);
  font: 12px/1.3 var(--sans);
  background: var(--panel);
  text-align: left;
}
.attach-chip > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 15rem; }
.attach-chip button { color: var(--ink-faint); font-size: 11px; }
.attach-chip--recv.is-pressed { background: color-mix(in oklab, var(--ink) 5%, var(--panel)); }

/* Read/unread: unread rows carry the IKB dot + bold sender (the mail-app
   convention); opening a thread clears Gmail's UNREAD label so rows settle
   to the quiet read state. */
.mail-row .row-title { font-weight: 400; }
.mail-row.unread .row-title { font-weight: 700; }
.mail-row.unread .row-title::before { content: ''; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--ikb); margin-right: 7px; vertical-align: 1px; }
.mail-msg { border-bottom: 1px solid var(--line); padding: 12px 0; }
.mail-msg-head { font: 11px/1.5 var(--mono); color: var(--ink-dim); margin-bottom: 6px; word-break: break-word; }
.mail-frame { width: 100%; border: 0; background: var(--panel); }
.mail-text { white-space: pre-wrap; word-wrap: break-word; }
.mail-text a { color: var(--ikb); text-underline-offset: 2px; word-break: break-all; }
.reply-box { border-top: 1px solid var(--line-dark); padding: 10px 0 0; }
.reply-box textarea { min-height: 5.5rem; margin-bottom: 8px; }
.banner {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--line-dark);
  padding: 10px 12px;
  margin: 14px 0 0;
  font-size: 13px;
}
.banner .dot { flex-shrink: 0; }

/* ---- calendar ---- */

.cal-nav { display: flex; align-items: baseline; justify-content: space-between; margin: 14px 0 8px; }
.cal-nav .cal-title { font: italic 350 20px/1 var(--serif); }
.cal-nav button { font: 500 12px/1 var(--mono); letter-spacing: .1em; padding: 8px 12px; color: var(--ikb); }
.cal-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.cal-grid th {
  font: 500 9px/1 var(--mono);
  letter-spacing: .18em;
  color: var(--ink-faint);
  text-transform: uppercase;
  padding: 6px 0;
  border-bottom: 1px solid var(--line-dark);
}
.cal-grid td {
  height: 3.1rem;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
  padding: 3px 0 0;
  text-align: center;
}
.cal-day { display: inline-grid; place-items: center; width: 26px; height: 26px; font: 12px/1 var(--mono); font-variant-numeric: tabular-nums; }
.cal-day.today { background: var(--ink); color: var(--paper); border-radius: 50%; }
.cal-day.selected:not(.today) { box-shadow: inset 0 0 0 1px var(--ink); border-radius: 50%; }
.cal-td.other { color: var(--ink-faint); }
.cal-dots { display: flex; gap: 3px; justify-content: center; margin-top: 2px; min-height: 5px; }
.cal-dots i { width: 5px; height: 5px; border-radius: 50%; }
.cal-dots i.ev { background: var(--ikb); }
.cal-dots i.tk { background: var(--amber); }

/* ---- tracker ---- */

.task {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
}
.task-check {
  width: 22px; height: 22px;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 1px;
  display: grid; place-items: center;
  color: transparent;
}
.task.done .task-check { color: var(--ink); }
.task.done .task-title { color: var(--ink-faint); text-decoration: line-through; text-decoration-thickness: 1px; }
.task-check svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.task-main { flex: 1; min-width: 0; }
.task-meta { font: 10px/1.5 var(--mono); letter-spacing: .08em; color: var(--ink-faint); display: flex; gap: 10px; flex-wrap: wrap; }
.task-meta .overdue { color: var(--red); }
.add-inline { display: flex; gap: 8px; margin: 14px 0; }
.add-inline input { flex: 1; }

/* ---- admin ---- */

.hub-row { display: flex; align-items: center; gap: 12px; }
.hub-row .row-title { font-size: 17px; }
.hub-row.disabled { color: var(--ink-faint); }
.hub-row.disabled .row-title { color: var(--ink-faint); font-weight: 400; }
.hub-note { margin-left: auto; font: 10px/1.4 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-faint); }

/* Gallery moderation photo strip (blob-hydrated, tap → overlay) */
.gal-photos { display: flex; gap: 6px; margin-top: 7px; flex-wrap: wrap; }
.gal-photos img {
  width: 84px; height: 84px; object-fit: cover;
  border: 1px solid var(--line);
  background: var(--panel);
}

/* Four aligned figures on one hairline-ruled band: equal columns, single-line
   labels, dividers inset so they read as column rules, not stray strokes. */
.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-bottom: 1px solid var(--line-dark);
  margin-top: 2px;
}
.stat-strip .stat {
  padding: 16px 8px 14px 0;
  border-right: 1px solid var(--line);
}
.stat-strip .stat + .stat { padding-left: 12px; }
.stat-strip .stat:last-child { border-right: 0; padding-right: 0; }
.stat .stat-n { font: 600 19px/1 var(--sans); font-variant-numeric: tabular-nums; }
.stat .stat-l {
  font: 9px/1 var(--mono);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin-top: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-row { display: flex; gap: 8px; margin: 14px 0 4px; }
.filter-row select { flex: 1; }

.swatch { display: inline-block; width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--line-dark); vertical-align: -2px; }

.preview-wrap { position: relative; margin: 14px 0; border: 1px solid var(--line); background: var(--panel); }
.preview-wrap canvas { display: block; width: 100%; height: 300px; touch-action: none; }
.preview-note { position: absolute; bottom: 6px; right: 8px; font: 9px/1 var(--mono); letter-spacing: .12em; color: var(--ink-faint); text-transform: uppercase; }

.kv { margin: 0; }
.kv > div { display: flex; justify-content: space-between; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.kv dt { font: 10px/1.6 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--ink-faint); }
.kv dd { margin: 0; text-align: right; word-break: break-word; }

.action-grid { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }

.pcard { border: 1px solid var(--line); padding: 12px; margin: 0 0 10px; background: var(--panel); }
.pcard.attention { border-color: var(--red); }
.pcard.offline { opacity: .6; }
.pcard-top { display: flex; align-items: center; gap: 8px; }
.pcard-name { font-weight: 700; }
.pcard-tags { margin-left: auto; display: flex; gap: 5px; }
.pbar { height: 4px; background: var(--line); margin: 10px 0 4px; }
.pbar > span { display: block; height: 100%; background: var(--ikb); }
.pcard-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* Per-printer settings controls (color/nozzle/spool + gear panel) */
.pcard-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.pcard-grid .field, .spool-row .field { margin: 0; }
.spool-row { display: flex; gap: 8px; align-items: flex-end; margin-top: 10px; }
.cam-frame { width: 100%; margin-top: 10px; border: 1px solid var(--line-dark); background: var(--panel); }
.pcal-panel { border: 1px solid var(--line-dark); padding: 12px; margin: 10px 0; background: var(--paper); }
.pcal-row { display: flex; align-items: center; gap: 9px; padding: 7px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.pcal-row input { width: 17px; height: 17px; accent-color: var(--ikb); }
/* Quiet destructive outline (Remove): red hairline, not a solid slab */
.btn.danger.ghost { background: transparent; color: var(--red); box-shadow: inset 0 0 0 1px var(--red); }
.btn.danger.ghost.is-pressed { background: var(--red); color: var(--paper); }

/* Codes: status + uses stacked on the right so redemption state reads at a
   glance ("did they use it?" without parsing a sentence). */
.code-right { display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.code-uses { font: 600 14px/1 var(--mono); color: var(--ink); }
.code-uses .of { color: var(--ink-faint); font-weight: 400; padding: 0 1px; }
.code-uses.maxed { color: var(--ink-faint); }

.warn-block { border: 1px solid var(--red); padding: 12px; margin: 14px 0; }
.warn-block .kicker { color: var(--red); }

/* ---- toast ---- */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--vvb) + var(--sab-live) + 22px);
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--paper);
  font: 500 11px/1.3 var(--mono);
  letter-spacing: .1em;
  padding: 10px 18px;
  border-radius: 999px;
  z-index: 100;
  max-width: 84vw;
  text-align: center;
}

.spin {
  margin: 34px auto;
  width: 18px; height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .spin { animation-duration: 1.6s; }
  .btn.is-pressed { transform: none; }
  .tnav-bars > span, .tnav-item, .tnav-info { transition-duration: 0s; }
}
