/*
 * App-specific styles. Uses only the design system's tokens, so a re-sync of
 * static/ws/ from the Claude Design project never conflicts with this file.
 *
 * Three kinds of rules live here:
 * 1. Layout the UI kit wrote as inline React styles (shell, dashboard), as
 *    classes, because the Content-Security-Policy forbids style attributes.
 * 2. Adapters that let the design's classes sit on native elements:
 *    <details> for nav groups and accordions, [popover] for menus, <dialog>.
 * 3. Small-screen behaviour the design does not specify.
 */

/* Shell -------------------------------------------------------------------- */

html, body { height: 100%; }
/* A column: the strip back to the main site, then the page's own layout filling the rest. */
body { overflow: hidden; display: flex; flex-direction: column; }
:root { --app-home-height: 32px; }

/* The strip on top of every page that links back to the site this demo is showcased on. */
.app-home { flex: none; display: flex; align-items: center; gap: 8px; height: var(--app-home-height); padding: 0 6px; border-bottom: 1px solid var(--border-default); background: var(--bg-sunken); }
.app-analytics-prefs { margin-left: auto; padding: 2px 6px; border: 0; background: transparent; font: inherit; font-size: var(--text-xs); color: var(--text-tertiary); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.app-analytics-prefs:hover { color: var(--text-link); }

/* PostHog consent: in the page flow on phones; fixed on larger screens with body inset while visible. */
.ap-analytics { flex: none; }
.ap-analytics-banner { position: relative; z-index: 1; width: 100%; box-sizing: border-box; padding: 12px 16px; border-bottom: 1px solid var(--border-default); background: var(--bg-elevated); }
.ap-analytics-banner__text { margin: 0 0 12px; flex: 0 1 auto; font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--text-secondary); }
.ap-analytics-banner__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.ap-analytics-banner__actions .ws-btn { flex: 0 1 auto; justify-content: center; }
@media (max-width: 639px) {
  .ap-analytics-banner__actions { flex-direction: row; }
  .ap-analytics-banner__actions .ws-btn { flex: 1 1 0; min-width: 0; }
}
@media (min-width: 640px) {
  .ap-analytics { display: contents; }
  /* Full-width bottom bar (not a floating card) so the shell inset is never empty grey beside the banner. */
  .ap-analytics-banner {
    position: fixed; z-index: calc(var(--z-popover, 50) + 2); inset: auto 0 0 0;
    display: flex; align-items: center; gap: 16px; width: 100%; max-width: none; margin: 0;
    padding: 12px 16px; border: 0; border-top: 1px solid var(--border-default); border-radius: 0;
    background: var(--bg-elevated); box-shadow: none;
  }
  .ap-analytics-banner__text { margin: 0; flex: 1 1 auto; min-width: 0; }
  .ap-analytics-banner__actions { flex: none; flex-wrap: nowrap; }
  .ap-analytics-banner__actions .ws-btn { flex: 0 0 auto; min-width: 7rem; }
  html.ap-analytics-banner-visible .app,
  html.ap-analytics-banner-visible .app-auth,
  html.ap-analytics-banner-visible .app-public {
    max-height: calc(100vh - var(--app-home-height) - var(--ap-analytics-banner-height, 0px));
  }
}

.app { display: flex; flex: 1; min-height: 0; }
.app-sidebar { flex: none; width: var(--sidebar-width); }
.app-workspace { flex: 1; min-width: 0; display: flex; min-height: 0; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { flex: 1; min-height: 0; overflow: auto; display: flex; flex-direction: column; }

.app-wordmark { font: var(--weight-semibold) var(--text-md) var(--font-sans); letter-spacing: var(--tracking-tight); white-space: nowrap; }
.app-sidebar__new { margin-left: auto; }

.app-user { display: flex; align-items: center; gap: 8px; padding: 2px 4px; }
.app-user__text { flex: 1; min-width: 0; line-height: 1.3; }
.app-user__text > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-user__role { font-size: var(--text-xs); color: var(--text-tertiary); }

.app-topbar {
  display: flex; align-items: center; gap: 12px; flex: none;
  height: var(--topbar-height); padding: 0 16px 0 20px;
  border-bottom: 1px solid var(--border-default); background: var(--bg-surface);
}
.app-topbar__menu { display: none; }
.app-topbar__actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.app-search { width: 260px; margin: 0 8px 0 0; }
.app-search .ws-input { width: 100%; }
.app-search input::-webkit-search-cancel-button { appearance: none; }
/* A long trail shrinks crumb by crumb with an ellipsis instead of running under the actions. */
.app-topbar .ws-crumbs { flex: 0 1 auto; overflow: hidden; }
.app-topbar .ws-crumbs > .ws-crumb { display: block; min-width: 0; flex: 0 1 auto; overflow: hidden; text-overflow: ellipsis; line-height: 24px; }
.app-topbar .ws-crumbs > .ws-crumb .ws-icon { vertical-align: -2px; margin-right: 6px; }
.app-topbar .ws-crumbs__sep { flex: none; }
.app-topbar .ws-crumbs > .ws-crumb:not(.is-current) { flex-shrink: 4; }

/* The theme toggle shows the icon of the theme it switches to. */
.app-theme-toggle__sun { display: none; }
[data-theme="dark"] .app-theme-toggle__sun { display: inline-block; }
[data-theme="dark"] .app-theme-toggle__moon { display: none; }

/* Nav groups and accordions on <details>/<summary> --------------------------- */

summary.ws-navitem, summary.ws-acc__head { list-style: none; }
summary.ws-navitem::-webkit-details-marker, summary.ws-acc__head::-webkit-details-marker { display: none; }
details.ws-navnode[open] > .ws-navitem .ws-navitem__chev,
details.ws-acc__item[open] > .ws-acc__head .ws-acc__chev { transform: rotate(90deg); }
a.ws-navitem, a.ws-navitem:hover { text-decoration: none; }
.ws-navitem[aria-disabled="true"] { cursor: default; }
.app-acc__icon { color: var(--text-tertiary); }

/* Menus and popovers on the Popover API --------------------------------------
 * The browser puts [popover] in the top layer with its own placement; ws.js
 * positions it next to its trigger instead. */

.ws-pop[popover] { position: fixed; inset: auto; margin: 0; overflow: visible; }
.ws-pop[popover]:not(:popover-open) { display: none; }
.app-menu .ws-pop__list { overflow: visible; max-height: none; }
.app-menu--220 { width: 220px; }
.app-menu--280 { width: 280px; }
button.ws-item { width: 100%; border: 0; background: none; font: inherit; text-align: left; }
button.ws-item:focus-visible { outline: none; background: var(--bg-hover); box-shadow: inset 0 0 0 2px var(--focus); }

/* Dialogs on <dialog> ---------------------------------------------------------
 * Matches the design's overlay: 10vh from the top, 24px gutters, darker scrim
 * for the first level and a lighter one for nested dialogs. */

dialog.ws-dialog { width: calc(100% - 48px); padding: 0; margin: 10vh auto auto; color: var(--text-primary); overflow: hidden; }
dialog.ws-dialog:not([open]) { display: none; }
dialog.ws-dialog::backdrop { background: var(--bg-overlay); animation: ws-fade var(--dur-base) var(--ease); }
dialog.ws-dialog[data-level="1"] { margin-top: 14vh; }
dialog.ws-dialog[data-level="1"]::backdrop { background: var(--bg-overlay-nested); }
dialog.ws-dialog--sheet { width: 100%; height: 100%; max-height: none; margin: 0 0 0 auto; }
/* Visually hidden controls (.ws-sr checkboxes and radios) are absolutely positioned; the
   scrolling body must hold them, or they stretch the dialog and focusing one scrolls it. */
dialog.ws-dialog .ws-dialog__body { position: relative; }
/* Outside a dialog the label holds its control: the design positions .ws-check, not .ws-switch,
   and a switch low on a page would otherwise stretch the whole window and scroll the shell. */
.ws-switch { position: relative; }

/* Tooltips (ws.js adds a .ws-tip next to [data-ws-tip] on hover and focus) */
.ws-tip-wrap > .ws-tip--bottom, .ws-tip-wrap > .ws-tip--top { white-space: nowrap; }

/* Components rendered by template tags ---------------------------------------- */

/* Avatar: the design sets size and colour inline; these are the same values. */
.app-avatar--18 { width: 18px; height: 18px; font-size: 7px; }
.app-avatar--20 { width: 20px; height: 20px; font-size: 8px; }
.app-avatar--24 { width: 24px; height: 24px; font-size: 10px; }
.app-avatar--32 { width: 32px; height: 32px; font-size: 13px; }
.app-avatar--tone-0 { background: var(--blue-100); color: var(--blue-700); }
.app-avatar--tone-1 { background: var(--green-100); color: var(--green-700); }
.app-avatar--tone-2 { background: var(--amber-100); color: var(--amber-700); }
.app-avatar--tone-3 { background: var(--violet-100); color: var(--violet-700); }
.app-avatar--tone-4 { background: var(--red-100); color: var(--red-700); }
.app-avatar--tone-5 { background: var(--gray-150); color: var(--gray-700); }

a.app-th-link { color: inherit; text-decoration: none; }
.ws-table td.is-center, .ws-table th.is-center { text-align: center; }
a.ws-btn--secondary, a.ws-btn--ghost { color: var(--text-primary); }

/* Text helpers */
.app-strong { font-weight: var(--weight-medium); }
.app-tertiary { color: var(--text-tertiary); }
.app-sla--ok { color: var(--text-secondary); }
.app-sla--warning { color: var(--warning-fg); }
.app-sla--danger { color: var(--danger-fg); }

/* Pages ------------------------------------------------------------------------ */

.app-page { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 1280px; padding: var(--page-gutter); }
.app-page__head { display: flex; align-items: flex-end; gap: 12px; }
.app-page__titles { flex: 1; min-width: 0; }
.app-page__actions { display: flex; align-items: center; gap: 12px; }
.app-h1 { margin: 0; font: var(--type-h1); }
.app-page__sub { margin: 4px 0 0; color: var(--text-secondary); }
a.ws-tab, a.ws-tab:hover { text-decoration: none; }

/* Dashboard */
.app-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ws-card__body.app-stat { padding: 14px 16px; }
.app-stat__label { font-size: var(--text-xs); color: var(--text-secondary); }
.app-stat__row { display: flex; align-items: baseline; gap: 8px; margin-top: 6px; }
.app-stat__value { font: var(--weight-semibold) 24px/1 var(--font-sans); letter-spacing: var(--tracking-tight); }
.app-dashboard__grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-col-case { width: 110px; }

.app-stages { display: flex; flex-direction: column; gap: 12px; margin: 0; padding: 0; list-style: none; }
.app-stage { display: grid; grid-template-columns: 120px 1fr 28px; align-items: center; gap: 10px; font-size: var(--text-xs); }
.app-stage__name { color: var(--text-secondary); }
.app-stage__bar { display: block; width: 100%; height: 8px; }
.app-stage__track { fill: var(--bg-sunken); }
.app-stage__fill { fill: var(--accent); }
.app-stage__count { text-align: right; font-weight: var(--weight-medium); }

/* Account menu in the top bar */
.ws-iconbtn.app-account { border-radius: var(--radius-full); }
.app-menu--260 { width: 260px; }
.app-account__who { padding: 6px 8px 4px; line-height: var(--leading-snug); }
.app-account__who > div { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-item.app-account__org { cursor: default; white-space: normal; }
.ws-item.app-account__org:hover { background: none; }
#app-account form { margin: 0; }

/* Members */
.app-person { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-page--narrow { max-width: 720px; }
.app-page__head > .ws-avatar { align-self: center; }
.app-facts { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px 16px; margin: 0; }
.app-facts dt { color: var(--text-secondary); }
.app-facts dd { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0; }

/* Sign-in and other pages outside the shell */
.app-auth { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; background: var(--bg-app); }
.app-auth__top { display: flex; align-items: center; justify-content: space-between; flex: none; height: var(--topbar-height); padding: 0 16px 0 20px; }
.app-auth__main { flex: 1; display: flex; justify-content: center; padding: 10vh 16px 48px; }
.app-auth__panel { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 380px; }
.app-auth__titles { text-align: center; }
.app-auth__note { margin: 0; text-align: center; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-form { display: flex; flex-direction: column; gap: 16px; }
.app-form form { margin: 0; }
.app-form .ws-btn--block { margin-top: 4px; }

/* Small screens ------------------------------------------------------------------
 * The design is desktop-first. Below 1100px the dashboard reflows; below 768px
 * the sidebar becomes a drawer opened from the top bar. */

.app-scrim { display: none; }

@media (max-width: 1100px) {
  .app-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .app-dashboard__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 900px) {
  .app-search { width: 200px; }
}

@media (max-width: 768px) {
  .app-sidebar {
    position: fixed; inset: 0 auto 0 0; z-index: var(--z-overlay);
    width: min(var(--sidebar-width), 85vw);
    transform: translateX(-100%); visibility: hidden;
    transition: transform var(--dur-slow) var(--ease), visibility 0s linear var(--dur-slow);
  }
  .ws-nav-open .app-sidebar { transform: none; visibility: visible; transition: transform var(--dur-slow) var(--ease); box-shadow: var(--shadow-lg); }
  .ws-nav-open .app-scrim { display: block; position: fixed; inset: 0; z-index: calc(var(--z-overlay) - 1); background: var(--bg-overlay); animation: ws-fade var(--dur-base) var(--ease); }
  .app-topbar { gap: 8px; padding: 0 8px 0 8px; }
  .app-topbar__menu { display: inline-flex; }
  .app-search, .app-topbar__help { display: none; }
  .app-page { padding: 16px; }
  .app-page__head { flex-wrap: wrap; align-items: flex-start; }
  .app-page__titles { flex-basis: 100%; }
  .ws-card__head { flex-wrap: wrap; }
}

@media (max-width: 420px) {
  .app-stage { grid-template-columns: 96px 1fr 28px; }
}

@media (prefers-reduced-motion: reduce) {
  .app-sidebar, .ws-nav-open .app-sidebar { transition: none; }
}

/* Design system page */
.app-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.app-muted { margin: 0; color: var(--text-secondary); }

/* Work screens (build task WS-04) ============================================== */

/* The design's flex containers would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

/* Toolbar above the queue: filters, or the bulk bar once rows are selected */
.app-toolbar { display: flex; align-items: center; gap: 8px; min-height: 32px; }
.app-toolbar__filters, .app-toolbar__bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; flex: 1; min-width: 0; margin: 0; }
.app-toolbar__search { width: 260px; max-width: 100%; }
.app-toolbar__spacer { flex: 1; }
.app-toolbar__sort { width: 170px; }
.app-toolbar__bulk > .app-strong { margin-right: 4px; }
.app-filter { width: 280px; }
.app-filter__body { display: flex; flex-direction: column; gap: 14px; }
.app-filter__checks { display: flex; flex-direction: column; gap: 8px; }
.app-filter form { margin: 0; }
.app-col-menu { width: 40px; text-align: right; }
/* The title column takes what is left and truncates, so the queue never scrolls sideways. */
.app-queue th.app-col-title { width: 100%; }
.app-queue td.app-col-title { max-width: 0; overflow: hidden; text-overflow: ellipsis; }
.ws-table td.app-col-menu { padding-right: 8px; }
a.app-ref { color: inherit; text-decoration: none; }
a.app-ref:hover { text-decoration: underline; }
.app-person--role .app-person__icon { color: var(--text-tertiary); }
.ws-table .ws-table__ctl .ws-check { display: inline-flex; }
.ws-iconbtn.is-disabled { color: var(--text-disabled); pointer-events: none; }
.ws-tag__x { text-decoration: none; }

/* Native inputs inside the design's input and select shells */
.ws-input select { flex: 1; min-width: 0; height: 100%; border: 0; outline: 0; background: transparent; padding: 0; font: inherit; color: inherit; appearance: none; cursor: pointer; }
.ws-input select:invalid { color: var(--text-tertiary); }
label.ws-select__trigger { display: flex; }
.ws-input--multi textarea { width: 100%; }
.ws-field__label { margin: 0; }
.ws-field { margin: 0; }

/* Checkbox and radio boxes follow their hidden input, so they work without script */
.ws-check input:checked + .ws-check__box { background: var(--accent); border-color: var(--accent); }
.ws-check__box > .ws-icon { display: none; }
.ws-check input:checked + .ws-check__box > .ws-icon { display: block; }
.ws-check input:checked + .ws-check__box--radio::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-fg); }
.ws-check__box.is-on > .ws-icon { display: block; }
.ws-check input:not(:checked) + .ws-check__box.is-on { background: var(--bg-surface); border-color: var(--border-input-hover); }
.ws-check input:not(:checked) + .ws-check__box.is-on > .ws-icon { display: none; }
.ws-check input:not(:checked) + .ws-check__box--radio.is-on::after { display: none; }

/* Forms on the case page */
.app-form { display: flex; flex-direction: column; gap: 16px; }
.app-form__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.app-field--wide { grid-column: 1 / -1; }
.app-form__foot { display: flex; justify-content: flex-end; gap: 8px; }
.app-review { gap: 16px; }
.app-radios { display: flex; flex-direction: column; gap: 10px; }
.app-table-editor { display: flex; flex-direction: column; gap: 8px; }
.app-table-editor .ws-table td { padding: 4px 6px; height: auto; }
.app-table-editor .ws-table th { padding: 0 6px; }
.app-table-editor .ws-input { width: 100%; }
.app-table-editor td.is-num input { text-align: right; }
.app-table-editor__foot { display: flex; }
.ws-input.is-invalid input { color: var(--danger-fg); }

/* Case page: header on the surface, tabs below it, then the content */
.app-case { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.app-case__head { flex: none; padding: 16px var(--page-gutter) 0; background: var(--bg-surface); border-bottom: 1px solid var(--border-default); }
.app-case__top { display: flex; align-items: flex-start; gap: 12px; }
.app-case__titles { flex: 1; min-width: 0; }
.app-case__meta { display: flex; align-items: center; gap: 8px; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-case__title { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin-top: 4px; }
.app-case__name { min-width: 0; }
.app-case__facts { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 8px; font-size: var(--text-xs); color: var(--text-secondary); }
.app-case__facts .app-person { display: inline-flex; gap: 6px; color: var(--text-primary); font-weight: var(--weight-medium); }
.app-case__owner { display: inline-flex; align-items: center; gap: 6px; }
.app-case__fact { color: var(--text-primary); font-weight: var(--weight-medium); }
b.app-case__fact.app-sla--warning { color: var(--warning-fg); }
b.app-case__fact.app-sla--danger { color: var(--danger-fg); }
.app-case__actions { display: flex; align-items: center; gap: 8px; flex: none; }
.app-case__tabs { border-bottom: 0; margin-top: 12px; }
.app-case__body { flex: 1; min-height: 0; }
.app-case__grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, 1fr); gap: 16px; align-items: start; padding: var(--page-gutter); max-width: var(--content-max); }
.app-case__main, .app-case__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.app-case__panel { display: flex; flex-direction: column; gap: 16px; padding: var(--page-gutter); max-width: var(--content-max); }
.app-case__panel--narrow { max-width: 720px; }
.app-dl { grid-template-columns: minmax(120px, 160px) minmax(0, 1fr); }
.app-dl dd { overflow-wrap: anywhere; }
.app-empty { padding: 0 16px; display: flex; align-items: center; justify-content: center; }

.app-path { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.app-path__row { display: flex; align-items: center; gap: 8px; }
.app-path__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.app-checks { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.app-checks__row { display: flex; align-items: flex-start; gap: 8px; }
.app-checks__row .ws-badge { flex: none; }
.app-checks__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; line-height: 1.3; }
.app-checks__meta { font-size: var(--text-xs); color: var(--text-secondary); overflow-wrap: anywhere; }
.app-path__meta { font-size: var(--text-xs); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.app-activity { display: flex; flex-direction: column; gap: 14px; margin: 0; padding: 0; list-style: none; }
.app-activity__item { display: flex; align-items: center; gap: 10px; }
.app-activity__text { flex: 1; min-width: 0; }
.app-activity__when { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }

/* New case */
.app-choices { display: flex; flex-direction: column; gap: 8px; }
.app-choice { margin: 0; }
.app-choice__button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 14px; border: 1px solid var(--border-default); border-radius: var(--radius-lg); background: var(--bg-surface); color: var(--text-primary); font: inherit; text-align: left; cursor: pointer; }
.app-choice__button:hover { background: var(--bg-hover); }
.app-choice__button:focus-visible { outline: none; box-shadow: var(--focus-shadow); }
.app-choice__icon { display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-sunken); color: var(--text-secondary); flex: none; }
.app-choice__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-choice__chev { color: var(--text-tertiary); }

/* Demo inbox */
.app-mail { margin: 0; padding: 0; list-style: none; }
.app-mail__item + .app-mail__item { border-top: 1px solid var(--border-subtle); }
.app-mail__link { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: inherit; text-decoration: none; }
.app-mail__link:hover { background: var(--bg-hover); text-decoration: none; }
.app-mail__icon { color: var(--text-tertiary); flex: none; }
.app-mail__item.is-unread .app-mail__icon { color: var(--text-primary); }
.app-mail__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-mail__subject { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-mail__item.is-unread .app-mail__subject { font-weight: var(--weight-medium); }
.app-mail__preview { font-size: var(--text-xs); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-mail__ref { color: var(--text-tertiary); }
.app-mail__when { font-size: var(--text-xs); color: var(--text-tertiary); white-space: nowrap; }
.app-mail__empty { padding: 32px 16px; text-align: center; color: var(--text-tertiary); }
.app-mail__body { margin: 0; white-space: pre-line; line-height: var(--leading-normal); }
.app-page__actions form { margin: 0; }

/* The bell shows a dot while mail is unread */
.app-bell { position: relative; display: inline-flex; }
.app-bell.has-unread::after { content: ''; position: absolute; top: 6px; right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--danger-solid); box-shadow: 0 0 0 2px var(--bg-surface); }

/* Toasts rendered by the server stack like the ones ws.js builds */
.ws-toast-stack:empty { display: none; }

@media (max-width: 1100px) {
  .app-case__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .app-case__head { padding: 12px 16px 0; }
  .app-case__top { flex-wrap: wrap; }
  .app-case__actions { width: 100%; justify-content: flex-end; }
  .app-case__grid, .app-case__panel { padding: 16px; }
  .app-form__grid { grid-template-columns: minmax(0, 1fr); }
  .app-toolbar__search { width: 100%; }
  .app-toolbar__sort { width: 100%; }
  .app-toolbar__spacer { display: none; }
  .app-queue .ws-table-wrap { overflow-x: auto; }
  .app-queue td.app-col-title { max-width: none; }
  .app-mail__ref { display: none; }
  .app-page__actions { width: 100%; }
}

/* Operations: the worker card, delivery tables and request bins (WS-05). */
.app-section { scroll-margin-top: 64px; }
.app-worker { display: flex; align-items: flex-start; gap: 12px; }
.app-worker__icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: var(--radius-md); background: var(--bg-subtle); color: var(--text-secondary); }
.app-worker__icon--success { background: var(--success-bg); color: var(--success-fg); }
.app-worker__icon--danger { background: var(--danger-bg); color: var(--danger-fg); }
.app-worker__icon--warning { background: var(--warning-bg); color: var(--warning-fg); }
.app-worker__icon--neutral { background: var(--bg-subtle); color: var(--text-secondary); }
.app-worker__text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-worker__title { display: flex; align-items: center; gap: 8px; }
.app-worker__headline { font-size: var(--text-md); font-weight: 500; color: var(--text-primary); }
.app-worker__detail { margin: 0; color: var(--text-secondary); overflow-wrap: anywhere; }
td.app-col-wrap { white-space: normal; min-width: 220px; overflow-wrap: anywhere; }
td.app-col-action, th.app-col-action { width: 1%; text-align: right; }
.app-code { font-family: var(--font-mono); font-size: var(--text-xs); padding: 1px 4px; border-radius: var(--radius-sm); background: var(--bg-subtle); }
.app-bin-answer { display: flex; align-items: center; gap: 8px; }
.app-bin-answer .ws-field__label { margin: 0; }
.app-bin { display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-bin__list { margin: 0; padding: 0; list-style: none; }
.app-bin__list li + li { border-top: 1px solid var(--border-subtle); }
.app-bin__item { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 8px; row-gap: 2px; align-items: center; padding: 10px 16px; color: inherit; text-decoration: none; }
.app-bin__item:hover { background: var(--bg-subtle); }
.app-bin__item.is-active { background: var(--bg-selected); }
.app-bin__method { font-size: var(--text-xs); color: var(--text-tertiary); }
.app-bin__ref { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-bin__when { grid-column: 2 / 4; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-bin__heading { margin: 16px 0 8px; font-size: var(--text-sm); font-weight: 500; color: var(--text-primary); }
.app-bin__header { width: 1%; white-space: nowrap; font-weight: 400; color: var(--text-secondary); text-align: left; }
.app-bin__value { overflow-wrap: anywhere; white-space: normal; }
.app-bin__body { margin: 0; padding: 12px; max-height: 420px; overflow: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-subtle); font-family: var(--font-mono); font-size: var(--text-xs); line-height: 1.5; white-space: pre-wrap; overflow-wrap: anywhere; }
@media (max-width: 900px) {
  .app-bin { grid-template-columns: minmax(0, 1fr); }
  .app-bin-answer .ws-field__label { display: none; }
}
/* On a phone the delivery tabs go under the card title and scroll if they must. */
@media (max-width: 640px) {
  .app-section .ws-card__head { flex-wrap: wrap; }
  .app-section .ws-card__actions { flex-basis: 100%; min-width: 0; overflow-x: auto; }
}

/* Document templates: the list and the letter preview (WS-06) ================== */

/* The design's switch takes is-on from React; here it follows its input, so it works without script. */
.ws-switch input:checked + .ws-switch__track { background: var(--accent); }
.ws-switch input:checked + .ws-switch__track .ws-switch__thumb { transform: translateX(12px); background: var(--accent-fg); }
.ws-switch input:not(:checked) + .ws-switch__track { background: var(--switch-off); }
.ws-switch input:not(:checked) + .ws-switch__track .ws-switch__thumb { transform: none; background: var(--switch-thumb-off); }

.app-preview { display: grid; grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 16px; align-items: start; }
.app-preview__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
/* The viewer stays in view while the clause list scrolls with the page. */
.app-preview__doc { position: sticky; top: var(--page-gutter); min-width: 0; height: calc(100vh - var(--app-home-height) - var(--topbar-height) - 2 * var(--page-gutter)); }
.app-preview__page { width: 100%; max-width: 816px; }
/* The design draws page thumbnails with lines; real pages are images, sized like the full page's. */
.ws-pdf__thumb-page img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
a.ws-pdf__thumb, a.ws-pdf__thumb:hover { text-decoration: none; }
.app-preview__empty { margin: auto; color: var(--text-tertiary); }
.app-page.app-preview-page { max-width: 1440px; }

.app-clauses { margin: 0; }
.app-clauses__list { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-clause { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; }
.app-clause + .app-clause { border-top: 1px solid var(--border-subtle); }
.app-clause:first-child { padding-top: 0; }
.app-clause:last-child { padding-bottom: 0; }
.app-clause .ws-switch { align-items: flex-start; }
.app-clause .ws-switch__track { margin-top: 2px; }
.app-clause .ws-switch__text { min-width: 0; }
.app-clause .ws-check__desc { overflow-wrap: anywhere; }
.app-clause.is-off .app-strong { color: var(--text-secondary); }
.app-clause__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding-left: 36px; }
.app-clauses__foot { display: flex; justify-content: flex-end; padding-top: 12px; }
.app-sample { grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 8px 12px; }
.app-sample dt { color: var(--text-secondary); overflow-wrap: anywhere; }

@media (max-width: 1100px) {
  .app-preview { grid-template-columns: minmax(0, 1fr); }
  .app-preview__doc { position: static; height: auto; }
  .app-preview__doc .ws-pdf__thumbs { display: none; }
}

@media (max-width: 768px) {
  .app-preview__doc .ws-pdf__scroll { padding: 12px; }
  .app-sample { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .app-sample dd + dt { margin-top: 8px; }
}

/* Document review on the case page: the design's PdfViewer with clause highlights.
   Pages forbid inline styles, so the boxes are an SVG overlay sized in page
   percentages; the classes mirror ws-pdf__hl and ws-pdf__pin. */
.app-doc { height: clamp(480px, calc(100vh - var(--app-home-height) - var(--topbar-height) - 232px), 960px); }
.app-doc__page { width: 100%; max-width: 816px; }
.app-doc__switch { flex: none; margin: 0 4px; }
.app-doc .ws-pdf__name { min-width: 0; }
.app-doc__overlay { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.app-hl rect { fill: transparent; stroke: transparent; stroke-width: 0.25; transition: fill var(--dur-fast) var(--ease), stroke var(--dur-fast) var(--ease); cursor: pointer; }
.app-hl:hover rect, .app-hl:focus-visible rect, .app-hl:target rect { fill: var(--highlight); stroke: var(--amber-500); mix-blend-mode: multiply; }
.app-hl--info rect { fill: rgba(59, 111, 232, .18); mix-blend-mode: multiply; }
.app-hl--info:hover rect, .app-hl--info:focus-visible rect, .app-hl--info:target rect { fill: rgba(59, 111, 232, .26); stroke: var(--blue-500); }
.app-hl:focus-visible { outline: none; }
.app-doc__pin { overflow: visible; pointer-events: none; }
.app-doc__pin path { fill: var(--gray-900); }
.app-doc__pin text { fill: #fff; font: var(--weight-semibold) 10px/1 var(--font-sans); }
.app-doc .ws-pdf__page:target { box-shadow: 0 0 0 2px var(--focus), 0 2px 8px rgba(18, 24, 32, .08); }

.app-doc__clauses { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-doc__clause { display: flex; flex-direction: column; gap: 8px; padding: 10px 0; scroll-margin-top: calc(var(--topbar-height) + 16px); }
.app-doc__clause + .app-doc__clause { border-top: 1px solid var(--border-subtle); }
.app-doc__clause:first-child { padding-top: 0; }
.app-doc__clause:last-child { padding-bottom: 0; }
.app-doc__clause:target { box-shadow: -3px 0 0 var(--focus); margin-left: -8px; padding-left: 5px; }
.app-doc__clause.is-removed .app-doc__clause-title { color: var(--text-secondary); }
.app-doc__clause-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; min-width: 0; }
.app-doc__clause-title { color: inherit; text-decoration: none; }
.app-doc__clause-title:hover { text-decoration: underline; }
.app-doc__clause-key { margin-left: auto; font-size: var(--text-2xs); }
.app-doc__pinno { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; border-radius: 50% 50% 50% 2px; background: var(--gray-900); color: #fff; font: var(--weight-semibold) 10px/1 var(--font-sans); flex: none; }
.app-doc__diff { margin: 0; font-size: var(--text-xs); line-height: var(--leading-normal); color: var(--text-secondary); overflow-wrap: anywhere; }
.app-doc__diff del { color: var(--danger-fg); background: var(--danger-bg); text-decoration: line-through; border-radius: 2px; padding: 0 1px; }
.app-doc__diff ins { color: var(--success-fg); background: var(--success-bg); text-decoration: none; border-radius: 2px; padding: 0 1px; }
.app-doc__comments { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.app-doc__comment { display: flex; align-items: flex-start; gap: 8px; }
.app-doc__comment .ws-avatar { flex: none; margin-top: 1px; }
.app-doc__comment-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.app-doc__comment-meta { font-size: var(--text-xs); }
.app-doc__comment-body { margin: 0; white-space: pre-line; overflow-wrap: anywhere; line-height: var(--leading-normal); }
.app-doc__add { margin: 0; }
.app-doc__add-summary { display: inline-flex; align-items: center; gap: 6px; font-size: var(--text-xs); color: var(--text-secondary); cursor: pointer; list-style: none; }
.app-doc__add-summary::-webkit-details-marker { display: none; }
.app-doc__add-summary:hover { color: var(--text-primary); }
.app-doc__add[open] .app-doc__add-summary { color: var(--text-primary); }
.app-doc__add-form { display: flex; flex-direction: column; gap: 8px; margin: 8px 0 0; }
.app-doc__add-foot { display: flex; justify-content: flex-end; }
.app-doc__older { margin-bottom: 10px; }

@media (max-width: 1100px) {
  .app-doc { height: auto; }
  .app-doc .ws-pdf__thumbs { display: none; }
  .app-doc .ws-pdf__scroll { padding: 12px; }
}
@media (max-width: 640px) {
  .app-doc .ws-pdf__bar { height: auto; flex-wrap: wrap; padding: 6px 8px; row-gap: 4px; }
  .app-doc .ws-pdf__name { flex-basis: 100%; }
  .app-doc__clause-key { display: none; }
}

/* Signing: the ceremony and Verify pages, and the Signatures panel (WS-08) ===== */

/* Pages outside the shell that an outside party reaches */
.app-public { display: flex; flex-direction: column; flex: 1; min-height: 0; overflow: auto; background: var(--bg-app); }
.app-public__top { display: flex; align-items: center; justify-content: space-between; flex: none; height: var(--topbar-height); padding: 0 16px 0 20px; border-bottom: 1px solid var(--border-default); background: var(--bg-surface); }
.app-public__brand { display: inline-flex; align-items: center; gap: 10px; }
.app-public__actions { display: inline-flex; align-items: center; gap: 4px; }
.app-public__workspace { flex: 1 0 auto; display: flex; min-width: 0; }
.app-public__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-public__narrow { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 560px; margin: 0 auto; padding: 8vh var(--page-gutter) 48px; }
.app-public__narrow .app-auth__main { padding: 0; }

/* The ceremony: the document beside a column with the signers and the consent card */
.app-sign { display: grid; grid-template-columns: minmax(0, 1fr) minmax(320px, 400px); gap: 16px; align-items: start; width: 100%; max-width: 1440px; margin: 0 auto; padding: var(--page-gutter); }
.app-sign__doc { position: sticky; top: var(--page-gutter); min-width: 0; height: calc(100vh - var(--app-home-height) - var(--topbar-height) - 2 * var(--page-gutter)); }
.app-sign__doc .ws-pdf { height: 100%; }
.app-sign__page { width: 100%; max-width: 816px; }
.app-sign__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.app-sign__head { display: flex; flex-direction: column; gap: 4px; }
.app-sign__title { margin-top: 2px; }
.app-sign__facts { grid-template-columns: minmax(80px, 110px) minmax(0, 1fr); }
.app-sign__hash { font-size: var(--text-xs); overflow-wrap: anywhere; }
.app-sign__actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 8px; }
.app-sign .ws-input--lg input { flex: 1; min-width: 0; }
.app-sign .ws-check { align-items: flex-start; }
.app-sign .ws-check__box { margin-top: 2px; }

/* Signers, on the ceremony, on Verify and in the case page's Signatures panel */
.app-signers { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.app-signers__row { display: flex; align-items: center; gap: 8px; }
.app-signers__row .ws-avatar { flex: none; }
.app-signers__row .ws-badge { flex: none; }
.app-signers__row.is-current .app-strong { color: var(--text-primary); }
.app-signers__row.is-current::before { content: ''; width: 6px; height: 6px; margin-right: -2px; border-radius: 50%; background: var(--warning-fg); flex: none; }
.app-signers__text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.app-signers__meta { font-size: var(--text-xs); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-signers__detail { font-size: var(--text-xs); color: var(--text-secondary); overflow-wrap: anywhere; }

.app-signing { display: flex; flex-direction: column; gap: 12px; }
.app-signing__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.app-signing__doc { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-xs); color: var(--text-secondary); }
.app-signing__doc > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-signing__facts { grid-template-columns: minmax(90px, 130px) minmax(0, 1fr); }
.app-signing__actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* Verify */
.app-verify .ws-banner { margin: 0; }
.app-file input[type="file"] { flex: 1; min-width: 0; font: inherit; color: var(--text-secondary); }
.app-file input[type="file"]::file-selector-button { margin-right: 10px; padding: 3px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-primary); font: inherit; font-size: var(--text-xs); cursor: pointer; }

@media (max-width: 1100px) {
  .app-sign { grid-template-columns: minmax(0, 1fr); }
  /* On one column the request comes first; the document follows, at its own height. */
  .app-sign__side { order: -1; }
  .app-sign__doc { position: static; height: auto; }
  .app-sign__doc .ws-pdf__thumbs { display: none; }
  .app-sign__doc .ws-pdf { height: clamp(480px, 70vh, 960px); }
}

@media (max-width: 768px) {
  .app-public__top { padding: 0 8px 0 12px; }
  .app-sign { padding: 16px; }
  .app-sign__doc .ws-pdf__scroll { padding: 12px; }
  .app-sign__doc .ws-pdf__bar { height: auto; flex-wrap: wrap; padding: 6px 8px; row-gap: 4px; }
  .app-sign__doc .ws-pdf__name { flex-basis: 100%; }
  .app-public__narrow { padding: 24px 16px 48px; }
}

/* The workflow builder (WS-09) ================================================== */

.app-inline-form { display: inline-flex; margin: 0; }
.app-workflow-name { display: inline-flex; align-items: center; gap: 8px; }
.app-workflow-name__icon { color: var(--text-tertiary); }
.app-builder__icon { vertical-align: -3px; margin-right: 8px; color: var(--text-secondary); }
.app-builder__panel { display: flex; flex-direction: column; gap: 16px; padding: var(--page-gutter); max-width: var(--content-max); }
.app-builder__panel--narrow { max-width: 760px; }
.app-builder__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 320px); gap: 16px; align-items: start; }
.app-builder__main, .app-builder__side { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.app-form__foot--wide { width: 100%; }
.app-form--dialog { gap: 14px; }
.app-form--dialog form { margin: 0; }
.ws-input.is-mono { font-family: var(--font-mono); font-size: var(--text-xs); }
.ws-input.is-readonly input { color: var(--text-secondary); }
.app-case__title .ws-badge { vertical-align: middle; }

/* The step list */
.app-steps th.app-steps__num, .app-steps td.app-steps__num { width: 36px; padding-right: 0; }
.app-steps td { white-space: normal; }
.app-steps td.app-steps__name { padding: 6px 12px; }
.app-steps th.app-steps__name { width: 32%; }
.app-steps th.app-steps__who { width: 20%; }
.app-step { display: flex; align-items: center; gap: 10px; min-width: 0; color: inherit; text-decoration: none; }
.app-step:hover { text-decoration: none; }
.app-step:hover .app-strong { text-decoration: underline; }
.app-step__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 28px; height: 28px; border-radius: var(--radius-md); border: 1px solid var(--border-default); background: var(--bg-surface); color: var(--text-secondary); }
.app-step__icon--automatic { background: var(--bg-sunken); border-color: transparent; }
.app-step__icon--wait { border-style: dashed; }
.app-step__icon--end { border-radius: var(--radius-full); background: var(--bg-inverse); color: var(--text-inverse); border-color: transparent; }
.app-step__icon--unknown { color: var(--danger-fg); border-color: var(--danger-solid); }
.app-step__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-step__title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.app-step__meta { font-size: var(--text-xs); color: var(--text-tertiary); }
.app-step__problems { display: inline-flex; }
.app-steps__who { font-size: var(--text-xs); }
.app-steps__who .app-strong { display: block; font-size: var(--text-sm); }
.app-steps__timing { color: var(--text-tertiary); }
.app-routes-list { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; font-size: var(--text-xs); color: var(--text-secondary); }
.app-routes-list__arrow { color: var(--text-tertiary); vertical-align: -2px; }
.app-routes-list__from { white-space: nowrap; }
.app-routes-list__missing { color: var(--danger-fg); }
.app-steps td.app-steps__tools { white-space: nowrap; padding-right: 8px; }
.app-steps__tools .app-inline-form { vertical-align: middle; }
.ws-tr.is-hover > td { background: var(--bg-hover); }

/* The diagram: SVG geometry from workflows/diagram.py, coloured here */
.app-diagram-wrap { overflow-x: auto; padding: 8px 12px; }
.app-diagram { display: block; font-family: var(--font-sans); }
.app-diagram__line { fill: none; stroke: var(--gray-400); stroke-width: 1.5; }
.app-diagram__edge.is-conditional .app-diagram__line { stroke-dasharray: 4 3; }
.app-diagram__edge.is-back .app-diagram__line { stroke: var(--gray-300); }
.app-diagram__edge.is-hover .app-diagram__line { stroke: var(--focus); stroke-width: 2; }
.app-diagram__arrowhead { fill: var(--gray-400); }
.app-diagram__edge.is-hover .app-diagram__arrowhead { fill: var(--focus); }
.app-diagram__label rect { fill: var(--bg-surface); stroke: var(--border-subtle); }
.app-diagram__label text { font-size: 11px; fill: var(--text-secondary); }
.app-diagram__edge.is-conditional .app-diagram__label text { font-style: italic; }
.app-diagram__node { cursor: pointer; }
.app-diagram__box { fill: var(--bg-surface); stroke: var(--border-default); stroke-width: 1; transition: stroke var(--dur-fast) var(--ease), fill var(--dur-fast) var(--ease); }
.app-diagram__node--automatic .app-diagram__box { fill: var(--bg-sunken); stroke: transparent; }
.app-diagram__node--wait .app-diagram__box { stroke-dasharray: 4 3; }
.app-diagram__node--end .app-diagram__box { fill: var(--bg-inverse); stroke: transparent; }
.app-diagram__node--end.is-negative .app-diagram__box { fill: var(--danger-solid); }
.app-diagram__node--unknown .app-diagram__box { stroke: var(--danger-solid); }
.app-diagram__node:hover .app-diagram__box, .app-diagram__node.is-hover .app-diagram__box { stroke: var(--text-tertiary); }
.app-diagram__node.is-current .app-diagram__box, .app-diagram__node:focus-visible .app-diagram__box { stroke: var(--focus); stroke-width: 2; }
.app-diagram__node:focus-visible { outline: none; }
.app-diagram__node.is-invalid .app-diagram__box { stroke: var(--danger-solid); }
.app-diagram__icon { color: var(--text-secondary); }
.app-diagram__node--end .app-diagram__icon { color: var(--text-inverse); }
.app-diagram__name { font-size: 12px; font-weight: var(--weight-medium); fill: var(--text-primary); }
.app-diagram__meta { font-size: 11px; fill: var(--text-tertiary); }
.app-diagram__node--end .app-diagram__name, .app-diagram__node--end .app-diagram__meta { fill: var(--text-inverse); }
.app-diagram__start { fill: var(--text-primary); }
.app-diagram__badge circle { fill: var(--danger-solid); }
.app-diagram__badge text { font-size: 10px; font-weight: var(--weight-semibold); fill: #fff; }
.app-diagram__empty { margin: 0; padding: 24px 16px; text-align: center; color: var(--text-tertiary); }

/* The publish check */
.app-check { display: flex; flex-direction: column; gap: 10px; margin: 14px 0 0; padding: 0; list-style: none; }
.app-check__item { display: flex; align-items: flex-start; gap: 8px; }
.app-check__icon { flex: none; margin-top: 2px; color: var(--danger-fg); }
.app-check__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.app-check__lines { margin: 0; padding: 0 0 0 14px; font-size: var(--text-xs); color: var(--text-secondary); }
.app-check__lines li { margin: 1px 0; }

/* Test runs */
.app-runs { margin: 0; padding: 0; list-style: none; }
.app-runs__item + .app-runs__item { border-top: 1px solid var(--border-subtle); }
.app-runs__link { display: flex; align-items: center; gap: 12px; padding: 10px 16px; color: inherit; text-decoration: none; }
.app-runs__link:hover { background: var(--bg-hover); text-decoration: none; }
.app-runs__ref { flex: none; }
.app-runs__text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.app-runs__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-runs__meta { font-size: var(--text-xs); color: var(--text-tertiary); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-runs__empty { margin: 0; padding: 16px; color: var(--text-tertiary); }

/* The inspector sheet */
dialog.app-inspector { max-width: 680px; }
/* The sheet focuses its title when it opens (no keyboard pops up on a phone). */
.app-inspector .ws-dialog__title:focus { outline: none; }
.app-inspector__form { gap: 20px; }
.app-inspector__fields { display: flex; flex-direction: column; gap: 20px; min-width: 0; margin: 0; padding: 0; border: 0; }
.app-inspector__fields:disabled .ws-input { background: var(--bg-subtle); }
.app-inspector__fields:disabled .ws-switch, .app-inspector__fields:disabled .ws-check { cursor: default; }
.app-inspector__section { display: flex; flex-direction: column; gap: 12px; }
.app-inspector__section + .app-inspector__section { padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.app-inspector__heading { margin: 0; font: var(--type-h4); display: flex; align-items: center; gap: 8px; }
.app-inspector__count { display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--bg-sunken); color: var(--text-secondary); font-size: var(--text-2xs); font-weight: var(--weight-medium); }
.app-inspector__help { margin: -6px 0 0; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-inspector__switches { gap: 10px; justify-content: center; }
.app-inspector__switches .ws-switch { align-items: flex-start; }
.app-inspector__switches .ws-switch__track { margin-top: 2px; }
.app-inspector .app-config { max-width: none; }
.app-inspector .app-config__form { padding: 0; border: 0; background: none; }
.app-inspector__foot { justify-content: flex-end; }
.app-inspector__delete { margin-right: auto; }
.app-inspector__delete .ws-btn { color: var(--danger-fg); }
/* A form step's fields in the inspector, standing in for the config editor: they are designed on their own page. */
.app-designer-link { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-subtle); }
.app-designer-link__fields { display: flex; flex-direction: column; gap: 6px; margin: 0; padding: 0; list-style: none; }
.app-designer-link__fields li { display: flex; align-items: center; gap: 8px; min-width: 0; }
.app-designer-link__icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 24px; height: 24px; border: 1px solid var(--border-default); border-radius: var(--radius-sm); background: var(--bg-surface); color: var(--text-secondary); }
.app-designer-link__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--weight-medium); }
.app-designer-link__kind { flex: none; margin-left: auto; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-designer-link__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding-top: 10px; border-top: 1px solid var(--border-subtle); }
.app-designer-link__note { font-size: var(--text-xs); color: var(--text-secondary); }

/* Routes inside the inspector */
.app-routes { display: flex; flex-direction: column; gap: 12px; }
.app-routes__group { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 10px 12px 12px; border: 1px solid var(--border-subtle); border-radius: var(--radius-md); background: var(--bg-subtle); }
.app-routes__outcome { padding: 0 4px; font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-secondary); }
.app-routes__outcome .ws-mono { color: var(--text-primary); }
/* A route reads top to bottom: when (its condition, full width), then where it goes. */
.app-route { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: start; padding: 8px 10px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); }
.app-route.is-invalid { border-color: var(--danger-solid); }
.app-route__when { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.app-route__to { grid-column: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.app-route__to .ws-input { flex: 1; min-width: 0; max-width: 340px; }
.app-route__label { font-size: var(--text-xs); font-weight: var(--weight-medium); color: var(--text-secondary); line-height: 24px; }
.app-route__condition { width: 100%; min-height: 48px; padding: 6px 8px; border: 1px solid var(--border-input); border-radius: var(--radius-md); background: var(--bg-surface); color: var(--text-primary); font: var(--type-mono); resize: vertical; }
.app-route__remove { grid-column: 2; grid-row: 1; color: var(--text-tertiary); }
.app-route__every { display: none; margin: 0; font-size: var(--text-xs); line-height: 24px; color: var(--text-tertiary); }
.app-route.is-default:not(.has-condition) .app-route__when { flex-direction: row; align-items: baseline; gap: 8px; }
.app-route.is-default:not(.has-condition) .app-route__every { display: block; }
.app-route.is-default:not(.has-condition) .app-cond, .app-route.is-default:not(.has-condition) .app-route__condition { display: none; }
.app-route__error { grid-column: 1 / -1; }
.app-routes__add { align-self: flex-start; }
.app-route.is-default .app-cond__foot .app-cond__json { display: none; }

/* The add-step dialog's component cards */
.app-components { border: 0; margin: 0; padding: 0; min-width: 0; }
.app-components legend { padding: 0; margin-bottom: 6px; }
.app-components__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.app-component { display: flex; align-items: flex-start; gap: 10px; padding: 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-surface); cursor: pointer; }
.app-component:hover { background: var(--bg-hover); }
.app-component.is-selected { border-color: var(--focus); box-shadow: 0 0 0 1px var(--focus); background: var(--bg-selected); }
.app-component:focus-within { box-shadow: var(--focus-shadow); }
.app-component__icon { margin-top: 1px; }
.app-component__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.app-component__kind { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
.app-component__desc { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-snug); }

@media (max-width: 1100px) {
  .app-builder__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .app-builder__panel { padding: 16px; }
  .app-components__grid { grid-template-columns: minmax(0, 1fr); }
  .app-steps .ws-table-wrap { overflow-x: auto; }
  .app-steps th.app-steps__routes, .app-steps td.app-steps__routes { display: none; }
  .app-steps td { white-space: nowrap; }
  .app-steps td.app-steps__who .app-strong { white-space: normal; }
  .app-case__actions .ws-tabs--segmented { order: 2; }
  .app-case__actions { flex-wrap: wrap; justify-content: flex-start; }
  dialog.app-inspector { max-width: none; }
}

/* Demo sandboxes (WS-11): the persona switcher in the sidebar footer and the Try page */
.app-personas form { margin: 0; }
.app-persona .ws-avatar { flex: none; }
.app-persona .ws-item__check { flex: none; }
.app-personas__note { padding: 6px 8px 4px; font-size: var(--text-xs); color: var(--text-tertiary); line-height: var(--leading-snug); white-space: normal; }
.app-try { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.app-try li { display: flex; align-items: flex-start; gap: 10px; line-height: var(--leading-normal); }
.app-try .ws-icon { flex: none; margin-top: 3px; color: var(--text-secondary); }
.app-auth__or { display: flex; align-items: center; gap: 12px; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-auth__or::before, .app-auth__or::after { content: ''; flex: 1; border-top: 1px solid var(--border-default); }
.ws-btn[aria-busy="true"] { opacity: 0.7; cursor: progress; }

/* The gallery (WS-13): templates, the component catalogue and the install dialog ============ */

.app-gallery__grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.app-gallery-card .ws-card__head { align-items: flex-start; }
.app-gallery-card__link { color: inherit; text-decoration: none; }
.app-gallery-card__link:hover { text-decoration: underline; }
.app-gallery-card__diagram { display: block; height: 128px; padding: 12px 16px; background: var(--bg-subtle); border-bottom: 1px solid var(--border-subtle); }
.app-gallery-card__diagram .app-diagram { width: 100%; height: 100%; }
/* At thumbnail scale text is noise: the shape of the flow is the point, drawn with crisp lines. */
.app-gallery-card__diagram .app-diagram__labels, .app-gallery-card__diagram .app-diagram__name, .app-gallery-card__diagram .app-diagram__meta { display: none; }
.app-gallery-card__diagram .app-diagram__line, .app-gallery-card__diagram .app-diagram__box { vector-effect: non-scaling-stroke; }
.app-gallery-card__diagram .app-diagram__box { stroke: var(--border-strong); }
.app-gallery-card__diagram:hover { background: var(--bg-hover); }
.app-gallery-card__body { display: flex; flex-direction: column; gap: 12px; }
.app-gallery-card__desc { margin: 0; color: var(--text-secondary); line-height: var(--leading-snug); }
.app-gallery-card__row { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.app-gallery-card__label { font-size: var(--text-2xs); font-weight: var(--weight-semibold); letter-spacing: var(--tracking-caps); text-transform: uppercase; color: var(--text-tertiary); }
.app-gallery-card__roles { font-size: var(--text-xs); color: var(--text-secondary); }
.app-gallery-card__foot { justify-content: flex-end; }

/* Component chips: a design Tag that links to the component's page */
.app-chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.app-chip { color: var(--text-primary); text-decoration: none; }
.app-chip:hover { background: var(--bg-hover); text-decoration: none; }
.app-chip__count { margin-left: 2px; color: var(--text-tertiary); font-variant-numeric: tabular-nums; }

/* The component catalogue: stats and the reuse table */
.app-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.app-stat__note { font-size: var(--text-xs); color: var(--text-tertiary); }
.app-reuse th.app-reuse__name { width: 30%; }
.app-reuse td.app-reuse__name { padding: 6px 12px; }
.app-reuse th.app-reuse__count { white-space: normal; text-align: center; vertical-align: bottom; padding: 8px 10px; line-height: var(--leading-snug); }
.app-reuse td.app-reuse__count { text-align: center; }
.app-reuse__head { display: inline-flex; flex-direction: column; align-items: center; gap: 4px; color: var(--text-secondary); text-decoration: none; }
.app-reuse__head:hover { color: var(--text-primary); }
.app-reuse__used { position: relative; display: inline-flex; align-items: center; color: var(--success-fg); font-size: var(--text-xs); font-weight: var(--weight-medium); }
/* The count hangs to the right, so every check in a column sits on one line. */
.app-reuse__used .ws-num { position: absolute; left: 100%; margin-left: 2px; }

/* One template */
.app-gallery__points { display: flex; flex-direction: column; gap: 8px; margin: 0; padding: 0; list-style: none; }
.app-gallery__points li { display: flex; align-items: flex-start; gap: 8px; line-height: var(--leading-snug); }
.app-gallery__point-icon { flex: none; margin-top: 2px; color: var(--success-fg); }
.app-steps__who .app-steps__four-eyes { display: block; }
.app-gallery__roles { margin: 0; padding: 0; list-style: none; }
.app-gallery__role { display: flex; flex-direction: column; gap: 2px; padding: 10px 16px; }
.app-gallery__role + .app-gallery__role { border-top: 1px solid var(--border-subtle); }
.app-gallery__role-desc { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-snug); }
.app-gallery__role-uses { font-size: var(--text-xs); color: var(--text-tertiary); }

/* The install dialog */
.app-install__roles { display: flex; flex-direction: column; gap: 14px; min-width: 0; margin: 0; padding: 16px 0 0; border: 0; border-top: 1px solid var(--border-subtle); }
.app-install__legend { padding: 0; font: var(--type-h4); }
.app-install__help { display: flex; align-items: flex-start; gap: 8px; margin: -8px 0 0; font-size: var(--text-xs); color: var(--text-tertiary); line-height: var(--leading-snug); }
.app-install__uses { margin: -2px 0 2px; }
.app-install__docs { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.app-install__docs .app-install__help { margin: 0; color: var(--text-secondary); }
.app-install__doc-icon { flex: none; margin-top: 1px; color: var(--text-tertiary); }

/* One component */
.app-gallery__component-name { display: inline-flex; align-items: center; gap: 10px; }
.app-settings-table td { height: auto; white-space: normal; padding-top: 8px; padding-bottom: 8px; vertical-align: top; }
.app-settings-table__name { min-width: 180px; }
.app-setting { display: flex; flex-direction: column; gap: 1px; }
.app-settings-table__row--1 .app-settings-table__name { padding-left: 32px; }
.app-settings-table__row--2 .app-settings-table__name { padding-left: 52px; }
.app-settings-table__type { font-size: var(--text-xs); color: var(--text-secondary); min-width: 110px; }
.app-settings-table__default { font-size: var(--text-xs); }
.app-settings-table__desc { font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-snug); }
.app-gallery__empty { margin: 0; padding: 16px; color: var(--text-tertiary); }
.app-gallery__note { margin: 10px 0 0; font-size: var(--text-xs); color: var(--text-tertiary); line-height: var(--leading-snug); }
.app-uses { margin: 0; padding: 0; list-style: none; }
.app-uses__group { display: flex; flex-direction: column; gap: 6px; padding: 12px 16px; }
.app-uses__group + .app-uses__group { border-top: 1px solid var(--border-subtle); }
.app-uses__workflow { display: inline-flex; align-items: center; gap: 8px; color: inherit; }
.app-uses__steps { display: flex; flex-direction: column; gap: 4px; margin: 0; padding: 0 0 0 22px; list-style: none; font-size: var(--text-sm); }
.app-uses__outcomes { margin-left: 8px; font-size: var(--text-2xs); color: var(--text-tertiary); }

@media (max-width: 1100px) {
  .app-gallery__grid { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 768px) {
  .app-stats--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .app-stats--3 .ws-card__body.app-stat { padding: 10px 12px; }
  .app-stats--3 .app-stat__row { flex-wrap: wrap; row-gap: 2px; }
  .app-gallery-card__diagram { height: 104px; padding: 10px 12px; }
  .app-gallery-card__foot { flex-wrap: wrap; }
  .app-reuse th.app-reuse__name { width: auto; min-width: 200px; }
  .app-settings-table__desc { min-width: 200px; }
  .app-uses__outcomes { display: block; margin-left: 0; }
}
/* Vendor onboarding (WS-14): an outside party's page, uploads, checklists ======= */

/* The page a magic link opens: one narrow column, like the sign-in page */
.app-respond { display: flex; flex-direction: column; gap: 16px; width: 100%; max-width: 720px; margin: 0 auto; padding: 6vh var(--page-gutter) 48px; }
.app-respond__head { display: flex; flex-direction: column; gap: 4px; }
.app-respond__head .app-h1 { margin-top: 2px; }
.app-respond__for { display: inline-flex; align-items: center; gap: 6px; min-width: 0; font-size: var(--text-xs); color: var(--text-secondary); }
.app-respond__for > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-respond__foot { align-items: center; }
.app-respond__note { display: flex; align-items: flex-start; gap: 8px; margin: 0; font-size: var(--text-xs); color: var(--text-tertiary); line-height: var(--leading-snug); }
.app-respond__note .ws-icon { flex: none; margin-top: 2px; }

/* Upload fields: a file input per document (the same input as Verify's, .app-file) */
.app-uploads { display: flex; flex-direction: column; gap: 16px; }
.app-uploads .app-file { width: 100%; }
.app-kept { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 1px solid var(--border-default); border-radius: var(--radius-md); background: var(--bg-subtle); }
.app-kept__icon { flex: none; color: var(--success-fg); }
.app-kept__text { display: flex; flex-direction: column; gap: 1px; min-width: 0; line-height: 1.3; }
.app-kept__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-kept__meta { font-size: var(--text-xs); color: var(--text-tertiary); }
.app-filelink { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; vertical-align: bottom; }
.app-filelink > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.app-filelink__icon { flex: none; color: var(--text-tertiary); }

/* A checklist: one row per item, its role on the right */
.app-checklist { display: flex; flex-direction: column; margin: 0; padding: 0; list-style: none; }
.app-checklist__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border-subtle); }
.app-checklist__row:first-child { border-top: 0; padding-top: 0; }
.app-checklist__row .ws-check { flex: 1; min-width: 0; }
.app-checklist__row .ws-badge { flex: none; }
/* A ticked item is done, not unavailable: keep its text readable. */
.app-checklist__row.is-done .ws-check.is-disabled { color: var(--text-primary); cursor: default; }
.app-checklist__row.is-done .ws-check.is-disabled .ws-check__box.is-on { background: var(--accent); border-color: var(--accent); }

@media (max-width: 768px) {
  .app-respond { padding: 24px 16px 48px; }
  .app-respond__foot { flex-wrap: wrap; }
  /* The title takes the whole line; who the link is for goes under it. */
  .app-respond .ws-card__head { flex-wrap: wrap; row-gap: 6px; }
  .app-respond .ws-card__titles { flex: 1 1 100%; }
  .app-respond .ws-card__actions { min-width: 0; max-width: 100%; }
}

/* Demo setup and the reopenable guide share the app's surface and feedback tokens. */
.app-demo-setup { display: flex; flex-direction: column; gap: 16px; }
.app-demo-orbit { position: relative; display: grid; place-items: center; width: 64px; height: 64px; margin: 0 auto 20px; color: var(--text-link); background: var(--info-bg); border-radius: 50%; }
.app-demo-orbit::after { content: ''; position: absolute; inset: -5px; border: 2px solid var(--border-default); border-top-color: var(--info-solid); border-radius: 50%; animation: app-demo-spin 1s linear infinite; }
@keyframes app-demo-spin { to { transform: rotate(360deg); } }
.app-demo-setup[data-state="failed"] .app-demo-orbit::after,
.app-demo-setup[data-state="ready"] .app-demo-orbit::after { animation: none; }
.app-demo-starting > :not(.app-demo-starting-view) { display: none; }
.app-demo-status { margin: 0 0 12px; color: var(--text-secondary); line-height: var(--leading-normal); }
.app-demo-progress { display: block; width: 100%; height: 5px; border: none; border-radius: 8px; overflow: hidden; background: var(--bg-sunken); accent-color: var(--info-solid); }
.app-demo-progress::-webkit-progress-bar { background: var(--bg-sunken); }
.app-demo-progress::-webkit-progress-value { background: var(--info-solid); }
.app-demo-progress::-moz-progress-bar { background: var(--info-solid); }
.app-demo-steps { display: flex; flex-direction: column; gap: 20px; padding: 20px 0 0; margin: 0; list-style: none; }
.app-demo-steps li { display: flex; align-items: center; gap: 12px; color: var(--text-tertiary); line-height: var(--leading-normal); }
.app-demo-step-mark { display: grid; place-items: center; flex: none; width: 24px; height: 24px; border-radius: 50%; border: 1px solid var(--border-strong); font: var(--weight-medium) var(--text-xs) var(--font-sans); color: var(--text-secondary); }
.app-demo-step-mark .ws-icon { display: none; }
.is-complete > .app-demo-step-mark { background: var(--success-bg); color: var(--success-fg); border-color: var(--success-border); }
.is-complete > .app-demo-step-mark .ws-icon { display: block; }
.is-complete > .app-demo-step-mark > span { display: none; }
.app-demo-steps .is-complete { color: var(--text-primary); }
.app-demo-steps .is-active { color: var(--text-link); font-weight: var(--weight-medium); }
.app-demo-steps .is-active .app-demo-step-mark { border: 2px solid var(--info-border); border-top-color: var(--info-solid); animation: app-demo-spin 1s linear infinite; }
.app-demo-steps .is-active .app-demo-step-mark > span { visibility: hidden; }
[data-demo-error], [data-demo-enter], [data-demo-reconnect] { margin-top: 20px; }
[data-demo-error] form { margin-top: 12px; }
.app-demo-guide-count { padding-left: 4px; color: var(--text-link); font-variant-numeric: tabular-nums; }
.app-demo-tour { width: 370px; min-height: 0; overflow: auto; padding: 20px; background: var(--bg-surface); box-shadow: var(--shadow-lg); }
@media (min-width: 1201px) {
  .app-demo-tour { flex: none; position: sticky; top: 0; align-self: stretch; max-height: calc(100dvh - var(--app-home-height)); border-left: 1px solid var(--border-default); }
}
@media (max-width: 1200px) {
  .app-demo-tour { position: fixed; top: calc(var(--app-home-height) + var(--topbar-height) + 8px); right: 16px; z-index: var(--z-popover, 50); max-width: calc(100vw - 32px); max-height: calc(100dvh - var(--app-home-height) - var(--topbar-height) - 24px); border: 1px solid var(--border-default); border-radius: var(--radius-lg, 12px); }
}
.app-demo-tour__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; margin-bottom: 12px; }
.app-demo-tour h2 { margin: 0; font-size: var(--text-md); font-weight: var(--weight-semibold); }
.app-demo-tour__head p { margin: 4px 0 0; font-size: var(--text-xs); color: var(--text-tertiary); }
.app-demo-tour__intro { margin: 14px 0; color: var(--text-secondary); font-size: var(--text-xs); line-height: var(--leading-normal); }
.app-demo-tour__tasks { margin: 0; padding: 0; list-style: none; }
.app-demo-tour__tasks > li { display: flex; align-items: flex-start; gap: 12px; padding: 14px 0; border-top: 1px solid var(--border-subtle); }
.app-demo-tour__tasks > li > div { min-width: 0; }
.app-demo-tour h3 { margin: 1px 0 5px; font-size: var(--text-sm); font-weight: var(--weight-semibold); }
.app-demo-tour__tasks p { margin: 0 0 6px; font-size: var(--text-xs); color: var(--text-secondary); line-height: var(--leading-normal); }
.app-demo-hint { font-size: var(--text-xs); margin: 7px 0; color: var(--text-secondary); }
.app-demo-hint summary { cursor: pointer; color: var(--text-link); }
.app-demo-hint p { margin-top: 6px; }
.app-demo-done { display: block; margin-top: 3px; color: var(--success-fg); font-size: var(--text-xs); font-weight: var(--weight-normal); }
.app-demo-tour__complete { padding: 12px; margin: 8px 0 0; border-radius: var(--radius-md, 8px); background: var(--success-bg); color: var(--success-fg); font-size: var(--text-xs); line-height: var(--leading-normal); }
@media (max-width: 768px) {
  .app-demo-tour { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-width: none; max-height: min(42dvh, 360px); padding: 16px; border-radius: var(--radius-lg, 12px); }
  .app-demo-guide-toggle { padding-inline: 6px; }
  .app-demo-guide-toggle > .ws-icon { display: none; }
  .app-public__top { flex-wrap: wrap; gap: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .app-demo-orbit::after, .app-demo-steps .is-active .app-demo-step-mark { animation: none; }
}
