:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --surface: #ffffff;
  --surface-2: #f0f2f5;
  --ink: #17181b;
  --muted: #6c7078;
  --line: #dfe2e7;
  --line-strong: #c9cdd4;
  --brand: #155eef;
  --brand-hover: #004eeb;
  --accent: #e84078;
  --success: #087a55;
  --warning: #a15c00;
  --danger: #c43232;
  --shadow: 0 8px 28px rgba(22, 24, 29, .1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--ink); }
body { min-width: 320px; }
button, input, textarea, select { font: inherit; letter-spacing: 0; }
button { color: inherit; }
a { color: inherit; }
svg { width: 18px; height: 18px; flex: none; stroke-width: 1.8; }
:focus-visible { outline: 3px solid rgba(21, 94, 239, .35); outline-offset: 2px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.skip-link { position: fixed; z-index: 300; top: 10px; left: 10px; transform: translateY(-150%); padding: 9px 12px; border: 1px solid var(--brand); border-radius: 6px; background: #fff; color: var(--brand); font-weight: 750; }
.skip-link:focus { transform: translateY(0); }

.boot-screen { min-height: 100vh; display: grid; place-content: center; justify-items: center; gap: 22px; }
.boot-spinner, .spinner { width: 20px; height: 20px; border: 2px solid #d6d9de; border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.brand-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 7px; background: var(--ink); color: #fff; font-weight: 900; line-height: 1; }
.brand-mark span { transform: translateY(-1px); }
.brand-lockup { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 820; white-space: nowrap; }
.brand-lockup small { color: var(--muted); font-weight: 650; }

.btn, .icon-btn, .segmented button, .tab-btn { border: 1px solid var(--line); background: var(--surface); cursor: pointer; transition: background-color .14s ease, border-color .14s ease, color .14s ease, transform .14s ease; }
.btn { min-height: 38px; border-radius: 7px; padding: 0 13px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; font-weight: 720; text-decoration: none; white-space: nowrap; }
.btn:hover:not(:disabled), .icon-btn:hover:not(:disabled), .tab-btn:hover:not(:disabled) { border-color: var(--line-strong); background: #f8f9fa; }
.btn:active:not(:disabled), .icon-btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled, .icon-btn:disabled { opacity: .48; cursor: not-allowed; }
.btn.primary { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #303238; border-color: #303238; }
.btn.brand { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.brand:hover:not(:disabled) { background: var(--brand-hover); border-color: var(--brand-hover); }
.btn.danger { color: var(--danger); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.small { min-height: 32px; padding: 0 10px; font-size: 12px; }
.icon-btn { width: 38px; height: 38px; padding: 0; border-radius: 7px; display: inline-grid; place-items: center; }
.icon-btn.small { width: 32px; height: 32px; }
.icon-btn.active { color: var(--brand); border-color: #9db9f8; background: #edf3ff; }
.icon-btn[data-tooltip] { position: relative; }
.icon-btn[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; z-index: 100; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); background: #17181b; color: #fff; padding: 5px 7px; border-radius: 5px; font-size: 11px; white-space: nowrap; pointer-events: none; }

.field { display: grid; gap: 6px; }
.field > span, .field-label { font-size: 12px; color: #4f535a; font-weight: 720; }
.input, .textarea, .select { width: 100%; border: 1px solid var(--line); border-radius: 7px; background: #fff; color: var(--ink); }
.input, .select { min-height: 40px; padding: 0 11px; }
.textarea { min-height: 96px; padding: 10px 11px; resize: vertical; line-height: 1.5; }
.input:hover, .textarea:hover, .select:hover { border-color: var(--line-strong); }
.input:focus, .textarea:focus, .select:focus { border-color: var(--brand); outline: 3px solid rgba(21, 94, 239, .12); }
.form-error { color: var(--danger); font-size: 12px; min-height: 18px; margin: 0; }
.form-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.stack { display: grid; gap: 14px; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(420px, .9fr); background: #fff; }
.auth-visual { min-height: 100vh; padding: 42px; background: #101114; color: #fff; display: grid; align-content: space-between; position: relative; overflow: hidden; }
.auth-visual::before { content: ""; position: absolute; inset: 0; opacity: .58; background-image: linear-gradient(#33363d 1px, transparent 1px), linear-gradient(90deg, #33363d 1px, transparent 1px); background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 85%); }
.auth-visual > * { position: relative; }
.auth-visual .brand-mark { background: #fff; color: #111; }
.auth-heading { max-width: 680px; margin: 0; font-size: clamp(42px, 6vw, 82px); line-height: .98; font-weight: 760; letter-spacing: 0; }
.auth-heading strong { color: #8fb2ff; font-weight: inherit; }
.auth-workbench { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; max-width: 720px; }
.auth-workbench div { min-height: 90px; border: 1px solid #3d4047; border-radius: 7px; padding: 14px; background: #181a1f; }
.auth-workbench span { display: block; color: #9ca2ac; font-size: 12px; margin-bottom: 8px; }
.auth-workbench strong { font-size: 15px; }
.auth-panel { display: grid; place-items: center; padding: 32px; background: #fff; }
.auth-box { width: min(400px, 100%); }
.auth-box h1 { margin: 28px 0 8px; font-size: 28px; }
.auth-box > p { margin: 0 0 24px; color: var(--muted); line-height: 1.5; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface-2); margin-bottom: 20px; }
.auth-tabs button { min-height: 35px; border: 0; border-radius: 5px; background: transparent; cursor: pointer; font-weight: 700; }
.auth-tabs button.active { background: #fff; box-shadow: 0 1px 4px rgba(20, 22, 26, .1); }
.password-note { margin: -4px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }

.dashboard-shell { min-height: 100vh; display: grid; grid-template-columns: 236px minmax(0, 1fr); }
.dashboard-sidebar { position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--line); background: #fff; padding: 18px 14px; display: grid; grid-template-rows: auto auto 1fr auto; gap: 20px; }
.sidebar-brand { padding: 0 6px; }
.new-project-btn { width: 100%; }
.side-nav { display: grid; align-content: start; gap: 4px; }
.side-nav button { min-height: 38px; padding: 0 10px; display: flex; align-items: center; gap: 10px; border: 0; border-radius: 6px; background: transparent; cursor: pointer; color: #555a62; font-weight: 650; text-align: left; }
.side-nav button:hover { background: var(--surface-2); color: var(--ink); }
.side-nav button.active { background: #e9eefb; color: #164eae; }
.side-account { border-top: 1px solid var(--line); padding-top: 14px; display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 34px; height: 34px; flex: none; border-radius: 50%; display: grid; place-items: center; background: #e8edff; color: #174ea6; font-weight: 850; }
.account-copy { min-width: 0; flex: 1; }
.account-copy strong, .account-copy span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-copy strong { font-size: 12px; }
.account-copy span { color: var(--muted); font-size: 11px; margin-top: 2px; }
.dashboard-main { min-width: 0; padding: 32px clamp(20px, 4vw, 56px) 64px; }
.dashboard-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 32px; }
.dashboard-head h1 { margin: 0; font-size: 24px; }
.dashboard-head p { margin: 5px 0 0; color: var(--muted); font-size: 13px; }
.dashboard-actions { display: flex; gap: 8px; }
.create-band { max-width: 900px; margin: 0 auto 42px; padding: 26px; border: 1px solid #cbd8f8; border-radius: 8px; background: #fff; box-shadow: 0 18px 50px rgba(28, 53, 103, .08); }
.create-band h2 { margin: 0 0 16px; font-size: 20px; }
.create-composer { border: 1px solid var(--line-strong); border-radius: 8px; background: #fff; padding: 12px; }
.create-composer textarea { width: 100%; min-height: 82px; border: 0; resize: vertical; padding: 2px; font: inherit; line-height: 1.5; outline: none; }
.composer-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.composer-foot .field { min-width: 200px; }
.compact-select { height: 34px; border: 1px solid var(--line); border-radius: 6px; padding: 0 28px 0 9px; background: #fff; color: var(--muted); font-size: 12px; font-weight: 700; }
.projects-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.projects-toolbar h2 { margin: 0; font-size: 16px; }
.search-box { position: relative; width: min(320px, 100%); }
.search-box svg { position: absolute; left: 10px; top: 10px; color: var(--muted); width: 17px; }
.search-box input { padding-left: 34px; }
.project-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.project-card { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #fff; cursor: pointer; transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.project-card:hover { border-color: #b6bdc8; box-shadow: 0 10px 24px rgba(24, 27, 32, .08); transform: translateY(-2px); }
.project-thumb { height: 178px; background: #eceef1; border-bottom: 1px solid var(--line); overflow: hidden; position: relative; }
.project-thumb iframe { width: 1366px; height: 768px; border: 0; transform: scale(.23); transform-origin: top left; pointer-events: none; background: #fff; }
.project-status { position: absolute; top: 9px; right: 9px; display: inline-flex; align-items: center; gap: 6px; min-height: 24px; padding: 0 8px; border-radius: 6px; background: rgba(255, 255, 255, .94); border: 1px solid rgba(205, 209, 216, .9); font-size: 10px; font-weight: 800; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #9ba1aa; }
.status-dot.ready { background: var(--success); }
.status-dot.queued, .status-dot.generating { background: var(--warning); }
.status-dot.error { background: var(--danger); }
.project-card-body { padding: 13px 14px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; }
.project-card h3 { margin: 0; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-card p { margin: 5px 0 0; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.favorite-button { border: 0; background: transparent; padding: 1px; cursor: pointer; color: #8a8f98; }
.favorite-button.active { color: #d47a00; fill: #ffc34b; }
.empty-state { grid-column: 1 / -1; min-height: 280px; display: grid; place-content: center; justify-items: center; border: 1px dashed var(--line-strong); border-radius: 8px; background: #fff; color: var(--muted); text-align: center; }
.empty-state svg { width: 30px; height: 30px; margin-bottom: 12px; }
.empty-state strong { color: var(--ink); }
.empty-state p { margin: 5px 0 0; font-size: 13px; }

.editor-shell { height: 100vh; overflow: hidden; background: #eef0f3; display: grid; grid-template-rows: 52px minmax(0, 1fr); }
.editor-topbar { display: grid; grid-template-columns: minmax(220px, 1fr) auto minmax(220px, 1fr); align-items: center; gap: 12px; padding: 0 10px; border-bottom: 1px solid var(--line); background: #fff; z-index: 20; }
.editor-project { display: flex; align-items: center; gap: 8px; min-width: 0; }
.editor-project .brand-mark { width: 30px; height: 30px; }
.back-button { border: 0; background: transparent; }
.project-name-button { min-width: 0; border: 0; background: transparent; padding: 6px; cursor: pointer; text-align: left; }
.project-name-button strong, .project-name-button span { display: block; max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-name-button strong { font-size: 13px; }
.project-name-button span { margin-top: 1px; color: var(--muted); font-size: 10px; }
.editor-tabs { display: flex; gap: 2px; align-self: stretch; }
.tab-btn { min-width: 70px; height: 100%; padding: 0 10px; border-width: 0 0 2px; border-color: transparent; color: var(--muted); font-size: 12px; font-weight: 740; }
.tab-btn.active { color: var(--ink); border-bottom-color: var(--ink); background: #fff; }
.editor-actions { display: flex; align-items: center; justify-content: flex-end; gap: 6px; }
.editor-body { min-height: 0; display: grid; grid-template-columns: 390px minmax(0, 1fr); }
.chat-panel { min-height: 0; border-right: 1px solid var(--line); background: #fff; display: grid; grid-template-rows: minmax(0, 1fr) auto; }
.messages { min-height: 0; overflow-y: auto; padding: 18px 16px 24px; display: grid; align-content: start; gap: 14px; }
.message { max-width: 94%; font-size: 13px; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.message.user { justify-self: end; background: #eef3ff; border: 1px solid #dce6ff; padding: 10px 12px; border-radius: 8px 8px 2px 8px; }
.message.assistant { justify-self: start; }
.message.system { max-width: 100%; padding: 8px 10px; color: var(--muted); background: #f7f8fa; border-left: 2px solid #b7bdc6; font-size: 11px; }
.message-meta { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 750; text-transform: uppercase; }
.job-progress { border: 1px solid #cdd9f6; border-radius: 7px; background: #f5f8ff; padding: 12px; display: grid; gap: 10px; }
.job-progress-head { display: flex; align-items: center; gap: 9px; font-size: 12px; font-weight: 760; }
.job-progress-track { height: 4px; border-radius: 4px; background: #dce5f7; overflow: hidden; }
.job-progress-track span { display: block; height: 100%; background: var(--brand); transition: width .25s ease; }
.chat-composer { border-top: 1px solid var(--line); padding: 12px; background: #fff; }
.prompt-box { border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px; }
.prompt-box textarea { width: 100%; min-height: 80px; max-height: 220px; border: 0; padding: 1px; outline: 0; resize: vertical; line-height: 1.45; }
.prompt-actions { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; }
.mode-switch { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface-2); }
.mode-switch button { min-height: 28px; padding: 0 9px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); font-size: 11px; font-weight: 750; cursor: pointer; }
.mode-switch button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(18, 20, 24, .11); }
.workspace { min-width: 0; min-height: 0; display: grid; grid-template-rows: 44px minmax(0, 1fr); }
.workspace-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 10px; border-bottom: 1px solid var(--line); background: #fafbfc; }
.toolbar-group { display: flex; align-items: center; gap: 5px; }
.path-control { min-width: min(280px, 28vw); height: 32px; border: 1px solid var(--line); border-radius: 6px; background: #fff; display: flex; align-items: center; padding: 0 9px; color: var(--muted); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.segmented { display: inline-flex; padding: 2px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.segmented button { width: 29px; height: 27px; padding: 0; border: 0; border-radius: 4px; display: grid; place-items: center; color: var(--muted); }
.segmented button.active { background: var(--surface-2); color: var(--ink); }
.segmented svg { width: 15px; height: 15px; }
.workspace-stage { min-width: 0; min-height: 0; overflow: auto; display: grid; place-items: start center; padding: 18px; background-color: #e5e7ea; background-image: linear-gradient(45deg, #dfe1e4 25%, transparent 25%), linear-gradient(-45deg, #dfe1e4 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #dfe1e4 75%), linear-gradient(-45deg, transparent 75%, #dfe1e4 75%); background-size: 20px 20px; background-position: 0 0, 0 10px, 10px -10px, -10px 0; }
.preview-frame-wrap { height: calc(100vh - 132px); min-height: 480px; width: 100%; max-width: 100%; background: #fff; box-shadow: 0 2px 18px rgba(25, 27, 31, .17); transition: width .2s ease; }
.preview-frame-wrap.tablet { width: 768px; }
.preview-frame-wrap.mobile { width: 390px; }
.preview-frame { width: 100%; height: 100%; border: 0; background: #fff; }
.workspace-panel { min-width: 0; min-height: 0; width: 100%; height: 100%; background: #fff; overflow: auto; }
.file-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); height: 100%; }
.file-tree { border-right: 1px solid var(--line); padding: 12px; }
.file-row { min-height: 34px; display: flex; align-items: center; gap: 8px; border-radius: 5px; padding: 0 8px; background: #eef3ff; color: #174ea6; font-size: 12px; font-weight: 700; }
.file-content { padding: 18px; }
.file-content h2 { margin: 0 0 6px; font-size: 16px; }
.file-content p { margin: 0 0 18px; color: var(--muted); font-size: 12px; }
.code-editor { width: 100%; height: calc(100vh - 190px); min-height: 440px; border: 1px solid var(--line); border-radius: 7px; padding: 14px; resize: none; background: #15171b; color: #e9edf2; font: 12px/1.55 "SFMono-Regular", Consolas, "Liberation Mono", monospace; tab-size: 2; }
.code-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }
.more-layout { max-width: 980px; margin: 0 auto; padding: 28px; display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 28px; }
.more-nav { display: grid; align-content: start; gap: 4px; }
.more-nav button { min-height: 36px; border: 0; border-radius: 6px; background: transparent; padding: 0 10px; text-align: left; color: var(--muted); cursor: pointer; font-weight: 680; }
.more-nav button.active { background: #edf2fc; color: #174ea6; }
.settings-section { display: grid; gap: 18px; }
.settings-section h2 { margin: 0; font-size: 20px; }
.settings-section > p { margin: -10px 0 0; color: var(--muted); font-size: 12px; }
.settings-group { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 13px; }
.settings-group h3 { margin: 0; font-size: 14px; }
.setting-row { display: grid; grid-template-columns: minmax(160px, .65fr) minmax(220px, 1.35fr); gap: 24px; align-items: start; }
.setting-copy strong { display: block; font-size: 13px; }
.setting-copy span { display: block; margin-top: 4px; color: var(--muted); font-size: 11px; line-height: 1.45; }
.connection-state { display: flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: 7px; font-size: 12px; }
.connection-state.connected { border-color: #a9d8c8; background: #f0faf6; color: var(--success); }
.publish-url { overflow-wrap: anywhere; color: var(--brand); font-size: 12px; }
.danger-zone { border-top-color: #ebbbbb; }

.visual-toolbar { position: fixed; z-index: 60; left: calc(390px + (100vw - 390px) / 2); transform: translateX(-50%); bottom: 18px; width: min(740px, calc(100vw - 440px)); min-width: 0; padding: 10px; display: grid; grid-template-columns: minmax(150px, 1fr) 104px 104px 82px 82px auto; gap: 8px; align-items: end; border: 1px solid #bdc6d6; border-radius: 8px; background: rgba(255, 255, 255, .98); box-shadow: var(--shadow); }
.visual-toolbar .field { min-width: 0; }
.visual-toolbar .input { min-width: 0; height: 34px; min-height: 34px; font-size: 11px; }
.visual-toolbar input[type="color"] { padding: 3px; }
.history-drawer { position: fixed; z-index: 80; top: 52px; right: 0; bottom: 0; width: min(390px, 100vw); border-left: 1px solid var(--line); background: #fff; box-shadow: -10px 0 28px rgba(24, 27, 31, .12); display: grid; grid-template-rows: 54px minmax(0, 1fr); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 0 14px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { margin: 0; font-size: 15px; }
.version-list { overflow-y: auto; padding: 12px; display: grid; align-content: start; gap: 8px; }
.version-row { border: 1px solid var(--line); border-radius: 7px; padding: 11px; display: grid; gap: 7px; }
.version-row.current { border-color: #9db9f8; background: #f5f8ff; }
.version-row-head { display: flex; justify-content: space-between; gap: 10px; }
.version-row strong { font-size: 12px; }
.version-row span { color: var(--muted); font-size: 10px; }
.version-row p { margin: 0; font-size: 11px; line-height: 1.4; }
.modal-backdrop { position: fixed; z-index: 120; inset: 0; background: rgba(18, 20, 24, .5); display: grid; place-items: center; padding: 20px; }
.modal { width: min(500px, 100%); max-height: calc(100vh - 40px); overflow-y: auto; border: 1px solid var(--line); border-radius: 8px; background: #fff; box-shadow: var(--shadow); }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font-size: 17px; }
.modal-body { padding: 18px; }
.modal-actions { padding: 14px 18px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 8px; }
.toast-region { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: grid; gap: 8px; width: min(360px, calc(100vw - 32px)); }
.toast { padding: 11px 13px; border: 1px solid #b9c0ca; border-radius: 7px; background: #fff; box-shadow: var(--shadow); font-size: 12px; line-height: 1.45; }
.toast.error { border-color: #e0a1a1; color: #9f2525; }

@media (max-width: 1120px) {
  .project-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .editor-body { grid-template-columns: 340px minmax(0, 1fr); }
  .visual-toolbar { left: calc(340px + (100vw - 340px) / 2); width: min(590px, calc(100vw - 370px)); grid-template-columns: minmax(130px, 1fr) 84px 84px auto; }
  .visual-toolbar .field:nth-of-type(4), .visual-toolbar .field:nth-of-type(5) { display: none; }
}

@media (max-width: 820px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-visual { display: none; }
  .auth-panel { min-height: 100vh; }
  .dashboard-shell { grid-template-columns: 68px minmax(0, 1fr); }
  .dashboard-sidebar { padding: 14px 8px; }
  .sidebar-brand .brand-lockup > span, .side-nav button span, .side-account .account-copy, .new-project-btn span { display: none; }
  .sidebar-brand { display: grid; place-items: center; }
  .side-nav button, .new-project-btn { justify-content: center; padding: 0; }
  .side-account { justify-content: center; }
  .dashboard-main { padding: 24px 16px 50px; }
  .editor-topbar { grid-template-columns: minmax(120px, 1fr) auto; }
  .editor-tabs { position: fixed; z-index: 30; left: 0; right: 0; bottom: 0; height: 52px; border-top: 1px solid var(--line); background: #fff; justify-content: space-around; }
  .editor-tabs .tab-btn { flex: 1; }
  .editor-actions .hide-tablet, .project-name-button span { display: none; }
  .editor-body { grid-template-columns: 1fr; padding-bottom: 52px; }
  .chat-panel { border-right: 0; }
  .editor-shell[data-mobile-view="workspace"] .chat-panel { display: none; }
  .editor-shell[data-mobile-view="chat"] .workspace { display: none; }
  .workspace { grid-template-rows: 42px minmax(0, 1fr); }
  .preview-frame-wrap { height: calc(100vh - 146px); }
  .path-control { min-width: 0; flex: 1; }
  .visual-toolbar { left: 12px; right: 12px; bottom: 64px; width: auto; transform: none; grid-template-columns: minmax(130px, 1fr) 70px auto; }
  .visual-toolbar .field:nth-of-type(2) { display: none; }
  .more-layout { grid-template-columns: 1fr; padding: 18px; gap: 18px; }
  .more-nav { display: flex; overflow-x: auto; }
  .more-nav button { flex: none; }
}

@media (max-width: 600px) {
  .project-grid { grid-template-columns: 1fr; }
  .dashboard-head { align-items: flex-start; }
  .dashboard-actions .btn span { display: none; }
  .create-band { padding: 16px; }
  .composer-foot { align-items: flex-end; }
  .composer-foot .field { min-width: 0; flex: 1; }
  .projects-toolbar { align-items: stretch; flex-direction: column; }
  .search-box { width: 100%; }
  .editor-actions .btn span { display: none; }
  .project-name-button strong { max-width: 115px; }
  .toolbar-group .segmented { display: none; }
  .file-layout { grid-template-columns: 1fr; }
  .file-tree { border-right: 0; border-bottom: 1px solid var(--line); }
  .code-editor { height: calc(100vh - 260px); }
  .setting-row { grid-template-columns: 1fr; gap: 10px; }
  .visual-toolbar { grid-template-columns: minmax(0, 1fr) auto; }
  .visual-toolbar .field:not(:first-child) { display: none; }
}

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