/* ClayGen support portal.
   One stylesheet, no build step. Colours are set once as tokens (light first, dark below, following the
   device's own setting); everything else refers to the tokens. The top bar and the greeting band stay
   charcoal in both themes, because the logo is drawn for a dark background. */

/* ------------------------------------------------------------------ tokens */

:root {
  color-scheme: light dark;

  --brand: #1695e8;            /* ClayGen blue */
  --charcoal: #15181c;         /* ClayGen charcoal: the top bar */
  --charcoal-2: #1c2127;

  --bg: #f3f5f8;
  --surface: #ffffff;
  --surface-2: #f6f8fa;
  --ink: #15181c;
  --ink-2: #3c4651;
  --muted: #5d6875;
  --line: #e3e7ec;
  --line-strong: #cdd4dc;

  --brand-solid: #0d76c2;      /* buttons: white text on it passes AA */
  --brand-solid-hover: #0b68ab;
  --on-brand: #ffffff;
  --brand-ink: #0b69b0;        /* links and blue text on light surfaces */
  --focus: #1695e8;

  --blue-bg: #e6f3fd;    --blue-ink: #0a5c9c;    --blue: #1695e8;
  --amber-bg: #fff3d6;   --amber-ink: #7a4d00;   --amber: #e0900a;
  --green-bg: #e2f5e9;   --green-ink: #17633a;   --green: #1f9d57;
  --red-bg: #fde9e7;     --red-ink: #a02b1a;     --red: #d2412e;
  --neutral-bg: #eceff3; --neutral-ink: #47525f; --neutral: #8b97a5;

  --avatar-bg: #5d6875;  --avatar-ink: #ffffff;   /* a colleague's initials */

  --shadow-1: 0 1px 2px rgba(21, 24, 28, .05), 0 1px 1px rgba(21, 24, 28, .03);
  --shadow-2: 0 1px 2px rgba(21, 24, 28, .05), 0 12px 28px -14px rgba(21, 24, 28, .18);
  --shadow-3: 0 18px 50px -12px rgba(21, 24, 28, .35);

  --radius: 16px;
  --radius-s: 10px;
  --bar: 64px;                 /* height of the top bar */
  --tabs: 0px;                 /* height of the phone's bottom menu (set below) */

  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, "Helvetica Neue", Roboto, Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0e1114;
    --surface: #171b20;
    --surface-2: #1d2228;
    --ink: #eef1f4;
    --ink-2: #c6ced6;
    --muted: #94a0ad;
    --line: #262c34;
    --line-strong: #364049;

    --brand-solid: #1695e8;    /* bright blue with dark text reads better on dark surfaces */
    --brand-solid-hover: #3aa6ee;
    --on-brand: #04121d;
    --brand-ink: #62bbf6;
    --focus: #62bbf6;

    --blue-bg: #0f2a40;    --blue-ink: #86c9f9;
    --amber-bg: #38290a;   --amber-ink: #ffd27a;
    --green-bg: #112e1e;   --green-ink: #7fdca4;
    --red-bg: #3a1612;     --red-ink: #ffa193;
    --neutral-bg: #232931; --neutral-ink: #b5bfca;

    --avatar-bg: #3a444f;  --avatar-ink: #e3e8ee;

    --shadow-1: none;
    --shadow-2: none;
    --shadow-3: 0 18px 50px -12px rgba(0, 0, 0, .7);
  }
}

/* A tone is chosen by class and read through these three variables. */
.blue    { --tone-bg: var(--blue-bg);    --tone-ink: var(--blue-ink);    --tone: var(--blue); }
.amber   { --tone-bg: var(--amber-bg);   --tone-ink: var(--amber-ink);   --tone: var(--amber); }
.green   { --tone-bg: var(--green-bg);   --tone-ink: var(--green-ink);   --tone: var(--green); }
.red     { --tone-bg: var(--red-bg);     --tone-ink: var(--red-ink);     --tone: var(--red); }
.neutral { --tone-bg: var(--neutral-bg); --tone-ink: var(--neutral-ink); --tone: var(--neutral); }

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--bar) + 16px); }
body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-wrap: break-word;
}

h1, h2, h3, p, ul, ol, dl, dd, figure, blockquote, fieldset { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
img, svg, canvas { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--brand-ink); text-decoration: none; }
a:hover { text-decoration: underline; }

h1 { font: 700 1.75rem/1.2 var(--font-display); letter-spacing: -.02em; }
h2 { font: 650 1.08rem/1.3 var(--font-display); letter-spacing: -.01em; }
h3 { font: 650 1rem/1.3 var(--font); }
/* Headings take focus after navigation (for screen readers); they are not controls, so no ring. */
h1[tabindex="-1"]:focus { outline: none; }

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}
.muted { color: var(--muted); }
.small { font-size: .86rem; }
.strong { font-weight: 650; }
.mono { font-family: var(--mono); font-size: .92em; }
.sep { margin: 0 .5em; color: var(--line-strong); }
.urgent { color: var(--red-ink); font-weight: 600; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }

.icon { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px;
  border: 1px solid transparent; border-radius: var(--radius-s);
  background: none; color: var(--ink);
  font-weight: 600; font-size: .95rem; line-height: 1.2; text-decoration: none; white-space: nowrap;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease, transform .08s ease, box-shadow .15s ease;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: default; transform: none; }
.btn .icon { width: 18px; height: 18px; }

.btn.primary { background: var(--brand-solid); color: var(--on-brand); box-shadow: 0 1px 2px rgba(13, 118, 194, .35); }
.btn.primary:hover:not(:disabled) { background: var(--brand-solid-hover); }
.btn.ghost { background: var(--surface); border-color: var(--line-strong); }
.btn.ghost:hover:not(:disabled) { background: var(--surface-2); border-color: var(--muted); }
.btn.tint { background: var(--blue-bg); color: var(--blue-ink); }
.btn.tint:hover:not(:disabled) { background: color-mix(in srgb, var(--brand) 26%, var(--surface)); }
.btn.quiet { color: var(--brand-ink); padding: 0 12px; }
.btn.quiet:hover:not(:disabled) { background: var(--blue-bg); }
.btn.danger { background: var(--red); color: #fff; }
.btn.danger:hover:not(:disabled) { filter: brightness(.93); }
.btn.danger-text { color: var(--red-ink); }
.btn.small { min-height: 38px; padding: 0 14px; font-size: .9rem; }
.btn.quiet.small { padding: 0 10px; }
.btn.large { min-height: 52px; padding: 0 26px; font-size: 1.04rem; border-radius: 12px; }
.btn.large .icon { width: 20px; height: 20px; }
.btn.block { display: flex; width: 100%; }
.btn.on-dark { background: rgba(255, 255, 255, .06); border-color: rgba(255, 255, 255, .22); color: #fff; }
.btn.on-dark:hover:not(:disabled) { background: rgba(255, 255, 255, .13); border-color: rgba(255, 255, 255, .4); }

.spinner {
  width: 16px; height: 16px; flex: none; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ------------------------------------------------------------------ the frame: top bar, menu, footer */

.shell { min-height: 100dvh; display: flex; flex-direction: column; }
.main { flex: 1; outline: none; }

.skip {
  position: fixed; top: 8px; left: 8px; z-index: 100; padding: 10px 16px;
  background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  font-weight: 600; transform: translateY(-200%);
}
.skip:focus { transform: none; }

.topbar { position: sticky; top: 0; z-index: 30; background: var(--charcoal); color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .07); }
.topbar-in { display: flex; align-items: center; gap: 28px; height: var(--bar); max-width: 1168px; margin: 0 auto; padding: 0 24px; }
.topbar :focus-visible { outline-color: #7cc4f8; }
.brand { display: flex; align-items: center; flex: none; border-radius: 8px; }
.brand img { height: 40px; width: auto; }

.nav { display: flex; align-items: stretch; gap: 4px; height: 100%; flex: 1; min-width: 0; }
.nav .nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 8px; padding: 0 14px;
  color: rgba(255, 255, 255, .72); font-weight: 600; font-size: .95rem; text-decoration: none;
  transition: color .15s ease;
}
.nav .nav-link::after {
  content: ""; position: absolute; left: 14px; right: 14px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0;
  background: var(--brand); transform: scaleX(0); transition: transform .2s ease;
}
.nav .nav-link:hover { color: #fff; }
.nav .nav-link[aria-current="page"] { color: #fff; }
.nav .nav-link[aria-current="page"]::after { transform: scaleX(1); }

.badge {
  display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--brand); color: #04121d; font-size: .74rem; font-weight: 700; line-height: 1;
}

.topbar-end { display: flex; align-items: center; gap: 14px; margin-left: auto; flex: none; }
.topbar .btn.primary { background: var(--brand); color: #04121d; box-shadow: none; min-height: 40px; }
.topbar .btn.primary:hover { background: #3aa6ee; }
.account { display: flex; align-items: center; gap: 10px; padding: 5px 10px 5px 5px; border-radius: 999px; color: #fff; text-decoration: none; transition: background-color .15s ease; }
.account:hover, .account[aria-current="page"] { background: rgba(255, 255, 255, .09); text-decoration: none; }
.account-text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.account-name { font-weight: 600; font-size: .88rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.account-org { font-size: .76rem; color: rgba(255, 255, 255, .6); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex: none;
  width: 40px; height: 40px; border-radius: 50%; overflow: hidden;
  background: var(--avatar-bg); color: var(--avatar-ink); font-weight: 700; font-size: .86rem; letter-spacing: .02em;
  user-select: none;
}
.avatar.small { width: 34px; height: 34px; font-size: .78rem; }
.avatar.large { width: 72px; height: 72px; font-size: 1.5rem; }
.avatar.staff { background: var(--charcoal); }
.avatar.staff img { width: 100%; height: 100%; object-fit: cover; }
.topbar .avatar { background: var(--brand); color: #04121d; }

.foot { padding: 28px 24px calc(28px + var(--tabs)); text-align: center; font-size: .86rem; color: var(--ink-2); border-top: 1px solid var(--line); }
.foot p + p { margin-top: 2px; }

/* The phone's bottom menu: hidden until the screen is narrow (see the end of the file). */
.tabbar { display: none; }

/* ------------------------------------------------------------------ pages */

.outlet { animation: page-in .28s ease both; }
@keyframes page-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.page { max-width: 1168px; margin: 0 auto; padding: 32px 24px 72px; }
.page.narrow { max-width: 800px; }

.page-head { margin-bottom: 24px; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.page-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.lead { margin-top: 6px; color: var(--ink-2); font-size: 1.02rem; max-width: 62ch; }
.eyebrow { margin-bottom: 6px; color: var(--muted); font-size: .8rem; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.back { display: inline-flex; align-items: center; gap: 6px; margin: -6px 0 14px -6px; padding: 6px 10px 6px 6px; border-radius: 8px; color: var(--ink-2); font-weight: 600; font-size: .92rem; }
.back:hover { background: var(--neutral-bg); text-decoration: none; }
.back .icon { width: 18px; height: 18px; }

.section + .section { margin-top: 28px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.more { display: inline-flex; align-items: center; gap: 2px; font-weight: 600; font-size: .92rem; white-space: nowrap; }
.more .icon { width: 16px; height: 16px; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); padding: 22px; }
.card.flush { padding: 0; overflow: hidden; }
.card + .card { margin-top: 16px; }
.card-title { margin-bottom: 14px; }
.card-foot { display: flex; align-items: center; justify-content: center; gap: 4px; padding: 14px; border-top: 1px solid var(--line); font-weight: 600; font-size: .93rem; }
.card-foot:hover { background: var(--surface-2); text-decoration: none; }
.card-foot .icon { width: 16px; height: 16px; }
.pad { padding: 20px 22px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 400px), 1fr)); gap: 16px; }
.cards .device + .device { margin-top: 0; }
.cards .card + .card { margin-top: 0; }

.pill {
  display: inline-flex; align-items: center; gap: 7px; padding: 3px 11px 3px 9px; border-radius: 999px;
  background: var(--tone-bg); color: var(--tone-ink); font-size: .8rem; font-weight: 650; line-height: 1.5; white-space: nowrap;
}
.pill-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: none; }
.tag {
  display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 6px; vertical-align: 1px;
  background: var(--neutral-bg); color: var(--neutral-ink); font-size: .72rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.tag.blue { background: var(--blue-bg); color: var(--blue-ink); }

.kv { display: grid; gap: 12px; }
.kv > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 12px; align-items: baseline; }
.kv dt { color: var(--muted); font-size: .88rem; }
.kv dd { font-weight: 500; overflow-wrap: anywhere; white-space: pre-line; }

.banner { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; border-radius: var(--radius); background: var(--tone-bg); color: var(--tone-ink); }
.banner-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 36px; height: 36px; border-radius: 50%; background: color-mix(in srgb, var(--tone) 22%, transparent); color: var(--tone-ink); }
.banner-text { flex: 1; min-width: 0; font-size: .95rem; }
.banner-title { font-weight: 700; font-size: 1rem; }
.banner .btn { flex: none; align-self: center; }

/* ------------------------------------------------------------------ empty, loading, error */

.empty { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 44px 24px; text-align: center; }
.empty h3, .empty h1 { font: 650 1.12rem/1.3 var(--font-display); }
.empty h1 { font-size: 1.5rem; }
.empty p { color: var(--muted); max-width: 46ch; }
.empty .btn { margin-top: 12px; }
.empty-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-ink); }
.empty-icon .icon { width: 26px; height: 26px; }
.empty-icon.warn { background: var(--amber-bg); color: var(--amber-ink); }

.skeleton { display: grid; gap: 14px; }
.skeleton-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--neutral-bg) 25%, color-mix(in srgb, var(--neutral-bg) 55%, var(--surface)) 45%, var(--neutral-bg) 65%);
  background-size: 300% 100%; animation: shimmer 1.4s ease-in-out infinite;
}
.skeleton-line.w1 { width: 62%; } .skeleton-line.w2 { width: 92%; } .skeleton-line.w3 { width: 78%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }

.boot { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px; background: var(--charcoal); }
.boot img { width: 220px; height: auto; }
.boot-bar { width: 120px; height: 3px; border-radius: 3px; background: rgba(255, 255, 255, .12); overflow: hidden; position: relative; }
.boot-bar::after { content: ""; position: absolute; inset: 0; width: 40%; border-radius: 3px; background: var(--brand); animation: boot 1.1s ease-in-out infinite; }
@keyframes boot { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.boot-error { min-height: 100dvh; justify-content: center; }
.noscript { max-width: 520px; margin: 15vh auto; padding: 24px; text-align: center; }

/* ------------------------------------------------------------------ forms */

/* minmax(0, 1fr): a grid column otherwise grows to fit its longest unbreakable child, pushing the form off a phone's screen. */
.form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.form-part { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.field { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; min-width: 0; align-content: start; }
legend { padding: 0; }
.field > label, .field > .label, .choices > legend, .chips-field > legend { font-weight: 650; font-size: .95rem; }
.optional { color: var(--muted); font-weight: 400; }
.field-hint { color: var(--muted); font-size: .87rem; }
.field-error { color: var(--red-ink); font-size: .9rem; font-weight: 600; }
.field-row { display: grid; grid-template-columns: 140px minmax(0, 220px); gap: 16px; }
.field-row.even { grid-template-columns: 1fr 1fr; }

.input {
  width: 100%; min-height: 46px; padding: 10px 14px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-s);
  transition: border-color .15s ease, box-shadow .15s ease;
  appearance: none; -webkit-appearance: none;
}
textarea.input { resize: vertical; min-height: 96px; line-height: 1.5; }
select.input {
  padding-right: 40px; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) 50%, calc(100% - 15px) 50%; background-size: 6px 6px; background-repeat: no-repeat;
}
.input::placeholder { color: var(--muted); opacity: .8; }
.input:hover { border-color: var(--muted); }
.input:focus, .input:focus-visible { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 28%, transparent); }
.input[aria-invalid="true"] { border-color: var(--red); }
.input[readonly] { background: var(--surface-2); color: var(--ink-2); }
input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }

.input-wrap { position: relative; }
.input-wrap .input { padding-right: 48px; }
.input-action {
  position: absolute; top: 3px; right: 3px; width: 40px; height: 40px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; border-radius: 8px; background: none; color: var(--muted);
}
.input-action:hover { color: var(--ink); background: var(--neutral-bg); }

.form-note { display: flex; align-items: flex-start; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); font-size: .94rem; font-weight: 550; }
.form-note.error { background: var(--red-bg); color: var(--red-ink); }
.form-note.ok { background: var(--green-bg); color: var(--green-ink); }
.form-note.warn { background: var(--amber-bg); color: var(--amber-ink); }
.form-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }

/* Radio buttons drawn as cards: the real input stays in place (invisible) so keyboard and screen readers work as usual. */
.choices { display: grid; gap: 10px; }
.choices-grid { display: grid; gap: 10px; }
.kinds.n3 .choices-grid { grid-template-columns: repeat(3, 1fr); }
.kinds.n2 .choices-grid { grid-template-columns: repeat(2, 1fr); }
.choices.compact .choices-grid { grid-template-columns: repeat(2, 1fr); }
.choice {
  position: relative; display: flex; gap: 12px; align-items: flex-start; padding: 16px;
  border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease;
}
.choice:hover { border-color: var(--muted); }
.choice input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--blue-bg); box-shadow: 0 0 0 1px var(--brand); }
.choice:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.kinds .choice { flex-direction: column; padding: 18px; min-height: 148px; }
.choice-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--neutral-bg); color: var(--ink-2); flex: none; }
.choice:has(input:checked) .choice-icon { background: var(--brand-solid); color: var(--on-brand); }
.choice-text { display: grid; gap: 2px; min-width: 0; padding-right: 22px; }
.kinds .choice-text { padding-right: 0; }
.choice-title { font-weight: 650; }
.choice-sub { color: var(--muted); font-size: .88rem; line-height: 1.4; }
.choice:has(input:checked) .choice-sub { color: var(--blue-ink); }
.choice-mark {
  position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line-strong); color: transparent; transition: background-color .15s ease, border-color .15s ease;
}
.choice-mark .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.choice:has(input:checked) .choice-mark { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); }

.chips-field { display: grid; gap: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-height: 40px; }
.chip { position: relative; cursor: pointer; }
.chip input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.chip span {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: var(--surface); font-weight: 550; font-size: .93rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip:hover span { border-color: var(--muted); }
.chip input:checked + span { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); }
.chip input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ------------------------------------------------------------------ toolbars: segmented choices, search */

.toolbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar:empty { display: none; }
.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--neutral-bg); transition: opacity .15s ease; }
.seg.dimmed { opacity: .45; }
.seg-option {
  display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 16px; border: 0; border-radius: 9px;
  background: none; color: var(--ink-2); font-weight: 600; font-size: .92rem; transition: background-color .15s ease, color .15s ease, box-shadow .15s ease;
}
.seg-option:hover { color: var(--ink); }
.seg-option[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.chip-toggle {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px; border-radius: 12px;
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2); font-weight: 600; font-size: .92rem;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.chip-toggle .icon { width: 18px; height: 18px; }
.chip-toggle:hover { border-color: var(--muted); }
.chip-toggle[aria-pressed="true"] { background: var(--amber-bg); border-color: var(--amber); color: var(--amber-ink); }
.search { position: relative; flex: 1 1 260px; min-width: 0; margin-left: auto; max-width: 420px; }
.search > .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-input { padding-left: 44px; border-radius: 12px; }
.list-summary { margin-top: 12px; font-size: .88rem; min-height: 1.4em; }

/* ------------------------------------------------------------------ ticket rows */

.tlist > li + li { border-top: 1px solid var(--line); }
.stale { opacity: .55; transition: opacity .2s ease .15s; }
.trow {
  position: relative; display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 4px 16px; align-items: center;
  padding: 16px 22px; color: inherit; text-decoration: none; transition: background-color .12s ease;
}
.trow:hover { background: var(--surface-2); text-decoration: none; }
.trow:focus-visible { outline-offset: -3px; border-radius: 12px; }
.trow-icon { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px; background: var(--tone-bg); color: var(--tone-ink); align-self: start; }
.trow-main { display: grid; gap: 2px; min-width: 0; }
.trow-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-preview { color: var(--ink-2); font-size: .92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-meta { color: var(--muted); font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.trow-time { color: var(--muted); font-size: .84rem; white-space: nowrap; }
.trow.unread .trow-title { font-weight: 750; }
.trow.unread::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 0 3px 3px 0; background: var(--brand); }
.unread-dot { display: inline-block; width: 9px; height: 9px; margin-right: 8px; border-radius: 50%; background: var(--brand); vertical-align: 1px; }

/* ------------------------------------------------------------------ home */

.hero {
  background:
    radial-gradient(720px 320px at 88% -20%, rgba(22, 149, 232, .34), transparent 70%),
    radial-gradient(520px 260px at 6% 120%, rgba(22, 149, 232, .14), transparent 70%),
    linear-gradient(180deg, var(--charcoal), var(--charcoal-2));
  color: #fff; border-bottom: 1px solid rgba(255, 255, 255, .06);
}
.hero-in { display: flex; align-items: flex-end; justify-content: space-between; gap: 40px; max-width: 1168px; margin: 0 auto; padding: 44px 24px 84px; }
.hero-text { min-width: 0; }
.hero-org { margin-bottom: 10px; color: #7cc4f8; font-size: .8rem; font-weight: 700; letter-spacing: .09em; text-transform: uppercase; }
.hero h1 { font-size: clamp(1.9rem, 1.3rem + 2.2vw, 2.7rem); line-height: 1.1; letter-spacing: -.03em; }
.hero-lead { margin-top: 12px; color: rgba(255, 255, 255, .76); font-size: 1.08rem; max-width: 46ch; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 26px; }
.hero :focus-visible { outline-color: #7cc4f8; }
.hero .btn.primary { background: var(--brand); color: #04121d; box-shadow: 0 8px 24px -8px rgba(22, 149, 232, .7); }
.hero .btn.primary:hover { background: #3aa6ee; }

.stats { display: flex; gap: 12px; flex: none; }
.stat {
  display: flex; flex-direction: column; justify-content: flex-end; gap: 2px; min-width: 132px; padding: 16px 18px; border-radius: 14px;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .09); color: #fff; text-decoration: none;
  transition: background-color .15s ease, border-color .15s ease, transform .15s ease;
}
.stat:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .2); text-decoration: none; transform: translateY(-2px); }
.stat-number { font: 700 2rem/1 var(--font-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat-label { color: rgba(255, 255, 255, .7); font-size: .86rem; }
.stat.amber .stat-number { color: #ffc65c; }

.page.home { margin-top: -52px; padding-top: 0; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 384px; gap: 28px; align-items: start; }
/* The first cards sit on the dark band: their headings are light there. */
.home-grid > * > .section:first-child > .section-head h2, .home-grid > * > .section:first-child > .section-head .more { color: #fff; }
.home-grid > * > .section:first-child > .section-head { min-height: 28px; }
.home-grid .card { box-shadow: var(--shadow-2); }
.caught-up { display: flex; align-items: center; gap: 16px; padding: 22px; }
.caught-up-icon { display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border-radius: 50%; background: var(--green-bg); color: var(--green-ink); flex: none; }
.caught-up-icon .icon { width: 26px; height: 26px; }
.mini-empty { display: grid; gap: 12px; justify-items: start; color: var(--ink-2); }
/* This PC (in the Support window): how the computer the person is sitting at is doing, in a line or two. */
.pc-facts { display: grid; gap: 8px; }
.pc-facts li { display: flex; gap: 10px; color: var(--ink-2); }
.pc-facts .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--tone-ink, var(--muted)); }
.device-name .tag { vertical-align: 2px; }
.tips h2 { margin-bottom: 14px; }
.tips ul { display: grid; gap: 14px; }
.tips li { display: flex; gap: 12px; color: var(--ink-2); font-size: .93rem; }
.tips .icon { color: var(--brand-ink); margin-top: 2px; }

/* ------------------------------------------------------------------ devices */

.device { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.device + .device { margin-top: 16px; }
.device-top { display: flex; align-items: center; gap: 14px; }
.device-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--blue-bg); color: var(--blue-ink); }
.device-icon .icon { width: 24px; height: 24px; }
.device-icon.large { width: 64px; height: 64px; border-radius: 18px; }
.device-icon.large .icon { width: 32px; height: 32px; }
.device-name { flex: 1; min-width: 0; }
.device-name h3 a { color: inherit; }
.device-name p { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.device-summary { color: var(--ink-2); }
.device-actions { display: flex; gap: 8px; flex-wrap: wrap; padding-top: 14px; border-top: 1px solid var(--line); }
.issues { display: grid; gap: 8px; }
.issues li { display: flex; gap: 10px; padding: 10px 12px; border-radius: var(--radius-s); background: var(--amber-bg); color: var(--amber-ink); font-size: .93rem; font-weight: 550; }
.issues .icon { width: 18px; height: 18px; margin-top: 2px; }

.disks { display: grid; gap: 12px; }
.disks h3 { font-size: .9rem; color: var(--muted); font-weight: 600; }
.disk { display: grid; gap: 6px; }
.disk-top { display: flex; justify-content: space-between; gap: 12px; font-size: .88rem; flex-wrap: wrap; }
.disk-name { font-weight: 600; }
.disk-free { color: var(--muted); }
.disk-free.warn { color: var(--amber-ink); font-weight: 600; }
.meter { display: block; height: 8px; border-radius: 4px; background: var(--neutral-bg); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: 4px; background: var(--brand); transition: width .5s ease; }
.meter-fill.warn { background: var(--amber); }
.meter-ends { display: flex; justify-content: space-between; margin-top: -4px; font-size: .82rem; }

.alist > li + li { border-top: 1px solid var(--line); }
.arow {
  /* Fixed outer columns, so "Assigned to" lines up from one row to the next. */
  display: grid; grid-template-columns: 46px minmax(0, 1.6fr) minmax(0, 1fr) 150px; gap: 4px 16px; align-items: center;
  padding: 14px 22px; color: inherit; text-decoration: none; transition: background-color .12s ease;
}
.arow:hover { background: var(--surface-2); text-decoration: none; }
.arow:focus-visible { outline-offset: -3px; border-radius: 12px; }
.arow-main { display: grid; gap: 2px; min-width: 0; }
.arow-title { font-weight: 650; }
.arow-sub { color: var(--muted); font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.arow-notes { display: flex; gap: 6px; color: var(--amber-ink); font-size: .86rem; font-weight: 550; }
.arow-notes .icon { width: 16px; height: 16px; margin-top: 2px; }
.arow-who { display: grid; min-width: 0; font-weight: 550; font-size: .94rem; }
.arow-label { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.arow-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }

.asset-head { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.asset-head-text { flex: 1; min-width: 240px; }
/* Two columns that each pack their cards tightly, whatever the cards' heights. */
.agrid { columns: 2; column-gap: 16px; }
.agrid > .card { break-inside: avoid; margin: 0 0 16px; }
.agrid:empty { display: none; }
.agrid + .section, .card + .section { margin-top: 28px; }
.asection { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-content: start; }
.asection .card-title { display: flex; align-items: center; gap: 10px; margin-bottom: 0; }
.asection-icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 10px; background: var(--neutral-bg); color: var(--ink-2); }
.asection-icon .icon { width: 18px; height: 18px; }
.headline { font: 650 1.18rem/1.3 var(--font-display); letter-spacing: -.01em; }
.headline.green, .headline.amber { color: var(--tone-ink); }
.advice { display: flex; gap: 10px; padding: 12px 14px; border-radius: var(--radius-s); background: var(--blue-bg); color: var(--blue-ink); font-size: .93rem; }
.advice .icon { width: 18px; height: 18px; margin-top: 2px; }
.secrow { display: flex; gap: 14px; }
.secrow + .secrow { padding-top: 14px; border-top: 1px solid var(--line); }
.secrow-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%; background: var(--tone-bg, var(--neutral-bg)); color: var(--tone-ink, var(--neutral-ink)); }
.software { display: grid; }
.software li { display: flex; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--line); }
.software li:first-child { border-top: 0; }
.software-name { font-weight: 550; min-width: 0; }
.software-meta { font-size: .88rem; text-align: right; flex: none; max-width: 55%; }
.asection .search { max-width: none; margin: 0; flex: none; }
.asection > .btn { justify-self: start; }
.device-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; }
.device-link .icon { width: 16px; height: 16px; }

/* ------------------------------------------------------------------ where a device is (managers; map.js, map.css) */

/* The map viewer is shared with the console; here it wears the portal's colours. */
.cgmap {
  --cgmap-surface: var(--surface); --cgmap-surface-2: var(--surface-2); --cgmap-hover: var(--surface-2); --cgmap-ink: var(--ink); --cgmap-muted: var(--muted);
  --cgmap-line: var(--line-strong); --cgmap-accent: var(--brand); --cgmap-radius: 14px; --cgmap-ground: #e6e9ed;
}
@media (prefers-color-scheme: dark) {
  .cgmap { --cgmap-ground: #23282f; --cgmap-tiles: brightness(.84) saturate(.88) contrast(1.04); }
}

.where { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
.agrid + .where, .agrid + .where-off { margin-top: 0; }
.where-off + .section { margin-top: 28px; }
.where-head { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; }
.where-head .card-title { display: flex; align-items: center; gap: 10px; margin: 0; }
.where [tabindex="-1"]:focus { outline: none; }
.where .btn[aria-disabled="true"] { cursor: default; }
.where .btn[aria-disabled="true"]:active { transform: none; }
.where-status { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.where-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 22px; align-items: start; }
.where-grid .cgmap { height: 320px; }
.where-side { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; align-content: start; }
.where-links { display: flex; flex-wrap: wrap; gap: 8px; }
.where-links .btn { flex: 1 1 auto; }
.where-links .btn .icon { width: 16px; height: 16px; }
.where .empty { padding: 28px 16px; }
/* Location is not collected for this device: one quiet line, not a card. */
.where-off { display: flex; align-items: flex-start; gap: 8px; margin: 0 4px 16px; color: var(--muted); font-size: .9rem; }
.where-off .icon { width: 17px; height: 17px; margin-top: 2px; }

/* In the manager's list: the way to a device's map, beside its row. */
.aitem { display: flex; align-items: stretch; }
.aitem .arow { flex: 1; min-width: 0; }
.arow-locate { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 56px; border-left: 1px solid var(--line); color: var(--muted); transition: background-color .12s ease, color .12s ease; }
.arow-locate:hover { background: var(--blue-bg); color: var(--blue-ink); text-decoration: none; }
.arow-locate:focus-visible { outline-offset: -3px; border-radius: 12px; }

/* ------------------------------------------------------------------ self-help (on a device's page) */

.selfhelp { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; margin-bottom: 16px; padding: 24px; border-color: color-mix(in srgb, var(--brand) 34%, var(--line)); box-shadow: var(--shadow-2); }
.selfhelp-head { display: flex; align-items: center; gap: 14px; }
.selfhelp-head h2 { font-size: 1.25rem; }
.selfhelp-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--brand-solid); color: var(--on-brand); }
.selfhelp-icon .icon { width: 24px; height: 24px; }
/* Status lines take focus when something starts or ends, so the news is read out; they are not controls, so no ring. */
.selfhelp [tabindex="-1"]:focus { outline: none; }
.sh-label { margin-bottom: 4px; color: var(--muted); font: 650 .8rem/1.4 var(--font); letter-spacing: .06em; text-transform: uppercase; }
.sh-plan { color: var(--ink-2); font-size: .95rem; }

.sh-updates { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); }
.sh-row { display: flex; align-items: center; gap: 12px 16px; flex-wrap: wrap; }
.sh-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 44px; height: 44px; border-radius: 50%; background: var(--tone-bg); color: var(--tone-ink); }
.sh-icon .icon { width: 22px; height: 22px; }
.sh-main { flex: 1 1 260px; min-width: 0; }
.sh-main .muted { margin-top: 2px; font-size: .93rem; }
.sh-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.sh-progress { display: grid; gap: 10px; color: var(--ink-2); font-size: .93rem; }
.sh-confirm { display: grid; gap: 6px; padding: 16px; border: 1px solid var(--line-strong); border-radius: var(--radius-s); background: var(--surface); }
.sh-confirm > p + p { color: var(--ink-2); font-size: .95rem; }
.sh-confirm-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* Something is under way and nobody knows for how long: a calm bar that keeps moving. */
.progress-bar { position: relative; display: block; height: 4px; border-radius: 4px; background: color-mix(in srgb, var(--brand) 20%, transparent); overflow: hidden; }
.progress-bar::after { content: ""; position: absolute; inset: 0; width: 36%; border-radius: 4px; background: var(--brand); animation: progress 1.7s ease-in-out infinite; }
@keyframes progress { from { transform: translateX(-100%); } to { transform: translateX(280%); } }

.sh-fixes { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.sh-fixes-head .muted { font-size: .93rem; }
.fixes { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); gap: 12px; }
.fix {
  display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2);
  transition: border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
/* The fix in hand: its card takes the colour of where it stands (asking or running, worked, did not work). */
.fix.blue, .fix.green, .fix.amber { border-color: var(--tone); background: color-mix(in srgb, var(--tone-bg) 60%, var(--surface)); box-shadow: 0 0 0 1px var(--tone); }
.fix-top { display: flex; align-items: center; gap: 12px; }
.fix-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-ink); }
.fix h4 { margin: 0; min-width: 0; font: 650 1rem/1.3 var(--font); }
.fix-text { color: var(--ink-2); font-size: .92rem; }
.fix-last { display: flex; gap: 8px; color: var(--tone-ink, var(--muted)); font-size: .86rem; font-weight: 550; }
.fix-last .icon { width: 16px; height: 16px; margin-top: 2px; }
/* Whatever comes last (the button, the question, the progress) sits at the foot, so a row of cards lines up. */
.fix > :last-child { margin-top: auto; padding-top: 4px; }
.fix-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.fix-state { display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; }
.fix-state .fix-actions { margin-top: 6px; }
.fix-state .progress-bar { margin-bottom: 4px; }
.fix-outcome { display: flex; gap: 8px; color: var(--tone-ink); font-weight: 650; }
.fix-outcome .icon { width: 20px; height: 20px; margin-top: 2px; }

/* ------------------------------------------------------------------ backup (on a device's page; backup.js) */

.backup { margin-bottom: 16px; }
.bk-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; }
/* The heading and the state line take focus when something starts or ends, so the news is read out; they are not controls. */
.backup [tabindex="-1"]:focus, .restore [tabindex="-1"]:focus { outline: none; }
.backup .sh-icon.neutral { background: var(--neutral-bg); color: var(--neutral-ink); }
/* The state line stays beside its icon on a phone too. */
.backup .sh-main { flex-basis: 200px; }
.backup .meter-fill { transition: width 1.2s ease; }
.bk-problem { display: flex; gap: 12px; padding: 14px 16px; border-radius: var(--radius-s); background: var(--amber-bg); color: var(--amber-ink); font-size: .95rem; }
.bk-problem > .icon { margin-top: 2px; }
.bk-problem > div { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.bk-quiet { display: flex; align-items: flex-start; gap: 8px; color: var(--muted); font-size: .92rem; }
.bk-quiet .icon { width: 17px; height: 17px; margin-top: 2px; }
.bk-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 190px), 1fr)); gap: 14px 28px; padding-top: 16px; border-top: 1px solid var(--line); }
.bk-facts dt { color: var(--muted); font-size: .76rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.bk-facts dd { margin-top: 2px; font-weight: 550; overflow-wrap: anywhere; }
.pc-link { color: inherit; text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
.pc-link:hover { color: var(--brand-ink); text-decoration-color: currentColor; }

/* Getting a file back: a window with a heading, the step in hand (which scrolls), and the way onward at the foot. */
.restore {
  width: min(720px, calc(100vw - 32px)); min-height: min(340px, calc(100dvh - 48px)); max-width: none; max-height: min(700px, calc(100dvh - 48px)); padding: 0;
  border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-3); overflow: hidden;
}
.restore[open] { display: flex; flex-direction: column; animation: toast-in .2s ease both; }
/* While there is a list to choose from, the window keeps one height, so it does not jump about as folders open. */
.restore.tall { height: min(700px, calc(100dvh - 48px)); }
.rs-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 20px 16px 16px 24px; border-bottom: 1px solid var(--line); }
.rs-head-text { min-width: 0; padding-top: 2px; }
.rs-head h2 { font-size: 1.25rem; }
.rs-head .eyebrow { margin-bottom: 4px; }
.rs-close { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border: 0; border-radius: 10px; background: none; color: var(--muted); }
.rs-close:hover { background: var(--neutral-bg); color: var(--ink); }
.rs-body { flex: 1; min-height: 0; overflow-y: auto; overscroll-behavior: contain; display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content; gap: 14px; align-content: start; padding: 20px 24px 24px; }
.rs-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding: 14px 24px; border-top: 1px solid var(--line); background: var(--surface-2); }
.rs-foot-note { color: var(--ink-2); font-size: .93rem; font-weight: 550; }
.rs-foot-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.rs-lead { color: var(--ink-2); }
.rs-wait { display: grid; gap: 12px; padding: 28px 4px; color: var(--ink-2); }
.rs-notice { display: grid; gap: 8px; justify-items: center; padding: 28px 12px 12px; text-align: center; }
.rs-notice h3 { font: 650 1.15rem/1.3 var(--font-display); }
.rs-notice p { max-width: 50ch; color: var(--ink-2); }
.rs-notice-icon { display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; margin-bottom: 6px; border-radius: 50%; background: var(--tone-bg); color: var(--tone-ink); }
.rs-notice-icon .icon { width: 26px; height: 26px; }
.rs-center { display: flex; justify-content: center; }
.rs-centered { text-align: center; }

.rs-list { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.rs-list > li + li { border-top: 1px solid var(--line); }
.rs-pick { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border: 0; background: none; text-align: left; transition: background-color .12s ease; }
.rs-pick:hover, .rs-open:hover, .rs-file:hover { background: var(--surface-2); }
.rs-pick:focus-visible, .rs-open:focus-visible { outline-offset: -3px; border-radius: 12px; }
.rs-pick-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 12px; background: var(--blue-bg); color: var(--blue-ink); }
.rs-pick-main { flex: 1; display: grid; gap: 2px; min-width: 0; }
.rs-pick-title { font-weight: 650; }
.rs-pick-sub { color: var(--muted); font-size: .88rem; overflow-wrap: break-word; }
.rs-chev { width: 16px; height: 16px; color: var(--muted); }
.rs-more { justify-self: start; }

.rs-crumbs { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; margin: -4px -8px; font-weight: 600; font-size: .95rem; }
.rs-crumbs > .icon { width: 14px; height: 14px; color: var(--muted); }
.rs-crumb { min-height: 36px; padding: 0 8px; border: 0; border-radius: 8px; background: none; color: var(--brand-ink); font-weight: 600; }
.rs-crumb:hover { background: var(--blue-bg); }
.rs-crumb-here { padding: 6px 8px; overflow-wrap: anywhere; }
.rs-all { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 14px; border-radius: 12px; background: var(--surface-2); font-weight: 600; cursor: pointer; }
.restore input[type="checkbox"] { flex: none; width: 20px; height: 20px; margin: 0; accent-color: var(--brand-solid); cursor: pointer; }
.restore input[type="checkbox"]:disabled { cursor: default; }
.rs-item { display: flex; align-items: stretch; min-height: 48px; }
.rs-tick { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 48px; cursor: pointer; }
.rs-file { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 14px 8px 0; cursor: pointer; }
.rs-file > .rs-tick { margin-right: -10px; }
.rs-open { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; padding: 8px 12px 8px 0; border: 0; background: none; text-align: left; font-weight: 600; }
.rs-kind { width: 20px; height: 20px; color: var(--muted); }
.rs-kind.folder { color: var(--brand-ink); }
.rs-main { flex: 1; display: flex; align-items: center; gap: 0 14px; min-width: 0; }
.rs-text { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.rs-meta { display: flex; gap: 14px; flex: none; color: var(--muted); font-size: .86rem; font-weight: 400; white-space: nowrap; }

.rs-promise { padding: 16px 18px; border-radius: 14px; background: var(--blue-bg); color: var(--blue-ink); font-size: 1.02rem; }
.rs-chosen { display: grid; }
.rs-chosen li { display: flex; align-items: flex-start; gap: 10px; padding: 9px 2px; border-top: 1px solid var(--line); }
.rs-chosen li:first-child { border-top: 0; }
.rs-chosen .icon { width: 18px; height: 18px; margin-top: 3px; color: var(--muted); }
.rs-path { display: flex; align-items: center; justify-content: space-between; gap: 8px 12px; flex-wrap: wrap; padding: 10px 10px 10px 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface-2); }
.rs-path .mono { flex: 1 1 200px; min-width: 0; overflow-wrap: break-word; user-select: all; -webkit-user-select: all; }

/* ------------------------------------------------------------------ one ticket */

.ticket-head { margin-bottom: 22px; }
.ticket-head h1 { max-width: 30ch; }
.ticket-sub { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 12px; font-size: .93rem; }
.ticket-grid { display: grid; grid-template-columns: minmax(0, 1fr) 332px; gap: 28px; align-items: start; }
.ticket-main { display: grid; gap: 20px; min-width: 0; }
.ticket-main > .card + .card { margin-top: 0; }
.ticket-side { position: sticky; top: calc(var(--bar) + 20px); display: grid; gap: 16px; }
.ticket-side .card + .card { margin-top: 0; }
.slot:empty { display: none; }

.approve { display: grid; gap: 18px; border-color: var(--amber); box-shadow: 0 0 0 3px var(--amber-bg), var(--shadow-1); }
.approve-head { display: flex; gap: 14px; align-items: flex-start; }
.approve-head .banner-icon { background: var(--amber-bg); color: var(--amber-ink); }
.approve-head p { margin-top: 2px; font-size: .93rem; }
.approve .kv { padding: 16px; border-radius: var(--radius-s); background: var(--surface-2); }
.approve-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.approve-actions .btn { min-width: 132px; }
.approval-line { display: flex; align-items: center; gap: 8px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); color: var(--tone-ink); font-weight: 600; font-size: .92rem; }
.approval-line .icon { width: 18px; height: 18px; flex: none; }
.approval-note { margin-top: 10px; padding: 10px 14px; border-left: 3px solid var(--line-strong); color: var(--ink-2); font-size: .93rem; white-space: pre-line; }

.conversation { display: grid; gap: 12px; }
.jump { justify-self: center; }
.thread { display: flex; flex-direction: column; gap: 18px; }
.msg { display: flex; gap: 12px; max-width: min(100%, 720px); align-self: flex-start; }
.msg.mine { align-self: flex-end; flex-direction: row-reverse; }
.msg .avatar { margin-top: 2px; }
.msg.mine .avatar { background: var(--brand-solid); color: var(--on-brand); }
.bubble { min-width: 0; padding: 14px 18px; background: var(--surface); border: 1px solid var(--line); border-radius: 6px 18px 18px 18px; box-shadow: var(--shadow-1); }
.msg.mine .bubble { background: var(--blue-bg); border-color: color-mix(in srgb, var(--brand) 22%, transparent); border-radius: 18px 6px 18px 18px; box-shadow: none; }
.msg.staff .bubble { border-left: 3px solid var(--brand); }
.msg-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0 10px; margin-bottom: 6px; }
.msg-author { font-weight: 700; font-size: .93rem; }
.msg-head .tag { margin-left: -2px; background: var(--blue-bg); color: var(--blue-ink); }
.msg-time { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: .82rem; white-space: nowrap; }
.msg.mine .msg-time { color: var(--blue-ink); opacity: .85; }
.msg-body { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.msg-body a { text-decoration: underline; }
.msg-files { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-top: 12px; }
.files-only .msg-files { margin-top: 4px; }
.files-only .msg-author { font-weight: 600; }
.msg.fresh .bubble, .sys.fresh { animation: fresh 2.4s ease both; }
@keyframes fresh { 0% { transform: translateY(8px); opacity: 0; } 12% { transform: none; opacity: 1; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 45%, transparent); } 100% { box-shadow: 0 0 0 3px transparent; } }

.sys { display: flex; align-items: center; justify-content: center; gap: 0; color: var(--muted); font-size: .86rem; text-align: center; }
.sys::before, .sys::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.sys::before { margin-right: 14px; } .sys::after { margin-left: 14px; }
.sys-text { max-width: 70%; }

.thumb { display: block; width: 132px; height: 96px; padding: 0; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--neutral-bg); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease; }
.thumb:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.filechip { display: inline-flex; align-items: center; gap: 10px; max-width: 100%; padding: 8px 14px 8px 8px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); transition: border-color .15s ease, background-color .15s ease; }
.filechip:hover { border-color: var(--muted); background: var(--surface-2); text-decoration: none; }
.filechip-icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 8px; background: var(--neutral-bg); color: var(--ink-2); flex: none; }
.filechip-text { display: grid; min-width: 0; line-height: 1.3; }
.filechip-name { font-weight: 600; font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.filechip-size { color: var(--muted); font-size: .8rem; }

.composer { position: relative; display: grid; gap: 12px; padding: 14px; transition: border-color .15s ease, box-shadow .15s ease; }
.composer:focus-within { border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 24%, transparent); }
textarea.composer-text { border: 0; padding: 6px 8px; min-height: 84px; resize: none; background: none; }
textarea.composer-text:focus, textarea.composer-text:focus-visible { box-shadow: none; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; padding-top: 12px; border-top: 1px solid var(--line); }
.composer-left { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1 1 240px; }
.composer-right { display: flex; gap: 10px; flex-wrap: wrap; margin-left: auto; }
.composer-hint { font-size: .85rem; }
.composer > .field-error { padding: 0 8px; }
.composer-drop {
  display: none; position: absolute; inset: 6px; z-index: 2; align-items: center; justify-content: center; gap: 10px;
  border: 2px dashed var(--brand); border-radius: 12px; background: color-mix(in srgb, var(--blue-bg) 94%, transparent); color: var(--blue-ink); font-weight: 650; pointer-events: none;
}
.dropping .composer-drop { display: flex; }
.closed-note { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; color: var(--ink-2); }

.pending { display: flex; flex-wrap: wrap; gap: 8px; }
.pending-item {
  position: relative; display: flex; align-items: center; gap: 10px; max-width: 100%; padding: 6px 6px 6px 6px;
  border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface-2); overflow: hidden; animation: page-in .2s ease both;
}
.pending-thumb, .pending-icon { width: 44px; height: 44px; border-radius: 7px; flex: none; }
.pending-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--neutral-bg); color: var(--ink-2); }
.pending-text { display: grid; min-width: 0; line-height: 1.3; }
.pending-name { font-weight: 600; font-size: .88rem; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-status { color: var(--muted); font-size: .8rem; }
.pending-item.failed { border-color: var(--red); }
.pending-item.failed .pending-status { color: var(--red-ink); font-weight: 600; white-space: normal; max-width: 260px; }
.pending-remove { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border: 0; border-radius: 8px; background: none; color: var(--muted); flex: none; }
.pending-remove:hover { background: var(--neutral-bg); color: var(--ink); }
.pending-remove .icon { width: 16px; height: 16px; }
.pending.locked .pending-remove { visibility: hidden; }
.pending-progress { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; }
.pending-bar { display: block; width: 0; height: 100%; background: var(--brand); transition: width .2s linear; }
.attach-zone { position: relative; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px; border: 1.5px dashed var(--line-strong); border-radius: 12px; }
.attach-zone .field-hint { flex: 1 1 200px; }
.new-form.dropping .attach-zone { border-color: var(--brand); }

/* ------------------------------------------------------------------ new ticket */

.new-form { padding: 26px; gap: 26px; }
.new-form .form-actions { padding-top: 20px; border-top: 1px solid var(--line); }
.field.narrow { max-width: 220px; }

/* ------------------------------------------------------------------ requesting new equipment */

/* The guided form (equipment.js): three steps inside the new-ticket card. */
.eq-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.eq-steps { display: flex; gap: 6px; padding: 6px; border-radius: 14px; background: var(--neutral-bg); }
.eq-steps li { flex: 1; min-width: 0; }
.eq-step-link {
  display: flex; align-items: center; gap: 8px; width: 100%; min-height: 40px; padding: 4px 10px; border: 0; border-radius: 10px;
  background: none; color: var(--muted); font-weight: 600; font-size: .9rem; text-align: left;
}
button.eq-step-link:hover { background: var(--surface); color: var(--ink); }
.eq-steps li.current .eq-step-link { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1), 0 0 0 1px var(--line); }
.eq-step-dot {
  display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border-radius: 50%;
  background: var(--surface); color: var(--muted); font-size: .8rem; font-weight: 700; box-shadow: 0 0 0 1px var(--line-strong);
}
.eq-step-dot .icon { width: 14px; height: 14px; stroke-width: 2.5; }
.eq-steps li.current .eq-step-dot { background: var(--brand-solid); color: var(--on-brand); box-shadow: none; }
.eq-steps li.done .eq-step-dot { background: var(--green-bg); color: var(--green-ink); box-shadow: none; }
.eq-step-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.eq-step { display: grid; grid-template-columns: minmax(0, 1fr); gap: 20px; }
.eq-step-title { font-size: 1.2rem; }
.eq-step-title:focus { outline: none; }
.eq-step-title + .muted { margin-top: -14px; font-size: .95rem; }
.eq-group { display: grid; gap: 10px; }
.eq-group h3 { color: var(--ink-2); font-size: .82rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; }
.eq-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; align-items: start; }
.eq-grid.one { grid-template-columns: minmax(0, 1fr); }

/* One thing that can be chosen: a checkbox drawn as a card, which opens its own questions when ticked. */
.eq-item { border: 1.5px solid var(--line-strong); border-radius: 14px; background: var(--surface); transition: border-color .15s ease, background-color .15s ease, box-shadow .15s ease; }
.eq-item:hover { border-color: var(--muted); }
.eq-item.on { border-color: var(--brand); box-shadow: 0 0 0 1px var(--brand); }
.eq-item:has(.eq-item-head input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 2px; }
.eq-item-head { position: relative; display: block; padding: 16px 46px 16px 16px; border-radius: 13px; cursor: pointer; }
.eq-item.on .eq-item-head { background: var(--blue-bg); border-radius: 13px 13px 0 0; }
.eq-item-head input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.eq-item-text, .eq-item-about { display: grid; gap: 6px; min-width: 0; }
.eq-item-name { font-weight: 650; line-height: 1.35; }
.eq-item-name .tag { margin-left: 0; margin-top: 4px; display: table; }
.eq-item-desc { color: var(--muted); font-size: .88rem; line-height: 1.45; }
.eq-item.on .eq-item-desc { color: var(--blue-ink); }
.eq-specs { display: grid; gap: 3px; margin-top: 2px; }
.eq-spec { display: flex; align-items: flex-start; gap: 7px; font-size: .88rem; color: var(--ink-2); }
.eq-spec .icon { flex: none; width: 15px; height: 15px; margin-top: 3px; color: var(--green); stroke-width: 2.5; }
.eq-item-head > .choice-mark { border-radius: 7px; }
.eq-item.on > .eq-item-head > .choice-mark { background: var(--brand-solid); border-color: var(--brand-solid); color: var(--on-brand); }
.eq-options { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 16px; border-top: 1px solid var(--line); }
.eq-howmany { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.eq-howmany .label, .eq-options .choices > legend { font-weight: 650; font-size: .9rem; }
.qty { display: inline-flex; align-items: center; gap: 6px; }
.qty-input { width: 68px; min-height: 40px; padding: 6px 8px; text-align: center; -moz-appearance: textfield; appearance: textfield; }
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn {
  display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; padding: 0; border-radius: var(--radius-s);
  border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink-2);
}
.qty-btn:hover { background: var(--surface-2); border-color: var(--muted); }
.qty-btn .icon { width: 16px; height: 16px; stroke-width: 2.25; }
/* The processor and memory choices sit inside a card, so they are drawn a size smaller than the page's own choices. */
.choices.slim { gap: 8px; }
.choices.compact.slim .choices-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; }
.choices.slim .choice { padding: 10px 12px; border-radius: 10px; border-width: 1px; }
.choices.slim .choice-text { padding-right: 24px; }
.choices.slim .choice-title { font-size: .92rem; }
.choices.slim .choice-sub { font-size: .8rem; }
.choices.slim .choice-mark { top: 9px; right: 9px; width: 18px; height: 18px; }
.choices.slim .choice-mark .icon { width: 11px; height: 11px; }
.eq-tally { font-size: .92rem; font-weight: 600; }
.eq-who .choices-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.eq-who .choice { flex-direction: column; }
.eq-filter { max-width: 280px; min-height: 40px; }
.eq-files:empty { display: none; }
.eq-actions { padding-top: 20px; border-top: 1px solid var(--line); }
.eq-actions .btn.primary .icon:last-child { margin-right: -4px; }
.eq-summary { padding: 18px; border-radius: var(--radius-s); background: var(--surface-2); }

/* A request as it reads on a ticket (parts.js equipmentView): the things asked for, then the facts about it. */
.eq-view { display: grid; gap: 16px; }
.eq-lines { display: grid; gap: 10px; }
.eq-line { display: grid; grid-template-columns: 3.1em minmax(0, 1fr); gap: 10px; align-items: baseline; }
.eq-qty { padding: 1px 6px; border-radius: 7px; background: var(--blue-bg); color: var(--blue-ink); font-weight: 700; font-size: .88rem; text-align: center; white-space: nowrap; }
.eq-name { font-weight: 600; overflow-wrap: anywhere; }
.eq-else { color: var(--muted); font-weight: 500; }
.eq-opts { color: var(--muted); font-size: .88rem; }
/* A choice other than the one the item starts on (more memory, a graphics card) is the part worth noticing. */
.eq-opt.changed { color: var(--ink); font-weight: 650; }
.eq-view .kv { padding-top: 14px; border-top: 1px solid var(--line); }
.approve .eq-view { padding: 16px; border-radius: var(--radius-s); background: var(--surface-2); }
.approve .eq-view .kv { padding: 14px 0 0; border-radius: 0; background: none; }

/* ------------------------------------------------------------------ people and profile */

.people > li + li { border-top: 1px solid var(--line); }
.person { display: grid; grid-template-columns: 40px minmax(0, 1.2fr) minmax(0, 1fr); gap: 6px 16px; align-items: center; padding: 16px 22px; }
.person.off { opacity: .6; }
.person-name { font-weight: 650; }
.person-main { display: grid; gap: 2px; min-width: 0; }
.person-contact { display: flex; flex-wrap: wrap; gap: 4px 18px; margin-top: 4px; font-size: .9rem; }
.person-contact a { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); min-width: 0; overflow-wrap: anywhere; }
.person-contact .icon { width: 16px; height: 16px; color: var(--muted); }
.person-side { display: grid; gap: 8px; justify-items: end; text-align: right; font-size: .9rem; }
.person-devices { display: flex; flex-wrap: wrap; gap: 6px 14px; justify-content: flex-end; }
.profile-head { display: flex; align-items: center; gap: 20px; }
.profile-head .avatar { background: var(--brand-solid); color: var(--on-brand); }
.profile-head .tag { margin: 8px 0 0; }
.signout { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.notices { display: flex; align-items: flex-start; gap: 14px; }
.notices .card-title { margin-bottom: 2px; }
.notices .asection-icon { flex: none; margin-top: 1px; }
.signout .card-title { margin-bottom: 2px; }

/* ------------------------------------------------------------------ signed out */

.public { min-height: 100dvh; display: flex; flex-direction: column; }
.auth { flex: 1; display: grid; grid-template-columns: minmax(380px, 5fr) 7fr; min-height: 100dvh; }
.auth-brand {
  display: flex; flex-direction: column; justify-content: space-between; gap: 40px; padding: 44px 48px;
  background:
    radial-gradient(640px 420px at 110% 0%, rgba(22, 149, 232, .38), transparent 70%),
    radial-gradient(520px 380px at -20% 100%, rgba(22, 149, 232, .2), transparent 70%),
    linear-gradient(160deg, var(--charcoal), #0f1215);
  color: #fff;
}
.auth-logo { width: 208px; height: auto; }
.auth-kicker { color: #7cc4f8; font-size: .8rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.auth-headline { margin-top: 12px; font: 700 clamp(1.7rem, 1rem + 1.8vw, 2.4rem)/1.15 var(--font-display); letter-spacing: -.025em; max-width: 16ch; }
.auth-points { display: grid; gap: 16px; margin-top: 32px; }
.auth-points li { display: flex; align-items: center; gap: 14px; color: rgba(255, 255, 255, .82); }
.auth-points .icon { width: 22px; height: 22px; padding: 9px; box-sizing: content-box; border-radius: 12px; background: rgba(255, 255, 255, .08); color: #7cc4f8; }
.auth-small { color: rgba(255, 255, 255, .5); font-size: .84rem; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 2rem; }
.auth-card .form { margin-top: 28px; }
.auth-links { margin-top: 20px; font-weight: 600; }
.auth-links a { display: inline-flex; align-items: center; gap: 6px; }
.auth-links .btn { display: flex; }
.auth-help { margin-top: 18px; color: var(--muted); font-size: .92rem; }
.auth-links + .auth-help { padding-top: 18px; border-top: 1px solid var(--line); }
.auth-done { display: inline-flex; align-items: center; justify-content: center; width: 60px; height: 60px; margin-bottom: 20px; border-radius: 50%; background: var(--blue-bg); color: var(--blue-ink); }
.auth-done .icon { width: 28px; height: 28px; }
.auth-done.warn { background: var(--amber-bg); color: var(--amber-ink); }
.auth-options { display: grid; gap: 14px; margin-top: 24px; }
.auth-option { display: grid; gap: 8px; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.auth-option h2 { font-size: 1rem; }
.auth-option p { color: var(--ink-2); font-size: .94rem; }
.auth-option .row { margin-top: 6px; }
.checks { display: grid; gap: 6px; margin-top: -6px; }
.checks li { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; transition: color .15s ease; }
.checks .icon { width: 16px; height: 16px; padding: 2px; box-sizing: content-box; border-radius: 50%; background: var(--neutral-bg); stroke-width: 2.5; transition: background-color .15s ease, color .15s ease; }
.checks li.met { color: var(--green-ink); }
.checks li.met .icon { background: var(--green); color: #fff; }

/* ------------------------------------------------------------------ toasts, dialogs */

.toasts { position: fixed; right: 20px; bottom: calc(20px + var(--tabs)); z-index: 60; display: flex; flex-direction: column; gap: 10px; width: min(400px, calc(100vw - 32px)); pointer-events: none; }
.toast {
  display: flex; align-items: flex-start; gap: 12px; padding: 14px 10px 14px 16px; border-radius: 14px;
  background: #1d2228; color: #fff; box-shadow: var(--shadow-3); border: 1px solid rgba(255, 255, 255, .08);
  pointer-events: auto; animation: toast-in .25s cubic-bezier(.2, .8, .2, 1) both;
}
.toast p { flex: 1; min-width: 0; font-size: .94rem; font-weight: 550; }
.toast > .icon { margin-top: 1px; color: #6fdc9a; }
.toast.error > .icon { color: #ff9f8f; }
.toast.info > .icon { color: #7cc4f8; }
.toast-close { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; margin: -5px 0; border: 0; border-radius: 8px; background: none; color: rgba(255, 255, 255, .6); flex: none; }
.toast-close:hover { background: rgba(255, 255, 255, .1); color: #fff; }
.toast-close .icon { width: 16px; height: 16px; }
.toast.leaving { opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }

dialog { color: var(--ink); }
dialog::backdrop { background: rgba(10, 13, 16, .6); }
.dialog { width: min(440px, calc(100vw - 32px)); padding: 26px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); box-shadow: var(--shadow-3); }
.dialog h2 { font-size: 1.25rem; }
.dialog p { margin-top: 10px; color: var(--ink-2); }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; margin-top: 24px; }
.dialog[open] { animation: toast-in .2s ease both; }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0 16px 16px; border: 0; background: transparent; }
.lightbox[open] { display: flex; flex-direction: column; align-items: center; }
.lightbox::backdrop { background: rgba(8, 10, 12, .9); }
.lightbox-bar { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 1100px; padding: 12px 0; color: #fff; }
.lightbox-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lightbox img { flex: 1; min-height: 0; max-width: 100%; object-fit: contain; border-radius: 8px; image-rendering: auto; }
.lightbox :focus-visible { outline-color: #7cc4f8; }

/* ------------------------------------------------------------------ narrower screens */

@media (max-width: 1040px) {
  .account-text { display: none; }
  .account { padding: 4px; }
  .home-grid { grid-template-columns: minmax(0, 1fr); }
  .home-side { display: grid; gap: 28px; }
  .home-side .section + .section { margin-top: 0; }
  /* Once stacked, only the very first card still sits on the dark band. */
  .home-side > .section:first-child > .section-head h2, .home-side > .section:first-child > .section-head .more { color: inherit; }
  .home-side > .section:first-child > .section-head .more { color: var(--brand-ink); }
  .ticket-grid { grid-template-columns: minmax(0, 1fr); }
  .ticket-side { position: static; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); align-items: start; }
  .hero-in { flex-direction: column; align-items: stretch; gap: 28px; }
  .stats { flex-wrap: wrap; }
  .stat { flex: 1 1 120px; }
}

@media (max-width: 860px) {
  .agrid { columns: 1; }
  .where-grid { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
  .auth-brand { flex-direction: row; align-items: center; padding: 18px 24px; }
  .auth-logo { width: 132px; }
  .auth-pitch, .auth-small { display: none; }
  .auth-main { align-items: flex-start; padding: 36px 24px 48px; }
  .arow { grid-template-columns: 46px minmax(0, 1fr) auto; }
  .arow-side { grid-column: 3; grid-row: 1; }
  .arow-who { grid-column: 2 / -1; grid-row: 2; display: flex; gap: 8px; align-items: baseline; }
  .person { grid-template-columns: 40px minmax(0, 1fr); align-items: start; }
  .person-side { grid-column: 2; justify-items: start; text-align: left; }
  .person-devices { justify-content: flex-start; }
}

/* Phones: the menu moves to the bottom of the screen, within reach of the thumb. */
@media (max-width: 720px) {
  :root { --bar: 56px; --tabs: calc(64px + env(safe-area-inset-bottom, 0px)); }
  h1 { font-size: 1.5rem; }
  .topbar-in { padding: 0 16px; gap: 12px; }
  .brand img { height: 34px; }
  .nav, .topbar .get-help { display: none; }
  .page { padding: 22px 16px 40px; }
  .card { padding: 18px; }
  .pad { padding: 18px; }
  .foot { padding-bottom: calc(24px + var(--tabs)); }

  .tabbar {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; display: flex; align-items: stretch;
    height: var(--tabs); padding: 0 6px env(safe-area-inset-bottom, 0px);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line);
  }
  .tabbar .nav-link {
    position: relative; flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--muted); font-size: .7rem; font-weight: 600; text-decoration: none; -webkit-tap-highlight-color: transparent;
  }
  .tabbar .nav-link .icon { width: 24px; height: 24px; }
  .tabbar .nav-link[aria-current="page"] { color: var(--brand-ink); }
  .tabbar .badge { position: absolute; top: 7px; left: calc(50% + 6px); min-width: 18px; height: 18px; font-size: .68rem; box-shadow: 0 0 0 2px var(--surface); }
  .tab-new-icon { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 34px; border-radius: 12px; background: var(--brand-solid); color: var(--on-brand); box-shadow: 0 4px 12px -4px rgba(22, 149, 232, .7); }
  .tab-new-icon .icon { width: 22px; height: 22px; stroke-width: 2.25; }
  .tabbar .tab-new { color: var(--ink); }

  .hero-in { padding: 28px 16px 72px; }
  .hero-actions .btn { flex: 1 1 auto; }
  .stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
  .stat { min-width: 0; padding: 12px 14px; }
  .stat-number { font-size: 1.6rem; }
  .stat-label { font-size: .8rem; }

  .trow { grid-template-columns: 36px minmax(0, 1fr); padding: 14px 16px; gap: 8px 12px; }
  .trow-icon { width: 36px; height: 36px; border-radius: 10px; }
  .trow-side { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
  .trow-title { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .arow { padding: 14px 16px; }
  .person { padding: 14px 16px; }

  .toolbar { gap: 10px; }
  .toolbar .seg { display: flex; flex: 1 1 100%; }
  .toolbar .seg-option { flex: 1; justify-content: center; padding: 0 8px; min-height: 40px; }
  .search { flex: 1 1 100%; max-width: none; }
  .chip-toggle { flex: 1 1 auto; justify-content: center; }

  .page-head-row { align-items: stretch; flex-direction: column; }
  .page-actions .btn { flex: 1; }
  .kinds.n3 .choices-grid, .kinds.n2 .choices-grid, .choices.compact .choices-grid { grid-template-columns: 1fr; }
  .kinds .choice { flex-direction: row; min-height: 0; padding: 14px; }
  .kinds .choice-text { padding-right: 26px; }
  .new-form { padding: 18px; }
  .eq-grid, .eq-who .choices-grid { grid-template-columns: minmax(0, 1fr); }
  .eq-who .choice { flex-direction: row; }
  .eq-steps li:not(.current) .eq-step-label { display: none; }
  .eq-steps li:not(.current) { flex: none; }
  .eq-filter { max-width: none; }
  .field-row, .field-row.even { grid-template-columns: 1fr; }
  .field.narrow { max-width: none; }
  .form-actions .btn { flex: 1; }

  .msg { max-width: 100%; gap: 8px; }
  .msg .avatar { width: 32px; height: 32px; font-size: .72rem; }
  .bubble { padding: 12px 14px; }
  .composer-right { width: 100%; }
  .composer-right .btn { flex: 1; }
  .composer-hint { display: none; }
  .kv > div { grid-template-columns: 96px minmax(0, 1fr); }
  .banner { padding: 14px; gap: 12px; flex-wrap: wrap; }
  .banner .btn { margin-left: 48px; }
  .asset-head { gap: 14px; }
  .selfhelp { padding: 18px; gap: 18px; }
  .sh-updates { padding: 14px; }
  .sh-actions { flex: 1 1 100%; }
  .sh-actions .btn, .sh-confirm-actions .btn { flex: 1 1 auto; }
  .this-pc .device-actions .btn { flex: 1 1 auto; }
  .asset-head .page-actions, .asset-head .page-actions .btn { width: 100%; }
  .where-grid .cgmap { height: 260px; }
  .where-head .btn { flex: 1 1 100%; }
  /* Getting a file back fills the screen, like a page of its own. */
  .restore, .restore.tall { width: 100vw; height: 100dvh; max-height: none; margin: 0; border: 0; border-radius: 0; }
  .rs-head { padding: 16px 8px 14px 16px; }
  .rs-body { padding: 16px; }
  .rs-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)); }
  .rs-foot-actions { flex: 1 1 100%; }
  .rs-foot-actions .btn { flex: 1 1 auto; }
  .rs-main { flex-direction: column; align-items: flex-start; }
  .rs-main .rs-text { flex: none; max-width: 100%; }
  .arow-locate { width: 48px; }
  .software li { flex-direction: column; gap: 0; }
  .software-meta { text-align: left; max-width: none; }
  .profile-head { gap: 14px; }
  .profile-head .avatar { width: 56px; height: 56px; font-size: 1.2rem; }
  .toasts { left: 16px; right: 16px; width: auto; }
  .auth-card h1 { font-size: 1.7rem; }
}

/* ------------------------------------------------------------------ inside the Support window on a PC */

/* The same pages are shown in the "ClayGen Support" window that opens from the tray icon of a managed PC (portal.js
   puts in-app on the body there). The window already has a title bar with ClayGen's name, so the frame is a
   little slimmer, the footer keeps only what is useful, and the parts that are furniture rather than content
   behave like an application: they cannot be selected as text or dragged out of the window. */
.in-app { --bar: 54px; overscroll-behavior: none; }
.in-app .brand img { height: 32px; }
.in-app .topbar, .in-app .tabbar, .in-app .btn, .in-app .back, .in-app .more, .in-app .stat, .in-app .seg, .in-app .chip-toggle, .in-app .foot, .in-app .skip { -webkit-user-select: none; user-select: none; }
.in-app a, .in-app img { -webkit-user-drag: none; }
.in-app .foot { padding-top: 20px; border-top: 0; }
.in-app .foot p:first-child { display: none; }
.in-app .hero-in { padding-top: 32px; }
/* Signing in: the window is the brand, so the pitch for the website is left out at every width. */
.in-app .auth { grid-template-columns: 1fr; grid-template-rows: auto 1fr; }
.in-app .auth-brand { flex-direction: row; align-items: center; padding: 16px 24px; }
.in-app .auth-logo { width: 132px; }
.in-app .auth-pitch, .in-app .auth-small { display: none; }
.in-app .auth-main { align-items: flex-start; padding: 36px 24px 48px; }
@media (min-width: 861px) { .in-app .auth-main { align-items: center; } }
@media (max-width: 720px) { .in-app .hero-in { padding-top: 24px; } }

/* ------------------------------------------------------------------ preferences */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
  .skeleton-line { animation: none; }
  /* Without movement the bar would stop out of sight: show it still, and let the words beside it say what is happening. */
  .progress-bar::after { animation: none; width: 100%; opacity: .55; }
}

@media (forced-colors: active) {
  .pill, .btn, .choice, .chip span, .card, .fix, .sh-updates, .restore, .bk-problem, .rs-promise, .eq-item, .qty-btn { border: 1px solid CanvasText; }
  .eq-item.on { border-width: 3px; }
  .meter { border: 1px solid CanvasText; }
  .meter-fill { background: Highlight; }
}

@media print {
  .topbar, .tabbar, .foot, .toasts, .composer, .skip, .sh-actions, .fix-actions, .where-head .btn, .arow-locate, .restore { display: none !important; }
  body { background: #fff; }
  .card { box-shadow: none; }
}
