:root {
  color-scheme: dark;
  --bg: #09090b;
  --bg-soft: #111114;
  --panel: rgba(25, 25, 29, 0.78);
  --panel-solid: #19191d;
  --panel-raised: #202025;
  --line: rgba(255, 255, 255, 0.085);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #f5f5f7;
  --muted: #98989f;
  --muted-2: #68686f;
  --blue: #8aa9ff;
  --blue-strong: #618cff;
  --blue-soft: rgba(105, 143, 255, 0.15);
  --green: #7ce3a5;
  --amber: #f7c66c;
  --red: #ff7e83;
  --radius-xl: 30px;
  --radius-lg: 22px;
  --radius-md: 16px;
  --shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
  --sidebar: 270px;
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text);
  background:
    radial-gradient(circle at 72% -10%, rgba(83, 104, 162, 0.22), transparent 32rem),
    radial-gradient(circle at 5% 100%, rgba(52, 74, 112, 0.12), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", Inter, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button, input, textarea, select { color: inherit; font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
::selection { color: #0a0a0b; background: #9ab5ff; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { border-radius: 20px; background: rgba(255,255,255,.13); }
::-webkit-scrollbar-track { background: transparent; }

.hidden { display: none !important; }
.glass {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(34,34,39,.82), rgba(17,17,20,.76));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.045), var(--shadow);
  backdrop-filter: blur(28px) saturate(125%);
  -webkit-backdrop-filter: blur(28px) saturate(125%);
}
.noise {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: .018;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.85'/%3E%3C/svg%3E");
}

.auth-screen { min-height: 100svh; display: grid; place-items: center; padding: 24px; position: relative; overflow: hidden; }
.auth-screen::before { content: ""; position: absolute; inset: 0; background: radial-gradient(circle at 50% 25%, rgba(111,143,235,.12), transparent 34rem); }
.auth-glow { position: absolute; width: 390px; height: 390px; border-radius: 50%; background: rgba(112,145,244,.12); filter: blur(100px); }
.auth-card { position: relative; z-index: 1; width: min(100%, 460px); padding: 34px; border-radius: 32px; }
.auth-brand, .brand { display: flex; align-items: center; gap: 12px; }
.auth-brand { margin-bottom: 74px; }
.auth-brand strong, .auth-brand small, .brand strong, .brand small { display: block; }
.auth-brand strong, .brand strong { font-size: 15px; letter-spacing: -.01em; }
.auth-brand small, .brand small { margin-top: 1px; color: var(--muted); font-size: 11px; }
.hermes-mark { width: 45px; height: 45px; display: grid; place-items: center; border: 1px solid rgba(151,177,255,.32); border-radius: 14px; color: #d9e2ff; background: radial-gradient(circle at 35% 25%, rgba(148,174,255,.28), rgba(73,91,145,.12) 55%, rgba(0,0,0,.1)); box-shadow: inset 0 1px 0 rgba(255,255,255,.13), 0 10px 30px rgba(36,58,120,.25); font-family: Georgia, serif; font-size: 23px; font-style: italic; }
.hermes-mark.small { width: 38px; height: 38px; border-radius: 12px; font-size: 19px; }
.eyebrow { color: var(--muted); font-size: 9px; font-weight: 700; letter-spacing: .18em; text-transform: uppercase; }
.auth-card h1 { margin: 10px 0 8px; font-size: 45px; line-height: 1; letter-spacing: -.055em; font-weight: 590; }
.auth-card > div > p { margin: 0; color: var(--muted); font-size: 14px; }
.stack-form { display: grid; gap: 15px; margin-top: 32px; }
label { color: #bbbcc2; font-size: 11px; font-weight: 580; }
input, textarea, select {
  width: 100%;
  border: 1px solid var(--line);
  outline: 0;
  background: rgba(7,7,9,.45);
  transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}
input:focus, textarea:focus, select:focus { border-color: rgba(131,162,255,.55); background: rgba(13,13,16,.72); box-shadow: 0 0 0 4px rgba(102,139,255,.09); }
.stack-form input, .form-grid input, .form-grid select { height: 51px; margin-top: 7px; padding: 0 15px; border-radius: 14px; }
.auth-foot { display: flex; align-items: center; gap: 8px; margin-top: 30px; padding-top: 20px; border-top: 1px solid var(--line); color: var(--muted-2); font-size: 10px; }
.status-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(124,227,165,.65); }
.form-error { margin-top: 16px; padding: 11px 13px; color: #ffb5b7; border: 1px solid rgba(255,126,131,.2); border-radius: 12px; background: rgba(255,126,131,.07); font-size: 12px; }

.button { min-height: 44px; padding: 0 18px; display: inline-flex; align-items: center; justify-content: center; gap: 12px; border: 1px solid var(--line); border-radius: 14px; color: var(--text); background: linear-gradient(rgba(255,255,255,.065), rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.055); font-size: 12px; font-weight: 650; transition: transform .18s ease, filter .18s ease, border-color .18s ease; }
.button:hover { transform: translateY(-1px); border-color: var(--line-strong); }
.button:active { transform: scale(.985); }
.button.primary { color: #0b1020; border-color: rgba(164,186,255,.9); background: linear-gradient(180deg, #a7bdff, #7f9fff); box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 12px 30px rgba(74,111,224,.2); }
.button.soft { background: rgba(255,255,255,.045); }
.button.wide { width: 100%; }
.button.compact { min-height: 38px; padding: 0 14px; border-radius: 12px; font-size: 11px; }
.icon-button { width: 38px; height: 38px; padding: 0; display: grid; place-items: center; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.025); }
.icon-button:hover { color: var(--text); background: rgba(255,255,255,.06); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; z-index: 30; inset: 12px auto 12px 12px; width: calc(var(--sidebar) - 12px); padding: 17px; display: flex; flex-direction: column; border-radius: 26px; box-shadow: 0 20px 60px rgba(0,0,0,.28); }
.side-head { height: 46px; display: flex; align-items: center; justify-content: space-between; }
.new-chat-button { min-height: 48px; margin-top: 28px; padding: 0 12px; display: grid; grid-template-columns: 31px 1fr auto; align-items: center; gap: 9px; color: var(--text); text-align: left; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.045); box-shadow: inset 0 1px 0 rgba(255,255,255,.045); font-size: 12px; }
.new-chat-button:hover { background: rgba(255,255,255,.075); }
.plus-icon { width: 29px; height: 29px; display: grid; place-items: center; color: #dbe3ff; border-radius: 10px; background: var(--blue-soft); font-size: 17px; }
kbd { color: var(--muted-2); font-family: inherit; font-size: 9px; }
.side-nav { display: grid; gap: 3px; margin-top: 22px; }
.side-nav > p { margin: 19px 10px 7px; color: #55555d; font-size: 8px; font-weight: 750; letter-spacing: .17em; text-transform: uppercase; }
.side-nav a { min-height: 41px; padding: 0 11px; display: grid; grid-template-columns: 23px 1fr auto; align-items: center; gap: 9px; color: #929299; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 560; }
.side-nav a:hover { color: #d3d3d8; background: rgba(255,255,255,.025); }
.side-nav a.active { color: #f3f4f8; border-color: rgba(255,255,255,.06); background: linear-gradient(90deg, rgba(122,153,247,.13), rgba(255,255,255,.025)); box-shadow: inset 0 1px 0 rgba(255,255,255,.035); }
.side-nav a.active svg { color: var(--blue); }
.side-nav a b { min-width: 20px; height: 19px; padding: 0 6px; display: grid; place-items: center; color: #787880; border-radius: 20px; background: rgba(255,255,255,.045); font-size: 9px; }
[data-icon] { width: 18px; height: 18px; display: inline-grid; place-items: center; color: currentColor; }
[data-icon] svg { width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.side-foot { position: relative; margin-top: auto; }
.mini-agent { display: flex; align-items: center; gap: 10px; margin: 0 4px 14px; padding: 13px 11px; border: 1px solid var(--line); border-radius: 15px; background: rgba(255,255,255,.02); }
.mini-agent strong, .mini-agent small { display: block; }
.mini-agent strong { font-size: 10px; }
.mini-agent small { margin-top: 2px; color: var(--muted-2); font-size: 9px; }
.agent-core { position: relative; width: 30px; height: 30px; display: grid; place-items: center; flex: none; border: 1px solid rgba(134,162,247,.28); border-radius: 50%; background: radial-gradient(circle, rgba(125,155,246,.35), rgba(45,56,92,.2)); box-shadow: 0 0 22px rgba(92,124,221,.15); }
.agent-core i { width: 7px; height: 7px; border-radius: 50%; background: #b8c9ff; box-shadow: 0 0 15px #88a9ff; }
.agent-core.large { width: 52px; height: 52px; }
.agent-core.large i { width: 10px; height: 10px; }
.profile-button { width: 100%; min-height: 52px; padding: 7px 9px; display: grid; grid-template-columns: 36px 1fr auto; align-items: center; gap: 9px; color: var(--text); text-align: left; border: 0; border-top: 1px solid var(--line); background: transparent; }
.profile-button > span:nth-child(2) strong, .profile-button > span:nth-child(2) small { display: block; }
.profile-button strong { font-size: 10px; }
.profile-button small { margin-top: 2px; color: var(--muted-2); font-size: 9px; text-transform: capitalize; }
.profile-button > i { color: var(--muted-2); font-style: normal; }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; color: #18213c; border-radius: 11px; background: linear-gradient(145deg, #becdff, #718edc); font-size: 11px; font-weight: 750; }
.profile-menu { position: absolute; right: 0; bottom: 52px; width: 130px; padding: 7px; border-radius: 13px; }
.profile-menu button { width: 100%; padding: 9px; color: #d7d7db; text-align: left; border: 0; border-radius: 9px; background: transparent; font-size: 11px; }
.profile-menu button:hover { background: rgba(255,255,255,.06); }

.main-stage { min-height: 100vh; margin-left: var(--sidebar); padding: 0 clamp(24px, 3vw, 48px) 48px; }
.topbar { min-height: 92px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--line); }
.topbar h2 { margin: 3px 0 0; font-size: 20px; letter-spacing: -.025em; }
.top-actions { display: flex; align-items: center; gap: 10px; }
.live-pill, .warning-pill { min-height: 34px; padding: 0 12px; display: inline-flex; align-items: center; gap: 8px; color: #b8bac0; border: 1px solid var(--line); border-radius: 999px; background: rgba(255,255,255,.025); font-size: 9px; font-weight: 650; }
.live-pill i { width: 6px; height: 6px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(124,227,165,.7); }
.warning-pill { color: var(--amber); background: rgba(247,198,108,.06); }
.view { display: none; padding-top: 34px; animation: appear .26s ease; }
.view.active { display: block; }
@keyframes appear { from { opacity: 0; transform: translateY(5px); } }

.hero-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr); gap: 14px; }
.welcome-card { min-height: 370px; padding: clamp(30px, 4vw, 52px); display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; overflow: hidden; border-radius: var(--radius-xl); }
.welcome-card::before { content: ""; position: absolute; inset: auto 20% -50% auto; width: 400px; height: 400px; border-radius: 50%; background: rgba(82,111,201,.08); filter: blur(40px); }
.welcome-copy { position: relative; z-index: 2; }
.welcome-copy h1 { margin: 12px 0 14px; font-size: clamp(40px, 5vw, 72px); line-height: .96; letter-spacing: -.065em; font-weight: 570; }
.welcome-copy > p { max-width: 520px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.65; }
.welcome-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 30px; }
.orb-wrap { position: relative; z-index: 1; min-height: 260px; display: grid; place-items: center; }
.orb { position: relative; width: 128px; height: 128px; display: grid; place-items: center; border: 1px solid rgba(157,178,244,.3); border-radius: 50%; color: #d8e1ff; background: radial-gradient(circle at 36% 25%, rgba(186,201,255,.38), rgba(87,111,181,.15) 42%, rgba(18,22,36,.6) 78%); box-shadow: inset 0 1px 0 rgba(255,255,255,.17), 0 0 75px rgba(87,120,229,.21); font-family: Georgia, serif; font-size: 48px; font-style: italic; }
.orb span { position: absolute; right: 11px; top: 13px; width: 9px; height: 9px; border: 2px solid #22242d; border-radius: 50%; background: var(--green); box-shadow: 0 0 13px var(--green); }
.orb-rings i { position: absolute; inset: 50%; border: 1px solid rgba(155,177,245,.10); border-radius: 50%; transform: translate(-50%,-50%); animation: ring 14s linear infinite; }
.orb-rings i:nth-child(1) { width: 185px; height: 185px; }
.orb-rings i:nth-child(2) { width: 225px; height: 110px; transform: translate(-50%,-50%) rotate(-26deg); animation-direction: reverse; }
.orb-rings i:nth-child(3) { width: 250px; height: 250px; border-style: dashed; opacity: .4; }
@keyframes ring { to { rotate: 360deg; } }
.system-card { min-height: 370px; padding: 27px; border-radius: var(--radius-xl); }
.system-card header { display: flex; align-items: center; justify-content: space-between; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.system-card h3, .section-bar h3, .recent-panel h3, .access-panel h3 { margin: 6px 0 0; font-size: 17px; letter-spacing: -.025em; }
.status-orb { width: 12px; height: 12px; border: 3px solid rgba(124,227,165,.15); border-radius: 50%; background: var(--green); box-shadow: 0 0 18px rgba(124,227,165,.4); }
.metric-list { display: grid; margin-top: 8px; }
.metric-list div { min-height: 62px; display: grid; grid-template-columns: 1fr 1.1fr auto; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.metric-list span { color: var(--muted-2); font-size: 10px; }
.metric-list strong { font-size: 11px; }
.metric-list i { color: var(--muted); font-size: 9px; font-style: normal; }
.metric-list i.good, .good { color: var(--green) !important; }
.section-bar { min-height: 96px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 11px; }
.quick-card { min-height: 142px; padding: 20px; display: grid; grid-template-columns: 40px 1fr auto; align-items: start; gap: 14px; color: var(--text); text-align: left; border-radius: var(--radius-lg); transition: transform .2s ease, border-color .2s ease; }
.quick-card:hover { transform: translateY(-3px); border-color: rgba(137,167,255,.25); }
.quick-card > i { width: 39px; height: 39px; padding: 10px; color: #b9c8f8; border: 1px solid rgba(139,164,241,.16); border-radius: 13px; background: rgba(112,142,231,.08); }
.quick-card strong, .quick-card small { display: block; }
.quick-card strong { margin-top: 3px; font-size: 12px; }
.quick-card small { margin-top: 7px; color: var(--muted); font-size: 10px; line-height: 1.45; }
.quick-card b { align-self: center; color: var(--muted-2); font-size: 15px; font-weight: 400; }
.overview-lower { display: grid; grid-template-columns: 1.25fr .75fr; gap: 12px; margin-top: 22px; }
.recent-panel, .access-panel { min-height: 270px; padding: 24px; border-radius: var(--radius-lg); }
.recent-panel header, .access-panel header { display: flex; align-items: center; justify-content: space-between; }
.recent-panel header button { color: var(--blue); border: 0; background: transparent; font-size: 10px; }
.recent-list { display: grid; margin-top: 14px; }
.recent-item { min-height: 53px; display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.recent-item > span:first-child { width: 29px; height: 29px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: var(--blue-soft); font-size: 10px; }
.recent-item strong, .recent-item small { display: block; }
.recent-item strong { font-size: 10px; }
.recent-item small, .recent-item time { color: var(--muted-2); font-size: 9px; }
.permission-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.permission-chips span { padding: 8px 10px; color: #c7ccda; border: 1px solid var(--line); border-radius: 10px; background: rgba(255,255,255,.025); font-size: 9px; text-transform: capitalize; }
.empty-state { display: grid; place-items: center; color: var(--muted-2); font-size: 11px; }
.empty-state.compact { min-height: 150px; }

.chat-view.active { height: calc(100vh - 126px); display: grid; grid-template-columns: 300px 1fr; gap: 12px; }
.chat-sidebar, .conversation { min-height: 0; border-radius: var(--radius-lg); overflow: hidden; }
.chat-sidebar { padding: 21px 14px; }
.chat-sidebar header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; }
.chat-sidebar h3 { margin: 5px 0 0; font-size: 16px; }
.search-field { height: 38px; margin: 18px 5px 11px; padding: 0 11px; display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 12px; background: rgba(0,0,0,.16); }
.search-field i { width: 14px; color: var(--muted-2); }
.search-field input { height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; font-size: 11px; }
.chat-list { height: calc(100% - 100px); overflow-y: auto; }
.chat-item { width: 100%; min-height: 64px; padding: 10px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; color: var(--text); text-align: left; border: 1px solid transparent; border-radius: 13px; background: transparent; }
.chat-item:hover { background: rgba(255,255,255,.025); }
.chat-item.active { border-color: var(--line); background: rgba(117,147,238,.09); }
.chat-item > span:first-child { width: 32px; height: 32px; display: grid; place-items: center; color: #b9c9fb; border-radius: 10px; background: rgba(116,145,232,.1); font-family: Georgia, serif; font-size: 13px; font-style: italic; }
.chat-item strong, .chat-item small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chat-item strong { font-size: 10px; }
.chat-item small { margin-top: 5px; color: var(--muted-2); font-size: 9px; }
.conversation { display: grid; grid-template-rows: 65px 1fr auto; }
.conversation-head { padding: 0 20px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); background: rgba(19,19,22,.58); }
.conversation-head > div { display: flex; align-items: center; gap: 11px; }
.conversation-symbol { width: 34px; height: 34px; display: grid; place-items: center; color: #d8e1ff; border-radius: 11px; background: var(--blue-soft); font-family: Georgia, serif; font-size: 14px; font-style: italic; }
.conversation-head strong, .conversation-head small { display: block; }
.conversation-head strong { font-size: 11px; }
.conversation-head small { margin-top: 3px; color: var(--muted-2); font-size: 9px; }
.message-list { padding: 28px clamp(18px, 4vw, 60px); overflow-y: auto; background: linear-gradient(180deg, rgba(10,10,12,.15), rgba(10,10,12,.02)); }
.conversation-empty { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.conversation-empty h3 { margin: 18px 0 7px; font-size: 18px; }
.conversation-empty p { margin: 0; color: var(--muted); font-size: 11px; }
.message { max-width: 780px; margin: 0 auto 26px; display: grid; grid-template-columns: 35px 1fr; gap: 13px; }
.message.user { grid-template-columns: 1fr 35px; }
.message.user .message-avatar { grid-column: 2; grid-row: 1; background: #c6d3ff; color: #1a2340; }
.message.user .message-body { grid-column: 1; grid-row: 1; justify-self: end; max-width: min(85%, 640px); padding: 13px 16px; border: 1px solid rgba(142,166,239,.15); border-radius: 18px 5px 18px 18px; background: rgba(105,135,224,.12); }
.message-avatar { width: 33px; height: 33px; display: grid; place-items: center; color: #cfdaff; border-radius: 11px; background: rgba(105,135,224,.12); font-size: 10px; font-weight: 700; }
.message.assistant .message-avatar { font-family: Georgia, serif; font-style: italic; }
.message-body { min-width: 0; color: #d4d4d9; font-size: 12px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; }
.message-body time { display: block; margin-top: 7px; color: var(--muted-2); font-size: 8px; }
.composer { margin: 0 clamp(18px, 4vw, 60px) 23px; padding: 11px 12px 9px 16px; border: 1px solid var(--line-strong); border-radius: 19px; background: rgba(17,17,20,.92); box-shadow: 0 15px 40px rgba(0,0,0,.22), inset 0 1px 0 rgba(255,255,255,.035); }
.composer textarea { min-height: 42px; max-height: 160px; padding: 10px 0 5px; resize: none; border: 0; background: transparent; box-shadow: none; font-size: 12px; line-height: 1.55; }
.composer-row { display: flex; align-items: center; justify-content: space-between; }
.composer-row > span { color: var(--muted-2); font-size: 8px; }
.send-button { width: 32px; height: 32px; display: grid; place-items: center; color: #101421; border: 0; border-radius: 11px; background: linear-gradient(#b5c8ff, #829fff); font-size: 18px; }

.files-panel, .terminal-panel, .automation-card, .people-panel, .invite-panel, .activity-panel { border-radius: var(--radius-lg); }
.files-panel { min-height: calc(100vh - 225px); padding: 16px; }
.file-upload { position: relative; overflow: hidden; }
.file-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-breadcrumb { min-height: 44px; display: flex; align-items: center; gap: 9px; padding: 0 6px 12px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 10px; }
.file-breadcrumb button { width: 28px; height: 28px; color: var(--text); border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.03); }
.file-layout { display: grid; grid-template-columns: minmax(260px,.75fr) minmax(400px,1.25fr); min-height: calc(100vh - 310px); }
.file-list { padding: 13px 12px 13px 0; border-right: 1px solid var(--line); overflow-y: auto; }
.file-row { width: 100%; min-height: 47px; padding: 0 11px; display: grid; grid-template-columns: 29px 1fr auto; align-items: center; gap: 9px; color: var(--text); text-align: left; border: 0; border-radius: 11px; background: transparent; }
.file-row:hover { background: rgba(255,255,255,.035); }
.file-row i { width: 28px; height: 28px; display: grid; place-items: center; color: var(--blue); border-radius: 9px; background: var(--blue-soft); font-style: normal; }
.file-row strong, .file-row small { display: block; }
.file-row strong { font-size: 10px; }
.file-row small { margin-top: 3px; color: var(--muted-2); font-size: 8px; }
.file-row > small { margin: 0; }
.file-editor { display: grid; grid-template-rows: 57px 1fr; padding-left: 14px; }
.file-editor header { display: flex; align-items: center; justify-content: space-between; padding: 0 6px; border-bottom: 1px solid var(--line); }
.file-editor header strong { display: block; margin-top: 4px; font-size: 10px; }
.file-editor textarea { min-height: 420px; padding: 18px 9px; resize: none; border: 0; background: transparent; box-shadow: none; color: #cdd1db; font-family: ui-monospace, "SFMono-Regular", Menlo, monospace; font-size: 11px; line-height: 1.65; }
.terminal-panel { overflow: hidden; background: #0b0b0d; }
.terminal-panel header { min-height: 48px; padding: 0 15px; display: grid; grid-template-columns: 80px 1fr auto; align-items: center; border-bottom: 1px solid var(--line); background: #17171a; }
.terminal-panel header > span { color: var(--muted); text-align: center; font-size: 9px; }
.terminal-panel header button { color: var(--muted); border: 0; background: transparent; font-size: 9px; }
.traffic { display: flex; gap: 6px; }
.traffic i { width: 8px; height: 8px; border-radius: 50%; background: #3b3b42; }
.traffic i:first-child { background: #ff7378; }
.traffic i:nth-child(2) { background: #f3c767; }
.traffic i:last-child { background: #70d996; }
.terminal-panel pre { height: min(58vh, 570px); margin: 0; padding: 23px; overflow: auto; color: #bfc4ce; font: 11px/1.7 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; }
.terminal-panel pre span { color: var(--blue); }
.terminal-panel form { min-height: 56px; padding: 0 14px 0 22px; display: grid; grid-template-columns: 20px 1fr auto; align-items: center; gap: 8px; border-top: 1px solid var(--line); background: #131316; }
.terminal-panel form > span { color: var(--blue); }
.terminal-panel form input { height: 100%; padding: 0; border: 0; background: transparent; box-shadow: none; font: 11px ui-monospace, "SFMono-Regular", Menlo, monospace; }
.terminal-panel form button { padding: 8px 13px; color: #10131c; border: 0; border-radius: 10px; background: #9db4fa; font-size: 10px; font-weight: 700; }
.automation-card { padding: 24px; }
.automation-hero { min-height: 78px; display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 14px; border-bottom: 1px solid var(--line); }
.automation-icon { width: 44px; height: 44px; padding: 12px; color: var(--blue); border-radius: 14px; background: var(--blue-soft); }
.automation-hero strong, .automation-hero small { display: block; }
.automation-hero strong { font-size: 12px; }
.automation-hero small { margin-top: 5px; color: var(--muted); font-size: 10px; }
.automation-hero > i { font-size: 9px; font-style: normal; }
.automation-card pre { min-height: 350px; margin: 18px 0 0; color: #adb2bd; font: 10px/1.65 ui-monospace, "SFMono-Regular", Menlo, monospace; white-space: pre-wrap; }
.people-grid { display: grid; grid-template-columns: 1.2fr .8fr; gap: 12px; }
.people-panel, .invite-panel { min-height: 500px; padding: 22px; }
.people-panel > header, .invite-panel > header { display: flex; align-items: baseline; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.people-panel header span, .invite-panel header span { font-size: 12px; font-weight: 650; }
.people-panel header small, .invite-panel header small { color: var(--muted-2); font-size: 9px; }
.user-card { min-height: 72px; padding: 11px 5px; display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 11px; border-bottom: 1px solid var(--line); }
.user-card strong, .user-card small { display: block; }
.user-card strong { font-size: 10px; }
.user-card small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.role-badge { padding: 6px 9px; color: #bdcaff; border: 1px solid rgba(137,165,255,.15); border-radius: 9px; background: var(--blue-soft); font-size: 8px; text-transform: capitalize; }
.invite-row { min-height: 62px; padding: 11px 4px; display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; border-bottom: 1px solid var(--line); }
.invite-row strong, .invite-row small { display: block; }
.invite-row strong { font-size: 10px; }
.invite-row small { margin-top: 4px; color: var(--muted-2); font-size: 8px; }
.invite-row span { color: var(--muted); font-size: 8px; }
.activity-panel { padding: 16px 23px; }
.activity-row { min-height: 61px; display: grid; grid-template-columns: 34px 1fr 130px; align-items: center; gap: 12px; border-bottom: 1px solid var(--line); }
.activity-row > i { width: 30px; height: 30px; display: grid; place-items: center; color: var(--blue); border-radius: 10px; background: var(--blue-soft); font-style: normal; font-size: 10px; }
.activity-row strong, .activity-row small { display: block; }
.activity-row strong { font-size: 10px; }
.activity-row small { margin-top: 4px; color: var(--muted-2); font-size: 9px; }
.activity-row time { color: var(--muted-2); text-align: right; font-size: 8px; }

.modal { width: min(92vw, 440px); padding: 25px; color: var(--text); border-radius: 26px; }
.modal::backdrop { background: rgba(0,0,0,.65); backdrop-filter: blur(8px); }
.wide-modal { width: min(92vw, 620px); }
.modal header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 23px; }
.modal h3 { margin: 5px 0 0; font-size: 21px; letter-spacing: -.035em; }
.modal > form > label { display: block; }
.modal > form > label input { height: 49px; margin-top: 7px; padding: 0 14px; border-radius: 13px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; margin-top: 18px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.18); }
.segmented label input { display: none; }
.segmented label span { min-height: 35px; display: grid; place-items: center; border-radius: 9px; color: var(--muted); font-size: 10px; }
.segmented label input:checked + span { color: var(--text); background: rgba(255,255,255,.08); box-shadow: inset 0 1px 0 rgba(255,255,255,.04); }
.modal-note { margin: 12px 0 22px; color: var(--muted-2); font-size: 9px; line-height: 1.5; }
.form-grid { display: grid; grid-template-columns: 1fr 160px; gap: 12px; }
.permission-editor { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin: 22px 0; }
.permission-toggle { min-height: 45px; padding: 0 11px; display: flex; align-items: center; justify-content: space-between; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.02); }
.permission-toggle span { font-size: 10px; text-transform: capitalize; }
.permission-toggle input { width: 31px; height: 18px; appearance: none; border: 0; border-radius: 20px; background: #3a3a40; box-shadow: none; transition: background .2s ease; }
.permission-toggle input::after { content: ""; width: 14px; height: 14px; display: block; margin: 2px; border-radius: 50%; background: white; transition: transform .2s ease; }
.permission-toggle input:checked { background: var(--blue-strong); }
.permission-toggle input:checked::after { transform: translateX(13px); }
.invite-result { text-align: center; }
.success-icon { width: 52px; height: 52px; margin: 0 auto 16px; display: grid; place-items: center; color: #0e2a19; border-radius: 50%; background: var(--green); font-size: 20px; font-weight: 800; }
.invite-result h3 { margin: 0; }
.invite-result p { color: var(--muted); font-size: 11px; }
.copy-field { display: grid; grid-template-columns: 1fr auto; margin: 20px 0 14px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: rgba(0,0,0,.2); }
.copy-field input { padding: 0 10px; border: 0; background: transparent; box-shadow: none; font-size: 9px; }
.copy-field button { padding: 9px 13px; color: #121622; border: 0; border-radius: 9px; background: #9db4ff; font-size: 9px; font-weight: 700; }

.toast { position: fixed; z-index: 90; left: 50%; bottom: 25px; padding: 11px 16px; color: #11141e; border-radius: 999px; background: #b5c7ff; box-shadow: 0 18px 50px rgba(0,0,0,.35); font-size: 10px; font-weight: 700; opacity: 0; transform: translate(-50%, 16px); pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.busy { position: fixed; z-index: 80; inset: 0; display: grid; place-items: center; align-content: center; gap: 14px; background: rgba(6,6,8,.55); backdrop-filter: blur(9px); }
.busy p { margin: 0; color: #c2c4cc; font-size: 11px; }
.spinner { width: 36px; height: 36px; border: 2px solid rgba(255,255,255,.1); border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.bottom-nav, .mobile-only { display: none; }

@media (max-width: 1100px) {
  :root { --sidebar: 230px; }
  .hero-grid { grid-template-columns: 1fr; }
  .system-card { min-height: auto; }
  .quick-grid { grid-template-columns: repeat(2, 1fr); }
  .overview-lower { grid-template-columns: 1fr; }
  .chat-view.active { grid-template-columns: 250px 1fr; }
  .people-grid { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  :root { --sidebar: 290px; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .mobile-only { display: grid; }
  .sidebar { inset: 8px auto 8px 8px; width: calc(var(--sidebar) - 16px); transform: translateX(calc(-100% - 18px)); transition: transform .28s cubic-bezier(.2,.75,.2,1); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  body.sidebar-open::after { content: ""; position: fixed; z-index: 25; inset: 0; background: rgba(0,0,0,.58); backdrop-filter: blur(4px); }
  .main-stage { margin-left: 0; padding: 0 15px 22px; }
  .topbar { min-height: 76px; padding-top: env(safe-area-inset-top); }
  .topbar > div:nth-child(2) { margin-right: auto; }
  .topbar h2 { font-size: 17px; }
  .top-actions .button { display: none; }
  .live-pill { padding: 0 9px; }
  .view { padding-top: 20px; }
  .welcome-card { min-height: 430px; padding: 30px 23px; grid-template-columns: 1fr; }
  .welcome-copy h1 { font-size: 48px; }
  .welcome-copy > p { font-size: 13px; }
  .orb-wrap { min-height: 180px; grid-row: 1; }
  .orb { width: 96px; height: 96px; font-size: 38px; }
  .orb-rings i:nth-child(1) { width: 145px; height: 145px; }
  .orb-rings i:nth-child(2) { width: 180px; height: 85px; }
  .orb-rings i:nth-child(3) { width: 190px; height: 190px; }
  .welcome-actions { flex-direction: column; }
  .welcome-actions .button { width: 100%; }
  .quick-grid { grid-template-columns: 1fr; }
  .quick-card { min-height: 105px; }
  .section-bar { min-height: 82px; }
  .chat-view.active { height: calc(100svh - 172px); display: block; position: relative; }
  .chat-sidebar { height: 100%; }
  .chat-view.has-chat .chat-sidebar { display: none; }
  .conversation { display: none; height: 100%; }
  .chat-view.has-chat .conversation { display: grid; }
  .conversation-head { padding: 0 13px; }
  .conversation-head::before { content: "‹"; margin-right: -3px; color: var(--muted); font-size: 26px; cursor: pointer; }
  .message-list { padding: 22px 14px; }
  .composer { margin: 0 12px 13px; }
  .message.user .message-body { max-width: 90%; }
  .file-layout { grid-template-columns: 1fr; }
  .file-list { min-height: 300px; border-right: 0; }
  .file-editor { padding: 0; border-top: 1px solid var(--line); }
  .files-panel { min-height: auto; }
  .terminal-panel pre { height: 52vh; }
  .people-panel, .invite-panel { min-height: auto; }
  .activity-row { grid-template-columns: 32px 1fr; }
  .activity-row time { grid-column: 2; text-align: left; }
  .form-grid, .permission-editor { grid-template-columns: 1fr; }
  .bottom-nav { position: fixed; z-index: 22; left: 10px; right: 10px; bottom: calc(8px + env(safe-area-inset-bottom)); min-height: 65px; padding: 6px 7px; display: grid; grid-template-columns: 1fr 1fr 64px 1fr 1fr; align-items: center; border-radius: 23px; }
  .bottom-nav a { min-height: 49px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; color: var(--muted-2); border-radius: 16px; font-size: 8px; }
  .bottom-nav a i { width: 17px; height: 17px; }
  .bottom-nav a.active { color: var(--blue); background: rgba(113,143,232,.08); }
  .bottom-nav > button { width: 54px; height: 54px; justify-self: center; display: grid; place-items: center; color: #111524; border: 0; border-radius: 18px; background: linear-gradient(150deg, #b9caff, #7999f2); box-shadow: 0 10px 25px rgba(79,112,214,.3); font-size: 25px; }
  .auth-card { padding: 26px 22px; }
  .auth-brand { margin-bottom: 55px; }
  .auth-card h1 { font-size: 39px; }
  .modal { padding: 22px; border-radius: 24px; }
}

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