:root {
  color-scheme: dark;
  --bg: #030201;
  --surface: rgba(18, 10, 5, .82);
  --surface-solid: #0d0805;
  --surface-raised: #17100b;
  --line: rgba(255, 139, 61, .13);
  --line-strong: rgba(255, 90, 10, .34);
  --text: #fff7f0;
  --muted: #a8998e;
  --accent: #ff5a0a;
  --accent-soft: rgba(255, 90, 10, .12);
  --blue: #ff9a24;
  --neon-orange: #ff5a0a;
  --hot-orange: #ff8a00;
  --ember: #ff2e00;
  --orange-soft: rgba(255, 90, 10, .105);
  --warning: #ffd166;
  --danger: #ff6d7a;
  --success: #ffb347;
  --radius: 4px;
  --radius-sm: 2px;
  --shadow: 0 24px 70px rgba(0, 0, 0, .28);
  --sidebar: 260px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); scroll-behavior: smooth; }
body { min-width: 320px; min-height: 100vh; margin: 0; color: var(--text); background: radial-gradient(circle at 86% -8%, rgba(255,90,10,.17) 0, transparent 31%), radial-gradient(circle at 38% 112%, rgba(255,46,0,.09), transparent 35%), linear-gradient(145deg, #030201, #080402 56%, #020101); overflow-x: hidden; }
body::after { position: fixed; z-index: -1; inset: 0; background: linear-gradient(108deg, transparent 0 57%, rgba(255,90,10,.025) 58%, transparent 59%), repeating-linear-gradient(0deg, transparent 0 5px, rgba(255,126,40,.013) 6px); content: ""; pointer-events: none; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.ambient { position: fixed; z-index: -1; width: 420px; height: 420px; border-radius: 50%; filter: blur(110px); opacity: .14; pointer-events: none; animation: ambient-drift 12s ease-in-out infinite alternate; }
.ambient--one { top: -240px; right: 5%; background: var(--neon-orange); }
.ambient--two { bottom: -320px; left: 25%; background: var(--hot-orange); animation-delay: -4s; }
.ambient--three { top: 38%; right: -330px; background: var(--ember); animation-delay: -8s; }
.motion-grid { position: fixed; z-index: -2; inset: 0; opacity: .22; pointer-events: none; background-image: linear-gradient(rgba(255,90,10,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,90,10,.06) 1px, transparent 1px); background-size: 48px 48px; mask-image: radial-gradient(circle at 75% 22%, black, transparent 68%); animation: grid-drift 20s linear infinite; }

.app-shell { display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; display: flex; flex-direction: column; height: 100vh; padding: 24px 16px; border-right: 1px solid rgba(255,90,10,.16); background: rgba(3, 2, 1, .9); box-shadow: 18px 0 55px rgba(0,0,0,.34), inset -1px 0 rgba(255,90,10,.035); backdrop-filter: blur(22px); }
.brand { display: flex; align-items: center; gap: 12px; padding: 0 10px 26px; }
.brand__mark { display: grid; place-items: center; width: 68px; height: 68px; overflow: hidden; border: 1px solid rgba(255,90,10,.28); border-radius: 16px; color: #140600; box-shadow: 0 0 34px rgba(255,90,10,.25), 0 0 0 4px rgba(255,90,10,.035); font-weight: 900; }
.brand__mark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: .08em; }
.brand small { margin-top: 2px; color: var(--muted); font-size: 10px; letter-spacing: .18em; }

.nav { display: flex; flex: 1; flex-direction: column; gap: 3px; overflow-y: auto; overflow-x: hidden; }
.nav__label { margin: 20px 12px 7px; color: #7c6c61; font-size: 10px; font-weight: 800; letter-spacing: .18em; text-transform: uppercase; }
.nav-group { margin-top: 5px; }
.nav-group > summary { position: relative; display: flex; align-items: center; justify-content: space-between; min-height: 31px; padding: 5px 12px; overflow: hidden; color: #7c6c61; font-size: 9px; font-weight: 850; letter-spacing: .18em; text-transform: uppercase; cursor: pointer; list-style: none; transition: color .2s ease, text-shadow .2s ease; }
.nav-group > summary::-webkit-details-marker { display: none; }
.nav-group > summary:hover { color: #ffd6bd; text-shadow: 0 0 14px rgba(255,90,10,.48); }
.nav-group > summary i { color: var(--neon-orange); font-size: 13px; font-style: normal; transition: transform .28s cubic-bezier(.2,.85,.2,1.25); }
.nav-group:not([open]) > summary i { transform: rotate(-90deg); }
.nav-group__items { display: grid; gap: 3px; max-height: 330px; overflow: hidden; opacity: 1; transform-origin: top; transition: max-height .34s cubic-bezier(.2,.8,.2,1), opacity .2s ease, transform .34s cubic-bezier(.2,.8,.2,1); }
.nav-group:not([open]) .nav-group__items { max-height: 0; opacity: 0; transform: translateY(-9px) scaleY(.94); }
.nav-group.is-opening .nav-group__items { animation: nav-slam .38s cubic-bezier(.16,.9,.28,1.28); }
.nav__item { position: relative; display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px; padding: 0 12px; overflow: hidden; border: 1px solid transparent; border-radius: 2px; color: #b5aaa2; background: transparent; font-size: 13px; font-weight: 650; text-align: left; cursor: pointer; transition: .18s ease; }
.nav__item > span { display: grid; place-items: center; width: 22px; color: #78887d; font-size: 18px; }
.nav__item:hover { color: var(--text); background: rgba(255,255,255,.035); }
.nav__item.is-active { color: #fff3e9; border-color: rgba(255,90,10,.34); background: linear-gradient(90deg, rgba(255,90,10,.2), rgba(255,138,0,.055)); box-shadow: inset 3px 0 0 var(--neon-orange), 0 0 28px rgba(255,90,10,.1); }
.nav__item.is-active > span { color: var(--neon-orange); text-shadow: 0 0 13px rgba(255,90,10,.82); }
.nav__item em { margin-left: auto; color: #5e6b62; font-size: 10px; font-style: normal; }
.nav__item--locked { opacity: .62; }
.sidebar__footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 18px 8px 0; border-top: 1px solid var(--line); }
.system-state { display: flex; align-items: center; gap: 9px; }
.system-state i { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 12px var(--success); }
.system-state strong, .system-state small { display: block; }
.system-state strong { font-size: 11px; }
.system-state small { margin-top: 2px; color: var(--muted); font-size: 10px; }

.main { min-width: 0; }
.topbar { position: sticky; z-index: 10; top: 0; display: flex; align-items: center; gap: 18px; min-height: 92px; padding: 18px clamp(20px, 4vw, 54px); border-bottom: 1px solid rgba(255,90,10,.17); background: rgba(3, 2, 1, .82); box-shadow: 0 12px 45px rgba(0,0,0,.3), 0 1px 24px rgba(255,90,10,.035); backdrop-filter: blur(24px); }
.topbar__title { min-width: 0; margin-right: auto; }
.topbar__title p, .eyebrow { margin: 0 0 5px; color: var(--accent); font-size: 10px; font-weight: 850; letter-spacing: .16em; text-transform: uppercase; }
.topbar__title h1 { margin: 0; font-size: clamp(21px, 3vw, 29px); line-height: 1; letter-spacing: -.035em; text-transform: uppercase; }
.topbar__actions { display: flex; align-items: center; gap: 10px; }
.content { position: relative; width: min(1500px, 100%); margin: 0 auto; padding: 34px clamp(20px, 4vw, 54px) 70px; }
.content.is-entering { animation: page-slam .48s cubic-bezier(.16,.9,.24,1.05); }
.content.is-entering::before { position: absolute; z-index: 5; top: 0; right: clamp(20px, 4vw, 54px); left: clamp(20px, 4vw, 54px); height: 2px; background: linear-gradient(90deg, transparent, var(--accent), var(--hot-orange), transparent); box-shadow: 0 0 14px rgba(255,90,10,.7); content: ""; transform-origin: left; animation: page-scan .64s cubic-bezier(.16,.9,.24,1); pointer-events: none; }
.assistant-quip { position: relative; display: grid; grid-template-columns: auto minmax(0,1fr) auto; align-items: center; gap: 13px; width: min(1500px, calc(100% - clamp(40px, 8vw, 108px))); margin: 15px auto -10px; padding: 11px 12px 11px 15px; overflow: hidden; border: 1px solid rgba(255,90,10,.28); border-radius: 2px; color: #ffe8d8; background: linear-gradient(100deg, rgba(255,90,10,.12), rgba(15,8,4,.84) 42%, rgba(255,46,0,.075)); box-shadow: 0 0 36px rgba(255,90,10,.075), inset 3px 0 var(--accent); }
.assistant-quip::before { position: absolute; inset: 0; background: linear-gradient(100deg, transparent 15%, rgba(255,255,255,.09), transparent 44%); content: ""; transform: translateX(-120%); animation: quip-scan 7s ease-in-out infinite; pointer-events: none; }
.assistant-quip__badge { color: var(--neon-orange); font-size: 9px; font-weight: 900; letter-spacing: .12em; white-space: nowrap; text-shadow: 0 0 12px rgba(255,90,10,.78); }
.assistant-quip strong { min-width: 0; overflow: hidden; font-size: 11px; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.assistant-quip button { position: relative; display: grid; place-items: center; width: 30px; height: 30px; overflow: hidden; border: 1px solid rgba(255,90,10,.28); border-radius: 9px; color: var(--neon-orange); background: rgba(255,90,10,.09); cursor: pointer; transition: transform .2s ease, background .2s ease; }
.assistant-quip button:hover { transform: rotate(18deg) scale(1.06); background: rgba(255,90,10,.18); }
.assistant-quip.is-changing strong { animation: quip-hit .42s cubic-bezier(.2,.9,.2,1.2); }
.menu-button { display: none !important; }

.button, .icon-button, .search-trigger { position: relative; overflow: hidden; isolation: isolate; border: 0; cursor: pointer; transition: transform .16s ease, border-color .16s ease, background .16s ease, box-shadow .16s ease; }
.button:active, .icon-button:active, .search-trigger:active { transform: translateY(1px); }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 42px; padding: 0 16px; border-radius: 2px; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.button--primary { color: #170600; background: linear-gradient(105deg, #ff3d00, var(--accent) 45%, var(--hot-orange)); box-shadow: 0 8px 26px rgba(255,90,10,.23), 0 0 0 1px rgba(255,255,255,.12) inset; }
.button--primary:hover { background: linear-gradient(105deg, #ff5a0a, #ff7a18 52%, #ffb000); box-shadow: 0 10px 38px rgba(255,90,10,.34); }
.button--ghost { color: var(--text); border: 1px solid var(--line); background: rgba(255,255,255,.035); }
.button--danger { color: var(--danger); border: 1px solid rgba(255,109,122,.25); background: rgba(255,109,122,.07); }
.button--small { min-height: 34px; padding: 0 11px; font-size: 11px; }
.icon-button { display: grid; place-items: center; width: 38px; height: 38px; padding: 0; border: 1px solid var(--line); border-radius: 2px; background: rgba(255,255,255,.035); font-size: 18px; }
.icon-button:hover { border-color: var(--line-strong); background: var(--accent-soft); }
.search-trigger { display: flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 10px 0 13px; border: 1px solid var(--line); border-radius: 2px; color: var(--muted); background: rgba(255,255,255,.025); font-size: 12px; }
.search-trigger span:first-child { font-size: 18px; }
kbd { padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; color: #8f7c70; background: #0e0804; font: 9px inherit; }

.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.section-heading h2 { margin: 0; font-size: clamp(21px, 3vw, 32px); letter-spacing: -.045em; }
.section-heading p { max-width: 680px; margin: 7px 0 0; color: var(--muted); font-size: 13px; line-height: 1.55; }
.section-heading__actions { display: flex; gap: 8px; }

.panel { position: relative; isolation: isolate; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(20,11,6,.9), rgba(6,4,3,.88)); box-shadow: var(--shadow), inset 0 1px rgba(255,255,255,.025); backdrop-filter: blur(18px); transition: border-color .22s ease, box-shadow .22s ease, transform .22s ease; }
.panel::before { position: absolute; z-index: -1; top: -1px; right: 18px; left: 18px; height: 1px; background: linear-gradient(90deg, transparent, rgba(255,90,10,.55), transparent); content: ""; opacity: .32; transition: opacity .22s ease, filter .22s ease; }
.panel:hover { border-color: rgba(255,90,10,.24); box-shadow: var(--shadow), 0 0 34px rgba(255,90,10,.07), inset 0 1px rgba(255,255,255,.035); }
.panel:hover::before { opacity: .9; filter: drop-shadow(0 0 7px rgba(255,90,10,.9)); }
.panel:not(.focus-card)::after { position: absolute; z-index: 2; top: -1px; right: -1px; width: 24px; height: 24px; border-top: 2px solid rgba(255,90,10,.7); border-right: 2px solid rgba(255,90,10,.7); content: ""; pointer-events: none; }
.empty-state { display: grid; place-items: center; min-height: 250px; padding: 34px; text-align: center; }
.empty-state__icon { display: grid; place-items: center; width: 55px; height: 55px; margin-bottom: 15px; border: 1px solid var(--line-strong); border-radius: 16px; color: var(--accent); background: var(--accent-soft); font-size: 24px; }
.empty-state h3 { margin: 0 0 7px; font-size: 18px; }
.empty-state p { max-width: 420px; margin: 0 0 19px; color: var(--muted); font-size: 12px; line-height: 1.55; }

.toast-region { position: fixed; z-index: 100; right: 20px; bottom: 20px; display: grid; gap: 8px; pointer-events: none; }
.toast { max-width: 340px; padding: 13px 16px; border: 1px solid var(--line-strong); border-radius: 12px; color: var(--text); background: #17100b; box-shadow: var(--shadow), 0 0 28px rgba(255,90,10,.1); font-size: 12px; animation: toast-in .25s ease; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
.motion-impact { position: absolute; z-index: -1; top: 50%; left: 50%; width: 18px; height: 18px; border: 2px solid rgba(255,90,10,.95); border-radius: 50%; box-shadow: 0 0 21px rgba(255,90,10,.85), inset 0 0 14px rgba(255,176,0,.5); pointer-events: none; transform: translate(-50%,-50%) scale(.2); animation: impact-burst .68s cubic-bezier(.1,.72,.18,1) forwards; }

@keyframes ambient-drift { to { transform: translate3d(35px,-28px,0) scale(1.12); opacity: .2; } }
@keyframes grid-drift { to { background-position: 48px 48px; } }
@keyframes page-slam { 0% { opacity: 0; filter: blur(9px); transform: translateY(20px) scale(.992); } 60% { opacity: 1; filter: blur(0); transform: translateY(-3px) scale(1.002); } 100% { transform: none; } }
@keyframes page-scan { 0% { opacity: 0; transform: scaleX(.04); } 48% { opacity: 1; } 100% { opacity: 0; transform: scaleX(1); } }
@keyframes nav-slam { 0% { opacity: 0; transform: translateX(-14px) scaleY(.88); } 70% { transform: translateX(3px) scaleY(1.02); } 100% { opacity: 1; transform: none; } }
@keyframes quip-hit { 0% { opacity: 0; transform: translateX(20px) skewX(-8deg); filter: blur(5px); } 65% { transform: translateX(-3px) skewX(1deg); filter: blur(0); } 100% { opacity: 1; transform: none; } }
@keyframes quip-scan { 0%, 62% { transform: translateX(-120%); } 78%, 100% { transform: translateX(150%); } }
@keyframes impact-burst { 65% { opacity: .65; } 100% { width: 190px; height: 190px; opacity: 0; transform: translate(-50%,-50%) scale(1); } }

.drawer-backdrop { position: fixed; z-index: 29; inset: 0; display: none; background: rgba(0,0,0,.55); backdrop-filter: blur(3px); }
.drawer-backdrop.is-visible { display: block; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
