:root {
  --panel-bg: rgba(15, 18, 26, 0.82);
  --panel-border: rgba(255, 255, 255, 0.09);
  --text: #e8eaf0;
  --muted: #8d93a5;
  --accent: #45d4a8;
  --accent-soft: rgba(69, 212, 168, 0.16);
  --track: #2a2f3e;
  --input-bg: rgba(255, 255, 255, 0.06);
  --input-border: rgba(255, 255, 255, 0.12);
  --dock-h: 62px;
  --shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

* {
  box-sizing: border-box;
}

/* keep the hidden attribute authoritative over display rules below */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none; /* no rubber-band bounce in the iOS web view */
  background: #0b0e14;
  font-family: ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  color: var(--text);
  /* native-app feel: no long-press callout, no text selection, no tap flash */
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* the seed field still needs real text selection/editing */
input[type='text'] {
  -webkit-user-select: text;
  user-select: text;
}

#art {
  position: fixed;
  inset: 0;
  display: block;
  touch-action: none; /* let interactive generators handle drags without scrolling */
}

/* startup-failure notice (see the inline guard script in index.html) */
#boot-error {
  position: fixed;
  top: calc(12px + env(safe-area-inset-top));
  left: 12px;
  right: 12px;
  z-index: 99;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(120, 24, 32, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
  font: 12px/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  word-break: break-word;
}

/* post-process layer (grain + vignette), blended over the art */
#fx {
  position: fixed;
  inset: 0;
  display: block;
  pointer-events: none;
  mix-blend-mode: overlay;
}

/* live touch ripples + kaleidoscope mirror guides (never baked into PNG exports) */
#touch-fx {
  position: fixed;
  inset: 0;
  display: block;
  pointer-events: none;
  z-index: 6;
}

/* shared inline-icon rules */
button svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

button svg .pip,
button svg .dot {
  fill: currentColor;
  stroke: none;
}

button {
  font-family: inherit;
}

button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* frosted-glass surface shared by the floating chrome */
.glass {
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
}

/* ---------- top bar ---------- */

#topbar {
  position: fixed;
  top: calc(8px + env(safe-area-inset-top));
  left: calc(12px + env(safe-area-inset-left));
  right: calc(12px + env(safe-area-inset-right));
  z-index: 16;
  display: flex;
  justify-content: space-between;
  align-items: center;
  pointer-events: none; /* the bar itself never blocks canvas touches */
  transition: opacity 0.25s, transform 0.25s;
}

.brand {
  pointer-events: auto;
  padding: 9px 15px;
  border-radius: 999px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.brand span {
  color: var(--accent);
}

.top-actions {
  pointer-events: auto;
  display: flex;
  gap: 8px;
}

.top-actions button {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s, transform 0.06s;
}

.top-actions button:active {
  transform: scale(0.92);
}

.top-actions svg {
  width: 18px;
  height: 18px;
}

/* brief "saved ♥" confirmation on the heart button */
#btn-fav.pop {
  color: var(--accent);
}

#btn-fav.pop svg path {
  fill: currentColor;
}

#btn-fav.pop svg {
  animation: fav-pop 0.45s ease;
}

@keyframes fav-pop {
  0% { transform: scale(1); }
  35% { transform: scale(1.35); }
  100% { transform: scale(1); }
}

/* return button while chrome is hidden */
#show-ui {
  position: fixed;
  bottom: calc(14px + env(safe-area-inset-bottom));
  right: calc(14px + env(safe-area-inset-right));
  z-index: 16;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--panel-border);
  background: var(--panel-bg);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

/* ---------- dock ---------- */

#dock {
  position: fixed;
  left: calc(10px + env(safe-area-inset-left));
  right: calc(10px + env(safe-area-inset-right));
  bottom: calc(10px + env(safe-area-inset-bottom));
  height: var(--dock-h);
  max-width: 430px;
  margin: 0 auto;
  z-index: 16;
  display: flex;
  align-items: stretch;
  padding: 0 4px;
  border-radius: 22px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
  transition: opacity 0.25s, transform 0.25s;
}

.dock-tab {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.04em;
  cursor: pointer;
  border-radius: 16px;
  transition: color 0.15s;
}

.dock-tab svg {
  width: 21px;
  height: 21px;
}

.dock-tab:active {
  color: var(--text);
}

.dock-tab.active {
  color: var(--accent);
}

/* the raised "surprise me" button in the middle of the dock */
#btn-shuffle {
  flex: none;
  width: 58px;
  height: 58px;
  align-self: center;
  transform: translateY(-16px);
  margin: 0 4px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(160deg, #58e6ba, #2fae87);
  color: #0a2019;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 8px 24px rgba(69, 212, 168, 0.4), 0 2px 6px rgba(0, 0, 0, 0.35);
  transition: transform 0.08s, box-shadow 0.15s;
}

#btn-shuffle svg {
  width: 26px;
  height: 26px;
  stroke-width: 1.9;
}

#btn-shuffle:active {
  transform: translateY(-16px) scale(0.93);
}

/* ---------- bottom sheet ---------- */

#sheet {
  position: fixed;
  left: calc(10px + env(safe-area-inset-left));
  right: calc(10px + env(safe-area-inset-right));
  bottom: calc(20px + env(safe-area-inset-bottom) + var(--dock-h));
  max-width: 560px;
  margin: 0 auto;
  z-index: 15;
  border-radius: 20px;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px) saturate(1.2);
  -webkit-backdrop-filter: blur(22px) saturate(1.2);
  box-shadow: var(--shadow);
  visibility: hidden;
  transform: translateY(calc(100% + var(--dock-h) + 40px));
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0.28, 1), visibility 0s 0.34s;
}

#sheet.open {
  visibility: visible;
  transform: none;
  transition: transform 0.34s cubic-bezier(0.32, 0.72, 0.28, 1);
}

#sheet.dragging {
  transition: none;
}

#sheet-grab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 26px;
  background: none;
  border: none;
  cursor: grab;
  touch-action: none;
}

#sheet-grab span {
  width: 42px;
  height: 4.5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.22);
}

#sheet-scroller {
  overflow-y: auto;
  overscroll-behavior: contain;
  max-height: min(44vh, 430px);
  padding: 0 14px 16px;
}

#sheet-scroller::-webkit-scrollbar {
  width: 8px;
}

#sheet-scroller::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.14);
  border-radius: 4px;
}

.pane {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pane-title {
  margin: 4px 0 -4px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

/* ---------- chips (category filter + segmented options) ---------- */

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  padding: 7px 13px;
  border-radius: 999px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.chip:active {
  transform: scale(0.96);
}

.chip.active {
  background: var(--accent-soft);
  border-color: rgba(69, 212, 168, 0.5);
  color: var(--accent);
  font-weight: 600;
}

/* sticky category chips while scrolling the pattern grid — a single
   horizontally-scrollable row so it stays one line on narrow phones */
#pattern-chips {
  position: sticky;
  top: 0;
  z-index: 2;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 2px 0 10px;
  margin-bottom: -6px;
  background: linear-gradient(rgba(17, 20, 28, 0.98) 80%, rgba(17, 20, 28, 0));
}

#pattern-chips::-webkit-scrollbar {
  display: none;
}

#pattern-chips .chip {
  flex: none;
}

/* ---------- pattern grid ---------- */

#pattern-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.grid-label {
  grid-column: 1 / -1;
  margin: 6px 0 -2px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
}

.grid-label:first-child {
  margin-top: 0;
}

.thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  gap: 8px;
}

.thumb {
  position: relative;
  border: 1px solid var(--input-border);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  background: #10131c;
  padding: 0;
  text-align: left;
  transition: border-color 0.15s, transform 0.08s;
}

.thumb:hover {
  border-color: var(--accent);
}

.thumb:active {
  transform: scale(0.96);
}

.thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.thumb canvas,
.thumb img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.thumb-name {
  padding: 6px 8px 7px;
  font-size: 10.5px;
  line-height: 1.25;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.thumb-name small {
  display: block;
  color: var(--muted);
  font-size: 9px;
}

/* "you can touch this one" badge on interactive patterns */
.touch-badge {
  position: absolute;
  top: 5px;
  left: 5px;
  padding: 2.5px 7px;
  border-radius: 999px;
  background: rgba(8, 10, 14, 0.72);
  color: var(--accent);
  font-size: 8.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  pointer-events: none;
}

.thumb-del {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: none;
  background: rgba(8, 10, 14, 0.72);
  color: var(--text);
  font-size: 11px;
  cursor: pointer;
}

.thumb-del:hover {
  background: rgba(200, 60, 60, 0.85);
}

.empty-note {
  margin: 4px 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- palette cards ---------- */

#palette-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
}

.pal-card {
  border: 1px solid var(--input-border);
  border-radius: 12px;
  overflow: hidden;
  background: var(--input-bg);
  cursor: pointer;
  padding: 0;
  transition: border-color 0.15s, transform 0.08s;
}

.pal-card:hover {
  border-color: var(--accent);
}

.pal-card:active {
  transform: scale(0.96);
}

.pal-card.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1.5px var(--accent);
}

.pal-stripes {
  display: flex;
  height: 34px;
}

.pal-stripes span {
  flex: 1;
}

.pal-name {
  display: block;
  padding: 6px 8px 7px;
  font-size: 10.5px;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

/* ---------- tune pane ---------- */

.tune-head {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

#tune-name {
  margin: 2px 0 0;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.01em;
}

.desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--muted);
}

.hint {
  margin: 0;
  font-size: 11.5px;
  line-height: 1.4;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 9px;
  padding: 8px 10px;
}

.transport {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 8px;
}

.transport button {
  height: 40px;
  border-radius: 11px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.15s, transform 0.05s;
}

.transport button:hover {
  background: rgba(255, 255, 255, 0.12);
}

.transport button:active {
  transform: scale(0.97);
}

/* ---------- controls (sliders / selects / checks) ---------- */

.control {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.control + .control {
  margin-top: 10px;
}

.control-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.control-label {
  font-size: 11.5px;
  color: var(--muted);
  letter-spacing: 0.03em;
}

.control-value {
  font-size: 11px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  color: var(--accent);
}

select,
input[type='text'] {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  font-size: 13px;
  outline: none;
}

select:focus,
input[type='text']:focus {
  border-color: var(--accent);
}

select option {
  background: #161a24;
}

.seed-wrap {
  display: flex;
  gap: 6px;
}

.seed-wrap input {
  flex: 1;
  min-width: 0;
}

.seed-wrap button {
  width: 42px;
  border-radius: 10px;
  border: 1px solid var(--input-border);
  background: var(--input-bg);
  color: var(--text);
  cursor: pointer;
  display: grid;
  place-items: center;
}

.seed-wrap button svg {
  width: 18px;
  height: 18px;
}

.seed-wrap button:hover {
  background: rgba(255, 255, 255, 0.12);
}

/* ---------- range sliders ---------- */

input[type='range'] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 26px;
  background: transparent;
  cursor: pointer;
  margin: 0;
}

input[type='range']::-webkit-slider-runnable-track {
  height: 5px;
  border-radius: 3px;
  background: var(--track);
}

input[type='range']::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #0b0e14;
  margin-top: -7px;
  transition: transform 0.1s;
}

input[type='range']::-webkit-slider-thumb:hover {
  transform: scale(1.12);
}

input[type='range']::-moz-range-track {
  height: 5px;
  border-radius: 3px;
  background: var(--track);
}

input[type='range']::-moz-range-thumb {
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: var(--accent);
  border: 2.5px solid #0b0e14;
}

/* ---------- checkboxes ---------- */

.control-check {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  cursor: pointer;
}

.control-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 19px;
  border-radius: 10px;
  background: var(--track);
  position: relative;
  cursor: pointer;
  transition: background 0.15s;
  margin: 0;
  flex: none;
}

.control-check input::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 15px;
  height: 15px;
  border-radius: 50%;
  background: #aab0c0;
  transition: transform 0.15s, background 0.15s;
}

.control-check input:checked {
  background: var(--accent-soft);
}

.control-check input:checked::after {
  transform: translateX(15px);
  background: var(--accent);
}

.check-label {
  font-size: 12px;
  color: var(--text);
}

/* ---------- immersive (hidden chrome) mode ---------- */

body.immersive #topbar,
body.immersive #dock {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-6px);
}

body.immersive #dock {
  transform: translateY(8px);
}

/* ---------- about overlay ---------- */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: calc(20px + env(safe-area-inset-top)) 20px calc(20px + env(safe-area-inset-bottom));
  background: rgba(6, 8, 12, 0.6);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.overlay-card {
  position: relative;
  max-width: 380px;
  width: 100%;
  max-height: 100%;
  overflow-y: auto;
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  border-radius: 20px;
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.5);
  padding: 22px 22px 18px;
}

.overlay-card h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.overlay-card h2 span {
  color: var(--accent);
}

.overlay-card h3 {
  margin: 18px 0 6px;
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.overlay-card p {
  margin: 8px 0 0;
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text);
}

.overlay-card .about-tag {
  margin-top: 2px;
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
}

.overlay-card a {
  color: var(--accent);
}

.overlay-card .about-foot {
  margin-top: 16px;
  font-size: 10px;
  color: var(--muted);
}

/* quiet text-style button (restore purchase, about links) */
.link-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 6px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 11.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}

.link-btn:hover {
  color: var(--text);
}

/* ---------- Vesica Studio promo card ---------- */

.promo-card {
  max-width: 340px;
  text-align: center;
}

.promo-list {
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
  text-align: left;
}

.promo-list li {
  position: relative;
  padding: 6px 0 6px 26px;
  font-size: 12.5px;
  line-height: 1.5;
}

.promo-list li::before {
  content: '✦';
  position: absolute;
  left: 4px;
  color: var(--accent);
}

.promo-buy {
  display: block;
  width: 100%;
  margin-top: 18px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: linear-gradient(160deg, #58e6ba, #2fae87);
  color: #0a2019;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(69, 212, 168, 0.35);
  transition: transform 0.08s;
}

.promo-buy:active {
  transform: scale(0.97);
}

.overlay-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
}

.overlay-close:hover {
  color: var(--text);
  background: var(--input-bg);
}

kbd {
  display: inline-block;
  padding: 0 5px;
  border: 1px solid var(--input-border);
  border-bottom-width: 2px;
  border-radius: 4px;
  background: var(--input-bg);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 9.5px;
}

/* keyboard hints are meaningless on touch devices */
@media (pointer: coarse) {
  .kbd-hints {
    display: none;
  }
}

/* ---------- toast ---------- */

#toast {
  position: fixed;
  top: calc(60px + env(safe-area-inset-top));
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  max-width: min(86vw, 420px);
  background: var(--panel-bg);
  border: 1px solid var(--panel-border);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  box-shadow: var(--shadow);
  color: var(--text);
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 999px;
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
  pointer-events: none;
  z-index: 40;
}

#toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ---------- wider screens ---------- */

@media (min-width: 760px) {
  #sheet-scroller {
    max-height: min(52vh, 520px);
  }

  #pattern-grid,
  .thumb-grid {
    grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  }
}

/* ---------- save pane + Vesica Studio rows ---------- */

.export-actions {
  margin-top: 12px;
  grid-auto-columns: auto;
  grid-template-columns: 1.6fr 1fr;
}

.transport button.primary {
  border: none;
  background: linear-gradient(160deg, #58e6ba, #2fae87);
  color: #0a2019;
  font-weight: 700;
}

.transport button:disabled {
  opacity: 0.7;
  cursor: default;
}

#export-note {
  margin-top: 10px;
  font-variant-numeric: tabular-nums;
}

/* a quiet, always-there pointer to the sibling app: violet, so it reads as
   Vesica rather than as one more GeoMaker control */
.vesica-row {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 12px 14px;
  text-align: left;
  border-radius: 14px;
  border: 1px solid rgba(179, 132, 255, 0.28);
  background: rgba(179, 132, 255, 0.08);
  color: var(--text);
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, transform 0.12s ease-out;
}

.vesica-row:active {
  transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
  .vesica-row:hover {
    background: rgba(179, 132, 255, 0.13);
    border-color: rgba(179, 132, 255, 0.45);
  }
}

.vesica-row-title {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  font-weight: 650;
  color: #cdb4ff;
}

.vesica-row-sub {
  display: block;
  margin-top: 4px;
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- floating touch HUD pill ---------- */

#touch-bar {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-h) + 28px + env(safe-area-inset-bottom));
  transform: translateX(-50%) translateY(0);
  z-index: 15;
  max-width: min(92vw, 430px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px 6px 12px;
  border-radius: 999px;
  background: rgba(15, 18, 26, 0.78);
  border: 1px solid rgba(69, 212, 168, 0.24);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.36);
  transition: opacity 0.22s cubic-bezier(0.23, 1, 0.32, 1), transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
}

body.touching #touch-bar,
body.sheet-open #touch-bar,
body.immersive #touch-bar {
  opacity: 0;
  transform: translateX(-50%) translateY(8px);
  pointer-events: none;
}

.touch-bar-hint {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  line-height: 1.25;
  color: rgba(232, 234, 240, 0.88);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.touch-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(69, 212, 168, 0.75);
}

.touch-bar-actions {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.touch-bar-actions button {
  height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.08s ease-out;
}

.touch-bar-actions button:active {
  transform: scale(0.94);
}

#btn-touch-sym.active {
  background: var(--accent-soft);
  border-color: rgba(69, 212, 168, 0.55);
  color: var(--accent);
}

#btn-touch-reset {
  width: 26px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 13px;
}
