/* Tide 2.0.0 build/tide.css sha256:b7734e7198a2 (copied at build) */
/* GENERATED by design-system/tide/scripts/build.mjs from tokens/tokens.json + themes/29court.json. Do not edit: change the JSON and rebuild. */
/* Tide 2.0.0. Layer order is declared here once; load this sheet first. */

@layer tide.reset, tide.tokens, tide.theme, tide.base, tide.components, tide.utilities;

@layer tide.tokens {

:root {
  color-scheme: light dark;
  --t-font-sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI Variable Text", "Segoe UI", Roboto, "Helvetica Neue", "Noto Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  --t-font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --t-font-hand: "Bradley Hand", "Chalkboard SE", "Segoe Print", "Marker Felt", cursive;
  --t-fs-xs: 12px;
  --t-lh-xs: 16px;
  --t-tracking-xs: 0.01em;
  --t-fs-sm: 13px;
  --t-lh-sm: 18px;
  --t-tracking-sm: 0;
  --t-fs-base: 15px;
  --t-lh-base: 22px;
  --t-tracking-base: 0;
  --t-fs-md: 17px;
  --t-lh-md: 24px;
  --t-tracking-md: -0.005em;
  --t-fs-lg: 20px;
  --t-lh-lg: 26px;
  --t-tracking-lg: -0.01em;
  --t-fs-xl: 24px;
  --t-lh-xl: 30px;
  --t-tracking-xl: -0.015em;
  --t-fs-2xl: 30px;
  --t-lh-2xl: 36px;
  --t-tracking-2xl: -0.02em;
  --t-fs-3xl: 38px;
  --t-lh-3xl: 44px;
  --t-tracking-3xl: -0.025em;
  --t-fs-control: 16px;
  --t-lh-control: 24px;
  --t-tracking-control: 0;
  --t-weight-regular: 400;
  --t-weight-medium: 500;
  --t-weight-semibold: 600;
  --t-weight-bold: 700;
  --t-space-0: 0px;
  --t-space-1: 4px;
  --t-space-2: 8px;
  --t-space-3: 12px;
  --t-space-4: 16px;
  --t-space-5: 20px;
  --t-space-6: 24px;
  --t-space-8: 32px;
  --t-space-10: 40px;
  --t-space-12: 48px;
  --t-space-16: 64px;
  --t-space-20: 80px;
  --t-space-px: 1px;
  --t-space-0-5: 2px;
  --t-space-1-5: 6px;
  --t-radius-full: 999px;
  --t-dur-instant: 60ms;
  --t-dur-fast: 120ms;
  --t-dur-base: 180ms;
  --t-dur-slow: 260ms;
  --t-dur-sheet: 340ms;
  --t-dur-draw: 640ms;
  --t-dur-fade: 120ms;
  --t-dur-loop: 800ms;
  --t-ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --t-ease-enter: cubic-bezier(0.05, 0.7, 0.1, 1);
  --t-ease-exit: cubic-bezier(0.3, 0, 0.8, 0.15);
  --t-ease-linear: linear;
  --t-motion-scale: 1;
  --t-anim-spin: tide-spin;
  --t-z-base: 0;
  --t-z-raised: 1;
  --t-z-sticky: 100;
  --t-z-chrome: 200;
  --t-z-sheet: 400;
  --t-z-dialog: 500;
  --t-z-popover: 600;
  --t-z-toast: 700;
  --t-z-tour: 800;
  --t-z-tooltip: 900;
  --t-bp-phone: 24.375em;
  --t-bp-sm: 40em;
  --t-bp-md: 60em;
  --t-bp-lg: 80em;
  --t-size-tap: 44px;
  --t-size-icon-sm: 16px;
  --t-size-icon: 20px;
  --t-size-icon-lg: 24px;
  --t-size-topbar: 56px;
  --t-size-tabbar: 60px;
  --t-size-sidebar: 256px;
  --t-size-content: 1120px;
  --t-size-prose: 68ch;
  --t-size-sheet: 640px;
  --t-size-dialog: 480px;
  --t-size-focus-width: 2px;
  --t-size-focus-offset: 2px;
}

:root, [data-tenant], [data-density] {
  --t-radius-xs: 4px;
  --t-radius-sm: 6px;
  --t-radius-md: 8px;
  --t-radius-lg: 12px;
  --t-radius-xl: 18px;
  --t-density-control: 40px;
  --t-density-row-y: 12px;
  --t-density-card: 16px;
  --t-density-gap: 12px;
  --t-control-h: var(--t-density-control);
}

@media (pointer: coarse) {
  :root, [data-tenant], [data-density] { --t-control-h: max(var(--t-density-control), 44px); }
}

:root, [data-mode="light"] {
  --t-neutral-0: #FFFFFF;
  --t-neutral-25: #F9FBFE;
  --t-neutral-50: #F5F7FA;
  --t-neutral-100: #EDEFF3;
  --t-neutral-150: #E6E8EC;
  --t-neutral-200: #DCDEE2;
  --t-neutral-300: #C6C9CE;
  --t-neutral-400: #A3A6AC;
  --t-neutral-500: #7D8087;
  --t-neutral-600: #60636A;
  --t-neutral-700: #474A50;
  --t-neutral-800: #303338;
  --t-neutral-850: #25282C;
  --t-neutral-900: #1C1E22;
  --t-neutral-925: #16181C;
  --t-neutral-950: #111317;
  --t-neutral-975: #0D0E12;
  --t-neutral-1000: #08090C;
  --t-bg: #F5F7FA;
  --t-surface: #FFFFFF;
  --t-surface-raised: #FFFFFF;
  --t-surface-sunken: #EDEFF3;
  --t-border: #E6E8EC;
  --t-border-strong: #DCDEE2;
  --t-border-control: #7D8087;
  --t-text: #0D0E12;
  --t-text-secondary: #474A50;
  --t-text-subtle: #60636A;
  --t-text-disabled: #A3A6AC;
  --t-inverse: #16181C;
  --t-on-inverse: #F9FBFE;
  --t-chrome: #FFFFFFDB;
  --t-hover: #08090C0D;
  --t-pressed: #08090C17;
  --t-scrim: #08090C6B;
  --t-sh-1: #08090C0F;
  --t-sh-2: #08090C1A;
  --t-sh-3: #08090C29;
  --t-highlight: #FFFFFF00;
  --t-annotate-halo: #FFFFFF;
  --t-accent: #F2A12E;
  --t-accent-hover: #FFAE42;
  --t-accent-pressed: #FFC177;
  --t-on-accent: #08090C;
  --t-accent-ui: #BF7A00;
  --t-on-accent-ui: #08090C;
  --t-accent-subtle: #FFF1E2;
  --t-accent-text: #985F00;
  --t-focus: #BF7A00;
  --t-focus-inverse: #F2A12E;
  --t-selected: #FFF1E2;
  --t-success: #0A924B;
  --t-success-hover: #249E57;
  --t-success-pressed: #36AB62;
  --t-on-success: #08090C;
  --t-success-ui: #0A924B;
  --t-on-success-ui: #08090C;
  --t-success-subtle: #DEFDE5;
  --t-success-text: #007C3E;
  --t-warning: #F2CF24;
  --t-warning-hover: #FFDC3E;
  --t-warning-pressed: #FFEB9B;
  --t-on-warning: #08090C;
  --t-warning-ui: #A08800;
  --t-on-warning-ui: #08090C;
  --t-warning-subtle: #FCF4D2;
  --t-warning-text: #7E6A00;
  --t-danger: #D02C2E;
  --t-danger-hover: #C21821;
  --t-danger-pressed: #B20016;
  --t-on-danger: #FFFFFF;
  --t-danger-ui: #D02C2E;
  --t-on-danger-ui: #FFFFFF;
  --t-danger-subtle: #FFEFED;
  --t-danger-text: #CE2A2C;
  --t-info: #0278C7;
  --t-info-hover: #006CB5;
  --t-info-pressed: #0060A2;
  --t-on-info: #FFFFFF;
  --t-info-ui: #0278C7;
  --t-on-info-ui: #FFFFFF;
  --t-info-subtle: #EBF5FF;
  --t-info-text: #006FB9;
  --t-annotate: #DE1C46;
  --t-annotate-hover: #CE003C;
  --t-annotate-pressed: #BA0035;
  --t-on-annotate: #FFFFFF;
  --t-annotate-ui: #DE1C46;
  --t-on-annotate-ui: #FFFFFF;
  --t-annotate-subtle: #FFEFEF;
  --t-annotate-text: #D70C40;
  --t-note-yellow: #FFEC95;
  --t-note-pink: #FFD9E2;
  --t-note-blue: #C6EBFF;
  --t-note-green: #C8F6D0;
  --t-note-ink: #08090C;
  --t-avatar-1-bg: #CDDFFF;
  --t-avatar-1-fg: #1E3A71;
  --t-avatar-2-bg: #A6ECF4;
  --t-avatar-2-fg: #00464C;
  --t-avatar-3-bg: #BCECC8;
  --t-avatar-3-fg: #004B22;
  --t-avatar-4-bg: #F3DBA9;
  --t-avatar-4-fg: #4F3900;
  --t-avatar-5-bg: #FFD3C3;
  --t-avatar-5-fg: #67260C;
  --t-avatar-6-bg: #FACEF4;
  --t-avatar-6-fg: #592656;
  --t-shadow-0: none;
  --t-shadow-1: 0 1px 2px #08090C0F;
  --t-shadow-2: 0 1px 3px #08090C0F, 0 6px 16px #08090C1A;
  --t-shadow-3: 0 2px 8px #08090C0F, 0 16px 40px #08090C29;
  --t-shadow-4: 0 4px 12px #08090C1A, 0 24px 64px #08090C29;
}

[data-mode="light"] { color-scheme: light; }
[data-mode="dark"] { color-scheme: dark; }

@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) {
    --t-bg: #0D0E12;
    --t-surface: #111317;
    --t-surface-raised: #1C1E22;
    --t-surface-sunken: #08090C;
    --t-border: #25282C;
    --t-border-strong: #303338;
    --t-border-control: #7D8087;
    --t-text: #F9FBFE;
    --t-text-secondary: #C6C9CE;
    --t-text-subtle: #A3A6AC;
    --t-text-disabled: #474A50;
    --t-inverse: #E6E8EC;
    --t-on-inverse: #0D0E12;
    --t-chrome: #111317D6;
    --t-hover: #FFFFFF0F;
    --t-pressed: #FFFFFF1A;
    --t-scrim: #00000099;
    --t-sh-1: #00000052;
    --t-sh-2: #00000070;
    --t-sh-3: #0000008F;
    --t-highlight: #FFFFFF0F;
    --t-annotate-halo: #08090C;
    --t-accent: #F5AC3F;
    --t-accent-hover: #FFBA5A;
    --t-accent-pressed: #FFCC8B;
    --t-on-accent: #08090C;
    --t-accent-ui: #F5AC3F;
    --t-on-accent-ui: #08090C;
    --t-accent-subtle: #412800;
    --t-accent-text: #F5AC3F;
    --t-focus: #F5AC3F;
    --t-focus-inverse: #B67800;
    --t-selected: #412800;
    --t-success: #54C57A;
    --t-success-hover: #62D286;
    --t-success-pressed: #70DF93;
    --t-on-success: #08090C;
    --t-success-ui: #54C57A;
    --t-on-success-ui: #08090C;
    --t-success-subtle: #0C371C;
    --t-success-text: #54C57A;
    --t-warning: #F2CF24;
    --t-warning-hover: #FFDC3E;
    --t-warning-pressed: #FFEB9B;
    --t-on-warning: #08090C;
    --t-warning-ui: #F2CF24;
    --t-on-warning-ui: #08090C;
    --t-warning-subtle: #372D00;
    --t-warning-text: #F2CF24;
    --t-danger: #FF645C;
    --t-danger-hover: #FF7F75;
    --t-danger-pressed: #FF968C;
    --t-on-danger: #08090C;
    --t-danger-ui: #FF645C;
    --t-on-danger-ui: #08090C;
    --t-danger-subtle: #4B1E1A;
    --t-danger-text: #FF645C;
    --t-info: #5AB1FF;
    --t-info-hover: #78BEFF;
    --t-info-pressed: #92CAFF;
    --t-on-info: #08090C;
    --t-info-ui: #5AB1FF;
    --t-on-info-ui: #08090C;
    --t-info-subtle: #0F304C;
    --t-info-text: #5AB1FF;
    --t-annotate: #FF6F7A;
    --t-annotate-hover: #FF888E;
    --t-annotate-pressed: #FF9FA2;
    --t-on-annotate: #08090C;
    --t-annotate-ui: #FF6F7A;
    --t-on-annotate-ui: #08090C;
    --t-annotate-subtle: #4B1D20;
    --t-annotate-text: #FF6F7A;
    --t-note-yellow: #DDCB74;
    --t-note-pink: #E8AFBD;
    --t-note-blue: #9AC8E1;
    --t-note-green: #A4D1AC;
    --t-note-ink: #08090C;
    --t-avatar-1-bg: #283C62;
    --t-avatar-1-fg: #CDDFFF;
    --t-avatar-2-bg: #00464C;
    --t-avatar-2-fg: #87F2FE;
    --t-avatar-3-bg: #1C472A;
    --t-avatar-3-fg: #ACF2BE;
    --t-avatar-4-bg: #4E3A06;
    --t-avatar-4-fg: #FDD990;
    --t-avatar-5-bg: #5C2F1F;
    --t-avatar-5-fg: #FFD3C3;
    --t-avatar-6-bg: #512F4F;
    --t-avatar-6-fg: #FFCAF9;
    --t-shadow-0: none;
    --t-shadow-1: 0 1px 2px #00000052;
    --t-shadow-2: inset 0 1px 0 #FFFFFF0F, 0 2px 6px #00000052, 0 8px 20px #00000070;
    --t-shadow-3: inset 0 1px 0 #FFFFFF0F, 0 4px 12px #00000070, 0 20px 48px #0000008F;
    --t-shadow-4: inset 0 1px 0 #FFFFFF0F, 0 6px 16px #00000070, 0 28px 72px #0000008F;
  }
}

[data-mode="dark"] {
  --t-neutral-0: #FFFFFF;
  --t-neutral-25: #F9FBFE;
  --t-neutral-50: #F5F7FA;
  --t-neutral-100: #EDEFF3;
  --t-neutral-150: #E6E8EC;
  --t-neutral-200: #DCDEE2;
  --t-neutral-300: #C6C9CE;
  --t-neutral-400: #A3A6AC;
  --t-neutral-500: #7D8087;
  --t-neutral-600: #60636A;
  --t-neutral-700: #474A50;
  --t-neutral-800: #303338;
  --t-neutral-850: #25282C;
  --t-neutral-900: #1C1E22;
  --t-neutral-925: #16181C;
  --t-neutral-950: #111317;
  --t-neutral-975: #0D0E12;
  --t-neutral-1000: #08090C;
  --t-bg: #0D0E12;
  --t-surface: #111317;
  --t-surface-raised: #1C1E22;
  --t-surface-sunken: #08090C;
  --t-border: #25282C;
  --t-border-strong: #303338;
  --t-border-control: #7D8087;
  --t-text: #F9FBFE;
  --t-text-secondary: #C6C9CE;
  --t-text-subtle: #A3A6AC;
  --t-text-disabled: #474A50;
  --t-inverse: #E6E8EC;
  --t-on-inverse: #0D0E12;
  --t-chrome: #111317D6;
  --t-hover: #FFFFFF0F;
  --t-pressed: #FFFFFF1A;
  --t-scrim: #00000099;
  --t-sh-1: #00000052;
  --t-sh-2: #00000070;
  --t-sh-3: #0000008F;
  --t-highlight: #FFFFFF0F;
  --t-annotate-halo: #08090C;
  --t-accent: #F5AC3F;
  --t-accent-hover: #FFBA5A;
  --t-accent-pressed: #FFCC8B;
  --t-on-accent: #08090C;
  --t-accent-ui: #F5AC3F;
  --t-on-accent-ui: #08090C;
  --t-accent-subtle: #412800;
  --t-accent-text: #F5AC3F;
  --t-focus: #F5AC3F;
  --t-focus-inverse: #B67800;
  --t-selected: #412800;
  --t-success: #54C57A;
  --t-success-hover: #62D286;
  --t-success-pressed: #70DF93;
  --t-on-success: #08090C;
  --t-success-ui: #54C57A;
  --t-on-success-ui: #08090C;
  --t-success-subtle: #0C371C;
  --t-success-text: #54C57A;
  --t-warning: #F2CF24;
  --t-warning-hover: #FFDC3E;
  --t-warning-pressed: #FFEB9B;
  --t-on-warning: #08090C;
  --t-warning-ui: #F2CF24;
  --t-on-warning-ui: #08090C;
  --t-warning-subtle: #372D00;
  --t-warning-text: #F2CF24;
  --t-danger: #FF645C;
  --t-danger-hover: #FF7F75;
  --t-danger-pressed: #FF968C;
  --t-on-danger: #08090C;
  --t-danger-ui: #FF645C;
  --t-on-danger-ui: #08090C;
  --t-danger-subtle: #4B1E1A;
  --t-danger-text: #FF645C;
  --t-info: #5AB1FF;
  --t-info-hover: #78BEFF;
  --t-info-pressed: #92CAFF;
  --t-on-info: #08090C;
  --t-info-ui: #5AB1FF;
  --t-on-info-ui: #08090C;
  --t-info-subtle: #0F304C;
  --t-info-text: #5AB1FF;
  --t-annotate: #FF6F7A;
  --t-annotate-hover: #FF888E;
  --t-annotate-pressed: #FF9FA2;
  --t-on-annotate: #08090C;
  --t-annotate-ui: #FF6F7A;
  --t-on-annotate-ui: #08090C;
  --t-annotate-subtle: #4B1D20;
  --t-annotate-text: #FF6F7A;
  --t-note-yellow: #DDCB74;
  --t-note-pink: #E8AFBD;
  --t-note-blue: #9AC8E1;
  --t-note-green: #A4D1AC;
  --t-note-ink: #08090C;
  --t-avatar-1-bg: #283C62;
  --t-avatar-1-fg: #CDDFFF;
  --t-avatar-2-bg: #00464C;
  --t-avatar-2-fg: #87F2FE;
  --t-avatar-3-bg: #1C472A;
  --t-avatar-3-fg: #ACF2BE;
  --t-avatar-4-bg: #4E3A06;
  --t-avatar-4-fg: #FDD990;
  --t-avatar-5-bg: #5C2F1F;
  --t-avatar-5-fg: #FFD3C3;
  --t-avatar-6-bg: #512F4F;
  --t-avatar-6-fg: #FFCAF9;
  --t-shadow-0: none;
  --t-shadow-1: 0 1px 2px #00000052;
  --t-shadow-2: inset 0 1px 0 #FFFFFF0F, 0 2px 6px #00000052, 0 8px 20px #00000070;
  --t-shadow-3: inset 0 1px 0 #FFFFFF0F, 0 4px 12px #00000070, 0 20px 48px #0000008F;
  --t-shadow-4: inset 0 1px 0 #FFFFFF0F, 0 6px 16px #00000070, 0 28px 72px #0000008F;
}

/* Reduced-motion contract (see README): no travel, no loops, final frames at once. */
@media (prefers-reduced-motion: reduce) {
  :root { --t-dur-instant: 1ms; --t-dur-fast: 1ms; --t-dur-base: 1ms; --t-dur-slow: 1ms; --t-dur-sheet: 1ms; --t-dur-draw: 1ms; --t-dur-loop: 2400ms; --t-motion-scale: 0; --t-anim-spin: tide-pulse; }
}
[data-motion="reduce"] { --t-dur-instant: 1ms; --t-dur-fast: 1ms; --t-dur-base: 1ms; --t-dur-slow: 1ms; --t-dur-sheet: 1ms; --t-dur-draw: 1ms; --t-dur-loop: 2400ms; --t-motion-scale: 0; --t-anim-spin: tide-pulse; }

}

/* An explicit data-density beats a tenant's default: same layer as themes, higher specificity. */
@layer tide.theme {

:root[data-density="compact"], [data-density="compact"][data-density] {
  --t-density-control: 36px;
  --t-density-row-y: 8px;
  --t-density-card: 12px;
  --t-density-gap: 8px;
}

:root[data-density="standard"], [data-density="standard"][data-density] {
  --t-density-control: 40px;
  --t-density-row-y: 12px;
  --t-density-card: 16px;
  --t-density-gap: 12px;
}

:root[data-density="comfortable"], [data-density="comfortable"][data-density] {
  --t-density-control: 44px;
  --t-density-row-y: 14px;
  --t-density-card: 20px;
  --t-density-gap: 16px;
}

}


/* ---- src/base.css ---- */
/* Tide 2 — base: reset, document type, focus, icons, a few layout utilities.
   Token-only: no literal colors, no literal durations (scripts/check.mjs enforces). */

@layer tide.reset {
  *, *::before, *::after { box-sizing: border-box; }
  html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
  body, h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd, ol, ul { margin: 0; }
  ol[class], ul[class] { padding: 0; list-style: none; }
  img, svg, video, canvas { display: block; max-width: 100%; }
  input, button, textarea, select { font: inherit; color: inherit; letter-spacing: inherit; }
  button { cursor: pointer; }
  table { border-collapse: collapse; }
  dialog { padding: 0; border: 0; color: inherit; max-width: none; max-height: none; }
  [hidden] { display: none !important; }
}

@layer tide.base {
  html {
    background: var(--t-bg);
    scroll-padding-top: calc(var(--t-size-topbar) + var(--t-space-3));
  }
  body {
    min-height: 100dvh;
    background: var(--t-bg);
    color: var(--t-text);
    font-family: var(--t-font-sans);
    font-size: var(--t-fs-base);
    line-height: var(--t-lh-base);
    font-weight: var(--t-weight-regular);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-synthesis-weight: none;
  }
  /* Any element that sets data-mode or data-tenant is a Tide scope: it repaints itself. */
  [data-mode], [data-tenant] { color: var(--t-text); }

  h1, .tide-h1 { font-size: var(--t-fs-xl); line-height: var(--t-lh-xl); letter-spacing: var(--t-tracking-xl); font-weight: var(--t-weight-bold); text-wrap: balance; }
  h2, .tide-h2 { font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); letter-spacing: var(--t-tracking-lg); font-weight: var(--t-weight-semibold); text-wrap: balance; }
  h3, .tide-h3 { font-size: var(--t-fs-md); line-height: var(--t-lh-md); letter-spacing: var(--t-tracking-md); font-weight: var(--t-weight-semibold); }
  h4, .tide-h4 { font-size: var(--t-fs-base); line-height: var(--t-lh-base); font-weight: var(--t-weight-semibold); }
  @media (min-width: 60em) {
    h1, .tide-h1 { font-size: var(--t-fs-2xl); line-height: var(--t-lh-2xl); letter-spacing: var(--t-tracking-2xl); }
  }
  p { text-wrap: pretty; }
  small, .tide-small { font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
  code, kbd, samp, pre { font-family: var(--t-font-mono); font-size: 0.92em; }
  :not(pre) > code {
    padding: 0.1em 0.35em;
    border-radius: var(--t-radius-xs);
    background: var(--t-surface-sunken);
    color: var(--t-text);
  }
  kbd {
    display: inline-block;
    min-width: 1.6em;
    padding: 0 0.4em;
    border: 1px solid var(--t-border-strong);
    border-bottom-width: 2px;
    border-radius: var(--t-radius-xs);
    background: var(--t-surface);
    color: var(--t-text-secondary);
    font-size: var(--t-fs-xs);
    line-height: var(--t-lh-xs);
    text-align: center;
  }
  a { color: var(--t-accent-text); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
  a:hover { text-decoration-thickness: 2px; }
  hr { height: 1px; margin: var(--t-space-4) 0; border: 0; background: var(--t-border); }
  ::selection { background: var(--t-accent-subtle); color: var(--t-text); }
  ::placeholder { color: var(--t-text-subtle); opacity: 1; }

  /* One focus ring for everything: an outline (so it survives forced-colors mode and
     follows border-radius), drawn outside the box, 3:1 on every surface. */
  :focus-visible {
    outline: var(--t-size-focus-width) solid var(--t-focus);
    outline-offset: var(--t-size-focus-offset);
  }
  :focus:not(:focus-visible) { outline: none; }

  .tide-icon {
    width: var(--t-size-icon);
    height: var(--t-size-icon);
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
  }
  .tide-icon[data-size="sm"] { width: var(--t-size-icon-sm); height: var(--t-size-icon-sm); stroke-width: 2; }
  .tide-icon[data-size="lg"] { width: var(--t-size-icon-lg); height: var(--t-size-icon-lg); }

  .tide-skip {
    position: fixed;
    top: var(--t-space-2);
    left: var(--t-space-2);
    z-index: var(--t-z-tooltip);
    padding: var(--t-space-2) var(--t-space-4);
    border-radius: var(--t-radius-md);
    background: var(--t-inverse);
    color: var(--t-on-inverse);
    font-weight: var(--t-weight-semibold);
    text-decoration: none;
    transform: translateY(-200%);
  }
  .tide-skip:focus-visible { transform: none; outline-color: var(--t-focus-inverse); }
}

@layer tide.utilities {
  .tide-sr-only {
    position: absolute !important;
    width: 1px; height: 1px;
    margin: -1px; padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
  }
  .tide-stack { display: flex; flex-direction: column; gap: var(--t-space-4); }
  .tide-stack[data-gap="2"] { gap: var(--t-space-2); }
  .tide-stack[data-gap="3"] { gap: var(--t-space-3); }
  .tide-stack[data-gap="6"] { gap: var(--t-space-6); }
  .tide-cluster { display: flex; flex-wrap: wrap; align-items: center; gap: var(--t-space-2); }
  .tide-cluster[data-gap="3"] { gap: var(--t-space-3); }
  .tide-spread { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); }
  .tide-grow { flex: 1 1 auto; min-width: 0; }
  .tide-mono { font-family: var(--t-font-mono); }
  .tide-num { font-variant-numeric: tabular-nums; }
  .tide-muted { color: var(--t-text-secondary); }
  .tide-subtle { color: var(--t-text-subtle); }
  .tide-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
  .tide-eyebrow {
    color: var(--t-text-subtle);
    font-size: var(--t-fs-xs);
    line-height: var(--t-lh-xs);
    font-weight: var(--t-weight-semibold);
    letter-spacing: 0.06em;
    text-transform: uppercase;
  }
  .tide-lede { color: var(--t-text-secondary); font-size: var(--t-fs-md); line-height: var(--t-lh-md); }
}

/* ---- src/components.css ---- */
/* Tide 2 — components.
   Rules of this file (scripts/check.mjs enforces the first three):
   - colors only through --t-* tokens (plus transparent / currentColor / system colors in forced-colors);
   - durations only through --t-dur-*; travel multiplied by --t-motion-scale;
   - @media / @container widths only at the breakpoint tokens (40em, 60em, 80em);
   - local knobs are --_name, set and read inside one component.
   Class API: .tide-<component>, parts .tide-<component>__<part>, variants as data-* attributes,
   state as ARIA where ARIA has a word for it (aria-selected, aria-current, aria-expanded, aria-busy). */

@layer tide.components {

/* =================================================================== app shell */
.tide-app { container: tide-app / inline-size; }

.tide-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "top" "main" "tabs";
  min-height: 100dvh;
  background: var(--t-bg);
}
.tide-topbar {
  grid-area: top;
  position: sticky;
  top: 0;
  z-index: var(--t-z-chrome);
  display: flex;
  align-items: center;
  gap: var(--t-space-2);
  min-height: calc(var(--t-size-topbar) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) var(--t-space-2) 0 var(--t-space-4);
  background: var(--t-chrome);
  border-bottom: 1px solid var(--t-border);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
}
.tide-topbar__title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--t-fs-md);
  line-height: var(--t-lh-md);
  font-weight: var(--t-weight-semibold);
  letter-spacing: var(--t-tracking-md);
}
.tide-topbar__actions { display: flex; align-items: center; gap: var(--t-space-1); margin-left: auto; }
.tide-topbar .tide-brand__name { display: none; }

.tide-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--t-space-2);
  min-height: var(--t-size-tap);
  color: var(--t-text);
  text-decoration: none;
  font-weight: var(--t-weight-semibold);
}
.tide-brand__logo { width: 28px; height: 28px; flex: none; border-radius: var(--t-radius-sm); }
.tide-brand__mark {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: var(--t-radius-sm);
  background: var(--t-accent);
  color: var(--t-on-accent);
  font-size: var(--t-fs-xs);
  line-height: 1;
  font-weight: var(--t-weight-bold);
}
.tide-brand__name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tide-main {
  grid-area: main;
  width: 100%;
  min-width: 0;
  max-width: var(--t-size-content);
  margin-inline: auto;
  padding: var(--t-space-4) var(--t-space-4) calc(var(--t-size-tabbar) + env(safe-area-inset-bottom, 0px) + var(--t-space-8));
}

.tide-sidebar { display: none; }

.tide-tabbar {
  grid-area: tabs;
  position: fixed;
  inset: auto 0 0 0;
  z-index: var(--t-z-chrome);
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  padding: 0 var(--t-space-1) env(safe-area-inset-bottom, 0px);
  background: var(--t-chrome);
  border-top: 1px solid var(--t-border);
  -webkit-backdrop-filter: saturate(1.4) blur(16px);
  backdrop-filter: saturate(1.4) blur(16px);
}
.tide-tabitem {
  position: relative;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: var(--t-space-0-5);
  min-height: var(--t-size-tabbar);
  padding: var(--t-space-1) 0;
  color: var(--t-text-secondary);
  font-size: var(--t-fs-xs);
  line-height: var(--t-lh-xs);
  font-weight: var(--t-weight-medium);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.tide-tabitem .tide-icon {
  width: 48px;
  height: 28px;
  padding: 2px 12px;
  border-radius: var(--t-radius-full);
  transition: background-color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-tabitem[aria-current="page"] { color: var(--t-text); font-weight: var(--t-weight-semibold); }
.tide-tabitem[aria-current="page"] .tide-icon { background: var(--t-selected); color: var(--t-accent-text); }
.tide-tabitem .tide-count { position: absolute; top: 4px; left: calc(50% + 6px); }
.tide-tabitem:focus-visible { outline-offset: -4px; border-radius: var(--t-radius-md); }

/* contained: the shell scrolls inside its own box (embeds, previews, device frames) */
.tide-shell[data-scroll="contained"] { height: 100%; min-height: 0; overflow: hidden; }
.tide-shell[data-scroll="contained"] .tide-main { overflow: auto; overscroll-behavior: contain; padding-bottom: var(--t-space-8); }
.tide-shell[data-scroll="contained"] .tide-tabbar { position: static; }

@container tide-app (min-width: 60em) {
  .tide-shell {
    grid-template-columns: var(--t-size-sidebar) minmax(0, 1fr);
    grid-template-rows: auto 1fr;
    grid-template-areas: "side top" "side main";
  }
  .tide-shell[data-scroll="contained"] .tide-sidebar { height: 100%; }
  .tide-tabbar { display: none; }
  .tide-topbar { padding-left: var(--t-space-6); }
  .tide-topbar .tide-brand { display: none; }
  .tide-main { padding: var(--t-space-6) var(--t-space-8) var(--t-space-12); }
  .tide-sidebar {
    grid-area: side;
    position: sticky;
    top: 0;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: var(--t-space-1);
    padding: var(--t-space-3) var(--t-space-3) var(--t-space-4);
    overflow-y: auto;
    background: var(--t-surface);
    border-right: 1px solid var(--t-border);
  }
  .tide-sidebar > .tide-brand { padding: 0 var(--t-space-2); margin-bottom: var(--t-space-2); }
}

.tide-nav { display: grid; gap: var(--t-space-0-5); }
.tide-nav__label { padding: var(--t-space-4) var(--t-space-3) var(--t-space-1); }
.tide-navitem {
  position: relative;
  display: flex;
  align-items: center;
  gap: var(--t-space-3);
  min-height: 40px;
  padding: 0 var(--t-space-3);
  border-radius: var(--t-radius-md);
  color: var(--t-text-secondary);
  font-weight: var(--t-weight-medium);
  text-decoration: none;
  transition: background-color var(--t-dur-fast) var(--t-ease-standard), color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-navitem:hover { background: var(--t-hover); color: var(--t-text); }
.tide-navitem[aria-current="page"] { background: var(--t-selected); color: var(--t-text); font-weight: var(--t-weight-semibold); }
.tide-navitem[aria-current="page"] .tide-icon { color: var(--t-accent-text); }
.tide-navitem .tide-count { margin-left: auto; }
.tide-sidebar__foot { margin-top: auto; padding-top: var(--t-space-3); border-top: 1px solid var(--t-border); }

/* page furniture */
.tide-pagehead { display: grid; gap: var(--t-space-1); margin-bottom: var(--t-space-6); }
.tide-pagehead__actions { display: flex; flex-wrap: wrap; gap: var(--t-space-2); margin-top: var(--t-space-3); }
.tide-section { display: grid; gap: var(--t-space-3); }
.tide-section + .tide-section { margin-top: var(--t-space-8); }
.tide-section__head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--t-space-3); }
.tide-split { display: grid; gap: var(--t-space-8); }
@container tide-app (min-width: 60em) {
  .tide-split { grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); align-items: start; }
  .tide-pagehead { grid-template-columns: 1fr auto; align-items: end; }
  .tide-pagehead > :not(.tide-pagehead__actions) { grid-column: 1; }
  .tide-pagehead__actions { grid-column: 2; grid-row: 1 / span 3; margin: 0; }
}

/* =================================================================== mode toggle */
.tide-modetoggle [data-mode-icon="dark"] { display: none; }
[data-mode="dark"] .tide-modetoggle [data-mode-icon="dark"],
.tide-modetoggle[data-mode="dark"] [data-mode-icon="dark"] { display: block; }
[data-mode="dark"] .tide-modetoggle [data-mode-icon="light"],
.tide-modetoggle[data-mode="dark"] [data-mode-icon="light"] { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-mode]) .tide-modetoggle [data-mode-icon="dark"] { display: block; }
  :root:not([data-mode]) .tide-modetoggle [data-mode-icon="light"] { display: none; }
}

/* =================================================================== buttons */
.tide-btn {
  --_bg: var(--t-surface);
  --_fg: var(--t-text);
  --_bd: var(--t-border-strong);
  --_hover: var(--t-hover);
  --_press: var(--t-pressed);
  --_shadow: var(--t-shadow-1);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--t-space-2);
  min-height: var(--t-control-h);
  padding: 0 var(--t-space-4);
  border: 1px solid var(--_bd);
  border-radius: var(--t-radius-md);
  background-color: var(--_bg);
  color: var(--_fg);
  box-shadow: var(--_shadow);
  font-size: var(--t-fs-base);
  line-height: 20px;
  font-weight: var(--t-weight-semibold);
  text-decoration: none;
  white-space: nowrap;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
  transition:
    background-color var(--t-dur-fast) var(--t-ease-standard),
    border-color var(--t-dur-fast) var(--t-ease-standard),
    box-shadow var(--t-dur-fast) var(--t-ease-standard),
    transform var(--t-dur-instant) var(--t-ease-standard);
}
.tide-btn:hover { background-image: linear-gradient(var(--_hover), var(--_hover)); }
.tide-btn:active { background-image: linear-gradient(var(--_press), var(--_press)); transform: translateY(calc(1px * var(--t-motion-scale))); }
.tide-btn[data-variant="primary"] { --_bg: var(--t-accent); --_fg: var(--t-on-accent); --_bd: transparent; }
.tide-btn[data-variant="primary"]:hover { background-image: none; background-color: var(--t-accent-hover); }
.tide-btn[data-variant="primary"]:active { background-image: none; background-color: var(--t-accent-pressed); }
.tide-btn[data-variant="danger"] { --_bg: var(--t-danger); --_fg: var(--t-on-danger); --_bd: transparent; }
.tide-btn[data-variant="danger"]:hover { background-image: none; background-color: var(--t-danger-hover); }
.tide-btn[data-variant="danger"]:active { background-image: none; background-color: var(--t-danger-pressed); }
.tide-btn[data-variant="ghost"] { --_bg: transparent; --_bd: transparent; --_shadow: none; }
.tide-btn[data-variant="ghost"][data-tone="accent"] { --_fg: var(--t-accent-text); }
.tide-btn[data-variant="ghost"][data-tone="danger"] { --_fg: var(--t-danger-text); }
.tide-btn[data-size="sm"] { min-height: 32px; padding: 0 var(--t-space-3); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); gap: var(--t-space-1-5); }
.tide-btn[data-size="lg"] { min-height: 52px; padding: 0 var(--t-space-5); font-size: var(--t-fs-md); line-height: var(--t-lh-md); border-radius: var(--t-radius-lg); }
.tide-btn[data-block] { display: flex; width: 100%; }
.tide-btn:disabled, .tide-btn[aria-disabled="true"] {
  --_bg: var(--t-surface-sunken);
  --_fg: var(--t-text-disabled);
  --_bd: var(--t-border);
  --_shadow: none;
  background-image: none;
  cursor: not-allowed;
  transform: none;
}
.tide-btn[aria-busy="true"] { color: transparent; pointer-events: none; }
.tide-btn[aria-busy="true"] > * { visibility: hidden; }
.tide-btn[aria-busy="true"]::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 18px;
  height: 18px;
  margin: auto;
  border: 2px solid var(--_fg);
  border-right-color: transparent;
  border-radius: var(--t-radius-full);
  animation: var(--t-anim-spin) var(--t-dur-loop) linear infinite;
}
.tide-btnrow { display: flex; flex-wrap: wrap; gap: var(--t-space-2); }
.tide-btnrow[data-stack] > .tide-btn { flex: 1 1 160px; }

.tide-iconbtn {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--t-control-h);
  height: var(--t-control-h);
  min-width: var(--t-size-tap);
  min-height: var(--t-size-tap);
  padding: 0;
  border: 0;
  border-radius: var(--t-radius-md);
  background: transparent;
  color: var(--t-text-secondary);
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--t-dur-fast) var(--t-ease-standard), color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-iconbtn:hover { background: var(--t-hover); color: var(--t-text); }
.tide-iconbtn:active { background: var(--t-pressed); }
.tide-iconbtn[data-variant="filled"] { background: var(--t-surface-sunken); color: var(--t-text); }
.tide-iconbtn[data-variant="primary"] { background: var(--t-accent); color: var(--t-on-accent); }
.tide-iconbtn[data-variant="primary"]:hover { background: var(--t-accent-hover); }
.tide-iconbtn:disabled { color: var(--t-text-disabled); background: transparent; cursor: not-allowed; }
.tide-iconbtn .tide-count { position: absolute; top: 4px; right: 2px; }

/* =================================================================== form controls */
.tide-field { display: grid; gap: var(--t-space-1-5); min-width: 0; }
.tide-label { color: var(--t-text); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-semibold); }
.tide-label__opt { color: var(--t-text-subtle); font-weight: var(--t-weight-regular); }
.tide-hint { color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-error {
  display: flex;
  align-items: flex-start;
  gap: var(--t-space-1-5);
  color: var(--t-danger-text);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
  font-weight: var(--t-weight-medium);
}
.tide-error .tide-icon { width: 16px; height: 16px; margin-top: 1px; }

.tide-input, .tide-select, .tide-textarea {
  width: 100%;
  min-width: 0;
  min-height: var(--t-control-h);
  padding: 0 var(--t-space-3);
  border: 1px solid var(--t-border-control);
  border-radius: var(--t-radius-md);
  background-color: var(--t-surface);
  color: var(--t-text);
  font-size: var(--t-fs-control);
  line-height: var(--t-lh-control);
  transition: border-color var(--t-dur-fast) var(--t-ease-standard), background-color var(--t-dur-fast) var(--t-ease-standard);
  -webkit-appearance: none;
  appearance: none;
}
.tide-input:hover, .tide-select:hover, .tide-textarea:hover { border-color: var(--t-text-subtle); }
.tide-input:focus, .tide-select:focus, .tide-textarea:focus {
  border-color: var(--t-accent-ui);
  outline: var(--t-size-focus-width) solid var(--t-focus);
  outline-offset: 0;
}
.tide-input[aria-invalid="true"], .tide-select[aria-invalid="true"], .tide-textarea[aria-invalid="true"] { border-color: var(--t-danger-ui); }
.tide-input[aria-invalid="true"]:focus, .tide-textarea[aria-invalid="true"]:focus { outline-color: var(--t-danger-ui); }
.tide-input:disabled, .tide-select:disabled, .tide-textarea:disabled {
  border-color: var(--t-border);
  background-color: var(--t-surface-sunken);
  color: var(--t-text-disabled);
  cursor: not-allowed;
}
.tide-input[readonly], .tide-textarea[readonly] { background-color: var(--t-surface-sunken); }
.tide-input[type="search"]::-webkit-search-decoration { -webkit-appearance: none; }
.tide-textarea { min-height: 96px; padding: var(--t-space-2) var(--t-space-3); resize: vertical; field-sizing: content; }
.tide-select {
  padding-right: var(--t-space-10);
  background-image:
    linear-gradient(45deg, transparent 50%, currentColor 50%),
    linear-gradient(135deg, currentColor 50%, transparent 50%);
  background-position: calc(100% - 19px) 52%, calc(100% - 14px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
}

.tide-inputgroup {
  display: flex;
  align-items: center;
  min-height: var(--t-control-h);
  border: 1px solid var(--t-border-control);
  border-radius: var(--t-radius-md);
  background: var(--t-surface);
  color: var(--t-text-subtle);
  transition: border-color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-inputgroup:hover { border-color: var(--t-text-subtle); }
.tide-inputgroup:focus-within { border-color: var(--t-accent-ui); outline: var(--t-size-focus-width) solid var(--t-focus); outline-offset: 0; }
.tide-inputgroup > .tide-icon { margin-left: var(--t-space-3); }
.tide-inputgroup__affix { padding: 0 var(--t-space-3); color: var(--t-text-subtle); font-size: var(--t-fs-sm); white-space: nowrap; }
.tide-inputgroup .tide-input { flex: 1; border: 0; background: transparent; min-height: calc(var(--t-control-h) - 2px); outline: none; }
.tide-inputgroup .tide-input:focus { outline: none; }
.tide-inputgroup kbd { margin-right: var(--t-space-3); }

.tide-check, .tide-radio {
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 20px;
  height: 20px;
  margin: 0;
  border: 1.5px solid var(--t-border-control);
  border-radius: var(--t-radius-xs);
  background: var(--t-surface);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--t-dur-fast) var(--t-ease-standard), border-color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-radio { border-radius: var(--t-radius-full); }
.tide-check::before {
  content: "";
  width: 11px;
  height: 6px;
  margin-top: -3px;
  border: solid var(--t-on-accent-ui);
  border-width: 0 0 2.25px 2.25px;
  transform: rotate(-45deg) scale(0);
  transition: transform var(--t-dur-fast) var(--t-ease-enter);
}
.tide-radio::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: var(--t-radius-full);
  background: var(--t-accent-ui);
  transform: scale(0);
  transition: transform var(--t-dur-fast) var(--t-ease-enter);
}
.tide-check:checked, .tide-check:indeterminate { border-color: var(--t-accent-ui); background: var(--t-accent-ui); }
.tide-check:checked::before { transform: rotate(-45deg) scale(1); }
.tide-check:indeterminate::before { width: 10px; height: 0; margin: 0; border-width: 0 0 2.25px 0; transform: none; }
.tide-radio:checked { border-color: var(--t-accent-ui); }
.tide-radio:checked::before { transform: scale(1); }
.tide-check:disabled, .tide-radio:disabled { border-color: var(--t-border); background: var(--t-surface-sunken); cursor: not-allowed; }
.tide-check[aria-invalid="true"], .tide-radio[aria-invalid="true"] { border-color: var(--t-danger-ui); }

.tide-switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin: 0;
  border: 0;
  border-radius: var(--t-radius-full);
  background: var(--t-border-control);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: background-color var(--t-dur-base) var(--t-ease-standard);
}
.tide-switch::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--t-radius-full);
  background: var(--t-surface-raised);
  box-shadow: var(--t-shadow-1);
  transition: translate var(--t-dur-base) var(--t-ease-standard);
}
.tide-switch:checked { background: var(--t-accent-ui); }
.tide-switch:checked::before { translate: 18px 0; background: var(--t-on-accent-ui); }
.tide-switch:disabled { opacity: 0.5; cursor: not-allowed; }

.tide-choice {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  column-gap: var(--t-space-3);
  min-height: var(--t-size-tap);
  padding: var(--t-space-2) 0;
  cursor: pointer;
}
.tide-choice > .tide-check, .tide-choice > .tide-radio { margin-top: 1px; }
.tide-choice > .tide-switch { grid-column: 2; grid-row: 1 / span 2; justify-self: end; align-self: center; }
.tide-choice:has(> .tide-switch) { grid-template-columns: 1fr auto; }
.tide-choice:has(> .tide-switch) > .tide-choice__text { grid-column: 1; grid-row: 1; }
.tide-choice__title { font-weight: var(--t-weight-medium); }
.tide-choice__hint { display: block; color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-choicegroup { display: grid; gap: 0; border: 0; margin: 0; padding: 0; min-width: 0; }
.tide-choicegroup > legend { padding: 0; margin-bottom: var(--t-space-1); }

/* =================================================================== surfaces */
.tide-card {
  display: flex;
  flex-direction: column;
  gap: var(--t-space-3);
  min-width: 0;
  padding: var(--t-density-card);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  color: var(--t-text);
  box-shadow: var(--t-shadow-1);
}
.tide-card__head { display: flex; align-items: flex-start; gap: var(--t-space-3); }
.tide-card__title { font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); letter-spacing: var(--t-tracking-md); }
.tide-card__meta { color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-card__body { color: var(--t-text-secondary); }
.tide-card__foot { display: flex; flex-wrap: wrap; align-items: center; gap: var(--t-space-2); margin-top: auto; padding-top: var(--t-space-1); }
a.tide-card, .tide-card[data-interactive] {
  text-decoration: none;
  transition: border-color var(--t-dur-fast) var(--t-ease-standard), box-shadow var(--t-dur-base) var(--t-ease-standard), transform var(--t-dur-base) var(--t-ease-standard);
}
a.tide-card:hover, .tide-card[data-interactive]:hover { border-color: var(--t-border-strong); box-shadow: var(--t-shadow-2); }
a.tide-card:active, .tide-card[data-interactive]:active { transform: translateY(calc(1px * var(--t-motion-scale))); }
.tide-card[aria-current="true"], .tide-card[data-selected] { border-color: var(--t-accent-ui); box-shadow: 0 0 0 1px var(--t-accent-ui), var(--t-shadow-1); }

.tide-glyph {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--t-radius-md);
  background: var(--t-accent-subtle);
  color: var(--t-accent-text);
}
.tide-glyph[data-size="lg"] { width: 44px; height: 44px; border-radius: var(--t-radius-lg); }
.tide-glyph[data-size="lg"] .tide-icon { width: 24px; height: 24px; }
.tide-glyph[data-tone="neutral"] { background: var(--t-surface-sunken); color: var(--t-text-secondary); }
.tide-glyph[data-tone="success"] { background: var(--t-success-subtle); color: var(--t-success-text); }
.tide-glyph[data-tone="warning"] { background: var(--t-warning-subtle); color: var(--t-warning-text); }
.tide-glyph[data-tone="danger"] { background: var(--t-danger-subtle); color: var(--t-danger-text); }
.tide-glyph[data-tone="info"] { background: var(--t-info-subtle); color: var(--t-info-text); }

/* =================================================================== list rows */
.tide-list {
  overflow: hidden;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  box-shadow: var(--t-shadow-1);
}
.tide-list > li + li { border-top: 1px solid var(--t-border); }
.tide-list[data-flush] { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
.tide-row {
  display: flex;
  align-items: center;
  gap: var(--t-space-3);
  min-height: 56px;
  padding: var(--t-density-row-y) var(--t-space-4);
  color: var(--t-text);
  text-decoration: none;
  transition: background-color var(--t-dur-fast) var(--t-ease-standard);
}
a.tide-row:hover, button.tide-row:hover, label.tide-row:hover { background: var(--t-hover); }
a.tide-row:focus-visible, button.tide-row:focus-visible { outline-offset: -2px; border-radius: var(--t-radius-lg); }
button.tide-row { width: 100%; border: 0; background: transparent; text-align: left; }
.tide-row[aria-current="true"], .tide-row[aria-selected="true"] { background: var(--t-selected); }
.tide-row[data-unread] .tide-row__title { font-weight: var(--t-weight-semibold); }
.tide-row[data-unread]::before {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-right: calc(var(--t-space-1) * -1);
  border-radius: var(--t-radius-full);
  background: var(--t-accent-ui);
}
.tide-row__lead { flex: none; display: flex; }
.tide-row__main { flex: 1 1 auto; min-width: 0; display: grid; gap: 2px; }
.tide-row__title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: var(--t-weight-medium); }
.tide-row__meta { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-row__trail {
  flex: none;
  display: flex;
  align-items: center;
  gap: var(--t-space-2);
  color: var(--t-text-subtle);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
  font-variant-numeric: tabular-nums;
}
.tide-row__trail > .tide-icon:last-child { color: var(--t-text-subtle); }

/* =================================================================== badges */
.tide-badge {
  --_bg: var(--t-surface-sunken);
  --_fg: var(--t-text-secondary);
  --_dot: var(--t-text-subtle);
  display: inline-flex;
  align-items: center;
  gap: var(--t-space-1-5);
  height: 22px;
  padding: 0 var(--t-space-2);
  border-radius: var(--t-radius-full);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--t-fs-xs);
  line-height: var(--t-lh-xs);
  font-weight: var(--t-weight-semibold);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.tide-badge .tide-icon { width: 14px; height: 14px; stroke-width: 2.25; }
.tide-badge[data-tone="accent"]  { --_bg: var(--t-accent-subtle);  --_fg: var(--t-accent-text);  --_dot: var(--t-accent-ui); }
.tide-badge[data-tone="success"] { --_bg: var(--t-success-subtle); --_fg: var(--t-success-text); --_dot: var(--t-success-ui); }
.tide-badge[data-tone="warning"] { --_bg: var(--t-warning-subtle); --_fg: var(--t-warning-text); --_dot: var(--t-warning-ui); }
.tide-badge[data-tone="danger"]  { --_bg: var(--t-danger-subtle);  --_fg: var(--t-danger-text);  --_dot: var(--t-danger-ui); }
.tide-badge[data-tone="info"]    { --_bg: var(--t-info-subtle);    --_fg: var(--t-info-text);    --_dot: var(--t-info-ui); }
.tide-badge[data-solid][data-tone="success"] { --_bg: var(--t-success); --_fg: var(--t-on-success); }
.tide-badge[data-solid][data-tone="warning"] { --_bg: var(--t-warning); --_fg: var(--t-on-warning); }
.tide-badge[data-solid][data-tone="danger"]  { --_bg: var(--t-danger);  --_fg: var(--t-on-danger); }
.tide-badge[data-solid][data-tone="info"]    { --_bg: var(--t-info);    --_fg: var(--t-on-info); }
.tide-badge[data-solid][data-tone="accent"]  { --_bg: var(--t-accent);  --_fg: var(--t-on-accent); }
.tide-badge[data-dot]::before { content: ""; width: 6px; height: 6px; border-radius: var(--t-radius-full); background: var(--_dot); }
.tide-badge[data-dot][data-live]::before { animation: tide-pulse var(--t-dur-loop) ease-in-out infinite alternate; }
.tide-badge[data-shape="square"] { border-radius: var(--t-radius-xs); }
.tide-count {
  display: inline-grid;
  place-items: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--t-radius-full);
  background: var(--t-accent);
  color: var(--t-on-accent);
  font-size: var(--t-fs-xs);
  line-height: 1;
  font-weight: var(--t-weight-bold);
  font-variant-numeric: tabular-nums;
}
.tide-count[data-tone="neutral"] { background: var(--t-surface-sunken); color: var(--t-text-secondary); }

/* =================================================================== tabs + segmented */
.tide-tabs {
  display: flex;
  gap: var(--t-space-1);
  overflow-x: auto;
  border-bottom: 1px solid var(--t-border);
  scrollbar-width: none;
}
.tide-tabs::-webkit-scrollbar { display: none; }
.tide-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--t-space-2);
  flex: none;
  min-height: var(--t-size-tap);
  padding: 0 var(--t-space-3);
  border: 0;
  background: transparent;
  color: var(--t-text-secondary);
  font-weight: var(--t-weight-medium);
  white-space: nowrap;
  transition: color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-tab:hover { color: var(--t-text); }
.tide-tab::after {
  content: "";
  position: absolute;
  inset: auto var(--t-space-2) -1px;
  height: 2px;
  border-radius: var(--t-radius-full);
  background: transparent;
  transition: background-color var(--t-dur-base) var(--t-ease-standard);
}
.tide-tab[aria-selected="true"] { color: var(--t-text); font-weight: var(--t-weight-semibold); }
.tide-tab[aria-selected="true"]::after { background: var(--t-accent-ui); }
.tide-tab:focus-visible { outline-offset: -4px; border-radius: var(--t-radius-md); }
.tide-tabpanel { padding-top: var(--t-space-4); }
.tide-tabpanel:focus-visible { outline-offset: 4px; border-radius: var(--t-radius-sm); }

.tide-segmented {
  display: inline-grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--t-border);
  border-radius: calc(var(--t-radius-md) + 3px);
  background: var(--t-surface-sunken);
}
.tide-segmented[data-block] { display: grid; width: 100%; }
.tide-segmented label { position: relative; display: grid; cursor: pointer; }
.tide-segmented input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: pointer; }
.tide-segmented span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--t-space-1-5);
  min-height: calc(var(--t-control-h) - 8px);
  padding: 0 var(--t-space-3);
  border-radius: var(--t-radius-md);
  color: var(--t-text-secondary);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
  font-weight: var(--t-weight-semibold);
  white-space: nowrap;
  transition: background-color var(--t-dur-fast) var(--t-ease-standard), color var(--t-dur-fast) var(--t-ease-standard), box-shadow var(--t-dur-fast) var(--t-ease-standard);
}
.tide-segmented label:hover span { color: var(--t-text); }
.tide-segmented input:checked + span { background: var(--t-surface-raised); color: var(--t-text); box-shadow: var(--t-shadow-1), 0 0 0 1px var(--t-border); }
.tide-segmented input:focus-visible + span { outline: var(--t-size-focus-width) solid var(--t-focus); outline-offset: 1px; }
.tide-segmented input:disabled + span { color: var(--t-text-disabled); cursor: not-allowed; }

/* =================================================================== sheet + dialog + palette (native <dialog>) */
.tide-sheet, .tide-dialog, .tide-palette {
  color: var(--t-text);
  background: var(--t-surface-raised);
  box-shadow: var(--t-shadow-3);
  opacity: 0;
  transition:
    opacity var(--t-dur-fade) var(--t-ease-standard),
    transform var(--t-dur-sheet) var(--t-ease-enter);
}
.tide-sheet::backdrop, .tide-dialog::backdrop, .tide-palette::backdrop {
  background: var(--t-scrim);
  opacity: 0;
  transition: opacity var(--t-dur-base) var(--t-ease-standard);
}
.tide-sheet[data-state="open"], .tide-dialog[data-state="open"], .tide-palette[data-state="open"] { opacity: 1; transform: none; }
.tide-sheet[data-state="open"]::backdrop, .tide-dialog[data-state="open"]::backdrop, .tide-palette[data-state="open"]::backdrop { opacity: 1; }
.tide-sheet[data-state="closing"], .tide-dialog[data-state="closing"], .tide-palette[data-state="closing"] {
  transition-duration: var(--t-dur-fade), var(--t-dur-base);
  transition-timing-function: var(--t-ease-exit);
}

.tide-sheet {
  --_drag: 0px;
  position: fixed;
  inset: auto 0 0 0;
  width: 100%;
  max-width: var(--t-size-sheet);
  max-height: calc(100dvh - var(--t-space-6) - env(safe-area-inset-top, 0px));
  margin: 0 auto;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--t-radius-xl) var(--t-radius-xl) 0 0;
  transform: translateY(calc(100% * var(--t-motion-scale)));
  overscroll-behavior: contain;
}
.tide-sheet[open] { display: flex; }
.tide-sheet[data-state="open"] { transform: translateY(var(--_drag)); }
.tide-sheet[data-dragging] { transition: none; }
.tide-sheet__handle {
  display: grid;
  place-items: center;
  width: 100%;
  height: 24px;
  flex: none;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: grab;
  touch-action: none;
}
.tide-sheet__handle::before { content: ""; width: 40px; height: 5px; border-radius: var(--t-radius-full); background: var(--t-border-strong); }
.tide-sheet__handle:focus-visible { outline-offset: -4px; }
.tide-sheet__head { display: flex; align-items: center; gap: var(--t-space-3); padding: 0 var(--t-space-2) var(--t-space-2) var(--t-space-5); }
.tide-sheet__title { flex: 1; min-width: 0; font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-semibold); letter-spacing: var(--t-tracking-lg); }
.tide-sheet__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--t-space-1) var(--t-space-5) var(--t-space-5); overscroll-behavior: contain; }
.tide-sheet__foot {
  display: flex;
  gap: var(--t-space-2);
  padding: var(--t-space-3) var(--t-space-5) calc(var(--t-space-3) + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--t-border);
  background: var(--t-surface-raised);
}
.tide-sheet__foot > .tide-btn { flex: 1 1 0; }
@media (min-width: 40em) {
  .tide-sheet { bottom: var(--t-space-4); border-radius: var(--t-radius-xl); }
  .tide-sheet__foot { padding-bottom: var(--t-space-3); }
}

.tide-dialog {
  position: fixed;
  inset: 0;
  width: min(100% - var(--t-space-8), var(--t-size-dialog));
  height: fit-content;
  max-height: calc(100dvh - var(--t-space-8));
  margin: auto;
  padding: var(--t-space-6);
  overflow-y: auto;
  border-radius: var(--t-radius-xl);
  box-shadow: var(--t-shadow-4);
  transform: scale(calc(1 - 0.04 * var(--t-motion-scale)));
}
.tide-dialog[open] { display: grid; gap: var(--t-space-3); }
.tide-dialog__title { font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-semibold); letter-spacing: var(--t-tracking-lg); }
.tide-dialog__body { color: var(--t-text-secondary); }
.tide-dialog__actions { display: flex; flex-direction: column-reverse; gap: var(--t-space-2); margin-top: var(--t-space-2); }
@media (min-width: 40em) {
  .tide-dialog__actions { flex-direction: row; justify-content: flex-end; }
}

.tide-palette {
  position: fixed;
  inset: 0;
  width: min(100% - var(--t-space-4), 640px);
  height: fit-content;
  max-height: min(560px, 100dvh - var(--t-space-8));
  margin: calc(env(safe-area-inset-top, 0px) + var(--t-space-2)) auto auto;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--t-radius-xl);
  box-shadow: var(--t-shadow-4);
  transform: translateY(calc(-8px * var(--t-motion-scale)));
}
.tide-palette[open] { display: flex; }
@media (min-width: 40em) { .tide-palette { margin-top: 12dvh; } }
.tide-palette__search { display: flex; align-items: center; gap: var(--t-space-3); padding: 0 var(--t-space-4); border-bottom: 1px solid var(--t-border); color: var(--t-text-subtle); }
.tide-palette__search:focus-within { box-shadow: inset 0 -2px 0 var(--t-accent-ui); }
.tide-palette__input {
  flex: 1;
  min-width: 0;
  height: 56px;
  border: 0;
  background: transparent;
  color: var(--t-text);
  font-size: var(--t-fs-md);
  line-height: var(--t-lh-md);
  outline: none;
}
.tide-palette__input:focus { outline: none; }
.tide-palette__list { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--t-space-2); overscroll-behavior: contain; }
.tide-palette__group { padding: var(--t-space-3) var(--t-space-3) var(--t-space-1); }
.tide-palette__item {
  display: flex;
  align-items: center;
  gap: var(--t-space-3);
  min-height: 48px;
  padding: var(--t-space-2) var(--t-space-3);
  border-radius: var(--t-radius-md);
  color: var(--t-text);
  cursor: pointer;
}
.tide-palette__item[aria-selected="true"] { background: var(--t-selected); }
.tide-palette__item mark { background: transparent; color: var(--t-accent-text); font-weight: var(--t-weight-semibold); }
.tide-palette__label { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tide-palette__meta { margin-left: auto; color: var(--t-text-subtle); font-size: var(--t-fs-sm); white-space: nowrap; }
.tide-palette__empty { padding: var(--t-space-8) var(--t-space-4); color: var(--t-text-subtle); text-align: center; }
.tide-palette__foot { display: flex; flex-wrap: wrap; gap: var(--t-space-4); padding: var(--t-space-2) var(--t-space-4); border-top: 1px solid var(--t-border); color: var(--t-text-subtle); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); }

/* =================================================================== launcher grid */
.tide-launcher { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--t-density-gap); }
.tide-tile {
  position: relative;
  display: grid;
  align-content: start;
  gap: var(--t-space-1);
  min-height: 128px;
  padding: var(--t-space-4);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  color: var(--t-text);
  box-shadow: var(--t-shadow-1);
  text-decoration: none;
  transition: border-color var(--t-dur-fast) var(--t-ease-standard), box-shadow var(--t-dur-base) var(--t-ease-standard), transform var(--t-dur-base) var(--t-ease-standard);
}
.tide-tile:hover { border-color: var(--t-border-strong); box-shadow: var(--t-shadow-2); }
.tide-tile:active { transform: translateY(calc(1px * var(--t-motion-scale))); }
.tide-tile .tide-glyph { margin-bottom: var(--t-space-2); }
.tide-tile__name { font-weight: var(--t-weight-semibold); }
.tide-tile__sub { color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-tile > .tide-count { position: absolute; top: var(--t-space-3); right: var(--t-space-3); }

/* =================================================================== toast */
.tide-toaster {
  position: fixed;
  inset: auto 0 calc(var(--t-space-4) + env(safe-area-inset-bottom, 0px)) 0;
  z-index: var(--t-z-toast);
  display: grid;
  justify-items: center;
  gap: var(--t-space-2);
  padding: 0 var(--t-space-3);
  pointer-events: none;
}
.tide-app:has(.tide-tabbar) .tide-toaster { bottom: calc(var(--t-size-tabbar) + var(--t-space-3) + env(safe-area-inset-bottom, 0px)); }
@container tide-app (min-width: 60em) {
  .tide-app:has(.tide-tabbar) .tide-toaster, .tide-toaster { bottom: var(--t-space-6); left: auto; right: var(--t-space-6); justify-items: end; }
}
.tide-toast {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--t-space-3);
  width: min(100%, 420px);
  padding: var(--t-space-3) var(--t-space-2) var(--t-space-3) var(--t-space-4);
  border-radius: var(--t-radius-lg);
  background: var(--t-inverse);
  color: var(--t-on-inverse);
  box-shadow: var(--t-shadow-4);
  pointer-events: auto;
  opacity: 0;
  transform: translateY(calc(12px * var(--t-motion-scale)));
  transition: opacity var(--t-dur-fade) var(--t-ease-standard), transform var(--t-dur-slow) var(--t-ease-enter);
}
.tide-toast[data-state="open"] { opacity: 1; transform: none; }
.tide-toast[data-state="closing"] { opacity: 0; transition-timing-function: var(--t-ease-exit); }
.tide-toast > .tide-icon { margin-top: 1px; }
.tide-toast__title { font-weight: var(--t-weight-semibold); }
.tide-toast__body { font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-toast__actions { display: flex; align-items: center; gap: var(--t-space-1); margin: -6px 0; }
.tide-toast .tide-btn[data-variant="ghost"] { --_fg: var(--t-on-inverse); text-decoration: underline; text-underline-offset: 0.2em; }
.tide-toast .tide-iconbtn { color: var(--t-on-inverse); width: 36px; height: 36px; min-width: 36px; min-height: 36px; }
.tide-toast :focus-visible { outline-color: var(--t-focus-inverse); }

/* =================================================================== states */
.tide-empty {
  display: grid;
  justify-items: center;
  gap: var(--t-space-2);
  padding: var(--t-space-10) var(--t-space-6);
  border: 1px dashed var(--t-border-strong);
  border-radius: var(--t-radius-lg);
  text-align: center;
}
.tide-empty .tide-glyph { margin-bottom: var(--t-space-2); }
.tide-empty__title { font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); }
.tide-empty__body { max-width: 38ch; color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-empty .tide-btnrow { justify-content: center; margin-top: var(--t-space-2); }

.tide-loading { display: inline-flex; align-items: center; gap: var(--t-space-2); color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-spinner {
  display: inline-block;
  flex: none;
  width: 20px;
  height: 20px;
  border: 2px solid var(--t-border-strong);
  border-top-color: var(--t-accent-ui);
  border-radius: var(--t-radius-full);
  animation: var(--t-anim-spin) var(--t-dur-loop) linear infinite;
}
.tide-spinner[data-size="sm"] { width: 14px; height: 14px; border-width: 2px; }
.tide-spinner[data-size="lg"] { width: 32px; height: 32px; border-width: 3px; }
.tide-skeleton {
  display: block;
  height: 12px;
  border-radius: var(--t-radius-sm);
  background: var(--t-surface-sunken);
  animation: tide-pulse var(--t-dur-loop) ease-in-out infinite alternate;
}
.tide-skeleton[data-shape="title"] { height: 18px; width: 55%; }
.tide-skeleton[data-shape="line"] { width: 100%; }
.tide-skeleton[data-shape="short"] { width: 40%; }
.tide-skeleton[data-shape="block"] { height: 96px; border-radius: var(--t-radius-lg); }
.tide-skeleton[data-shape="circle"] { width: 36px; height: 36px; border-radius: var(--t-radius-full); }
.tide-skeletonrow { display: flex; align-items: center; gap: var(--t-space-3); padding: var(--t-space-3) var(--t-space-4); }
.tide-skeletonrow > div { flex: 1; display: grid; gap: var(--t-space-2); }

.tide-alert {
  --_bg: var(--t-info-subtle);
  --_fg: var(--t-info-text);
  --_bd: var(--t-info-ui);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: var(--t-space-1) var(--t-space-3);
  padding: var(--t-space-3) var(--t-space-4);
  border: 1px solid var(--_bd);
  border-left-width: 4px;
  border-radius: var(--t-radius-md);
  background: var(--_bg);
  color: var(--t-text);
}
.tide-alert > .tide-icon { grid-row: 1 / span 3; margin-top: 1px; color: var(--_fg); }
.tide-alert__title { font-weight: var(--t-weight-semibold); color: var(--_fg); }
.tide-alert__body { color: var(--t-text); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-alert .tide-btnrow { margin-top: var(--t-space-2); }
.tide-alert[data-tone="success"] { --_bg: var(--t-success-subtle); --_fg: var(--t-success-text); --_bd: var(--t-success-ui); }
.tide-alert[data-tone="warning"] { --_bg: var(--t-warning-subtle); --_fg: var(--t-warning-text); --_bd: var(--t-warning-ui); }
.tide-alert[data-tone="danger"]  { --_bg: var(--t-danger-subtle);  --_fg: var(--t-danger-text);  --_bd: var(--t-danger-ui); }

.tide-progress {
  display: block;
  width: 100%;
  height: 6px;
  border: 0;
  border-radius: var(--t-radius-full);
  background: var(--t-surface-sunken);
  overflow: hidden;
  -webkit-appearance: none;
  appearance: none;
}
.tide-progress::-webkit-progress-bar { background: var(--t-surface-sunken); border-radius: var(--t-radius-full); }
.tide-progress::-webkit-progress-value { background: var(--t-accent-ui); border-radius: var(--t-radius-full); transition: width var(--t-dur-slow) var(--t-ease-standard); }
.tide-progress::-moz-progress-bar { background: var(--t-accent-ui); border-radius: var(--t-radius-full); }
.tide-progress[data-tone="danger"]::-webkit-progress-value { background: var(--t-danger-ui); }
.tide-progress[data-tone="danger"]::-moz-progress-bar { background: var(--t-danger-ui); }

/* =================================================================== avatars */
.tide-avatar {
  --_size: 32px;
  --_bg: var(--t-avatar-1-bg);
  --_fg: var(--t-avatar-1-fg);
  position: relative;
  display: inline-grid;
  place-items: center;
  flex: none;
  width: var(--_size);
  height: var(--_size);
  border-radius: var(--t-radius-full);
  background: var(--_bg);
  color: var(--_fg);
  font-size: var(--t-fs-xs);
  line-height: 1;
  font-weight: var(--t-weight-semibold);
  letter-spacing: 0.02em;
  user-select: none;
}
.tide-avatar[data-color="2"] { --_bg: var(--t-avatar-2-bg); --_fg: var(--t-avatar-2-fg); }
.tide-avatar[data-color="3"] { --_bg: var(--t-avatar-3-bg); --_fg: var(--t-avatar-3-fg); }
.tide-avatar[data-color="4"] { --_bg: var(--t-avatar-4-bg); --_fg: var(--t-avatar-4-fg); }
.tide-avatar[data-color="5"] { --_bg: var(--t-avatar-5-bg); --_fg: var(--t-avatar-5-fg); }
.tide-avatar[data-color="6"] { --_bg: var(--t-avatar-6-bg); --_fg: var(--t-avatar-6-fg); }
.tide-avatar[data-agent] { --_bg: var(--t-accent-subtle); --_fg: var(--t-accent-text); box-shadow: inset 0 0 0 1.5px var(--t-accent-ui); }
.tide-avatar[data-size="sm"] { --_size: 24px; font-size: 10px; }
.tide-avatar[data-size="lg"] { --_size: 40px; font-size: var(--t-fs-sm); }
.tide-avatar[data-size="xl"] { --_size: 56px; font-size: var(--t-fs-lg); }
.tide-avatar > img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.tide-avatar > .tide-icon { width: 60%; height: 60%; }
.tide-avatar[data-status]::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 10px;
  height: 10px;
  border: 2px solid var(--t-surface);
  border-radius: var(--t-radius-full);
  background: var(--t-text-subtle);
}
.tide-avatar[data-status="online"]::after { background: var(--t-success-ui); }
.tide-avatar[data-status="away"]::after { background: var(--t-warning-ui); }
.tide-avatars { display: inline-flex; align-items: center; }
.tide-avatars > .tide-avatar + .tide-avatar { margin-left: -8px; box-shadow: 0 0 0 2px var(--t-surface); }

/* =================================================================== timeline / run steps */
.tide-steps { display: grid; }
.tide-step {
  --_line: var(--t-border-strong);
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  column-gap: var(--t-space-3);
  padding-bottom: var(--t-space-5);
}
.tide-step::before {
  content: "";
  position: absolute;
  top: 32px;
  bottom: 4px;
  left: 13px;
  width: 2px;
  border-radius: var(--t-radius-full);
  background: var(--_line);
}
.tide-step:last-child { padding-bottom: 0; }
.tide-step:last-child::before { display: none; }
.tide-step__marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 2px solid var(--t-border-control);
  border-radius: var(--t-radius-full);
  background: var(--t-surface);
  color: var(--t-text-subtle);
}
.tide-step__marker .tide-icon { width: 15px; height: 15px; stroke-width: 2.5; }
.tide-step__body { display: grid; gap: 2px; min-width: 0; padding-top: 3px; }
.tide-step__title { font-weight: var(--t-weight-medium); }
.tide-step__meta { color: var(--t-text-subtle); font-family: var(--t-font-mono); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); font-variant-numeric: tabular-nums; }
.tide-step__detail {
  margin-top: var(--t-space-2);
  padding: var(--t-space-3);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-md);
  background: var(--t-surface-sunken);
  color: var(--t-text-secondary);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
}
.tide-step__detail .tide-btnrow { margin-top: var(--t-space-3); }
.tide-step[data-state="done"] { --_line: var(--t-success-ui); }
.tide-step[data-state="done"] .tide-step__marker { border-color: var(--t-success); background: var(--t-success); color: var(--t-on-success); }
.tide-step[data-state="running"] .tide-step__marker { border-color: var(--t-accent-ui); color: var(--t-accent-text); }
.tide-step[data-state="running"] .tide-step__marker::after {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid var(--t-accent-ui);
  border-right-color: transparent;
  border-radius: var(--t-radius-full);
  animation: var(--t-anim-spin) var(--t-dur-loop) linear infinite;
}
.tide-step[data-state="waiting"] .tide-step__marker { border-color: var(--t-warning-ui); background: var(--t-warning-subtle); color: var(--t-warning-text); }
.tide-step[data-state="waiting"] .tide-step__title { font-weight: var(--t-weight-semibold); }
.tide-step[data-state="failed"] .tide-step__marker { border-color: var(--t-danger); background: var(--t-danger); color: var(--t-on-danger); }
.tide-step[data-state="skipped"] .tide-step__marker { border-style: dashed; }
.tide-step[data-state="skipped"] .tide-step__title { color: var(--t-text-subtle); }
.tide-step[data-state="queued"] .tide-step__title { color: var(--t-text-secondary); }

/* =================================================================== decision card (the Desk) */
.tide-decision { position: relative; isolation: isolate; border-radius: var(--t-radius-lg); }
.tide-decision__reveal {
  position: absolute;
  inset: 0;
  z-index: -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--t-space-6);
  border-radius: inherit;
  background: var(--t-surface-sunken);
  font-weight: var(--t-weight-bold);
  opacity: 0;
  transition: opacity var(--t-dur-fast) var(--t-ease-standard), background-color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-decision__reveal > span { display: inline-flex; align-items: center; gap: var(--t-space-2); opacity: 0.35; }
.tide-decision[data-drag] .tide-decision__reveal { opacity: 1; }
.tide-decision[data-drag="approve"] .tide-decision__reveal { background: var(--t-success-subtle); color: var(--t-success-text); }
.tide-decision[data-drag="decline"] .tide-decision__reveal { background: var(--t-danger-subtle); color: var(--t-danger-text); }
.tide-decision[data-drag="approve"] [data-side="approve"], .tide-decision[data-drag="decline"] [data-side="decline"] { opacity: 1; }
.tide-decision[data-armed] [data-side] { text-decoration: underline; text-underline-offset: 0.25em; }
.tide-decision__card {
  --_dx: 0px;
  --_rot: 0deg;
  display: grid;
  gap: var(--t-space-3);
  padding: var(--t-density-card);
  border: 1px solid var(--t-border);
  border-radius: inherit;
  background: var(--t-surface);
  box-shadow: var(--t-shadow-2);
  transform: translateX(var(--_dx)) rotate(var(--_rot));
  transition: transform var(--t-dur-slow) var(--t-ease-enter);
  touch-action: pan-y;
}
.tide-decision[data-dragging] .tide-decision__card { transition: none; cursor: grabbing; }
.tide-decision__head { display: flex; align-items: flex-start; gap: var(--t-space-3); }
.tide-decision__head > .tide-badge { margin-left: auto; }
.tide-decision__title { font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); letter-spacing: var(--t-tracking-md); }
.tide-decision__facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--t-space-2) var(--t-space-4); margin: 0; }
.tide-decision__facts > div { min-width: 0; }
.tide-decision__facts dt { color: var(--t-text-subtle); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); }
.tide-decision__facts dd { margin: 0; font-weight: var(--t-weight-medium); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.tide-decision__why {
  display: flex;
  gap: var(--t-space-2);
  padding: var(--t-space-3);
  border-radius: var(--t-radius-md);
  background: var(--t-surface-sunken);
  color: var(--t-text-secondary);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
}
.tide-decision__why .tide-icon { flex: none; width: 16px; height: 16px; margin-top: 1px; color: var(--t-accent-text); }
.tide-decision__overflow { display: flex; align-items: center; gap: var(--t-space-2); color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-decision__actions { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--t-space-2); margin-top: var(--t-space-1); }
.tide-decision__hint { color: var(--t-text-subtle); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); text-align: center; }
@media (pointer: fine) { .tide-decision__hint { display: none; } }
.tide-decision__result {
  display: flex;
  align-items: center;
  gap: var(--t-space-3);
  min-height: 64px;
  padding: var(--t-space-3) var(--t-space-3) var(--t-space-3) var(--t-space-4);
  border: 1px solid var(--t-border);
  border-radius: inherit;
  background: var(--t-surface);
}
.tide-decision__result > p { flex: 1; min-width: 0; }
.tide-decision[data-state="approved"] .tide-decision__result { border-color: var(--t-success-ui); background: var(--t-success-subtle); }
.tide-decision[data-state="declined"] .tide-decision__result { border-color: var(--t-danger-ui); background: var(--t-danger-subtle); }
.tide-decision[data-state="approved"] .tide-decision__result .tide-icon { color: var(--t-success-text); }
.tide-decision[data-state="declined"] .tide-decision__result .tide-icon { color: var(--t-danger-text); }
.tide-decision[data-state] .tide-decision__card, .tide-decision[data-state] .tide-decision__reveal { display: none; }

/* =================================================================== sticky notes */
.tide-note {
  --_paper: var(--t-note-yellow);
  position: relative;
  display: grid;
  gap: var(--t-space-2);
  max-width: 300px;
  padding: var(--t-space-4) var(--t-space-4) var(--t-space-5);
  background: var(--_paper);
  color: var(--t-note-ink);
  box-shadow: var(--t-shadow-2);
  font-size: var(--t-fs-base);
  line-height: var(--t-lh-base);
}
.tide-note[data-color="pink"] { --_paper: var(--t-note-pink); }
.tide-note[data-color="blue"] { --_paper: var(--t-note-blue); }
.tide-note[data-color="green"] { --_paper: var(--t-note-green); }
.tide-note__by { font-family: var(--t-font-mono); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); color: var(--t-note-ink); }
.tide-note[data-style="scribbly"] {
  border-radius: 2px 3px 14px 2px;
  font-family: var(--t-font-hand);
  font-size: var(--t-fs-md);
  line-height: var(--t-lh-md);
  rotate: -1.6deg;
}
.tide-note[data-style="scribbly"][data-tilt="right"] { rotate: 1.4deg; }
.tide-note[data-style="scribbly"]::before {
  content: "";
  position: absolute;
  top: -10px;
  left: 50%;
  width: 72px;
  height: 22px;
  translate: -50% 0;
  rotate: 2deg;
  background: var(--t-chrome);
  box-shadow: var(--t-shadow-1);
  opacity: 0.8;
}
.tide-note[data-style="scribbly"] .tide-note__by { font-family: var(--t-font-hand); font-size: var(--t-fs-sm); }
.tide-note[data-style="serious"] {
  border-radius: var(--t-radius-sm);
  border-left: 4px solid var(--t-note-ink);
  box-shadow: var(--t-shadow-1);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
}
.tide-note[data-style="serious"] .tide-note__title { font-size: var(--t-fs-base); font-weight: var(--t-weight-semibold); }
.tide-note[data-style="popup"] {
  position: absolute;
  top: calc(100% + var(--t-space-2));
  left: 0;
  z-index: var(--t-z-popover);
  width: max-content;
  max-width: min(280px, 80vw);
  border-radius: var(--t-radius-md);
  box-shadow: var(--t-shadow-3);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
  transform-origin: 14px 0;
  animation: tide-pop var(--t-dur-base) var(--t-ease-enter);
}
.tide-pinwrap { position: relative; display: inline-block; }
.tide-pin {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 2px solid var(--t-annotate-halo);
  border-radius: var(--t-radius-full) var(--t-radius-full) var(--t-radius-full) 2px;
  background: var(--t-annotate);
  color: var(--t-on-annotate);
  box-shadow: var(--t-shadow-2);
  font-size: var(--t-fs-xs);
  font-weight: var(--t-weight-bold);
  line-height: 1;
}
.tide-pin[aria-expanded="true"] { background: var(--t-annotate-pressed); }
.tide-pin::after { content: ""; position: absolute; inset: -8px; }

/* =================================================================== tour overlay */
.tide-tour { position: fixed; inset: 0; z-index: var(--t-z-tour); pointer-events: none; }
.tide-tour[data-contained] { position: absolute; }
.tide-tour__ink { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.tide-tour__halo, .tide-tour__stroke { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tide-tour__halo { stroke: var(--t-annotate-halo); stroke-width: 8; opacity: 0.92; }
.tide-tour__stroke { stroke: var(--t-annotate-ui); stroke-width: 3.5; }
.tide-tour__ink [data-len] { stroke-dasharray: var(--_len); stroke-dashoffset: var(--_len); transition: stroke-dashoffset var(--t-dur-draw) var(--t-ease-standard); }
.tide-tour__ink[data-drawn] [data-len] { stroke-dashoffset: 0; }
.tide-tour__label { position: absolute; left: var(--_x, 0px); top: var(--_y, 0px); pointer-events: none; }
.tide-tour__card {
  position: absolute;
  inset: auto var(--t-space-3) calc(var(--t-space-3) + env(safe-area-inset-bottom, 0px));
  display: grid;
  gap: var(--t-space-2);
  max-width: 400px;
  margin: 0 auto;
  padding: var(--t-space-4);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface-raised);
  color: var(--t-text);
  box-shadow: var(--t-shadow-4);
  pointer-events: auto;
}
@media (min-width: 40em) { .tide-tour__card { left: auto; right: var(--t-space-6); bottom: var(--t-space-6); width: 360px; } }
/* a tour inside a frame (container option) keeps its card inside the frame at any viewport */
.tide-tour[data-contained] .tide-tour__card { inset: auto var(--t-space-3) var(--t-space-3); width: auto; }
.tide-tour__step { display: flex; align-items: center; gap: var(--t-space-2); color: var(--t-text-subtle); font-family: var(--t-font-mono); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); }
.tide-tour__dots { display: inline-flex; gap: 4px; }
.tide-tour__dots > i { width: 6px; height: 6px; border-radius: var(--t-radius-full); background: var(--t-border-strong); }
.tide-tour__dots > i[aria-current="step"] { width: 16px; background: var(--t-accent-ui); }
.tide-tour__title { font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); }
.tide-tour__body { color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }
.tide-tour__actions { display: flex; align-items: center; gap: var(--t-space-2); margin-top: var(--t-space-1); }
.tide-tour__actions > :first-child { margin-right: auto; }

/* =================================================================== data table */
.tide-tablewrap {
  container: tide-table / inline-size;
  overflow-x: auto;
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  box-shadow: var(--t-shadow-1);
}
.tide-table { width: 100%; font-variant-numeric: tabular-nums; }
.tide-table caption { padding: var(--t-space-3) var(--t-space-4); text-align: left; color: var(--t-text-secondary); font-size: var(--t-fs-sm); }
.tide-table th {
  padding: var(--t-space-2) var(--t-space-4);
  border-bottom: 1px solid var(--t-border);
  background: var(--t-surface-sunken);
  color: var(--t-text-secondary);
  font-size: var(--t-fs-xs);
  line-height: var(--t-lh-xs);
  font-weight: var(--t-weight-semibold);
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}
.tide-table td { padding: var(--t-density-row-y) var(--t-space-4); border-top: 1px solid var(--t-border); vertical-align: middle; }
.tide-table tbody tr:first-child td { border-top: 0; }
.tide-table [data-num] { text-align: right; }
.tide-table td[data-primary] { font-weight: var(--t-weight-medium); }
.tide-table td[data-mono] { font-family: var(--t-font-mono); font-size: var(--t-fs-sm); }
.tide-table tbody tr { transition: background-color var(--t-dur-fast) var(--t-ease-standard); }
.tide-table tbody tr:hover { background: var(--t-hover); }
.tide-table a { color: var(--t-text); text-decoration: none; font-weight: var(--t-weight-medium); }
.tide-table a:hover { text-decoration: underline; }
@container tide-table (max-width: 40em) {
  .tide-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tide-table, .tide-table tbody, .tide-table tr, .tide-table td { display: block; }
  .tide-table tbody tr { padding: var(--t-space-3) var(--t-space-4); border-top: 1px solid var(--t-border); }
  .tide-table tbody tr:first-child { border-top: 0; }
  .tide-table td {
    display: grid;
    grid-template-columns: minmax(6.5em, 38%) minmax(0, 1fr);
    gap: var(--t-space-3);
    padding: var(--t-space-0-5) 0;
    border: 0;
  }
  .tide-table td[data-num] { text-align: left; }
  .tide-table td::before { content: attr(data-label); color: var(--t-text-subtle); font-size: var(--t-fs-sm); line-height: var(--t-lh-base); }
  .tide-table td[data-primary] { display: block; padding-bottom: var(--t-space-1-5); font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); }
  .tide-table td[data-primary]::before { content: none; }
}

/* =================================================================== metric tiles */
.tide-metrics { display: grid; grid-template-columns: repeat(auto-fit, minmax(156px, 1fr)); gap: var(--t-density-gap); }
.tide-metric {
  display: grid;
  align-content: start;
  gap: var(--t-space-1);
  min-width: 0;
  padding: var(--t-space-4);
  border: 1px solid var(--t-border);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  box-shadow: var(--t-shadow-1);
}
.tide-metric__label { color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-medium); }
.tide-metric__value {
  font-size: var(--t-fs-2xl);
  line-height: var(--t-lh-2xl);
  font-weight: var(--t-weight-semibold);
  letter-spacing: var(--t-tracking-2xl);
  font-variant-numeric: tabular-nums;
}
.tide-metric__unit { margin-left: 2px; color: var(--t-text-subtle); font-size: var(--t-fs-base); font-weight: var(--t-weight-medium); letter-spacing: 0; }
.tide-metric__delta { display: inline-flex; align-items: center; gap: var(--t-space-1); color: var(--t-text-subtle); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); font-weight: var(--t-weight-semibold); }
.tide-metric__delta .tide-icon { width: 14px; height: 14px; stroke-width: 2.5; }
.tide-metric__delta[data-good="true"] { color: var(--t-success-text); }
.tide-metric__delta[data-good="false"] { color: var(--t-danger-text); }
.tide-metric__spark { width: 100%; height: 36px; margin-top: var(--t-space-2); overflow: visible; }
.tide-metric__spark polyline { fill: none; stroke: var(--t-accent-ui); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tide-metric__spark polygon { fill: var(--t-accent-subtle); stroke: none; }
.tide-metric__spark circle { fill: var(--t-accent-ui); stroke: var(--t-surface); stroke-width: 2; vector-effect: non-scaling-stroke; }

/* =================================================================== comment thread + composer */
.tide-thread { display: grid; }
.tide-thread__head { display: flex; align-items: center; gap: var(--t-space-2); padding-bottom: var(--t-space-3); border-bottom: 1px solid var(--t-border); }
.tide-thread__quote {
  margin: var(--t-space-3) 0 0;
  padding: var(--t-space-1) 0 var(--t-space-1) var(--t-space-3);
  border-left: 3px solid var(--t-accent-ui);
  color: var(--t-text-secondary);
  font-size: var(--t-fs-sm);
  line-height: var(--t-lh-sm);
}
.tide-comment { display: grid; grid-template-columns: 32px minmax(0, 1fr); column-gap: var(--t-space-3); padding: var(--t-space-3) 0; }
.tide-comment + .tide-comment { border-top: 1px solid var(--t-border); }
.tide-comment > .tide-avatar { grid-row: 1 / span 3; }
.tide-comment__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--t-space-1) var(--t-space-2); }
.tide-comment__author { font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-semibold); }
.tide-comment__time { color: var(--t-text-subtle); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); }
.tide-comment__body { margin-top: 2px; overflow-wrap: anywhere; }
.tide-comment__body > * + * { margin-top: var(--t-space-2); }
.tide-comment__actions { display: flex; gap: var(--t-space-1); margin: var(--t-space-1) 0 0 calc(var(--t-space-2) * -1); }
.tide-comment[data-pending] .tide-comment__body { color: var(--t-text-secondary); }
.tide-thread[data-resolved] .tide-comment { opacity: 0.72; }

.tide-composer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: var(--t-space-1);
  margin-top: var(--t-space-3);
  padding: var(--t-space-1);
  border: 1px solid var(--t-border-control);
  border-radius: var(--t-radius-lg);
  background: var(--t-surface);
  transition: border-color var(--t-dur-fast) var(--t-ease-standard);
}
.tide-composer:focus-within { border-color: var(--t-accent-ui); outline: var(--t-size-focus-width) solid var(--t-focus); outline-offset: 0; }
.tide-composer__field {
  min-width: 0;
  min-height: 40px;
  max-height: 40dvh;
  padding: var(--t-space-2) var(--t-space-1);
  border: 0;
  background: transparent;
  color: var(--t-text);
  font-size: var(--t-fs-control);
  line-height: var(--t-lh-control);
  resize: none;
  field-sizing: content;
  outline: none;
}
.tide-composer__field:focus { outline: none; }
.tide-composer .tide-iconbtn { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }

/* =================================================================== keyframes */
@keyframes tide-spin { to { rotate: 360deg; } }
@keyframes tide-pulse { from { opacity: 1; } to { opacity: 0.45; } }
@keyframes tide-pop {
  from { opacity: 0; transform: translateY(calc(-4px * var(--t-motion-scale))) scale(calc(1 - 0.04 * var(--t-motion-scale))); }
  to { opacity: 1; transform: none; }
}

/* =================================================================== forced colors (Windows high contrast) */
@media (forced-colors: active) {
  .tide-btn, .tide-iconbtn, .tide-segmented span, .tide-tab, .tide-navitem, .tide-tabitem { border: 1px solid ButtonText; }
  .tide-btn[data-variant="primary"], .tide-segmented input:checked + span, .tide-navitem[aria-current="page"], .tide-tab[aria-selected="true"] { border-width: 2px; }
  .tide-check:checked, .tide-radio:checked::before, .tide-switch:checked, .tide-switch::before { background: Highlight; }
  .tide-switch, .tide-progress { border: 1px solid CanvasText; }
  .tide-card, .tide-list, .tide-sheet, .tide-dialog, .tide-palette, .tide-toast, .tide-note, .tide-tour__card { border: 1px solid CanvasText; }
  .tide-tour__stroke { stroke: Highlight; }
}
}

/* Tide 2.0.0 build/themes/29court.css sha256:5084368628d6 (copied at build) */
/* GENERATED by design-system/tide/scripts/build.mjs from themes/29court.json. Do not edit: change the JSON and rebuild. */
/* 29Court. Load after tide.tokens.css; activate with data-tenant="29court" (on <html> or any scope that also sets data-mode). */

@layer tide.theme {

[data-tenant="29court"] {
  --t-radius-xs: 4px;
  --t-radius-sm: 6px;
  --t-radius-md: 8px;
  --t-radius-lg: 12px;
  --t-radius-xl: 18px;
  --t-density-control: 40px;
  --t-density-row-y: 12px;
  --t-density-card: 16px;
  --t-density-gap: 12px;
}

[data-tenant="29court"]:not([data-mode="dark"]) {
  --t-neutral-0: #FFFFFF;
  --t-neutral-25: #F9FBFE;
  --t-neutral-50: #F5F7FA;
  --t-neutral-100: #EDEFF3;
  --t-neutral-150: #E6E8EC;
  --t-neutral-200: #DCDEE2;
  --t-neutral-300: #C6C9CE;
  --t-neutral-400: #A3A6AC;
  --t-neutral-500: #7D8087;
  --t-neutral-600: #60636A;
  --t-neutral-700: #474A50;
  --t-neutral-800: #303338;
  --t-neutral-850: #25282C;
  --t-neutral-900: #1C1E22;
  --t-neutral-925: #16181C;
  --t-neutral-950: #111317;
  --t-neutral-975: #0D0E12;
  --t-neutral-1000: #08090C;
  --t-bg: #F5F7FA;
  --t-surface: #FFFFFF;
  --t-surface-raised: #FFFFFF;
  --t-surface-sunken: #EDEFF3;
  --t-border: #E6E8EC;
  --t-border-strong: #DCDEE2;
  --t-border-control: #7D8087;
  --t-text: #0D0E12;
  --t-text-secondary: #474A50;
  --t-text-subtle: #60636A;
  --t-text-disabled: #A3A6AC;
  --t-inverse: #16181C;
  --t-on-inverse: #F9FBFE;
  --t-chrome: #FFFFFFDB;
  --t-hover: #08090C0D;
  --t-pressed: #08090C17;
  --t-scrim: #08090C6B;
  --t-sh-1: #08090C0F;
  --t-sh-2: #08090C1A;
  --t-sh-3: #08090C29;
  --t-highlight: #FFFFFF00;
  --t-annotate-halo: #FFFFFF;
  --t-accent: #F2A12E;
  --t-accent-hover: #FFAE42;
  --t-accent-pressed: #FFC177;
  --t-on-accent: #08090C;
  --t-accent-ui: #BF7A00;
  --t-on-accent-ui: #08090C;
  --t-accent-subtle: #FFF1E2;
  --t-accent-text: #985F00;
  --t-focus: #BF7A00;
  --t-focus-inverse: #F2A12E;
  --t-selected: #FFF1E2;
  --t-success: #0A924B;
  --t-success-hover: #249E57;
  --t-success-pressed: #36AB62;
  --t-on-success: #08090C;
  --t-success-ui: #0A924B;
  --t-on-success-ui: #08090C;
  --t-success-subtle: #DEFDE5;
  --t-success-text: #007C3E;
  --t-warning: #F2CF24;
  --t-warning-hover: #FFDC3E;
  --t-warning-pressed: #FFEB9B;
  --t-on-warning: #08090C;
  --t-warning-ui: #A08800;
  --t-on-warning-ui: #08090C;
  --t-warning-subtle: #FCF4D2;
  --t-warning-text: #7E6A00;
  --t-danger: #D02C2E;
  --t-danger-hover: #C21821;
  --t-danger-pressed: #B20016;
  --t-on-danger: #FFFFFF;
  --t-danger-ui: #D02C2E;
  --t-on-danger-ui: #FFFFFF;
  --t-danger-subtle: #FFEFED;
  --t-danger-text: #CE2A2C;
  --t-info: #0278C7;
  --t-info-hover: #006CB5;
  --t-info-pressed: #0060A2;
  --t-on-info: #FFFFFF;
  --t-info-ui: #0278C7;
  --t-on-info-ui: #FFFFFF;
  --t-info-subtle: #EBF5FF;
  --t-info-text: #006FB9;
  --t-annotate: #DE1C46;
  --t-annotate-hover: #CE003C;
  --t-annotate-pressed: #BA0035;
  --t-on-annotate: #FFFFFF;
  --t-annotate-ui: #DE1C46;
  --t-on-annotate-ui: #FFFFFF;
  --t-annotate-subtle: #FFEFEF;
  --t-annotate-text: #D70C40;
  --t-note-yellow: #FFEC95;
  --t-note-pink: #FFD9E2;
  --t-note-blue: #C6EBFF;
  --t-note-green: #C8F6D0;
  --t-note-ink: #08090C;
  --t-avatar-1-bg: #CDDFFF;
  --t-avatar-1-fg: #1E3A71;
  --t-avatar-2-bg: #A6ECF4;
  --t-avatar-2-fg: #00464C;
  --t-avatar-3-bg: #BCECC8;
  --t-avatar-3-fg: #004B22;
  --t-avatar-4-bg: #F3DBA9;
  --t-avatar-4-fg: #4F3900;
  --t-avatar-5-bg: #FFD3C3;
  --t-avatar-5-fg: #67260C;
  --t-avatar-6-bg: #FACEF4;
  --t-avatar-6-fg: #592656;
  --t-shadow-0: none;
  --t-shadow-1: 0 1px 2px #08090C0F;
  --t-shadow-2: 0 1px 3px #08090C0F, 0 6px 16px #08090C1A;
  --t-shadow-3: 0 2px 8px #08090C0F, 0 16px 40px #08090C29;
  --t-shadow-4: 0 4px 12px #08090C1A, 0 24px 64px #08090C29;
}

@media (prefers-color-scheme: dark) {
  :root[data-tenant="29court"]:not([data-mode]) {
    --t-neutral-0: #FFFFFF;
    --t-neutral-25: #F9FBFE;
    --t-neutral-50: #F5F7FA;
    --t-neutral-100: #EDEFF3;
    --t-neutral-150: #E6E8EC;
    --t-neutral-200: #DCDEE2;
    --t-neutral-300: #C6C9CE;
    --t-neutral-400: #A3A6AC;
    --t-neutral-500: #7D8087;
    --t-neutral-600: #60636A;
    --t-neutral-700: #474A50;
    --t-neutral-800: #303338;
    --t-neutral-850: #25282C;
    --t-neutral-900: #1C1E22;
    --t-neutral-925: #16181C;
    --t-neutral-950: #111317;
    --t-neutral-975: #0D0E12;
    --t-neutral-1000: #08090C;
    --t-bg: #0D0E12;
    --t-surface: #111317;
    --t-surface-raised: #1C1E22;
    --t-surface-sunken: #08090C;
    --t-border: #25282C;
    --t-border-strong: #303338;
    --t-border-control: #7D8087;
    --t-text: #F9FBFE;
    --t-text-secondary: #C6C9CE;
    --t-text-subtle: #A3A6AC;
    --t-text-disabled: #474A50;
    --t-inverse: #E6E8EC;
    --t-on-inverse: #0D0E12;
    --t-chrome: #111317D6;
    --t-hover: #FFFFFF0F;
    --t-pressed: #FFFFFF1A;
    --t-scrim: #00000099;
    --t-sh-1: #00000052;
    --t-sh-2: #00000070;
    --t-sh-3: #0000008F;
    --t-highlight: #FFFFFF0F;
    --t-annotate-halo: #08090C;
    --t-accent: #F5AC3F;
    --t-accent-hover: #FFBA5A;
    --t-accent-pressed: #FFCC8B;
    --t-on-accent: #08090C;
    --t-accent-ui: #F5AC3F;
    --t-on-accent-ui: #08090C;
    --t-accent-subtle: #412800;
    --t-accent-text: #F5AC3F;
    --t-focus: #F5AC3F;
    --t-focus-inverse: #B67800;
    --t-selected: #412800;
    --t-success: #54C57A;
    --t-success-hover: #62D286;
    --t-success-pressed: #70DF93;
    --t-on-success: #08090C;
    --t-success-ui: #54C57A;
    --t-on-success-ui: #08090C;
    --t-success-subtle: #0C371C;
    --t-success-text: #54C57A;
    --t-warning: #F2CF24;
    --t-warning-hover: #FFDC3E;
    --t-warning-pressed: #FFEB9B;
    --t-on-warning: #08090C;
    --t-warning-ui: #F2CF24;
    --t-on-warning-ui: #08090C;
    --t-warning-subtle: #372D00;
    --t-warning-text: #F2CF24;
    --t-danger: #FF645C;
    --t-danger-hover: #FF7F75;
    --t-danger-pressed: #FF968C;
    --t-on-danger: #08090C;
    --t-danger-ui: #FF645C;
    --t-on-danger-ui: #08090C;
    --t-danger-subtle: #4B1E1A;
    --t-danger-text: #FF645C;
    --t-info: #5AB1FF;
    --t-info-hover: #78BEFF;
    --t-info-pressed: #92CAFF;
    --t-on-info: #08090C;
    --t-info-ui: #5AB1FF;
    --t-on-info-ui: #08090C;
    --t-info-subtle: #0F304C;
    --t-info-text: #5AB1FF;
    --t-annotate: #FF6F7A;
    --t-annotate-hover: #FF888E;
    --t-annotate-pressed: #FF9FA2;
    --t-on-annotate: #08090C;
    --t-annotate-ui: #FF6F7A;
    --t-on-annotate-ui: #08090C;
    --t-annotate-subtle: #4B1D20;
    --t-annotate-text: #FF6F7A;
    --t-note-yellow: #DDCB74;
    --t-note-pink: #E8AFBD;
    --t-note-blue: #9AC8E1;
    --t-note-green: #A4D1AC;
    --t-note-ink: #08090C;
    --t-avatar-1-bg: #283C62;
    --t-avatar-1-fg: #CDDFFF;
    --t-avatar-2-bg: #00464C;
    --t-avatar-2-fg: #87F2FE;
    --t-avatar-3-bg: #1C472A;
    --t-avatar-3-fg: #ACF2BE;
    --t-avatar-4-bg: #4E3A06;
    --t-avatar-4-fg: #FDD990;
    --t-avatar-5-bg: #5C2F1F;
    --t-avatar-5-fg: #FFD3C3;
    --t-avatar-6-bg: #512F4F;
    --t-avatar-6-fg: #FFCAF9;
    --t-shadow-0: none;
    --t-shadow-1: 0 1px 2px #00000052;
    --t-shadow-2: inset 0 1px 0 #FFFFFF0F, 0 2px 6px #00000052, 0 8px 20px #00000070;
    --t-shadow-3: inset 0 1px 0 #FFFFFF0F, 0 4px 12px #00000070, 0 20px 48px #0000008F;
    --t-shadow-4: inset 0 1px 0 #FFFFFF0F, 0 6px 16px #00000070, 0 28px 72px #0000008F;
  }
}

[data-tenant="29court"][data-mode="dark"] {
  --t-neutral-0: #FFFFFF;
  --t-neutral-25: #F9FBFE;
  --t-neutral-50: #F5F7FA;
  --t-neutral-100: #EDEFF3;
  --t-neutral-150: #E6E8EC;
  --t-neutral-200: #DCDEE2;
  --t-neutral-300: #C6C9CE;
  --t-neutral-400: #A3A6AC;
  --t-neutral-500: #7D8087;
  --t-neutral-600: #60636A;
  --t-neutral-700: #474A50;
  --t-neutral-800: #303338;
  --t-neutral-850: #25282C;
  --t-neutral-900: #1C1E22;
  --t-neutral-925: #16181C;
  --t-neutral-950: #111317;
  --t-neutral-975: #0D0E12;
  --t-neutral-1000: #08090C;
  --t-bg: #0D0E12;
  --t-surface: #111317;
  --t-surface-raised: #1C1E22;
  --t-surface-sunken: #08090C;
  --t-border: #25282C;
  --t-border-strong: #303338;
  --t-border-control: #7D8087;
  --t-text: #F9FBFE;
  --t-text-secondary: #C6C9CE;
  --t-text-subtle: #A3A6AC;
  --t-text-disabled: #474A50;
  --t-inverse: #E6E8EC;
  --t-on-inverse: #0D0E12;
  --t-chrome: #111317D6;
  --t-hover: #FFFFFF0F;
  --t-pressed: #FFFFFF1A;
  --t-scrim: #00000099;
  --t-sh-1: #00000052;
  --t-sh-2: #00000070;
  --t-sh-3: #0000008F;
  --t-highlight: #FFFFFF0F;
  --t-annotate-halo: #08090C;
  --t-accent: #F5AC3F;
  --t-accent-hover: #FFBA5A;
  --t-accent-pressed: #FFCC8B;
  --t-on-accent: #08090C;
  --t-accent-ui: #F5AC3F;
  --t-on-accent-ui: #08090C;
  --t-accent-subtle: #412800;
  --t-accent-text: #F5AC3F;
  --t-focus: #F5AC3F;
  --t-focus-inverse: #B67800;
  --t-selected: #412800;
  --t-success: #54C57A;
  --t-success-hover: #62D286;
  --t-success-pressed: #70DF93;
  --t-on-success: #08090C;
  --t-success-ui: #54C57A;
  --t-on-success-ui: #08090C;
  --t-success-subtle: #0C371C;
  --t-success-text: #54C57A;
  --t-warning: #F2CF24;
  --t-warning-hover: #FFDC3E;
  --t-warning-pressed: #FFEB9B;
  --t-on-warning: #08090C;
  --t-warning-ui: #F2CF24;
  --t-on-warning-ui: #08090C;
  --t-warning-subtle: #372D00;
  --t-warning-text: #F2CF24;
  --t-danger: #FF645C;
  --t-danger-hover: #FF7F75;
  --t-danger-pressed: #FF968C;
  --t-on-danger: #08090C;
  --t-danger-ui: #FF645C;
  --t-on-danger-ui: #08090C;
  --t-danger-subtle: #4B1E1A;
  --t-danger-text: #FF645C;
  --t-info: #5AB1FF;
  --t-info-hover: #78BEFF;
  --t-info-pressed: #92CAFF;
  --t-on-info: #08090C;
  --t-info-ui: #5AB1FF;
  --t-on-info-ui: #08090C;
  --t-info-subtle: #0F304C;
  --t-info-text: #5AB1FF;
  --t-annotate: #FF6F7A;
  --t-annotate-hover: #FF888E;
  --t-annotate-pressed: #FF9FA2;
  --t-on-annotate: #08090C;
  --t-annotate-ui: #FF6F7A;
  --t-on-annotate-ui: #08090C;
  --t-annotate-subtle: #4B1D20;
  --t-annotate-text: #FF6F7A;
  --t-note-yellow: #DDCB74;
  --t-note-pink: #E8AFBD;
  --t-note-blue: #9AC8E1;
  --t-note-green: #A4D1AC;
  --t-note-ink: #08090C;
  --t-avatar-1-bg: #283C62;
  --t-avatar-1-fg: #CDDFFF;
  --t-avatar-2-bg: #00464C;
  --t-avatar-2-fg: #87F2FE;
  --t-avatar-3-bg: #1C472A;
  --t-avatar-3-fg: #ACF2BE;
  --t-avatar-4-bg: #4E3A06;
  --t-avatar-4-fg: #FDD990;
  --t-avatar-5-bg: #5C2F1F;
  --t-avatar-5-fg: #FFD3C3;
  --t-avatar-6-bg: #512F4F;
  --t-avatar-6-fg: #FFCAF9;
  --t-shadow-0: none;
  --t-shadow-1: 0 1px 2px #00000052;
  --t-shadow-2: inset 0 1px 0 #FFFFFF0F, 0 2px 6px #00000052, 0 8px 20px #00000070;
  --t-shadow-3: inset 0 1px 0 #FFFFFF0F, 0 4px 12px #00000070, 0 20px 48px #0000008F;
  --t-shadow-4: inset 0 1px 0 #FFFFFF0F, 0 6px 16px #00000070, 0 28px 72px #0000008F;
}

}


/* apps/platform/src/styles/app.css */
/* 29Court platform: the page layer over Tide 2 (tide.css + themes/29court.css).
   Tokens (--t-*) only; no colour literals. Mobile first, works at 360px.
   Tide draws the shell, rows, cards, fields, sheets and toasts; this file
   only lays pages out. */
@layer page {
  body { background: var(--t-bg); color: var(--t-text); }
  h1, h2, h3, p { margin: 0; }

  /* Shell details */
  .p-account { text-decoration: none; }
  .tide-tabitem .p-tablabel { max-width: 100%; padding: 0 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* Seven tabs fit at 360px: tighter icon pill and label */
  @media (max-width: 30em) {
    .tide-tabitem .tide-icon { width: 40px; padding: 2px 8px; }
    .tide-tabitem .p-tablabel { padding: 0; font-size: 0.6875rem; letter-spacing: -0.01em; }
  }
  .tide-sidebar__foot .p-mono { overflow-wrap: anywhere; }
  .tide-main:focus { outline: none; }

  /* Main */
  .p-title {
    margin: var(--t-space-2) 0 var(--t-space-4);
    font-size: var(--t-fs-2xl);
    line-height: var(--t-lh-2xl);
    letter-spacing: var(--t-tracking-2xl);
    font-weight: var(--t-weight-bold);
  }
  .p-lede { max-width: 60ch; margin-bottom: var(--t-space-4); color: var(--t-text-secondary); }
  .p-muted { color: var(--t-text-secondary); }
  .p-mono { font-family: var(--t-font-mono); font-size: 0.875em; overflow-wrap: anywhere; }
  .p-h3 { margin-top: var(--t-space-2); color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-semibold); }
  .p-gap-top { margin-top: var(--t-space-4); }
  .p-note { margin: var(--t-space-2) 0 var(--t-space-4); }
  .p-note-text { margin: var(--t-space-1) 0; white-space: pre-wrap; overflow-wrap: anywhere; }
  .p-tag {
    display: inline-block;
    padding: 0 var(--t-space-2);
    border-radius: var(--t-radius-full);
    background: var(--t-accent-subtle);
    color: var(--t-accent-text);
    font-size: var(--t-fs-xs);
    line-height: var(--t-lh-xs);
    font-weight: var(--t-weight-semibold);
    vertical-align: middle;
  }
  .p-pad { padding: var(--t-density-card); }

  .p-stack { display: flex; flex-direction: column; gap: var(--t-space-4); }
  .p-actions { display: flex; flex-wrap: wrap; gap: var(--t-space-2); margin-bottom: var(--t-space-4); }
  .p-actions:last-child { margin-bottom: 0; }

  /* Sections and lists */
  .p-section { margin-top: var(--t-space-6); }
  .p-section > h2, .p-section__head h2 { margin-bottom: var(--t-space-3); font-size: var(--t-fs-md); line-height: var(--t-lh-md); font-weight: var(--t-weight-semibold); }
  .p-section__head { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); margin-bottom: var(--t-space-3); }
  .p-section__head h2 { margin-bottom: 0; }
  /* Tide's list draws rules between <li>s; ours hold rows directly. */
  .p-list > * + * { border-top: 1px solid var(--t-border); }
  .p-list .tide-row__title, .p-list .tide-row__meta { overflow-wrap: anywhere; }
  .p-list .tide-row__title { white-space: normal; }
  .p-list .tide-row__trail { display: inline-flex; flex-shrink: 0; align-items: center; gap: var(--t-space-2); margin-left: auto; color: var(--t-text-subtle); }
  .tide-row[data-compact] { min-height: 48px; }
  .p-row-icon {
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--t-radius-md);
    background: var(--t-accent-subtle);
    color: var(--t-accent-text);
  }
  .p-checkin { align-items: flex-start; }

  /* Number tiles */
  .p-storage { align-self: center; }
  .p-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--t-space-3); }
  @media (min-width: 48em) { .p-tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); } }
  .p-hubnote { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); flex-wrap: wrap; padding: var(--t-density-card); margin-bottom: var(--t-space-3); background: var(--t-accent-subtle); }
  .p-hubnote .tide-btn { min-height: 44px; }
  .p-tile { gap: var(--t-space-1); min-height: 96px; padding: var(--t-density-card); color: inherit; text-decoration: none; }
  a.p-tile:hover { background: var(--t-hover); }
  .p-tile__num { font-size: var(--t-fs-2xl); line-height: var(--t-lh-2xl); letter-spacing: var(--t-tracking-2xl); font-weight: var(--t-weight-bold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .p-tile__label { color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); }

  /* House: a client's own place (routes/house.ts). The accent is only ever
     a fill, with its own text colour (--p-house-on) checked for AA on save;
     with no accent it is Tide's accent and on-accent pair. */
  .p-house { --p-house-accent: var(--t-accent); --p-house-on: var(--t-on-accent); }
  .p-house__hero {
    display: flex;
    flex-direction: column;
    gap: var(--t-space-2);
    padding: var(--t-space-6) var(--t-space-5) calc(var(--t-space-6) + 6px);
    border-radius: var(--t-radius-xl);
    background: var(--p-house-accent);
    color: var(--p-house-on);
    box-shadow: var(--t-shadow-1), inset 0 -6px 0 color-mix(in srgb, var(--p-house-on) 18%, transparent);
  }
  .p-house__eyebrow { display: inline-flex; align-items: center; gap: var(--t-space-2); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-semibold); }
  .p-house__eyebrow .tide-icon { width: 18px; height: 18px; }
  .p-house__name { font-size: var(--t-fs-2xl); line-height: var(--t-lh-2xl); letter-spacing: var(--t-tracking-2xl); font-weight: var(--t-weight-bold); overflow-wrap: anywhere; }
  .p-house__line { max-width: 52ch; font-size: var(--t-fs-md); line-height: var(--t-lh-md); overflow-wrap: anywhere; }
  .p-house__count {
    align-self: flex-start;
    margin-top: var(--t-space-2);
    padding: var(--t-space-1) var(--t-space-3);
    border: 1px solid currentColor;
    border-radius: var(--t-radius-full);
    font-size: var(--t-fs-xs);
    line-height: var(--t-lh-xs);
    font-weight: var(--t-weight-semibold);
  }
  .p-house__grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--t-space-3); }
  @media (min-width: 40em) { .p-house__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  @media (min-width: 72em) { .p-house__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
  .p-house__card { flex-direction: row; align-items: center; gap: var(--t-space-3); min-height: 88px; color: inherit; text-decoration: none; }
  a.p-house__card:hover { border-color: var(--p-house-accent); }
  .p-house__chip {
    display: inline-grid;
    flex-shrink: 0;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--t-radius-md);
    background: var(--p-house-accent);
    color: var(--p-house-on);
  }
  .p-house__chip[data-size="lg"] { width: 64px; height: 64px; border-radius: var(--t-radius-lg); }
  .p-house__chip[data-size="lg"] .tide-icon { width: 28px; height: 28px; }
  .p-house__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
  .p-house__kind { color: var(--t-text-secondary); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); font-weight: var(--t-weight-semibold); letter-spacing: 0.02em; text-transform: uppercase; }
  .p-house__title { font-weight: var(--t-weight-semibold); overflow-wrap: anywhere; }
  .p-house__meta { color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); overflow-wrap: anywhere; }
  .p-house__go { display: inline-grid; flex-shrink: 0; place-items: center; color: var(--t-text-subtle); transition: transform var(--t-dur-fast) var(--t-ease-standard); }
  a.p-house__card:hover .p-house__go { transform: translateX(calc(2px * var(--t-motion-scale))); color: var(--t-text); }
  .p-house__empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--t-space-2);
    padding: var(--t-space-8) var(--t-space-5);
    border: 1.5px dashed var(--t-border-strong);
    border-radius: var(--t-radius-xl);
    background: var(--t-surface);
    text-align: center;
  }
  .p-house__empty .p-house__chip { margin-bottom: var(--t-space-2); }
  .p-house__empty-title { font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-bold); }
  .p-house__empty-body { max-width: 40ch; color: var(--t-text-secondary); }
  .p-house__askform { padding: var(--t-density-card); }
  .p-house__btn { --_bg: var(--p-house-accent); --_fg: var(--p-house-on); --_bd: transparent; align-self: flex-start; min-height: 44px; }
  .p-house__ask { white-space: pre-wrap; }
  .p-house .p-section .p-h3 { margin: var(--t-space-5) 0 var(--t-space-2); }

  /* The house on the home page */
  .p-housetile { flex-direction: row; align-items: center; gap: var(--t-space-3); margin-bottom: var(--t-space-3); color: inherit; text-decoration: none; }
  .p-housetile__text { display: flex; flex: 1; flex-direction: column; min-width: 0; }
  .p-housetile__title { font-weight: var(--t-weight-semibold); }
  .p-housetile__meta { color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); overflow-wrap: anywhere; }
  .p-housetile__go { display: inline-grid; flex-shrink: 0; color: var(--t-text-subtle); }

  /* The House section of the client sheet */
  .p-house-admin { margin-top: var(--t-space-2); padding-top: var(--t-space-4); border-top: 1px solid var(--t-border); }
  .p-house-admin .p-section__head { margin-bottom: 0; }
  .p-house-admin .p-h3 { margin-top: 0; }
  .p-accent { grid-template-columns: auto auto 1fr; align-items: center; gap: var(--t-space-3); padding: var(--t-space-1) 0; }
  .p-accent > .tide-radio { margin-top: 0; }
  .p-accent:has(.tide-radio:disabled) { color: var(--t-text-secondary); }
  .p-swatch { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--t-radius-md); }
  .p-swatch--tide { background: var(--t-accent); color: var(--t-on-accent); font-size: var(--t-fs-sm); font-weight: var(--t-weight-bold); }

  /* Key-value lines in sheets */
  .p-kv { display: flex; align-items: baseline; justify-content: space-between; gap: var(--t-space-3); padding-bottom: var(--t-space-2); border-bottom: 1px solid var(--t-border); }
  .p-kv span { color: var(--t-text-secondary); }
  .p-kv strong { min-width: 0; text-align: right; font-weight: var(--t-weight-semibold); overflow-wrap: anywhere; }

  /* Inline forms */
  .p-inline-form { display: flex; align-items: flex-end; gap: var(--t-space-2); }
  .p-inline-form .tide-field { flex: 1; min-width: 0; }

  /* Filter chips scroll sideways on phones, inside their own strip */
  .p-filter { display: flex; gap: var(--t-space-2); margin: 0 calc(-1 * var(--t-space-4)); padding: 0 var(--t-space-4) var(--t-space-1); overflow-x: auto; scrollbar-width: none; }
  .p-chip {
    display: inline-flex;
    flex: none;
    align-items: center;
    min-height: 36px;
    padding: 0 var(--t-space-3);
    border: 1px solid var(--t-border);
    border-radius: var(--t-radius-full);
    background: var(--t-surface);
    color: var(--t-text-secondary);
    font-size: var(--t-fs-sm);
    font-weight: var(--t-weight-medium);
    text-decoration: none;
    white-space: nowrap;
  }
  .p-chip:hover { background: var(--t-hover); color: var(--t-text); }
  .p-chip[aria-current="page"] { border-color: var(--t-accent-ui); background: var(--t-selected); color: var(--t-text); }

  /* A sheet the server rendered open (no JS yet): not modal, so it gets a scrim of its own */
  .p-scrim { position: fixed; inset: 0; z-index: var(--t-z-sheet); background: var(--t-scrim); }
  .tide-sheet[data-server-open] { z-index: calc(var(--t-z-sheet) + 1); }
  .tide-sheet__body > .p-stack { padding-bottom: var(--t-space-2); }

  /* Notebook */
  .p-md { overflow-wrap: anywhere; line-height: var(--t-lh-md); }
  .p-md > * + * { margin-top: var(--t-space-3); }
  .p-md h2, .p-md h3, .p-md h4, .p-md h5, .p-md h6 { margin-top: var(--t-space-5); font-weight: var(--t-weight-semibold); }
  .p-md ul, .p-md ol { padding-left: var(--t-space-6); }
  .p-md li + li { margin-top: var(--t-space-1); }
  .p-md .p-md-task { list-style: none; margin-left: calc(-1 * var(--t-space-5)); }
  .p-md blockquote { padding-left: var(--t-space-3); border-left: 3px solid var(--t-border); color: var(--t-text-secondary); }
  .p-md hr { border: 0; border-top: 1px solid var(--t-border); }
  .p-md code { padding: 0 var(--t-space-1); border-radius: var(--t-radius-sm); background: var(--t-surface-sunken); font-family: var(--t-font-mono); font-size: 0.9em; }
  .p-md .p-md-code { padding: var(--t-space-3); border-radius: var(--t-radius-md); background: var(--t-surface-sunken); overflow-x: auto; }
  .p-md .p-md-code code { padding: 0; background: none; }
  .p-md a { color: var(--t-accent-text); }
  .p-wikilink[data-missing] { color: var(--t-danger-text); text-decoration-style: dashed; }
  .p-wikilink__hint { font-size: var(--t-fs-xs); }
  [data-autosave-field] { min-height: 40vh; font-family: var(--t-font-mono); }

  /* Signed-out pages */
  .p-bare { min-height: 100dvh; }
  .p-baretop { display: flex; align-items: center; gap: var(--t-space-2); max-width: 440px; margin: 0 auto; padding: var(--t-space-3) var(--t-space-4) 0; }
  .p-main--narrow { max-width: 440px; margin: 0 auto; padding: var(--t-space-8) var(--t-space-4) var(--t-space-12); }
  .p-auth { gap: var(--t-space-4); padding: var(--t-space-6) var(--t-space-5); }
  .p-auth__title { font-size: var(--t-fs-xl); line-height: var(--t-lh-xl); letter-spacing: var(--t-tracking-xl); font-weight: var(--t-weight-bold); }

  /* Trust pages and the legal footer */
  .p-legal { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--t-space-1) var(--t-space-4); padding: var(--t-space-6) 0 var(--t-space-2); }
  .p-legal a { display: inline-flex; align-items: center; min-height: 44px; color: var(--t-text-secondary); font-size: var(--t-fs-sm); text-decoration: underline; }
  .p-prose { display: flex; flex-direction: column; gap: var(--t-space-3); max-width: 62ch; overflow-wrap: anywhere; }
  .p-prose__banner { border: 1px solid var(--t-accent-ui); background: var(--t-selected); color: var(--t-text); border-radius: var(--t-radius-md); padding: var(--t-space-3) var(--t-space-4); }
  .p-prose h2 { font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-bold); margin-top: var(--t-space-4); }
  .p-prose__sec { display: flex; flex-direction: column; gap: var(--t-space-2); }
  .p-prose ul { padding-left: var(--t-space-5); display: flex; flex-direction: column; gap: var(--t-space-2); }

  /* Weekly check-in: the card a client steers, on the hub and the Desk */
  .p-checkcard { overflow-wrap: anywhere; }
  .p-checklines { display: flex; flex-direction: column; gap: var(--t-space-1); padding-left: var(--t-space-5); color: var(--t-text-secondary); }
  .p-checkcard .tide-btn { min-height: 44px; }
  .p-schedule { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--t-space-3); }
  @media (min-width: 36em) { .p-schedule { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

  /* Bridge: a hand-off as its plain file, and the API examples */
  .p-file { margin: 0; padding: var(--t-space-3); overflow-x: auto; max-width: 100%; background: var(--t-surface-sunken); border: 1px solid var(--t-border); border-radius: var(--t-radius-md); font-family: var(--t-font-mono); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); white-space: pre; }

  /* Desk: an intake decision. The proposal first, the choices as buttons. */
  .p-quote { margin: 0; padding: var(--t-space-2) var(--t-space-3); border-left: 3px solid var(--t-border-strong); color: var(--t-text); overflow-wrap: anywhere; white-space: pre-wrap; }
  .p-quote--full { margin-top: var(--t-space-2); }
  .p-intake { overflow-wrap: anywhere; }
  .p-intake__chips { display: inline-flex; flex-wrap: wrap; gap: var(--t-space-1); }
  .p-intake__who { margin-top: calc(var(--t-space-2) * -1); }
  .p-intake details > summary { cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--t-accent-text); font-size: var(--t-fs-sm); }
  .p-intake__proposal { gap: var(--t-space-2); padding: var(--t-space-3); background: var(--t-surface-sunken); border-radius: var(--t-radius-md); }
  .p-intake__choices { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--t-space-2); }
  @media (min-width: 36em) { .p-intake__choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
  .p-intake__choices .tide-btn { min-height: 48px; justify-content: center; text-align: center; white-space: normal; }
  .p-intake__tag { margin-left: var(--t-space-1); padding: 0 var(--t-space-2); border-radius: var(--t-radius-full); background: var(--t-on-accent); color: var(--t-accent-text); font-size: var(--t-fs-xs); font-weight: var(--t-weight-semibold); }

  /* Routine builder: the canvas of blocks and the Tray (a bottom sheet of fixed height). */
  .bld { display: flex; flex-direction: column; gap: var(--t-space-4); max-width: 44rem; }
  .bld[hidden], .bld [hidden] { display: none !important; }
  .bld-banner { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); padding: var(--t-space-3) var(--t-space-4); border: 1px solid var(--t-border-strong); border-radius: var(--t-radius-md); background: var(--t-surface-raised); }
  .bld-banner[data-tone="ok"] { border-color: var(--t-success-ui); background: var(--t-success-subtle); color: var(--t-success-text); }
  .bld-banner[data-tone="warn"] { border-color: var(--t-warning-ui); background: var(--t-warning-subtle); color: var(--t-warning-text); }
  .bld-banner[data-tone="bad"] { border-color: var(--t-danger-ui); background: var(--t-danger-subtle); color: var(--t-danger-text); }
  .bld-loading { display: flex; flex-direction: column; gap: var(--t-space-3); }
  .bld-skel { display: block; height: 76px; border-radius: var(--t-radius-lg); background: var(--t-surface-sunken); animation: bld-pulse 1.4s ease-in-out infinite; }
  @keyframes bld-pulse { 50% { opacity: 0.55; } }
  .bld-main { display: flex; flex-direction: column; gap: var(--t-space-4); }
  .bld-bar { display: flex; flex-wrap: wrap; gap: var(--t-space-2); }
  .bld-bar .tide-btn { min-height: 48px; flex: 1 1 10rem; justify-content: center; }
  .bld-snapnote { flex: 1 1 100%; font-size: var(--t-fs-sm); }
  .bld-problems { padding: var(--t-space-3) var(--t-space-4); border: 1px solid var(--t-danger-ui); border-radius: var(--t-radius-md); background: var(--t-danger-subtle); color: var(--t-danger-text); }
  .bld-problems ul { margin: var(--t-space-1) 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; }
  .bld-problems__lead { font-weight: var(--t-weight-semibold); }
  .bld-link { display: block; width: 100%; min-height: 44px; padding: var(--t-space-2) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; text-decoration: underline; cursor: pointer; }
  .bld-canvas { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--t-space-4); }
  .bld-block { position: relative; display: flex; flex-direction: column; gap: var(--t-space-2); padding: var(--t-space-3); border: 1px solid var(--t-border-strong); border-radius: var(--t-radius-lg); background: var(--t-surface); }
  .bld-block + .bld-block::before, .bld-slot + .bld-block::before { content: ""; position: absolute; left: 28px; top: calc(var(--t-space-4) * -1); height: var(--t-space-4); border-left: 2px solid var(--t-border-strong); }
  .bld-block--trigger { background: var(--t-accent-subtle); border-color: var(--t-accent-ui); }
  .bld-block[data-problem="yes"] { border: 2px solid var(--t-danger-ui); background: var(--t-danger-subtle); }
  .bld-block[data-editing="yes"] { outline: 2px solid var(--t-focus); outline-offset: 2px; }
  .bld-block[data-lifted] { opacity: 0.35; }
  .bld-block__head { display: flex; align-items: stretch; gap: var(--t-space-2); }
  .bld-block__main { flex: 1 1 auto; min-width: 0; min-height: 48px; display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: var(--t-space-1) var(--t-space-2); border: 0; border-radius: var(--t-radius-md); background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
  .bld-block__main--static { cursor: default; }
  .bld-block__eyebrow { font-size: var(--t-fs-xs); text-transform: uppercase; letter-spacing: 0.06em; color: var(--t-text-secondary); font-weight: var(--t-weight-semibold); }
  .bld-block__title { font-weight: var(--t-weight-semibold); overflow-wrap: anywhere; }
  .bld-block__meta { display: block; color: var(--t-text-secondary); font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); overflow-wrap: anywhere; }
  .bld-tokens { align-self: center; padding: 0 var(--t-space-2); border-radius: var(--t-radius-full); background: var(--t-warning-subtle); color: var(--t-warning-text); font-size: var(--t-fs-xs); font-weight: var(--t-weight-semibold); white-space: nowrap; }
  .bld-grip { flex: none; width: 44px; min-height: 48px; border: 0; border-radius: var(--t-radius-md); background: none; color: var(--t-text-secondary); cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; display: grid; place-items: center; }
  .bld-grip::before { content: ""; width: 14px; height: 20px; background: radial-gradient(circle, currentColor 1.6px, transparent 2px) 0 0 / 7px 7px; }
  .bld-grip:disabled { opacity: 0.35; cursor: not-allowed; }
  .bld-grip:active { cursor: grabbing; background: var(--t-hover); }
  .bld-io { display: flex; flex-wrap: wrap; gap: var(--t-space-1); }
  .bld-chip { padding: 0 var(--t-space-2); border-radius: var(--t-radius-full); border: 1px solid var(--t-border-strong); font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); }
  .bld-chip[data-tone="ok"] { background: var(--t-success-subtle); border-color: var(--t-success-ui); color: var(--t-success-text); }
  .bld-chip[data-tone="bad"] { background: var(--t-danger-ui); border-color: var(--t-danger-ui); color: var(--t-on-danger-ui); font-weight: var(--t-weight-bold); }
  .bld-chip[data-tone="neutral"] { color: var(--t-text-secondary); }
  .bld-issues { margin: 0; padding: 0; list-style: none; color: var(--t-danger-text); font-weight: var(--t-weight-semibold); }
  .bld-issues li::before { content: "! "; font-weight: var(--t-weight-bold); }
  .bld-ok { color: var(--t-success-text); }
  .bld-slot { list-style: none; height: 6px; margin: calc(var(--t-space-2) * -1) 0; border-radius: var(--t-radius-full); background: var(--t-accent-ui); }
  .bld-empty { padding: var(--t-space-6) var(--t-space-4); border: 2px dashed var(--t-border-strong); border-radius: var(--t-radius-lg); text-align: center; }
  .bld[data-dragging] { user-select: none; -webkit-user-select: none; }
  .bld-ghost { position: fixed; z-index: calc(var(--t-z-toast) + 10); top: 0; left: 0; pointer-events: none; padding: var(--t-space-2) var(--t-space-4); border-radius: var(--t-radius-lg); background: var(--t-accent-ui); color: var(--t-on-accent-ui); font-weight: var(--t-weight-semibold); box-shadow: var(--t-shadow-3); }
  .bld-delete { position: fixed; z-index: calc(var(--t-z-toast) + 5); left: var(--t-space-4); right: var(--t-space-4); bottom: calc(var(--t-space-4) + env(safe-area-inset-bottom)); max-width: 40rem; margin: 0 auto; min-height: 64px; display: grid; place-items: center; border: 2px dashed var(--t-danger-ui); border-radius: var(--t-radius-lg); background: var(--t-danger-subtle); color: var(--t-danger-text); font-weight: var(--t-weight-semibold); }
  .bld-delete[data-hot="yes"] { background: var(--t-danger-ui); color: var(--t-on-danger-ui); }
  .bld-panel { display: flex; flex-direction: column; gap: var(--t-space-2); padding: var(--t-space-3) var(--t-space-4); border: 1px solid var(--t-border); border-radius: var(--t-radius-lg); background: var(--t-surface); }
  .bld-panel .tide-btn { min-height: 44px; }
  .bld-versions { list-style: none; margin: 0; padding: 0; }
  .bld-version { display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); padding: var(--t-space-2) 0; }
  .bld-version + .bld-version { border-top: 1px solid var(--t-border); }
  .bld-version__main { display: flex; flex-direction: column; min-width: 0; }
  .bld-scrim { position: fixed; inset: 0; z-index: var(--t-z-sheet); background: var(--t-scrim); }
  /* The Tray: the same height whatever is inside; the content scrolls in it. */
  .bld-tray { position: fixed; z-index: calc(var(--t-z-sheet) + 1); left: 0; right: 0; bottom: 0; width: min(100%, 44rem); margin: 0 auto; height: 72dvh; display: flex; flex-direction: column; border-radius: 24px 24px 0 0; background: var(--t-surface-raised); box-shadow: var(--t-shadow-4); transform: translateY(100%); visibility: hidden; transition: transform 340ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 340ms; }
  .bld-tray[data-open="true"] { transform: translateY(0); visibility: visible; transition: transform 340ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s; }
  .bld-tray[data-dragging] { transform: translateY(calc(100% - 52px)); opacity: 0.9; }
  .bld-tray__handle { flex: none; display: grid; place-items: center; height: 28px; touch-action: none; cursor: grab; }
  .bld-tray__grab { width: 40px; height: 5px; border-radius: var(--t-radius-full); background: var(--t-border-strong); }
  .bld-tray__head { flex: none; display: flex; align-items: center; justify-content: space-between; gap: var(--t-space-3); padding: 0 var(--t-space-4) var(--t-space-2); }
  .bld-tray__title { font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-bold); }
  .bld-tray__body { flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: var(--t-space-2) var(--t-space-4) calc(var(--t-space-6) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--t-space-3); }
  .bld-lib-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--t-space-2); }
  .bld-lib { display: flex; align-items: stretch; gap: var(--t-space-1); border: 1px solid var(--t-border-strong); border-radius: var(--t-radius-lg); background: var(--t-surface); }
  .bld-lib__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: var(--t-space-1); padding: var(--t-space-2) var(--t-space-3) var(--t-space-2) 0; border: 0; background: none; color: inherit; font: inherit; text-align: left; cursor: pointer; }
  .bld-lib__main:disabled { opacity: 0.5; cursor: not-allowed; }
  /* A kind this Routine's trigger can't run: shown, greyed, with the reason legible. */
  .bld-lib[data-available="no"] { border-style: dashed; background: var(--t-surface-sunken); }
  .bld-lib[data-available="no"] .bld-lib__main:disabled { opacity: 1; }
  .bld-lib[data-available="no"] .bld-block__title, .bld-lib[data-available="no"] .bld-block__meta, .bld-lib[data-available="no"] .bld-io { opacity: 0.55; }
  .bld-lib__why { color: var(--t-text-secondary); font-size: var(--t-fs-xs); font-weight: var(--t-weight-semibold); }
  .bld-tokens[data-optional="yes"] { background: var(--t-surface); border: 1px solid var(--t-border-strong); color: var(--t-text-secondary); }
  .bld-field { display: flex; flex-direction: column; gap: var(--t-space-1); }
  .bld-field__label { font-weight: var(--t-weight-semibold); font-size: var(--t-fs-sm); }
  .bld-field__help { color: var(--t-text-secondary); font-size: var(--t-fs-xs); }
  .bld-tray .tide-input, .bld-tray .tide-select { min-height: 48px; }
  @media (prefers-reduced-motion: reduce) { .bld-tray, .bld-tray[data-open="true"] { transition: none; } .bld-skel { animation: none; } }
}

/* apps/platform/src/styles/tray.css */
/* The Tray (routes/tray.ts, client/tray.js): a slide-up sheet at one fixed
   height whatever is inside, tabs in a fixed header zone, the content
   scrolling under them. Tokens (--t-*) only; mobile first at 390px; no
   horizontal overflow (long ids and model names wrap or ellipsize). */
@layer page {
  .tray-page { display: flex; flex-direction: column; gap: var(--t-space-4); }
  .tray-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--t-space-2); }
  @media (min-width: 40em) { .tray-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
  .tray-stat { min-width: 0; display: flex; flex-direction: column; gap: 2px; padding: var(--t-space-3); border: 1px solid var(--t-border); border-radius: var(--t-radius-lg); background: var(--t-surface); }
  .tray-stat__value { font-size: var(--t-fs-xl); line-height: var(--t-lh-xl); font-weight: var(--t-weight-bold); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .tray-stat__label { font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); color: var(--t-text-secondary); }
  .tray-scrim { position: fixed; inset: 0; z-index: var(--t-z-sheet); background: var(--t-scrim); }

  .tray { position: fixed; z-index: calc(var(--t-z-sheet) + 1); left: 0; right: 0; bottom: 0; width: min(100%, 44rem); margin: 0 auto; height: 72dvh; display: flex; flex-direction: column; overflow: hidden; border-radius: 24px 24px 0 0; background: var(--t-surface-raised); box-shadow: var(--t-shadow-4); transform: translateY(100%); visibility: hidden; transition: transform 340ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s linear 340ms; }
  .tray[data-open="true"] { transform: translateY(0); visibility: visible; transition: transform 340ms cubic-bezier(0.32, 0.72, 0, 1), visibility 0s; }
  /* The fixed header zone: handle, title, tabs. Never scrolls. */
  .tray__zone { flex: none; border-bottom: 1px solid var(--t-border); }
  .tray__handle { display: grid; place-items: center; height: 28px; touch-action: none; cursor: grab; }
  .tray__grab { width: 40px; height: 5px; border-radius: var(--t-radius-full); background: var(--t-border-strong); }
  .tray__head { display: flex; align-items: center; gap: var(--t-space-3); padding: 0 var(--t-space-4) var(--t-space-2); }
  .tray__title { flex: 1 1 auto; min-width: 0; font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-bold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tray__live { flex: none; font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); color: var(--t-success-text); }
  .tray__live::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: var(--t-radius-full); background: var(--t-success-ui); vertical-align: middle; }
  .tray__live[data-state="stale"] { color: var(--t-text-secondary); }
  .tray__live[data-state="stale"]::before { background: var(--t-border-strong); }
  .tray__tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--t-space-1); padding: 0 var(--t-space-3) var(--t-space-2); }
  .tray__tab { min-width: 0; min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 0 var(--t-space-2); border: 0; border-radius: var(--t-radius-md); background: none; color: var(--t-text-secondary); font: inherit; font-weight: var(--t-weight-semibold); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tray__tab[aria-selected="true"] { background: var(--t-selected); color: var(--t-text); }
  .tray__tab:focus-visible { outline: var(--t-size-focus-width) solid var(--t-focus); outline-offset: calc(var(--t-size-focus-width) * -1); }
  .tray__count { min-width: 20px; padding: 0 6px; border-radius: var(--t-radius-full); background: var(--t-warning-ui); color: var(--t-on-warning-ui); font-size: var(--t-fs-xs); line-height: 20px; text-align: center; }
  .tray__body { flex: 1 1 auto; min-height: 0; min-width: 0; overflow-x: hidden; overflow-y: auto; overscroll-behavior: contain; padding: var(--t-space-3) var(--t-space-4) calc(var(--t-space-6) + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: var(--t-space-3); }

  .tray-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--t-space-2); }
  .tray-item { min-width: 0; display: flex; align-items: center; gap: var(--t-space-3); width: 100%; padding: var(--t-space-3); border: 1px solid var(--t-border); border-radius: var(--t-radius-lg); background: var(--t-surface); color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer; }
  .tray-item:hover { background: var(--t-hover); }
  .tray-item:focus-visible { outline: var(--t-size-focus-width) solid var(--t-focus); outline-offset: 2px; }
  .tray-item__main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .tray-item__title { font-weight: var(--t-weight-semibold); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tray-item__meta { font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); color: var(--t-text-secondary); overflow-wrap: anywhere; }
  .tray-item__trail { flex: none; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; font-variant-numeric: tabular-nums; }
  .tray-dot { flex: none; width: 10px; height: 10px; border-radius: var(--t-radius-full); background: var(--t-border-strong); }
  .tray-dot[data-status="done"] { background: var(--t-success-ui); }
  .tray-dot[data-status="waiting"], .tray-dot[data-status="running"] { background: var(--t-warning-ui); }
  .tray-dot[data-status="failed"] { background: var(--t-danger-ui); }
  .tray-dot[data-status="stopped"] { background: var(--t-text-secondary); }

  .tray-filter { display: flex; flex-wrap: wrap; align-items: center; gap: var(--t-space-2); }
  .tray-chip { min-height: 36px; display: inline-flex; align-items: center; gap: 6px; max-width: 100%; padding: 0 var(--t-space-3); border: 1px solid var(--t-border-strong); border-radius: var(--t-radius-full); background: var(--t-surface); color: inherit; font: inherit; font-size: var(--t-fs-sm); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .tray-chip[aria-pressed="true"] { background: var(--t-accent-subtle); border-color: var(--t-accent-ui); color: var(--t-accent-text); }

  .tray-back { align-self: flex-start; }
  .tray-sec { display: flex; flex-direction: column; gap: var(--t-space-2); }
  .tray-sec__title { font-size: var(--t-fs-sm); line-height: var(--t-lh-sm); font-weight: var(--t-weight-bold); color: var(--t-text-secondary); text-transform: none; }
  /* Labels take their own width, values the rest: a long run id wraps instead of squeezing its label to nothing at 390px. */
  .tray-kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--t-space-1) var(--t-space-3); margin: 0; font-size: var(--t-fs-sm); }
  .tray-kv dt { color: var(--t-text-secondary); min-width: 0; }
  .tray-kv dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; min-width: 0; overflow-wrap: anywhere; }
  .tray-steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
  .tray-step { min-width: 0; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--t-space-1) var(--t-space-3); align-items: baseline; padding: var(--t-space-2) 0; }
  .tray-step + .tray-step { border-top: 1px solid var(--t-border); }
  .tray-step .tray-dot { align-self: center; }
  .tray-step__name { font-size: var(--t-fs-xs); color: var(--t-text-secondary); }
  .tray-step__outcome { overflow-wrap: anywhere; }
  .tray-step__detail { grid-column: 2 / 4; font-size: var(--t-fs-xs); color: var(--t-text-secondary); overflow-wrap: anywhere; }
  .tray-step__nums { font-size: var(--t-fs-xs); color: var(--t-text-secondary); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
  .tray-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: var(--t-fs-sm); }
  .tray-table th, .tray-table td { padding: var(--t-space-1) 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
  .tray-table th:first-child, .tray-table td:first-child { text-align: left; width: 40%; }
  .tray-table th { font-size: var(--t-fs-xs); color: var(--t-text-secondary); font-weight: var(--t-weight-semibold); }
  .tray-note { font-size: var(--t-fs-xs); line-height: var(--t-lh-xs); color: var(--t-text-secondary); overflow-wrap: anywhere; }
  /* People: a workspace's name over its totals; a Routine row that filters the runs shows it is on. */
  .tray-person__name { margin: 0; font-size: var(--t-fs-lg); line-height: var(--t-lh-lg); font-weight: var(--t-weight-bold); overflow-wrap: anywhere; }
  .tray-item[aria-pressed="true"] { border-color: var(--t-accent-ui); background: var(--t-accent-subtle); }
  .tray-mono { font-family: var(--t-font-mono); font-size: var(--t-fs-xs); overflow-wrap: anywhere; }
  .tray-empty { padding: var(--t-space-6) var(--t-space-4); border: 2px dashed var(--t-border-strong); border-radius: var(--t-radius-lg); text-align: center; color: var(--t-text-secondary); }
  @media (prefers-reduced-motion: reduce) { .tray, .tray[data-open="true"] { transition: none; } }
}

