:root {
  --ink: #f4eee4;
  --mute: rgba(244, 238, 228, 0.72);
  --go: #f3d39a;
  --glass: rgba(16, 18, 20, 0.38);
  --glass-shine: rgba(255, 255, 255, 0.12);
  --glass-edge: rgba(255, 255, 255, 0.18);
  --frost: blur(18px) saturate(1.2);
  --bar: linear-gradient(var(--glass-shine), var(--glass-shine)), var(--glass);
  --line: rgba(255,255,255,0.1);
}
.glass {
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
}
* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: #1a1814;
  color: var(--ink);
  font: 15px/1.35 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  user-select: none;
}
#board {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  display: block;
}
#space {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  display: none;
  touch-action: none;
}
body.space-on #board { visibility: hidden; }
body.space-on #space {
  display: block;
  cursor: grab;
}
body.space-on #space:active { cursor: grabbing; }
body.space-on #tags { display: none; }
body.space-on #hits,
#hits[data-space="3d"] {
  pointer-events: none;
  cursor: grab;
}
body.space-on #hits:active,
#hits[data-space="3d"]:active {
  cursor: grabbing;
}
body.space-on #projector,
body.space-on #grid {
  pointer-events: none;
}
body.space-on #hits [data-section],
body.space-on #hits [data-object],
body.space-on #hits [data-box-corner],
body.space-on #hits [data-edge],
body.space-on #hits [data-point],
body.space-on #hits [data-shape-edge],
body.space-on #hits [data-shape-vertex],
body.space-on #hits [id^="stroke-"] {
  pointer-events: none;
}
body.space-on #hits [data-face],
body.space-on #hits [id^="wall-"],
body.space-on #hits [id^="face-"],
#hits[data-space="3d"] [data-face],
#hits[data-space="3d"] [id^="wall-"],
#hits[data-space="3d"] [id^="face-"] {
  pointer-events: auto;
  cursor: inherit;
}
body.space-on #lockDims,
body.space-on #wallTools [data-ink],
body.space-on #wallTools [data-tool],
body.space-on #addArt,
body.space-on #wallTools .seg { display: none; }
#hits {
  position: absolute;
  inset: 0;
  z-index: 1;
  cursor: crosshair;
  touch-action: none;
}
#hits .hit {
  position: absolute;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  outline: none;
  -webkit-tap-highlight-color: transparent;
  cursor: inherit;
  min-height: 0;
}
#hits [data-shape-vertex],
#hits [data-point],
#hits [data-section],
#hits [data-object],
#hits [id^="stroke-"] {
  cursor: move;
}
#hits [data-face] {
  cursor: pointer;
}
#hits[data-mode="ink"] [data-section],
#hits[data-mode="ink"] [data-object],
#hits[data-mode="ink"] [data-shape-edge],
#hits[data-mode="ink"] [data-shape-vertex],
#hits[data-mode="ink"] [data-face],
#hits[data-mode="ink"] [data-edge],
#hits[data-mode="ink"] [data-point],
#hits[data-mode="ink"] [id^="stroke-"] {
  pointer-events: none;
  cursor: inherit;
}
body.space-on #hits[data-mode="ink"] [data-face],
body.space-on #hits[data-mode="ink"] [id^="wall-"],
body.space-on #hits[data-mode="ink"] [id^="face-"],
#hits[data-space="3d"][data-mode="ink"] [data-face],
#hits[data-space="3d"][data-mode="ink"] [id^="wall-"],
#hits[data-space="3d"][data-mode="ink"] [id^="face-"] {
  pointer-events: auto;
  cursor: inherit;
}
#hits [data-box-corner="tl"],
#hits [data-box-corner="br"] { cursor: nwse-resize; }
#hits [data-box-corner="tr"],
#hits [data-box-corner="bl"] { cursor: nesw-resize; }
#hits [data-resize="ns-resize"] { cursor: ns-resize; }
#hits [data-resize="ew-resize"] { cursor: ew-resize; }
#hits [data-resize="nwse-resize"] { cursor: nwse-resize; }
#hits [data-resize="nesw-resize"] { cursor: nesw-resize; }
#hits [data-shape-edge]::after,
#hits [data-edge]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
  background: rgba(244, 238, 228, 0.55);
  opacity: 0;
  pointer-events: none;
}
#hits [data-box-corner]::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(244, 238, 228, 0.5) 0 5px, transparent 13px);
  opacity: 0;
  pointer-events: none;
}
@media (hover: hover) and (pointer: fine) {
  #hits [data-shape-vertex]:hover:not(.picked),
  #hits [data-point]:hover:not(.picked),
  #hits [data-shape-vertex]:focus-visible:not(.picked),
  #hits [data-point]:focus-visible:not(.picked) {
    background: rgba(244, 238, 228, 0.28);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.32);
  }
  #hits [data-shape-edge]:hover:not(.picked)::after,
  #hits [data-edge]:hover:not(.picked)::after,
  #hits [data-shape-edge]:focus-visible:not(.picked)::after,
  #hits [data-edge]:focus-visible:not(.picked)::after {
    opacity: 1;
  }
  #hits [data-section]:hover:not(.picked),
  #hits [data-object]:hover:not(.picked),
  #hits [data-face]:hover:not(.picked),
  #hits [data-section]:focus-visible:not(.picked),
  #hits [data-object]:focus-visible:not(.picked),
  #hits [data-face]:focus-visible:not(.picked),
  #hits [id^="stroke-"]:hover:not(.picked),
  #hits [id^="stroke-"]:focus-visible:not(.picked) {
    background: rgba(243, 211, 154, 0.1);
  }
  #hits [data-box-corner]:hover::after,
  #hits [data-box-corner]:focus-visible::after {
    opacity: 1;
  }
}
#hits [data-shape-vertex].picked,
#hits [data-point].picked {
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 2px #fff, 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#hits [data-shape-edge].picked::after,
#hits [data-edge].picked::after {
  opacity: 1;
  height: 5px;
  margin-top: -2.5px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 0 0 1px rgba(243, 211, 154, 0.45);
}
#hits [data-section].picked,
#hits [data-object].picked,
#hits [data-face].picked {
  background: rgba(243, 211, 154, 0.08);
}
#tags {
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
}
.chip {
  position: absolute;
  transform: translate(-50%, -50%);
  pointer-events: none;
  padding: 5px 10px;
  border-radius: 12px;
  background: linear-gradient(rgba(255, 255, 255, 0.14), rgba(255, 255, 255, 0.14)), rgba(16, 18, 20, 0.48);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font: 650 13px/1.2 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  white-space: nowrap;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
}
.icon-btn svg {
  width: 22px;
  height: 22px;
  display: block;
}
.icon-btn path,
.icon-btn circle,
.icon-btn rect,
.icon-btn ellipse,
.icon-btn line {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#wallTools.pass,
#wallTools.pass button,
.island.pass,
#flow.pass {
  pointer-events: none;
}
header {
  position: fixed;
  top: 14px;
  left: 16px;
  right: 16px;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
}
#flow {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  max-width: min(420px, calc(100vw - 280px));
  padding: 3px 6px;
  border-radius: 18px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
.flow-step {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
  font: 650 13px/1.2 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  letter-spacing: 0.02em;
  background: transparent;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
.flow-step.now {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
.flow-step.done:not(.now) {
  color: var(--ink);
}
.flow-step.wait {
  opacity: 0.45;
}
.flow-card {
  position: absolute;
  left: 50%;
  top: calc(100% + 10px);
  transform: translateX(-50%) translateY(4px);
  width: 196px;
  padding: 8px;
  border-radius: 14px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge), 0 12px 32px rgba(0, 0, 0, 0.35);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  z-index: 8;
  transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s;
}
.flow-card img {
  display: block;
  width: 100%;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  background: #07080c;
}
.flow-card em {
  display: block;
  margin: 6px 2px 0;
  font: 500 11px/1.3 "Segoe UI Variable", "Segoe UI", system-ui, sans-serif;
  color: var(--mute);
  font-style: normal;
  text-shadow: none;
}
@media (hover: hover) and (pointer: fine) {
  .flow-step:hover .flow-card,
  .flow-step:focus-visible .flow-card {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
  }
}
#status {
  margin-left: 8px;
  color: var(--ink);
  font-size: 13px;
  padding: 6px 12px;
  border-radius: 16px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}
#viewMode {
  margin-left: auto;
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 16px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#viewMode button {
  min-width: 44px;
  padding: 6px 12px;
  border-radius: 13px;
  background: transparent;
}
#viewMode button.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#status:empty {
  display: none;
}
header .ghost {
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#wallTools {
  position: fixed;
  left: 50%;
  bottom: 84px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  border-radius: 16px;
}
#wallTools:has(.seg) {
  gap: 8px;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: none;
  border-radius: 0;
}
#wallTools .seg {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  flex-shrink: 0;
  padding: 4px;
  overflow: visible;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  border-radius: 16px;
}
#wallTools[hidden] { display: none; }
#wallTools button {
  background: rgba(255,255,255,0.08);
  color: var(--ink);
  border: 0;
  border-radius: 16px;
  padding: 8px 12px;
  font: inherit;
  cursor: pointer;
}
#wallTools .seg button {
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 13px;
  background: transparent;
}
#wallTools button.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#wallTools button:disabled { opacity: 0.35; cursor: default; }
.go:disabled { opacity: 0.35; cursor: default; }
#choices {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
  max-width: 90vw;
}
#choices button {
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  border: 0;
  border-radius: 18px;
  padding: 10px 12px 8px;
  font: inherit;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  min-width: 88px;
}
#choices button svg {
  width: 56px;
  height: 56px;
  display: block;
}
#choices button path {
  fill: none;
  stroke: #f3d39a;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#choices button:hover, #choices button.on {
  background: linear-gradient(rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0.18)), rgba(16, 18, 20, 0.42);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.55);
}
#choices button:hover path, #choices button.on path {
  stroke: var(--go);
  fill: rgba(243, 211, 154, 0.12);
}
a.ghost {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  margin-left: 8px;
}
header .ghost + .ghost { margin-left: 0; }
.card .row { display: flex; gap: 6px; margin-top: 8px; }
.card .row button {
  flex: 1;
  font: inherit;
  color: inherit;
  background: rgba(255,255,255,0.08);
  border: 0;
  border-radius: 16px;
  padding: 8px 10px;
  cursor: pointer;
}
#wallTools button.hole.on {
  background: #12110f;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--go);
}
.hole-slot {
  position: relative;
  display: inline-flex;
  align-items: center;
  pointer-events: none;
}
.hole-slot > button {
  pointer-events: auto;
}
#wallTools #antiObject {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  transform: translateX(-50%);
  z-index: 7;
  min-width: 44px;
  min-height: 44px;
  padding: 8px;
  border-radius: 14px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.hole-slot:hover #antiObject,
.hole-slot.pin #antiObject {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
#wallTools #antiObject.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#ctxMenu {
  position: fixed;
  z-index: 28;
  min-width: 196px;
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: 6px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#confirmDlg {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 8, 10, 0.38);
}
#confirmDlg[hidden] { display: none !important; }
#confirmDlg .confirm-card {
  min-width: 260px;
  max-width: 360px;
  padding: 18px 18px 14px;
  border-radius: 16px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#confirmDlg .confirm-copy {
  margin: 0 0 14px;
  color: var(--ink);
}
#confirmDlg .confirm-row {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}
#confirmDlg .danger {
  background: rgba(226, 59, 59, 0.22);
}
#ctxMenu[hidden] { display: none !important; }
#rotateDial {
  position: fixed;
  z-index: 28;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  display: grid;
  place-items: center;
  color: var(--ink);
  cursor: grab;
  touch-action: none;
}
#rotateDial[hidden] { display: none !important; }
#rotateDial.spin,
#rotateDial:active {
  cursor: grabbing;
}
#rotateDial svg {
  width: 36px;
  height: 36px;
  display: block;
  pointer-events: none;
}
#rotateDial .dial-ring {
  fill: none;
  stroke: rgba(244, 238, 228, 0.55);
  stroke-width: 1.5;
}
#rotateDial .dial-hub {
  fill: var(--go);
}
#rotateDial .dial-tick {
  fill: var(--ink);
  transform-origin: 22px 22px;
  transform: rotate(var(--ang, 0rad));
}
#ctxMenu button {
  display: block;
  width: 100%;
  text-align: left;
  border-radius: 10px;
}
#ctxMenu button:disabled {
  opacity: 0.45;
  cursor: default;
}
#ctxMenu button:disabled:hover {
  background: none;
}
#ctxMenu .tone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 8px 14px;
  border-radius: 10px;
  font: inherit;
  color: inherit;
  cursor: pointer;
}
#ctxMenu button:hover,
#ctxMenu .tone:hover {
  background: rgba(255, 255, 255, 0.12);
}
#ctxMenu .fold {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#ctxMenu .fold-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
#ctxMenu .fold-btn::after {
  content: "▸";
  color: var(--mute);
  font-size: 12px;
}
#ctxMenu .fold.open .fold-btn::after {
  content: "▾";
}
#ctxMenu .fold-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 2px 0 2px 8px;
}
#ctxMenu .fold-list[hidden] { display: none !important; }
#ctxMenu .tone input[type="color"] {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 7px;
  background: none;
  cursor: pointer;
}
#ctxMenu .tone input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
}
#ctxMenu .tone input[type="color"]::-webkit-color-swatch,
#ctxMenu .tone input[type="color"]::-moz-color-swatch {
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 7px;
}
button, .ghost {
  font: inherit;
  color: var(--ink);
  background: rgba(255,255,255,0.08);
  border: 0;
  border-radius: 16px;
  padding: 8px 14px;
  cursor: pointer;
}
.island {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  z-index: 6;
  display: flex;
  gap: 6px;
  padding: 6px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  border-radius: 16px;
}
[hidden] { display: none !important; }
#pairCode {
  font-size: 28px;
  letter-spacing: 0.14em;
  font-weight: 650;
  margin: 10px 0 6px;
}
.go { background: var(--go); color: #1a1408; font-weight: 650; }
.island .go {
  background: rgba(255, 255, 255, 0.1);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#library {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 10, 0.38);
}
#library[hidden] { display: none !important; }
#library .library-card {
  width: min(420px, calc(100vw - 32px));
  max-height: min(80vh, 640px);
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#library .lib-save {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}
#library .lib-save input {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  padding: 10px 12px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: var(--ink);
  font: inherit;
}
#library .lib-save .go {
  min-height: 44px;
}
#library #libErr:not([hidden]) {
  margin: 8px 0 0;
  color: #e8b4a0;
}
#settings {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(8, 8, 10, 0.38);
}
#settings[hidden] { display: none !important; }
#settings .settings-card {
  width: min(360px, calc(100vw - 32px));
  max-height: min(72vh, 520px);
  overflow: auto;
  padding: 18px;
  border-radius: 20px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#settings .set-tabs {
  display: flex;
  gap: 2px;
  margin-top: 14px;
  padding: 3px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#settings .set-tabs button {
  flex: 1;
  min-width: 0;
  padding: 7px 8px;
  border-radius: 13px;
  background: transparent;
  font-size: 13px;
}
#settings .set-tabs button.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#settings .set-pane {
  margin-top: 14px;
}
#settings .set-pane .fine {
  margin: 0 0 6px;
}
#setUser {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 650;
}
#setView {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
}
#setView button {
  min-width: 44px;
  padding: 6px 12px;
  border-radius: 13px;
  background: transparent;
}
#setView button.on {
  background: rgba(255, 255, 255, 0.14);
  color: var(--go);
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
}
#showPair {
  margin-top: 4px;
}
#pairBox {
  margin-top: 8px;
}
.sheet {
  position: fixed;
  inset: 16px;
  z-index: 10;
  background: rgba(16,14,12,0.94);
  border-radius: 28px;
  padding: 24px;
  overflow: auto;
}
.sheet-bar { display: flex; align-items: center; }
.sheet-bar h2 { margin: 0; }
.sheet-bar button { margin-left: auto; }
.fine { color: var(--mute); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.card {
  border: 0;
  border-radius: 16px;
  padding: 14px;
  background: var(--bar);
  backdrop-filter: var(--frost);
  -webkit-backdrop-filter: var(--frost);
  box-shadow: inset 0 0 0 1px var(--glass-edge);
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.card b {
  display: block;
}
.card span {
  display: block;
  color: var(--mute);
  font-size: 13px;
  margin-top: 2px;
}
.card.on {
  box-shadow: inset 0 0 0 1px rgba(243, 211, 154, 0.7);
  background: rgba(255, 255, 255, 0.1);
}
.card svg {
  width: 56px;
  height: 56px;
  display: block;
  margin-bottom: 8px;
}
.card path {
  fill: none;
  stroke: #f3d39a;
  stroke-width: 2;
  stroke-linejoin: round;
}
@media (pointer: coarse) {
  header {
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    right: 10px;
    flex-wrap: wrap;
  }
  #flow {
    position: static;
    transform: none;
    order: 8;
    width: 100%;
    max-width: none;
    justify-content: center;
  }
  #status {
    font-size: 12px;
    max-width: 46vw;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  button { min-height: 44px; }
  #ctxMenu {
    min-width: min(240px, calc(100vw - 16px));
  }
  #ctxMenu button,
  #ctxMenu .tone {
    min-height: 44px;
    padding-top: 12px;
    padding-bottom: 12px;
  }
  .island {
    bottom: calc(12px + env(safe-area-inset-bottom));
    flex-wrap: wrap;
    justify-content: center;
    max-width: calc(100vw - 16px);
  }
  #wallTools {
    bottom: calc(76px + env(safe-area-inset-bottom));
    max-width: calc(100vw - 16px);
    flex-wrap: wrap;
    justify-content: center;
  }
  .sheet {
    inset: calc(8px + env(safe-area-inset-top)) 8px calc(8px + env(safe-area-inset-bottom));
  }
}
@media (max-width: 760px) {
  header { flex-wrap: wrap; }
  #flow {
    position: static;
    transform: none;
    order: 8;
    width: 100%;
    max-width: none;
    justify-content: center;
  }
}
