/* Web Studio — same black / silver / charcoal textured look as the desktop app (tokens come from /shared/theme.css).
   One screen at a time, large controls, plain words. */
html, body { height: auto; min-height: 100%; }
body { overflow: auto; padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
[hidden] { display: none !important; }

.top { display: flex; align-items: center; gap: 12px; padding: 14px 20px; position: sticky; top: 0; z-index: 5; flex-wrap: wrap;
  background: linear-gradient(180deg, rgba(10,10,11,.92), rgba(10,10,11,.7)); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.brand { font-weight: 700; letter-spacing: .34em; font-size: 12.5px; color: var(--silver-300); text-transform: uppercase; }
.brand span { color: var(--silver-700); }
.strip { display: flex; gap: 6px; flex-wrap: wrap; margin-left: auto; }
.pill { font-size: 12.5px; padding: 4px 11px; border-radius: 999px; background: rgba(255,255,255,.07); border: 1px solid var(--line); color: var(--silver-500); white-space: nowrap; }
.pill.on { background: var(--rec); border-color: transparent; color: #fff; font-weight: 600; }
.pill.ok { color: var(--ok); } .pill.warn { color: var(--warn); } .pill.bad { color: #ff9f98; }

.screen { position: relative; z-index: 2; max-width: 1180px; margin: 0 auto; padding: 22px 20px 40px; }
.hero { padding: 36px 0 10px; text-align: center; }
h1 { font-size: clamp(1.7rem, 4.2vw, 2.6rem); line-height: 1.12; margin: 0 0 10px; font-weight: 650; letter-spacing: -.025em; }
h2 { font-size: 1.3rem; margin: 0 0 14px; } h3 { font-size: 12px; letter-spacing: .09em; text-transform: uppercase; color: var(--silver-500); margin: 18px 0 8px; font-weight: 600; }
.lead { color: var(--silver-500); font-size: 1.05rem; max-width: 52ch; margin: 0 auto 8px; }
.fine { color: var(--silver-500); font-size: 13px; } .muted { color: var(--silver-500); }
.est { color: var(--silver-300); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); margin: 18px 0; }
.cards.two { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); max-width: 760px; margin: 22px auto; }
.card-btn { text-align: left; padding: 20px; border-radius: 22px; border: 1px solid var(--line); color: var(--silver-100); cursor: pointer; min-height: 110px;
  background: var(--panel-bg); box-shadow: var(--panel-edge); display: flex; flex-direction: column; gap: 6px; transition: transform .15s ease, border-color .2s; }
.card-btn b { font-size: 1.08rem; font-weight: 600; } .card-btn span { color: var(--silver-500); font-size: .92rem; }
.card-btn:hover { transform: translateY(-2px); border-color: var(--line-strong); } .card-btn:focus-visible { outline: 2px solid var(--silver-100); }
.card-btn[aria-pressed="true"] { border-color: var(--silver-300); box-shadow: var(--panel-edge), 0 0 0 1px var(--silver-300) inset; }
.card-btn:disabled { opacity: .5; cursor: default; transform: none; }

.panel { background: var(--panel-bg); border: 1px solid var(--line); border-radius: 22px; padding: 18px 20px; margin: 14px 0; box-shadow: var(--panel-edge); }
.grid2 { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(310px, 1fr)); }
label { display: block; margin: 12px 0 6px; font-size: 13px; color: var(--silver-500); }
label.check { display: flex; gap: 12px; align-items: center; color: var(--silver-100); min-height: 44px; font-size: 15px; margin: 0; }
button { font: inherit; min-height: 44px; padding: 10px 16px; border-radius: 12px; border: 1px solid var(--line-strong); cursor: pointer; color: var(--silver-100);
  background: var(--brushed), linear-gradient(180deg, #3d3d41, #2a2a2d); box-shadow: inset 0 1px 0 rgba(255,255,255,.1); }
button:hover { filter: brightness(1.12); } button:disabled { opacity: .45; cursor: default; }
button.primary { background: linear-gradient(180deg, #f6f6f9, #c9c9d0); color: #0b0b0c; border-color: transparent; font-weight: 650; }
button.big { width: 100%; min-height: 54px; margin-top: 14px; font-size: 1.02rem; }
button.sec { background: var(--brushed), linear-gradient(180deg, #343437, #232326); }
button.link { background: none; border: 0; box-shadow: none; color: var(--silver-500); }
button.danger { color: #ff9f98; }
button[aria-pressed="true"]:not(.card-btn) { background: linear-gradient(180deg, #ededf1, #c3c3ca); color: #0b0b0c; border-color: transparent; }
.seg { display: inline-flex; padding: 3px; border-radius: 13px; background: rgba(0,0,0,.4); border: 1px solid var(--line); gap: 2px; margin: 6px 0; flex-wrap: wrap; }
.seg button { border: 0; background: none; box-shadow: none; min-height: 38px; padding: 6px 16px; border-radius: 10px; color: var(--silver-300); }
.seg button[aria-pressed="true"] { background: linear-gradient(180deg, #ededf1, #c3c3ca); color: #0b0b0c; font-weight: 600; }
.msg { min-height: 1.3em; margin: 10px 2px 0; font-size: 14px; color: var(--warn); } .msg.ok { color: var(--ok); } .msg.bad { color: #ff9f98; }
.notice { border: 1px solid var(--line); background: rgba(0,0,0,.3); padding: 14px; border-radius: 16px; margin: 14px 0; display: flex; flex-direction: column; gap: 6px; }
.cap { width: 100%; border-collapse: collapse; font-size: 13.5px; } .cap td { padding: 8px 6px; border-bottom: 1px solid var(--line); vertical-align: top; }
.cap td:nth-child(2) { white-space: nowrap; font-weight: 600; }
.st-supported { color: var(--ok); } .st-limited, .st-unknown { color: var(--warn); } .st-unavailable { color: #ff9f98; }
.recs { margin: 8px 0 0; padding-left: 18px; color: var(--warn); }
details summary { cursor: pointer; padding: 10px 0; min-height: 44px; color: var(--silver-300); }

/* studio: the picture first, controls in a dock, everything else in a drawer */
.studio { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
.canvas-wrap { position: relative; background: #000; border-radius: 22px; overflow: hidden; border: 1px solid var(--line-strong); display: flex; justify-content: center;
  max-height: 72vh; box-shadow: 0 0 0 1px rgba(0,0,0,.8), 0 30px 80px rgba(0,0,0,.55); }
canvas#program { max-width: 100%; max-height: 72vh; width: auto; height: auto; display: block; background: #000; }
.safe { position: absolute; inset: 5%; border: 1px dashed rgba(255,255,255,.5); pointer-events: none; border-radius: 8px; }
.stale { position: absolute; top: 10px; left: 10px; background: var(--rec); padding: 4px 12px; border-radius: 999px; font-size: 13px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; justify-content: center; padding: 12px; border-radius: 26px; border: 1px solid var(--line);
  background: var(--panel-bg); box-shadow: var(--panel-edge); }
.actions button { flex: 1 1 auto; min-width: 92px; border-radius: 16px; }
button.rec { border-color: rgba(255,69,58,.5); } button.rec.on { background: var(--rec); border-color: transparent; color: #fff; font-weight: 650; }
button.live.on { background: linear-gradient(180deg, #fff, #d9d9de); color: #000; font-weight: 700; box-shadow: 0 0 22px rgba(255,255,255,.3); }
.meters { display: flex; align-items: center; gap: 12px; margin-top: 14px; color: var(--silver-500); font-size: 13px; }
.meter { flex: 1; height: 8px; background: rgba(0,0,0,.5); border-radius: 4px; overflow: hidden; border: 1px solid var(--line); }
.meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8e8e95, #f5f5f7); transition: width .08s linear; }
.side { background: var(--panel-bg); border: 1px solid var(--line); border-radius: 22px; padding: 12px 16px 18px; max-height: calc(100vh - 100px); overflow: auto; box-shadow: var(--panel-edge); }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); margin: 0 -6px 10px; padding: 0 6px; position: sticky; top: 0; z-index: 2; background: #202023; }
.tabs button { background: none; border: 0; box-shadow: none; border-radius: 10px 10px 0 0; color: var(--silver-500); min-height: 42px; }
.tabs button[aria-selected="true"] { color: var(--silver-100); box-shadow: 0 -2px 0 var(--silver-100) inset; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; } .chips button { min-height: 38px; padding: 6px 14px; }
.layers { list-style: none; margin: 0; padding: 0; } .layers li { display: flex; align-items: center; gap: 6px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.layers li span { flex: 1; } .layers button { min-height: 36px; padding: 4px 11px; }
.row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 5px 14px; font-size: 13.5px; } .kv b { color: var(--silver-500); font-weight: 500; }
.dest { border: 1px solid var(--line); border-radius: 16px; padding: 12px; margin: 10px 0; background: rgba(0,0,0,.28); }
.dest .head { display: flex; justify-content: space-between; gap: 8px; }
.dest .state { font-size: 12px; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--line); color: var(--silver-300); }
.dest .state.live { color: #0c2b18; background: var(--ok); border-color: transparent; } .dest .state.failed { color: #ff9f98; border-color: #ff9f98; }
input[type=color] { width: 54px; height: 40px; border: 0; background: none; padding: 0; }

@media (max-width: 900px) {
  .studio { grid-template-columns: 1fr; }
  .side { max-height: none; }
  .actions { position: sticky; bottom: 10px; z-index: 4; }
  .actions button { min-height: 52px; }
}
