:root {
  --bg: #07080a;
  --panel: #111419;
  --panel-strong: #171a21;
  --line: #292d36;
  --text: #f7f8fa;
  --muted: #9da3af;
  --accent: #ff3152;
  --accent-soft: #ff7186;
  --danger: #ff8999;
}

* { box-sizing: border-box; }
html { min-width: 280px; background: var(--bg); }
body {
  margin: 0;
  min-width: 280px;
  overflow-x: hidden;
  background: radial-gradient(circle at 82% -8%, #310d18 0, transparent 34%), radial-gradient(circle at 8% 42%, #170810 0, transparent 30%), var(--bg);
  color: var(--text);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea { font: inherit; }
button { min-height: 44px; border: 0; color: inherit; cursor: pointer; }
button:focus-visible, input:focus-visible, textarea:focus-visible, a:focus-visible { outline: 3px solid var(--accent-soft); outline-offset: 3px; }

#app { min-height: 100vh; max-width: 1120px; margin: auto; padding-bottom: 82px; }
.topbar { height: 72px; display: flex; align-items: center; justify-content: space-between; padding: 0 20px; border-bottom: 1px solid rgba(255,255,255,.07); }
.brand { display: flex; align-items: center; gap: 9px; color: var(--text); text-decoration: none; font-size: 19px; letter-spacing: -.04em; }
.brand img { width: 29px; height: 29px; border-radius: 9px; object-fit: cover; }
.icon-btn, .avatar, .back { width: 44px; height: 44px; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; color: #bdc4d0; }
.avatar { background: #fff; color: #09090b; font-weight: 800; border: 0; }

.auth-view { position: relative; min-height: calc(100vh - 154px); display: flex; align-items: center; justify-content: center; flex-direction: column; overflow: hidden; padding: 30px 24px; text-align: center; }
.auth-view:before, .auth-view:after { content: ''; position: absolute; border-radius: 50%; filter: blur(2px); pointer-events: none; opacity: .25; }
.auth-view:before { width: 240px; height: 240px; background: #e90032; top: 115px; left: -150px; animation: orb 7s ease-in-out infinite; }
.auth-view:after { width: 190px; height: 190px; background: #710018; right: -110px; bottom: 155px; animation: orb 9s ease-in-out infinite reverse; }
@keyframes orb { 50% { transform: translate(35px,-25px) scale(1.18); opacity: .45; } }
.hero-mark { width: 82px; height: 82px; padding: 5px; margin-bottom: 26px; background: linear-gradient(140deg, #ff173e, #6f001c); border-radius: 25px; box-shadow: 0 0 0 1px var(--accent), 0 0 28px #ff163f88; animation: logoPulse 2.8s ease-in-out infinite; }
.hero-mark img { width: 100%; height: 100%; object-fit: cover; border-radius: 20px; }
@keyframes logoPulse { 50% { transform: translateY(-5px) scale(1.04); box-shadow: 0 0 0 2px var(--accent), 0 0 45px #ff163faa; } }
.eyebrow { margin: 0 0 8px; color: var(--accent); text-transform: uppercase; font-size: 15px; font-weight: 800; letter-spacing: .12em; line-height: 1.2; }
.auth-view .eyebrow { margin-bottom: 16px; white-space: nowrap; text-shadow: 0 0 14px #ff304f; }
h1, h2 { letter-spacing: -.05em; }
.auth-view h1 { margin: 0 0 14px; font-size: clamp(32px, 8.6vw, 62px); line-height: 1.08; text-shadow: 0 0 22px #ff183d55; }
.hero-copy { max-width: 350px; font-size: 16px; }
.muted { color: var(--muted); }
.tiny { margin-top: 20px; color: #687181; font-size: 11px; }
.primary { min-height: 48px; padding: 13px 17px; background: #fff; color: #09090b; border-radius: 12px; font-weight: 800; box-shadow: 0 8px 24px #ffffff20; transition: transform .2s ease, background .2s ease; }
.primary:hover { background: #eceef2; transform: translateY(-1px); }
.primary span { margin-left: 22px; }
.wide { width: 100%; max-width: 350px; margin-top: 25px; }
.demo-btn { display: block; width: 100%; max-width: 350px; min-height: 46px; margin: 12px auto 0; padding: 10px 16px; background: transparent; border: 1px solid #ff2148; border-radius: 12px; color: #ff6b82; font-size: 14px; font-weight: 700; }
.demo-btn:hover { background: #ff214814; color: #fff; }
.small { min-height: 44px; padding: 10px 13px; font-size: 15px; }

.page-head, .workspace-head { display: flex; align-items: center; justify-content: space-between; padding: 32px 20px 22px; }
.page-head h1, .workspace-head h1 { margin: 0; font-size: 25px; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 20px 30px; }
.stats div { padding: 14px 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.stats strong, .stats span { display: block; }
.stats strong { font-size: 21px; }
.stats span { margin-top: 3px; color: var(--muted); font-size: 12px; }
.online-dot { color: var(--accent); }
.section-title { display: flex; align-items: center; justify-content: space-between; padding: 0 20px 13px; }
.section-title h2 { margin: 0; font-size: 18px; }
.ghost, .link-btn { background: none; color: var(--muted); font-size: 14px; }
.project-list { display: grid; gap: 10px; padding: 0 20px; }
.project { display: flex; align-items: center; gap: 14px; padding: 15px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; text-align: left; }
.project:hover { border-color: #6473a0; }
.project-icon { width: 43px; height: 43px; display: grid; place-items: center; flex: 0 0 auto; border-radius: 13px; background: #20283b; color: var(--accent); font-size: 20px; }
.project b { font-size: 15px; }.project p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }.project time { margin-left: auto; color: #687286; font-size: 12px; }
.quick-card { display: flex; gap: 14px; margin: 25px 20px 0; padding: 16px; border: 1px solid #32412b; background: #151e16; border-radius: 16px; }.quick-card p { margin: 4px 0 0; font-size: 13px; }.spark { color: var(--accent); font-size: 24px; }

.workspace-head { gap: 12px; padding-bottom: 15px; }.workspace-head > div { flex: 1; }.back { font-size: 28px; line-height: 1; }.skill-row { display: flex; align-items: center; gap: 10px; padding: 0 20px 16px; }.label { color: var(--muted); font-size: 12px; text-transform: uppercase; }.skill-select { min-height: 44px; padding: 8px 10px; background: #1a2432; border: 1px solid #344761; border-radius: 10px; color: #cfd9ef; }.skill-select span { margin-left: 16px; color: var(--accent); }
.workspace-grid { display: grid; grid-template-columns: 230px 1fr; gap: 12px; padding: 0 20px; }.files-panel, .chat-panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }.files-panel { padding: 14px; }.panel-title { display: flex; justify-content: space-between; margin-bottom: 12px; }.file { padding: 10px 8px; border-radius: 9px; color: #b4bdcd; font-size: 13px; }.file.active { background: #20293a; color: var(--text); }.file small { display: block; color: #6e798b; font-size: 11px; }
.chat-panel { display: flex; flex-direction: column; min-height: 440px; padding: 16px; }.messages { flex: 1; min-width: 0; }.message { display: flex; gap: 10px; margin-bottom: 20px; font-size: 14px; }.message p { margin: 5px 0; color: #c8ceda; white-space: pre-wrap; overflow-wrap: anywhere; }.message-icon { color: var(--accent); font-size: 19px; }.message.user { justify-content: flex-end; }.message.user > div:last-child { padding: 10px 13px; background: #263450; border-radius: 13px 13px 2px 13px; }
.suggestions { display: flex; gap: 7px; overflow-x: auto; padding: 7px 0; scrollbar-width: thin; }.suggestions button { min-height: 44px; white-space: nowrap; padding: 7px 10px; background: #1b212c; border: 1px solid var(--line); border-radius: 9px; color: #98a4b8; font-size: 13px; }.composer { display: flex; align-items: end; gap: 8px; padding: 7px; background: #0d1118; border: 1px solid var(--line); border-radius: 13px; }.composer textarea { flex: 1; min-width: 0; resize: none; padding: 7px; background: none; border: 0; color: var(--text); outline: 0; }.send { width: 44px; height: 44px; padding: 0; background: var(--accent); color: #10150c; border-radius: 9px; font-weight: 900; }
.bottom-nav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 5; display: flex; justify-content: space-around; height: 70px; padding-bottom: env(safe-area-inset-bottom); background: #10141df2; border-top: 1px solid var(--line); }.bottom-nav[hidden] { display: none; }.nav-item { flex: 1; max-width: 130px; padding: 9px 8px; background: none; color: #8290a8; font-size: 20px; }.nav-item span { display: block; margin-top: 1px; font-size: 11px; font-weight: 500; }.nav-item.active { color: var(--accent); text-shadow: 0 0 10px #ff304f66; }

dialog { width: min(92vw, 390px); padding: 26px; background: var(--panel-strong); color: var(--text); border: 1px solid #354052; border-radius: 20px; box-shadow: 0 20px 80px #000b; }dialog::backdrop { background: #000b; }.dialog-close { position: absolute; top: 12px; right: 18px; background: none; color: var(--muted); font-size: 27px; }.dialog-logo { width: 38px; height: 38px; border-radius: 11px; object-fit: cover; }dialog h2 { margin: 4px 0; font-size: 25px; }dialog form { display: grid; gap: 10px; margin-top: 22px; }input, dialog textarea { width: 100%; padding: 13px; background: #0d1118; border: 1px solid var(--line); border-radius: 10px; color: var(--text); outline: none; }input:focus, textarea:focus { border-color: var(--accent); }.link-btn { display: block; margin: 18px auto 0; color: var(--accent); }.error { margin: 0; color: var(--danger); font-size: 13px; }.toast { position: fixed; left: 50%; bottom: 85px; z-index: 10; padding: 11px 17px; transform: translate(-50%, 15px); background: #e9fbdc; color: #14200c; border-radius: 11px; font-size: 13px; opacity: 0; pointer-events: none; transition: .2s; }.toast.show { opacity: 1; transform: translate(-50%, 0); }

.admin-card { margin: 0 20px; padding: 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 16px; }.admin-card b { font-size: 18px; }.admin-card p { margin: 6px 0; }.admin-card form { display: grid; gap: 12px; margin-top: 18px; }.admin-card label { color: var(--muted); font-size: 12px; }.admin-card input { margin-top: 5px; }

@media (max-width: 700px) { .workspace-grid { display: block; }.files-panel { display: none; }.chat-panel { min-height: calc(100vh - 245px); border-radius: 14px; }.workspace-head { padding-top: 22px; }.topbar { height: 62px; } .page-head { padding-top: 25px; } }
@media (min-width: 701px) { .bottom-nav { border: 1px solid var(--line); border-bottom: 0; border-radius: 20px 20px 0 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }
