@font-face {
  font-family: "Space Grotesk";
  src: url("/brand/space-grotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --page: #0d151e;
  --side: #121f2a;
  --panel: #172731;
  --edge: #354b58;
  --ink: #f3f7f8;
  --muted: #c2d0d9;
  --quiet: #a8bcc7;
  --acid: #a4eed3;
  --danger: #ffbbb6;
  --ring: #9aefd5;
  --studio-input: #0f1923;
  --studio-raised: #1b2c37;
  --studio-selected: #244047;
  --studio-hover: #233744;
  --studio-focus: #80d7bf;
  --studio-accent-ink: #132e25;
  --studio-content-width: 900px;
  font-family: "Space Grotesk", "Segoe UI", system-ui, sans-serif;
  scrollbar-color: #4c6572 transparent;
}

::selection { background: var(--acid); color: var(--studio-accent-ink); }
.studio { grid-template-columns: clamp(218px, 18.6vw, 264px) minmax(0, 1fr); }
.studio .brand { gap: 10px; color: var(--ink); font: 700 1.39rem/1 "Space Grotesk", "Segoe UI", system-ui, sans-serif; letter-spacing: -.037em; }
.studio .brand-mark { display: inline-block; width: 28px; height: 28px; flex: none; object-fit: contain; background: transparent; clip-path: none; }
.status-dot { width: 6px; height: 6px; box-shadow: 0 0 10px #a4eed336; }
.primary, .send { background: var(--acid); color: var(--studio-accent-ink); border-radius: 8px; }
.primary:hover, .send:hover { background: #c4f7e5; }
.ghost, .secondary { background: var(--studio-raised); border-color: var(--edge); border-radius: 7px; font-size: .82rem; }
.ghost:hover, .secondary:hover { background: var(--studio-hover); border-color: #5b7782; }

.side { padding: 22px 14px 14px; border-right: 1px solid #2f444f; overflow-y: auto; }
.side .brand { margin: 1px 0 21px; padding-left: 8px; }
.new-chat { min-height: 44px; border: 1px solid #507776; border-radius: 7px; padding: 8px 10px; background: #1c343b; color: #e2fdf3; font-size: .91rem; }
.new-chat:hover { background: #27474d; border-color: #7db4a6; }
.side-label { margin: 22px 10px 8px; color: #aebfc9; font-size: .68rem; letter-spacing: .105em; }
.mode-nav, .side-bottom, .recent { gap: 2px; }
.mode-nav { grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; gap: 4px; border: 1px solid var(--edge); border-radius: 8px; background: var(--studio-input); }
.mode-nav button { justify-content: center; }
.mode-nav button, .side-bottom button, .recent button { min-height: 36px; padding: 6px 9px; font-size: .86rem; gap: 8px; }
.mode-nav button:hover, .side-bottom button:hover, .recent button:hover { background: var(--studio-hover); }
.mode-nav button.selected, .recent button.selected { background: var(--studio-selected); border-color: #4a7175; color: var(--ink); }
.mode-icon, .account-mark { min-width: 22px; color: #a0e7d0; }
.account-mark { background: #285055; color: #ddfbef; }
.project-label { margin-top: 14px; }
.project-label .ghost, .project-picker .ghost { min-height: 30px; }
.project-picker select, .conversation-tools select { background: var(--studio-input); min-height: 34px; color: var(--ink); font-size: .83rem; }
.history-heading { margin: 15px 0 5px; }
.history-heading button { padding: 5px 8px; }
.recent { margin-bottom: 9px; }
.recent p { font-size: .8rem; }
.side-bottom { border-top-color: var(--edge); padding-top: 9px; }
.side-bottom button { flex: none; }
.side-bottom #logout { margin-top: 2px; }
#open-terminal > span:last-child:not(:first-child) { display: none; }

.main { background: radial-gradient(ellipse at 80% 16%, #152933, var(--page) 61%); }
.top { min-height: 65px; padding-inline: clamp(15px, 3.15vw, 46px); border-bottom-color: var(--edge); background: #121f2a; }
.top-left { gap: 10px; color: var(--ink); }
.top-muted { color: var(--muted); }
.slash { color: #a8bbc7; }
.model-picker { border: 1px solid #536e79; border-radius: 8px; background: var(--studio-raised); padding: 5px 8px 5px 12px; }
.model-picker select { max-width: 215px; font-size: .85rem; }
.model-picker option { background: var(--panel); }
.menu { color: var(--ink); }

.intro {
  position: relative;
  isolation: isolate;
  flex: none;
  width: min(100% - 80px, var(--studio-content-width));
  padding: 36px 0 24px;
  text-align: start;
}
.welcome-mark { width: 49px; height: 49px; margin: 0 0 20px; background: #203740; border: 1px solid #4e7479; border-radius: 10px; }
.welcome-mark .brand-mark { width: 25px; height: auto; }
.intro h1 { font-size: clamp(2.3rem, 5vw, 4.6rem); font-weight: 650; letter-spacing: -.067em; line-height: 1.02; }
.intro h1 em { color: #c6f3e5; font-family: Georgia, serif; font-style: italic; font-weight: 400; }
.intro > p { margin-top: 13px; color: var(--muted); font-size: 1.04rem; line-height: 1.58; }
.ideas { max-width: none; margin: 26px 0 0; gap: 9px; }
.idea { position: relative; align-content: center; justify-items: start; min-height: 87px; padding: 12px 13px; gap: 4px; border-radius: 7px; border-color: #3b5563; background: #172631eb; }
.idea:hover { background: #203641; border-color: #729a9b; }
.idea strong { font-size: .91rem; font-weight: 650; }
.idea span { font-size: .8rem; line-height: 1.4; }
.idea::before { content: ""; width: 12px; height: 12px; margin-bottom: 3px; border: 1px solid #a2e5cd; border-radius: 3px; transform: rotate(45deg) scale(.82); }
.idea:nth-child(2)::before { transform: none; border-radius: 2px; border-bottom: 3px double #a2e5cd; }
.idea:nth-child(3)::before { transform: none; border-radius: 50%; box-shadow: inset 0 0 0 2px #172631, inset 0 0 0 3px #a2e5cd; }
.idea::after { content: none; }

.conversation, .compose-area { width: min(100% - 80px, var(--studio-content-width)); }
.conversation { padding-top: 23px; }
.conversation-header { margin-bottom: 18px; }
.conversation-header h2 { font-size: 1.05rem; font-weight: 640; }
.messages { gap: 18px; }
.message { background: #15222c; border-color: #3a4e5a; border-radius: 10px; padding: 17px 19px; }
.message.user { border-color: #486b72; background: #203641; }
.message-head { flex-wrap: wrap; color: #b5f1db; font-size: .73rem; font-weight: 650; }
.message-actions { flex-wrap: wrap; min-width: 0; }
.message-body { font-size: 1rem; line-height: 1.6; }
.message.is-message-match { border-color: var(--studio-focus); box-shadow: 0 0 0 1px var(--studio-focus); }
.message-body pre, dialog pre, .markdown-body :not(pre) > code, .code-snippet,
.markdown-table-scroll, .markdown-table-scroll th, .markdown-table-scroll td { border-color: var(--edge); }
.message-body pre, dialog pre, .markdown-body :not(pre) > code, .code-snippet { background: #0b151e; }
.message-body .code-snippet pre { background: transparent; }
.markdown-table-scroll th { background: var(--studio-raised); }
.markdown-body blockquote { border-left-color: #76c8b3; }
.code-snippet-bar { border-bottom-color: var(--edge); }
.code-snippet-actions .code-preview { border-color: #527a7d; }

.compose-area { position: relative; padding-bottom: max(13px, env(safe-area-inset-bottom)); }
.compose { background: #172832; border-color: #52707d; border-radius: 11px; box-shadow: 0 9px 34px #050c1258; padding: 12px; }
.compose:focus-within { border-color: var(--studio-focus); box-shadow: 0 0 0 2px #a4eed323, 0 9px 34px #050c1258; }
.compose textarea { min-height: 58px; padding-inline: 7px; font-size: 1rem; }
.compose textarea::placeholder { color: #aec3cf; }
.compose-actions { flex-wrap: wrap; gap: 6px; }
.compose-actions .secondary { min-height: 35px; padding-block: 6px; color: #d2e3e8; }
.compose-actions > span { margin: 0 0 0 auto; color: #becfd7; font-size: .73rem; }
.compose-actions .send { flex: none; margin-inline-start: 0; width: 39px; height: 39px; }
.attachment { background: #223f45; border-color: #52767c; }
.attachment button:hover { background: #34575c; }
.foot-note { font-size: .72rem; }
#open-project-instructions.active-instructions { border-color: #78a8a0; }

dialog { max-height: calc(100dvh - 24px); overflow: auto; border-color: #54707c; border-radius: 14px; background: #172631; padding: 22px; box-shadow: 0 22px 70px #02090da0; }
dialog::backdrop { background: #07111bcc; }
#account-settings { width: min(480px, calc(100% - 28px)); }
#account-identity { margin-bottom: 17px; overflow-wrap: anywhere; }
#account-password-form button { margin-top: 6px; }
#account-settings-recovery { color: var(--acid); }
.dialog-head h2 { font-size: 1.23rem; letter-spacing: -.025em; font-weight: 650; }
.dialog-head .ghost { min-width: 35px; min-height: 35px; }
dialog .downloads a:hover { background: var(--studio-hover); border-color: #597d81; }
dialog form :is(input:not([type="checkbox"], [type="radio"], [type="file"]), select, textarea),
dialog :is(#token, #device-token, #retry-preview, #artifact-canvas, #artifact-source) { background: var(--studio-input); border-color: var(--edge); }
#project-edit-dialog { width: min(46rem, calc(100vw - 28px)); max-height: calc(100dvh - 28px); overflow: auto; }
#project-edit-scope-help { margin-top: 12px; }
#project-edit-scope { display: grid; gap: 5px; margin: 8px 0 4px; padding: 0; list-style: none; }
#project-edit-dialog #project-edit-scope label { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 9px; min-height: 36px; margin: 0; padding: 7px 9px; border: 1px solid var(--edge); border-radius: 5px; color: var(--ink); font: .75rem var(--mono); cursor: pointer; }
#project-edit-scope input { accent-color: var(--acid); }
#project-edit-scope span { overflow-wrap: anywhere; }
#project-edit-scope small { color: var(--muted); }
#project-edit-scope input:checked ~ small { color: var(--acid); }
#project-edit-scope-status { margin: 0 0 12px; }
#project-edit-dialog label { display: block; margin: 0 0 6px; color: var(--muted); font-size: .82rem; }
#project-edit-dialog textarea { display: block; width: 100%; min-height: 88px; padding: 10px 12px; resize: vertical; border: 1px solid var(--edge); border-radius: 8px; background: var(--studio-input); color: var(--ink); }
#project-edit-summary { overflow-wrap: anywhere; }
#project-edit-test-tools { margin: 16px 0; }
#project-edit-test-tools .token-actions { align-items: center; }
#download-project-candidate { padding: 7px 10px; border: 1px solid var(--edge); border-radius: 7px; text-decoration: none; font-size: .82rem; }
#download-project-candidate:hover { background: var(--studio-hover); }
#project-edit-revision { margin: 14px 0; padding: 13px; border: 1px solid var(--edge); border-radius: 8px; }
#project-revision-model { display: block; width: min(100%, 24rem); margin-bottom: 10px; padding: 8px; color: var(--ink); border: 1px solid var(--edge); border-radius: 7px; }
#project-edit-revision .project-revision-source { display: flex; align-items: center; gap: 7px; margin-bottom: 10px; cursor: pointer; }
#project-revision-original { accent-color: var(--acid); }
#project-revision-destination { margin-bottom: 10px; overflow-wrap: anywhere; }
#project-edit-diffs section { min-width: 0; margin: 14px 0; }
#project-edit-diffs h3 { margin: 0; color: var(--ink); font: 600 .82rem var(--mono); overflow-wrap: anywhere; }
#project-edit-diffs pre { max-height: 38dvh; min-height: 55px; margin: 6px 0 0; padding: 7px 0; background: var(--studio-input); border-color: var(--edge); font-size: .76rem; }
#project-edit-diffs pre:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
#project-edit-diffs pre span { display: block; min-width: max-content; min-height: 1.55em; padding-inline: 10px; }
#project-edit-diffs .added { color: #b8efcc; background: #1d372d; }
#project-edit-diffs .removed { color: #ffc2c1; background: #42282f; }
#project-edit-diffs .range { color: #b9ccd6; }
#client-workspace { margin: 0 0 16px; }
#client-workspace label { display: block; margin-bottom: 5px; color: var(--muted); font-size: .82rem; }
#client-workspace div { display: flex; gap: 6px; align-items: stretch; }
#client-workspace-url { flex: 1; min-width: 0; padding: 8px 9px; border: 1px solid var(--edge); border-radius: 7px; background: var(--studio-input); color: var(--ink); font: .77rem var(--mono); }
#copy-workspace-url { flex: none; }
:is(#provider-health, .model-panel, .usage-limit, #passkey-list li, .usage-scroll th) { background: var(--studio-raised); border-color: var(--edge); }
.artifact-switch button[aria-pressed="true"] { background: var(--studio-selected); border-color: #648d8e; }

@media (min-width: 900px) {
  .intro::before {
    content: "";
    position: absolute;
    z-index: -1;
    inset: -50px -4% auto auto;
    width: min(54%, 520px);
    height: 260px;
    opacity: .32;
    background: url("/brand/instrument.webp") 68% center / cover no-repeat;
    mask-image: radial-gradient(ellipse at 57% 45%, #000 10%, transparent 74%);
    pointer-events: none;
  }
}

@media (min-width: 691px) and (min-height: 720px) {
  .main:has(.intro:not([hidden])) .main-scroll { flex: 0 1 auto; margin-top: auto; }
  .main:has(.intro:not([hidden])) .compose-area { margin-bottom: auto; }
}

@media (max-width: 960px) {
  .intro, .conversation, .compose-area { width: calc(100% - 52px); }
  .side { padding-inline: 11px; }
}

@media (max-width: 690px) {
  .studio { grid-template-columns: minmax(0, 1fr); position: relative; }
  .side { position: absolute; inset: 58px auto 0 0; width: min(275px, 88vw); z-index: 5; padding: 18px 12px; box-shadow: 13px 0 44px #030b13a8; visibility: hidden; transform: translateX(-100%); transition: transform .16s ease, visibility .16s; }
  .side.open { visibility: visible; transform: none; }
  .side .brand { margin-bottom: 18px; }
  .menu { display: grid !important; place-items: center; width: 37px; height: 37px; padding: 0; flex: none; }
  .top { min-height: 58px; gap: 8px; }
  .top-left { gap: 7px; }
  .model-picker { padding-inline: 7px 4px; gap: 4px; }
  .model-picker select { max-width: min(148px, 37vw); }
  .intro, .conversation, .compose-area { width: calc(100% - 30px); }
  .intro { padding: 22px 0 21px; }
  .welcome-mark { width: 44px; height: 44px; margin-bottom: 16px; border-radius: 10px; }
  .intro > p { font-size: .96rem; margin-top: 10px; }
  .ideas { grid-template-columns: minmax(0, 1fr); gap: 6px; margin-top: 18px; }
  .idea { min-height: 54px; padding: 7px 11px 7px 37px; gap: 1px; }
  .idea::before { position: absolute; top: 50%; left: 13px; margin: -5px 0 0; }
  .message { padding: 13px; }
  .message-body { font-size: .96rem; }
  .compose-area { padding-bottom: max(7px, env(safe-area-inset-bottom)); }
  .compose { padding: 8px; }
  .compose textarea { min-height: 51px; }
  .compose-actions .secondary { padding-inline: 7px; }
  .compose-actions > span { padding-left: 2px; }
  :is(dialog, #devices, #usage) { padding: 15px; }
}

@media (max-height: 770px) {
  .side { padding-block: 14px 9px; }
  .side .brand { margin-bottom: 15px; }
  .side-label { margin-top: 14px; }
  .side-bottom button, .mode-nav button, .recent button { min-height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .side { transition: none; }
}
