:root {
  color-scheme: light;
  --bg: #f4f7fb;
  --card: #ffffff;
  --text: #14213d;
  --muted: #65758b;
  --line: #d9e2ef;
  --accent: #2f80ed;
  --accent-dark: #1f62bd;
  --soft: #eaf3ff;
  --danger: #b42318;
  --ok: #13844f;
  --shadow: 0 18px 55px rgba(20, 33, 61, .10);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: radial-gradient(circle at top left, #ffffff 0, var(--bg) 42%, #eaf1f9 100%);
  color: var(--text);
}

.shell { width: min(1440px, calc(100% - 32px)); margin: 0 auto; padding: 32px 0; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: stretch; margin-bottom: 24px; }
.eyebrow { margin: 0 0 12px; color: var(--accent-dark); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; font-size: 12px; }
h1 { margin: 0; font-size: clamp(30px, 5vw, 56px); line-height: 1.02; letter-spacing: -.04em; max-width: 920px; }
.lead { max-width: 780px; color: var(--muted); font-size: 18px; line-height: 1.55; }
.hero-card, .panel { background: rgba(255,255,255,.88); border: 1px solid rgba(217,226,239,.9); border-radius: 28px; box-shadow: var(--shadow); }
.hero-card { padding: 24px; display: flex; flex-direction: column; justify-content: center; min-height: 220px; }
.yeti-avatar { width: 64px; height: 64px; display: grid; place-items: center; border-radius: 22px; background: var(--soft); font-size: 34px; margin-bottom: 16px; }
.hero-card p { color: var(--muted); margin-bottom: 0; }

.workspace { display: grid; grid-template-columns: 320px minmax(420px, 1fr) 360px; gap: 20px; align-items: stretch; }
.panel { padding: 20px; min-width: 0; }
.panel h2 { margin: 0 0 16px; font-size: 20px; letter-spacing: -.02em; }
label { display: grid; gap: 8px; color: var(--muted); font-size: 13px; margin-bottom: 14px; }
input { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font: inherit; color: var(--text); outline: none; background: #fff; }
input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,128,237,.12); }
button { border: 0; border-radius: 16px; padding: 12px 16px; font: inherit; font-weight: 700; color: #fff; background: var(--accent); cursor: pointer; transition: transform .15s ease, background .15s ease; }
button:hover { background: var(--accent-dark); transform: translateY(-1px); }
button.ghost { color: var(--text); background: #eef4fb; }
button.ghost:hover { background: #e3edf8; }
.settings-actions, .result-actions { display: grid; gap: 10px; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.45; }

.chat-panel { display: flex; flex-direction: column; min-height: 680px; }
.chat-header { display: flex; justify-content: space-between; gap: 16px; align-items: center; border-bottom: 1px solid var(--line); padding-bottom: 16px; margin-bottom: 16px; }
.chat-header h2 { margin: 0 0 4px; }
.chat-header p { margin: 0; color: var(--muted); }
.status-dot { width: 12px; height: 12px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 6px rgba(19,132,79,.12); }
.messages { flex: 1; overflow: auto; display: flex; flex-direction: column; gap: 12px; padding: 4px 4px 16px; }
.message { max-width: 82%; padding: 13px 15px; border-radius: 18px; line-height: 1.45; }
.message.bot { align-self: flex-start; background: #eef5ff; border-bottom-left-radius: 6px; }
.message.user { align-self: flex-end; background: var(--accent); color: #fff; border-bottom-right-radius: 6px; }
.message small { display: block; opacity: .72; margin-top: 6px; font-size: 12px; }
.quick-actions { display: flex; gap: 8px; flex-wrap: wrap; border-top: 1px solid var(--line); padding-top: 12px; min-height: 60px; align-content: flex-start; }
.quick-actions button { background: #eef4fb; color: var(--text); padding: 10px 12px; font-size: 14px; }
.quick-actions button:hover { background: #dfeafa; }
.composer { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 12px; }

pre { margin: 0; min-height: 480px; max-height: 560px; overflow: auto; background: #0f172a; color: #dbeafe; border-radius: 18px; padding: 16px; font-size: 12px; line-height: 1.45; }
code { color: var(--accent-dark); }

@media (max-width: 1100px) {
  .hero, .workspace { grid-template-columns: 1fr; }
  .chat-panel { min-height: 620px; }
}
select { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: 12px 14px; font: inherit; color: var(--text); outline: none; background: #fff; }
select:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(47,128,237,.12); }
.checkbox-label { grid-template-columns: auto 1fr; align-items: center; color: var(--text); font-weight: 600; }
.checkbox-label input { width: 18px; height: 18px; }
.status-dot.loading { background: #f59e0b; box-shadow: 0 0 0 6px rgba(245,158,11,.16); }
.status-dot.error { background: var(--danger); box-shadow: 0 0 0 6px rgba(180,35,24,.12); }
.mt { margin-top: 18px !important; }
.result-panel pre { min-height: 220px; max-height: 320px; }

.mini-mode-toggle {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 1000;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 999px;
  background: #ffffff;
  color: #17212b;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.16);
  cursor: pointer;
  font-weight: 700;
}

body.mini-mode .hero,
body.mini-mode .settings-panel,
body.mini-mode .result-panel {
  display: none !important;
}

body.mini-mode .shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body.mini-mode .workspace {
  width: min(760px, calc(100vw - 32px));
  display: block;
}

body.mini-mode .chat-panel {
  width: 100%;
  max-width: 760px;
}

body.mini-mode .messages {
  height: min(68vh, 640px);
}
