:root {
  color: #213547;
  background: #f8fafc;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  --blue: #2563eb;
  --blue-soft: #eff6ff;
  --ink: #17233b;
  --muted: #6b7a90;
  --line: rgba(148, 163, 184, 0.22);
  --glass: rgba(255, 255, 255, 0.72);
  --shadow: 0 24px 70px rgba(62, 86, 118, 0.12), 0 4px 14px rgba(62, 86, 118, 0.06);
}

* { box-sizing: border-box; }

html, body { margin: 0; min-width: 320px; min-height: 100%; }

body {
  min-height: 100vh;
  overflow-x: hidden;
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
.visually-hidden { display: none !important; }

.ambient {
  position: fixed;
  inset: 0;
  z-index: -2;
  overflow: hidden;
  background:
    radial-gradient(60% 60% at 20% 15%, rgba(96, 165, 250, 0.19), transparent 62%),
    radial-gradient(50% 55% at 84% 24%, rgba(129, 140, 248, 0.14), transparent 66%),
    radial-gradient(55% 60% at 16% 88%, rgba(45, 212, 191, 0.13), transparent 66%),
    linear-gradient(180deg, rgba(248, 250, 252, 0.96), rgba(255, 255, 255, 0.9));
}

.ambient::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.18;
  background-image: radial-gradient(rgba(37, 99, 235, 0.28) 0.55px, transparent 0.55px);
  background-size: 18px 18px;
  mask-image: linear-gradient(to bottom, black, transparent 65%);
}

.ambient-blob { position: absolute; border-radius: 50%; filter: blur(90px); opacity: 0.18; }
.blob-blue { width: 34vw; height: 34vw; left: -10vw; top: 5vh; background: #60a5fa; }
.blob-indigo { width: 30vw; height: 30vw; right: -8vw; top: 18vh; background: #818cf8; }
.blob-teal { width: 36vw; height: 36vw; left: 26vw; bottom: -24vw; background: #2dd4bf; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  padding-top: env(safe-area-inset-top);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.75);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.05);
}

.header-inner { max-width: 1440px; height: 72px; margin: 0 auto; padding: 0 26px; display: flex; align-items: center; justify-content: space-between; }
.brand { color: var(--ink); display: inline-flex; align-items: center; gap: 11px; text-decoration: none; }
.brand-mark { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: rgba(219, 234, 254, 0.9); box-shadow: 0 6px 20px rgba(37, 99, 235, 0.14); }
.brand-mark svg { width: 23px; height: 23px; transform: rotate(-20deg); transition: transform 260ms ease; }
.brand:hover .brand-mark svg { transform: rotate(-34deg); }
.brand-mark path { fill: none; stroke: currentColor; stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-copy { display: flex; flex-direction: column; line-height: 1; gap: 5px; }
.brand-copy strong { font-size: 18px; letter-spacing: -0.035em; }
.brand-copy small { color: #718198; font-size: 9px; font-weight: 800; letter-spacing: 0.18em; }
.header-actions { display: flex; align-items: center; gap: 12px; }
.service-pill { display: inline-flex; align-items: center; gap: 8px; min-height: 34px; padding: 0 13px; border-radius: 999px; color: #526177; background: rgba(248, 250, 252, 0.86); border: 1px solid var(--line); font-size: 12px; font-weight: 700; }
.service-pill i, .conversation-state i { width: 7px; height: 7px; border-radius: 50%; background: #f59e0b; box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.11); }
.service-pill.online i, .conversation-state i { background: #10b981; box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.11); }
.service-pill.offline i { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1); }

.ghost-button, .mobile-sidebar-button { border: 1px solid var(--line); background: rgba(255,255,255,.72); color: #596980; border-radius: 9px; padding: 8px 13px; font-size: 13px; font-weight: 700; box-shadow: 0 2px 8px rgba(15,23,42,.04); }
.ghost-button:hover, .mobile-sidebar-button:hover { color: var(--blue); border-color: rgba(37,99,235,.2); transform: translateY(-1px); }

main { position: relative; }
.is-hidden { display: none !important; }
.glass-panel { background: var(--glass); border: 1px solid rgba(255,255,255,.76); backdrop-filter: blur(22px); box-shadow: var(--shadow); }
.eyebrow { color: #6680a6; font-size: 10px; font-weight: 850; letter-spacing: .17em; }

.login-view { width: min(1180px, calc(100% - 40px)); min-height: calc(100vh - 72px); margin: 0 auto; padding: 80px 0 110px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(340px, .75fr); gap: clamp(52px, 8vw, 112px); align-items: center; }
.login-copy { padding-left: 16px; }
.login-copy h1 { margin: 19px 0 24px; color: var(--ink); font-size: clamp(44px, 5.6vw, 76px); line-height: 1.08; letter-spacing: -.06em; }
.login-copy h1 em { color: var(--blue); font-style: normal; position: relative; }
.login-copy h1 em::after { content: ""; position: absolute; left: 2px; right: -4px; bottom: -6px; height: 9px; opacity: .4; border-radius: 999px; background: linear-gradient(90deg, #60a5fa, #2dd4bf); transform: rotate(-1.5deg); }
.login-copy > p { max-width: 590px; margin: 0; color: var(--muted); font-size: 17px; line-height: 1.85; }
.isolation-row { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 10px; }
.isolation-row span { padding: 9px 13px; color: #45617f; border: 1px solid rgba(147, 197, 253, .38); border-radius: 10px; background: rgba(255,255,255,.58); font-size: 12px; font-weight: 750; box-shadow: 0 4px 14px rgba(59,130,246,.05); }

.login-card { border-radius: 28px; padding: 38px; }
.card-kicker { display: inline-block; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 7px 10px; font-size: 10px; font-weight: 850; letter-spacing: .12em; }
.login-card h2 { margin: 18px 0 6px; color: var(--ink); font-size: 28px; letter-spacing: -.035em; }
.login-card > p { margin: 0 0 26px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; margin-top: 17px; }
.login-card label span, .select-label { display: block; margin-bottom: 8px; color: #526177; font-size: 12px; font-weight: 750; }
.login-card input, .control-panel select { width: 100%; min-height: 48px; color: var(--ink); background: rgba(248,250,252,.82); border: 1px solid rgba(203,213,225,.64); border-radius: 12px; outline: none; padding: 0 14px; transition: border-color 180ms, box-shadow 180ms, background 180ms; }
.login-card input:focus, .control-panel select:focus, .composer textarea:focus { background: rgba(255,255,255,.96); border-color: rgba(37,99,235,.44); box-shadow: 0 0 0 4px rgba(37,99,235,.08); }
.form-error { min-height: 20px; margin: 10px 0 0 !important; color: #dc2626 !important; font-size: 12px !important; }
.primary-button { border: 0; color: white; background: linear-gradient(135deg, #2563eb, #3976ee); box-shadow: 0 12px 28px rgba(37,99,235,.24); }
.login-submit { width: 100%; min-height: 50px; margin-top: 5px; padding: 0 17px; border-radius: 12px; display: flex; justify-content: center; align-items: center; gap: 8px; font-weight: 800; }
.login-submit svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(37,99,235,.28); }
.primary-button:disabled { opacity: .6; cursor: wait; transform: none; }
.trust-note { margin-top: 20px; text-align: center; color: #8a97aa; font-size: 11px; }
.trust-note span { color: #10b981; }

.workspace { width: min(1460px, calc(100% - 32px)); height: calc(100vh - 96px); min-height: 640px; margin: 12px auto; display: grid; grid-template-columns: 264px minmax(460px, 1fr) 286px; gap: 12px; }
.workspace > .glass-panel { border-radius: 22px; min-height: 0; }
.session-panel, .control-panel { overflow: hidden; }
.session-panel { padding: 18px 14px 14px; display: flex; flex-direction: column; }
.panel-heading { padding: 4px 6px 14px; display: flex; justify-content: space-between; align-items: center; }
.panel-heading h2, .control-section h2 { margin: 5px 0 0; color: var(--ink); font-size: 17px; letter-spacing: -.02em; }
.icon-button { width: 36px; height: 36px; padding: 0; display: grid; place-items: center; border: 0; border-radius: 10px; color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.icon-button:hover { transform: translateY(-2px) rotate(3deg); }
.icon-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.session-list { min-height: 0; flex: 1; overflow-y: auto; padding: 4px 2px 14px; scrollbar-width: thin; scrollbar-color: rgba(148,163,184,.35) transparent; }
.session-item { width: 100%; margin: 3px 0; padding: 12px; border: 1px solid transparent; border-radius: 12px; background: transparent; color: #43536a; text-align: left; transition: .18s ease; }
.session-item:hover { background: rgba(255,255,255,.65); border-color: rgba(226,232,240,.7); transform: translateX(2px); }
.session-item.active { color: #1d4ed8; background: rgba(239,246,255,.92); border-color: rgba(147,197,253,.38); box-shadow: inset 3px 0 #3b82f6; }
.session-item strong { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: 13px; }
.session-item span { display: block; margin-top: 5px; color: #94a3b8; font-size: 10px; }
.session-empty { margin: 24px 12px; color: #94a3b8; font-size: 12px; line-height: 1.6; }
.skeleton-row { height: 54px; margin: 5px 2px; border-radius: 12px; background: linear-gradient(90deg, rgba(226,232,240,.42), rgba(255,255,255,.8), rgba(226,232,240,.42)); background-size: 200% 100%; animation: shimmer 1.3s infinite; }
.skeleton-row.short { width: 76%; }
.sidebar-foot { padding: 13px 7px 4px; display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.avatar { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: white; background: linear-gradient(145deg,#3b82f6,#6366f1); font-size: 12px; font-weight: 900; box-shadow: 0 6px 14px rgba(59,130,246,.22); }
.sidebar-foot div { min-width: 0; }
.sidebar-foot strong, .sidebar-foot small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sidebar-foot strong { color: var(--ink); font-size: 12px; }
.sidebar-foot small { margin-top: 3px; color: #94a3b8; font-size: 9px; }

.chat-panel { display: flex; flex-direction: column; overflow: hidden; }
.chat-heading { min-height: 76px; padding: 16px 22px; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.chat-heading h1 { max-width: 620px; margin: 5px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); font-size: 19px; letter-spacing: -.03em; }
.conversation-state { display: flex; align-items: center; gap: 8px; color: #728399; font-size: 9px; font-weight: 850; letter-spacing: .14em; }
.mobile-sidebar-button { display: none; }
.messages { min-height: 0; flex: 1; overflow-y: auto; padding: 26px clamp(20px, 5vw, 72px); scroll-behavior: smooth; }
.empty-state { min-height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 28px 0 44px; }
.orbit-mark { width: 76px; height: 76px; margin-bottom: 24px; border-radius: 50%; display: grid; place-items: center; position: relative; color: var(--blue); background: rgba(239,246,255,.8); border: 1px solid rgba(147,197,253,.4); }
.orbit-mark::before, .orbit-mark::after { content: ""; position: absolute; inset: -9px; border: 1px dashed rgba(59,130,246,.24); border-radius: 50%; animation: spin 18s linear infinite; }
.orbit-mark::after { inset: 9px -15px; border-style: solid; border-color: rgba(45,212,191,.22); animation-direction: reverse; animation-duration: 12s; }
.orbit-mark span { font-weight: 900; font-size: 23px; }
.empty-state h2 { margin: 11px 0 9px; color: var(--ink); font-size: 28px; letter-spacing: -.045em; }
.empty-state > p { max-width: 500px; margin: 0; color: var(--muted); font-size: 14px; line-height: 1.7; }
.prompt-grid { width: min(680px, 100%); margin-top: 28px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.prompt-grid button { min-height: 70px; padding: 13px; border: 1px solid rgba(203,213,225,.54); border-radius: 13px; color: #53657c; background: rgba(255,255,255,.58); font-size: 12px; line-height: 1.5; box-shadow: 0 4px 12px rgba(15,23,42,.035); }
.prompt-grid button:hover { color: var(--blue); border-color: rgba(96,165,250,.42); background: rgba(239,246,255,.8); transform: translateY(-2px); }
.message { margin: 0 auto 20px; max-width: 820px; animation: message-in .28s ease both; }
.message-label { margin-bottom: 7px; display: flex; align-items: center; gap: 8px; color: #8593a5; font-size: 9px; font-weight: 850; letter-spacing: .13em; }
.message-label i { width: 22px; height: 22px; border-radius: 8px; display: grid; place-items: center; color: white; background: #3b82f6; font-style: normal; font-size: 9px; letter-spacing: 0; }
.message.user .message-label { justify-content: flex-end; }
.message.user .message-label i { background: #64748b; }
.message-content { padding: 16px 18px; border-radius: 15px; color: #34445a; background: rgba(255,255,255,.72); border: 1px solid rgba(226,232,240,.72); font-size: 14px; line-height: 1.75; overflow-wrap: anywhere; box-shadow: 0 5px 18px rgba(15,23,42,.04); }
.message.user .message-content { margin-left: auto; width: fit-content; max-width: 85%; color: white; background: linear-gradient(145deg,#3b82f6,#2563eb); border-color: transparent; box-shadow: 0 10px 24px rgba(37,99,235,.18); }
.message-content p { margin: 0 0 10px; }
.message-content p:last-child { margin-bottom: 0; }
.message-content code { padding: 2px 5px; border-radius: 5px; color: #1d4ed8; background: rgba(219,234,254,.62); font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .91em; }
.message-content pre { overflow-x: auto; margin: 12px 0; padding: 14px; border-radius: 11px; color: #e2e8f0; background: #172033; }
.message-content pre code { padding: 0; color: inherit; background: none; }
.message.streaming .message-content::after { content: ""; display: inline-block; width: 7px; height: 14px; margin-left: 4px; vertical-align: -2px; border-radius: 2px; background: #3b82f6; animation: blink .8s infinite; }
.tool-event { margin: 8px 0; padding: 8px 10px; border-left: 2px solid #93c5fd; color: #718096; background: rgba(239,246,255,.55); font-size: 11px; }
.message-assets { max-width: 820px; margin-top: 9px; display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.message.user .message-assets { width: min(620px, 92%); margin-left: auto; }
.asset-card { min-width: 0; padding: 10px 11px; display: flex; align-items: center; gap: 10px; color: #43536a; background: rgba(255,255,255,.82); border: 1px solid rgba(203,213,225,.56); border-radius: 12px; box-shadow: 0 5px 16px rgba(15,23,42,.045); }
.asset-card.artifact { border-color: rgba(147,197,253,.48); background: linear-gradient(135deg,rgba(255,255,255,.94),rgba(239,246,255,.82)); }
.asset-icon { width: 35px; height: 39px; flex: 0 0 auto; border-radius: 8px 8px 10px 10px; display: grid; place-items: center; position: relative; color: #2563eb; background: #e8f1ff; font-size: 8px; font-weight: 900; letter-spacing: .04em; }
.asset-icon::after { content: ""; position: absolute; right: 0; top: 0; border-style: solid; border-width: 0 0 8px 8px; border-color: transparent transparent rgba(147,197,253,.7) transparent; }
.asset-copy { min-width: 0; flex: 1; }
.asset-copy strong, .asset-copy span { display: block; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.asset-copy strong { color: #334155; font-size: 11px; }
.asset-copy span { margin-top: 4px; color: #8794a6; font-size: 9px; }
.asset-actions { display: flex; align-items: center; gap: 5px; }
.asset-action { min-height: 28px; padding: 0 8px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid rgba(148,163,184,.26); border-radius: 8px; color: #5b6c82; background: rgba(255,255,255,.75); text-decoration: none; font-size: 9px; font-weight: 800; }
.asset-action:hover { color: #1d4ed8; border-color: rgba(59,130,246,.28); transform: translateY(-1px); }

.composer { margin: 0 clamp(14px, 3vw, 42px) 18px; padding: 13px 14px 10px; border-radius: 17px; background: rgba(255,255,255,.84); border: 1px solid rgba(191,219,254,.72); box-shadow: 0 15px 36px rgba(59,130,246,.1); transition: box-shadow .18s, border-color .18s; }
.composer:focus-within { border-color: rgba(59,130,246,.5); box-shadow: 0 16px 42px rgba(59,130,246,.15), 0 0 0 4px rgba(59,130,246,.05); }
.composer.dragging { border-color: #2f72ed; background: rgba(239,246,255,.94); box-shadow: 0 0 0 5px rgba(59,130,246,.1), 0 18px 42px rgba(59,130,246,.16); }
.pending-files { display: none; margin: -2px 0 10px; flex-wrap: wrap; gap: 7px; }
.pending-files.has-files { display: flex; }
.pending-file { max-width: min(100%, 310px); min-height: 35px; padding: 6px 7px 6px 10px; display: flex; align-items: center; gap: 8px; position: relative; overflow: hidden; border: 1px solid rgba(147,197,253,.44); border-radius: 10px; color: #4b6079; background: rgba(239,246,255,.78); }
.pending-file.uploading { border-style: dashed; }
.pending-file-copy { min-width: 0; flex: 1; position: relative; z-index: 1; }
.pending-file-copy strong, .pending-file-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pending-file-copy strong { font-size: 10px; }
.pending-file-copy span { margin-top: 2px; color: #8291a5; font-size: 8px; }
.pending-progress { position: absolute; z-index: 0; inset: auto 0 0; height: 2px; background: linear-gradient(90deg,#3b82f6,#2dd4bf); transform-origin: left; }
.pending-remove { width: 23px; height: 23px; flex: 0 0 auto; position: relative; z-index: 1; display: grid; place-items: center; border: 0; border-radius: 7px; color: #7e8da1; background: rgba(255,255,255,.74); font-size: 14px; }
.pending-remove:hover { color: #dc2626; background: white; }
.composer textarea { display: block; width: 100%; max-height: 180px; resize: none; overflow-y: hidden; padding: 3px 3px 10px; color: var(--ink); background: transparent; border: 0; outline: none; font-size: 14px; line-height: 1.6; }
.composer textarea::placeholder { color: #a1adbd; }
.composer-bar { display: flex; align-items: center; justify-content: space-between; }
.composer-left { min-width: 0; display: flex; align-items: center; gap: 9px; }
.attach-button { width: 32px; height: 32px; flex: 0 0 auto; padding: 0; display: grid; place-items: center; border: 1px solid rgba(148,163,184,.25); border-radius: 9px; color: #66788f; background: rgba(248,250,252,.72); }
.attach-button:hover { color: var(--blue); border-color: rgba(59,130,246,.3); background: rgba(239,246,255,.92); transform: translateY(-1px); }
.attach-button:disabled { opacity: .45; cursor: wait; transform: none; }
.attach-button svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.composer-meta { min-width: 0; display: flex; align-items: center; gap: 8px; color: #7b899d; font-size: 10px; }
.composer-meta span { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta-separator { width: 3px; height: 3px; flex: 0 0 auto; border-radius: 50%; background: #cbd5e1; }
.send-button { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 11px; display: grid; place-items: center; color: white; background: var(--blue); box-shadow: 0 8px 18px rgba(37,99,235,.22); }
.send-button:hover { transform: translateY(-2px); }
.send-button:disabled { opacity: .5; cursor: wait; transform: none; }
.send-button svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.control-panel { padding: 17px; overflow-y: auto; }
.control-section { padding: 5px 3px 20px; }
.control-section + .control-section { padding-top: 20px; border-top: 1px solid var(--line); }
.section-heading { display: flex; align-items: center; justify-content: space-between; }
.section-heading > span:last-child, .live-dot { color: #2563eb; background: rgba(219,234,254,.68); border-radius: 999px; padding: 4px 7px; font-size: 8px; font-weight: 850; }
.live-dot { color: #059669; background: rgba(209,250,229,.72); }
.select-label { margin-top: 17px; }
.control-panel select { min-height: 43px; padding-right: 30px; font-size: 12px; }
.field-hint { margin: 10px 2px 0; color: #8c99aa; font-size: 10px; line-height: 1.55; }
.skill-list { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 7px; }
.skill-chip { max-width: 100%; padding: 7px 9px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #50637b; background: rgba(248,250,252,.78); border: 1px solid rgba(203,213,225,.54); border-radius: 9px; font-size: 10px; font-weight: 700; }
.muted { color: #94a3b8; font-size: 11px; }
.profile-proof { margin-top: 2px; padding: 13px; display: flex; gap: 10px; color: #3f5e78; background: linear-gradient(135deg,rgba(239,246,255,.9),rgba(240,253,250,.72)); border: 1px solid rgba(147,197,253,.32); border-radius: 13px; }
.profile-proof svg { width: 22px; height: 22px; flex: 0 0 auto; fill: none; stroke: #2563eb; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.profile-proof strong, .profile-proof span { display: block; }
.profile-proof strong { font-size: 11px; }
.profile-proof span { margin-top: 4px; color: #7b8a9c; font-size: 9px; line-height: 1.45; }
.profile-proof code { color: #1d4ed8; font-weight: 800; }

.preview-dialog { width: min(1080px, calc(100% - 34px)); height: min(780px, calc(100vh - 50px)); padding: 0; overflow: hidden; border: 1px solid rgba(255,255,255,.84); border-radius: 22px; background: rgba(248,250,252,.96); box-shadow: 0 36px 100px rgba(15,23,42,.28); }
.preview-dialog::backdrop { background: rgba(21,34,56,.38); backdrop-filter: blur(9px); }
.preview-shell { height: 100%; display: flex; flex-direction: column; }
.preview-heading { min-height: 72px; padding: 13px 16px 13px 22px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid rgba(203,213,225,.58); background: rgba(255,255,255,.82); }
.preview-heading h2 { max-width: min(62vw, 680px); margin: 4px 0 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--ink); font-size: 16px; }
.preview-actions { display: flex; align-items: center; gap: 8px; }
.preview-download { text-decoration: none; }
.preview-body { min-height: 0; flex: 1; overflow: auto; display: grid; place-items: center; padding: 20px; background: radial-gradient(circle at 50% 0,rgba(219,234,254,.44),transparent 52%),#eef3f8; }
.preview-body img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 10px; box-shadow: 0 12px 38px rgba(15,23,42,.15); }
.preview-body iframe { width: 100%; height: 100%; border: 0; border-radius: 10px; background: white; box-shadow: 0 12px 38px rgba(15,23,42,.12); }
.preview-body pre { align-self: stretch; justify-self: stretch; min-height: 100%; margin: 0; padding: 20px; overflow: auto; border-radius: 12px; color: #dbeafe; background: #172033; font: 12px/1.7 ui-monospace,SFMono-Regular,Menlo,monospace; white-space: pre-wrap; overflow-wrap: anywhere; }
.preview-body audio, .preview-body video { max-width: 100%; max-height: 100%; }
.preview-loading { color: #718198; font-size: 12px; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: 26px; max-width: min(440px, calc(100% - 32px)); padding: 11px 16px; border-radius: 11px; color: white; background: rgba(30,41,59,.93); box-shadow: 0 14px 36px rgba(15,23,42,.24); font-size: 12px; transform: translate(-50%, 30px); opacity: 0; pointer-events: none; transition: .24s ease; }
.toast.visible { transform: translate(-50%, 0); opacity: 1; }

@keyframes shimmer { to { background-position: -200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes blink { 50% { opacity: 0; } }
@keyframes message-in { from { opacity: 0; transform: translateY(8px); } }

@media (max-width: 1120px) {
  .workspace { grid-template-columns: 238px minmax(0, 1fr); }
  .control-panel { display: none; }
}

@media (max-width: 760px) {
  .header-inner { height: 64px; padding: 0 16px; }
  .brand-copy strong { font-size: 16px; }
  .brand-copy small { display: none; }
  .service-pill span { display: none; }
  .service-pill { width: 34px; padding: 0; justify-content: center; }
  .login-view { min-height: calc(100vh - 64px); padding: 42px 0 70px; grid-template-columns: 1fr; gap: 34px; }
  .login-copy { padding: 0 5px; text-align: center; }
  .login-copy h1 { font-size: clamp(38px, 11vw, 55px); }
  .login-copy > p { font-size: 14px; }
  .isolation-row { justify-content: center; }
  .login-card { padding: 28px 23px; border-radius: 23px; }
  .workspace { width: calc(100% - 16px); height: calc(100vh - 80px); min-height: 560px; margin: 8px auto; display: block; }
  .session-panel { display: none; position: fixed; z-index: 80; inset: 76px 8px 8px; }
  .workspace.sidebar-open .session-panel { display: flex; }
  .chat-panel { height: 100%; border-radius: 18px !important; }
  .chat-heading { min-height: 67px; padding: 12px 15px; }
  .chat-heading h1 { max-width: 210px; font-size: 16px; }
  .mobile-sidebar-button { display: block; }
  .messages { padding: 18px 14px; }
  .prompt-grid { grid-template-columns: 1fr; }
  .prompt-grid button { min-height: 50px; }
  .empty-state h2 { font-size: 24px; }
  .message.user .message-content { max-width: 92%; }
  .message-assets, .message.user .message-assets { width: 100%; max-width: 100%; grid-template-columns: 1fr; }
  .asset-card { padding: 9px; }
  .composer { margin: 0 8px 8px; }
  .composer-meta span:first-child, .composer-meta .meta-separator { display: none; }
  .preview-dialog { width: calc(100% - 12px); height: calc(100vh - 20px); border-radius: 17px; }
  .preview-heading { min-height: 64px; padding: 11px 10px 11px 15px; }
  .preview-heading h2 { max-width: 45vw; }
  .preview-download { padding: 7px 9px; font-size: 10px; }
  .preview-body { padding: 8px; }
}

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