:root {
  --gold: #f7c948;
  --gold2: #ffe38b;
  --bg: #100d0b;
  --panel: #17120f;
  --card: #201913;
  --soft: #2a2119;
  --ink: #fff8de;
  --muted: #c3b58f;
  --line: rgba(255, 220, 128, .18);
  --danger: #b42318;
  --shadow: 0 24px 70px rgba(0,0,0,.35);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: radial-gradient(circle at top left, #3a2b16, #100d0b 48%, #070605); color: var(--ink); }
button, input, textarea, select { font: inherit; }
button, .head-actions a { border: 0; border-radius: 14px; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #17110a; padding: 12px 16px; font-weight: 1000; cursor: pointer; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; }
input, textarea, select { width: 100%; border: 1px solid var(--line); border-radius: 14px; padding: 12px 13px; background: rgba(0,0,0,.25); color: var(--ink); outline: none; }
textarea { resize: vertical; }
label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 900; }
.hidden { display: none !important; }
.login-screen { min-height: 100vh; display: grid; place-items: center; padding: 22px; }
.login-card { width: min(500px, 100%); background: rgba(32,25,19,.88); border: 1px solid var(--line); border-radius: 34px; padding: 34px; box-shadow: var(--shadow); backdrop-filter: blur(16px); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 1000; min-width: 0; }
.logo { min-width: 46px; height: 46px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, var(--gold2), var(--gold)); color: #17110a; font-size: 13px; font-weight: 1000; }
.login-card h1 { font-size: 46px; line-height: .96; margin: 48px 0 12px; letter-spacing: -.05em; }
p, .hint, small, li { color: var(--muted); line-height: 1.55; }
.stack { display: grid; gap: 12px; }
.hint { font-size: 13px; }
.app { min-height: 100vh; display: grid; grid-template-columns: 280px 1fr; }
.sidebar { background: rgba(12,10,8,.86); border-right: 1px solid var(--line); padding: 24px; display: grid; grid-template-rows: auto 1fr auto; gap: 28px; position: sticky; top: 0; height: 100vh; }
.sidebar .brand span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
nav { display: grid; align-content: start; gap: 8px; }
.nav, .logout, .ghost { text-align: left; background: transparent; color: var(--muted); border: 1px solid transparent; }
.nav:hover, .nav.active { background: rgba(247,201,72,.10); color: var(--gold2); border-color: var(--line); }
.logout { color: #ffb4a9; }
.ghost { color: var(--ink); border-color: var(--line); justify-content: center; }
.main { padding: 28px; overflow: auto; }
.main-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 22px; }
.head-actions { display: flex; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
.eyebrow { text-transform: uppercase; letter-spacing: .14em; color: var(--gold2); font-size: 11px; font-weight: 1000; margin: 0 0 5px; }
.main-head h1 { margin: 0; font-size: 40px; letter-spacing: -.04em; }
.view { display: none; }
.active-view { display: block; }
.grid.two { display: grid; grid-template-columns: minmax(340px, 470px) 1fr; gap: 20px; align-items: start; }
.card, .stat { background: rgba(32,25,19,.86); border: 1px solid var(--line); border-radius: 26px; padding: 20px; box-shadow: 0 16px 42px rgba(0,0,0,.18); }
.card h2 { margin: 0 0 16px; }
.actions, .mini-actions, .form-row, .upload-row { display: flex; gap: 10px; }
.form-row > label { flex: 1; }
.upload-row input { flex: 1; }
.upload-row button { white-space: nowrap; }
.list { display: grid; gap: 10px; }
.item { border: 1px solid var(--line); border-radius: 20px; padding: 14px; background: rgba(0,0,0,.18); }
.item-head { display: flex; justify-content: space-between; gap: 12px; }
.item h3 { margin: 0 0 8px; }
.item p { margin: 0 0 10px; white-space: pre-wrap; }
.item small { display: block; margin: 7px 0 10px; }
.item-img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 16px; border: 1px solid var(--line); margin: 8px 0 10px; background: #0a0807; }
.mini-actions { flex-wrap: wrap; }
.mini-actions button { padding: 8px 10px; font-size: 13px; }
.danger { background: #b42318; color: #fff; }
.badge { display: inline-flex; padding: 5px 9px; border-radius: 999px; background: rgba(247,201,72,.12); color: var(--gold2); font-size: 12px; font-weight: 900; border: 1px solid var(--line); }
.toast { position: fixed; right: 22px; bottom: 22px; background: #080706; border: 1px solid var(--line); color: var(--ink); padding: 14px 16px; border-radius: 16px; box-shadow: var(--shadow); display: none; max-width: 360px; }
.toast.show { display: block; }
.logs .item p { font-size: 14px; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.stat span { font-size: 28px; }
.stat strong { display: block; font-size: 34px; margin-top: 10px; }
.stat p { margin: 0; }
.start-card { max-width: 850px; }
.image-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.image-preview img { width: 100%; aspect-ratio: 1/1; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); background: #0a0807; }
.theme-card { max-width: 840px; }
@media (max-width: 1050px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; grid-template-rows: auto auto auto; }
  nav { grid-template-columns: repeat(2, 1fr); }
  .grid.two, .stats-grid { grid-template-columns: 1fr; }
  .main-head { align-items: start; flex-direction: column; }
  .head-actions { justify-content: flex-start; }
}
@media (max-width: 640px) {
  .main { padding: 16px; }
  .login-card { padding: 24px; }
  .login-card h1, .main-head h1 { font-size: 34px; }
  .form-row, .actions, .upload-row { flex-direction: column; }
}

/* v0.4.0 AI Mode Control Center */
.stats-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.top-gap { margin-top: 18px; }
.checks { display: grid; gap: 10px; padding: 10px 0; }
.checks label { display: flex; gap: 10px; align-items: center; color: var(--muted); font-weight: 800; }
.checks input { width: auto; accent-color: var(--gold); }
.status-box { border: 1px solid var(--line); border-radius: 14px; padding: 12px; background: rgba(255,255,255,.04); }
.status-box .ok { color: #8cffb5; font-weight: 900; }
.status-box .warn { color: #ffd879; font-weight: 900; }
.prompt-list .item p { max-height: 140px; overflow: auto; white-space: pre-wrap; }
.test-result { border: 1px dashed var(--line); border-radius: 18px; min-height: 120px; padding: 12px; background: rgba(0,0,0,.18); }
.mini-guide { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 12px; }
.danger-text { color: #ff9f9f; font-weight: 900; }
