

@layer theme, base, components, utilities;
/**
 * Single-file design system CSS import.
 *
 * Layer order ensures Tailwind utilities can override component classes:
 *   theme < base < components < utilities
 *
 * Tokens are un-layered so they always win over Tailwind's @layer theme defaults.
 * Base keyframes and utilities are un-layered (they target elements/pseudo-elements).
 * Content layout rules live in @layer components.
 */
/**
 * Universal design tokens.
 *
 * CSS custom properties shared across all Sujho products.
 * Product-specific tokens (catalog layout, lesson document, auras, etc.)
 * belong in each product's own stylesheet, not here.
 *
 * Categories:
 *   - Typography scale
 *   - Spacing scale
 *   - Color palette (surfaces, primary, accent, semantic)
 *   - Border radius
 *   - Elevation / shadows
 *   - Motion / easing
 *   - Scrollbar
 *   - Skeleton loading
 *   - Interactive targets
 *   - Z-index layering
 */
:root {
  /* ── Typography ──────────────────────────────────────────────────── */
  --font-sans: system-ui, sans-serif;
  --text-xs: 0.75rem;       /* 12px */
  --text-sm: 0.875rem;      /* 14px */
  --text-base: 1rem;        /* 16px */
  --text-lg: 1.125rem;      /* 18px */
  --text-xl: 1.25rem;       /* 20px */
  --text-2xl: 1.5rem;       /* 24px */
  --text-3xl: 1.875rem;     /* 30px */
  --text-4xl: 2.25rem;      /* 36px */
  --text-5xl: 3rem;         /* 48px */

  /* ── Spacing ─────────────────────────────────────────────────────── */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;

  /* ── Core Surface Colors ─────────────────────────────────────────── */
  --bg: #faf9f7;              /* warm canvas */
  --bg-card: #ffffff;         /* card surface */
  --border: #e5e7eb;          /* neutral-200 */
  --text: #0f172a;            /* slate-900 */
  --muted: #64748b;           /* slate-500 */

  /* ── Primary (Amber Brand) ──────────────────────────────────────── */
  --primary: #FFC107;
  --primary-rgb: 255, 193, 7;
  --primary-from: #FFD54F;    /* lighter amber — gradient start */
  --primary-to: #FFA000;      /* deeper amber — gradient end */
  --primary-bg: #FFF8E1;
  --primary-border: #FFE082;
  --primary-text: #78350f;

  /* ── Accent (Blue) ──────────────────────────────────────────────── */
  --accent: #2563eb;
  --accent-rgb: 37, 99, 235;

  /* ── Success ─────────────────────────────────────────────────────── */
  --success: #10b981;
  --success-bg: #ecfdf5;
  --success-border: #a7f3d0;
  --success-text: #064e3b;

  /* ── Error ───────────────────────────────────────────────────────── */
  --error: #ef4444;
  --error-bg: #fef2f2;
  --error-border: #fecaca;
  --error-text: #7f1d1d;

  /* ── Neutral ─────────────────────────────────────────────────────── */
  --neutral-light: #f5f5f5;
  --neutral-border: #d1d5db;
  --neutral-text: #6b7280;

  /* ── Radius ──────────────────────────────────────────────────────── */
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;

  /* ── Elevation ───────────────────────────────────────────────────── */
  --shadow-sm: 0 1px 2px 0 rgba(16, 24, 40, 0.05);
  --shadow-md: 0 8px 24px rgba(16, 24, 40, 0.08), 0 2px 8px rgba(16, 24, 40, 0.06);
  --shadow-lg: 0 24px 48px rgba(16, 24, 40, 0.12), 0 8px 16px rgba(16, 24, 40, 0.08);

  /* ── Motion ──────────────────────────────────────────────────────── */
  --easing-out: cubic-bezier(0.16, 1, 0.3, 1);
  --easing-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --easing-inout: cubic-bezier(0.4, 0, 0.2, 1);
  --dur-100: 120ms;
  --dur-200: 180ms;
  --dur-300: 240ms;

  /* ── Scrollbar ───────────────────────────────────────────────────── */
  --scrollbar-size: 0.5rem;
  --scrollbar-thumb-color: rgba(15, 23, 42, 0.15);
  --scrollbar-radius: var(--radius-lg);

  /* ── Skeleton Loading ────────────────────────────────────────────── */
  --skeleton-bg: rgba(15, 23, 42, 0.06);
  --skeleton-shine: rgba(255, 255, 255, 0.5);

  /* ── Interactive ─────────────────────────────────────────────────── */
  --touch-target: 2.75rem;   /* 44px — Apple HIG minimum */
  --segmented-phone-cell-width: clamp(1.125rem, 4vw, 1.75rem);

  /* ── Interactive Embeds ─────────────────────────────────────────── */
  /* DS-generated iframe controls depend on these values. */
  --interactive-control-track-height: 4px;
  --interactive-control-thumb-size: 18px;
  --interactive-toggle-width: 48px;
  --interactive-toggle-height: 26px;
  --interactive-toggle-inset: 2px;
  --interactive-toggle-knob: 22px;
  --interactive-toggle-travel: 22px;

  /* ── Overlay ───────────────────────────────────────────────────── */
  --sheet-standard-width: 720px;

  /* ── Document Layout ──────────────────────────────────────────── */
  --lesson-doc-measure: 68ch;
  --lesson-doc-gutter-min: var(--space-4);
  --lesson-doc-gutter-fluid: 3vw;
  --lesson-doc-gutter-max: var(--space-6);
  --lesson-doc-padding-block-mobile: var(--space-4);
  --lesson-doc-padding-block-desktop: var(--space-4);
  --lesson-figure-margin-y: var(--space-3);

  /* ── Z-Index Scale ───────────────────────────────────────────────── */
  --z-base: 0;
  --z-content: 10;
  --z-overlay: 20;
  --z-chrome: 40;
  --z-modal: 50;
}
/**
 * Base component classes and keyframes.
 *
 * Most component styling lives in design-system constants (surfaces, layout,
 * actions, etc.) for Tailwind consumers. This file provides:
 *   - Foundational action surfaces usable by non-Tailwind consumers (www)
 *   - Keyframe definitions (cannot be expressed as Tailwind utilities)
 */
@layer components {
  /* ── Action Surfaces ───────────────────────────────────────────────── */

  .btn-primary {
    background: linear-gradient(135deg, var(--primary-from), var(--primary-to));
    color: white;
    box-shadow: 0 6px 20px rgba(255, 193, 7, 0.35);
  }

  .btn-primary:hover {
    filter: brightness(0.92);
  }

  .btn-default {
    background: rgba(255, 255, 255, 0.8);
    color: var(--text);
    border: 1px solid var(--border);
  }

  .btn-default:hover {
    background: var(--bg-card);
  }
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
/**
 * Global resets and utilities.
 *
 * Root typography, scrollbar styling, scrollbar-hiding utility,
 * skeleton loading, and fade masks.
 */
/* ── Root Typography ───────────────────────────────────────────────── */
:root {
  font-family: var(--font-sans);
  line-height: 1.5;
  font-weight: 400;
}
/* ── Scrollbar Styling ─────────────────────────────────────────────── */
*::-webkit-scrollbar {
  width: var(--scrollbar-size);
  height: var(--scrollbar-size);
}
*::-webkit-scrollbar-thumb {
  background-color: var(--scrollbar-thumb-color);
  border-radius: var(--scrollbar-radius);
}
*::-webkit-scrollbar-track {
  background: transparent;
}
/* ── Hide Scrollbar ────────────────────────────────────────────────── */
.hide-scrollbar {
  scrollbar-width: none;
}
.hide-scrollbar::-webkit-scrollbar {
  display: none;
}
/* ── Skeleton Loading ──────────────────────────────────────────────── */
.skeleton {
  background: linear-gradient(
    90deg,
    var(--skeleton-bg) 0%,
    var(--skeleton-shine) 50%,
    var(--skeleton-bg) 100%
  );
  background-size: 200% 100%;
  border-radius: var(--radius-lg);
  animation: shimmer 1.5s infinite;
}
@layer utilities {

  /* ── Fade Masks ──────────────────────────────────────────────────── */

  .fade-mask-bottom {
    -webkit-mask-image: linear-gradient(
      to bottom,
      black 0%,
      black var(--fade-mask-solid-stop, 78%),
      transparent var(--fade-mask-clear-stop, 100%)
    );
    mask-image: linear-gradient(
      to bottom,
      black 0%,
      black var(--fade-mask-solid-stop, 78%),
      transparent var(--fade-mask-clear-stop, 100%)
    );
  }
}
/**
 * Rich-content document layout.
 *
 * Grid layout for lesson documents: a content track for readable text and
 * a full track for bleed-to-edge media like images and interactive figures.
 *
 * Token defaults live in tokens.css; products may override them.
 */
@layer components {

  /* ── Lesson Document Grid ────────────────────────────────────────── */

  .lesson-doc {
    --lesson-doc-gutter: clamp(
      var(--lesson-doc-gutter-min),
      var(--lesson-doc-gutter-fluid),
      var(--lesson-doc-gutter-max)
    );
    --lesson-doc-content-width: min(
      var(--lesson-doc-measure),
      max(0px, calc(100% - (2 * var(--lesson-doc-gutter))))
    );

    display: grid;
    grid-template-columns:
      [full-start] minmax(0, 1fr)
      [content-start] var(--lesson-doc-content-width)
      [content-end] minmax(0, 1fr)
      [full-end];
    padding-block: var(--lesson-doc-padding-block-mobile);
  }

  @media (min-width: 768px) {
    .lesson-doc {
      padding-block: var(--lesson-doc-padding-block-desktop);
    }
  }

  .lesson-doc > * {
    grid-column: content-start / content-end;
  }

  /* ── Full-Bleed Figures ──────────────────────────────────────────── */

  .lesson-doc > .lesson-figure--full {
    grid-column: full-start / full-end;
    margin-block: var(--lesson-figure-margin-y);
  }

  .lesson-doc > .lesson-figure--full > .lesson-figure__image,
  .lesson-doc > .lesson-figure--full > .lesson-figure__interactive {
    display: block;
    width: 100%;
    height: auto;
  }

  .lesson-doc > .lesson-figure--full > .lesson-figure__interactive {
    border: none;
  }

  .lesson-doc > .lesson-figure--full > .lesson-figure__caption {
    padding: var(--space-2) var(--lesson-doc-gutter) 0;
    font-size: var(--text-xs);
    color: var(--muted);
    text-align: left;
    font-weight: 400;
    line-height: 1.5;
  }
}
/* ===== Layout shells ===== */
.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: var(--space-6);
}
.login-shell {
  width: min(100%, 28rem);
}
.site-header,
.page-shell,
.tabs {
  width: min(70rem, calc(100vw - (2 * var(--space-4))));
  margin-inline: auto;
}
.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-8) 0 var(--space-6);
}
.page-shell {
  padding-bottom: var(--space-12);
}
/* ===== Surfaces ===== */
.login-card,
.card,
.empty-panel,
.toolbar {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
}
.login-card {
  padding: var(--space-8);
}
.card {
  padding: var(--space-4);
  box-shadow: var(--shadow-sm);
}
.empty-panel {
  padding: var(--space-6);
}
/* ===== Brand & nav ===== */
.brand,
.login-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
}
.brand {
  color: inherit;
  text-decoration: none;
}
.brand-mark {
  width: 2rem;
  height: auto;
  flex: none;
}
.brand-wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-2);
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.brand-wordmark em {
  font-style: normal;
  color: var(--muted);
  font-weight: 700;
}
.login-brand {
  width: 100%;
  justify-content: center;
  margin-bottom: var(--space-4);
}
.login-brand .brand-mark {
  width: 2.25rem;
}
.eyebrow {
  color: var(--primary-text);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tabs {
  display: flex;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
}
.tab {
  border-radius: 999px;
  padding: var(--space-3) var(--space-4);
  color: var(--muted);
  font-weight: 700;
  text-decoration: none;
  transition: background var(--dur-200) var(--easing-out), color var(--dur-200) var(--easing-out);
}
.tab:hover {
  background: rgba(255, 255, 255, 0.8);
  color: var(--text);
}
/* ===== Toolbar ===== */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
}
.toolbar input[type="search"] {
  flex: 1 1 18rem;
}
.toolbar-count {
  margin-left: auto;
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-card);
  color: var(--muted);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  user-select: none;
}
.toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.toggle::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: currentColor;
  opacity: 0.4;
}
.toggle:has(input:checked) {
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary-text);
}
.toggle:has(input:checked)::before {
  opacity: 1;
}
/* ===== Card content ===== */
.card-list,
.stack,
.autocomplete {
  display: grid;
  gap: var(--space-3);
}
.enrollment-card {
  display: grid;
  gap: var(--space-3);
}
.enrollment-card-header {
  display: flex;
  gap: var(--space-3);
  justify-content: space-between;
  align-items: center;
}
.identity {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
  min-width: 0;
}
.identity h3,
.identity strong {
  margin: 0;
  font-size: var(--text-lg);
  line-height: 1.2;
}
.phone {
  color: var(--text);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.01em;
}
.lead-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 999px;
  background: var(--primary);
  align-self: center;
  flex: none;
}
.muted {
  color: var(--muted);
}
/* ===== Chips ===== */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
}
.chip-row:empty {
  display: none;
}
.scope-chip {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm, 6px);
  padding: 0.125rem 0.5rem;
  background: rgba(15, 23, 42, 0.03);
  color: var(--text);
  font-size: var(--text-sm);
  font-weight: 600;
  line-height: 1.5;
}
.scope-chip-grade {
  min-width: 1.75rem;
  justify-content: center;
  background: var(--primary-bg);
  border-color: var(--primary-border);
  color: var(--primary-text);
  font-variant-numeric: tabular-nums;
  font-weight: 700;
}
.scope-chip-overflow {
  color: var(--muted);
  cursor: help;
  font-variant-numeric: tabular-nums;
}
/* ===== Disclosure ===== */
.details-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-weight: 600;
  font-size: var(--text-sm);
  padding: var(--space-1) 0;
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}
.details-panel summary::-webkit-details-marker {
  display: none;
}
.details-panel summary::before {
  content: "";
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  transition: transform var(--dur-200, 200ms) var(--easing-out, ease);
}
.details-panel[open] summary::before {
  transform: rotate(45deg);
}
.details-panel[open] summary {
  color: var(--text);
  margin-bottom: var(--space-3);
}
/* ===== Linked list (expanded panel) ===== */
.manager-body {
  display: grid;
  gap: var(--space-3);
}
.linked-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.linked-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-card);
}
.linked-item + .linked-item {
  border-top: 1px solid var(--border);
}
/* ===== Link form ===== */
.link-form {
  display: flex;
  gap: var(--space-2);
  align-items: stretch;
}
.link-form .autocomplete {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  display: block;
}
.link-form .autocomplete input[type="search"] {
  width: 100%;
}
.link-form .autocomplete-results:not(:empty) {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  z-index: 10;
  display: grid;
  gap: var(--space-1);
  padding: var(--space-1);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  max-height: 18rem;
  overflow-y: auto;
}
/* ===== Inputs ===== */
input[type="search"],
input[type="password"],
.autocomplete input {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 0.875rem;
  background: var(--bg-card);
  color: var(--text);
  font: inherit;
}
input[type="password"] {
  width: 100%;
}
.field-label {
  font-weight: 600;
}
/* ===== Buttons ===== */
button {
  appearance: none;
  -webkit-appearance: none;
  border: none;
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--dur-200) var(--easing-out), filter var(--dur-200) var(--easing-out);
}
/* Default = primary text button (e.g. login submit). */
button:not(.secondary-button):not(.icon-button):not(.autocomplete-option),
.tab-active,
.tab-active:hover {
  background: linear-gradient(135deg, var(--primary-from), var(--primary-to));
  color: #ffffff;
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.35);
}
button:not(.secondary-button):not(.icon-button):not(.autocomplete-option):hover {
  filter: brightness(0.92);
}
.secondary-button {
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--border);
  color: var(--text);
}
.secondary-button:hover {
  background: var(--bg-card);
}
/* One icon-button pattern, three intent modifiers (--muted, --danger, --primary). */
.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid transparent;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--muted);
}
.icon-button:hover:not(:disabled) {
  background: rgba(15, 23, 42, 0.05);
  color: var(--text);
}
.icon-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.icon-button .icon {
  width: 1.125rem;
  height: 1.125rem;
}
.icon-button-danger {
  color: var(--error-text);
}
.icon-button-danger:hover:not(:disabled) {
  background: var(--error-bg);
  color: var(--error-text);
}
.icon-button-primary {
  color: var(--primary-text);
  background: var(--primary-bg);
  border-color: var(--primary-border);
}
.icon-button-primary:hover:not(:disabled) {
  background: var(--primary);
  color: #ffffff;
}
/* ===== Autocomplete option ===== */
.autocomplete-option {
  display: grid;
  gap: 2px;
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm, 6px);
  color: var(--text);
  text-align: left;
}
.autocomplete-option:hover {
  background: var(--primary-bg);
  color: var(--primary-text);
}
.autocomplete-option span {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
}
.autocomplete-empty {
  padding: var(--space-2) var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}
/* ===== Banners & focus ===== */
.error-banner {
  padding: var(--space-3) var(--space-4);
  background: var(--error-bg);
  border: 1px solid var(--error-border);
  border-radius: var(--radius-md);
  color: var(--error-text);
  font-weight: 600;
}
input[type="search"]:focus-visible,
input[type="password"]:focus-visible,
.autocomplete input:focus-visible,
button:focus-visible,
.tab:focus-visible,
.toggle:focus-within,
.details-panel summary:focus-visible {
  outline: 2px solid rgba(var(--primary-rgb), 0.35);
  outline-offset: 2px;
}
@media (max-width: 760px) {
  .site-header,
  .toolbar,
  .enrollment-card-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .toolbar-count {
    margin-left: 0;
  }

  .tabs {
    flex-wrap: wrap;
  }

  .link-form {
    flex-wrap: wrap;
  }
}
