/* PadHost board — shared by the tablet and the editor preview.
   Each theme sets colors AND typography (numerals, headers, labels) through variables.
   Fonts are the ones built into iPadOS / macOS, with generic fallbacks elsewhere.
   Written for old Safari too (iOS 10+): no flex gap, no `inset`, no aspect-ratio. */

/* ======================= theme variables ======================= */

.pb-root {
  /* color */
  --bg: #0a0a0b;
  --paint: var(--bg);
  --tile: #141416;
  --tile-hi: #1d1d20;
  --well: #0e0e10;
  --line: rgba(255, 255, 255, .06);
  --line-2: rgba(255, 255, 255, .11);
  --fg: #f3f3f1;
  --fg-2: #9a9aa0;
  --fg-3: #77777e;
  --signal: #ff5a36;
  --good: #3fd98a;
  --fill: var(--fg);
  /* shape */
  --gap: 10px;
  --radius: 20px;
  --key-radius: 16px;
  --tile-shadow: inset 0 0 0 1px var(--line);
  --pad: 14px 16px 15px;
  /* type */
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Hiragino Sans", "Noto Sans JP", system-ui, sans-serif;
  --mono: "SF Mono", ui-monospace, Menlo, monospace;
  --num-font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", sans-serif;
  --num-weight: 200;
  --num-track: -.04em;
  --num-style: normal;
  --hd-font: var(--mono);
  --hd-size: 10.5px;
  --hd-weight: 600;
  --hd-track: .09em;
  --hd-transform: uppercase;
  --hd-color: var(--fg-3);
  --label-font: var(--sans);
  --label-weight: 600;
  --label-track: -.005em;
  --label-transform: none;
  --label-scale: 1;
  color: var(--fg);
  font-family: var(--sans);
}

/* Paper — warm stock, Futura. Mid-century print. */
.pb-root[data-theme="paper"] {
  --bg: #e8e2d6; --tile: #f6f1e7; --tile-hi: #fffaf0; --well: #e9e2d4;
  --line: rgba(60, 40, 20, .08); --line-2: rgba(60, 40, 20, .16);
  --fg: #26221d; --fg-2: #5f584d; --fg-3: #7d7568; --signal: #d9502f; --good: #2e8b57;
  --radius: 14px; --key-radius: 12px;
  --tile-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.7), 0 1px 2px rgba(70,45,20,.10), 0 8px 20px -12px rgba(70,45,20,.22);
  --num-font: Futura, "Futura PT", "Century Gothic", "Avenir Next", sans-serif;
  --num-weight: 500; --num-track: -.03em;
  --hd-font: Futura, "Avenir Next", "Hiragino Sans", sans-serif; --hd-size: 10.5px; --hd-weight: 700; --hd-track: .14em;
  --label-font: "Avenir Next", "Hiragino Sans", sans-serif; --label-weight: 600; --label-track: .005em;
}

/* Swiss — white, black, red. Heavy grotesk, tight numerals, hard edges. */
.pb-root[data-theme="swiss"] {
  --bg: #efefec; --tile: #ffffff; --tile-hi: #f6f6f3; --well: #ececea;
  --line: rgba(0, 0, 0, .09); --line-2: rgba(0, 0, 0, .2);
  --fg: #111111; --fg-2: #555555; --fg-3: #767676; --signal: #e4202a; --good: #111111;
  --radius: 3px; --key-radius: 3px; --gap: 8px;
  --tile-shadow: inset 0 0 0 1px var(--line);
  --num-font: "Helvetica Neue", Helvetica, Arial, sans-serif;
  --num-weight: 700; --num-track: -.045em;
  --hd-font: "Helvetica Neue", Helvetica, Arial, "Hiragino Sans", sans-serif; --hd-size: 11px; --hd-weight: 700; --hd-track: .01em; --hd-color: var(--fg);
  --label-font: "Helvetica Neue", Helvetica, "Hiragino Sans", sans-serif; --label-weight: 700; --label-track: -.015em; --label-scale: 1.08;
}

/* 和紙 — kinari paper, Mincho, vermilion. */
.pb-root[data-theme="washi"] {
  --bg: #ece5d6;
  --paint: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .25 0 0 0 0 .15 0 0 0 .10 0'/%3E%3C/filter%3E%3Crect width='220' height='220' filter='url(%23n)'/%3E%3C/svg%3E"), #ece5d6;
  --tile: rgba(250, 246, 237, .82); --tile-hi: #fffcf4; --well: rgba(120, 95, 60, .08);
  --line: rgba(90, 65, 35, .14); --line-2: rgba(90, 65, 35, .26);
  --fg: #2a241f; --fg-2: #5e5347; --fg-3: #7c6f60; --signal: #c53d2b; --good: #4d6b3c;
  --radius: 4px; --key-radius: 4px;
  --tile-shadow: inset 0 0 0 1px var(--line);
  --num-font: Didot, "Bodoni 72", "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif;
  --num-weight: 400; --num-track: -.01em;
  --hd-font: "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; --hd-size: 11.5px; --hd-weight: 600; --hd-track: .18em; --hd-transform: none;
  --label-font: "Iowan Old Style", Palatino, "Hiragino Mincho ProN", "Yu Mincho", "Noto Serif JP", serif; --label-weight: 600; --label-track: .03em;
}

/* Blueprint — cyanotype grid, drafting lettering, crop marks. */
.pb-root[data-theme="blueprint"] {
  --bg: #12386a;
  --paint:
    linear-gradient(rgba(255,255,255,.10) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(90deg, rgba(255,255,255,.10) 1px, transparent 1px) 0 0 / 120px 120px,
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px) 0 0 / 24px 24px,
    #12386a;
  --tile: rgba(14, 44, 86, .72); --tile-hi: rgba(30, 70, 125, .85); --well: rgba(255, 255, 255, .06);
  --line: rgba(220, 235, 255, .32); --line-2: rgba(220, 235, 255, .55);
  --fg: #eef5ff; --fg-2: #a9c4e8; --fg-3: #7d9ccb; --signal: #ffd23f; --good: #9ef0c9;
  --radius: 2px; --key-radius: 2px;
  --tile-shadow: inset 0 0 0 1px rgba(220, 235, 255, .16);
  --num-font: "DIN Alternate", "DIN Condensed", "Avenir Next Condensed", "Roboto Condensed", sans-serif;
  --num-weight: 500; --num-track: 0;
  --hd-font: Menlo, "SF Mono", monospace; --hd-size: 10px; --hd-weight: 500; --hd-track: .12em; --hd-color: var(--fg-2);
  --label-font: "Avenir Next Condensed", "DIN Condensed", "Hiragino Sans", sans-serif; --label-weight: 600; --label-track: .02em; --label-transform: uppercase; --label-scale: 1;
}

/* Instrument — panel meters, 7-segment numerals, DIN legends. */
.pb-root[data-theme="instrument"] {
  --bg: #0b0d0c; --tile: #151917; --tile-hi: #1c211e; --well: #0a0c0b;
  --line: rgba(190, 255, 215, .07); --line-2: rgba(190, 255, 215, .14);
  --fg: #e6f2ea; --fg-2: #9fb0a5; --fg-3: #74837a; --signal: #ffb13b; --good: #7dffb4;
  --fill: #7dffb4; --seg: #7dffb4;
  --radius: 10px; --key-radius: 8px;
  --tile-shadow: inset 0 1px 0 rgba(255,255,255,.04), inset 0 0 0 1px var(--line), inset 0 -10px 24px rgba(0,0,0,.35);
  --num-font: "DIN Condensed", "Avenir Next Condensed", sans-serif; --num-weight: 600; --num-track: 0;
  --hd-font: "DIN Condensed", "Avenir Next Condensed", "Hiragino Sans", sans-serif; --hd-size: 13px; --hd-weight: 600; --hd-track: .14em;
  --label-font: "DIN Condensed", "Avenir Next Condensed", "Hiragino Sans", sans-serif; --label-weight: 600; --label-track: .03em; --label-transform: uppercase; --label-scale: 1.05;
}

/* Aurora — frosted glass over a slow color field. Avenir Next UltraLight. */
.pb-root[data-theme="aurora"] {
  --bg: #0c0b1d;
  --paint:
    radial-gradient(75% 80% at 15% 10%, rgba(110, 92, 255, .34), transparent 70%),
    radial-gradient(70% 80% at 85% 100%, rgba(40, 210, 195, .28), transparent 70%),
    #0c0b1d;
  --tile: rgba(255, 255, 255, .10); --tile-hi: rgba(255, 255, 255, .18); --well: rgba(255, 255, 255, .08);
  --line: rgba(255, 255, 255, .16); --line-2: rgba(255, 255, 255, .28);
  --fg: #ffffff; --fg-2: rgba(255, 255, 255, .72); --fg-3: rgba(255, 255, 255, .55); --signal: #ff6b8b; --good: #6dffd7;
  --radius: 26px; --key-radius: 18px;
  --tile-shadow: inset 0 0 0 1px var(--line), inset 0 1px 0 rgba(255,255,255,.22), 0 18px 40px -20px rgba(0, 0, 0, .6);
  --num-font: "Avenir Next", Avenir, "Helvetica Neue", sans-serif; --num-weight: 300; --num-track: -.03em;
  --hd-font: "Avenir Next", Avenir, "Hiragino Sans", sans-serif; --hd-size: 10.5px; --hd-weight: 600; --hd-track: .16em; --hd-color: var(--fg-3);
  --label-font: "Avenir Next", Avenir, "Hiragino Sans", sans-serif; --label-weight: 600; --label-track: .005em;
}

/* ======================= layout ======================= */

.pb-grid {
  display: grid;
  grid-gap: var(--gap);
  gap: var(--gap);
  grid-auto-flow: row dense;
}

.pb-tile {
  position: relative;
  overflow: hidden;
  min-width: 0;
  min-height: 0;
  border-radius: var(--radius);
  background: var(--tile);
  box-shadow: var(--tile-shadow);
  padding: var(--pad);
  display: -webkit-flex; display: flex;
  -webkit-flex-direction: column; flex-direction: column;
  -webkit-transition: -webkit-transform .16s cubic-bezier(.2,.8,.3,1), background-color .2s, box-shadow .2s;
  transition: transform .16s cubic-bezier(.2,.8,.3,1), background-color .2s, box-shadow .2s;
  -webkit-user-select: none; user-select: none;
}
.pb-tile.is-down { -webkit-transform: scale(.965); transform: scale(.965); background: var(--tile-hi); }
.pb-tile.is-selected { box-shadow: var(--tile-shadow), 0 0 0 2px #0a84ff, 0 0 0 6px rgba(10,132,255,.25); }

.pb-hd {
  display: -webkit-flex; display: flex;
  -webkit-align-items: center; align-items: center;
  -webkit-justify-content: space-between; justify-content: space-between;
  -webkit-flex-shrink: 0; flex-shrink: 0;
  font-family: var(--hd-font);
  font-size: var(--hd-size);
  font-weight: var(--hd-weight);
  line-height: 1.25;
  letter-spacing: var(--hd-track);
  text-transform: var(--hd-transform);
  color: var(--hd-color);
  white-space: nowrap;
  min-height: 14px;
}
.pb-hd > span { overflow: hidden; text-overflow: ellipsis; }
.pb-hd > span + span { margin-left: 10px; text-align: right; }
.pb-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor; margin-right: 6px; vertical-align: 1px; }
.pb-bd { min-height: 0; -webkit-flex: 1; flex: 1; display: -webkit-flex; display: flex; -webkit-flex-direction: column; flex-direction: column; -webkit-justify-content: flex-end; justify-content: flex-end; }
/* Shortcut chips: the theme fonts (Futura, Didot, DIN…) have no ⌘⇧⌥⌃ glyphs, so always use the system face. */
.pb-combo { font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", "Apple Symbols", sans-serif; font-size: 12.5px; font-weight: 500; letter-spacing: .1em; text-transform: none; color: var(--fg-2); }

/* ======================= type primitives ======================= */

.pb-num {
  font-family: var(--num-font);
  font-weight: var(--num-weight);
  font-style: var(--num-style);
  letter-spacing: var(--num-track);
  line-height: .9;
  font-variant-numeric: tabular-nums lining-nums;
  -webkit-font-feature-settings: "tnum", "lnum"; font-feature-settings: "tnum", "lnum";
  white-space: nowrap;
}
.pb-num small { font-size: .42em; letter-spacing: 0; color: var(--fg-2); margin-left: .12em; }
.pb-colon { display: inline-block; margin: 0 .03em; position: relative; top: -.06em; }
.pb-deg { display: inline-block; font-size: .5em; vertical-align: top; margin-left: .04em; color: var(--fg-2); line-height: 1.3; }

/* 7-segment numerals (Instrument theme) */
.pb-seg { display: inline-block; height: .8em; width: auto; vertical-align: bottom; margin-right: .08em; overflow: visible; color: var(--seg, var(--fg)); }
.pb-seg .on { fill: currentColor; }
.pb-seg .off { fill: currentColor; opacity: .05; }

/* ======================= button ======================= */

.pb-btn .pb-bd { -webkit-justify-content: space-between; justify-content: space-between; }
.pb-btn .pb-hd { margin-bottom: 10px; }
.pb-btn .pb-hd.is-float { position: absolute; top: var(--pv, 14px); right: calc(var(--pv, 14px) * 1.1); margin: 0; min-height: 0; }
.pb-btn.is-wide .pb-hd.is-float { top: 50%; margin-top: -8px; }
.pb-glyph { color: var(--tint, var(--fg)); width: var(--g, 30px); height: var(--g, 30px); -webkit-flex-shrink: 0; flex-shrink: 0; margin-bottom: 12px; }
.pb-glyph svg { width: 100%; height: 100%; stroke-width: 1.6; }
.pb-glyph.is-app { width: var(--ga, 44px); height: var(--ga, 44px); }
.pb-glyph.is-app img { width: 100%; height: 100%; display: block; -webkit-filter: drop-shadow(0 3px 8px rgba(0,0,0,.28)); filter: drop-shadow(0 3px 8px rgba(0,0,0,.28)); }
.pb-glyph.is-emoji { font-size: calc(var(--g, 30px) * .9); line-height: 1; }
.pb-label {
  font-family: var(--label-font);
  font-size: calc(var(--fl, 15px) * var(--label-scale));
  font-weight: var(--label-weight);
  letter-spacing: var(--label-track);
  text-transform: var(--label-transform);
  line-height: 1.3;
  padding-bottom: 1px;
  overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* wide, short tiles: icon and label side by side */
.pb-btn.is-wide .pb-bd { -webkit-flex-direction: row; flex-direction: row; -webkit-align-items: center; align-items: center; -webkit-justify-content: flex-start; justify-content: flex-start; }
.pb-btn.is-wide .pb-glyph { margin: 0 16px 0 0; }
.pb-btn.is-wide .pb-label { -webkit-flex: 1; flex: 1; min-width: 0; }
.pb-sub { font-size: 12.5px; color: var(--fg-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-tile.has-tint::before { content: ""; position: absolute; left: 0; top: 0; right: 0; height: 2px; background: var(--tint); }

/* ======================= widgets ======================= */

.pb-clock .pb-num { font-size: var(--fn, 64px); margin-top: auto; }
.pb-clock .pb-sec { color: var(--fg-3); }

.pb-weather .pb-bd { margin-top: 10px; }
.pb-weather .pb-row { display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end; }
.pb-weather .pb-num { font-size: var(--fn, 56px); }
.pb-weather .pb-wicon { width: calc(var(--fn, 56px) * .62); height: calc(var(--fn, 56px) * .62); margin-left: auto; color: var(--fg-2); -webkit-flex-shrink: 0; flex-shrink: 0; }
.pb-weather .pb-wicon svg { width: 100%; height: 100%; stroke-width: 1.4; }
.pb-weather .pb-sub { margin-top: 10px; font-family: var(--sans); }

.pb-volume .pb-bd { margin-top: 10px; -webkit-justify-content: flex-end; justify-content: flex-end; }
.pb-volume .pb-num { font-size: var(--fn, 44px); margin-bottom: 10px; }
.pb-track { position: relative; -webkit-flex: 1; flex: 1; min-height: 22px; border-radius: calc(var(--radius) * .5); background: var(--well); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; touch-action: none; }
.pb-track.is-h { -webkit-flex: 0 0 auto; flex: 0 0 auto; height: 30px; }
.pb-fill { position: absolute; left: 0; bottom: 0; background: var(--fill); border-radius: inherit; -webkit-transition: height .12s, width .12s; transition: height .12s, width .12s; }
.pb-track.is-h .pb-fill { top: 0; }
.pb-track.is-v .pb-fill { right: 0; }
.pb-ticks { position: absolute; left: 0; top: 0; right: 0; bottom: 0; pointer-events: none; opacity: .9; }
.pb-track.is-v .pb-ticks { background: repeating-linear-gradient(to top, transparent 0, transparent calc(10% - 1px), var(--line-2) calc(10% - 1px), var(--line-2) 10%); }
.pb-track.is-h .pb-ticks { background: repeating-linear-gradient(to right, transparent 0, transparent calc(10% - 1px), var(--line-2) calc(10% - 1px), var(--line-2) 10%); }
.pb-volume.is-muted .pb-fill { background: var(--fg-3); }
.pb-volume.is-muted .pb-num small { color: var(--fg-2); font-family: var(--sans); font-weight: 600; letter-spacing: .04em; }
.pb-volume.is-dragging .pb-fill { -webkit-transition: none; transition: none; }
.pb-iconbtn { -webkit-appearance: none; appearance: none; border: 0; background: none; color: inherit; padding: 0; margin: -8px -8px -8px 0; width: 30px; height: 30px; }
.pb-iconbtn svg { width: 16px; height: 16px; margin: 0 auto; }

.pb-np .pb-bd { -webkit-flex-direction: row; flex-direction: row; -webkit-align-items: flex-end; align-items: flex-end; -webkit-justify-content: flex-start; justify-content: flex-start; }
.pb-np .pb-meta { -webkit-flex: 1; flex: 1; min-width: 0; }
.pb-np .pb-title { font-family: var(--label-font); font-size: var(--fl, 18px); font-weight: var(--label-weight); letter-spacing: var(--label-track); line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pb-np .pb-artist { font-size: 13px; color: var(--fg-2); margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-family: var(--sans); }
.pb-np .pb-bar { height: 3px; border-radius: 2px; background: var(--well); margin-top: 12px; overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.pb-np .pb-bar i { display: block; height: 100%; background: var(--fill); width: 0; }
.pb-np .pb-ctrls { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; margin-left: 14px; }
.pb-np .pb-ctrls button { -webkit-appearance: none; appearance: none; border: 0; width: 42px; height: 42px; border-radius: 50%; margin-left: 6px; background: transparent; color: var(--fg); box-shadow: inset 0 0 0 1px var(--line-2); }
.pb-np .pb-ctrls button.is-main { background: var(--fg); color: var(--bg); width: 50px; height: 50px; box-shadow: none; }
.pb-np .pb-ctrls button svg { width: 17px; height: 17px; margin: 0 auto; }
.pb-np .pb-ctrls button.is-down { -webkit-transform: scale(.92); transform: scale(.92); }
.pb-np.is-idle .pb-title { color: var(--fg-2); }

.pb-mic .pb-bd { -webkit-justify-content: flex-end; justify-content: flex-end; }
.pb-mic .pb-glyph { color: var(--fg-2); margin-bottom: 10px; }
.pb-mic .pb-state { font-family: var(--label-font); font-size: var(--fl, 16px); font-weight: var(--label-weight); letter-spacing: var(--label-track); line-height: 1.3; color: var(--fg-2); display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; white-space: nowrap; }
.pb-mic .pb-state .pb-dot { width: .45em; height: .45em; margin-right: .4em; vertical-align: 0; }
.pb-mic.is-live { box-shadow: var(--tile-shadow), inset 0 0 0 1.5px var(--signal); }
.pb-mic.is-live .pb-glyph, .pb-mic.is-live .pb-state { color: var(--signal); }
.pb-mic.is-live .pb-dot { -webkit-animation: pb-pulse 1.6s ease-in-out infinite; animation: pb-pulse 1.6s ease-in-out infinite; }
@-webkit-keyframes pb-pulse { 50% { opacity: .35; } }
@keyframes pb-pulse { 50% { opacity: .35; } }

.pb-sys .pb-bd { margin-top: 6px; -webkit-justify-content: space-around; justify-content: space-around; }
.pb-meter { display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; }
.pb-meter b { -webkit-flex: 0 0 3.4em; flex: 0 0 3.4em; font-family: var(--hd-font); font-size: var(--hd-size); font-weight: var(--hd-weight); letter-spacing: var(--hd-track); color: var(--fg-3); text-transform: uppercase; white-space: nowrap; overflow: hidden; }
.pb-meter .pb-m { -webkit-flex: 1; flex: 1; min-width: 0; height: 4px; border-radius: 2px; background: var(--well); overflow: hidden; margin: 0 12px; box-shadow: inset 0 0 0 1px var(--line); }
.pb-meter .pb-m i { display: block; height: 100%; background: var(--fill); width: 0; -webkit-transition: width .5s; transition: width .5s; }
.pb-meter span { -webkit-flex: 0 0 auto; flex: 0 0 auto; min-width: 2.8em; text-align: right; font-family: var(--num-font); font-size: var(--fm, 15px); font-weight: 500; color: var(--fg); font-variant-numeric: tabular-nums; -webkit-font-feature-settings: "tnum"; font-feature-settings: "tnum"; white-space: nowrap; }

/* ======================= theme flourishes ======================= */

/* Graphite: thin numerals get a touch more weight when small */
.pb-root[data-theme="graphite"] .pb-volume .pb-num, .pb-root[data-theme="graphite"] .pb-meter span { font-weight: 300; }

/* Paper: Futura only for numerals and headers; labels stay in Avenir Next + Hiragino so weights match */

/* Swiss: black rule over every header, red clock block */
.pb-root[data-theme="swiss"] .pb-hd { border-top: 2px solid var(--fg); padding-top: 8px; }
.pb-root[data-theme="swiss"] .pb-btn .pb-hd.is-float { border-top: 0; padding-top: 0; }
.pb-root[data-theme="swiss"] .pb-btn { box-shadow: inset 0 2px 0 var(--fg), var(--tile-shadow); }
.pb-root[data-theme="swiss"] .pb-tile.has-tint::before { display: none; }
.pb-root[data-theme="swiss"] .pb-tile.has-tint .pb-hd { border-top-color: var(--tint); }
.pb-root[data-theme="swiss"] .pb-btn.has-tint { box-shadow: inset 0 2px 0 var(--tint), var(--tile-shadow); }
.pb-root[data-theme="swiss"] .pb-clock { background: var(--signal); color: #fff; box-shadow: none; }
.pb-root[data-theme="swiss"] .pb-clock .pb-hd { color: #fff; border-color: #fff; }
.pb-root[data-theme="swiss"] .pb-clock .pb-sec { color: rgba(255,255,255,.7); }
.pb-root[data-theme="swiss"] .pb-num { line-height: .82; }
.pb-root[data-theme="swiss"] .pb-deg { color: inherit; }
.pb-root[data-theme="swiss"] .pb-glyph svg { stroke-width: 2.2; }
.pb-root[data-theme="swiss"] .pb-np .pb-ctrls button { border-radius: 2px; }

/* Washi: hairline rule under widget headers, vermilion seal for live mic */
.pb-root[data-theme="washi"] .pb-tile > .pb-hd { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.pb-root[data-theme="washi"] .pb-hd > span + span { letter-spacing: .04em; }
.pb-root[data-theme="washi"] .pb-tile > .pb-hd.is-float { border: 0; padding: 0; }
.pb-root[data-theme="washi"] .pb-glyph svg { stroke-width: 1.3; }
.pb-root[data-theme="washi"] .pb-deg { font-size: .34em; margin-top: .12em; }
.pb-root[data-theme="washi"] .pb-mic.is-live { background: var(--signal); box-shadow: none; }
.pb-root[data-theme="washi"] .pb-mic.is-live .pb-state, .pb-root[data-theme="washi"] .pb-mic.is-live .pb-glyph, .pb-root[data-theme="washi"] .pb-mic.is-live .pb-hd { color: #fbf3e4; }
.pb-root[data-theme="washi"] .pb-mic.is-live .pb-hd { border-color: rgba(255,255,255,.3); }
.pb-root[data-theme="washi"] .pb-np .pb-ctrls button { border-radius: 3px; }
.pb-root[data-theme="washi"] .pb-np .pb-ctrls button.is-main { background: var(--fg); color: #f6f0e3; width: 46px; height: 46px; }
.pb-root[data-theme="washi"] .pb-np .pb-bar i, .pb-root[data-theme="washi"] .pb-meter .pb-m i { background: var(--signal); }

/* Blueprint: crop marks at the corners, dashed wells */
.pb-root[data-theme="blueprint"] .pb-tile::after {
  content: ""; position: absolute; left: 6px; top: 6px; right: 6px; bottom: 6px; pointer-events: none;
  background:
    linear-gradient(var(--fg), var(--fg)) left top / 10px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) left top / 1px 10px no-repeat,
    linear-gradient(var(--fg), var(--fg)) right top / 10px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) right top / 1px 10px no-repeat,
    linear-gradient(var(--fg), var(--fg)) left bottom / 10px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) left bottom / 1px 10px no-repeat,
    linear-gradient(var(--fg), var(--fg)) right bottom / 10px 1px no-repeat, linear-gradient(var(--fg), var(--fg)) right bottom / 1px 10px no-repeat;
  opacity: .55;
}
.pb-root[data-theme="blueprint"] .pb-track { box-shadow: none; border: 1px dashed var(--line-2); }
.pb-root[data-theme="blueprint"] .pb-np .pb-bar, .pb-root[data-theme="blueprint"] .pb-meter .pb-m { box-shadow: none; background: none; border-radius: 0; border-bottom: 1px dashed var(--line-2); height: 5px; }
.pb-root[data-theme="blueprint"] .pb-np .pb-bar i, .pb-root[data-theme="blueprint"] .pb-meter .pb-m i { height: 4px; }
.pb-root[data-theme="blueprint"] .pb-glyph svg { stroke-width: 1.4; }
.pb-root[data-theme="blueprint"] .pb-np .pb-ctrls button { border-radius: 2px; background: transparent; box-shadow: inset 0 0 0 1px var(--line-2); }
.pb-root[data-theme="blueprint"] .pb-np .pb-ctrls button.is-main { background: var(--signal); color: #12386a; }
.pb-root[data-theme="blueprint"] .pb-mic.is-live { background: rgba(255, 210, 63, .12); }

/* Instrument: green phosphor numerals and bars, amber alarm, legend plates */
.pb-root[data-theme="instrument"] .pb-hd { color: var(--fg-2); }
.pb-root[data-theme="instrument"] .pb-label.is-latin, .pb-root[data-theme="blueprint"] .pb-label.is-latin { font-size: calc(var(--fl, 15px) * 1.22); letter-spacing: .04em; }
.pb-root[data-theme="instrument"] .pb-num { display: -webkit-flex; display: flex; -webkit-align-items: flex-end; align-items: flex-end; line-height: 1; }
.pb-root[data-theme="instrument"] .pb-seg { -webkit-filter: drop-shadow(0 0 4px rgba(125, 255, 180, .35)); filter: drop-shadow(0 0 4px rgba(125, 255, 180, .35)); }
.pb-root[data-theme="instrument"] .pb-glyph { color: var(--tint, #b9d8c6); }
.pb-root[data-theme="instrument"] .pb-sub, .pb-root[data-theme="instrument"] .pb-np .pb-artist { font-family: var(--sans); }
.pb-root[data-theme="instrument"] .pb-fill, .pb-root[data-theme="instrument"] .pb-meter .pb-m i, .pb-root[data-theme="instrument"] .pb-np .pb-bar i { box-shadow: 0 0 8px rgba(125, 255, 180, .4); }
.pb-root[data-theme="instrument"] .pb-np .pb-ctrls button.is-main { background: var(--good); color: #08110c; }
.pb-root[data-theme="instrument"] .pb-mic.is-live { background: rgba(255, 177, 59, .08); }
.pb-root[data-theme="instrument"] .pb-meter span { font-family: "DIN Condensed", "Avenir Next Condensed", sans-serif; font-size: calc(var(--fm, 15px) * 1.2); color: var(--good); }

/* Aurora: frosted glass */
.pb-root[data-theme="aurora"] .pb-tile { -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); }
.pb-root[data-theme="aurora"] .pb-num { text-shadow: 0 1px 12px rgba(0, 0, 0, .25); }
.pb-root[data-theme="aurora"] .pb-np .pb-ctrls button { background: rgba(255,255,255,.12); box-shadow: none; }
.pb-root[data-theme="aurora"] .pb-np .pb-ctrls button.is-main { background: #fff; color: #1a1636; }
@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .pb-root[data-theme="aurora"] { --tile: rgba(40, 36, 70, .78); }
}

/* ======================= theme swatch (pickers) ======================= */

.pb-swatch { border-radius: 14px; overflow: hidden; background: var(--paint); padding: 10px; position: relative; }
.pb-swatch .pb-tile { height: 84px; padding: 10px 12px; --pad: 10px 12px; }
.pb-swatch .pb-num { font-size: 40px; }
.pb-swatch .pb-name { font-family: var(--label-font); font-weight: var(--label-weight); letter-spacing: var(--label-track); color: var(--fg); font-size: 13px; margin-top: 9px; }
.pb-swatch .pb-desc { color: var(--fg-2); font-size: 11px; margin-top: 2px; font-family: var(--sans); }

/* ======================= editor helpers ======================= */

.pb-tile.is-dragging { opacity: .35; }
.pb-tile.is-drop { box-shadow: inset 0 0 0 2px #0a84ff; }

/* ======================= look (config.look) ======================= */
/* Wallpaper: <div class="pb-bg"><i>image</i><b>dim</b></div>, first child of the .pb-root. */
.pb-bg { position: absolute; left: 0; top: 0; right: 0; bottom: 0; overflow: hidden; pointer-events: none; z-index: 0; }
body > .pb-bg { position: fixed; }
.pb-bg i, .pb-bg b { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.pb-bg i {
  background: center / cover no-repeat;
  -webkit-filter: blur(var(--bg-blur, 0)); filter: blur(var(--bg-blur, 0));
  -webkit-transform: scale(var(--bg-scale, 1)); transform: scale(var(--bg-scale, 1));
}
.pb-bg b { background: #000; opacity: var(--bg-dim, 0); }
/* Frosted tiles: blur whatever is behind them. */
.pb-root.has-frost .pb-tile { -webkit-backdrop-filter: blur(var(--frost)) saturate(150%); backdrop-filter: blur(var(--frost)) saturate(150%); }
/* A chosen label font replaces the theme's; drop the size boost meant for condensed theme faces. */
.pb-root.has-font .pb-label.is-latin { font-size: var(--fl, 15px); letter-spacing: var(--label-track); }

/* Now playing in a narrow, tall tile: title on top, controls underneath */
.pb-np.is-stack .pb-bd { -webkit-flex-direction: column; flex-direction: column; -webkit-align-items: stretch; align-items: stretch; -webkit-justify-content: flex-end; justify-content: flex-end; }
.pb-np.is-stack .pb-ctrls { margin: 14px 0 0; -webkit-justify-content: space-between; justify-content: space-between; }
.pb-np.is-stack .pb-ctrls button { margin-left: 0; }

/* Free placement (auto-arrange off) in the editor: empty cells you can drop on or add to */
.pb-slot { border-radius: var(--radius); box-shadow: inset 0 0 0 1.5px var(--line-2); background: transparent; display: -webkit-flex; display: flex; -webkit-align-items: center; align-items: center; -webkit-justify-content: center; justify-content: center; color: var(--fg-3); opacity: .55; cursor: pointer; -webkit-transition: opacity .15s, box-shadow .15s; transition: opacity .15s, box-shadow .15s; }
.pb-slot svg { width: 20px; height: 20px; }
.pb-slot:hover { opacity: 1; }
.pb-slot.is-drop { opacity: 1; box-shadow: inset 0 0 0 2px #0a84ff; }
