@font-face { font-family: "Unbounded"; font-weight: 200 900; src: url(fonts/unbounded-latin.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "JetBrains Mono"; font-weight: 400; src: url(fonts/jetbrains-mono-regular.ttf) format("truetype"); font-display: block; }
@font-face { font-family: "JetBrains Mono"; font-weight: 500; src: url(fonts/jetbrains-mono-medium.ttf) format("truetype"); font-display: block; }
@font-face { font-family: "JetBrains Mono"; font-weight: 700; src: url(fonts/jetbrains-mono-bold.ttf) format("truetype"); font-display: block; }
@font-face { font-family: "Caveat"; font-weight: 400; src: url(fonts/caveat-400.woff2) format("woff2"); font-display: block; }
@font-face { font-family: "Caveat"; font-weight: 600; src: url(fonts/caveat-600.woff2) format("woff2"); font-display: block; }

:root {
  --bg: #050507;
  --surface: #0c0b11;
  --raised: #15141b;
  --edge: rgba(246, 244, 250, 0.10);
  --edge-strong: rgba(246, 244, 250, 0.22);
  --ink: #f6f4fa;
  --dim: #9a96a8;
  --accent: #ff2e88;
  --accent-ink: #ff8fc0;
  --accent-deep: #b3155f;
  --cyan: #38e1ff;
  --danger: #ff8a9a;
  --radius: 12px;
  --gap: 16px;
  --title: "Unbounded", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
  --tabs: 64px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
button, label { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 14px/1.5 var(--mono); -webkit-font-smoothing: antialiased; }

.top { display: flex; align-items: center; justify-content: space-between; gap: var(--gap); padding: 12px 20px; border-bottom: 1px solid var(--edge); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand .mark { height: 30px; width: auto; }
.brand .word { height: 17px; width: auto; }
.brand .by { font: 500 10px var(--mono); letter-spacing: 0.32em; color: var(--dim); margin-left: 4px; white-space: nowrap; }
.now { color: var(--dim); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

.workspace { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: var(--gap); padding: var(--gap) 20px; height: calc(100% - 57px); }
/* The board's box keeps the board's proportions while there's room, so the board and the player under it sit together
   in the middle; when there isn't, it shrinks and the board fits inside. */
.stage-wrap { display: flex; flex-direction: column; justify-content: center; gap: 12px; min-height: 0; min-width: 0; }
.stage-box { position: relative; flex: 0 1 auto; width: 100%; aspect-ratio: var(--board-ar, 9 / 16); min-height: 0; min-width: 0;
  display: grid; place-items: center; }
.stage-box:has(> .empty:not([hidden])), .stage-box:has(> .busy:not([hidden])) { min-height: 300px; }
#stage { border-radius: 14px; box-shadow: 0 0 0 1px var(--edge); background: #000; cursor: pointer; touch-action: manipulation; }
.ring { position: absolute; border: 2px solid var(--accent); border-radius: 12px; box-shadow: 0 0 0 4px rgba(255, 46, 136, 0.18); pointer-events: none; transition: all 160ms ease-out; }
.empty, .busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; text-align: center; gap: 10px; padding: 16px; }
.empty .lead { font: 600 17px var(--title); margin: 10px 0 0; max-width: 28ch; text-wrap: balance; }
.empty .hint { color: var(--dim); margin: 0 0 6px; }
.empty .row { justify-content: center; }
.busy { background: rgba(5, 5, 7, 0.8); border-radius: 14px; }
.busy p { margin: 0; font: 600 15px var(--title); }
.bar { width: min(320px, 70vw); height: 4px; background: var(--raised); border-radius: 2px; overflow: hidden; }
.bar > div { height: 100%; width: 0; background: var(--accent); transition: width 120ms linear; }

.transport { display: flex; align-items: center; gap: 14px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); }
.icon { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: grid; place-items: center; cursor: pointer; flex: none; }
.icon svg { width: 22px; height: 22px; fill: currentColor; }

.icon:disabled { opacity: 0.35; cursor: default; }
.icon, .seg button, .strip button, .looks button, .tiles button { transition: transform 100ms ease-out, border-color 150ms, background 150ms, color 150ms; }
.icon:active:not(:disabled), .seg button:active, .strip button:active, .looks button:active, .tiles button:active { transform: scale(0.96); }
.meta { display: flex; flex-direction: column; min-width: 92px; }
.meta .name { display: none; }
.time { font-variant-numeric: tabular-nums; color: var(--dim); }
.scrub { position: relative; flex: 1; height: 44px; }
.scrub canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.scrub input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }

.panel { overflow-y: auto; display: flex; flex-direction: column; gap: var(--gap); padding-bottom: 24px; }
.group { background: var(--surface); border: 1px solid var(--edge); border-radius: var(--radius); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.group h2 { margin: 0; font: 600 12px var(--title); letter-spacing: 0.12em; text-transform: uppercase; }
.grab { display: none; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.tight { justify-content: space-between; }
.field { display: flex; flex-direction: column; gap: 8px; }
.label { color: var(--dim); font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; }
.note { margin: 0; color: var(--dim); font-size: 12px; }
.note.warn { color: var(--danger); }

.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--edge-strong); background: var(--raised); color: var(--ink); font: 500 14px var(--mono); cursor: pointer;
  transition: border-color 150ms, background 150ms; }

.button.primary { background: var(--accent-deep); border-color: var(--accent); }

.button:disabled { opacity: 0.45; cursor: default; }
.link { background: none; border: 0; color: var(--accent-ink); font: inherit; cursor: pointer; padding: 8px; min-height: 44px; }

.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg button { min-height: 40px; padding: 0 12px; border-radius: 9px; border: 1px solid var(--edge); background: transparent; color: var(--dim);
  font: 500 13px var(--mono); cursor: pointer; display: inline-flex; align-items: center; gap: 8px; }
.seg button[aria-checked="true"] { color: var(--ink); border-color: var(--accent); background: rgba(255, 46, 136, 0.12); }

.seg .shape { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.5; flex: none; }
.seg .map { flex: none; overflow: visible; }
.seg .map rect { fill: none; stroke: currentColor; stroke-width: 1; opacity: 0.55; }
.seg .map rect.on { fill: var(--accent); stroke: var(--accent); opacity: 1; }
.seg button span { white-space: nowrap; }
/* Themes and backgrounds: small pictures in a grid that scrolls on its own, so the panel stays short. */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: 8px; max-height: 332px; overflow-y: auto;
  overscroll-behavior: contain; padding: 2px; margin: -2px; scrollbar-width: thin; }
.tiles button { display: flex; flex-direction: column; gap: 5px; padding: 5px; border-radius: 10px; border: 1px solid var(--edge);
  background: transparent; color: var(--dim); font: 500 12px var(--mono); cursor: pointer; text-align: left; min-width: 0; }
.tiles button[aria-checked="true"] { border-color: var(--accent); color: var(--ink); background: rgba(255, 46, 136, 0.08); }
.tiles button[hidden] { display: none; }
.tiles canvas { width: 100%; aspect-ratio: 3 / 2; border-radius: 6px; display: block; }
.tiles span { padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

.strip { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; }
.strip button { flex: none; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px; border-radius: 12px;
  border: 1px solid var(--edge); background: transparent; color: var(--dim); font: 500 12px var(--mono); cursor: pointer; scroll-snap-align: start; }
.strip button[aria-checked="true"] { border-color: var(--accent); color: var(--ink); background: rgba(255, 46, 136, 0.08); }
.strip canvas { display: block; border-radius: 6px; background: var(--raised); }

.looks { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; }
.looks button { display: flex; flex-direction: column; gap: 6px; padding: 6px; border-radius: 12px; border: 1px solid var(--edge); background: transparent;
  color: var(--dim); font: 500 12px var(--mono); cursor: pointer; text-align: left; }
.looks button[aria-checked="true"] { border-color: var(--accent); color: var(--ink); background: rgba(255, 46, 136, 0.08); }
.looks canvas { width: 100%; aspect-ratio: 4 / 3; border-radius: 8px; display: block; background: var(--raised); }
.looks span, .strip span { padding: 0 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }

/* The looks' tools: shuffling, the search and the groups, which stay in view while the grid scrolls under them. */
.button.small { min-height: 38px; padding: 0 12px; font-size: 13px; }
.lookbar { position: sticky; top: -1px; z-index: 2; display: flex; flex-direction: column; gap: 8px; padding: 6px 0 8px;
  margin: 0 -4px; padding-inline: 4px; background: var(--surface); }
#lookFind { width: 100%; min-height: 40px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--edge-strong);
  background: var(--raised); color: var(--ink); font: 400 14px var(--mono); }
#lookFind::placeholder { color: var(--dim); }
#lookFind:focus { outline: none; border-color: var(--accent); }
.lookline { display: flex; align-items: center; gap: 6px; min-width: 0; }
.iconbtn { display: none; flex: none; width: 38px; height: 38px; border-radius: 50%; border: 1px solid var(--edge-strong); background: var(--raised);
  color: var(--ink); place-items: center; cursor: pointer; }
.iconbtn svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.iconbtn:active { transform: scale(0.94); }
.chips { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; min-width: 0; flex: 1; }
.chips::-webkit-scrollbar { display: none; }
.chips button { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 0 11px; border-radius: 17px;
  border: 1px solid var(--edge); background: transparent; color: var(--dim); font: 500 12px var(--mono); cursor: pointer;
  transition: border-color 150ms, background 150ms, color 150ms; }
.chips button small { font-size: 11px; opacity: 0.7; }
.chips button[aria-checked="true"] { color: var(--ink); border-color: var(--accent); background: rgba(255, 46, 136, 0.12); }
.looks button[hidden] { display: none; }
/* Editing the panels (0.64.0): a handle on each line between panels, and the panels as boxes to drag onto each other. */
.editor { position: absolute; z-index: 3; touch-action: none; }
.editor[hidden] { display: none; }
.edit-pane { position: absolute; box-shadow: inset 0 0 0 1px rgba(255, 46, 136, 0.6); cursor: grab; touch-action: none; transition: box-shadow 120ms ease-out; }
.edit-pane.lifted { z-index: 2; cursor: grabbing; background: rgba(255, 46, 136, 0.16); box-shadow: inset 0 0 0 2px var(--accent); transition: none; }
.edit-pane.target { box-shadow: inset 0 0 0 3px var(--accent); background: rgba(255, 46, 136, 0.1); }
.edit-line { position: absolute; z-index: 1; touch-action: none; outline: none; border-radius: 4px; }
.edit-line.x { cursor: col-resize; }
.edit-line.y { cursor: row-resize; }
.edit-line::after { content: ""; position: absolute; left: 50%; top: 50%; border-radius: 3px; background: var(--accent);
  box-shadow: 0 0 0 2px rgba(5, 5, 7, 0.55); transform: translate(-50%, -50%); }
.edit-line.x::after { width: 5px; height: min(56px, 70%); }
.edit-line.y::after { height: 5px; width: min(56px, 70%); }
.edit-line.held::after, .edit-line:focus-visible::after { background: #fff; }
.edit-line:focus-visible { box-shadow: 0 0 0 2px var(--accent); }
.edit-tip { position: absolute; z-index: 4; transform: translateX(-50%); padding: 3px 8px; border-radius: 6px; background: rgba(5, 5, 7, 0.85);
  color: #fff; font: 500 12px var(--mono); pointer-events: none; white-space: nowrap; }
.edittools { gap: 6px; }
.button[aria-pressed="true"] { border-color: var(--accent); background: rgba(255, 46, 136, 0.12); }
/* Rows with a name each: the panel tools while editing, and the board's spacing. */
.named { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 12px; align-items: center; }
.named[hidden] { display: none; }
.named > span { color: var(--dim); font-size: 13px; }
.named .seg button { min-height: 36px; padding: 0 10px; }
/* Look or Style: which side of the card the panel changes. */
.seg.mode button { flex: 1; justify-content: center; }
.pane { display: flex; flex-direction: column; gap: 14px; }
#stylePane .strip span { max-width: 92px; }
#stylePane .strip { flex-wrap: wrap; overflow: visible; }
#styleVariations button, #styleDrivers button { white-space: nowrap; }

.check { display: flex; align-items: center; gap: 10px; color: var(--ink); cursor: pointer; min-height: 44px; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 4px 14px; margin: 0; }
.facts dt { color: var(--dim); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; }
.facts dd { margin: 0; font-variant-numeric: tabular-nums; }
.facts .src { color: var(--dim); font-size: 12px; }
.progress { display: flex; flex-direction: column; gap: 6px; }
.progress .bar { width: 100%; }

.tabs { display: none; }
.drop { position: fixed; inset: 0; background: rgba(5, 5, 7, 0.86); display: grid; place-items: center; z-index: 40; border: 2px dashed var(--accent); }
.drop p { font: 600 18px var(--title); text-align: center; padding: 0 24px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Hover only where there's a pointer that hovers; on a touch screen it would stick after a tap. */
@media (hover: hover) {
  .icon:hover:not(:disabled) { background: #ff4f9c; }
  .button:hover:not(:disabled) { border-color: var(--accent); }
  .button.primary:hover:not(:disabled) { background: #d11d72; }
  .seg button:hover, .strip button:hover, .looks button:hover, .chips button:hover, .tiles button:hover { color: var(--ink); }
}

/* Phones, small tablets and short windows: the board fills the screen with the player under it, and the panels open one at a time
   from a tab bar, docked under the player so the whole board stays in view. */
@media (max-width: 900px), (max-height: 520px) {
  body { height: 100dvh; display: flex; flex-direction: column; overflow: hidden; }
  .top { flex: none; padding: 10px 16px; padding-top: max(10px, env(safe-area-inset-top)); }
  .brand { gap: 9px; }
  .brand .mark { height: 24px; }
  .brand .word { height: 13px; }
  .brand .by { font-size: 9px; letter-spacing: 0.26em; }
  .now { display: none; }
  .meta { min-width: 0; flex: 0 1 auto; max-width: 38%; }
  .meta .name { display: block; font: 600 12px var(--title); color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .meta .name:empty { display: none; }
  /* The chips say what they are, so their labels give their room to the board. */
  .sheet .label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .workspace { flex: 1; min-height: 0; height: auto; display: flex; flex-direction: column; gap: 0; padding: 10px 0 0; }
  .stage-wrap { flex: 1; min-height: 0; gap: 10px; padding: 0 12px 10px; }
  .transport { padding: 6px 12px 6px 6px; gap: 12px; }
  .time { min-width: 0; font-size: 12px; }
  .panel { flex: none; display: grid; grid-template-rows: 0fr; overflow: hidden; padding: 0; gap: 0;
    transition: grid-template-rows 260ms cubic-bezier(.2, .8, .2, 1); }
  .panel.open { grid-template-rows: 1fr; }
  .sheet { display: none; position: relative; min-height: 0; max-height: 50dvh; overflow-y: auto; overscroll-behavior: contain;
    border-radius: 20px 20px 0 0; border-width: 1px 0 0; padding: 0 16px 16px; gap: 12px; }
  .sheet.shown { display: flex; }
  /* The panel scrolls as a whole; its rows keep their own height rather than squeezing to fit. */
  .sheet > * { flex-shrink: 0; }
  .sheet h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .grab { display: block; flex: none; position: relative; height: 22px; margin: 0 -16px -2px; touch-action: none; cursor: grab; }
  .grab::before { content: ""; position: absolute; left: 50%; top: 8px; width: 40px; height: 4px; margin-left: -20px;
    border-radius: 2px; background: var(--edge-strong); }
  .tabs { flex: none; display: grid; grid-template-columns: repeat(4, 1fr); height: calc(var(--tabs) + env(safe-area-inset-bottom));
    padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
    background: var(--surface); border-top: 1px solid var(--edge); }
  .tabs button { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
    border: 0; background: none; color: var(--dim); font: 500 11px var(--mono); letter-spacing: 0.04em; cursor: pointer; min-height: 48px; }
  .tabs svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
  .tabs button[aria-expanded="true"] { color: var(--accent); }
  .tabs button[aria-expanded="true"]::before { content: ""; position: absolute; top: -1px; left: 32%; right: 32%; height: 2px;
    border-radius: 0 0 2px 2px; background: var(--accent); }
  /* Rows that scroll sideways, out to the panel's edges. */
  .strip, #slots { display: flex; flex-wrap: nowrap; overflow-x: auto; margin: 0 -16px; padding: 2px 16px 4px;
    scroll-snap-type: x proximity; scroll-padding: 0 16px; scrollbar-width: none; }
  .strip::-webkit-scrollbar, #slots::-webkit-scrollbar { display: none; }
  /* The looks: a grid of three that scrolls with the panel, the search and groups held at its top. */
  .looks { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  /* Themes and backgrounds run sideways in two rows, out to the panel's edges. */
  .tiles { grid-template-columns: none; grid-auto-flow: column; grid-template-rows: repeat(2, auto); grid-auto-columns: 86px;
    max-height: none; overflow-x: auto; overflow-y: hidden; margin: 0 -16px; padding: 2px 16px 4px; scrollbar-width: none; }
  .tiles::-webkit-scrollbar { display: none; }
  .looks button { padding: 5px; }
  /* On a phone the search and the shuffle buttons give their room to the board: shuffling is the round button
     beside the groups, and the panel stays short enough that the board keeps most of the screen. */
  #sheet-looks { max-height: min(42dvh, 330px); }
  .lookbar { margin: 0 -16px; padding: 4px 0 6px 16px; }
  #lookFind, .looktools { display: none; }
  .iconbtn { display: grid; }
  .chips { padding-right: 16px; }
  #slots button { flex: none; scroll-snap-align: start; }
  /* The style rows need their names: a row of pictures doesn't say whether it's finishes or frames. */
  #stylePane .label, #cardPane .label { position: static; width: auto; height: auto; overflow: visible; clip-path: none; }
  /* While the panels are being edited, the Board panel keeps only the editing tools, so the board has the room. */
  #sheet-board.editing > .field:not(#editField), #sheet-board.editing > .check { display: none; }
  .named { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .named > div { margin-bottom: 6px; }
  #stylePane .strip { flex-wrap: nowrap; overflow-x: auto; }
  #styleVariations, #styleDrivers { margin: 0 -16px; padding: 0 16px 2px; }
  .field { gap: 6px; }
}
/* A phone on its side: the tabs stand down the right edge and the open panel sits beside the board. */
@media (orientation: landscape) and (max-height: 520px) {
  body { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .top { grid-column: 1; padding-block: 6px; padding-left: max(16px, env(safe-area-inset-left)); }
  .workspace { grid-column: 1; grid-row: 2; flex-direction: row; padding: 4px 0 0; }
  .stage-wrap { padding: 0 10px 8px max(10px, env(safe-area-inset-left)); gap: 8px; }
  .panel { display: block; width: 0; transition: width 260ms cubic-bezier(.2, .8, .2, 1); }
  .panel.open { width: min(400px, 46vw); }
  .sheet { width: min(400px, 46vw); height: 100%; max-height: none; border-radius: 16px 0 0 0; border-width: 1px 0 0 1px; padding-top: 14px; }
  .grab { display: none; }
  .tabs { grid-column: 2; grid-row: 1 / 3; grid-template-columns: none; grid-template-rows: repeat(4, 1fr); height: auto;
    width: calc(76px + env(safe-area-inset-right)); padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) 0;
    border-top: 0; border-left: 1px solid var(--edge); }
  .tabs button[aria-expanded="true"]::before { top: 30%; bottom: 30%; left: -1px; right: auto; width: 2px; height: auto; border-radius: 0 2px 2px 0; }
}
@media (max-width: 380px) { .brand .by { display: none; } }
@media (hover: none) { .empty .hint { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* The account button in the header and the Plans dialog. */
.now { margin-left: auto; }
.account { flex: none; }
.acct { display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 20px; border: 1px solid var(--edge-strong);
  background: var(--raised); color: var(--ink); font: 500 13px var(--mono); cursor: pointer; max-width: 260px; }
.acct:has(.acct-avatar:not([hidden])) { padding-left: 5px; }
.acct-avatar { flex: none; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent); font: 700 13px var(--title); color: #fff; }
.acct-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.acct-plan, .looks button[data-locked="true"]::after, .seg button[data-pro="true"]::after, .label[data-pro="true"]::after { font: 800 9px var(--title); letter-spacing: 0.12em; color: #fff;
  background: var(--accent); border-radius: 6px; padding: 3px 6px; line-height: 1; }
.acct-plan { flex: none; }
.looks button[data-locked="true"] { position: relative; }
.looks button[data-locked="true"]::after { content: "PRO"; position: absolute; top: 11px; right: 11px; }
.seg button[data-pro="true"]::after { content: "PRO"; }
.label[data-pro="true"]::after { content: "PRO"; margin-left: 8px; vertical-align: 1px; }
.seg button:disabled { opacity: 0.5; cursor: default; }
.check:has(input:disabled) { color: var(--dim); cursor: default; }
.button.danger { border-color: rgba(255, 138, 154, 0.5); color: var(--danger); }

.plans { width: min(580px, calc(100vw - 32px)); max-height: min(88dvh, 860px); padding: 0; border: 1px solid var(--edge-strong); border-radius: 18px;
  background: var(--surface); color: var(--ink); overflow-y: auto; overscroll-behavior: contain; }
.plans::backdrop { background: rgba(5, 5, 7, 0.74); }
.plans-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 12px 22px;
  background: var(--surface); border-bottom: 1px solid var(--edge); }
.plans-head h2 { margin: 0; font: 600 13px var(--title); letter-spacing: 0.12em; text-transform: uppercase; }
.plans .iconbtn.close { display: grid; }
.plans-reason { margin: 0; padding: 12px 22px; background: rgba(255, 46, 136, 0.1); border-bottom: 1px solid var(--edge); color: var(--accent-ink); }
.plans-part { display: flex; flex-direction: column; gap: 10px; padding: 16px 22px; }
.plans-part:empty { display: none; }
.plans-part + .plans-part { border-top: 1px solid var(--edge); }
.plans-part h3 { margin: 0; font: 600 12px var(--title); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dim); }
.plans-part p { margin: 0; }
#plansNote { padding: 12px 22px 0; }
#plansNote:empty { display: none; }
.plans .button { align-self: flex-start; text-decoration: none; }
.plans .link { align-self: flex-start; text-decoration: none; padding-inline: 0; }
.who { display: flex; align-items: center; gap: 12px; }
.who .avatar { flex: none; width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-deep);
  box-shadow: inset 0 0 0 1px var(--accent); font: 700 16px var(--title); color: #fff; }
.who-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.who-text strong { font: 600 14px var(--title); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dim { color: var(--dim); }
.source { color: var(--accent-ink); }
.features { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.features li { position: relative; padding-left: 18px; }
.features li::before { content: ""; position: absolute; left: 2px; top: 0.62em; width: 7px; height: 7px; border-radius: 50%; background: var(--cyan); }
.plan, .sub { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--edge); border-radius: 14px; background: var(--raised); }
.plan-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.plan-top strong { font: 600 15px var(--title); }
.plan-price { font: 600 15px var(--title); color: var(--accent-ink); font-variant-numeric: tabular-nums; }
.payments summary { cursor: pointer; color: var(--dim); min-height: 32px; display: flex; align-items: center; }
.payments ul { margin: 6px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.payments .reversed { color: var(--dim); text-decoration: line-through; }
@media (hover: hover) { .acct:hover { border-color: var(--accent); } }
@media (max-width: 900px), (max-height: 520px) {
  .acct { min-height: 36px; padding: 0 12px; font-size: 12px; }
  .acct:has(.acct-avatar:not([hidden])) { padding: 0 5px; gap: 6px; }
  .acct-avatar { width: 26px; height: 26px; font-size: 12px; }
  .acct-avatar:not([hidden]) + .acct-name { display: none; }
  .acct-plan { margin-right: 4px; }
  .plans { width: 100vw; max-width: 100vw; max-height: 92dvh; margin: auto 0 0; border-radius: 20px 20px 0 0; border-width: 1px 0 0;
    padding-bottom: env(safe-area-inset-bottom); }
  .plans-head { padding-left: 18px; }
  .plans-part, .plans-reason { padding-inline: 18px; }
  #plansNote { padding-inline: 18px; }
}

/* The account dialog's tabs and forms. */
.plans-tabs { display: flex; gap: 4px; padding: 10px 22px 0; border-bottom: 1px solid var(--edge); }
.plans-tabs button { min-height: 42px; padding: 0 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--dim);
  font: 600 12px var(--title); letter-spacing: 0.08em; text-transform: uppercase; cursor: pointer; margin-bottom: -1px; }
.plans-tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }
.form { display: flex; flex-direction: column; gap: 12px; }
.form .field { gap: 6px; }
.form .label { text-transform: none; letter-spacing: 0; font-size: 13px; color: var(--ink); }
.input { width: 100%; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--edge-strong); background: var(--raised); color: var(--ink);
  font: 400 15px var(--mono); }
.input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 46, 136, 0.18); }
.hint { color: var(--dim); font-size: 12px; }
.trap { position: absolute; left: -10000px; width: 1px; height: 1px; opacity: 0; }
.doors { margin-bottom: 4px; }
.doors button { flex: 1; justify-content: center; }
.doors button[aria-selected="true"] { color: var(--ink); border-color: var(--accent); background: rgba(255, 46, 136, 0.12); }
.or { color: var(--dim); text-align: center; font-size: 12px; letter-spacing: 0.1em; text-transform: uppercase; }
.plans .button.pattalium { align-self: stretch; border-color: var(--edge-strong); }
.more summary { cursor: pointer; color: var(--accent-ink); min-height: 40px; display: flex; align-items: center; }
.more[open] summary { margin-bottom: 8px; }
.codes { margin: 0; padding: 14px 16px; list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 18px;
  border: 1px dashed var(--edge-strong); border-radius: 12px; background: var(--raised); font: 500 15px var(--mono); letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums; }
.qr { width: 216px; height: 216px; image-rendering: pixelated; border-radius: 12px; align-self: center; }
.secret { display: block; padding: 10px 12px; border-radius: 10px; background: var(--raised); font: 500 14px var(--mono); letter-spacing: 0.08em; word-break: break-all;
  user-select: all; }
@media (max-width: 900px), (max-height: 520px) {
  .plans-tabs { padding-inline: 18px; }
}
.plan .yours { align-self: flex-start; font: 700 11px var(--title); letter-spacing: 0.12em; text-transform: uppercase; color: var(--good, #7ee0a8);
  border: 1px solid rgba(126, 224, 168, 0.5); border-radius: 8px; padding: 8px 12px; }

/* (0.7.0) A mouse can't swipe, and these rows hid their scrollbars, so on a computer some chips and pictures could not
   be reached. With a mouse, rows of pictures wrap into grids, short rows of chips wrap, and the long row of look groups
   shows a thin scrollbar and scrolls with the wheel. Phones keep swiping. */
@media (hover: hover) and (pointer: fine) {
  .chips { scrollbar-width: thin; scrollbar-color: var(--edge-strong) transparent; padding-bottom: 6px; }
  .chips::-webkit-scrollbar { display: block; height: 6px; }
  .chips::-webkit-scrollbar-thumb { background: var(--edge-strong); border-radius: 3px; }
  .chips::-webkit-scrollbar-track { background: transparent; }
  #themeKinds, #styleVariations, #styleDrivers { flex-wrap: wrap; overflow: visible; margin: 0; padding: 0 0 2px; }
  .strip, #slots, #stylePane .strip { flex-wrap: wrap; overflow: visible; margin: 0; padding: 2px 0 4px; scroll-snap-type: none; }
  .tiles { grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); grid-auto-flow: row; grid-template-rows: none;
    grid-auto-columns: auto; max-height: 332px; overflow-x: hidden; overflow-y: auto; margin: -2px; padding: 2px; scrollbar-width: thin; }
}
