:root {
  color-scheme: dark;
  /* base colors — set per theme by themes.js */
  --term-bg: #0b0d10;
  --text: #d7dae0;
  --panel: #16191e;
  --line: #262a31;
  --muted: #7d8590;
  --working: #4c8dff;
  --needs: #ff8a1f;
  --done: #2fbf71;
  --exited: #c0453b;

  /* everything else is derived, so every theme stays consistent */
  --bg: color-mix(in srgb, var(--term-bg) 82%, var(--panel));
  --panel2: color-mix(in srgb, var(--panel) 55%, var(--term-bg));
  --idle: color-mix(in srgb, var(--muted) 70%, var(--panel));
  --exited-dot: var(--exited);
  --btn: color-mix(in srgb, var(--panel), var(--text) 7%);
  --btn-hover: color-mix(in srgb, var(--panel), var(--text) 13%);
  --seg-on: color-mix(in srgb, var(--panel), var(--text) 17%);
  --hover: color-mix(in srgb, var(--panel2), var(--text) 7%);
  --tab-cur: color-mix(in srgb, var(--panel), var(--text) 11%);
  --tab-cur-border: color-mix(in srgb, var(--line), var(--text) 30%);
  --ring: var(--muted);
  --gutter: color-mix(in srgb, var(--line), var(--text) 25%);
  --input-bg: var(--term-bg);
  --working-text: color-mix(in srgb, var(--working) 72%, var(--text));
  --needs-text: color-mix(in srgb, var(--needs) 72%, var(--text));
  --needs-head: color-mix(in srgb, var(--needs) 20%, var(--panel));
  --needs-soft: color-mix(in srgb, var(--needs) 15%, transparent);
  --needs-soft2: color-mix(in srgb, var(--needs) 32%, transparent);
  --needs-glow: color-mix(in srgb, var(--needs) 55%, transparent);
  --done-text: color-mix(in srgb, var(--done) 72%, var(--text));
  --done-head: color-mix(in srgb, var(--done) 17%, var(--panel));
  --done-soft: color-mix(in srgb, var(--done) 12%, transparent);
  --seen-text: color-mix(in srgb, var(--done) 50%, var(--muted));
  --error-bg: #b42318;

  --head-h: 46px;
  --tabs-h: 0px;
  --foot-h: 26px;
  --gap: 6px;
}
:root[data-theme=light] { color-scheme: light; }
body.view-focus { --tabs-h: 38px; }
body.has-tagbar { --tagbar-h: 34px; }
body.native { --head-pad-left: 78px; } /* room for macOS traffic lights */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text);
  font: 13px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; overflow: hidden;
  overscroll-behavior-x: none; }
button, select { font: inherit; color: var(--text); background: var(--btn); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 10px; cursor: pointer; }
button:hover { background: var(--btn-hover); }
button.primary { background: #c96442; border-color: #c96442; color: #fff; }
button.primary:hover { background: #d9744f; }

/* ---------- top bar ---------- */
#topbar { height: var(--head-h); display: flex; align-items: center; gap: 12px;
  padding: 0 12px 0 calc(12px + var(--head-pad-left, 0px));
  border-bottom: 1px solid var(--line); background: var(--panel); -webkit-app-region: drag; }
#topbar button, #topbar .chip, #topbar .seg { -webkit-app-region: no-drag; }
.brand { font-weight: 600; white-space: nowrap; }
.logo { color: #c96442; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button { border: 0; border-radius: 0; background: transparent; padding: 4px 10px; color: var(--muted); }
.seg button.on { background: var(--seg-on); color: var(--text); }
#attention { flex: 1; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
#attention .calm { color: var(--muted); }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px;
  white-space: nowrap; cursor: pointer; border: 1px solid transparent; font-size: 12px; }
.chip.needs { background: var(--needs-soft); border-color: var(--needs); color: var(--needs-text); animation: pulse-chip 1.4s infinite; }
.chip.done { background: var(--done-soft); border-color: var(--done); color: var(--done-text); }
.chip .age { opacity: .7; }
.actions { display: flex; gap: 8px; }
#btn-notify.on { border-color: var(--done); }
body.view-focus #btn-reset { display: none; }

/* ---------- focus-mode tabs ---------- */
#tabs { height: var(--tabs-h); display: flex; align-items: center; gap: 6px; padding: 0 8px;
  background: var(--panel2); border-bottom: 1px solid var(--line); }
#tabs[hidden] { display: none; }
#tabs .nav { padding: 2px 10px; font-size: 16px; line-height: 1; }
#tablist { flex: 1; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 7px; padding: 4px 12px; border-radius: 6px; cursor: pointer;
  white-space: nowrap; color: var(--muted); border: 1px solid transparent; user-select: none; }
.tab:hover { background: var(--hover); }
.tab.current { background: var(--tab-cur); color: var(--text); border-color: var(--tab-cur-border); }
.tab .num { font: 10px ui-monospace, Menlo, monospace; opacity: .6; }
.tab .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); }
.tab.s-working .dot { background: var(--working); animation: blink 1s infinite; }
.tab.s-needs { color: var(--needs-text); border-color: var(--needs); animation: pulse-chip 1.4s infinite; }
.tab.s-needs .dot { background: var(--needs); }
.tab.s-done .dot { background: var(--done); }
.tab.s-exited .dot { background: var(--exited-dot); }
.tab { cursor: grab; }
.tab.dragging { opacity: .4; }
.tab.drop-before { box-shadow: inset 3px 0 0 #c96442; }
.tab.drop-after { box-shadow: inset -3px 0 0 #c96442; }

/* ---------- grid (split panes) ---------- */
#grid { position: relative; height: calc(100vh - var(--head-h) - var(--tagbar-h, 0px) - var(--tabs-h) - var(--foot-h));
  padding: var(--gap); display: flex; flex-direction: column; overflow: hidden; }
.row { display: flex; min-height: 0; }
.gutter { flex: none; position: relative; z-index: 3; }
.gutter.g-row { height: var(--gap); cursor: row-resize; }
.gutter.g-col { width: var(--gap); cursor: col-resize; }
.gutter:hover, .gutter.active { background: var(--gutter); border-radius: 3px; }
body.view-focus .row { display: contents; }
body.view-focus .gutter { display: none; }
/* Focus mode: every terminal stays full-size (just invisible) so switching
   never resizes it — Claude's screen is already drawn at the right width. */
body.view-focus .frame { position: absolute; inset: var(--gap); visibility: hidden; pointer-events: none; z-index: 0; }
body.view-focus .frame.current { visibility: visible; pointer-events: auto; z-index: 1; }

.frame { position: relative; display: flex; flex-direction: column; min-width: 120px; min-height: 0;
  background: var(--term-bg); border: 2px solid var(--line); border-radius: 8px; overflow: hidden;
  transition: border-color .2s, box-shadow .2s; }
.frame.focused { box-shadow: 0 0 0 1px var(--ring) inset; }
.fhead { display: flex; align-items: center; gap: 8px; height: 28px; padding: 0 6px 0 10px; flex: none;
  background: var(--panel); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; }
.fhead .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--idle); flex: none; }
.fhead .num { font: 10px ui-monospace, Menlo, monospace; color: var(--muted); }
.fhead .fname { font-weight: 600; white-space: nowrap; }
.fhead .fcwd { color: var(--muted); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30%; }
.fhead .fmsg { flex: 1; font-size: 12px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.fhead .fbtns { display: flex; gap: 3px; }
.fhead .fbtns button { padding: 0 6px; height: 20px; font-size: 12px; background: transparent; border-color: transparent; }
.fhead .fbtns button:hover { background: var(--btn-hover); }
.fterm { flex: 1; min-height: 0; padding: 4px 0 0 6px; }
.fterm .xterm { height: 100%; }
/* drop indicator while dragging a header */
.drop-hint { display: none; position: absolute; z-index: 6; pointer-events: none; background: rgba(201,100,66,.28); border: 2px solid #c96442; border-radius: 6px; }
.frame[data-drop] .drop-hint { display: block; }
.frame[data-drop=center] .drop-hint { inset: 30% 30%; }
.frame[data-drop=left] .drop-hint { inset: 0 70% 0 0; }
.frame[data-drop=right] .drop-hint { inset: 0 0 0 70%; }
.frame[data-drop=bottom] .drop-hint { inset: 70% 0 0 0; }
.frame[data-drop=files] .drop-hint { inset: 28px 0 0 0; display: flex; align-items: center; justify-content: center; }
.frame[data-drop=files] .drop-hint::after { content: 'Drop to insert the file path'; color: var(--text); font-weight: 600;
  background: var(--panel); padding: 6px 12px; border-radius: 6px; border: 1px solid #c96442; }
body.dragging .fterm { pointer-events: none; }

.slide-next { animation: slide-next .22s ease-out; }
.slide-prev { animation: slide-prev .22s ease-out; }
@keyframes slide-next { from { transform: translateX(60px); opacity: .3; } to { transform: none; opacity: 1; } }
@keyframes slide-prev { from { transform: translateX(-60px); opacity: .3; } to { transform: none; opacity: 1; } }

/* ---------- statuses ---------- */
.frame.s-working { border-color: rgba(76,141,255,.55); }
.frame.s-working .dot { background: var(--working); animation: blink 1s infinite; }
.frame.s-working .fmsg { color: var(--working-text); }

.frame.s-needs { border-color: var(--needs); animation: pulse 1.4s infinite; }
.frame.s-needs .fhead { background: var(--needs-head); }
.frame.s-needs .dot { background: var(--needs); }
.frame.s-needs .fmsg { color: var(--needs-text); font-weight: 600; }

.frame.s-done { border-color: var(--done); }
.frame.s-done .fhead { background: var(--done-head); }
.frame.s-done .dot { background: var(--done); }
.frame.s-done .fmsg { color: var(--done-text); }

.frame.s-exited { border-color: var(--exited); opacity: .75; }
.frame.s-exited .dot { background: var(--exited-dot); }

@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(255,138,31,.0); } 50% { box-shadow: 0 0 14px 2px var(--needs-glow); } }
@keyframes pulse-chip { 50% { background: var(--needs-soft2); } }
@keyframes blink { 50% { opacity: .3; } }

.frame.drag-over { outline: 2px dashed var(--ring); outline-offset: -4px; }

/* ---------- misc ---------- */
#empty { position: fixed; inset: var(--head-h) 0 var(--foot-h) 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted); }
#empty[hidden], #conn[hidden] { display: none; }
#conn { position: fixed; top: 54px; left: 50%; transform: translateX(-50%); background: var(--error-bg); color: #fff;
  padding: 6px 14px; border-radius: 6px; z-index: 50; }
#keys { height: var(--foot-h); display: flex; gap: 18px; align-items: center; padding: 0 12px;
  color: var(--muted); font-size: 11px; border-top: 1px solid var(--line); background: var(--panel); white-space: nowrap; overflow: hidden; }
kbd { font: 10px ui-monospace, Menlo, monospace; background: var(--btn); border: 1px solid var(--line);
  border-radius: 3px; padding: 0 4px; margin-right: 2px; }

dialog { background: var(--panel); color: var(--text); border: 1px solid var(--line); border-radius: 10px; width: 520px; padding: 18px 20px; }
dialog::backdrop { background: rgba(0,0,0,.55); }
dialog h3 { margin: 0 0 14px; }
dialog label { display: block; margin-bottom: 12px; color: var(--muted); }
dialog label.row { display: flex; gap: 8px; align-items: center; color: var(--text); }
dialog input:not([type=checkbox]), dialog select { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; font: 13px ui-monospace, Menlo, monospace;
  color: var(--text); background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; }
dialog select { font-family: inherit; }
dialog .hint { font-size: 11px; }
dialog code { font-size: 11px; }
dialog .warn { color: var(--needs-text); margin: 0; }
dialog .warn[hidden] { display: none; }
dialog menu { display: flex; justify-content: flex-end; gap: 8px; padding: 0; margin: 16px 0 0; }

/* ---------- rename, mark as done ---------- */
input.rename { font: 600 13px -apple-system, BlinkMacSystemFont, sans-serif; color: var(--text); background: var(--input-bg);
  border: 1px solid #c96442; border-radius: 4px; padding: 1px 5px; outline: none; }
.fhead .fbtns button.ack { display: none; color: var(--done-text); border-color: rgba(47,191,113,.6); }
.frame.s-done .fhead .fbtns button.ack { display: inline-block; }
.frame.s-done .fhead .fbtns button.ack:hover { background: rgba(47,191,113,.2); }
.frame.s-seen .dot { background: transparent; box-shadow: 0 0 0 2px var(--done) inset; }
.frame.s-seen .fmsg { color: var(--seen-text); }
.tab.s-done { color: var(--done-text); }
.tab.s-seen .dot { background: transparent; box-shadow: 0 0 0 2px var(--done) inset; }
.tab .tack, .chip .cack { margin-left: 2px; padding: 0 5px; border-radius: 4px; font-size: 11px; cursor: pointer; }
.tab .tack:hover, .chip .cack:hover { background: rgba(47,191,113,.3); }
.chip.clear { color: var(--muted); border-color: var(--line); }
.chip.clear:hover { color: var(--text); background: var(--btn); }
.toast { position: fixed; bottom: 40px; left: 50%; transform: translateX(-50%); background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: 0 6px 20px rgba(0,0,0,.25);
  padding: 8px 14px; border-radius: 6px; z-index: 100; }

/* ---------- appearance switch ---------- */
#theme-switch button { padding: 4px 8px; }
:root[data-theme=light] .frame { box-shadow: 0 1px 2px rgba(0,0,0,.06); }
:root[data-theme=light] .frame.focused { box-shadow: 0 0 0 1px var(--ring) inset; }

/* ---------- theme picker ---------- */
#theme-dialog { width: 860px; max-width: 94vw; max-height: 90vh; overflow-y: auto; }
#theme-dialog h4 { margin: 14px 0 8px; color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.tcard { border: 2px solid var(--line); border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--panel); transition: transform .1s; }
.tcard:hover { transform: translateY(-1px); border-color: var(--muted); }
.tcard.selected { border-color: #c96442; box-shadow: 0 0 0 2px rgba(201,100,66,.35); }
.tcard .pv { padding: 0; font: 11px/1.5 Menlo, ui-monospace, monospace; }
.tcard .pv .bar { display: flex; gap: 5px; align-items: center; padding: 4px 8px; font: 600 11px -apple-system, sans-serif; }
.tcard .pv .bar i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.tcard .pv .body { padding: 6px 8px 8px; white-space: pre; overflow: hidden; }
.tcard .meta { padding: 6px 8px 8px; }
.tcard .meta b { display: block; font-size: 12px; }
.tcard .meta span { font-size: 11px; color: var(--muted); }
.tcard .meta .badge { float: right; font-size: 10px; color: #c96442; font-weight: 600; }
.theme-row { display: flex; align-items: center; gap: 14px; margin-top: 16px; flex-wrap: wrap; }
.theme-row input[type=range] { width: 200px; }
#theme-dialog .note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
/* keep the terminal's empty area in the theme color */
.fterm, .xterm, .xterm .xterm-viewport, .xterm .xterm-screen { background-color: var(--term-bg) !important; }

/* ---------- tags ---------- */
#tagbar { height: var(--tagbar-h, 0px); display: flex; align-items: center; gap: 8px; padding: 0 10px;
  background: var(--panel2); border-bottom: 1px solid var(--line); }
#tagbar[hidden] { display: none; }
#tagbar .lbl { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
#tagbar .hint { color: var(--muted); font-size: 11px; margin-left: auto; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#tagbar button[hidden] { display: none; }
#tagbar > button { padding: 2px 10px; font-size: 12px; }
#taglist { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; }
.tagchip { display: inline-flex; align-items: center; gap: 6px; padding: 2px 10px; border-radius: 999px; font-size: 12px;
  border: 1px solid color-mix(in srgb, var(--tagc) 60%, var(--line)); background: color-mix(in srgb, var(--tagc) 14%, var(--panel)); }
.tagchip i { width: 8px; height: 8px; border-radius: 50%; background: var(--tagc); }
.tagchip em { font-style: normal; font-size: 10px; color: var(--muted); }
.tagchip.off { opacity: .55; background: transparent; border-style: dashed; }
.tagchip.off span { text-decoration: line-through; }
.tagchip.off i::after { content: ''; }
.tagchip.off::before { content: '🙈'; font-size: 11px; }

.fhead .ftag { flex: none; font-size: 11px; font-weight: 600; padding: 0 7px; border-radius: 999px; line-height: 17px; cursor: pointer;
  color: #fff; background: var(--tagc); max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fhead .ftag.empty { background: transparent; color: var(--muted); border: 1px dashed var(--line); font-weight: 400; visibility: hidden; }
.frame:hover .fhead .ftag.empty { visibility: visible; }
.fhead .ftag:has(input) { visibility: visible; background: transparent; padding: 0; }
.frame.has-tag .fhead { box-shadow: inset 0 3px 0 var(--tagc); }
input.tagedit { font-size: 12px; font-weight: 400; }

.tab.has-tag { box-shadow: inset 0 -3px 0 var(--tagc); }
.tab.current.has-tag { box-shadow: inset 0 -3px 0 var(--tagc); }
.tabgroup { align-self: center; font-size: 10px; text-transform: uppercase; letter-spacing: .05em; font-weight: 700;
  color: var(--tagc); padding: 0 4px 0 10px; white-space: nowrap; border-left: 1px solid var(--line); }
.tabgroup:first-child { border-left: 0; padding-left: 2px; }

/* ---------- hidden terminals ---------- */
#stash { position: fixed; left: -30000px; top: 0; width: 1000px; height: 700px; visibility: hidden; pointer-events: none; }
#stash .frame { width: 1000px; height: 700px; }
#all-hidden { position: fixed; inset: var(--head-h) 0 var(--foot-h) 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center; color: var(--muted); }
#all-hidden[hidden] { display: none; }
.chip.hidden-waiting { color: var(--muted); border-color: var(--line); }
#hidden-menu { position: fixed; z-index: 60; min-width: 300px; max-width: 420px; background: var(--panel); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
#hidden-menu .hm-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px 6px; }
#hidden-menu .hm-row { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: 6px; }
#hidden-menu .hm-row:hover { background: var(--hover); }
#hidden-menu .hm-row b { flex: 1; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#hidden-menu .hm-row button { padding: 2px 10px; font-size: 12px; }
#hidden-menu .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--idle); flex: none; }
#hidden-menu .s-needs .dot { background: var(--needs); } #hidden-menu .s-done .dot { background: var(--done); } #hidden-menu .s-working .dot { background: var(--working); }
#hidden-menu .hm-tag { font-size: 10px; font-weight: 600; color: #fff; background: var(--tagc); padding: 0 6px; border-radius: 999px; }
#hidden-menu .hm-all { width: 100%; margin-top: 6px; }

.toast.error { background: var(--error-bg); color: #fff; border-color: transparent; }

/* ---------- machines / hub ---------- */
body:not(.is-hub) .hub-only, body.is-hub .local-only { display: none !important; }
.fhead .fmach { display: none; flex: none; font-size: 11px; color: var(--muted); white-space: nowrap; max-width: 140px; overflow: hidden; text-overflow: ellipsis; }
body.multi-machine .fhead .fmach { display: inline; }
.frame.offline { opacity: .6; }
.frame.offline .fterm { filter: grayscale(1); }
.frame.s-offline .dot { background: transparent; box-shadow: 0 0 0 2px var(--muted) inset; }
.tagchip.machine { --tagc: var(--muted); }
.tagchip.machine.is-offline span { color: var(--muted); }
.tagsep { width: 1px; align-self: stretch; margin: 6px 4px; background: var(--line); }
#btn-hub.hub-connected { border-color: var(--done); }
#btn-hub.hub-error, #btn-hub.hub-rejected, #btn-hub.hub-disconnected { border-color: var(--needs); }
#machines-dialog { width: 560px; }
#machines-dialog .mrow { display: flex; align-items: center; gap: 10px; padding: 8px 4px; border-bottom: 1px solid var(--line); }
#machines-dialog .mrow b { flex: 1; }
#machines-dialog .ok { color: var(--done-text); font-size: 12px; }
#machines-dialog .off { color: var(--muted); font-size: 12px; }
#machines-dialog .pair { margin-top: 14px; }
#machines-dialog h4 { margin: 8px 0; }
.pair-row { display: flex; gap: 8px; }
.pair-row input { flex: 1; padding: 7px 9px; color: var(--text); background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; }
.kv { display: flex; align-items: center; gap: 8px; margin: 6px 0; }
.kv span { width: 100px; color: var(--muted); font-size: 12px; }
.kv code { flex: 1; font-size: 12px; background: var(--input-bg); border: 1px solid var(--line); border-radius: 6px; padding: 6px 8px; word-break: break-all; user-select: all; }
dialog .note { color: var(--muted); font-size: 12px; margin: 0 0 12px; }
form.inline { display: inline; margin-right: auto; }
dialog menu form.inline button { margin: 0; }
#machine-row[hidden] { display: none; }

/* ---------- iPad / touch ---------- */
#touchkeys { display: none; }
body.touch { --foot-h: 52px; touch-action: manipulation; }
body.touch #keys { display: none; }
body.touch #touchkeys { display: flex; position: fixed; left: 0; right: 0; bottom: 0; height: var(--foot-h); gap: 6px; align-items: center;
  padding: 6px 8px calc(6px + env(safe-area-inset-bottom)) 8px; background: var(--panel); border-top: 1px solid var(--line); overflow-x: auto; z-index: 30; }
body.touch #touchkeys button { min-width: 44px; height: 38px; font-size: 15px; padding: 0 10px; flex: none; }
body.touch #touchkeys .tk-sp { flex: 1; }
body.touch #topbar { padding-top: env(safe-area-inset-top); height: calc(var(--head-h) + env(safe-area-inset-top)); overflow-x: auto; }
body.touch #grid { height: calc(100dvh - var(--head-h) - env(safe-area-inset-top) - var(--tagbar-h, 0px) - var(--tabs-h) - var(--foot-h) - env(safe-area-inset-bottom)); }
body.touch .tab { padding: 8px 14px; }
body.touch .fhead { height: 36px; }
body.touch .fhead .fbtns button { height: 30px; min-width: 32px; }
body.touch .brand { display: none; }
@media (max-width: 900px) { #tagbar .hint, #attention .age { display: none; } }
body.touch #grid, body.touch #tabs { overscroll-behavior: none; }
body.touch.view-focus #grid { touch-action: pan-y; }

/* ---------- live server browser ---------- */
body:not(.has-browser) .browser-only { display: none !important; }
#browser-panel { position: fixed; inset: var(--head-h) 0 0 0; z-index: 40; display: flex; flex-direction: column; background: var(--bg); }
#browser-panel[hidden] { display: none; }
#browser-panel .bp-head { display: flex; align-items: center; gap: 12px; padding: 6px 10px; background: var(--panel); border-bottom: 1px solid var(--line); }
#browser-panel .bp-head .hint { color: var(--muted); font-size: 12px; margin-right: auto; }
#browser-panel .bp-head a { color: var(--working-text); font-size: 12px; }
#browser-panel iframe { flex: 1; border: 0; width: 100%; }
