/* MrOTP shared design language: ink surfaces, restrained indigo, cyan signal. */
:root {
  color-scheme: dark;
  --mrotp-page: #070710;
  --mrotp-surface: #0e0e1c;
  --mrotp-surface-raised: #15152a;
  --mrotp-surface-soft: #111120;
  --mrotp-border: rgba(203, 213, 225, .13);
  --mrotp-border-soft: rgba(203, 213, 225, .08);
  --mrotp-text: #eef2ff;
  --mrotp-text-strong: #f8fafc;
  --mrotp-muted: #9aa4bb;
  --mrotp-faint: #717c95;
  --mrotp-accent: #818cf8;
  --mrotp-accent-strong: #6366f1;
  --mrotp-cyan: #67e8f9;
  --mrotp-success: #34d399;
  --mrotp-warning: #fbbf24;
  --mrotp-danger: #fb7185;
  --mrotp-radius: 1rem;
  --mrotp-shadow: 0 18px 55px rgba(0, 0, 0, .28);
}

html { scroll-behavior: smooth; }
body.app-shell {
  min-height: 100vh;
  background: var(--mrotp-page);
  color: var(--mrotp-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app-shell ::selection { background: rgba(99, 102, 241, .38); color: #fff; }
.app-shell :focus-visible { outline: 2px solid var(--mrotp-cyan); outline-offset: 2px; }
.app-shell main { min-height: calc(100vh - 4rem); }

/* Shared public/product navigation */
.brand-header {
  color: var(--mrotp-text);
  border-bottom: 1px solid var(--mrotp-border-soft);
  background: rgba(7, 7, 16, .86);
  backdrop-filter: saturate(150%) blur(16px);
  -webkit-backdrop-filter: saturate(150%) blur(16px);
}
.brand-symbol {
  color: white;
  background: linear-gradient(145deg, #6366f1, #0891b2);
  box-shadow: 0 8px 24px rgba(99, 102, 241, .23), inset 0 1px rgba(255,255,255,.25);
}
.brand-mark { color: #f8fafc; text-decoration: none; }
.brand-mark:hover { color: #c7d2fe; }
.brand-nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  border: 1px solid transparent;
  border-radius: .7rem;
  padding: .5rem .72rem;
  color: #aab3c7;
  font-size: .84rem;
  font-weight: 550;
  text-decoration: none;
  transition: color .18s ease, background-color .18s ease, border-color .18s ease, transform .18s ease;
}
.brand-nav-link:hover { color: white; background: rgba(255,255,255,.055); }
.brand-nav-link:active { transform: translateY(1px); }
.brand-nav-link.active { color: #e0e7ff; background: rgba(99,102,241,.13); border-color: rgba(129,140,248,.2); }
.brand-account { color: #e2e8f0; background: rgba(255,255,255,.045); border: 1px solid var(--mrotp-border-soft); transition: background .18s ease, border-color .18s ease; }
.brand-account:hover, .brand-account[aria-expanded="true"] { background: rgba(255,255,255,.09); border-color: var(--mrotp-border); }
.brand-account:focus-visible, .brand-menu-toggle:focus-visible, .brand-cta:focus-visible { outline: 2px solid var(--mrotp-cyan); outline-offset: 3px; }
.brand-avatar { color: #eef2ff; background: linear-gradient(145deg, rgba(99,102,241,.5), rgba(8,145,178,.45)); border: 1px solid rgba(165,180,252,.22); }
.brand-balance { color: #dbeafe; background: rgba(34,211,238,.07); border: 1px solid rgba(103,232,249,.13); }
.brand-balance-label { color: #93a3bb; font-size: .7rem; }
.brand-dropdown { z-index: 70; color: var(--mrotp-text); background: #111120; border: 1px solid var(--mrotp-border); box-shadow: var(--mrotp-shadow); }
.brand-dropdown > div { border-color: var(--mrotp-border-soft); }
.brand-menu-item { color: #cbd5e1; text-decoration: none; transition: color .16s ease, background .16s ease; }
.brand-menu-item:hover { color: white; background: rgba(255,255,255,.055); }
.brand-menu-item.danger { color: #fda4af; }
.brand-menu-item.danger:hover { color: #fecdd3; background: rgba(244,63,94,.1); }
.brand-cta { color: white; text-decoration: none; background: linear-gradient(150deg, #6366f1, #4f46e5); box-shadow: 0 9px 24px rgba(79,70,229,.24), inset 0 1px rgba(255,255,255,.2); transition: transform .18s ease, filter .18s ease; }
.brand-cta:hover { color: white; filter: brightness(1.12); transform: translateY(-1px); }
.brand-menu-toggle { color: #cbd5e1; border: 1px solid var(--mrotp-border-soft); background: rgba(255,255,255,.04); }
.brand-menu-toggle:hover { color: white; background: rgba(255,255,255,.09); }
.brand-mobile-panel { background: rgba(10,10,20,.98); border-color: var(--mrotp-border-soft); }
.brand-mobile-account { color: var(--mrotp-text); background: rgba(255,255,255,.045); border: 1px solid var(--mrotp-border-soft); }
.brand-mobile-panel .brand-nav-link { width: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

/* Dark operational surfaces: preserve existing page layouts and controls. */
.app-shell .text-slate-950, .app-shell .text-slate-900 { color: #f1f5f9 !important; }
.app-shell .text-slate-800 { color: #e2e8f0 !important; }
.app-shell .text-slate-700 { color: #cbd5e1 !important; }
.app-shell .text-slate-600 { color: #aeb9cb !important; }
.app-shell .text-slate-500 { color: #96a2b7 !important; }
.app-shell .text-slate-400 { color: #8490a7 !important; }
.app-shell .bg-white { background-color: var(--mrotp-surface) !important; }
.app-shell .bg-slate-50 { background-color: #0b0b17 !important; }
.app-shell .bg-slate-100 { background-color: #171727 !important; }
.app-shell .bg-slate-200 { background-color: #222238 !important; }
.app-shell .border-slate-100 { border-color: rgba(203,213,225,.07) !important; }
.app-shell .border-slate-200 { border-color: var(--mrotp-border) !important; }
.app-shell .border-slate-300 { border-color: rgba(203,213,225,.22) !important; }
.app-shell .divide-slate-100 > :not([hidden]) ~ :not([hidden]), .app-shell .divide-slate-200 > :not([hidden]) ~ :not([hidden]) { border-color: var(--mrotp-border-soft) !important; }
.app-shell .hover\:bg-slate-50:hover { background-color: rgba(255,255,255,.035) !important; }
.app-shell .hover\:bg-slate-100:hover { background-color: rgba(255,255,255,.06) !important; }
.app-shell .hover\:text-slate-900:hover, .app-shell .hover\:text-slate-700:hover { color: white !important; }
.app-shell .card { background: linear-gradient(150deg, rgba(20,20,38,.98), rgba(13,13,25,.98)); border-color: var(--mrotp-border); box-shadow: 0 12px 34px rgba(0,0,0,.16); }
.app-shell .card-pad { padding: 1.35rem; }
.app-shell .table th { color: #9aa6bd; border-color: var(--mrotp-border); }
.app-shell .table td { color: #cbd5e1; border-color: var(--mrotp-border-soft); }
.app-shell .table tbody tr:hover { background: rgba(255,255,255,.035); }
.app-shell .input, .app-shell input.input, .app-shell select.input, .app-shell textarea.input {
  color: #eef2ff; background: #0b0b17; border-color: rgba(203,213,225,.2);
}
.app-shell .input::placeholder { color: #67738a; }
.app-shell .input:focus { border-color: #818cf8; box-shadow: 0 0 0 3px rgba(99,102,241,.2); }
.app-shell .input:disabled, .app-shell .input[readonly] { color: #8994a9; background: #111120; }
.app-shell .btn-secondary { color: #d5dbea; background: #151525; border-color: var(--mrotp-border); }
.app-shell .btn-secondary:hover { color: white; background: #202037; }
.app-shell .btn-primary { background: linear-gradient(150deg, #6366f1, #4f46e5); box-shadow: 0 8px 22px rgba(79,70,229,.17); }
.app-shell .badge-slate { color: #cbd5e1; background: #25253a; }
.app-shell .badge-indigo { color: #c7d2fe; background: rgba(99,102,241,.18); }
.app-shell .badge-green { color: #6ee7b7; background: rgba(16,185,129,.15); }
.app-shell .badge-amber { color: #fcd34d; background: rgba(245,158,11,.15); }
.app-shell .badge-red { color: #fda4af; background: rgba(244,63,94,.15); }
.app-shell .badge-slate, .app-shell .badge-indigo, .app-shell .badge-green, .app-shell .badge-amber, .app-shell .badge-red { border: 1px solid rgba(255,255,255,.055); }
.app-shell .nav-link { color: #aeb9cb; }
.app-shell .nav-link:hover { color: white; background: rgba(255,255,255,.06); }
.app-shell .nav-link-active { color: #e0e7ff; background: rgba(99,102,241,.16); }
.app-shell .toasts .toast { color: #e2e8f0; background: #171727; border-color: var(--mrotp-border); box-shadow: var(--mrotp-shadow); }
.app-shell .toast.border-l-emerald-500 { border-left-color: #34d399; }
.app-shell .toast.border-l-red-500 { border-left-color: #fb7185; }
.app-shell .toast.border-l-indigo-500 { border-left-color: #818cf8; }
.app-shell .modal::before { background: rgba(3,3,10,.78); }
.app-shell .modal-box { color: var(--mrotp-text); background: #111120; border-color: var(--mrotp-border); box-shadow: var(--mrotp-shadow); }
.app-shell .modal-head, .app-shell .modal-foot { border-color: var(--mrotp-border-soft); }
.app-shell .modal-foot { background: #151525; }
.app-shell .donut-hole { background: #111120; box-shadow: inset 0 0 0 1px rgba(203,213,225,.16); }
.app-shell .donut-hole b { color: #f8fafc; }
.app-shell .donut-hole small { color: #aeb9cb; }
.app-shell .bar-track { background: #25253a; }
.app-shell .bar-fill, .app-shell .day-bar { filter: saturate(.9); }
.app-shell code:not(pre code) { color: #c7d2fe; background: rgba(99,102,241,.12); }
.app-shell hr { border-color: var(--mrotp-border-soft); }

/* Auth surfaces and workspace overview: layered but calm, matched to public product pages. */
.eyebrow { color: #9da8c1; font-size: .68rem; font-weight: 700; letter-spacing: .17em; line-height: 1.4; }
.app-shell .auth-layout { position: relative; display: grid; max-width: 64rem; min-height: min(720px, calc(100dvh - 10rem)); grid-template-columns: minmax(0, 1fr) minmax(340px, .86fr); align-items: center; gap: clamp(2rem, 6vw, 5.5rem); margin: 0 auto; padding: 2.25rem 1rem 3rem; }
.app-shell .auth-layout::before { content: ""; position: absolute; z-index: -1; left: -8rem; top: 8%; width: 28rem; height: 28rem; border-radius: 50%; background: radial-gradient(circle, rgba(99,102,241,.13), transparent 68%); filter: blur(8px); pointer-events: none; }
.app-shell .auth-story { padding: 1.5rem 0; }
.app-shell .auth-flow { max-width: 26rem; }
.app-shell .auth-flow-step { display: flex; align-items: center; gap: .9rem; }
.app-shell .auth-flow-step > span { display: grid; width: 2.25rem; height: 2.25rem; flex: none; place-items: center; border: 1px solid rgba(129,140,248,.3); border-radius: .75rem; color: #c7d2fe; background: rgba(99,102,241,.1); font: 600 .72rem/1 ui-monospace, monospace; }
.app-shell .auth-flow-step strong, .app-shell .auth-benefits strong { display: block; color: #e2e8f0; font-size: .88rem; font-weight: 600; }
.app-shell .auth-flow-step small, .app-shell .auth-benefits small { display: block; margin-top: .18rem; color: #8e99b0; font-size: .78rem; line-height: 1.5; }
.app-shell .auth-flow-line { width: 1px; height: 1.15rem; margin: .18rem 0 .18rem 1.1rem; background: linear-gradient(#6366f1, rgba(99,102,241,.08)); }
.app-shell .auth-benefits { display: grid; gap: 1rem; }
.app-shell .auth-benefits > div { display: flex; align-items: flex-start; gap: .7rem; }
.app-shell .auth-check { display: grid; width: 1.35rem; height: 1.35rem; flex: none; place-items: center; border-radius: .45rem; color: #67e8f9; background: rgba(34,211,238,.1); font-size: .8rem; }
.app-shell .auth-panel { position: relative; padding: clamp(1.4rem, 4vw, 2.25rem); border: 1px solid rgba(203,213,225,.13); border-radius: 1.35rem; background: linear-gradient(145deg, rgba(20,20,39,.97), rgba(12,12,24,.98)); box-shadow: 0 24px 70px rgba(0,0,0,.3), inset 0 1px rgba(255,255,255,.035); }
.app-shell .auth-panel::before { content: ""; position: absolute; inset: 0 18% auto; height: 1px; background: linear-gradient(90deg, transparent, rgba(129,140,248,.65), transparent); }
.app-shell .auth-inline-link, .app-shell .auth-doc-link { color: #a5b4fc; font-weight: 600; text-decoration: none; transition: color .18s ease; }
.app-shell .auth-inline-link:hover, .app-shell .auth-doc-link:hover { color: #67e8f9; }
.app-shell .home-hero { border: 1px solid rgba(129,140,248,.19); background: linear-gradient(115deg, #121225 0%, #111120 58%, #0d1821 100%); box-shadow: 0 22px 60px rgba(0,0,0,.18); }
.app-shell .home-hero-glow { position: absolute; right: -6rem; top: -11rem; width: 28rem; height: 28rem; border-radius: 50%; background: radial-gradient(circle, rgba(34,211,238,.12), rgba(99,102,241,.11) 32%, transparent 70%); filter: blur(5px); }
.app-shell .balance-feature { border: 1px solid rgba(203,213,225,.12); background: linear-gradient(155deg, rgba(255,255,255,.065), rgba(255,255,255,.025)); box-shadow: inset 0 1px rgba(255,255,255,.04); }
.app-shell .balance-signal { display: grid; width: 2.25rem; height: 2.25rem; place-items: center; border: 1px solid rgba(52,211,153,.2); border-radius: .8rem; background: rgba(16,185,129,.09); }
.app-shell .balance-signal span { width: .52rem; height: .52rem; border-radius: 50%; background: #34d399; box-shadow: 0 0 14px rgba(52,211,153,.8); }
.app-shell .balance-link { color: #a5b4fc; font-size: .76rem; font-weight: 600; text-decoration: none; }
.app-shell .balance-link:hover { color: #67e8f9; }
.app-shell .workspace-links { display: grid; }
.app-shell .workspace-link { display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .75rem; min-height: 5.2rem; padding: 1rem; border: 1px solid var(--mrotp-border-soft); border-radius: 1rem; color: inherit; text-decoration: none; background: linear-gradient(145deg, rgba(20,20,38,.92), rgba(13,13,25,.92)); transition: transform .2s ease, border-color .2s ease, background .2s ease; }
.app-shell .workspace-link:hover { transform: translateY(-2px); border-color: rgba(129,140,248,.36); background: linear-gradient(145deg, rgba(29,29,54,.96), rgba(15,18,31,.96)); }
.app-shell .workspace-link-index { color: #7d89a1; font: 600 .68rem/1 ui-monospace, monospace; }
.app-shell .workspace-link strong { display: block; color: #e8edfa; font-size: .88rem; font-weight: 600; }
.app-shell .workspace-link small { display: block; margin-top: .25rem; color: #8d99b0; font-size: .73rem; line-height: 1.4; }
.app-shell .workspace-link-arrow { color: #8b95ac; font-size: 1rem; transition: color .2s ease, transform .2s ease; }
.app-shell .workspace-link:hover .workspace-link-arrow { color: #a5b4fc; transform: translate(2px, -2px); }

/* Responsive table treatment remains scrollable instead of crushing columns. */
@media (max-width: 767px) {
  .app-shell .auth-layout { min-height: auto; grid-template-columns: 1fr; gap: 1.5rem; padding: 1.5rem .25rem 2.5rem; }
  .app-shell .auth-story { padding: .5rem 0 0; }
  .app-shell .auth-story h1 { max-width: 38rem; font-size: clamp(2rem, 8vw, 3rem); }
  .app-shell .auth-flow, .app-shell .auth-benefits { display: none; }
}
@media (max-width: 640px) {
  .app-shell main { padding-top: 1.25rem; }
  .app-shell .card-pad { padding: 1rem; }
  .brand-header-row { height: 3.75rem; }
}
