@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-400-normal.woff2") format("woff2"); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-500-normal.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }
@font-face { font-family: "IBM Plex Sans"; src: url("/assets/fonts/ibm-plex-sans-latin-600-normal.woff2") format("woff2"); font-style: normal; font-weight: 600; font-display: swap; }
@font-face { font-family: "IBM Plex Mono"; src: url("/assets/fonts/ibm-plex-mono-latin-500-normal.woff2") format("woff2"); font-style: normal; font-weight: 500; font-display: swap; }

:root {
  --cs-bg: #0E0F0F; --cs-surface: #161717; --cs-surface-raised: #1A1B1B; --cs-board-well: #070808;
  --cs-text: #F2EEE6; --cs-text-2: #C9C5BD; --cs-text-muted: #A29E96; --cs-text-faint: #7F7B74;
  --cs-divider: #232424; --cs-border: #2A2B2B; --cs-border-card: #262727; --cs-border-control: #2E2F2F; --cs-border-strong: #3A3B3B;
  --cs-accent: #E8A33D; --cs-accent-hover: #F4BE6A; --cs-accent-fill: #E8A33D; --cs-accent-fill-hover: #F4BE6A; --cs-on-accent: #141414; --cs-on-danger: #141414; --cs-accent-tint: #1A1610; --cs-accent-tint-pressed: #221D14; --cs-accent-edge: #5A4A2E; --cs-accent-edge-solid: #8A5E1F;
  --cs-danger: #E5806F; --cs-danger-edge: #5A3530; --cs-danger-hover: #F09A8C; --cs-online: #7BC67B; --cs-offline: #6F6B65;
  --cs-toast-bg: #F2EEE6; --cs-toast-text: #141414; --cs-scrim: rgba(0,0,0,0.62);
  --cs-accent-soft: #F4D49A; --cs-accent-muted: #E8C27A; --cs-danger-strong: #9A3B30;
  --cs-danger-surface-bg: #2A1A18; --cs-danger-surface-border: #8E3A30; --cs-danger-surface-text: #F0A99D;
  --cs-success: #4A9A5E; --cs-success-surface-bg: #1A2A1E; --cs-success-surface-text: #9FD8AE;
  --cs-info: #3A82B4; --cs-info-text: #84B4D8; --cs-info-surface-bg: #13202B; --cs-info-surface-border: #1F4E73;
  --cs-disabled-bg: #2A2B2B; --cs-disabled-text: #6F6B65; --cs-map-empty: #111212;
}
:root[data-controller-theme="light"] {
  --cs-bg: #F6F3EC; --cs-surface: #EDE9DF; --cs-surface-raised: #FFFFFF; --cs-board-well: #E2DDD0;
  --cs-text: #1C1B19; --cs-text-2: #4A4741; --cs-text-muted: #6B665D; --cs-text-faint: #655F56;
  --cs-divider: #DDD8CC; --cs-border: #D2CCBE; --cs-border-card: #D8D3C7; --cs-border-control: #CFC9BB; --cs-border-strong: #B9B2A2;
  --cs-accent: #B06F12; --cs-accent-hover: #9A5F0C; --cs-accent-fill: #E8A33D; --cs-accent-fill-hover: #F4BE6A; --cs-on-accent: #141414; --cs-on-danger: #FFFFFF; --cs-accent-tint: #F3E7D2; --cs-accent-tint-pressed: #EAD9B8; --cs-accent-edge: #9A5F0C; --cs-accent-edge-solid: #7C4B08;
  --cs-danger: #B3402F; --cs-danger-edge: #9B3829; --cs-danger-hover: #923526; --cs-online: #256D32; --cs-offline: #655F56;
  --cs-toast-bg: #1C1B19; --cs-toast-text: #F6F3EC; --cs-scrim: rgba(0,0,0,0.4);
  --cs-accent-soft: #754706; --cs-accent-muted: #78500E; --cs-danger-strong: #923526;
  --cs-danger-surface-bg: #F9E5DF; --cs-danger-surface-border: #B3402F; --cs-danger-surface-text: #923526;
  --cs-success: #256D32; --cs-success-surface-bg: #E0EFE2; --cs-success-surface-text: #215F2C;
  --cs-info: #24638B; --cs-info-text: #245E83; --cs-info-surface-bg: #DFEDF5; --cs-info-surface-border: #39729A;
  --cs-disabled-bg: #E2DED5; --cs-disabled-text: #655F56; --cs-map-empty: #D5D0C5;
}

:root .eyebrow, :root .section-number, :root .studio-back,
:root .household-role, :root .profile-appearance legend, :root .controller-theme-menu p,
:root .spread-field, :root .content-picker-badge, :root .authoring-heading > span,
:root .write-label-row, :root .write-group legend, :root .position-tools > span,
:root .draw-color-tools > span, :root .selection-tools > span, :root .dwell-editor > span,
:root .library-count, :root .pace-controls output, :root .pairing-code, :root time, :root code,
:root .pack-thumbnail-order {
  font-family: "IBM Plex Mono", monospace;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}
:root .eyebrow, :root .section-number, :root .studio-back,
:root .household-role, :root .profile-appearance legend, :root .controller-theme-menu p,
:root .authoring-heading > span, :root .write-label-row, :root .write-group legend,
:root .position-tools > span, :root .draw-color-tools > span, :root .selection-tools > span,
:root .dwell-editor > span, :root .library-count { font-size: 11px; letter-spacing: 0.08em; }
/* Mono letters plus letter spacing make a space read about 1.5 characters wide ("AT  THE  END"); pull words back together. */
:root .eyebrow, :root .section-number, :root .household-role, :root .profile-appearance legend,
:root .controller-theme-menu p, :root .authoring-heading > span, :root .write-label-row, :root .write-group legend,
:root .position-tools > span, :root .draw-color-tools > span, :root .selection-tools > span,
:root .dwell-editor > span, :root .spread-field > span, :root .play-label { word-spacing: -0.25em; }

:root {
  --cs-safe-area-bottom: env(safe-area-inset-bottom, 0px);
  --cs-header-control-size: 44px;
  --cs-header-icon-size: 20px;
  --cs-header-title-line-height: 1.1;
  --cs-toast-edge-gap: 12px;
}
:root :is(.active-display-picker, .spread-heading .section-label-row, .saved-spread-header, .studio-header, #library-screen .library-intro) {
  align-items: center;
}
/* Icons center in their space on every page. Left inline, an icon rests on a text baseline instead
   (the display row's chevron sat 4 px low). Only icon-only buttons (they carry an aria-label) change, so
   icon-and-word buttons like Copy keep flowing. */
:root [data-lucide-icon] {
  display: inline-grid;
  place-items: center;
}
:root :is([data-lucide-icon], button[aria-label]) > svg:only-child {
  display: block;
}

/* One filter-chip style on every page (Create's Library, Curate's Add panel): selected is solid accent. */
:root :is(.library-filter-chips, .content-picker-chips) { display: flex; gap: 7px; overflow-x: auto; flex-wrap: nowrap; scrollbar-width: thin; }
:root :is(.library-filter-chips, .content-picker-chips) button { flex: 0 0 auto; min-height: 40px; padding: 0 16px; border: 1px solid var(--cs-border-control); border-radius: 14px; background: transparent; color: var(--cs-text-2); font: 500 13px/1 "IBM Plex Sans", sans-serif; text-transform: none; letter-spacing: 0; }
:root :is(.library-filter-chips, .content-picker-chips) button[aria-pressed="true"] { border-color: var(--cs-accent-fill); background: var(--cs-accent-fill); color: var(--cs-on-accent); }

/* Reusable choice cards and wrapping choice pills in Controller sheets. */
:root .cs-choice { box-sizing: border-box; display: flex; align-items: center; gap: 7px; min-height: 44px; border: 1px solid var(--cs-border-control); background: var(--cs-surface-raised); color: var(--cs-text-2); font: 500 13px/1.25 "IBM Plex Sans", sans-serif; text-align: left; text-transform: none; letter-spacing: 0; cursor: pointer; }
:root .cs-choice[aria-pressed="true"] { border-color: var(--cs-accent); background: var(--cs-accent-tint); color: var(--cs-accent); }
:root .cs-choice:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
:root .cs-choice-card { position: relative; flex: 1 1 0; min-width: 0; min-height: 88px; display: grid; align-content: start; gap: 4px; padding: 9px; border-radius: 9px; }
:root .cs-choice-pill { padding: 7px 10px; border-radius: 22px; }
:root .cs-choice-card > [data-lucide-icon] { flex: none; align-self: flex-start; }
:root .cs-choice [data-lucide-icon] svg { width: 17px; height: 17px; }
:root .cs-choice-copy { display: grid; gap: 3px; min-width: 0; }
:root .cs-choice-copy strong { color: var(--cs-text); font-size: 13px; }
:root .cs-choice-copy small { color: var(--cs-text-muted); font: 400 11px/1.25 "IBM Plex Sans", sans-serif; }
:root .cs-choice-check { flex: none; margin-left: auto; visibility: hidden; }
:root .cs-choice-card .cs-choice-check { position: absolute; top: 9px; right: 9px; }
:root .cs-choice[aria-pressed="true"] .cs-choice-check { visibility: visible; }

/* Shared category filters for libraries and content pickers. */
:root .library-filter-chips { min-width: 0; align-items: center; }
:root .library-filter-chips button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap; }
:root .library-filter-chips .library-filter-clear { border: 0; padding-inline: 8px; color: var(--cs-text-muted); }
:root .library-filter-chips .library-filter-label { max-width: 100px; overflow: hidden; text-overflow: ellipsis; }
:root .library-filter-chips [data-lucide-icon] svg { width: 16px; height: 16px; }
:root .library-filter-badge { min-width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; background: var(--cs-accent-fill); color: var(--cs-on-accent); font-size: 11px; }
:root .library-filter-sheet { display: block; }
:root .library-filter-sheet:not([open]) { display: none; }
:root .library-filter-sheet h2 { margin: 0 44px 16px 0; }
:root .library-filter-sheet .play-sheet-close { position: absolute; top: 16px; right: 16px; min-width: 44px; min-height: 44px; display: grid; place-items: center; }
:root .library-filter-sheet .play-sheet-close svg { width: 20px; height: 20px; }
:root .library-filter-sheet-body { display: grid; gap: 18px; }
:root .library-filter-section { display: grid; gap: 8px; }
:root .library-filter-section h3, :root .library-filter-section p { margin: 0; }
:root .library-filter-section p { color: var(--cs-text-muted); font-size: 13px; }
:root .library-filter-sheet .library-filter-choice { width: 100%; border-radius: 9px; }
:root .library-filter-actions { position: sticky; bottom: -1.5rem; display: flex; gap: 8px; margin: 16px -1.5rem -1.5rem; padding: 12px 1.5rem 1.5rem; background: var(--cs-surface); }
:root .library-filter-actions button { min-height: 44px; flex: 1; }

/* Search boxes everywhere: our clear (X) button instead of the browser's own (search-clear.js). */
.search-field { position: relative; display: block; width: 100%; }
.search-field input[type="search"] { width: 100%; padding-right: 44px; }
.search-field input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; display: none; }
.search-clear { position: absolute; top: 50%; right: 2px; transform: translateY(-50%); display: grid; place-items: center; width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--cs-text-muted); }
.search-clear[hidden] { display: none; }
.search-clear:hover { color: var(--cs-text); }
.search-clear svg { display: block; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }

/* The caret marks focus in fields; the border changes without a ring that can clip in a sheet. */
:root input:is(:not([type]), [type="text"], [type="search"], [type="email"], [type="number"], [type="password"], [type="url"], [type="tel"]):focus,
:root textarea:focus { outline: none; box-shadow: none; border-color: var(--cs-text-faint); caret-color: var(--cs-accent); }
