:root {
  color-scheme: dark;
  --bg: #090a0f;
  --bg-soft: #0d0f17;
  --panel: rgba(18, 20, 31, .86);
  --panel-solid: #131520;
  --panel-2: #1a1d2b;
  --line: rgba(163, 170, 205, .14);
  --line-strong: rgba(139, 117, 255, .34);
  --text: #f5f4ff;
  --muted: #999fb5;
  --faint: #64697c;
  --indigo: #7c6cff;
  --violet: #a66cff;
  --cyan: #52d9e8;
  --green: #5be0ad;
  --red: #ff6f85;
  --amber: #ffc46b;
  --shadow: 0 24px 80px rgba(0, 0, 0, .45);
  --radius: 18px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html, body { width: 100%; min-height: 100%; margin: 0; }
body {
  background:
    radial-gradient(circle at 50% -20%, rgba(99, 79, 210, .14), transparent 38%),
    linear-gradient(180deg, #0b0c12 0%, var(--bg) 70%);
  color: var(--text);
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; }
button, select { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

::selection { background: rgba(124, 108, 255, .42); color: white; }
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(145, 151, 181, .2); border: 2px solid transparent; background-clip: padding-box; border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(145, 151, 181, .36); }

.ambient { position: fixed; inset: 0; pointer-events: none; overflow: hidden; opacity: .65; }
.ambient i { position: absolute; border-radius: 50%; filter: blur(90px); animation: ambient-drift 18s ease-in-out infinite alternate; }
.ambient i:nth-child(1) { width: 34vw; height: 34vw; left: 14%; top: -23%; background: rgba(104, 76, 255, .11); }
.ambient i:nth-child(2) { width: 28vw; height: 28vw; right: -12%; top: 36%; background: rgba(48, 193, 218, .07); animation-delay: -7s; }
.ambient i:nth-child(3) { width: 30vw; height: 30vw; left: 38%; bottom: -27%; background: rgba(163, 90, 255, .06); animation-delay: -12s; }
@keyframes ambient-drift { to { transform: translate3d(3vw, 2vh, 0) scale(1.08); } }

.app-shell { position: relative; width: 100vw; height: 100dvh; isolation: isolate; }
.topbar {
  position: fixed; z-index: 30; inset: 0 0 auto 0; height: 68px; padding: 0 22px;
  display: flex; align-items: center; justify-content: space-between;
  background: linear-gradient(180deg, rgba(9, 10, 15, .94), rgba(9, 10, 15, .56), transparent);
  opacity: 1; transform: none; pointer-events: auto;
  transition: opacity .35s var(--ease), transform .35s var(--ease);
}
.has-chat .topbar { opacity: 1; transform: none; pointer-events: auto; }
.brand-compact, .icon-button, .quiet-button, .primary-button, .wide-button, .send-button, .stop-button {
  border: 0; cursor: pointer; transition: .2s var(--ease);
}
.brand-compact { display: flex; gap: 10px; align-items: center; padding: 7px 9px; color: var(--text); background: transparent; font-size: 13px; font-weight: 800; letter-spacing: .16em; }
.brand-mark, .dialog-symbol {
  display: grid; place-items: center; width: 31px; height: 31px; border: 1px solid rgba(128, 110, 255, .42); border-radius: 9px;
  color: white; background: linear-gradient(145deg, rgba(124, 108, 255, .28), rgba(82, 217, 232, .12)); box-shadow: 0 0 24px rgba(124, 108, 255, .14);
}
.top-status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; position: absolute; left: 50%; transform: translateX(-50%); }
.connection-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--amber); box-shadow: 0 0 12px currentColor; }
.connection-dot.online { background: var(--green); color: var(--green); }
.connection-dot.offline { background: var(--red); color: var(--red); }
.top-actions { display: flex; align-items: center; gap: 8px; }
.icon-button, .quiet-button {
  min-height: 36px; padding: 0 13px; border: 1px solid var(--line); border-radius: 11px; background: rgba(22, 24, 36, .72); color: var(--muted);
}
.icon-button { width: 38px; padding: 0; font-size: 18px; }
.icon-button:hover, .quiet-button:hover { color: var(--text); border-color: var(--line-strong); background: rgba(30, 32, 47, .9); }
.teacher-toggle.active { color: #e7dcff; border-color: rgba(166, 108, 255, .42); background: rgba(134, 87, 219, .16); }

.workspace { position: relative; width: 100%; height: 100%; display: flex; justify-content: center; }
.hero {
  position: absolute; z-index: 4; left: 50%; top: 42%; width: min(760px, calc(100% - 32px)); transform: translate(-50%, -50%);
  text-align: center; transition: opacity .35s var(--ease), transform .55s var(--ease), top .55s var(--ease);
}
.has-chat .hero { opacity: 0; transform: translate(-50%, -66%) scale(.82); pointer-events: none; }
.logo-orbit { position: absolute; inset: -56px 18% -28px; pointer-events: none; }
.logo-orbit::before {
  content: ""; position: absolute; inset: 8% 13%; border: 1px solid rgba(115, 102, 233, .13); border-radius: 50%;
  transform: rotate(-4deg); opacity: 0; animation: orbit-show 1.4s .35s var(--ease) forwards;
}
.logo-orbit b { position: absolute; width: 3px; height: 3px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 12px rgba(82, 217, 232, .95); opacity: 0; animation: particle-in 1.35s var(--ease) forwards; }
.logo-orbit b:nth-child(1) { left: 15%; top: 56%; --tx: 18vw; --ty: -2vh; animation-delay: .05s; }
.logo-orbit b:nth-child(2) { left: 80%; top: 15%; --tx: -24vw; --ty: 5vh; animation-delay: .12s; }
.logo-orbit b:nth-child(3) { left: 42%; top: -10%; --tx: 3vw; --ty: 12vh; animation-delay: .2s; }
.logo-orbit b:nth-child(4) { left: 92%; top: 75%; --tx: -28vw; --ty: -9vh; animation-delay: .25s; }
.logo-orbit b:nth-child(5) { left: 5%; top: 8%; --tx: 34vw; --ty: 6vh; animation-delay: .32s; }
.logo-orbit b:nth-child(6) { left: 62%; top: 110%; --tx: -8vw; --ty: -15vh; animation-delay: .38s; }
@keyframes particle-in { 0% { opacity: 0; transform: translate(0,0) scale(.2); } 32% { opacity: .9; } 88% { opacity: .8; transform: translate(var(--tx), var(--ty)) scale(1); } 100% { opacity: 0; transform: translate(var(--tx), var(--ty)) scale(.2); } }
@keyframes orbit-show { 45% { opacity: .7; } 100% { opacity: 0; transform: rotate(5deg) scale(.88); } }
.norax-word {
  position: relative; display: flex; justify-content: center; gap: clamp(4px, 1.4vw, 20px); margin: 0;
  font-size: clamp(64px, 11vw, 132px); line-height: .9; letter-spacing: .02em; font-weight: 760;
  filter: drop-shadow(0 0 28px rgba(114, 92, 255, .12));
}
.norax-word span {
  display: inline-block; color: transparent; background: linear-gradient(110deg, #bdb6ff 5%, #786dff 40%, #d8c7ff 62%, #63d4e4 96%);
  background-size: 220% 100%; -webkit-background-clip: text; background-clip: text;
  opacity: 0; transform: translateY(34px) scale(.72); filter: blur(14px);
  animation: letter-form .9s var(--ease) forwards, logo-breathe 8s 2.2s ease-in-out infinite;
}
.norax-word span:nth-child(1) { animation-delay: .18s, 2.2s; }
.norax-word span:nth-child(2) { animation-delay: .31s, 2.32s; }
.norax-word span:nth-child(3) { animation-delay: .44s, 2.44s; }
.norax-word span:nth-child(4) { animation-delay: .57s, 2.56s; }
.norax-word span:nth-child(5) { animation-delay: .70s, 2.68s; }
@keyframes letter-form { 0% { opacity: 0; transform: translateY(34px) scale(.72); filter: blur(14px); } 55% { opacity: 1; filter: blur(1px); } 100% { opacity: 1; transform: none; filter: blur(0); } }
@keyframes logo-breathe { 0%, 100% { background-position: 0% 50%; text-shadow: 0 0 0 rgba(123, 105, 255, 0); } 50% { background-position: 100% 50%; text-shadow: 0 0 34px rgba(123, 105, 255, .18); } }
.hero-subtitle { margin: 20px 0 0; color: #bebdd0; font-size: clamp(13px, 2vw, 17px); letter-spacing: .22em; text-transform: uppercase; font-weight: 550; opacity: 0; animation: rise-in .55s 1s var(--ease) forwards; }
.hero-greeting { margin: 22px 0 0; color: var(--muted); font-size: clamp(16px, 2vw, 20px); opacity: 0; animation: rise-in .55s 1.15s var(--ease) forwards; transition: opacity .28s; }
@keyframes rise-in { to { opacity: 1; transform: none; } from { opacity: 0; transform: translateY(9px); } }

.chat-region { width: min(900px, calc(100% - 36px)); height: 100%; padding: 86px 0 142px; pointer-events: none; opacity: 0; transition: opacity .35s .16s var(--ease); }
.has-chat .chat-region { opacity: 1; pointer-events: auto; }
.messages { height: 100%; overflow: auto; padding: 4px 8px 28px; scroll-behavior: smooth; }
.message { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 12px; margin: 0 auto 24px; animation: message-in .32s var(--ease); }
.message.user { grid-template-columns: minmax(0, 1fr) 34px; }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }
.avatar { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 10px; border: 1px solid var(--line); background: var(--panel-solid); color: var(--muted); font-weight: 800; font-size: 12px; }
.message.assistant .avatar { color: #d7d2ff; border-color: rgba(125, 109, 255, .32); background: linear-gradient(145deg, rgba(124, 108, 255, .22), rgba(82, 217, 232, .07)); }
.message.user .avatar { grid-column: 2; background: rgba(124, 108, 255, .22); color: white; }
.message-body { min-width: 0; color: #e5e4ef; font-size: 15px; line-height: 1.72; }
.message.user .message-body { grid-column: 1; grid-row: 1; justify-self: end; max-width: min(78%, 690px); padding: 12px 16px; border-radius: 17px 17px 5px 17px; border: 1px solid rgba(132, 112, 255, .25); background: linear-gradient(135deg, rgba(105, 86, 225, .32), rgba(76, 64, 156, .3)); line-height: 1.55; }
.message-body p { margin: 0 0 12px; }
.message-body p:last-child { margin-bottom: 0; }
.message-body h1, .message-body h2, .message-body h3 { color: var(--text); line-height: 1.25; margin: 24px 0 10px; }
.message-body h1 { font-size: 1.55em; } .message-body h2 { font-size: 1.3em; } .message-body h3 { font-size: 1.1em; }
.message-body ul, .message-body ol { margin: 8px 0 14px; padding-left: 24px; }
.message-body li { margin: 4px 0; }
.message-body blockquote { margin: 12px 0; padding: 8px 14px; border-left: 3px solid var(--indigo); background: rgba(124,108,255,.07); color: #c7c6d5; }
.message-body a { color: #7edce7; text-decoration: underline; text-decoration-color: rgba(126,220,231,.35); text-underline-offset: 3px; }
.message-body table { width: 100%; margin: 14px 0; border-collapse: collapse; display: block; overflow-x: auto; }
.message-body th, .message-body td { padding: 9px 12px; border: 1px solid var(--line); text-align: left; white-space: nowrap; }
.message-body th { background: rgba(124,108,255,.1); color: #dedaff; }
.code-block { position: relative; margin: 14px 0; border: 1px solid var(--line); border-radius: 13px; overflow: hidden; background: #080a10; }
.code-head { display: flex; align-items: center; justify-content: space-between; min-height: 36px; padding: 0 10px 0 14px; border-bottom: 1px solid var(--line); background: #11131c; color: var(--faint); font: 11px/1.2 ui-monospace, SFMono-Regular, Consolas, monospace; text-transform: uppercase; letter-spacing: .08em; }
.copy-code { border: 0; border-radius: 7px; padding: 5px 8px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; }
.copy-code:hover { background: rgba(124,108,255,.12); color: white; }
.code-block pre { margin: 0; padding: 16px; overflow: auto; color: #d9d9e4; font: 13px/1.65 ui-monospace, SFMono-Regular, Consolas, monospace; tab-size: 2; }
.message-body code:not(.code-block code) { padding: 2px 5px; border: 1px solid rgba(145,151,181,.14); border-radius: 5px; background: rgba(145,151,181,.08); color: #d9d5ff; font: .88em ui-monospace, SFMono-Regular, Consolas, monospace; }
.tok-keyword { color: #b9a4ff; } .tok-string { color: #8bdcb3; } .tok-number { color: #f2bc7d; } .tok-comment { color: #6f758c; font-style: italic; }
.message-meta { display: flex; gap: 7px; align-items: center; margin-top: 10px; color: var(--faint); font-size: 11px; }
.message-actions { display: flex; gap: 5px; margin-left: auto; }
.message-action { border: 0; border-radius: 7px; padding: 5px 8px; background: transparent; color: var(--faint); cursor: pointer; font-size: 11px; }
.message-action:hover { color: white; background: rgba(145,151,181,.08); }
.cursor::after { content: ""; display: inline-block; width: 7px; height: 15px; margin-left: 3px; vertical-align: -2px; border-radius: 2px; background: var(--cyan); animation: cursor-blink .8s steps(1) infinite; }
@keyframes cursor-blink { 50% { opacity: .1; } }
.cancelled-note { color: var(--amber); font-size: 12px; }

.teacher-bar { position: absolute; z-index: 8; left: 50%; bottom: 128px; width: min(880px, calc(100% - 42px)); transform: translateX(-50%); padding: 12px 14px; border: 1px solid rgba(166,108,255,.22); border-radius: 14px; background: rgba(17,18,28,.94); box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.teacher-bar > div:first-child { display: flex; align-items: baseline; gap: 9px; margin-bottom: 9px; }
.teacher-bar strong { font-size: 13px; color: #e9dcff; }.teacher-bar span { font-size: 11px; color: var(--muted); }
.template-list { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.template-chip { flex: 0 0 auto; border: 1px solid var(--line); border-radius: 9px; padding: 7px 10px; background: rgba(124,108,255,.07); color: #c8c5d9; cursor: pointer; font-size: 11px; }
.template-chip:hover { border-color: var(--line-strong); color: white; }

.composer-zone { position: absolute; z-index: 12; left: 50%; top: calc(42% + clamp(145px, 17vw, 205px)); width: min(760px, calc(100% - 32px)); transform: translateX(-50%); transition: top .55s var(--ease), bottom .55s var(--ease), width .55s var(--ease), transform .55s var(--ease); }
.has-chat .composer-zone { position: fixed; top: auto; bottom: max(18px, env(safe-area-inset-bottom)); width: min(900px, calc(100% - 36px)); }
.composer { min-height: 62px; display: flex; align-items: flex-end; gap: 10px; padding: 9px 9px 9px 18px; border: 1px solid rgba(149, 142, 205, .22); border-radius: 20px; background: rgba(20, 22, 33, .9); box-shadow: 0 18px 60px rgba(0,0,0,.35), 0 0 0 1px rgba(124,108,255,.03) inset; backdrop-filter: blur(22px); transition: border-color .2s, box-shadow .2s; }
.composer:focus-within { border-color: rgba(129,112,255,.56); box-shadow: 0 20px 65px rgba(0,0,0,.4), 0 0 32px rgba(124,108,255,.08); }
#prompt-input { flex: 1; min-height: 42px; max-height: 170px; padding: 10px 0 7px; resize: none; overflow-y: auto; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 15px; line-height: 1.5; }
#prompt-input::placeholder { color: #6f7488; }
.send-button { flex: 0 0 44px; width: 44px; height: 44px; border-radius: 14px; background: linear-gradient(145deg, var(--indigo), #6554e8); color: white; font-size: 23px; box-shadow: 0 8px 24px rgba(93,73,221,.3); }
.send-button:hover { transform: translateY(-1px); filter: brightness(1.08); }
.send-button:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.stop-button { height: 44px; padding: 0 15px; display: flex; align-items: center; gap: 7px; border-radius: 14px; background: rgba(255,111,133,.13); border: 1px solid rgba(255,111,133,.28); color: #ff9aaa; font-weight: 700; font-size: 12px; }
.stop-button:hover { background: rgba(255,111,133,.2); }
.composer-meta { min-height: 24px; display: flex; justify-content: space-between; align-items: center; padding: 6px 7px 0; color: var(--faint); font-size: 10px; letter-spacing: .01em; }
.model-confirmation { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.model-confirmation b { color: #9895ad; font-weight: 600; }.model-confirmation i { margin: 0 4px; font-style: normal; }

.settings-drawer { position: fixed; z-index: 60; top: 0; right: 0; width: min(430px, 100%); height: 100dvh; padding: 22px; overflow-y: auto; border-left: 1px solid var(--line); background: rgba(13,15,23,.96); box-shadow: -30px 0 100px rgba(0,0,0,.45); backdrop-filter: blur(30px); transform: translateX(104%); transition: transform .4s var(--ease); }
.settings-drawer.open { transform: none; }
.drawer-backdrop { position: fixed; z-index: 55; inset: 0; border: 0; background: rgba(3,4,8,.58); backdrop-filter: blur(3px); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.drawer-head h2 { margin: 3px 0 0; font-size: 22px; }.eyebrow { color: #8279bc; font-size: 9px; font-weight: 800; letter-spacing: .2em; }
.setting-card { margin-bottom: 12px; padding: 16px; border: 1px solid var(--line); border-radius: var(--radius); background: linear-gradient(145deg, rgba(24,26,39,.84), rgba(17,19,29,.7)); }
.setting-card h3 { margin: 0; font-size: 14px; }.setting-card p { margin: 5px 0 13px; color: var(--muted); font-size: 11px; line-height: 1.5; }
.setting-title { display: flex; justify-content: space-between; gap: 12px; }
.status-pill { align-self: flex-start; flex: 0 0 auto; padding: 4px 7px; border-radius: 99px; background: rgba(91,224,173,.1); color: var(--green); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.field-label { display: block; margin: 12px 0 6px; color: #adafc1; font-size: 10px; font-weight: 650; }
select, input[type="text"], input[type="password"] { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 11px; outline: none; padding: 0 12px; background: #10121b; color: var(--text); }
select:focus, input:focus { border-color: var(--line-strong); }
.model-detail { display: grid; gap: 4px; margin-top: 9px; color: var(--muted); font-size: 10px; line-height: 1.5; }
.model-detail strong { color: #dedce7; font-size: 11px; font-weight: 600; }
.model-detail span { display: block; }
.model-guide { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.model-guide summary { cursor: pointer; color: #c7c4d4; font-size: 11px; font-weight: 600; }
.model-guide-intro { margin: 9px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }
.model-guide-list { display: grid; gap: 7px; max-height: min(310px, 42vh); overflow-y: auto; padding-right: 3px; }
.model-guide-item { padding: 9px 10px; border: 1px solid var(--line); border-radius: 10px; background: rgba(9,10,15,.45); }
.model-guide-item.selected { border-color: rgba(124,108,255,.44); background: rgba(124,108,255,.09); }
.model-guide-item div { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.model-guide-item strong { color: #e2e0e9; font-size: 11px; }
.model-guide-item em { color: #9f98ca; font-size: 9px; font-style: normal; white-space: nowrap; }
.model-guide-item p { margin: 5px 0; color: var(--muted); font-size: 10px; line-height: 1.45; }
.model-guide-item small { color: #aaa6ba; font-size: 9px; }
.more-models { margin-top: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.more-models summary { cursor: pointer; color: #b9b6c8; font-size: 11px; }
.additional-model { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; padding: 9px; border-radius: 9px; background: rgba(9,10,15,.45); color: var(--muted); font-size: 10px; }
.additional-model b { display: block; color: #d4d2dd; font-size: 11px; }.additional-model em { align-self: center; color: var(--faint); font-style: normal; white-space: nowrap; }
.thinking-levels { display: grid; grid-template-columns: repeat(4,1fr); gap: 6px; }
.thinking-levels button { min-height: 58px; padding: 8px 3px; border: 1px solid var(--line); border-radius: 10px; background: #10121b; color: var(--muted); cursor: pointer; font-size: 14px; }
.thinking-levels button span { display: block; margin-top: 5px; font-size: 9px; }
.thinking-levels button:hover, .thinking-levels button.active { border-color: rgba(124,108,255,.48); color: white; background: rgba(124,108,255,.13); }
.microcopy { margin: 9px 0 0 !important; color: var(--faint) !important; }
.toggle-row { min-height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.toggle-row:last-child { border-bottom: 0; }.toggle-row strong, .toggle-row small { display: block; }.toggle-row strong { font-size: 12px; }.toggle-row small { margin-top: 3px; color: var(--faint); font-size: 9px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }.toggle-row i { position: relative; flex: 0 0 38px; width: 38px; height: 21px; border-radius: 99px; background: #292c3a; transition: .2s; }.toggle-row i::after { content: ""; position: absolute; width: 15px; height: 15px; left: 3px; top: 3px; border-radius: 50%; background: #7a7f93; transition: .2s; }.toggle-row input:checked + i { background: rgba(124,108,255,.55); }.toggle-row input:checked + i::after { transform: translateX(17px); background: white; }
.compact-card { display: grid; gap: 8px; }
.wide-button { display: grid; place-items: center; width: 100%; min-height: 42px; border-radius: 11px; background: rgba(124,108,255,.14); color: #d9d4ff; font-size: 11px; }
.wide-button:hover { background: rgba(124,108,255,.22); }.wide-button.secondary { background: rgba(145,151,181,.07); color: var(--muted); }
.drawer-footer { display: flex; justify-content: space-between; padding: 8px 4px 20px; color: var(--faint); font-size: 9px; }

dialog { color: var(--text); }
dialog::backdrop { background: rgba(3,4,8,.72); backdrop-filter: blur(7px); }
.welcome-dialog, .tutorial-offer { width: min(430px, calc(100% - 30px)); padding: 0; border: 1px solid rgba(133,117,245,.28); border-radius: 22px; background: #12141e; box-shadow: var(--shadow); }
.welcome-dialog form, .tutorial-offer form { padding: 28px; }.dialog-symbol { margin-bottom: 23px; }.welcome-dialog h2, .tutorial-offer h2 { margin: 7px 0 8px; font-size: 24px; }.welcome-dialog p, .tutorial-offer p { color: var(--muted); font-size: 13px; line-height: 1.55; }.welcome-dialog input { margin-top: 12px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 22px; }.primary-button { min-height: 38px; padding: 0 16px; border-radius: 11px; background: linear-gradient(135deg, var(--indigo), #6252df); color: white; font-weight: 700; font-size: 12px; }.primary-button:hover { filter: brightness(1.1); }

.tutorial-layer { position: fixed; z-index: 100; inset: 0; pointer-events: none; }
.tutorial-spotlight { position: fixed; z-index: 101; border: 2px solid rgba(139,120,255,.85); border-radius: 14px; box-shadow: 0 0 0 9999px rgba(5,6,10,.78), 0 0 34px rgba(124,108,255,.4); transition: .28s var(--ease); }
.tutorial-card { position: fixed; z-index: 102; width: min(360px, calc(100% - 28px)); padding: 18px; border: 1px solid rgba(139,120,255,.35); border-radius: 16px; background: #171925; box-shadow: var(--shadow); pointer-events: auto; transition: .28s var(--ease); }
.tutorial-count { color: #8178b4; font-size: 9px; letter-spacing: .15em; }.tutorial-card h3 { margin: 7px 0; font-size: 17px; }.tutorial-card p { max-height: min(230px, 38vh); margin: 0; overflow-y: auto; color: var(--muted); font-size: 12px; line-height: 1.55; }.tutorial-actions { display: grid; grid-template-columns: auto 1fr auto auto; gap: 7px; margin-top: 16px; }
.tutorial-target { position: relative !important; z-index: 103 !important; }
.toast-region { position: fixed; z-index: 120; right: 18px; bottom: 18px; display: grid; gap: 8px; width: min(380px, calc(100% - 36px)); pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #191b28; box-shadow: var(--shadow); color: #d7d5e1; font-size: 12px; animation: toast-in .25s var(--ease); }.toast.error { border-color: rgba(255,111,133,.32); color: #ffb0bc; }.toast.success { border-color: rgba(91,224,173,.28); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 720px) {
  .topbar { height: 58px; padding: 0 12px; }.brand-compact { font-size: 11px; }.brand-mark { width: 28px; height: 28px; }.top-status { display: none; }.teacher-toggle { display: none; }
  .hero { top: 38%; }.norax-word { font-size: clamp(54px, 20vw, 83px); gap: 2px; }.hero-subtitle { margin-top: 16px; font-size: 11px; }.hero-greeting { margin-top: 18px; font-size: 16px; }
  .composer-zone { top: calc(38% + 135px); }.has-chat .composer-zone { bottom: max(8px, env(safe-area-inset-bottom)); width: calc(100% - 18px); }.composer { min-height: 56px; padding: 6px 6px 6px 14px; border-radius: 17px; }.send-button { width: 42px; height: 42px; flex-basis: 42px; }.stop-button { height: 42px; padding: 0 11px; }.stop-button span:last-child { display: none; }
  .composer-meta { padding-inline: 4px; }.model-confirmation span, .model-confirmation i { display: none; }.model-confirmation b:first-of-type { display: none; }
  .chat-region { width: 100%; padding: 68px 12px 112px; }.messages { padding-inline: 2px; }.message { grid-template-columns: 29px minmax(0,1fr); gap: 9px; margin-bottom: 19px; }.message.user { grid-template-columns: minmax(0,1fr) 29px; }.avatar { width: 28px; height: 28px; border-radius: 9px; }.message-body { font-size: 14px; }.message.user .message-body { max-width: 88%; }
  .teacher-bar { bottom: 103px; width: calc(100% - 18px); }.teacher-bar > div:first-child span { display: none; }
  .settings-drawer { padding: 16px; }.thinking-levels button { min-height: 54px; }.thinking-levels button span { font-size: 8px; }
  .tutorial-card { padding: 15px; }.tutorial-actions { grid-template-columns: auto 1fr auto; }.tutorial-actions #tutorial-back { grid-column: 1; grid-row: 2; }.tutorial-actions #tutorial-next { grid-column: 3; grid-row: 2; }.tutorial-actions span { display: none; }
}

@media (max-height: 620px) and (orientation: landscape) {
  .hero { top: 32%; transform: translate(-50%,-50%) scale(.78); }.composer-zone { top: 58%; }.hero-greeting { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
  .ambient, .logo-orbit { display: none; }
  .norax-word span, .hero-subtitle, .hero-greeting { opacity: 1; transform: none; filter: none; }
}

/* Admin dashboard */
.admin-body { overflow: auto; min-height: 100dvh; }
.admin-shell { width: min(1320px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 60px; }
.admin-header { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 20px; margin-bottom: 20px; }
.admin-header > div:nth-child(2) { text-align: center; }.admin-header h1 { margin: 4px 0 0; font-size: 24px; }.admin-actions { justify-self: end; display: flex; gap: 8px; }
.admin-notice { display: flex; gap: 12px; align-items: baseline; margin-bottom: 14px; padding: 12px 15px; border: 1px solid rgba(91,224,173,.15); border-radius: 13px; background: rgba(91,224,173,.05); }.admin-notice strong { color: var(--green); font-size: 11px; }.admin-notice span { color: var(--muted); font-size: 10px; }
.metric-grid { display: grid; grid-template-columns: repeat(8, minmax(110px, 1fr)); gap: 10px; margin-bottom: 12px; }.metric-grid article { min-height: 112px; padding: 14px; border: 1px solid var(--line); border-radius: 15px; background: var(--panel); }.metric-grid span, .metric-grid strong, .metric-grid small { display: block; }.metric-grid span { color: var(--faint); font-size: 9px; text-transform: uppercase; letter-spacing: .12em; }.metric-grid strong { margin-top: 14px; font-size: 20px; }.metric-grid small { margin-top: 5px; color: var(--muted); font-size: 9px; line-height: 1.35; }
.admin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 12px; }.admin-panel { min-width: 0; padding: 17px; border: 1px solid var(--line); border-radius: 17px; background: var(--panel); }.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 14px; }.panel-head h2 { margin: 4px 0 0; font-size: 16px; }
.danger-button { min-height: 34px; padding: 0 11px; border: 1px solid rgba(255,111,133,.25); border-radius: 9px; background: rgba(255,111,133,.09); color: #ff9aaa; cursor: pointer; font-size: 10px; }.danger-button:hover { background: rgba(255,111,133,.16); }
.runtime-summary { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 12px; }.runtime-summary span { padding: 7px 9px; border-radius: 9px; background: rgba(124,108,255,.07); color: var(--muted); font-size: 10px; }.runtime-summary b { color: white; }
.request-list, .loaded-list, .process-list { display: grid; gap: 7px; }.request-list > p, .loaded-list > p, .admin-logs > p { color: var(--faint); font-size: 11px; }.request-row, .loaded-row, .process-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; padding: 10px; border-radius: 10px; background: rgba(8,9,14,.48); }.request-row b, .request-row span, .loaded-row b, .loaded-row span { display: block; }.request-row b, .loaded-row b { font-size: 11px; }.request-row span, .loaded-row span { margin-top: 3px; color: var(--muted); font-size: 9px; }.process-row { color: var(--muted); font-size: 10px; }.process-row b { color: #bab7c9; }
.installed-table-wrap { overflow-x: auto; }.installed-table { width: 100%; border-collapse: collapse; font-size: 10px; }.installed-table th, .installed-table td { padding: 9px; border-bottom: 1px solid var(--line); text-align: left; }.installed-table th { color: var(--faint); font-size: 8px; text-transform: uppercase; letter-spacing: .1em; }.installed-table td { color: var(--muted); }.installed-table td b, .installed-table td small { display: block; }.installed-table td b { color: #dedce7; }.installed-table td small { margin-top: 3px; color: var(--faint); }
.logs-panel { margin-top: 0; }.admin-logs { display: grid; gap: 8px; }.admin-logs details { border: 1px solid var(--line); border-radius: 10px; background: rgba(8,9,14,.4); }.admin-logs summary { padding: 10px; cursor: pointer; color: #b8b5c7; font-size: 10px; }.admin-logs pre { max-height: 360px; margin: 0; padding: 12px; overflow: auto; border-top: 1px solid var(--line); color: #a7abba; font: 10px/1.55 ui-monospace,Consolas,monospace; white-space: pre-wrap; }
.admin-login-error { color: var(--red) !important; min-height: 18px; }.dialog-link { display: grid; place-items: center; }.admin-body dialog[open] ~ .admin-shell { filter: blur(4px); pointer-events: none; }
@media (max-width: 1100px) { .metric-grid { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 720px) { .admin-shell { width: calc(100% - 20px); padding-top: 12px; }.admin-header { grid-template-columns: 1fr auto; }.admin-header > div:nth-child(2) { display: none; }.admin-actions .quiet-button:first-child { display: none; }.metric-grid { grid-template-columns: repeat(2,1fr); }.admin-grid { grid-template-columns: 1fr; }.admin-notice { align-items: flex-start; flex-direction: column; gap: 4px; } }
