/* ============================================================
   Dashboard 静的サイト 統合CSS（自動生成 / dist専用）
   出典: _ds tokens(fonts,colors,typography,spacing,effects,base)
        + _ds_bundle.js の全コンポーネントCSS(.ds-*) 13ブロック
   ※ @import(Google Fonts) は先頭厳守。編集はソースの _ds 側で行い再生成。
   ============================================================ */
/* ===========================================================================
   Dashboard — Webfonts
   Brand book specifies: Latin = Plus Jakarta Sans (geometric, strong numerals
   for KPI), JP = Noto Sans JP (rounded gothic). Max 2 families.
   These are CDN-hosted (Google Fonts) rather than self-hosted binaries —
   see CAVEATS in readme.md. They ARE the families named in the brand book.
   =========================================================================== */
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400&family=Noto+Sans+JP:wght@400;500;700;900&display=swap');

/* ===========================================================================
   Dashboard — Color tokens
   Deep Teal (P3) palette, confirmed in the Brand Strategy Book v1.1 (2026-06).
   Rule of thumb: #BAE8E8 (D) and #FF7369 (coral needle) are FILL-ONLY — never
   body text on white. Text/lines use Deep Teal; headings/links use Func Teal.
   Mix ~ Deep Teal+white 60% / D+sub-teal 25% / func-teal text 10% / coral 5%.
   =========================================================================== */
:root {
  /* --- Brand base values --------------------------------------------------- */
  --teal-900: #0B2E34;   /* darkest — deep shadows, pressed dark surfaces      */
  --teal-800: #0F3D44;   /* Deep Teal — primary brand, dark surfaces, body txt */
  --teal-700: #14545A;   /* raised dark surface on teal                        */
  --teal-600: #14746F;   /* Functional Teal — heading/link text on light (AA)  */
  --teal-500: #5FB0A8;   /* Sub-accent mid teal — chart 2, fills               */
  --teal-300: #8FD3CE;   /* soft fill, chart gridline accents                  */
  --teal-200: #BAE8E8;   /* "D" light — fills, logo D, large display fills     */
  --teal-100: #D6F0EE;   /* tint fill                                          */
  --teal-50:  #EAF4F3;   /* lightest surface — cards, app canvas               */

  --coral-600: #E2564C;  /* darker coral — coral text/links (use sparingly)    */
  --coral-500: #FF7369;  /* Coral needle — accent, Playful spark (FILL-ONLY)   */
  --coral-300: #FFA39C;  /* soft coral fill                                    */
  --coral-100: #FFE2DF;  /* coral tint surface                                 */

  /* --- Neutrals (warm-tinted toward teal) ---------------------------------- */
  --white:    #FFFFFF;
  --ink-900:  #0F3D44;   /* = Deep Teal, primary text                          */
  --ink-700:  #335157;   /* secondary text                                     */
  --ink-500:  #5C757A;   /* muted / captions                                   */
  --ink-300:  #9DB0B3;   /* disabled text, placeholders                        */
  --line-200: #D5E2E1;   /* hairline borders on light                          */
  --line-100: #E7EEED;   /* subtle dividers                                    */
  --canvas:   #F6FAF9;   /* page background on light                           */

  /* --- Semantic status ----------------------------------------------------- */
  --success-600: #1F8A6D;
  --success-100: #DCF1E9;
  --warning-600: #C98A1E;
  --warning-100: #FBEFD6;
  --danger-600:  #D8473C;
  --danger-100:  #FCE3E0;
  --info-600:    #14746F;
  --info-100:    #D6F0EE;

  /* --- Semantic aliases (use these in components) -------------------------- */
  --brand:            var(--teal-800);
  --brand-ink:        var(--teal-600);  /* brand-colored text that passes AA   */
  --accent:           var(--coral-500);
  --accent-ink:       var(--coral-600);

  --bg-page:          var(--canvas);
  --bg-page-soft:     var(--teal-50);
  --surface-card:     var(--white);
  --surface-sunken:   var(--teal-50);
  --surface-dark:     var(--teal-800);
  --surface-dark-raised: var(--teal-700);

  --text-strong:      var(--ink-900);
  --text-body:        var(--ink-700);
  --text-muted:       var(--ink-500);
  --text-disabled:    var(--ink-300);
  --text-on-dark:     var(--teal-50);
  --text-on-dark-muted: var(--teal-300);
  --text-link:        var(--teal-600);

  --border-default:   var(--line-200);
  --border-subtle:    var(--line-100);
  --border-strong:    var(--teal-800);
  --border-focus:     var(--teal-600);

  --focus-ring:       color-mix(in srgb, var(--teal-600) 45%, transparent);
}

/* ===========================================================================
   Dashboard — Typography tokens
   Plus Jakarta Sans (Latin + numerals) over Noto Sans JP (Japanese).
   Clear, few steps. Headings tend toward 700/800; body 400/500.
   =========================================================================== */
:root {
  /* --- Families ------------------------------------------------------------ */
  --font-sans: 'Plus Jakarta Sans', 'Noto Sans JP', system-ui, -apple-system,
               'Hiragino Kaku Gothic ProN', 'Yu Gothic', Meiryo, sans-serif;
  --font-jp:   'Noto Sans JP', 'Plus Jakarta Sans', system-ui, sans-serif;
  --font-display: 'Plus Jakarta Sans', 'Noto Sans JP', system-ui, sans-serif;
  /* numerals: Plus Jakarta Sans has clean tabular figures for KPI tables */
  --font-num:  'Plus Jakarta Sans', 'Noto Sans JP', system-ui, sans-serif;

  /* --- Weights ------------------------------------------------------------- */
  --fw-regular: 400;   /* @kind font */
  --fw-medium:  500;   /* @kind font */
  --fw-semibold: 600;  /* @kind font */
  --fw-bold:    700;   /* @kind font */
  --fw-extrabold: 800; /* @kind font */

  /* --- Type scale (1.250 major-third-ish, tuned) --------------------------- */
  --fs-display: 56px;   /* hero / marquee numbers          */
  --fs-h1: 40px;
  --fs-h2: 30px;
  --fs-h3: 23px;
  --fs-h4: 19px;
  --fs-body-lg: 17px;
  --fs-body: 15px;
  --fs-sm: 13px;
  --fs-xs: 12px;
  --fs-kpi: 34px;       /* KPI tile big number             */

  /* --- Line heights -------------------------------------------------------- */
  --lh-tight: 1.1;     /* @kind font */
  --lh-snug: 1.25;     /* @kind font */
  --lh-normal: 1.5;    /* @kind font */
  --lh-relaxed: 1.7;   /* @kind font */

  /* --- Letter spacing ------------------------------------------------------ */
  --ls-tight: -0.02em;  /* @kind font */
  --ls-snug: -0.01em;   /* @kind font */
  --ls-normal: 0em;     /* @kind font */
  --ls-wide: 0.04em;    /* @kind font */

  /* --- Semantic roles ------------------------------------------------------ */
  --text-display-size: var(--fs-display);
  --text-display-weight: var(--fw-extrabold);
  --text-display-lh: var(--lh-tight);
  --text-display-ls: var(--ls-tight);

  --text-heading-weight: var(--fw-bold);
  --text-heading-lh: var(--lh-snug);

  --text-body-lh: var(--lh-relaxed);
  --text-eyebrow-size: var(--fs-xs);
  --text-eyebrow-weight: var(--fw-bold);
  --text-eyebrow-ls: var(--ls-wide);
}

/* ===========================================================================
   Dashboard — Spacing, radii, sizing
   4px base grid. Generous whitespace ("1画面1メッセージ" / Simple).
   =========================================================================== */
:root {
  /* --- Space scale (4px base) ---------------------------------------------- */
  --space-0: 0;
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;
  --space-16: 64px;
  --space-20: 80px;
  --space-24: 96px;
  --space-32: 128px;

  /* --- Radii — rounded, friendly geometry (角丸ジオメトリック) ------------- */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;   /* default control radius                              */
  --radius-lg: 16px;   /* cards                                               */
  --radius-xl: 24px;   /* large panels, hero cards                            */
  --radius-2xl: 32px;  /* logo-tile feel on big surfaces                      */
  --radius-pill: 999px;
  --radius-logo-tile: 22.5%; /* the D mark's corner ratio (≈ on a square)     */

  /* --- Container & layout -------------------------------------------------- */
  --container-sm: 640px;
  --container-md: 880px;
  --container-lg: 1120px;
  --container-xl: 1320px;
  --gutter: var(--space-6);

  /* --- Control sizing ------------------------------------------------------ */
  --control-h-sm: 32px;
  --control-h-md: 40px;
  --control-h-lg: 48px;
  --tap-min: 44px;     /* minimum touch target                               */
}

/* ===========================================================================
   Dashboard — Elevation, motion, effects
   Shadows are soft and teal-tinted (never neutral grey). Motion is light,
   quick, and a touch bouncy — "AI Native の俊敏さ". Microinteractions welcome,
   but restrained (やりすぎない).
   =========================================================================== */
:root {
  /* --- Shadows (teal-tinted) ----------------------------------------------- */
  --shadow-xs: 0 1px 2px rgba(15, 61, 68, 0.06);
  --shadow-sm: 0 2px 6px rgba(15, 61, 68, 0.08);
  --shadow-md: 0 6px 18px rgba(15, 61, 68, 0.10);
  --shadow-lg: 0 16px 40px rgba(15, 61, 68, 0.14);
  --shadow-xl: 0 28px 64px rgba(15, 61, 68, 0.18);
  /* coral glow — for a single Playful focal moment, used rarely */
  --shadow-coral: 0 8px 24px rgba(255, 115, 105, 0.30);
  /* focus ring */
  --ring-focus: 0 0 0 3px var(--focus-ring);

  /* --- Borders ------------------------------------------------------------- */
  --border-width: 1px;          /* @kind other */
  --border-width-strong: 2px;   /* @kind other */

  /* --- Motion -------------------------------------------------------------- */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);     /* @kind other */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);  /* @kind other */
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1); /* @kind other */
  --dur-instant: 80ms;  /* @kind other */
  --dur-fast: 140ms;    /* @kind other */
  --dur-base: 220ms;    /* @kind other */
  --dur-slow: 360ms;    /* @kind other */
  --transition-base: all var(--dur-base) var(--ease-out); /* @kind other */

  /* --- Blur / glass (used sparingly, e.g. sticky headers over content) ----- */
  --blur-sm: 8px;   /* @kind other */
  --blur-md: 16px;  /* @kind other */
  --glass-light: rgba(255, 255, 255, 0.72); /* @kind color */
  --glass-dark: rgba(15, 61, 68, 0.62);     /* @kind color */

  /* --- Z-index ------------------------------------------------------------- */
  --z-base: 1;        /* @kind other */
  --z-sticky: 100;    /* @kind other */
  --z-overlay: 200;   /* @kind other */
  --z-modal: 300;     /* @kind other */
  --z-toast: 400;     /* @kind other */
  --z-tooltip: 500;   /* @kind other */
}

/* ===========================================================================
   Dashboard — Base element styles
   Light, unopinionated resets + brand defaults. Components stay self-contained;
   this just makes raw HTML (cards, prose) look on-brand out of the box.
   =========================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: var(--text-body-lh);
  color: var(--text-body);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: 'palt' 1; /* tighten JP punctuation */
}

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 0.5em;
  color: var(--text-strong);
  font-weight: var(--fw-bold);
  line-height: var(--text-heading-lh);
  letter-spacing: var(--ls-snug);
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); font-weight: var(--fw-extrabold); letter-spacing: var(--ls-tight); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

p { margin: 0 0 1em; text-wrap: pretty; }

a {
  color: var(--text-link);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}
a:hover { color: var(--teal-800); text-decoration: underline; text-underline-offset: 2px; }

small { font-size: var(--fs-sm); }

code, kbd, samp {
  font-family: 'Plus Jakarta Sans', ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.92em;
}

hr { border: 0; border-top: 1px solid var(--border-subtle); margin: var(--space-6) 0; }

::selection { background: var(--coral-100); color: var(--teal-800); }

:focus-visible { outline: none; box-shadow: var(--ring-focus); border-radius: var(--radius-xs); }

/* Eyebrow / overline helper used across specimens and kits */
.ds-eyebrow {
  font-size: var(--text-eyebrow-size);
  font-weight: var(--text-eyebrow-weight);
  letter-spacing: var(--ls-wide);
  text-transform: uppercase;
  color: var(--brand-ink);
}

/* ===== components (.ds-*) from _ds_bundle.js ===== */

.ds-btn {
  --_h: var(--control-h-md);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  height: var(--_h); padding: 0 var(--space-5);
  font-family: var(--font-sans); font-size: var(--fs-body); font-weight: var(--fw-semibold);
  line-height: 1; letter-spacing: var(--ls-snug); white-space: nowrap;
  border: var(--border-width-strong) solid transparent; border-radius: var(--radius-md);
  cursor: pointer; user-select: none; text-decoration: none;
  transition: background var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
}
.ds-btn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.ds-btn:active { transform: scale(0.98); }
.ds-btn[disabled], .ds-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }

.ds-btn--sm { --_h: var(--control-h-sm); padding: 0 var(--space-3); font-size: var(--fs-sm); border-radius: var(--radius-sm); }
.ds-btn--lg { --_h: var(--control-h-lg); padding: 0 var(--space-6); font-size: var(--fs-body-lg); }
.ds-btn--block { display: flex; width: 100%; }

/* primary — Deep Teal */
.ds-btn--primary { background: var(--teal-800); color: var(--teal-50); border-color: var(--teal-800); }
.ds-btn--primary:hover { background: var(--teal-900); border-color: var(--teal-900); box-shadow: var(--shadow-sm); }

/* accent — coral, the Playful CTA (use rarely) */
.ds-btn--accent { background: var(--coral-500); color: var(--white); border-color: var(--coral-500); }
.ds-btn--accent:hover { background: var(--coral-600); border-color: var(--coral-600); box-shadow: var(--shadow-coral); }

/* secondary — outline */
.ds-btn--secondary { background: var(--white); color: var(--teal-600); border-color: var(--line-200); }
.ds-btn--secondary:hover { border-color: var(--teal-600); color: var(--teal-800); background: var(--teal-50); }

/* ghost — quiet */
.ds-btn--ghost { background: transparent; color: var(--teal-600); border-color: transparent; }
.ds-btn--ghost:hover { background: var(--teal-50); color: var(--teal-800); }

/* on dark surfaces */
.ds-btn--on-dark { background: var(--teal-200); color: var(--teal-900); border-color: var(--teal-200); }
.ds-btn--on-dark:hover { background: var(--white); border-color: var(--white); }


.ds-iconbtn {
  --_s: var(--control-h-md);
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--_s); height: var(--_s); padding: 0;
  border: var(--border-width-strong) solid transparent; border-radius: var(--radius-md);
  background: transparent; color: var(--teal-600); cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out), transform var(--dur-fast) var(--ease-out);
}
.ds-iconbtn:hover { background: var(--teal-50); color: var(--teal-800); }
.ds-iconbtn:active { transform: scale(0.94); }
.ds-iconbtn:focus-visible { outline: none; box-shadow: var(--ring-focus); }
.ds-iconbtn[disabled] { opacity: 0.4; cursor: not-allowed; }
.ds-iconbtn--sm { --_s: var(--control-h-sm); border-radius: var(--radius-sm); }
.ds-iconbtn--lg { --_s: var(--control-h-lg); }
.ds-iconbtn--solid { background: var(--teal-800); color: var(--teal-50); border-color: var(--teal-800); }
.ds-iconbtn--solid:hover { background: var(--teal-900); color: var(--white); }
.ds-iconbtn--outline { border-color: var(--line-200); }
.ds-iconbtn--outline:hover { border-color: var(--teal-600); }


.ds-avatar {
  position: relative; display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%; overflow: visible; flex: none;
  font-family: var(--font-sans); font-weight: var(--fw-bold); color: var(--teal-800);
  background: var(--teal-200); font-size: var(--fs-sm); user-select: none;
}
.ds-avatar--sm { width: 28px; height: 28px; font-size: var(--fs-xs); }
.ds-avatar--lg { width: 56px; height: 56px; font-size: var(--fs-body-lg); }
.ds-avatar--xl { width: 80px; height: 80px; font-size: var(--fs-h3); }
.ds-avatar--square { border-radius: var(--radius-md); }
.ds-avatar--coral { background: var(--coral-300); color: var(--coral-600); }
.ds-avatar--teal { background: var(--teal-500); color: var(--white); }
.ds-avatar--dark { background: var(--teal-800); color: var(--teal-50); }
.ds-avatar__img { width: 100%; height: 100%; object-fit: cover; border-radius: inherit; }
.ds-avatar__status {
  position: absolute; right: -1px; bottom: -1px; width: 28%; height: 28%; min-width: 9px; min-height: 9px;
  border-radius: 50%; border: 2px solid var(--white); background: var(--ink-300);
}
.ds-avatar__status--online { background: var(--success-600); }
.ds-avatar__status--busy { background: var(--danger-600); }
.ds-avatar__status--away { background: var(--warning-600); }


.ds-stat {
  display: flex; flex-direction: column; gap: var(--space-3);
  background: var(--surface-card); border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  padding: var(--space-5); font-family: var(--font-sans); min-width: 0;
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out);
}
.ds-stat--interactive { cursor: pointer; }
.ds-stat--interactive:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.ds-stat--dark { background: var(--surface-dark); border-color: transparent; color: var(--text-on-dark); }
.ds-stat__top { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.ds-stat__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-muted); margin: 0; }
.ds-stat--dark .ds-stat__label { color: var(--text-on-dark-muted); }
.ds-stat__icon { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: var(--radius-sm); background: var(--teal-50); color: var(--teal-600); flex: none; }
.ds-stat--dark .ds-stat__icon { background: var(--surface-dark-raised); color: var(--teal-200); }
.ds-stat__value { font-family: var(--font-num); font-size: var(--fs-kpi); font-weight: var(--fw-extrabold); line-height: 1; letter-spacing: var(--ls-tight); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.ds-stat--dark .ds-stat__value { color: var(--white); }
.ds-stat__unit { font-size: 0.5em; font-weight: var(--fw-bold); color: var(--text-muted); margin-left: 3px; }
.ds-stat__foot { display: flex; align-items: center; gap: var(--space-2); font-size: var(--fs-sm); }
.ds-stat__delta { display: inline-flex; align-items: center; gap: 3px; font-weight: var(--fw-bold); font-variant-numeric: tabular-nums; }
.ds-stat__delta--up { color: var(--success-600); }
.ds-stat__delta--down { color: var(--danger-600); }
.ds-stat__delta--flat { color: var(--text-muted); }
.ds-stat__delta svg { width: 14px; height: 14px; }
.ds-stat__note { color: var(--text-muted); }
.ds-stat--dark .ds-stat__note { color: var(--text-on-dark-muted); }


.ds-badge {
  display: inline-flex; align-items: center; gap: 5px;
  height: 22px; padding: 0 10px; font-family: var(--font-sans);
  font-size: var(--fs-xs); font-weight: var(--fw-bold); line-height: 1;
  border-radius: var(--radius-pill); white-space: nowrap; letter-spacing: .01em;
}
.ds-badge__dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.ds-badge--neutral { background: var(--teal-50); color: var(--teal-600); }
.ds-badge--brand   { background: var(--teal-800); color: var(--teal-50); }
.ds-badge--accent  { background: var(--coral-100); color: var(--coral-600); }
.ds-badge--success { background: var(--success-100); color: var(--success-600); }
.ds-badge--warning { background: var(--warning-100); color: var(--warning-600); }
.ds-badge--danger  { background: var(--danger-100); color: var(--danger-600); }
.ds-badge--info    { background: var(--info-100); color: var(--info-600); }
.ds-badge--outline { background: transparent; box-shadow: inset 0 0 0 1.5px var(--line-200); color: var(--text-body); }


.ds-progress { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); }
.ds-progress__head { display: flex; justify-content: space-between; align-items: baseline; }
.ds-progress__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-body); }
.ds-progress__val { font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text-strong); font-variant-numeric: tabular-nums; }
.ds-progress__track { height: 8px; border-radius: var(--radius-pill); background: var(--teal-50); overflow: hidden; }
.ds-progress--lg .ds-progress__track { height: 12px; }
.ds-progress--sm .ds-progress__track { height: 6px; }
.ds-progress__fill {
  height: 100%; border-radius: var(--radius-pill); background: var(--teal-600);
  transition: width var(--dur-slow) var(--ease-out);
}
.ds-progress--accent .ds-progress__fill { background: var(--coral-500); }
.ds-progress--success .ds-progress__fill { background: var(--success-600); }
.ds-progress--gradient .ds-progress__fill { background: linear-gradient(90deg, var(--teal-500), var(--teal-600)); }
.ds-progress__track--striped .ds-progress__fill {
  background-image: linear-gradient(45deg, rgba(255,255,255,.25) 25%, transparent 25%, transparent 50%, rgba(255,255,255,.25) 50%, rgba(255,255,255,.25) 75%, transparent 75%);
  background-size: 16px 16px;
}


.ds-tag {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; font-family: var(--font-sans);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-body);
  background: var(--white); border: 1px solid var(--line-200); border-radius: var(--radius-sm);
  transition: border-color var(--dur-fast) var(--ease-out), background var(--dur-fast) var(--ease-out);
}
.ds-tag--selected { background: var(--teal-800); border-color: var(--teal-800); color: var(--teal-50); }
.ds-tag--clickable { cursor: pointer; }
.ds-tag--clickable:hover { border-color: var(--teal-500); }
.ds-tag--selected.ds-tag--clickable:hover { background: var(--teal-900); border-color: var(--teal-900); }
.ds-tag__x {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px; margin-right: -3px; border-radius: 50%;
  border: 0; background: transparent; color: inherit; cursor: pointer; opacity: .6;
  font-size: 14px; line-height: 1; transition: opacity var(--dur-fast) var(--ease-out);
}
.ds-tag__x:hover { opacity: 1; background: color-mix(in srgb, currentColor 18%, transparent); }


@keyframes ds-toast-in { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.ds-toast {
  display: flex; align-items: flex-start; gap: var(--space-3);
  width: 360px; max-width: calc(100vw - 32px); padding: var(--space-4);
  background: var(--white); border: 1px solid var(--line-100);
  border-radius: var(--radius-md); box-shadow: var(--shadow-lg);
  font-family: var(--font-sans); animation: ds-toast-in var(--dur-base) var(--ease-bounce) both;
}
@media (prefers-reduced-motion: reduce) { .ds-toast { animation: none; } }
.ds-toast__accent { width: 4px; align-self: stretch; border-radius: var(--radius-pill); flex: none; background: var(--teal-600); }
.ds-toast--success .ds-toast__accent { background: var(--success-600); }
.ds-toast--warning .ds-toast__accent { background: var(--warning-600); }
.ds-toast--danger .ds-toast__accent { background: var(--danger-600); }
.ds-toast--accent .ds-toast__accent { background: var(--coral-500); }
.ds-toast__icon { flex: none; display: inline-flex; color: var(--teal-600); margin-top: 1px; }
.ds-toast--success .ds-toast__icon { color: var(--success-600); }
.ds-toast--warning .ds-toast__icon { color: var(--warning-600); }
.ds-toast--danger .ds-toast__icon { color: var(--danger-600); }
.ds-toast--accent .ds-toast__icon { color: var(--coral-600); }
.ds-toast__body { flex: 1; min-width: 0; }
.ds-toast__title { margin: 0; font-size: var(--fs-body); font-weight: var(--fw-bold); color: var(--text-strong); }
.ds-toast__msg { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.ds-toast__close { flex: none; border: 0; background: transparent; color: var(--ink-500); cursor: pointer; font-size: 16px; line-height: 1; padding: 2px; border-radius: var(--radius-xs); }
.ds-toast__close:hover { color: var(--text-strong); background: var(--teal-50); }


.ds-check { display: inline-flex; align-items: flex-start; gap: var(--space-2); cursor: pointer; font-family: var(--font-sans); user-select: none; }
.ds-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-check__box {
  flex: none; width: 20px; height: 20px; margin-top: 1px;
  border: 2px solid var(--line-200); border-radius: var(--radius-xs); background: var(--white);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out);
}
.ds-check__box svg { width: 13px; height: 13px; stroke: var(--white); stroke-width: 3.5;
  stroke-linecap: round; stroke-linejoin: round; fill: none;
  stroke-dasharray: 20; stroke-dashoffset: 20; transition: stroke-dashoffset var(--dur-base) var(--ease-bounce); }
.ds-check:hover .ds-check__box { border-color: var(--teal-500); }
.ds-check input:focus-visible + .ds-check__box { box-shadow: var(--ring-focus); }
.ds-check input:checked + .ds-check__box { background: var(--teal-800); border-color: var(--teal-800); }
.ds-check input:checked + .ds-check__box svg { stroke-dashoffset: 0; }
.ds-check input:disabled + .ds-check__box { background: var(--teal-50); border-color: var(--line-100); }
.ds-check input:disabled ~ .ds-check__label { color: var(--ink-300); }
.ds-check__label { font-size: var(--fs-body); color: var(--text-body); line-height: 1.35; }
.ds-check__label small { display: block; font-size: var(--fs-xs); color: var(--text-muted); margin-top: 1px; }


.ds-field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); }
.ds-field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.ds-field__req { color: var(--coral-600); margin-left: 2px; }
.ds-input-wrap { position: relative; display: flex; align-items: center; }
.ds-input {
  width: 100%; height: var(--control-h-md); padding: 0 var(--space-3);
  font-family: var(--font-sans); font-size: var(--fs-body); color: var(--text-strong);
  background: var(--white); border: var(--border-width) solid var(--line-200);
  border-radius: var(--radius-md); outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ds-input::placeholder { color: var(--ink-300); }
.ds-input:hover { border-color: var(--teal-500); }
.ds-input:focus { border-color: var(--teal-600); box-shadow: var(--ring-focus); }
.ds-input:disabled { background: var(--teal-50); color: var(--ink-300); cursor: not-allowed; }
.ds-input--has-lead { padding-left: 38px; }
.ds-input--has-trail { padding-right: 38px; }
.ds-input--lg { height: var(--control-h-lg); font-size: var(--fs-body-lg); }
.ds-input--sm { height: var(--control-h-sm); font-size: var(--fs-sm); }
.ds-input-icon { position: absolute; display: inline-flex; color: var(--ink-500); pointer-events: none; }
.ds-input-icon--lead { left: 12px; }
.ds-input-icon--trail { right: 12px; }
.ds-field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.ds-field--error .ds-input { border-color: var(--danger-600); }
.ds-field--error .ds-input:focus { box-shadow: 0 0 0 3px color-mix(in srgb, var(--danger-600) 30%, transparent); }
.ds-field--error .ds-field__hint { color: var(--danger-600); }


.ds-select-field { display: flex; flex-direction: column; gap: 6px; font-family: var(--font-sans); }
.ds-select-field__label { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.ds-select-wrap { position: relative; display: flex; align-items: center; }
.ds-select {
  appearance: none; -webkit-appearance: none; width: 100%;
  height: var(--control-h-md); padding: 0 38px 0 var(--space-3);
  font-family: var(--font-sans); font-size: var(--fs-body); color: var(--text-strong);
  background: var(--white); border: var(--border-width) solid var(--line-200);
  border-radius: var(--radius-md); cursor: pointer; outline: none;
  transition: border-color var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.ds-select:hover { border-color: var(--teal-500); }
.ds-select:focus { border-color: var(--teal-600); box-shadow: var(--ring-focus); }
.ds-select:disabled { background: var(--teal-50); color: var(--ink-300); cursor: not-allowed; }
.ds-select--lg { height: var(--control-h-lg); font-size: var(--fs-body-lg); }
.ds-select--sm { height: var(--control-h-sm); font-size: var(--fs-sm); }
.ds-select-caret {
  position: absolute; right: 12px; pointer-events: none; color: var(--ink-500);
  width: 16px; height: 16px; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
  transform: translateY(-3px) rotate(45deg); border-radius: 1px;
}


.ds-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-family: var(--font-sans); user-select: none; }
.ds-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.ds-switch__track {
  flex: none; position: relative; width: 44px; height: 26px; border-radius: var(--radius-pill);
  background: var(--line-200); transition: background var(--dur-base) var(--ease-out);
}
.ds-switch__thumb {
  position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--white); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-base) var(--ease-bounce);
}
.ds-switch input:checked + .ds-switch__track { background: var(--teal-600); }
.ds-switch input:checked + .ds-switch__track .ds-switch__thumb { transform: translateX(18px); }
.ds-switch--accent input:checked + .ds-switch__track { background: var(--coral-500); }
.ds-switch input:focus-visible + .ds-switch__track { box-shadow: var(--ring-focus); }
.ds-switch input:disabled + .ds-switch__track { opacity: 0.5; }
.ds-switch__label { font-size: var(--fs-body); color: var(--text-body); }


.ds-card {
  display: block; background: var(--surface-card);
  border: var(--border-width) solid var(--border-subtle); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm); padding: var(--space-6);
  transition: box-shadow var(--dur-base) var(--ease-out), transform var(--dur-base) var(--ease-out),
              border-color var(--dur-base) var(--ease-out);
}
.ds-card--sunken { background: var(--surface-sunken); box-shadow: none; border-color: transparent; }
.ds-card--dark { background: var(--surface-dark); color: var(--text-on-dark); border-color: transparent; box-shadow: var(--shadow-md); }
.ds-card--flat { box-shadow: none; }
.ds-card--pad-sm { padding: var(--space-4); }
.ds-card--pad-lg { padding: var(--space-8); }
.ds-card--interactive { cursor: pointer; }
.ds-card--interactive:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: var(--line-200); }
.ds-card--interactive:active { transform: translateY(0); }
.ds-card__head { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.ds-card__title { margin: 0; font-size: var(--fs-h4); font-weight: var(--fw-bold); color: var(--text-strong); letter-spacing: var(--ls-snug); }
.ds-card--dark .ds-card__title { color: var(--text-on-dark); }
.ds-card__sub { margin: 2px 0 0; font-size: var(--fs-sm); color: var(--text-muted); }
.ds-card--dark .ds-card__sub { color: var(--text-on-dark-muted); }

