/* ===================================================================
   ORTY UI — shadcn/ui component library (vanilla CSS port)
   -------------------------------------------------------------------
   Loaded AFTER static/style.css so its rules win at equal specificity.

   Follows the real shadcn "dark" theme scaffold: flat surfaces,
   low-alpha borders, r=0.625rem base radius, near-white high-emphasis
   buttons, muted secondary/ghost variants, data-state driven widgets.

   Orty mapping:
     --primary / --cyan  → success / score tiers / verification (teal)
     --brand             → coral ACCENT only (links, active, focus)
     --btn (near-white)  → default high-emphasis button (shadcn primary)

   Components are semantic classes with shadcn-style state attributes:
     [data-state="open|closed|checked|unchecked|active|on|off"]
     [data-disabled], [aria-selected="true"], [aria-current]
   =================================================================== */

/* ==================================================================
   1. TOKENS
   ================================================================== */
:root {
  /* shadcn radius scale (base 0.625rem) */
  --radius: 0.625rem;
  --radius-sm: calc(var(--radius) * 0.6);
  --radius-md: calc(var(--radius) * 0.8);
  --radius-lg: var(--radius);
  --radius-xl: calc(var(--radius) * 1.4);
  --radius-2xl: calc(var(--radius) * 1.8);
  --radius-full: 999px;
  --radius-btn: var(--radius-md);
  --radius-tag: var(--radius-sm);

  /* surfaces */
  --background: #0a0a0c;
  --foreground: #f4f2f0;
  --card: #16161a;
  --card-2: #111114;
  --popover: #1c1c22;
  --elevated: #1c1c22;
  --secondary: #26262d;
  --muted: #26262d;
  --accent-surface: #26262d;
  --in-field: #121217;
  --input: #121217;

  /* legacy surface aliases */
  --bg: var(--background);
  --text: #ece9e7;
  --text-muted: rgba(236, 233, 231, 0.66);
  --text-faint: #8b8994;
  --glass: rgba(22, 22, 26, 0.86);
  --glass-2: rgba(17, 17, 20, 0.86);
  --muted-foreground: var(--text-muted);

  /* borders */
  --border: rgba(255, 255, 255, 0.1);
  --border-strong: rgba(255, 255, 255, 0.17);
  --border-soft: rgba(255, 255, 255, 0.06);
  --line: var(--border);

  /* default button = near-white (shadcn primary) */
  --btn: #f4f2f0;
  --btn-foreground: #0d0d10;
  --btn-hover: #e4e2e0;
  --primary-foreground: #0d0d10;

  /* success / score (teal) */
  --primary: #2dd4a0;
  --primary-dim: #189a72;
  --primary-soft: rgba(45, 212, 160, 0.14);
  --on-primary: #04231b;
  --cyan: #2dd4a0;
  --cyan-deep: #189a72;
  --cyan-soft: rgba(45, 212, 160, 0.14);
  --ok: var(--primary);

  /* coral accent only */
  --brand: #f2603c;
  --brand-bright: #ff7a57;
  --brand-deep: #d14e2e;
  --brand-soft: rgba(242, 96, 60, 0.1);
  --coral: #f2603c;
  --coral-deep: #d14e2e;
  --coral-soft: rgba(242, 96, 60, 0.1);
  --accent: var(--brand);
  --accent-dim: var(--brand-deep);
  --accent-glow: var(--brand-soft);

  --amber: #f2c545;
  --amber-soft: rgba(242, 197, 69, 0.14);
  --info: #6aa6f5;
  --info-soft: rgba(106, 166, 245, 0.14);
  --destructive: #e5484d;
  --destructive-deep: #c93a3a;
  --destructive-soft: rgba(229, 72, 77, 0.12);
  --danger: var(--destructive);
  --danger-dim: var(--destructive-deep);
  --danger-soft: var(--destructive-soft);

  --ring: rgba(242, 96, 60, 0.32);

  --shadow: 0 20px 45px -25px rgba(0, 0, 0, 0.8), 0 8px 22px -14px rgba(0, 0, 0, 0.55);
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.35);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4), 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 28px -14px rgba(0, 0, 0, 0.7), 0 4px 10px -6px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 30px 70px -24px rgba(0, 0, 0, 0.85), 0 10px 24px -12px rgba(0, 0, 0, 0.6);

  --duration-fast: 120ms;
  --duration-base: 180ms;
  --duration-slow: 280ms;
  --panel: var(--glass);
  --panel-2: var(--glass-2);
}

/* ==================================================================
   2. BASE + MOTION
   ================================================================== */
html {
  scroll-behavior: smooth;
}
html,
body {
  background: var(--background);
  color: var(--text);
}
body {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}
::selection {
  background: var(--brand-soft);
  color: var(--brand-bright);
}
:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
* {
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
  scrollbar-width: thin;
}
*::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
*::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-full);
  border: 2px solid transparent;
  background-clip: content-box;
}
*::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.24);
  background-clip: content-box;
}

@keyframes orty-dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: none; }
}
@keyframes orty-menu-in {
  from { opacity: 0; transform: translateY(-4px) scale(0.985); }
  to { opacity: 1; transform: none; }
}
@keyframes orty-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes orty-shimmer {
  0% { background-position: -180% 0; }
  100% { background-position: 180% 0; }
}
@keyframes orty-spin {
  to { transform: rotate(360deg); }
}
.view.active {
  animation-duration: var(--duration-slow);
}
.view.active .panel {
  animation-duration: 340ms;
}

/* ==================================================================
   3. BUTTON (+ Button Group)
   ================================================================== */
.btn,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px; /* h-9 */
  padding: 0 16px; /* px-4 */
  border-radius: var(--radius-md); /* rounded-md */
  background: var(--btn);
  color: var(--btn-foreground);
  border: 1px solid transparent;
  font-weight: 500; /* font-medium */
  font-size: 14px; /* text-sm */
  letter-spacing: 0;
  box-shadow: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color var(--duration-fast) var(--ease-out),
    border-color var(--duration-fast) var(--ease-out),
    color var(--duration-fast) var(--ease-out),
    box-shadow var(--duration-fast) var(--ease-out),
    transform var(--duration-fast) var(--ease-out);
}
.btn:hover:not(:disabled), .btn-primary:hover:not(:disabled) { background: var(--btn-hover); }
.btn:active:not(:disabled), .btn-primary:active:not(:disabled) { transform: translateY(1px) scale(0.995); }
.btn:disabled, .btn-primary:disabled { opacity: 0.45; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.loading { animation: btn-pulse 1.4s var(--ease-out) infinite; cursor: wait; }

.btn.secondary { background: var(--secondary); color: var(--text); border-color: transparent; box-shadow: none; }
.btn.secondary:hover:not(:disabled) { background: #30303a; color: var(--text); }
.btn.outline, .btn-ghost { background: transparent; color: var(--text); border-color: var(--border); box-shadow: none; }
.btn.outline:hover:not(:disabled), .btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: var(--border-strong); color: var(--text); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.06); border-color: transparent; }
.btn.brand { background: var(--brand); color: #180a05; border-color: rgba(255, 255, 255, 0.14); box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.16), var(--shadow-xs); }
.btn.brand:hover:not(:disabled) { background: var(--brand-bright); }
.btn.danger, .btn-coral { background: var(--destructive); color: #fff; border-color: transparent; box-shadow: var(--shadow-xs); }
.btn.danger:hover:not(:disabled) { background: var(--destructive-deep); box-shadow: var(--shadow-sm); }
.btn.danger:disabled { background: transparent; color: var(--destructive); border: 1px solid var(--destructive); box-shadow: none; }

.btn.small, .btn-small { height: 32px; padding: 0 12px; font-size: 12.5px; border-radius: var(--radius-sm); }
.btn.large, .btn-lg { height: 46px; padding: 0 22px; font-size: 14.5px; }
.btn.icon, .btn.icon-only-btn { width: 40px; height: 40px; padding: 0; }
.btn.icon.small { width: 32px; height: 32px; }

.btn-copy, .outreach-copy-btn {
  display: inline-flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04); color: var(--text-muted);
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.btn-copy:hover, .outreach-copy-btn:hover { background: rgba(255, 255, 255, 0.08); border-color: var(--border-strong); color: var(--text); }
.btn-copy.done { color: var(--primary); border-color: rgba(45, 212, 160, 0.4); background: var(--primary-soft); }

/* Button Group */
.button-group { display: inline-flex; align-items: stretch; }
.button-group > .btn { border-radius: 0; margin-left: -1px; }
.button-group > .btn:first-child { border-radius: var(--radius-btn) 0 0 var(--radius-btn); margin-left: 0; }
.button-group > .btn:last-child { border-radius: 0 var(--radius-btn) var(--radius-btn) 0; }
.button-group > .btn:only-child { border-radius: var(--radius-btn); }

/* ==================================================================
   4. BADGE / TAG / CHIP
   ================================================================== */
.badge, .tag {
  display: inline-flex; align-items: center; gap: 5px;
  border-radius: var(--radius-full);
  font-size: 11px; font-weight: 600; line-height: 1;
  padding: 4px 9px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text-muted);
  white-space: nowrap;
}
.badge.default { background: var(--btn); color: var(--btn-foreground); border-color: transparent; }
.badge.secondary { background: var(--secondary); color: var(--text); border-color: transparent; }
.badge.outline { background: transparent; }
.badge.success { color: var(--primary); background: var(--primary-soft); border-color: rgba(45, 212, 160, 0.3); }
.badge.warning { color: var(--amber); background: var(--amber-soft); border-color: rgba(242, 197, 69, 0.3); }
.badge.danger { color: #ff9c84; background: var(--destructive-soft); border-color: rgba(229, 72, 77, 0.35); }
.badge.brand { color: var(--brand-bright); background: var(--brand-soft); border-color: rgba(242, 96, 60, 0.28); }

.tag { border-radius: var(--radius-tag); font-weight: 600; }
.tag.req { color: var(--brand-bright); background: var(--brand-soft); border: 1px solid rgba(242, 96, 60, 0.24); }
.tag.opt { color: var(--text-faint); background: rgba(255, 255, 255, 0.03); border: 1px solid var(--border-soft); }

.score-chip { border-radius: var(--radius-tag); font-variant-numeric: tabular-nums; font-weight: 700; }
.score-chip.strong { color: var(--primary); background: var(--primary-soft); border: 1px solid rgba(45, 212, 160, 0.3); }
.score-chip.maybe { color: var(--amber); background: var(--amber-soft); border: 1px solid rgba(242, 197, 69, 0.3); }
.score-chip.skip { color: #ff9c84; background: var(--brand-soft); border: 1px solid rgba(242, 96, 60, 0.3); }

.conf-chip { border-radius: var(--radius-full); border: 1px solid var(--border); color: var(--text-muted); }
.conf-chip.conf-high { border-color: rgba(45, 212, 160, 0.35); background: var(--primary-soft); color: var(--text); }
.conf-chip.conf-medium { border-color: rgba(242, 197, 69, 0.32); background: var(--amber-soft); color: var(--text-muted); }
.conf-chip.conf-low { border-color: rgba(242, 96, 60, 0.26); background: var(--brand-soft); color: var(--text-muted); }

.niche-chip, .context-chip, .suggest-chip {
  border-radius: var(--radius-full); border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03); color: var(--text-muted);
  transition: border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out);
}
.niche-chip:hover, .suggest-chip:hover { border-color: var(--brand); color: var(--brand-bright); background: var(--brand-soft); }

/* ==================================================================
   5. CARD
   ================================================================== */
.card {
  border-radius: 12px; /* shadcn card = rounded-xl */
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.card-header { display: flex; flex-direction: column; gap: 4px; padding: 18px 18px 0; }
.card-title { font-size: 15px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.card-description { font-size: 12.5px; color: var(--text-muted); }
.card-content { padding: 18px; }
.card-footer { display: flex; align-items: center; gap: 10px; padding: 0 18px 18px; }
.card.interactive:hover { border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md); }

/* ==================================================================
   6. FORMS — label, field, input, textarea, select, checkbox, radio,
      switch, slider, input-group, input-otp, kbd
   ================================================================== */
.label { display: inline-block; font-size: 12.5px; font-weight: 600; color: var(--text-muted); margin-bottom: 6px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field-row { display: flex; gap: 10px; align-items: center; }
.field-error { font-size: 12px; color: var(--destructive); }
.field-hint, .label-hint, .hint, .microhint, .gb-question-hint, .gb-header-hint { color: var(--text-faint); }
.hint-link { color: var(--brand-bright); }

input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
textarea, select,
.input, .textarea, .native-select {
  width: 100%;
  font-family: inherit;
  font-size: 14px; /* text-sm */
  color: var(--text);
  background: rgba(255, 255, 255, 0.03) !important;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 12px; /* px-3 */
  box-shadow: var(--shadow-xs);
  transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), background-color var(--duration-base) var(--ease-out);
}
/* Single-line controls get the shadcn h-9 height. */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="search"], input[type="tel"], input[type="url"], input[type="date"],
select, .input, .native-select {
  height: 36px;
  padding: 0 12px;
}
textarea, .textarea { padding: 8px 12px; }
input:hover, textarea:hover, select:hover { border-color: var(--border-strong); }
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--ring);
}
input[aria-invalid="true"], textarea[aria-invalid="true"], select[aria-invalid="true"] {
  border-color: var(--destructive);
  box-shadow: 0 0 0 3px var(--destructive-soft);
}
textarea { min-height: 86px; resize: vertical; line-height: 1.55; }
textarea.mono { font-family: var(--mono); font-size: 12.5px; }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type="file"] { display: none; }

select, .native-select {
  appearance: none; -webkit-appearance: none; -moz-appearance: none; cursor: pointer;
  padding-right: 34px;
  /* Single shorthand keeps color + one no-repeat chevron + explicit size,
     so nothing can tile the arrow. */
  background: rgba(255, 255, 255, 0.03)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23a1a0aa'/></svg>")
    no-repeat right 12px center !important;
  background-size: 10px 6px !important;
}
select:focus, .native-select:focus {
  background: rgba(255, 255, 255, 0.03)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path d='M0 0l5 6 5-6z' fill='%23f2603c'/></svg>")
    no-repeat right 12px center !important;
  background-size: 10px 6px !important;
}
/* Native option list — best effort (browser-controlled). */
option {
  background: var(--elevated);
  color: var(--text);
}

/* Settings / modal selects get full shadcn control sizing even though the
   legacy .status-select class (compact mono) would otherwise win. */
.settings-overlay select,
.modal select,
.modal-provider-config select,
#s-chat-provider,
#s-email-provider,
#reply-email-provider,
#feedback-reason {
  height: 36px !important;
  padding: 0 34px 0 12px !important;
  font-family: var(--font) !important;
  font-size: 13.5px !important;
  width: 100%;
}

/* Input group (leading/trailing addon) */
.input-group { display: flex; align-items: stretch; }
.input-group > * { border-radius: 0; margin-left: -1px; }
.input-group > *:first-child { border-radius: var(--radius-md) 0 0 var(--radius-md); margin-left: 0; }
.input-group > *:last-child { border-radius: 0 var(--radius-md) var(--radius-md) 0; }
.input-group .input-addon { display: inline-flex; align-items: center; padding: 0 12px; background: var(--secondary); border: 1px solid var(--border); color: var(--text-muted); font-size: 12.5px; }

/* OTP */
.input-otp { display: inline-flex; gap: 8px; }
.input-otp input {
  width: 40px; height: 44px; text-align: center; padding: 0;
  font-family: var(--mono); font-size: 16px; border-radius: var(--radius-md);
}

/* --- CHECKBOX (custom, shadcn-style) -----------------------------
   Pseudo-elements don't render on <input>, so the check/dash marks are
   painted as SVG background-images instead. Works on every checkbox. */
input[type="checkbox"], input[type="checkbox"].checkbox, .checkbox {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex: none; margin: 0;
  border: 1px solid var(--border-strong);
  border-radius: 4px;
  background-color: var(--input);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 11px 11px;
  cursor: pointer; display: inline-block; vertical-align: -3px;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
input[type="checkbox"]:hover, .checkbox:hover { border-color: var(--brand); }
input[type="checkbox"]:checked, .checkbox:checked,
input[type="checkbox"]:indeterminate, .checkbox:indeterminate {
  background-color: var(--btn);
  border-color: var(--btn);
}
input[type="checkbox"]:checked, .checkbox:checked {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><path d='M3.4 8.4l3 3 6.2-6.6' fill='none' stroke='%230d0d10' stroke-width='2.3' stroke-linecap='round' stroke-linejoin='round'/></svg>");
}
input[type="checkbox"]:indeterminate, .checkbox:indeterminate {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'><rect x='3' y='7' width='10' height='2' rx='1' fill='%230d0d10'/></svg>");
}
input[type="checkbox"]:focus-visible, .checkbox:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
input[type="checkbox"]:disabled, .checkbox:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- RADIO GROUP -------------------------------------------------- */
.radio-group { display: flex; flex-direction: column; gap: 9px; }
.radio {
  display: inline-flex; align-items: center; gap: 9px;
  font-size: 13px; color: var(--text-muted); cursor: pointer;
}
input[type="radio"], input[type="radio"].radio, .radio input[type="radio"] {
  appearance: none; -webkit-appearance: none;
  width: 16px; height: 16px; flex: none; margin: 0;
  border: 1px solid var(--border-strong); border-radius: 50%;
  background-color: var(--input); cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
input[type="radio"]:hover, .radio input[type="radio"]:hover { border-color: var(--brand); }
input[type="radio"]:checked, .radio input[type="radio"]:checked {
  border-color: var(--btn); background-color: var(--btn);
  box-shadow: inset 0 0 0 3.5px var(--background);
}
input[type="radio"]:focus-visible, .radio input[type="radio"]:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
input[type="radio"]:disabled, .radio input[type="radio"]:disabled { opacity: 0.45; cursor: not-allowed; }

/* --- SWITCH ------------------------------------------------------- */
.switch { position: relative; display: inline-flex; align-items: center; width: 40px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; }
.switch .switch-thumb {
  position: absolute; inset: 0; border-radius: var(--radius-full);
  background: var(--secondary); border: 1px solid var(--border);
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out);
}
.switch .switch-thumb::after {
  content: ""; position: absolute; top: 1px; left: 1px; width: 18px; height: 18px;
  border-radius: 50%; background: var(--foreground);
  transition: transform var(--duration-base) var(--ease-out);
}
.switch input:checked + .switch-thumb { background: var(--btn); border-color: var(--btn); }
.switch input:checked + .switch-thumb::after { transform: translateX(16px); background: var(--btn-foreground); }
.switch input:focus-visible + .switch-thumb { box-shadow: 0 0 0 3px var(--ring); }
.trust-toggle-slider { background: var(--secondary) !important; border-radius: var(--radius-full); }
.trust-toggle input:checked + .trust-toggle-slider { background: var(--brand) !important; }

/* --- SLIDER ------------------------------------------------------- */
input[type="range"], .slider {
  -webkit-appearance: none; appearance: none;
  width: 100%; height: 6px; padding: 0; border: none; box-shadow: none;
  border-radius: var(--radius-full);
  background: var(--secondary) !important;
  cursor: pointer;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--btn); border: 1px solid rgba(0, 0, 0, 0.4);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-fast) var(--ease-out);
}
input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.12); }
input[type="range"]::-moz-range-thumb {
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--btn); border: 1px solid rgba(0, 0, 0, 0.4);
}
input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--ring); }
input[type="range"]:disabled { opacity: 0.5; cursor: not-allowed; }

/* --- KBD ---------------------------------------------------------- */
.kbd, kbd {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 22px; padding: 0 6px;
  font-family: var(--mono); font-size: 11px; color: var(--text-muted);
  background: var(--secondary); border: 1px solid var(--border);
  border-bottom-width: 2px; border-radius: var(--radius-sm);
}

/* Dropzones */
.dropzone {
  border: 1.5px dashed var(--border-strong); border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.015);
  transition: border-color var(--duration-base) var(--ease-out), background-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.dropzone:hover, .dropzone.drag { border-color: var(--brand); background: var(--brand-soft); color: var(--brand-bright); }
.dropzone.drag { box-shadow: 0 0 0 4px var(--brand-soft); }
.dropzone-icon { border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--in-field); color: var(--brand); transition: border-color var(--duration-base) var(--ease-out), background-color var(--duration-base) var(--ease-out); }
.dropzone:hover .dropzone-icon, .dropzone.drag .dropzone-icon { border-color: var(--brand); background: var(--brand-soft); }
.thumb { border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--in-field); }
.thumb .t-ok { background: var(--primary); box-shadow: none; }

/* ==================================================================
   7. TABS — underline + segmented
   ================================================================== */
.tab-list {
  display: inline-flex; align-items: center; gap: 4px;
  border-bottom: 1px solid var(--border);
}
.tab-trigger, .tabs .tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 12px; border: none; background: transparent;
  color: var(--text-muted); font-size: 13px; font-weight: 600; cursor: pointer;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}
.tab-trigger:hover, .tabs .tab:hover { color: var(--text); background: rgba(255, 255, 255, 0.04); }
.tab-trigger[data-state="active"], .tab-trigger[aria-selected="true"], .tabs .tab.active {
  color: var(--text); box-shadow: inset 0 -2px 0 var(--brand);
}

/* Segmented / pill tabs */
.segmented {
  display: inline-flex; gap: 3px; padding: 3px;
  background: var(--secondary); border: 1px solid var(--border);
  border-radius: var(--radius-md);
}
.segmented > button, .segmented > .segmented-item {
  border: none; background: transparent; color: var(--text-muted);
  padding: 7px 14px; border-radius: var(--radius-sm); font-size: 12.5px; font-weight: 600; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.segmented > button:hover, .segmented > .segmented-item:hover { color: var(--text); }
.segmented > button[data-state="active"], .segmented > button.active, .segmented > .segmented-item.active {
  background: var(--card); color: var(--text); box-shadow: var(--shadow-xs);
}
/* App-native segmented classes */
.gb-tab, .modal-tab, .gb-tone, .settings-nav-item {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: transparent; color: var(--text-muted);
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.gb-tab:hover, .modal-tab:hover, .gb-tone:hover, .settings-nav-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.gb-tab.active, .modal-tab.active, .gb-tone.active, .settings-nav-item.active {
  background: var(--brand-soft); border-color: rgba(242, 96, 60, 0.28); color: var(--brand-bright);
}
.gb-opt {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015); color: var(--text-muted);
  transition: background-color var(--duration-base) var(--ease-out), border-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.gb-opt:hover { border-color: var(--border-strong); color: var(--text); }
.gb-opt.selected { background: var(--brand-soft); border-color: var(--brand); color: var(--brand-bright); }

/* ==================================================================
   8. ACCORDION / COLLAPSIBLE
   ================================================================== */
.accordion { border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.accordion-item { border-bottom: 1px solid var(--border-soft); }
.accordion-item:last-child { border-bottom: none; }
.accordion-trigger {
  width: 100%; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; background: transparent; border: none; cursor: pointer;
  color: var(--text); font-size: 13.5px; font-weight: 600; text-align: left;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.accordion-trigger:hover { background: rgba(255, 255, 255, 0.03); }
.accordion-trigger::after {
  content: ""; width: 8px; height: 8px; flex: none;
  border-right: 2px solid var(--text-faint); border-bottom: 2px solid var(--text-faint);
  transform: rotate(45deg); transition: transform var(--duration-base) var(--ease-out);
}
.accordion-item[data-state="open"] .accordion-trigger::after, details[open] > summary::after { transform: rotate(-135deg); }
.accordion-content { padding: 0 16px 14px; color: var(--text-muted); font-size: 13px; line-height: 1.6; }
.accordion-content[data-state="open"], .accordion-item[data-state="open"] .accordion-content { animation: orty-rise var(--duration-base) var(--ease-out) both; }
details.collapsible > summary, summary.gb-manual-toggle, summary.wins-raw-toggle {
  cursor: pointer; list-style: none; color: var(--text-muted); font-size: 13px;
  display: flex; align-items: center; gap: 8px;
}
details.collapsible > summary::-webkit-details-marker, summary::-webkit-details-marker { display: none; }

/* ==================================================================
   9. ALERT (+ Alert Dialog uses Dialog)
   ================================================================== */
.alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: var(--card);
  color: var(--text-muted); font-size: 13px; line-height: 1.55;
}
.alert-icon { flex: none; color: var(--text-faint); margin-top: 1px; }
.alert-title { color: var(--text); font-weight: 650; font-size: 13.5px; margin-bottom: 3px; }
.alert.info { border-color: rgba(106, 166, 245, 0.35); background: var(--info-soft); }
.alert.info .alert-icon { color: var(--info); }
.alert.success { border-color: rgba(45, 212, 160, 0.35); background: var(--primary-soft); }
.alert.success .alert-icon { color: var(--primary); }
.alert.warning { border-color: rgba(242, 197, 69, 0.32); background: var(--amber-soft); }
.alert.warning .alert-icon { color: var(--amber); }
.alert.destructive { border-color: rgba(229, 72, 77, 0.4); background: var(--destructive-soft); }
.alert.destructive .alert-icon { color: var(--destructive); }

/* App banners map onto alerts */
.dedup-banner, .canspam-banner, .demo-banner, .wizard-banner, .error-banner, .success-banner, .settings-banner {
  border-radius: var(--radius-md); border: 1px solid var(--border);
}
.error-banner, .wizard-error { border-color: rgba(229, 72, 77, 0.4); background: var(--destructive-soft); color: #ffb4b4; }
.success-banner, .wizard-success { border-color: rgba(45, 212, 160, 0.4); background: var(--primary-soft); color: #9bffec; }

/* ==================================================================
   10. DIALOG / ALERT DIALOG / SHEET / DRAWER
   ================================================================== */
.dialog-overlay, .sheet-overlay, .drawer-overlay, .modal-overlay, .settings-backdrop {
  position: fixed; inset: 0; z-index: 90;
  background: rgba(6, 6, 8, 0.66);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.dialog, .dialog-content, .modal, .onboarding-modal, .settings-overlay {
  border-radius: var(--radius-xl);
  border: 1px solid var(--border);
  background: var(--popover);
  box-shadow: var(--shadow-lg);
}
.dialog-header { display: flex; flex-direction: column; gap: 4px; padding: 20px 20px 12px; border-bottom: 1px solid var(--border-soft); }
.dialog-title { font-size: 16px; font-weight: 650; letter-spacing: -0.01em; color: var(--text); }
.dialog-description { font-size: 12.5px; color: var(--text-muted); }
.dialog-body { padding: 18px 20px; }
.dialog-footer { display: flex; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; }
.dialog-close, .settings-modal-close {
  position: absolute; top: 12px; right: 12px; width: 32px; height: 32px;
  border-radius: var(--radius-md); border: 1px solid transparent; background: transparent;
  color: var(--text-faint); cursor: pointer; display: grid; place-items: center;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.dialog-close:hover, .settings-modal-close:hover { background: rgba(255, 255, 255, 0.07); color: var(--text); }
/* Entrance motion. NOTE: .settings-overlay is centered with
   transform: translate(-50%,-50%) — animating its transform would clobber
   that and push the panel off-centre, so it keeps its own transition and is
   deliberately NOT animated here. */
.dialog-overlay[data-state="open"] .dialog, .modal-overlay.show .modal {
  animation: orty-dialog-in var(--duration-slow) var(--ease-out) both;
}
.modal-header, .settings-modal-title { border-bottom: 1px solid var(--border-soft); }

/* Sheet (edge panel) + Drawer (bottom) */
.sheet { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 100%); z-index: 91;
  background: var(--popover); border-left: 1px solid var(--border); box-shadow: var(--shadow-lg);
  border-radius: 0; display: flex; flex-direction: column;
}
.sheet.left { right: auto; left: 0; border-left: none; border-right: 1px solid var(--border); }
.sheet[data-state="open"], .sheet.open { animation: orty-sheet-in var(--duration-slow) var(--ease-out) both; }
@keyframes orty-sheet-in { from { transform: translateX(12px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer { position: fixed; left: 0; right: 0; bottom: 0; z-index: 91; max-height: 88vh;
  background: var(--popover); border-top: 1px solid var(--border);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0; box-shadow: var(--shadow-lg);
}
.drawer[data-state="open"], .drawer.open { animation: orty-drawer-in var(--duration-slow) var(--ease-out) both; }
@keyframes orty-drawer-in { from { transform: translateY(14px); opacity: 0; } to { transform: none; opacity: 1; } }

/* ==================================================================
   11. DROPDOWN / CONTEXT MENU / MENUBAR
   ================================================================== */
.dropdown-menu, .context-menu, .menubar-menu, .popover, .acct-dropdown {
  min-width: 190px; padding: 5px;
  border-radius: var(--radius-lg); border: 1px solid var(--border);
  background: var(--popover); color: var(--text);
  box-shadow: var(--shadow-md); z-index: 80;
  animation: orty-menu-in var(--duration-base) var(--ease-out) both;
}
.dropdown-item, .menu-item, .acct-dd-item, .context-menu-item {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: var(--radius-sm);
  color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.dropdown-item:hover, .menu-item:hover, .acct-dd-item:hover, .context-menu-item:hover,
.dropdown-item[data-highlighted], .menu-item[data-highlighted] {
  background: rgba(255, 255, 255, 0.06); color: var(--text);
}
.dropdown-item.destructive { color: var(--destructive); }
.dropdown-label, .menu-label { padding: 6px 9px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.dropdown-separator, .menu-separator, .separator { height: 1px; background: var(--border); margin: 5px 0; }
.menubar { display: inline-flex; align-items: center; gap: 2px; padding: 4px; border-radius: var(--radius-md); border: 1px solid var(--border); background: var(--card); }
.menubar-trigger { padding: 6px 10px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted); cursor: pointer; border: none; background: transparent; }
.menubar-trigger:hover, .menubar-trigger[data-state="open"] { background: rgba(255, 255, 255, 0.06); color: var(--text); }

/* ==================================================================
   12. POPOVER / HOVER CARD / TOOLTIP
   ================================================================== */
.popover { padding: 14px; min-width: 240px; }
.hover-card { width: 300px; padding: 16px; border-radius: var(--radius-lg); border: 1px solid var(--border); background: var(--popover); box-shadow: var(--shadow-md); animation: orty-menu-in var(--duration-base) var(--ease-out) both; }
.tooltip {
  position: relative; display: inline-flex;
}
.tooltip-content, .tooltip[data-tooltip]::after {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%) translateY(3px);
  padding: 5px 9px; border-radius: var(--radius-sm);
  background: var(--elevated); color: var(--text);
  border: 1px solid var(--border); box-shadow: var(--shadow-md);
  font-size: 11.5px; white-space: nowrap; pointer-events: none;
  opacity: 0; transition: opacity var(--duration-fast) var(--ease-out), transform var(--duration-fast) var(--ease-out);
  z-index: 100;
}
.tooltip[data-tooltip]::after { content: attr(data-tooltip); }
.tooltip:hover .tooltip-content, .tooltip[data-tooltip]:hover::after,
.tooltip:focus-within .tooltip-content, .tooltip[data-tooltip]:focus-within::after {
  opacity: 1; transform: translateX(-50%) translateY(0);
}

/* ==================================================================
   13. AVATAR
   ================================================================== */
.avatar { position: relative; display: inline-flex; width: 36px; height: 36px; flex: none; border-radius: 50%; overflow: hidden; }
.avatar.sm { width: 26px; height: 26px; }
.avatar.lg { width: 52px; height: 52px; }
.avatar .avatar-image { width: 100%; height: 100%; object-fit: cover; }
.avatar .avatar-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  background: var(--secondary); color: var(--text); font-size: 12.5px; font-weight: 650;
}
.acct-avatar, .acct-hero-avatar {
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
}

/* ==================================================================
   14. BREADCRUMB / PAGINATION / NAVIGATION MENU
   ================================================================== */
.breadcrumb { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; font-size: 12.5px; color: var(--text-muted); }
.breadcrumb a { color: var(--text-muted); text-decoration: none; transition: color var(--duration-fast) var(--ease-out); }
.breadcrumb a:hover { color: var(--text); }
.breadcrumb-separator { color: var(--text-faint); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

.pagination { display: flex; align-items: center; gap: 4px; }
.pagination a, .pagination button, .pagination .pagination-item {
  min-width: 32px; height: 32px; padding: 0 9px; display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--radius-sm); border: 1px solid transparent; background: transparent;
  color: var(--text-muted); font-size: 12.5px; cursor: pointer; text-decoration: none;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}
.pagination a:hover, .pagination button:hover, .pagination .pagination-item:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.pagination .active, .pagination [aria-current="page"] { background: var(--secondary); border-color: var(--border); color: var(--text); }

.navigation-menu { display: flex; align-items: center; gap: 4px; }
.navigation-menu-item { padding: 7px 11px; border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; text-decoration: none; transition: color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out); }
.navigation-menu-item:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }

/* ==================================================================
   15. PROGRESS / SPINNER / SKELETON
   ================================================================== */
.progress { height: 8px; width: 100%; background: rgba(255, 255, 255, 0.09); border-radius: var(--radius-full); overflow: hidden; }
.progress > .progress-indicator, .progress-fill {
  height: 100%; background: var(--btn); border-radius: var(--radius-full);
  transition: width var(--duration-slow) var(--ease-out);
}
.progress.brand > .progress-indicator, .progress.brand .progress-fill { background: var(--brand); }
.progress.success > .progress-indicator, .progress.success .progress-fill { background: var(--primary); }

.goals-total-bar, .goal-bar, .usage-bar, .sb-quota-bar, .ctx-loading-bar, .gb-progress-track, .gb-strength-bar, .lf-progress {
  background: rgba(255, 255, 255, 0.09); border-radius: var(--radius-full); overflow: hidden;
}
.goals-total-fill, .goal-fill, .usage-fill, .sb-quota-fill, .ctx-loading-fill, .gb-progress-fill {
  background: var(--brand); border-radius: var(--radius-full); transition: width var(--duration-slow) var(--ease-out);
}
.gb-strength-fill { background: var(--primary); border-radius: var(--radius-full); }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid rgba(255, 255, 255, 0.14); border-top-color: var(--brand); animation: orty-spin 0.7s linear infinite; }
.spinner.lg { width: 24px; height: 24px; border-width: 3px; }

.skeleton {
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05) 25%, rgba(255, 255, 255, 0.1) 37%, rgba(255, 255, 255, 0.05) 63%);
  background-size: 200% 100%;
  animation: orty-shimmer 1.4s ease-in-out infinite;
  border-radius: var(--radius-sm);
  color: transparent;
}
.skeleton-text { height: 12px; margin: 6px 0; }
.skeleton-circle { border-radius: 50%; }

/* ==================================================================
   16. TOGGLE / TOGGLE GROUP
   ================================================================== */
.toggle {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  min-height: 36px; padding: 0 12px; border-radius: var(--radius-md);
  border: 1px solid var(--border); background: transparent; color: var(--text-muted);
  font-size: 13px; font-weight: 600; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.toggle:hover { background: rgba(255, 255, 255, 0.05); color: var(--text); }
.toggle[data-state="on"], .toggle.on, .toggle[aria-pressed="true"] {
  background: var(--secondary); border-color: var(--border-strong); color: var(--text);
}
.toggle.outline { background: transparent; }
.toggle-group { display: inline-flex; gap: 3px; padding: 3px; background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-md); }
.toggle-group > .toggle { border: none; background: transparent; min-height: 30px; }
.toggle-group > .toggle[data-state="on"], .toggle-group > .toggle.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-xs); }

/* ==================================================================
   17. TABLE / DATA TABLE
   ================================================================== */
.table, table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.table thead th, th {
  color: var(--text-faint); font-weight: 600; text-transform: uppercase; letter-spacing: 0.02em;
  font-size: 10.5px; text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--border);
}
.table tbody td, td { padding: 11px 12px; border-bottom: 1px solid var(--border-soft); color: var(--text); vertical-align: middle; }
.table tbody tr, tbody tr { transition: background-color var(--duration-fast) var(--ease-out); }
.table tbody tr:hover, tbody tr:hover { background: rgba(255, 255, 255, 0.03); }
.table .table-caption, .table-caption { caption-side: bottom; padding: 10px; font-size: 12px; color: var(--text-faint); }

/* ==================================================================
   18. COMMAND / COMBOBOX
   ================================================================== */
.command {
  display: flex; flex-direction: column; width: 100%; max-width: 520px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--popover); box-shadow: var(--shadow-lg); overflow: hidden;
}
.command-input {
  border: none !important; border-bottom: 1px solid var(--border-soft) !important;
  border-radius: 0 !important; box-shadow: none !important; background: transparent !important;
  height: 44px; padding: 0 16px; font-size: 13.5px;
}
.command-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.command-empty { padding: 24px; text-align: center; color: var(--text-faint); font-size: 13px; }
.command-group-label { padding: 7px 9px 4px; font-size: 11px; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); }
.command-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 10px;
  border-radius: var(--radius-sm); color: var(--text-muted); font-size: 13px; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.command-item:hover, .command-item[data-selected="true"] { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.combobox { position: relative; }
.combobox-dropdown {
  position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 80;
  max-height: 280px; overflow-y: auto; padding: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--popover); box-shadow: var(--shadow-md);
  animation: orty-menu-in var(--duration-base) var(--ease-out) both;
}

/* ==================================================================
   19. EMPTY / ITEM / MARKER / BUBBLE / MESSAGE
   ================================================================== */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 40px 24px; text-align: center;
  border: 1px dashed var(--border); border-radius: var(--radius-lg);
  color: var(--text-muted);
}
.empty-icon { color: var(--text-faint); }
.empty-title { color: var(--text); font-weight: 650; font-size: 15px; }
.empty-description { color: var(--text-muted); font-size: 13px; max-width: 420px; }
.empty-state { border: 1px dashed var(--border); border-radius: var(--radius-lg); background: rgba(255, 255, 255, 0.012); }
.empty-state .empty-icon { color: var(--text-faint); }
.empty-state .empty-headline { color: var(--text); }
.empty-state .empty-desc { color: var(--text-muted); }
.empty-state .empty-cta { border-radius: var(--radius-md); }

.item { display: flex; align-items: center; gap: 12px; padding: 12px; border-radius: var(--radius-md); border: 1px solid transparent; transition: background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out); }
.item:hover { background: rgba(255, 255, 255, 0.03); border-color: var(--border-soft); }
.item-media { flex: none; }
.item-content { flex: 1; min-width: 0; }
.item-title { color: var(--text); font-weight: 600; font-size: 13.5px; }
.item-description { color: var(--text-muted); font-size: 12.5px; }
.item-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.marker { display: inline-flex; align-items: center; gap: 6px; font-size: 11.5px; color: var(--text-faint); }
.marker-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand); }

.bubble {
  max-width: 85%; padding: 10px 13px; border-radius: 14px;
  font-size: 13px; line-height: 1.5; border: 1px solid var(--border);
  background: var(--card-2); color: var(--text);
}
.bubble.mine { background: var(--secondary); margin-left: auto; border-bottom-right-radius: 4px; }
.bubble.their { border-bottom-left-radius: 4px; }
.message { display: flex; gap: 10px; margin: 10px 0; }
.message-content { max-width: 85%; }

/* ==================================================================
   20. CALENDAR / DATE PICKER
   ================================================================== */
.calendar, .date-picker {
  width: max-content; padding: 12px;
  border: 1px solid var(--border); border-radius: var(--radius-lg);
  background: var(--card); box-shadow: var(--shadow-md);
}
.calendar-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.calendar-caption { font-size: 13px; font-weight: 650; color: var(--text); }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 32px); gap: 2px; }
.calendar-cell {
  width: 32px; height: 32px; display: grid; place-items: center;
  border-radius: var(--radius-sm); border: none; background: transparent;
  color: var(--text-muted); font-size: 12.5px; cursor: pointer;
  transition: background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
}
.calendar-cell:hover { background: rgba(255, 255, 255, 0.06); color: var(--text); }
.calendar-cell.weekday { color: var(--text-faint); font-size: 11px; cursor: default; }
.calendar-cell.today { border: 1px solid var(--border-strong); }
.calendar-cell.selected, .calendar-cell[aria-selected="true"] { background: var(--brand); color: #180a05; font-weight: 650; }
.calendar-cell.outside { color: var(--text-faint); opacity: 0.5; }

/* ==================================================================
   21. CAROUSEL / RESIZABLE / SCROLL AREA / ASPECT RATIO
   ================================================================== */
.carousel { position: relative; overflow: hidden; }
.carousel-track { display: flex; transition: transform var(--duration-slow) var(--ease-out); }
.carousel-item { flex: 0 0 100%; min-width: 0; }
.carousel-button {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--popover); color: var(--text);
  display: grid; place-items: center; cursor: pointer; box-shadow: var(--shadow-md);
}
.carousel-button.prev { left: 10px; }
.carousel-button.next { right: 10px; }

.resizable { display: flex; gap: 8px; }
.resizable-panel { flex: 1; min-width: 0; }
.resizable-handle {
  flex: none; width: 8px; border-radius: var(--radius-full);
  background: var(--border); cursor: col-resize; position: relative;
  transition: background-color var(--duration-fast) var(--ease-out);
}
.resizable-handle::after { content: ""; position: absolute; inset: 0 2px; background: var(--border-strong); border-radius: var(--radius-full); }
.resizable-handle:hover, .resizable-handle[data-state="drag"] { background: var(--brand); }

.scroll-area { position: relative; overflow: hidden; }
.scroll-area-viewport { overflow-y: auto; max-height: 100%; }

.aspect-square { aspect-ratio: 1 / 1; }
.aspect-video { aspect-ratio: 16 / 9; }
.aspect-portrait { aspect-ratio: 3 / 4; }

/* ==================================================================
   22. TYPOGRAPHY (prose)
   ================================================================== */
.typography, .prose { color: var(--text-muted); font-size: 14px; line-height: 1.7; max-width: 68ch; }
.typography h1, .prose h1 { font-size: 30px; font-weight: 700; letter-spacing: -0.03em; color: var(--text); margin: 0 0 14px; }
.typography h2, .prose h2 { font-size: 22px; font-weight: 650; letter-spacing: -0.02em; color: var(--text); margin: 28px 0 10px; }
.typography h3, .prose h3 { font-size: 17px; font-weight: 650; color: var(--text); margin: 22px 0 8px; }
.typography p, .prose p { margin: 0 0 14px; }
.typography a, .prose a { color: var(--brand-bright); text-decoration: none; }
.typography a:hover, .prose a:hover { text-decoration: underline; }
.typography ul, .prose ul, .typography ol, .prose ol { padding-left: 22px; margin: 0 0 14px; }
.typography li, .prose li { margin: 4px 0; }
.typography code, .prose code { font-family: var(--mono); font-size: 0.9em; padding: 2px 5px; border-radius: 5px; background: var(--secondary); color: var(--text); }
.typography blockquote, .prose blockquote { border-left: 3px solid var(--brand); padding-left: 14px; color: var(--text-muted); font-style: italic; margin: 0 0 14px; }
.typography table, .prose table { width: 100%; font-size: 13px; margin: 0 0 16px; }
.typography hr, .prose hr { border: none; border-top: 1px solid var(--border); margin: 24px 0; }
.typography strong, .prose strong { color: var(--text); }

/* ==================================================================
   23. TOAST / SONNER
   ================================================================== */
.toast {
  border-radius: var(--radius-md); border: 1px solid var(--border);
  background: var(--popover); color: var(--text); box-shadow: var(--shadow-md);
  border-left: 3px solid var(--text-faint);
  /* No transform animation: the app slides toasts with translateX(120%),
     and an animation on transform would clobber that. */
}
.toast.error { border-left-color: var(--destructive); }
.toast.info { border-left-color: var(--info); }
.toast.success { border-left-color: var(--primary); }
.sonner { position: fixed; bottom: 18px; right: 18px; z-index: 200; display: flex; flex-direction: column; gap: 10px; width: min(380px, calc(100vw - 32px)); }
.sonner .toast { display: flex; flex-direction: column; gap: 3px; padding: 13px 15px; }
.sonner .toast-title { font-size: 13.5px; font-weight: 650; color: var(--text); }
.sonner .toast-description { font-size: 12.5px; color: var(--text-muted); }

/* ==================================================================
   24. PROGRESS — questionnaire
   ================================================================== */
.questionnaire { display: flex; flex-direction: column; gap: 18px; }
.questionnaire-step { display: flex; flex-direction: column; gap: 10px; }
.questionnaire-question { font-size: 14px; font-weight: 600; color: var(--text); }
.questionnaire-options { display: flex; flex-wrap: wrap; gap: 8px; }

/* ==================================================================
   25. APP COMPONENT PRIMITIVES (panels, score card, etc.)
   ================================================================== */
.panel, .score-card, .reason-card, .outreach-card, .email-card, .email-box, .opp-card,
.dash-stat-card, .goal-card, .healing-stat-card, .healing-incident, .healing-triage-card,
.short-card, .portfolio-card, .billing-card, .acct-stat, .db-section, .fb-card,
.scoring-accuracy, .gb-section, .gb-result, .gb-review, .gb-loading, .question-block,
.lf-report-card, .wizard-card, .setup-card, .banner, .tab-lock-wrap {
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
  transition: border-color var(--duration-base) var(--ease-out), box-shadow var(--duration-base) var(--ease-out), background-color var(--duration-base) var(--ease-out), transform var(--duration-base) var(--ease-out);
}
.panel { box-shadow: var(--shadow-xs); }
.panel--subtle { background: var(--card-2); box-shadow: none; }
.panel-title, .ph-title { color: var(--text); letter-spacing: -0.01em; }
.panel-desc, .ph-help { color: var(--text-muted); }
.score-card { box-shadow: var(--shadow-sm); }
.reason-card, .outreach-card, .opp-card { background: var(--card-2); box-shadow: none; }
.portfolio-card:hover, .goal-card:hover, .dash-stat-card:hover, .acct-stat:hover, .healing-stat-card:hover {
  border-color: var(--border-strong); transform: translateY(-1px); box-shadow: var(--shadow-md);
}

/* ==================================================================
   26. SIDEBAR — deliberately minimal: same structure, subtle polish
   ================================================================== */
.sb-tab {
  border-radius: var(--radius-md);
  transition: background-color var(--duration-base) var(--ease-out), color var(--duration-base) var(--ease-out);
}
.sb-tab:hover { background: rgba(255, 255, 255, 0.05); }
.sb-tab.active { background: rgba(255, 255, 255, 0.06); }
.sb-tab.active .sb-ico { color: var(--brand); }
.sb-rail-btn { border-radius: var(--radius-md); transition: background-color var(--duration-base) var(--ease-out); }
.sb-rail-btn:hover { background: rgba(255, 255, 255, 0.05); }
.sidebar { border: 1px solid var(--border); }

/* Sidebar wordmark: Orty plane mark + word, subtly enhanced (no redesign). */
.sb-logo { gap: 9px; }
.sb-logo .sb-mark { flex: none; display: block; }

/* Topbar gets the same subtle chrome as the rest of the shell. */
.topnav, .topbar {
  border: 1px solid var(--border);
  background: var(--glass);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--shadow-xs);
}

/* ==================================================================
   26b. TODAY — v2.1.1 command center
   ================================================================== */
.today-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.today-strip { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
.today-stat { border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--card-2); padding: 12px 14px; }
.today-stat-value { font-size: 20px; font-weight: 700; letter-spacing: -0.02em; color: var(--text); font-variant-numeric: tabular-nums; }
.today-stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-faint); margin-top: 2px; }
.today-goalbar { margin: 4px 0 18px; font-size: 12.5px; color: var(--text-muted); }
.today-goalbar .progress { margin-top: 6px; }
.today-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.today-section { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--card-2); padding: 14px; }
.today-section-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.today-section-title { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-muted); }
.today-section-count { font-size: 11px; font-weight: 700; color: var(--text-faint); background: rgba(255, 255, 255, 0.05); border: 1px solid var(--border); border-radius: var(--radius-full); padding: 1px 8px; }
.today-section-hint { font-size: 11.5px; color: var(--text-faint); margin: 3px 0 10px; }
.today-list { display: flex; flex-direction: column; gap: 8px; }
.today-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 1px solid var(--border-soft); border-radius: var(--radius-md); background: var(--card); transition: border-color var(--duration-fast) var(--ease-out); }
.today-item:hover { border-color: var(--border-strong); }
.today-opp { flex: none; width: 38px; height: 38px; display: grid; place-items: center; border-radius: var(--radius-sm); font-weight: 800; font-size: 13px; font-variant-numeric: tabular-nums; background: var(--primary-soft); color: var(--primary); border: 1px solid rgba(45, 212, 160, 0.3); }
.today-opp.empty { background: rgba(255, 255, 255, 0.04); color: var(--text-faint); border-color: var(--border); }
.today-item-body { min-width: 0; }
.today-name { font-size: 13px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-why { font-size: 11.5px; color: var(--text-faint); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today-empty { font-size: 12px; color: var(--text-faint); padding: 10px 4px; }
.today-footer { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.today-footnote { font-size: 11.5px; color: var(--text-faint); margin-left: auto; }
@media (max-width: 980px) {
  .today-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .today-stat-value { font-size: 18px; }
  .today-footnote { margin-left: 0; }
}

/* ==================================================================
   27. REDUCED MOTION + MOBILE
   ================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
@media (max-width: 640px) {
  .btn, .btn-primary { height: 44px; }
  .btn.small, .btn-small { height: 40px; }
  input, textarea, select, .input, .textarea, .native-select { font-size: 16px; }
}
