:root {
  color-scheme: dark;
  --ink: #f7eeee;
  --muted: #b6a2a3;
  --red: #c82e3c;
  --red-bright: #f0525c;
  --panel: rgba(25, 12, 15, .96);
  --line: rgba(255, 227, 226, .13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; color: var(--ink); background: #10090b; }
button, input, textarea, select { font: inherit; }
button { color: inherit; }
.app-shell {
  min-height: 100vh;
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(14, 6, 8, .91) 0%, rgba(19, 7, 9, .74) 45%, rgba(17, 7, 9, .42) 100%), url("./garuda-interface.png") center / cover fixed no-repeat, #160b0d;
}
.app-shell::after { position: fixed; content: ""; inset: 0; z-index: -1; pointer-events: none; background: radial-gradient(ellipse at 75% 55%, transparent 5%, rgba(7, 3, 5, .28) 90%); }
.topbar { height: 82px; display: flex; align-items: center; justify-content: space-between; padding: 0 clamp(20px, 5vw, 76px); border-bottom: 1px solid rgba(255,255,255,.08); background: rgba(15, 7, 9, .22); }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); text-decoration: none; letter-spacing: .12em; }
.brand-mark, .lock-emblem { display: grid; place-items: center; border: 1px solid rgba(240,82,92,.7); color: #ff7b82; font-family: Georgia, serif; font-size: 25px; font-weight: 700; width: 42px; height: 42px; transform: rotate(45deg); }
.brand-mark { border-radius: 12px 3px 12px 3px; }
.brand-mark::first-letter { transform: rotate(-45deg); }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 14px; }
.brand small { color: #bda7a8; font-size: 8px; letter-spacing: .2em; margin-top: 4px; }
.topbar-status { display: flex; align-items: center; gap: 8px; font-size: 9px; letter-spacing: .16em; color: #ccbabb; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #62c79b; box-shadow: 0 0 10px #62c79b; }
.workspace { width: min(940px, calc(100% - 40px)); min-height: calc(100vh - 260px); margin: 0 auto; padding: clamp(68px, 12vh, 132px) 0 32px; }
.welcome { max-width: 680px; }
.eyebrow { color: #f0646c; font-size: 9px; font-weight: 700; letter-spacing: .23em; margin: 0 0 16px; }
.welcome h1 { font-family: Georgia, "Times New Roman", serif; font-size: clamp(46px, 7vw, 78px); font-weight: 400; line-height: .98; letter-spacing: -.04em; margin: 0; }
.welcome h1 em { color: #f2787e; font-weight: 400; }
.welcome > p:last-child { color: #c5b0b1; font-size: 13px; margin-top: 23px; line-height: 1.7; }
.chat-log { display: grid; gap: 16px; margin: 36px 0 14px; }
.chat-log:empty { display: none; }
.welcome.is-compact { padding-top: 0; }
.welcome.is-compact h1 { font-size: 27px; }
.welcome.is-compact > p:last-child { display: none; }
.message { max-width: min(760px, 100%); border: 1px solid var(--line); border-radius: 12px; padding: 15px 18px; background: rgba(19, 10, 12, .78); white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.65; font-size: 14px; }
.message.user { margin-left: auto; background: rgba(112, 28, 38, .48); border-color: rgba(238, 88, 98, .3); }
.message-label { display: block; color: #f07b81; font-size: 9px; letter-spacing: .17em; font-weight: 700; margin-bottom: 7px; }
.message.user .message-label { color: #ffd1d1; }
.composer { position: relative; width: min(940px, calc(100% - 40px)); margin: 0 auto; border: 1px solid rgba(241, 150, 153, .35); background: rgba(20, 10, 12, .88); border-radius: 14px; box-shadow: 0 16px 50px rgba(0,0,0,.24); }
.composer textarea { display: block; width: 100%; resize: vertical; min-height: 60px; max-height: 180px; padding: 19px 132px 13px 20px; color: var(--ink); background: transparent; outline: 0; border: 0; }
.composer textarea::placeholder { color: #a48f91; }
.composer-actions { position: absolute; right: 9px; top: 9px; display: flex; gap: 7px; align-items: center; }
.icon-button, .send-button, .download-button { cursor: pointer; border: 0; }
.icon-button { padding: 10px; background: transparent; color: #d3bfc0; font-size: 9px; letter-spacing: .1em; }
.icon-button.is-listening { color: white; background: #a82433; border-radius: 8px; animation: pulse 1.2s infinite; }
.send-button { border-radius: 8px; padding: 12px 17px; color: white; font-size: 10px; font-weight: 700; letter-spacing: .12em; background: linear-gradient(135deg, #d33f4a, #9e1d2c); }
.send-button:hover, .download-button:hover { filter: brightness(1.13); }
.send-button:disabled { opacity: .55; cursor: wait; }
.composer-note { color: #907f81; font-size: 9px; padding: 0 20px 11px; }
.control-dock { position: fixed; z-index: 4; right: clamp(14px, 3vw, 42px); bottom: max(18px, env(safe-area-inset-bottom)); display: flex; gap: 8px; }
.dock-button { cursor: pointer; display: flex; gap: 8px; align-items: center; border: 1px solid rgba(255, 228, 228, .2); border-radius: 9px; padding: 12px 15px; background: rgba(20, 8, 11, .86); color: #ead9da; font-size: 9px; letter-spacing: .11em; backdrop-filter: blur(12px); }
.dock-button span { color: #f06c74; font-size: 14px; }
.dock-button:hover { background: #47151d; border-color: rgba(240,82,92,.6); }
.side-panel { position: fixed; z-index: 7; top: 0; right: 0; height: 100dvh; width: min(430px, 100vw); overflow-y: auto; padding: 30px 26px max(34px, env(safe-area-inset-bottom)); background: var(--panel); border-left: 1px solid rgba(240, 82, 92, .23); box-shadow: -25px 0 70px rgba(0,0,0,.35); transform: translateX(105%); transition: transform .24s ease; visibility: hidden; }
.side-panel.open { transform: translateX(0); visibility: visible; }
.panel-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.panel-heading .eyebrow { margin-bottom: 7px; }
.panel-heading h2 { font-family: Georgia, serif; font-size: 29px; font-weight: 400; margin: 0; }
.close-panel { border: 1px solid var(--line); background: transparent; color: #e8cfd0; border-radius: 8px; width: 36px; height: 36px; font-size: 22px; cursor: pointer; }
.panel-copy, .small-note { color: var(--muted); font-size: 12px; line-height: 1.6; }
.panel-copy { margin: 0 0 22px; }
.small-note { font-size: 10px; margin-top: 20px; }
.field-label { display: block; color: #bda8aa; font-size: 9px; letter-spacing: .16em; margin: 17px 0 7px; }
.text-field { width: 100%; border: 1px solid rgba(250,220,220,.2); border-radius: 8px; outline: none; padding: 12px; color: var(--ink); background: rgba(255,255,255,.045); }
.text-field:focus, .composer:focus-within { border-color: rgba(240,82,92,.8); }
.provider-list { display: grid; gap: 11px; margin-top: 19px; }
.provider-card { border: 1px solid var(--line); border-radius: 10px; padding: 12px; background: rgba(255,255,255,.025); }
.provider-row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
.provider-name { font-size: 12px; font-weight: 650; }
.provider-model { display: block; color: #9c898b; font-size: 9px; margin-top: 4px; }
.toggle { accent-color: var(--red-bright); width: 17px; height: 17px; }
.provider-key { margin-top: 10px; font-size: 11px; }
.data-stats { display: flex; align-items: center; justify-content: space-between; padding: 12px 0; border-block: 1px solid var(--line); color: #c9b6b7; font-size: 11px; }
.data-stats strong { color: var(--ink); }
.source-list { display: grid; gap: 7px; margin: 14px 0; }
.source-item { color: #d8c8c9; font-size: 11px; display: flex; justify-content: space-between; gap: 8px; }
.source-item span:last-child { color: #9c898b; }
.upload-button { display: block; cursor: pointer; text-align: center; padding: 13px; border: 1px dashed rgba(240,82,92,.6); border-radius: 9px; color: #ff9a9f; font-size: 11px; }
.module-grid { display: grid; gap: 8px; }
.module-button { cursor: pointer; text-align: left; color: #f1e4e5; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,.03); padding: 12px; font-size: 11px; }
.module-button:hover { border-color: rgba(240,82,92,.7); background: rgba(141,32,45,.22); }
.module-button span { display: block; color: #9f8c8d; font-size: 9px; margin-top: 4px; }
.download-button { width: 100%; margin-top: 17px; border-radius: 8px; padding: 13px; color: #fff; background: #982635; font-size: 9px; letter-spacing: .13em; }
.download-button:disabled { opacity: .42; cursor: not-allowed; }
.panel-scrim { position: fixed; z-index: 6; inset: 0; border: 0; background: rgba(0,0,0,.3); opacity: 0; visibility: hidden; transition: opacity .2s; }
.panel-scrim.visible { opacity: 1; visibility: visible; }
.lock-screen { position: fixed; z-index: 20; inset: 0; display: grid; place-items: center; padding: 24px; background: radial-gradient(ellipse at 50% 30%, #45131b, #1a090d 55%, #0c0708); }
.lock-card { width: min(390px, 100%); text-align: center; }
.lock-emblem { margin: 0 auto 28px; width: 54px; height: 54px; font-size: 30px; border-radius: 18px 4px 18px 4px; }
.lock-card h1 { font: 400 36px Georgia, serif; margin: 0 0 11px; }
.lock-card > p:not(.eyebrow):not(.small-note):not(.form-error) { color: #c2aaac; font-size: 12px; line-height: 1.6; margin: 0 0 22px; }
.lock-card form { display: grid; gap: 10px; }
.lock-submit { width: 100%; padding: 14px; margin-top: 4px; }
.form-error { color: #ff858a; min-height: 16px; font-size: 11px; }
.creator-dialog { width: min(420px, calc(100% - 28px)); color: var(--ink); border: 1px solid rgba(240,82,92,.4); border-radius: 13px; padding: 24px; background: #1b0c10; box-shadow: 0 24px 80px #000; }
.creator-dialog::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(4px); }
.creator-dialog h2 { font: 400 26px Georgia, serif; margin: 0 0 8px; }
.creator-dialog p:not(.eyebrow):not(.form-error) { color: #c2aaac; font-size: 12px; line-height: 1.6; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 10px; }
.text-button { cursor: pointer; border: 0; background: transparent; color: #c7b4b5; font-size: 9px; letter-spacing: .1em; }
.toast { position: fixed; z-index: 30; bottom: 86px; left: 50%; transform: translate(-50%, 12px); opacity: 0; visibility: hidden; border: 1px solid var(--line); border-radius: 8px; padding: 11px 15px; background: #210e12; color: #f3dedf; font-size: 11px; transition: .2s; max-width: calc(100% - 30px); }
.toast.show { transform: translate(-50%, 0); opacity: 1; visibility: visible; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
code { color: #ffa0a5; }
@keyframes pulse { 50% { box-shadow: 0 0 0 6px rgba(200,46,60,.18); } }
@media (max-width: 640px) {
  .topbar { height: 68px; padding: 0 18px; }
  .topbar-status { font-size: 8px; }
  .workspace { min-height: calc(100dvh - 240px); padding-top: 12vh; }
  .composer { margin-bottom: 78px; }
  .composer textarea { padding-right: 95px; }
  .composer-actions { gap: 0; }
  .icon-button { padding: 10px 7px; }
  .send-button { padding: 12px; }
  .control-dock { right: 10px; left: 10px; bottom: max(10px, env(safe-area-inset-bottom)); justify-content: center; gap: 5px; }
  .dock-button { flex: 1; justify-content: center; padding: 11px 5px; gap: 5px; font-size: 8px; white-space: nowrap; }
  .dock-button span { font-size: 12px; }
  .toast { bottom: 78px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; } }
