:root {
    --bg: #070a12;
    --panel: rgba(14, 20, 35, 0.88);
    --panel-strong: rgba(18, 27, 48, 0.96);
    --border: rgba(142, 163, 255, 0.18);
    --text: #f4f7ff;
    --muted: #aab4cf;
    --accent: #7c5cff;
    --accent-2: #29d9d5;
    --danger: #ff5b7c;
    --success: #46e29c;
    --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

* { box-sizing: border-box; }
html { min-height: 100%; }
body {
    margin: 0;
    min-height: 100vh;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--text);
    background: radial-gradient(circle at 12% 8%, rgba(124, 92, 255, 0.22), transparent 34%),
                radial-gradient(circle at 86% 14%, rgba(41, 217, 213, 0.16), transparent 30%),
                var(--bg);
}

a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
.om-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0.3;
    background-image: linear-gradient(rgba(255,255,255,0.04) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.04) 1px, transparent 1px);
    background-size: 54px 54px;
    mask-image: radial-gradient(circle at center, black, transparent 72%);
}
.topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px clamp(16px, 4vw, 48px);
    backdrop-filter: blur(18px);
    background: rgba(5, 8, 16, 0.72);
    border-bottom: 1px solid var(--border);
}
.brand { display: inline-flex; align-items: center; gap: 12px; font-weight: 800; letter-spacing: -0.02em; }
.brand-mark {
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #041018;
    font-weight: 900;
    box-shadow: 0 12px 34px rgba(124, 92, 255, 0.35);
}
.nav { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; justify-content: flex-end; color: var(--muted); }
.nav a, .link-button { color: var(--muted); transition: color .2s ease, background .2s ease, border-color .2s ease; }
.nav a:hover, .link-button:hover { color: var(--text); }
.nav-pill { border: 1px solid var(--border); border-radius: 999px; padding: 9px 14px; background: rgba(255,255,255,0.04); }
.inline-form { display: inline; margin: 0; }
.link-button { background: transparent; border: 0; padding: 0; cursor: pointer; }
.page { position: relative; z-index: 1; width: min(1180px, calc(100% - 32px)); margin: 34px auto 64px; }
.footer { width: min(1180px, calc(100% - 32px)); margin: 0 auto 32px; display: flex; justify-content: space-between; gap: 12px; color: rgba(244,247,255,0.5); font-size: 13px; }
.hero-card, .panel, .card, .mind-card, .empty-state {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20,30,52,0.92), rgba(10,15,28,0.88));
    border-radius: 28px;
    box-shadow: var(--shadow);
}
.hero-card { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr); gap: 26px; padding: clamp(28px, 5vw, 62px); align-items: center; }
.eyebrow { margin: 0 0 10px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .16em; font-size: 12px; font-weight: 800; }
h1, h2, h3, p { overflow-wrap: anywhere; }
h1 { margin: 0 0 14px; font-size: clamp(34px, 5vw, 64px); line-height: .95; letter-spacing: -.06em; }
h2 { margin: 0 0 10px; font-size: 22px; letter-spacing: -.03em; }
h3 { margin: 0 0 8px; }
p { color: var(--muted); line-height: 1.65; }
.hero-copy { max-width: 680px; font-size: 18px; }
.hero-actions, .card-actions, .form-actions, .side-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 1px solid var(--border);
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease, border-color .18s ease;
    color: var(--text);
    background: rgba(255,255,255,0.06);
}
.button:hover { transform: translateY(-1px); border-color: rgba(255,255,255,0.3); }
.button.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); color: #061018; border: 0; font-weight: 800; box-shadow: 0 14px 38px rgba(41, 217, 213, 0.18); }
.button.ghost { background: rgba(255,255,255,0.055); }
.button.danger { background: rgba(255,91,124,0.1); border-color: rgba(255,91,124,0.38); color: #ff9aad; }
.button.small { min-height: 36px; padding: 8px 13px; font-size: 13px; }
.button.full { width: 100%; }
.orb-card { position: relative; overflow: hidden; min-height: 280px; border-radius: 26px; padding: 28px; background: rgba(255,255,255,0.055); border: 1px solid var(--border); }
.orb { width: 170px; height: 170px; border-radius: 999px; margin: 8px auto 24px; background: radial-gradient(circle at 30% 25%, #fff, var(--accent-2) 16%, var(--accent) 54%, transparent 70%); filter: blur(.2px); box-shadow: 0 0 80px rgba(124,92,255,.5); }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; margin-top: 22px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.card, .mind-card { padding: 24px; }
.mind-card-top { display: flex; justify-content: space-between; gap: 12px; align-items: flex-start; }
.temp-pill, .status-pill { flex: none; display: inline-flex; align-items: center; min-height: 32px; padding: 7px 11px; border-radius: 999px; background: rgba(41,217,213,.1); border: 1px solid rgba(41,217,213,.24); color: #b9fffc; font-size: 12px; font-weight: 800; }
.section-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 22px; margin-bottom: 22px; }
.section-head h1 { font-size: clamp(32px, 4vw, 48px); }
.empty-state { padding: clamp(28px, 5vw, 54px); text-align: center; }
.alert { padding: 14px 18px; border-radius: 18px; margin: 0 0 18px; border: 1px solid var(--border); background: rgba(255,255,255,.065); }
.alert.success { border-color: rgba(70,226,156,.35); color: #bdffe0; }
.alert.error { border-color: rgba(255,91,124,.35); color: #ffd0d9; }
.auth-wrap { min-height: 62vh; display: grid; place-items: center; }
.form-panel { width: min(460px, 100%); padding: 28px; }
.form-panel h1 { font-size: 38px; }
.form-grid { padding: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
label { display: grid; gap: 8px; color: var(--text); font-weight: 700; }
input, textarea, select {
    width: 100%;
    color: var(--text);
    background: rgba(2, 6, 14, 0.68);
    border: 1px solid rgba(142, 163, 255, 0.22);
    border-radius: 16px;
    padding: 13px 14px;
    outline: none;
    transition: border-color .2s ease, box-shadow .2s ease;
}
textarea { resize: vertical; min-height: 90px; }
input:focus, textarea:focus, select:focus { border-color: rgba(41,217,213,.6); box-shadow: 0 0 0 4px rgba(41,217,213,.08); }
.span-2 { grid-column: span 2; }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; height: 18px; }
.muted { color: var(--muted); font-size: 14px; }
code { background: rgba(255,255,255,.08); border: 1px solid var(--border); border-radius: 8px; padding: 2px 6px; }
.chat-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 18px; align-items: stretch; }
.chat-sidebar { padding: 20px; max-height: calc(100vh - 170px); overflow: auto; }
.chat-main { padding: 0; display: grid; grid-template-rows: auto minmax(380px, 1fr) auto; min-height: calc(100vh - 170px); overflow: hidden; }
.chat-header { display: flex; justify-content: space-between; gap: 18px; align-items: flex-start; padding: 20px; border-bottom: 1px solid var(--border); }
.chat-header h1 { font-size: clamp(24px, 3vw, 34px); }
.sidebar-section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 20px; }
.sidebar-section h2 { font-size: 16px; }
.conversation-list { display: grid; gap: 8px; }
.conversation-link { display: block; padding: 10px 12px; border-radius: 14px; background: rgba(255,255,255,.04); color: var(--muted); border: 1px solid transparent; font-size: 14px; }
.conversation-link.active, .conversation-link:hover { color: var(--text); border-color: var(--border); background: rgba(124,92,255,.12); }
.memory-list { display: grid; gap: 8px; }
.memory-item { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; padding: 10px; border-radius: 14px; border: 1px solid var(--border); background: rgba(255,255,255,.04); color: var(--muted); font-size: 13px; }
.memory-item form { margin: 0; }
.memory-item button { width: 24px; height: 24px; border-radius: 999px; border: 1px solid rgba(255,91,124,.35); background: rgba(255,91,124,.12); color: #ffd0d9; cursor: pointer; }
.memory-form { display: grid; gap: 10px; margin-top: 12px; }
.messages { padding: 20px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.message { max-width: 86%; padding: 14px 16px; border-radius: 20px; border: 1px solid var(--border); background: rgba(255,255,255,.055); }
.message.user { align-self: flex-end; background: rgba(124,92,255,.14); border-color: rgba(124,92,255,.32); }
.message.assistant { align-self: flex-start; background: rgba(41,217,213,.07); border-color: rgba(41,217,213,.22); }
.message-role { margin-bottom: 6px; color: var(--accent-2); text-transform: uppercase; letter-spacing: .12em; font-size: 11px; font-weight: 900; }
.message-content { color: #edf4ff; line-height: 1.65; overflow-wrap: anywhere; }
.welcome-message { margin: auto; text-align: center; max-width: 560px; }
.chat-input { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 18px; border-top: 1px solid var(--border); background: rgba(5,8,16,.45); }
.chat-input textarea { min-height: 54px; max-height: 180px; }
.error-box { border-color: rgba(255,91,124,.35); }
@media (max-width: 900px) {
    .hero-card, .chat-layout, .grid.three, .form-grid { grid-template-columns: 1fr; }
    .span-2 { grid-column: span 1; }
    .chat-sidebar { max-height: none; }
    .chat-main { min-height: 70vh; }
    .section-head, .chat-header, .topbar { flex-direction: column; align-items: stretch; }
    .nav { justify-content: flex-start; }
}
@media (max-width: 560px) {
    .page { width: min(100% - 20px, 1180px); margin-top: 20px; }
    .footer { flex-direction: column; }
    h1 { font-size: 34px; }
    .hero-card, .panel, .card, .mind-card, .empty-state { border-radius: 22px; }
    .chat-input { grid-template-columns: 1fr; }
    .message { max-width: 100%; }
    .card-actions { align-items: stretch; }
    .card-actions .button, .card-actions form, .card-actions form button { width: 100%; }
}


/* v0.1.1 AI readiness panel */
.status-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    padding: 20px 22px;
    margin: 0 0 22px;
}
.readiness-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 22px;
}
.status-card {
    border: 1px solid var(--border);
    background: linear-gradient(180deg, rgba(20,30,52,0.92), rgba(10,15,28,0.88));
    border-radius: 24px;
    padding: 20px;
    box-shadow: var(--shadow);
    min-width: 0;
}
.status-card.ok { border-color: rgba(70,226,156,.28); }
.status-card.warn { border-color: rgba(255,202,87,.34); }
.status-card.bad { border-color: rgba(255,91,124,.38); }
.status-card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 12px;
}
.status-pill.ok { color: #bdffe0; border-color: rgba(70,226,156,.35); background: rgba(70,226,156,.1); }
.status-pill.warn { color: #ffe6a8; border-color: rgba(255,202,87,.38); background: rgba(255,202,87,.1); }
.status-pill.bad { color: #ffd0d9; border-color: rgba(255,91,124,.38); background: rgba(255,91,124,.12); }
.check-list { display: grid; gap: 8px; margin-top: 14px; }
.check-item {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: rgba(255,255,255,.04);
}
.good-text { color: #bdffe0; }
.bad-text { color: #ffd0d9; }
.mini-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}
.mini-meta span {
    display: inline-flex;
    padding: 7px 10px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255,255,255,.045);
    font-size: 12px;
    font-weight: 800;
}
.status-wide { padding: 22px; margin-bottom: 22px; }
.config-table {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}
.config-table > div {
    display: grid;
    grid-template-columns: 150px minmax(0, 1fr);
    gap: 12px;
    align-items: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255,255,255,.04);
}
.config-table code,
.config-suggestion code {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
}
.config-suggestion {
    margin-top: 14px;
    border: 1px solid rgba(255,202,87,.28);
    border-radius: 16px;
    padding: 12px;
    background: rgba(255,202,87,.08);
}
.model-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }
.model-chip {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    color: var(--muted);
    background: rgba(255,255,255,.05);
    font-size: 13px;
    font-weight: 800;
}
.model-chip.active {
    color: #061018;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
}
.sample-box {
    margin: 16px 0 0;
    padding: 14px;
    border-radius: 16px;
    border: 1px solid var(--border);
    background: rgba(2,6,14,.68);
    color: #edf4ff;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}
.status-pass { border-color: rgba(70,226,156,.32); }
.status-fail { border-color: rgba(255,91,124,.38); }
.fix-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 14px;
}
.fix-list > div {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 14px;
    background: rgba(255,255,255,.04);
}
@media (max-width: 1100px) {
    .readiness-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
    .readiness-grid, .fix-list { grid-template-columns: 1fr; }
    .status-callout, .status-card-head { flex-direction: column; align-items: stretch; }
    .config-table > div { grid-template-columns: 1fr; }
}

/* v0.1.1.1 chat memory / timeout side patch */
.message.error {
    border-color: rgba(255,91,124,.38);
    background: rgba(255,91,124,.08);
}
.chat-input textarea:disabled {
    opacity: .72;
    cursor: wait;
}

/* v0.1.3 first-use polish / AI status controls */
.first-use-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 18px;
    margin: 0 0 22px;
}
.first-use-card {
    padding: 22px;
    min-width: 0;
}
.setup-steps {
    display: grid;
    gap: 10px;
    margin: 14px 0 0;
    padding: 0;
    list-style: none;
}
.setup-steps li {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: rgba(255,255,255,.04);
    color: var(--muted);
}
.setup-steps span {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    color: #061018;
    font-weight: 900;
    font-size: 12px;
}
.setup-steps strong { color: var(--text); }
.warn-panel { border-color: rgba(255,202,87,.34); }
.setup-notices {
    display: grid;
    gap: 12px;
    margin: 0 0 22px;
}
.notice-card {
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 15px 16px;
    background: rgba(255,255,255,.045);
}
.notice-card strong { display: block; color: var(--text); margin-bottom: 4px; }
.notice-card p { margin: 0; }
.notice-card.warn { border-color: rgba(255,202,87,.34); background: rgba(255,202,87,.07); }
.notice-card.info { border-color: rgba(142,163,255,.25); }
.notice-card.bad { border-color: rgba(255,91,124,.38); background: rgba(255,91,124,.08); }
.warn-text { color: #ffe6a8; }
.model-manager { border-color: rgba(41,217,213,.26); }
.model-save-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 12px;
    align-items: end;
    margin-top: 16px;
}
.model-save-form .button[disabled] {
    opacity: .5;
    cursor: not-allowed;
    transform: none;
}
.last-status-panel { border-color: rgba(124,92,255,.24); }
@media (max-width: 1000px) {
    .first-use-grid { grid-template-columns: 1fr; }
    .model-save-form { grid-template-columns: 1fr; }
}


/* v0.1.3.3 design spacing / padding polish side patch */
:root {
    --om-space-1: 6px;
    --om-space-2: 10px;
    --om-space-3: 14px;
    --om-space-4: 18px;
    --om-space-5: 24px;
    --om-space-6: 30px;
    --om-space-7: 38px;
    --om-radius-soft: 18px;
    --om-radius-card: 28px;
}

body {
    line-height: 1.5;
}

.topbar {
    min-height: 74px;
    padding-top: clamp(14px, 2vw, 22px);
    padding-bottom: clamp(14px, 2vw, 22px);
}

.brand {
    min-width: 0;
}

.brand span:last-child {
    overflow-wrap: anywhere;
}

.nav a,
.link-button,
.nav-pill {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
}

.link-button {
    padding: 8px 0;
}

.page {
    width: min(1240px, calc(100% - clamp(24px, 5vw, 72px)));
    margin-top: clamp(26px, 4vw, 48px);
    margin-bottom: clamp(54px, 7vw, 86px);
}

.footer {
    width: min(1240px, calc(100% - clamp(24px, 5vw, 72px)));
    padding: 0 2px;
}

p {
    margin-top: 0;
    margin-bottom: 1rem;
}

p:last-child {
    margin-bottom: 0;
}

.eyebrow {
    line-height: 1.35;
}

.hero-card,
.panel,
.card,
.mind-card,
.empty-state,
.status-card {
    background-clip: padding-box;
}

.hero-card {
    gap: clamp(24px, 5vw, 46px);
}

.hero-actions,
.card-actions,
.form-actions,
.side-actions {
    margin-top: var(--om-space-4);
}

.button {
    line-height: 1.2;
    text-align: center;
    gap: 8px;
    white-space: normal;
}

.button.full {
    justify-self: stretch;
}

.grid,
.cards-grid,
.first-use-grid,
.readiness-grid {
    gap: clamp(18px, 2.4vw, 26px);
}

.card,
.mind-card,
.first-use-card,
.status-card,
.status-wide,
.empty-state {
    padding: clamp(22px, 3vw, 30px);
}

.mind-card {
    display: flex;
    flex-direction: column;
    min-height: 240px;
}

.mind-card > p {
    flex: 1 1 auto;
}

.mind-card-top {
    margin-bottom: var(--om-space-3);
}

.temp-pill,
.status-pill,
.model-chip,
.mini-meta span {
    line-height: 1.15;
    white-space: normal;
}

.section-head {
    margin-bottom: clamp(22px, 3vw, 32px);
}

.section-head > div {
    min-width: 0;
}

.section-head p {
    max-width: 760px;
}

.alert {
    padding: 16px 20px;
    margin-bottom: 22px;
}

.auth-wrap {
    min-height: calc(100vh - 190px);
    padding: var(--om-space-5) 0;
}

.form-panel {
    display: grid;
    gap: 18px;
    padding: clamp(28px, 4vw, 38px);
}

.form-panel h1,
.form-panel p {
    margin-bottom: 0;
}

.form-grid {
    gap: clamp(18px, 2.4vw, 24px);
    padding: clamp(24px, 4vw, 36px);
}

label {
    min-width: 0;
    line-height: 1.35;
}

input,
textarea,
select {
    min-height: 48px;
    line-height: 1.45;
}

textarea {
    padding-top: 14px;
    padding-bottom: 14px;
}

.check-row {
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: rgba(255,255,255,.035);
}

.check-row input {
    flex: 0 0 auto;
    margin-top: 2px;
}

.chat-layout {
    grid-template-columns: minmax(300px, 360px) minmax(0, 1fr);
    gap: clamp(18px, 2.6vw, 28px);
}

.chat-sidebar {
    padding: clamp(22px, 2.8vw, 30px);
    max-height: calc(100vh - 190px);
}

.mind-summary h1 {
    font-size: clamp(28px, 3.2vw, 40px);
    margin-bottom: 12px;
}

.mind-summary p {
    margin-bottom: 0;
}

.sidebar-section {
    margin-top: clamp(22px, 3vw, 30px);
    padding-top: clamp(22px, 3vw, 30px);
}

.sidebar-section h2 {
    margin-bottom: 14px;
}

.conversation-list,
.memory-list {
    gap: 10px;
}

.conversation-link {
    padding: 13px 15px;
    line-height: 1.35;
}

.memory-item {
    padding: 13px 14px;
    gap: 12px;
    line-height: 1.45;
}

.memory-item span {
    min-width: 0;
}

.memory-item button {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    line-height: 1;
}

.memory-form {
    gap: 12px;
    margin-top: 16px;
}

.chat-main {
    min-height: calc(100vh - 190px);
}

.chat-header {
    padding: clamp(22px, 3vw, 30px);
}

.chat-header h1 {
    margin-bottom: 0;
}

.chat-header .status-pill {
    max-width: 100%;
}

.messages {
    padding: clamp(22px, 3vw, 32px);
    gap: 16px;
    scroll-padding-bottom: 26px;
}

.message {
    max-width: min(86%, 820px);
    padding: 16px 18px;
    border-radius: 22px;
}

.message.user {
    border-bottom-right-radius: 10px;
}

.message.assistant {
    border-bottom-left-radius: 10px;
}

.message-role {
    margin-bottom: 8px;
}

.message-content {
    line-height: 1.72;
}

.message-content p {
    margin: 0 0 12px;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.welcome-message {
    padding: clamp(24px, 5vw, 48px);
    border: 1px dashed rgba(142, 163, 255, 0.26);
    border-radius: 26px;
    background: rgba(255,255,255,.035);
}

.chat-input {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 14px;
    padding: clamp(18px, 2.6vw, 26px);
    align-items: end;
}

.chat-input textarea {
    min-height: 64px;
}

.chat-input .button {
    min-height: 52px;
    padding-left: 24px;
    padding-right: 24px;
}

.status-callout {
    padding: clamp(22px, 3vw, 30px);
    margin-bottom: clamp(20px, 3vw, 30px);
}

.status-card-head {
    gap: 16px;
    margin-bottom: 16px;
}

.status-card h2,
.status-wide h2,
.first-use-card h2 {
    margin-bottom: 12px;
}

.check-list {
    gap: 10px;
}

.check-item,
.config-table > div,
.fix-list > div,
.setup-steps li {
    padding: 13px 15px;
}

.config-table {
    gap: 12px;
}

.config-table code,
.config-suggestion code,
code {
    line-height: 1.45;
}

.model-list {
    gap: 12px;
}

.model-chip {
    padding: 9px 13px;
}

.model-save-form {
    gap: 16px;
}

.setup-steps {
    gap: 12px;
}

.setup-steps li {
    align-items: flex-start;
    line-height: 1.4;
}

.setup-steps span {
    margin-top: -2px;
}

.notice-card {
    padding: 17px 18px;
}

.sample-box {
    padding: 16px;
    line-height: 1.55;
}

.fix-list {
    gap: 14px;
}

@media (max-width: 900px) {
    .topbar {
        gap: 16px;
    }

    .nav {
        gap: 10px;
    }

    .chat-layout {
        gap: 18px;
    }

    .chat-sidebar {
        max-height: none;
    }

    .chat-main {
        min-height: 72vh;
    }

    .message {
        max-width: 94%;
    }
}

@media (max-width: 700px) {
    .page,
    .footer {
        width: min(100% - 22px, 1240px);
    }

    .card,
    .mind-card,
    .first-use-card,
    .status-card,
    .status-wide,
    .empty-state,
    .form-grid,
    .form-panel,
    .chat-sidebar {
        padding: 20px;
    }

    .hero-card {
        padding: 24px;
    }

    .chat-header,
    .messages,
    .chat-input {
        padding: 18px;
    }

    .message {
        max-width: 100%;
        padding: 15px 16px;
    }

    .chat-input {
        grid-template-columns: 1fr;
    }

    .chat-input .button {
        width: 100%;
    }

    .model-save-form {
        grid-template-columns: 1fr;
    }

    .mini-meta span,
    .model-chip,
    .status-pill {
        width: fit-content;
        max-width: 100%;
    }
}

@media (max-width: 560px) {
    .topbar {
        position: relative;
        padding: 16px 14px;
    }

    .brand-mark {
        width: 38px;
        height: 38px;
        border-radius: 14px;
    }

    .nav a,
    .link-button,
    .nav-pill {
        min-height: 36px;
        padding-top: 7px;
        padding-bottom: 7px;
    }

    .section-head .button,
    .hero-actions .button,
    .form-actions .button,
    .side-actions .button {
        width: 100%;
    }

    .hero-actions,
    .form-actions,
    .side-actions {
        align-items: stretch;
    }

    .check-row {
        padding: 13px 14px;
    }

    .config-table > div,
    .check-item {
        gap: 8px;
    }

    .footer {
        gap: 8px;
        padding-bottom: 20px;
    }
}
