/* Device Studio: the workspace surrounding the calibrated device rendering. */
@font-face { font-family: 'Studio Sans'; src: url('./vendor/safari-fonts/built/bonnie-avenir-next-400.woff2') format('woff2'); font-style: normal; font-weight: 400; font-display: swap; }
@font-face { font-family: 'Studio Display'; src: url('./vendor/safari-fonts/built/bonnie-palatino-700.woff2') format('woff2'); font-style: normal; font-weight: 700; font-display: swap; }

@layer studio {
  :root {
    --sans: 'Studio Sans', 'Avenir Next', sans-serif;
    --ground: #191c1b; --panel: #202422; --sunk: #272c29;
    --ink: #eeeede; --ink-2: #b6bdb4; --ink-3: #929d94;
    --rule: #373f38; --rule-2: #2b332d;
    --accent: #c9d9b1; --accent-ink: #243323; --canvas: #151916;
    --live: #a9cda2; --focus-ring: #a9cda2; --gutter: 0px;
    --r-control: 6px; --r-panel: 10px; --h-header: 66px;
  }
  :root[data-theme='light'] {
    --ground: #f6f5f0; --panel: #fdfcf8; --sunk: #eeeee6;
    --ink: #26352d; --ink-2: #59665c; --ink-3: #68756b;
    --rule: #dddfd3; --rule-2: #e8e9e0;
    --accent: #344e3d; --accent-ink: #f5f7eb; --canvas: #eeefe6;
    --live: #426747; --focus-ring: #426747;
  }
  button, a, input, select { -webkit-tap-highlight-color: transparent; }
  button:disabled { opacity: .45; cursor: not-allowed; }
  button:not(:disabled):active { transform: translateY(1px); }
  button[aria-busy='true'] { cursor: progress; }
  kbd { font: 10px/1.4 var(--sans); border: 1px solid var(--rule); border-radius: 4px; padding: 3px 5px; color: var(--ink-3); white-space: nowrap; }
  .eyebrow, .studio-breadcrumb, .canvas-label, .rail-section { font: 10px/1.4 var(--sans); letter-spacing: .12em; font-weight: 600; }
  .page { height: 100dvh; padding: 0 20px 52px 96px; }
  .top { margin-left: -96px; margin-right: -20px; padding: 0 24px; border-bottom: 1px solid var(--rule); gap: 24px; background: var(--panel); }
  .wordmark { display: flex; align-items: center; gap: 10px; font: 700 24px/1 'Studio Display', serif; letter-spacing: -.06em; text-decoration: none; }
  .brand-mark { display: grid; place-items: center; width: 30px; height: 34px; background: var(--accent); color: var(--accent-ink); border-radius: 9px 9px 12px 4px; font-size: 30px; padding-bottom: 5px; }
  .brand-suffix { color: var(--ink-3); font: 13px var(--sans); letter-spacing: -.02em; }
  .workspace-name { font-size: 11px; padding-left: 24px; border-left: 1px solid var(--rule); color: var(--ink-2); }
  .top .status { gap: 10px; font-size: 10px; }
  .top .status #attest-badge, .top .status .sep { display: none; }
  .top .line { display: none; }
  .top .links { gap: 14px; }
  .command-trigger { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 7px 9px 7px 12px; border: 1px solid var(--rule); background: var(--ground); border-radius: 6px; color: var(--ink-3); font-size: 11px; }
  .command-trigger:hover { border-color: var(--ink-3); }
  .agent-connect { display: flex; align-items: center; gap: 8px; font-size: 11px; font-weight: 600; min-height: 34px; }
  .agent-connect svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.4; }
  .agent-connect .eye { fill: currentColor; stroke: none; }
  .studio-rail { position: absolute; left: 0; top: 66px; bottom: 40px; width: 76px; border-right: 1px solid var(--rule); display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 23px 7px 16px; background: var(--panel); z-index: 4; }
  .rail-section { font-size: 8px; color: var(--ink-3); margin-bottom: 12px; }
  .rail-tool { display: flex; flex-direction: column; gap: 7px; align-items: center; justify-content: center; width: 60px; min-height: 59px; border-radius: 7px; color: var(--ink-3); font-size: 9px; transition: color 120ms, background 120ms; }
  .rail-tool svg { display: block; height: 21px; width: 21px; stroke: currentColor; fill: none; stroke-width: 1.35; stroke-linecap: round; stroke-linejoin: round; }
  .rail-tool:hover, .rail-tool.selected { background: var(--sunk); color: var(--ink); }
  .rail-tool.selected { box-shadow: inset 0 0 0 1px var(--rule); }
  .rail-divider { width: 24px; border-top: 1px solid var(--rule); margin: 7px 0; }
  .rail-help { margin-top: auto; }
  .help-glyph { width: 20px; height: 20px; border: 1px solid currentColor; border-radius: 50%; text-align: center; font-size: 13px; }
  .strip.notice { margin: 0 -20px 0 -20px; padding: 9px 22px; height: auto; min-height: 33px; border-bottom: 1px solid var(--rule); background: var(--sunk); font-size: 10px; }
  .strip.notice strong { color: var(--ink-2); }
  .strip.notice strong::before { background: var(--live); }
  .strip.notice .grow { color: var(--ink-3); }
  .strip.notice .link { white-space: nowrap; font-size: 10px; }
  .studio-heading { display: flex; align-items: center; justify-content: space-between; gap: 20px; flex: none; padding: 24px 4px 23px; }
  .studio-breadcrumb { display: flex; gap: 10px; color: var(--ink-3); font-size: 8px; }
  .studio-breadcrumb span { opacity: .5; }
  .studio-heading h1 { margin-top: 7px; font: 400 clamp(20px, 1.8vw, 28px)/1.3 var(--sans); letter-spacing: -.045em; }
  .studio-heading-actions { display: flex; align-items: center; gap: 18px; }
  .studio-session { display: flex; align-items: center; gap: 7px; font-size: 10px; color: var(--ink-3); white-space: nowrap; }
  .studio-session .dot { background: var(--live); width: 5px; height: 5px; }
  .studio-heading-actions .btn { font-size: 10px; height: 32px; gap: 18px; }
  .stage { flex: 1 1 0; gap: 0; grid-template-columns: minmax(0, 1fr) 306px; min-height: 400px; border: 1px solid var(--rule); border-radius: 10px; background: var(--panel); overflow: clip; }
  #devices { height: auto; min-height: 0; background: var(--canvas); border-right: 1px solid var(--rule); }
  .canvas-bar { display: flex; align-items: center; gap: 12px; padding: 15px 18px; z-index: 2; flex: none; color: var(--ink-3); font-size: 10px; }
  .canvas-label { display: flex; align-items: center; gap: 6px; font-size: 8px; white-space: nowrap; }
  .canvas-label .dot { width: 5px; height: 5px; background: var(--live); }
  #studio-device-label { padding-left: 12px; border-left: 1px solid var(--rule); }
  .canvas-bar .link { margin-left: auto; font-size: 9px; white-space: nowrap; }
  .room { background-image: radial-gradient(var(--rule) .7px, transparent .7px); background-size: 18px 18px; mask-image: linear-gradient(transparent, #000 20%, #000 80%, transparent); }
  .room::before { opacity: .13; filter: blur(64px); }
  .phone-row { padding: 0 14px calc(var(--deck-h, 108px) + 16px); }
  .phone-stage:not([data-loaded='true']) .phone-row { padding-bottom: calc(var(--deck-h, 108px) + 102px); }
  .phone-cap { font-size: 9px; padding: 0 10px; max-width: 560px; line-height: 1.5; }
  .empty-screen { white-space: pre-line; font-size: 11px; width: 155px; line-height: 1.7; top: 60%; }
  .studio-start { position: absolute; left: 0; right: 0; bottom: calc(var(--deck-h, 108px) + 28px); z-index: 2; display: flex; align-items: center; flex-direction: column; gap: 8px; }
  .studio-start > span:first-child { color: var(--ink-2); font-size: 11px; }
  .studio-start .fine { font-size: 9px; }
  .phone-stage[data-loaded='true'] .studio-start { display: none; }
  .btn.studio-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; min-height: 35px; padding: 0 15px; font-size: 11px; transition: filter 140ms, transform 140ms; }
  .btn.studio-primary:hover:not(:disabled) { filter: brightness(1.12); }
  .deck { bottom: 12px; width: calc(100% - 28px); padding: 10px; border-radius: 9px; gap: 9px; background: var(--panel); box-shadow: 0 2px 5px #142a1710; }
  .deck .row { flex-wrap: wrap; height: auto; min-height: 32px; gap: 6px; }
  .deck .row:first-child { padding-bottom: 9px; border-bottom: 1px solid var(--rule-2); }
  .deck .select { width: 159px; }
  .deck .seg button { font-size: 10px; padding: 0 8px; }
  .deck .select select { font-size: 11px; }
  .deck .netlify { font-size: 9px; }
  .deck .addr { flex: 1 1 200px; background: var(--ground); border-color: var(--rule); }
  .deck .addr input { font-size: 11px; }
  .deck .addr .go { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-size: 10px; }
  .deck .via .pill { padding: 0 8px; font-size: 9px; cursor: pointer; }
  .deck .tog { font-size: 10px; padding: 0 7px; }
  .deck .ico { width: 28px; height: 28px; }
  .address-error { padding: 4px 3px; font-size: 11px; color: var(--refused); overflow-wrap: anywhere; }
  .watch { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
  .inspector-tabs { display: flex; gap: 3px; padding: 0 17px; height: 48px; border-bottom: 1px solid var(--rule); flex: none; }
  .inspector-tabs button { position: relative; flex: 1; text-align: center; color: var(--ink-3); font-size: 11px; border-bottom: 2px solid transparent; }
  .inspector-tabs button[aria-selected='true'] { color: var(--ink); border-bottom-color: var(--accent); }
  .inspector-tabs button:hover { color: var(--ink); }
  .activity-indicator { position: absolute; top: 15px; right: 6px; width: 5px; height: 5px; border-radius: 50%; background: var(--live); }
  .read, .console-panel, .activity { flex: 1; max-height: none; overflow: auto; padding: 22px 20px; border: none; min-height: 0; }
  .read { display: flex; gap: 12px; }
  .inspect-intro .eyebrow { color: var(--ink-3); font-size: 8px; }
  .inspect-intro h2 { display: block; margin: 13px 0 12px; font: 700 30px/1.1 'Studio Display', serif; letter-spacing: -.055em; color: var(--ink); }
  .inspect-intro p { font-size: 11px; line-height: 1.75; color: var(--ink-2); max-width: 30ch; }
  .inspect-intro .inspect-result-heading { display: none; }
  .phone-stage[data-findings] .inspect-empty-heading, .phone-stage[data-findings] .inspect-intro p { display: none; }
  .phone-stage[data-findings] .inspect-result-heading { display: block; font-size: 25px; }
  #studio-geometry-status[data-result='mismatch'] { color: var(--refused); }
  #studio-geometry-status[data-result='match'] { color: var(--live); }
  .inspect-button { width: 100%; display: flex; justify-content: space-between; margin-top: 4px; flex: none; }
  .read > .fine { font-size: 9px; line-height: 1.65; }
  .inspector-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding-top: 17px; margin-top: 3px; border-top: 1px solid var(--rule); }
  .inspector-section-head h2 { font-size: 11px; font-weight: 600; color: var(--ink); gap: 8px; }
  .inspector-section-head .eyebrow { font-size: 8px; color: var(--ink-3); }
  .inspector-section-head .link { font-size: 10px; }
  .ps-findings { overflow: visible; flex: none; font-size: 11px; gap: 12px; }
  .ps-findings .ps-empty { font-size: 10px; line-height: 1.8; color: var(--ink-3); padding: 2px 0 10px; }
  .ps-findings .f { line-height: 1.65; }
  .ps-findings button.f { width: calc(100% + 16px); margin: 0 -8px; padding: 6px 8px 6px 22px; text-align: left; border-radius: 4px; cursor: pointer; }
  .ps-findings button.f:hover, .ps-findings button.f[data-on='true'] { color: var(--ink); }
  /* The finding that is marked on the phone reads as the one selected here too. */
  .ps-findings button.f[data-on='true'] { background: color-mix(in srgb, var(--accent) 9%, transparent); box-shadow: inset 2px 0 0 var(--accent); }
  .phone .layer.marks { z-index: 20; overflow: hidden; }
  .phone .marks .mark { position: absolute; border: 2px solid #b3462d; background: #d86b4712; opacity: 0; transition: opacity 140ms; }
  .phone .marks .mark[data-on='true'] { opacity: 1; }
  .phone .marks .mark b { position: absolute; left: var(--lx, 0px); bottom: calc(100% + 4px); display: block; max-width: 290px; padding: 5px 8px; border-radius: 4px; background: #963c28; color: #fff8ef; font: 600 12px/1.4 var(--sans); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .phone .marks .mark[data-flip='true'] b { top: calc(100% + 4px); bottom: auto; }
  .ps-findings .f .fix { font-size: 10px; margin-top: 6px; background: var(--sunk); padding: 7px; border-radius: 4px; overflow-wrap: anywhere; }
  .ps-findings .clean { line-height: 1.7; font-size: 11px; }
  .read .findings { font-size: 9px; }
  .geometry-section { margin-top: auto; padding-top: 8px; }
  .studio-specs { margin: 13px 0; display: grid; gap: 10px; }
  .studio-specs div { display: flex; justify-content: space-between; gap: 8px; font-size: 10px; }
  .studio-specs dt { color: var(--ink-3); }
  .studio-specs dd { margin: 0; color: var(--ink); }
  .geometry-section .fine { font-size: 9px; line-height: 1.75; }
  #studio-copy-report { font-size: 10px; flex: none; width: 100%; justify-content: center; }
  .inspector-foot { display: flex; gap: 6px; align-items: center; padding: 14px 16px; border-top: 1px solid var(--rule); font-size: 9px; color: var(--ink-3); flex: none; }
  .inspector-foot .dot { width: 5px; height: 5px; background: var(--live); }
  .inspector-foot .link { margin-left: auto; font-size: 9px; }
  .console-panel .inspector-section-head { margin-top: 0; padding-top: 0; border: none; margin-bottom: 14px; }
  .console-panel .fine { font-size: 11px; line-height: 1.7; }
  .ps-log { margin-top: 20px; font-size: 10px; gap: 12px; overflow-wrap: anywhere; }
  .ps-log:empty::before { content: 'No console messages yet. Messages appear as you use the app.'; font: 11px/1.8 var(--sans); padding: 18px 0; border-top: 1px solid var(--rule); }
  .activity { display: flex; flex-direction: column; padding: 14px 17px; }
  .activity .side-head { flex-wrap: wrap; }
  ol.rail li { font-size: 11px; }
  ol.rail li .arg, ol.rail li[data-kind='call'] .name { font-size: 10px; }
  .side-foot .btn { font-size: 10px; }
  .bench { background: var(--panel); }
  .bench-bar { padding-left: 22px; padding-right: 22px; gap: 14px; }
  .bench-bar .fact, .bench-bar .link, .bench-bar .status { font-size: 10px; }
  .bench-toggle { font-size: 11px; }
  .bench .tabs [role='tab'] { font-size: 11px; }
  .machine-label { font-size: 10px; }
  .command-menu { position: fixed; inset: 15vh auto auto 50%; transform: translateX(-50%); margin: 0; padding: 0; width: min(560px, calc(100vw - 32px)); max-height: min(620px, 76dvh); color: var(--ink); background: var(--panel); border: 1px solid var(--rule); border-radius: 12px; box-shadow: 0 24px 100px #0b180d33; overflow: hidden; }
  .command-menu:popover-open { display: flex; flex-direction: column; animation: command-enter 180ms var(--ease); }
  .command-menu::backdrop { background: #0b180d38; }
  .command-search { display: flex; align-items: center; gap: 14px; padding: 16px 18px; border-bottom: 1px solid var(--rule); flex: none; }
  .command-search > span { font-size: 28px; color: var(--ink-3); }
  .command-search input { flex: 1; width: 0; border: 0; background: transparent; outline: none; color: var(--ink); font: 14px var(--sans); }
  .command-escape { color: var(--ink-3); border: 1px solid var(--rule); border-radius: 4px; padding: 3px 6px; font-size: 10px; }
  .command-results { padding: 8px; overflow: auto; min-height: 0; }
  .command-result { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 12px; width: 100%; border-radius: 6px; }
  .command-result:hover, .command-result:focus-visible { background: var(--sunk); outline-offset: -2px; }
  .command-result strong { font: 600 12px var(--sans); display: block; }
  .command-result small { display: block; font-size: 10px; color: var(--ink-3); margin-top: 4px; }
  .command-group { font-size: 9px; color: var(--ink-3); }
  .command-empty { padding: 28px 15px; font-size: 12px; color: var(--ink-2); }
  .command-footer { display: flex; justify-content: space-between; padding: 12px 18px; border-top: 1px solid var(--rule); font-size: 9px; color: var(--ink-3); flex: none; }
  .command-footer span span { margin-left: 16px; }
  @keyframes command-enter { from { opacity: 0; translate: 0 -8px; } to { opacity: 1; translate: 0 0; } }
  body[data-focus='true'] .studio-heading, body[data-focus='true'] .studio-rail, body[data-focus='true'] .watch { display: none; }
  body[data-focus='true'] .page { padding-left: 20px; padding-bottom: 12px; }
  body[data-focus='true'] .top { margin-left: -20px; }
  body[data-focus='true'] .stage { margin-top: 12px; grid-template-columns: minmax(0, 1fr); }
  body[data-focus='true'] #devices { border-right: none; }
  @media (min-width: 1600px) { .stage { grid-template-columns: minmax(0, 1fr) 340px; } .read { padding: 28px; } .studio-heading { padding-top: 30px; padding-bottom: 28px; } }
  @media (max-width: 1150px) { .workspace-name { display: none; } .top .status { margin-right: auto; } .studio-session { display: none; } .stage { grid-template-columns: minmax(0, 1fr) 280px; } .command-trigger { gap: 10px; } .deck .netlify { order: 4; } }
  @media (max-height: 820px) and (min-width: 901px) { .studio-heading { padding-top: 14px; padding-bottom: 14px; } .inspect-intro h2 { font-size: 26px; } .read { padding-top: 16px; } .canvas-bar { padding-top: 10px; padding-bottom: 10px; } }
  @media (max-width: 900px) {
    .page { height: auto; min-height: 100dvh; padding-left: 86px; padding-right: 12px; }
    .top { margin-left: -86px; margin-right: -12px; padding: 0 16px; }
    .studio-rail { position: fixed; }
    .stage { flex: none; grid-template-columns: minmax(0, 1fr); overflow: visible; }
    #devices { border-right: none; border-bottom: 1px solid var(--rule); border-radius: 10px 10px 0 0; }
    .phone-row { height: 650px; flex: none; }
    .watch { min-height: 480px; }
    .read { display: grid; grid-template-columns: 1fr 1fr; column-gap: 24px; }
    .inspect-intro { grid-column: 1; grid-row: 1 / span 2; }
    .read > .inspector-section-head, .ps-findings, .geometry-section, #studio-copy-report { grid-column: 1 / -1; }
    .geometry-section { margin-top: 0; }
    .console-panel, .activity { min-height: 360px; }
    .inspector-foot { margin-top: auto; }
    .studio-heading h1 { font-size: 22px; }
    .studio-heading-actions { display: none; }
    .strip.notice { margin-left: -10px; margin-right: -12px; }
    .top .status { display: none; }
    .command-trigger > span { display: none; }
    .command-trigger { padding: 5px; }
    body[data-focus='true'] .phone-row { height: calc(100dvh - 140px); }
  }
  @media (max-width: 600px) {
    .page { padding: 0 10px 110px; }
    .top { margin: 0 -10px; padding: 0 12px; height: 60px; flex-wrap: nowrap; gap: 10px; }
    .wordmark { font-size: 22px; gap: 7px; }
    .brand-suffix { display: none; }
    .top .links { gap: 8px; margin-left: auto; flex-wrap: nowrap; }
    .agent-connect { font-size: 10px; gap: 5px; }
    .agent-connect svg { width: 19px; }
    .command-trigger { min-width: 32px; min-height: 34px; }
    .command-trigger kbd { font-size: 0; border: none; padding: 0; }
    .command-trigger kbd::after { content: '⌕'; font-size: 24px; padding-left: 4px; }
    .studio-rail { position: relative; inset: auto; width: auto; margin: 0 -10px; padding: 4px 10px; flex-direction: row; gap: 2px; border-right: none; border-bottom: 1px solid var(--rule); }
    .rail-section, .rail-divider { display: none; }
    .rail-tool { flex: 1; width: auto; min-height: 52px; gap: 4px; font-size: 8px; }
    .rail-tool svg { width: 18px; height: 18px; }
    .rail-help { margin-top: 0; }
    .strip.notice { margin: 0 -10px; padding: 10px 13px; font-size: 10px; }
    .strip.notice .link { display: inline-block; margin: 5px 0 0; }
    .studio-heading { padding: 20px 4px; }
    .studio-heading h1 { font-size: 21px; }
    .canvas-bar { padding: 12px; flex-wrap: wrap; gap: 7px; }
    .canvas-label { font-size: 7px; }
    #studio-device-label { font-size: 9px; padding-left: 7px; }
    .canvas-bar .link { font-size: 8px; }
    .phone-row, .phone-stage:not([data-loaded='true']) .phone-row { height: min(65svh, 580px); padding: 6px 8px 10px; }
    .studio-start { position: static; padding: 10px 12px 18px; }
    .deck { position: relative; bottom: auto; left: auto; transform: none; margin: 0 8px 8px; width: calc(100% - 16px); }
    .deck .select { width: 100%; }
    .deck .select select, .deck .addr input { font-size: 16px; }
    .deck .seg button, .deck .tog { font-size: 11px; min-height: 38px; }
    .deck .ico { width: 38px; height: 38px; }
    .deck .addr .go { height: 32px; font-size: 12px; }
    .deck .row:first-child { gap: 10px; }
    .deck .via .pill { min-height: 32px; font-size: 11px; }
    .deck .netlify { font-size: 11px; margin-left: auto; }
    .deck .focus-btn { display: inline-flex; }
    .read { display: flex; padding: 24px; }
    .inspector-tabs { height: 48px; }
    .inspector-tabs button { font-size: 13px; }
    .watch { min-height: 580px; }
    .inspect-intro p { max-width: 38ch; font-size: 12px; }
    .read > .fine, .geometry-section .fine { font-size: 11px; }
    .ps-findings .ps-empty { font-size: 12px; }
    .studio-specs div, .inspector-section-head h2 { font-size: 12px; }
    .btn.studio-primary { min-height: 44px; font-size: 12px; }
    .inspector-foot { padding: 16px; font-size: 10px; }
    .bench-bar { padding: 0 12px; }
    .command-menu { top: 9vh; }
    .command-search input { font-size: 16px; }
    body[data-focus='true'] .page { padding-left: 10px; }
    body[data-focus='true'] .top { margin-left: -10px; }
  }
  @media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }
}
