/* Amara AI Solutions — shared design primitives. Dark is the default. */
:root {
  color-scheme: dark;
  --bg: #07070C; --card: #0F0F1A; --tile: #161628; --band: #0B0B14;
  --surface: var(--card); --surface-raised: var(--tile);
  --text: #F5F5FA; --muted: #A3A3BD; --line: #23233A;
  --accent: #8B7CFF; --on-accent: #0B0820; --glow: rgba(124,92,255,.22); --soft: var(--tile);
  --profit: #75E5AB; --loss: #FFA0AC; --cost: #5EE6F7; --warning: #F6D082;
  --go-bg: #103326; --test-bg: rgba(34,211,238,.14); --test-fg: #5EE6F7;
  --hold-bg: #362B16; --reject-bg: #3B1D29; --insufficient-bg: var(--tile);
  --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --type-xs: .75rem; --type-sm: .875rem; --type-base: 1rem; --type-lg: 1.25rem;
  --type-title: clamp(1.9rem, 4vw, 2.75rem);
  --space-1: .25rem; --space-2: .5rem; --space-3: .75rem; --space-4: 1rem;
  --space-6: 1.5rem; --space-8: 2rem; --space-12: 3rem;
  --radius-sm: 14px; --radius-md: 16px; --radius-lg: 24px;
  --shadow-color: rgba(0,0,0,.55);
  --shadow: 0 24px 80px var(--shadow-color); --shadow-popover: 0 32px 96px var(--shadow-color);
  --motion-fast: 140ms; --motion-normal: 220ms; --ease: cubic-bezier(.2,.8,.2,1);
}
:root[data-theme=light] {
  color-scheme: light;
  --bg: #F7F7FC; --card: #FFFFFF; --tile: #EFEEFB; --band: #F1F0FA;
  --text: #0E0E1A; --muted: #55556E; --line: #E1E0F0;
  --accent: #5B45E0; --on-accent: #FFFFFF; --glow: rgba(91,69,224,.12);
  --profit: #17633E; --loss: #AC263D; --cost: #0B6F82; --warning: #785500;
  --go-bg: #DDF5E8; --test-bg: #DDF6FB; --test-fg: #0B6F82;
  --hold-bg: #FFF0CC; --reject-bg: #FFE5EA;
  --shadow-color: rgba(30,20,90,.12);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: var(--type-base)/1.6 var(--font-body); }
button, input, select { font: inherit; }
a { color: var(--accent); text-underline-offset: 4px; overflow-wrap: anywhere; }
button, .button, a, summary { -webkit-tap-highlight-color: transparent; transition: background var(--motion-fast) var(--ease), border-color var(--motion-fast) var(--ease), box-shadow var(--motion-fast) var(--ease); }
button, .button, summary, nav a { min-height: 44px; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .6rem .9rem; color: var(--text); background: var(--surface); cursor: pointer; text-decoration: none; }
a:hover, button:hover, summary:hover { background: var(--surface-raised); border-color: var(--accent); }
a:active, button:active, summary:active { background: var(--soft); box-shadow: inset 0 0 0 1px var(--accent); }
button:disabled { opacity: .55; cursor: wait; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 4px; }
.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); font-weight: 700; }
.primary:hover, .primary:active { background: var(--accent); color: var(--on-accent); box-shadow: 0 0 0 3px var(--soft); }
input, select { width: 100%; min-width: 0; min-height: 48px; padding: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bg); color: var(--text); }
h1 { font-size: var(--type-title); line-height: 1.2; letter-spacing: -.035em; }
p, li, dd { overflow-wrap: anywhere; }
.panel, .hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.icon { width: 20px; height: 20px; flex: 0 0 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; vertical-align: middle; }
.brand { display: inline-flex; align-items: center; gap: var(--space-3); min-height: 44px; padding: var(--space-2); border-radius: var(--radius-md); text-decoration: none; color: var(--text); }
.brand img { width: 40px; height: 40px; flex: 0 0 40px; }
.brand-copy { display: flex; flex-direction: column; line-height: 1.25; letter-spacing: -.025em; font-weight: 700; }
.brand-copy small { color: var(--muted); font-size: .68rem; letter-spacing: .08em; text-transform: uppercase; margin-top: .3rem; font-weight: 500; }
.site-header { display: flex; align-items: center; gap: var(--space-6); padding: var(--space-4) max(1rem, calc((100vw - 1200px)/2)); background: var(--surface); border-bottom: 1px solid var(--line); }
.shell-controls { display: flex; align-items: center; gap: var(--space-6); flex: 1; min-width: 0; }
.primary-nav { display: flex; align-items: center; gap: var(--space-2); }
.primary-nav a, .account-menu a, .account-menu button { display: flex; align-items: center; gap: var(--space-2); }
.primary-nav a { border-color: transparent; font-size: var(--type-sm); white-space: nowrap; }
.primary-nav a[aria-current=page] { background: var(--soft); color: var(--accent); border-color: var(--line); }
.account-control { position: relative; margin-left: auto; }
.account-menu { position: absolute; right: 0; top: calc(100% + 12px); width: 288px; max-width: calc(100vw - 32px); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-popover); background: var(--surface); z-index: 20; }
.account-menu a, .account-menu button { width: 100%; text-align: left; margin-top: var(--space-2); }
.account-email { font-size: var(--type-sm); overflow-wrap: anywhere; margin: var(--space-2); }
.account-menu .chip { margin-left: var(--space-2); }
.mobile-toggle, .drawer-heading { display: none; }
.menu-trigger { display: inline-flex; align-items: center; gap: var(--space-2); }
#theme { justify-content: flex-start; }
.theme-value { margin-left: auto; color: var(--muted); font-size: var(--type-xs); }
[hidden] { display: none !important; }
.password-hint[data-met=true] { color: var(--profit); }
.password-error, #feedback[data-error=true], .error { color: var(--loss); }
@media(max-width: 768px) {
  .site-header { padding: var(--space-3) var(--space-4); gap: var(--space-2); flex-wrap: nowrap; }
  .brand { font-size: .8rem; gap: var(--space-2); padding-left: 0; min-width: 0; }
  .brand-copy { max-width: 220px; }
  .brand-copy small { font-size: .6rem; }
  .mobile-toggle { display: inline-flex; align-items: center; justify-content: center; margin-left: auto; min-width: 44px; }
  .shell-controls { display: none; }
  .shell-controls.is-open { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-6); position: fixed; inset: 0 0 0 auto; width: min(360px, 100%); padding: var(--space-6); background: var(--surface); box-shadow: -20px 0 80px #0009; z-index: 30; overflow-y: auto; }
  .drawer-heading { display: flex; align-items: center; justify-content: space-between; font-weight: 700; }
  .primary-nav { flex-direction: column; align-items: stretch; width: 100%; }
  .account-control { margin-left: 0; }
  .account-menu { position: static; width: 100%; max-width: none; margin-top: var(--space-3); box-shadow: none; }
  main { min-width: 0; }
  .filters > div { min-width: min(180px, 100%); }
  .actions > * { min-width: 0; }
}
@media(prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; } }

body.drawer-open { overflow: hidden; }
/* Navigation and action links are controls; prose links retain inline wrapping. */
nav a, .actions a, .account-menu a, .button { display: inline-flex; align-items: center; min-height: 44px; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: var(--radius-sm); text-decoration: none; }
a.brand { border-color: transparent; }

h1, h2, h3 { font-weight: 800; letter-spacing: -.035em; }
.metric, .inset { background: var(--tile); border-radius: var(--radius-md); }
.job { border-radius: var(--radius-lg); box-shadow: var(--shadow); }
.site-header > .theme-toggle { margin-left: auto; order: 2; }
.shell-controls { order: 1; }
.site-header > .mobile-toggle { order: 3; margin-left: 0; }
.theme-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; flex: 0 0 44px; padding: 0; }
.theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.theme-sun, [data-theme=light] .theme-moon { display: none; }
[data-theme=light] .theme-sun { display: block; }
/* Semantic badges use the same contrast-safe pairs throughout the workspace. */
.decision[data-decision=GO], [data-decision=GO] .chip { color: var(--profit); background: var(--go-bg); }
.decision[data-decision=TEST], [data-decision=TEST] .chip, .preview-verdict { color: var(--test-fg); background: var(--test-bg); }
.decision[data-decision=HOLD], [data-decision=HOLD] .chip { color: var(--warning); background: var(--hold-bg); }
.decision[data-decision=REJECT], [data-decision=REJECT] .chip { color: var(--loss); background: var(--reject-bg); }
.decision[data-decision=INSUFFICIENT_DATA], [data-decision=INSUFFICIENT_DATA] .chip { color: var(--muted); background: var(--insufficient-bg); }

/* Workspace controls share the Electric Indigo tile surface in either theme. */
input, select { background: var(--tile); border-color: var(--muted); }
.metric[data-measured=false] dd { color: var(--muted); font-size: 1rem; font-weight: 500; }

/* The beta label stays beside the brand in public and workspace headers. */
.beta-pill { flex: 0 0 auto; padding: .15rem .45rem; border: 1px solid var(--accent); border-radius: 999px; background: var(--tile); color: var(--accent); font-size: var(--type-xs); font-weight: 700; line-height: 1.4; letter-spacing: 0; }
.signup-legal { font-size: var(--type-sm); }
