/* Studio shell and component refinements. Core media/prose styles live in app.css. */
:root { --sidebar-w: 224px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; padding: 12px 18px; border-radius: 10px; color: var(--on-accent); background: var(--accent); }
.skip-link:focus { top: 12px; }
.grain { opacity: .035; }
.halo { opacity: .055; }
button:disabled { cursor: not-allowed; opacity: .45; transform: none; }
.top { height: calc(76px + env(safe-area-inset-top)); padding-inline: 28px; gap: 16px; background: var(--bg); border-bottom: 1px solid var(--line); }
.brand { margin-right: auto; flex: none; gap: 11px; font-size: 30px; }
.brand-caption { font: 500 9px/1.5 var(--mono); letter-spacing: .17em; color: var(--ink-3); border-left: 1px solid var(--line-2); padding-left: 18px; margin-left: 10px; }
.top-right { gap: 7px; }
.icon-btn { width: 42px; height: 42px; flex: none; }
.key-state { width: auto; height: 30px; display: inline-flex; align-items: center; gap: 7px; padding: 0 10px; margin: 0 10px 0 0; border-radius: 99px; background: var(--surface); color: var(--ink-2); border: 1px solid var(--line); font: 500 11px/1 var(--sans); box-shadow: none; }
.key-state::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--ink-3); }
.key-state.ok, .key-state.bad { background: var(--surface); box-shadow: none; }
.key-state.ok::before { background: var(--c-ask); }
.key-state.bad::before { background: var(--c-video); }
.studio-nav { display: none; }
#stage { padding: calc(108px + env(safe-area-inset-top)) 32px calc(var(--dock-h) + 32px); scroll-padding-bottom: var(--dock-h); }
.welcome { max-width: 980px; padding-top: 12px; }
.eyebrow { font-size: 10px; line-height: 1.5; letter-spacing: .13em; margin-bottom: 20px; }
.greeting { font-size: clamp(43px, 5.6vw, 76px); line-height: 1.04; margin-bottom: 20px; animation: none; }
.welcome-copy { color: var(--ink-2); margin: 0 0 34px; font-size: 15px; line-height: 1.7; }
.mobile-break { display: none; }
.section-label { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 13px; }
.section-label h2 { margin: 0; font: 500 11px/1.5 var(--mono); text-transform: uppercase; letter-spacing: .11em; color: var(--ink-2); }
.section-label > span { font-size: 12px; color: var(--ink-3); }
.bento { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile, .tile:nth-child(n) { grid-column: auto; grid-row: auto; min-height: 172px; padding: 20px; border-radius: 16px; justify-content: flex-start; gap: 12px; animation: none; }
.tile:hover { transform: translateY(-2px); }
.tile-top { gap: 10px; }
.tile-icon { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent); border-radius: 10px; background: color-mix(in srgb, var(--accent) 7%, transparent); color: var(--accent); }
.tile-icon svg { width: 18px; height: 18px; }
.tile-name, .tile:nth-child(1) .tile-name { font: 400 27px/1 var(--serif); margin-right: auto; }
.tile-key { border: 0; padding: 0; font-size: 10px; }
.tile-desc { margin: 0; font-size: 13px; line-height: 1.55; max-width: 30ch; }
.tile-try, .tile:nth-child(1) .tile-try { display: block; font: 400 12px/1.5 var(--sans); margin-top: auto; padding-top: 2px; opacity: 1; }
.tile-glyph { display: none; }
.legal-links { margin-top: 22px; font-size: 11px; color: var(--ink-3); }
.legal-links a { color: var(--ink-2); text-underline-offset: 3px; }
.dock { padding-inline: 24px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
.dock-inner { max-width: 860px; }
.dock::before { inset-block-start: -32px; }
.composer { border-radius: 20px; background: var(--bg-2); }
.modes { padding: 7px 8px 0; }
.mode { height: 40px; font-size: 13px; color: var(--ink-2); border-radius: 10px; }
.mode-ink { top: 7px; height: 40px; border-radius: 10px; }
.composer-row { padding: 12px 12px 8px; gap: 5px; }
.composer-row .icon-btn { width: 42px; height: 44px; }
#input { padding: 10px 6px; min-height: 44px; }
.send { width: 44px; height: 44px; border-radius: 14px; }
.options { padding: 6px 12px 12px; gap: 7px; mask-image: none; -webkit-mask-image: none; }
.options .chip, .options .opt select { min-height: 34px; }
.composer-hint { display: flex; justify-content: space-between; gap: 12px; margin: 8px 5px 0; color: var(--ink-3); font-size: 10px; line-height: 1.5; }
.connection-banner { margin: 0 auto 18px; padding: 12px 16px; max-width: 980px; border: 1px solid var(--line-2); border-radius: 12px; font-size: 13px; color: var(--ink-2); background: var(--bg-2); }
.drawer { padding-inline: 22px; }
.drawer-description { margin: -3px 0 20px; color: var(--ink-2); font-size: 13px; }
.drawer-head h3 { font-size: 36px; }
.empty-note { text-align: center; padding: 42px 22px; font: 14px/1.65 var(--sans); color: var(--ink-2); }
.empty-note strong { display: block; margin-bottom: 8px; font: 400 28px/1.2 var(--serif); color: var(--ink); }
.empty-note .chip { display: inline-flex; align-items: center; min-height: 40px; margin-top: 18px; }
.thread { padding: 6px 8px; }
.thread-open { display: flex; align-items: center; gap: 10px; text-align: left; flex: 1; min-width: 0; padding: 8px 0; }
.thread-body { min-width: 0; }
.thread-title, .thread-sub { display: block; }
.thread .del { opacity: .7; }
button.lib-item { display: block; width: 100%; text-align: left; }
.lib-grid .empty-note { column-span: all; }
.settings-nav { display: flex; gap: 6px; padding: 12px 0 18px; flex-wrap: wrap; }
.settings-nav .chip { min-height: 38px; font-family: var(--sans); font-size: 13px; padding-inline: 14px; }
.sheet-foot { position: sticky; bottom: -22px; background: var(--bg-2); padding-block: 16px 8px; margin-top: auto; z-index: 1; }
.sheet-body { min-height: 360px; }
.field-group h4 { font-size: 11px; }
.field small { line-height: 1.6; }
.onboard .sheet-body { padding: 32px; gap: 12px; }
.onboard .onboard-art { height: 54px; margin: 0; scale: .6; transform-origin: top left; }
.onboard-title { font-size: 52px; }
.onboard-copy { font-size: 14px; color: var(--ink-2); line-height: 1.7; margin: 0 0 8px; max-width: 44ch; }
.onboard .field { margin-bottom: 2px; }
.onboard .field > span { font-size: 12px; }
.onboard .field small { display: inline; margin-left: 6px; }
.onboard .onboard-actions { justify-content: stretch; }
.onboard .btn-primary { width: 100%; min-height: 46px; }
.onboard .legal-links { margin: 4px 0 0; text-align: center; }
.onboard input { font-size: 16px; }
.file-chip { position: relative; }
.file-chip input[type=file] { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.file-chip:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.seg input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: -2px; }
.actions { opacity: .85; }
.mini { min-height: 34px; }
.prose { line-height: 1.8; }
.viewer-body { overflow: auto; }
.viewer-body img { min-height: 0; object-fit: contain; }

@media (min-width: 1100px) {
  .top > #threadsBtn { display: none; }
  .top-right > #youBtn, .top-right > #libraryBtn, .top-right > #settingsBtn { display: none; }
  .top-right #newBtn { border: 1px solid var(--line); }
  .studio-nav { position: fixed; display: flex; flex-direction: column; left: 0; top: calc(76px + env(safe-area-inset-top)); bottom: 0; width: var(--sidebar-w); padding: 28px 18px 24px; border-right: 1px solid var(--line); background: var(--bg); z-index: 20; }
  .nav-caption { font: 500 9px/1.5 var(--mono); letter-spacing: .14em; margin: 0 12px 16px; color: var(--ink-3); }
  .nav-new { display: flex; align-items: center; gap: 9px; padding: 12px; margin-bottom: 15px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 11px; font-size: 13px; }
  .nav-new > span { color: var(--accent); font-size: 19px; line-height: 1; }
  .nav-new kbd { display: none; }
  .nav-item { display: flex; gap: 12px; align-items: center; min-height: 44px; padding: 10px 12px; width: 100%; text-align: left; font-size: 13px; border-radius: 10px; color: var(--ink-2); }
  .nav-item svg { width: 17px; height: 17px; }
  .nav-item:hover, .nav-new:hover { background: var(--surface-2); color: var(--ink); }
  .nav-note { padding: 38px 12px; color: var(--ink-3); }
  .nav-note-mark { font-size: 28px; color: var(--accent); }
  .nav-note p { font: 400 25px/1.2 var(--serif); margin: 16px 0 12px; color: var(--ink-2); }
  .nav-note > span:last-child { font-size: 10px; }
  .nav-bottom { margin-top: auto; }
  .nav-local { display: block; margin: 20px 12px 0; color: var(--ink-3); font-size: 10px; }
  #stage { margin-left: var(--sidebar-w); padding-inline: clamp(32px, 5vw, 80px); }
  .dock { left: var(--sidebar-w); padding-inline: 40px; }
  .toast { left: calc(50% + var(--sidebar-w) / 2); }
}
@media (max-width: 760px) {
  .top { padding-inline: 16px; gap: 10px; }
  .brand { font-size: 27px; }
  .brand-caption { display: none; }
  #stage { padding: calc(98px + env(safe-area-inset-top)) 20px calc(var(--dock-h) + 24px); }
  .welcome { padding-top: 0; }
  .greeting { font-size: clamp(42px, 8vw, 60px); margin-bottom: 16px; }
  .welcome-copy { margin-bottom: 28px; font-size: 14px; }
  .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tile, .tile:nth-child(n) { padding: 16px; min-height: 165px; }
  .tile-key { display: none; }
  .tile-name, .tile:nth-child(1) .tile-name { font-size: 25px; }
  .tile-desc { font-size: 12px; }
  .tile-try, .tile:nth-child(1) .tile-try { font-size: 11px; }
  .section-label > span { display: none; }
  .dock { padding-inline: 12px; }
  .composer-hint > span:first-child { display: none; }
  .composer-hint { justify-content: center; }
  .sheet-foot { bottom: -18px; }
  .drawer.you { width: min(560px, 100vw); }
}
@media (max-width: 480px) {
  .top { gap: 6px; padding-inline: 10px; }
  .top-right { gap: 0; }
  .top-right #newBtn { display: none; }
  .key-state { padding: 0; border: 0; margin-right: 6px; width: 16px; justify-content: center; }
  .key-state span { display: none; }
  .brand { font-size: 25px; gap: 7px; }
  .brand-mark { width: 16px; height: 16px; }
  .icon-btn { width: 38px; }
  .mobile-break { display: block; }
  .greeting { font-size: 43px; }
  .eyebrow { font-size: 9px; }
  .tile, .tile:nth-child(n) { padding: 13px; min-height: 172px; gap: 10px; }
  .tile-top { gap: 8px; }
  .tile-icon { width: 27px; height: 27px; border-radius: 8px; }
  .tile-name, .tile:nth-child(1) .tile-name { font-size: 24px; }
  .mode, .mode[aria-selected='true'] { flex: 1 0 0; flex-direction: column; height: 48px; gap: 5px; padding: 0 3px; min-width: 0; font-size: 10px; }
  .mode span { display: inline; }
  .mode svg { width: 15px; height: 15px; }
  .mode-ink { height: 48px; }
  .composer-row { padding: 8px 8px 4px; gap: 0; }
  .composer-row .icon-btn { width: 36px; }
  .options .chip, .options .opt select { min-height: 36px; }
  .options .opt-note { display: none; }
  .opt select { max-width: 174px; }
  .onboard .sheet-body { padding: 24px; }
  .onboard-title { font-size: 44px; }
  .onboard .field small { display: block; margin-left: 0; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
