/* Νήμα — εμφάνιση. Χαρτί, μελάνι και μία κόκκινη κλωστή. */

:root {
  --font: "Commissioner", "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --paper: #f4f0e8;
  --paper-2: #ede7dc;
  --card: #fbf9f5;
  --ink: #1b1916;
  --ink-2: #5f584f;
  --ink-3: #8d8579;
  --line: #ddd5c7;
  --line-2: #cdc4b4;
  --thread: #b8281d;
  --thread-2: #9b1f15;
  --on-thread: #fffaf5;
  --stage: #e6dfd2;
  --veil: rgba(244, 240, 232, 0.8);
  --pin: #8d8579;
  --pin-faint: rgba(120, 110, 98, 0.55);
  --shadow: 0 1px 2px rgba(27, 25, 22, .06), 0 10px 30px rgba(27, 25, 22, .1);
  --radius: 14px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #161513;
    --paper-2: #1c1a17;
    --card: #22201c;
    --ink: #f2ede4;
    --ink-2: #b4ab9e;
    --ink-3: #847c71;
    --line: #322e29;
    --line-2: #423c35;
    --thread: #e4573f;
    --thread-2: #f2715b;
    --on-thread: #1a0d0a;
    --stage: #0e0d0c;
    --veil: rgba(14, 13, 12, 0.74);
    --pin: #8a8277;
    --pin-faint: rgba(150, 140, 128, 0.5);
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 12px 32px rgba(0, 0, 0, .45);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}
button, input, select { font: inherit; color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--thread); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- Διάταξη ---------- */

.app {
  display: grid;
  grid-template-columns: minmax(360px, 420px) 1fr;
  grid-template-rows: auto 1fr;
  grid-template-areas: "top top" "panel stage";
  height: 100vh;
  height: 100dvh;
}

.top {
  grid-area: top;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 20px;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 30;
  background: var(--paper);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; min-width: 0; }
.brand .mark { width: 30px; height: 30px; flex: none; }
.brand .word { font-size: 21px; font-weight: 700; letter-spacing: -0.02em; }
.brand .tag { color: var(--ink-3); font-size: 13.5px; padding-left: 10px; border-left: 1px solid var(--line-2); white-space: nowrap; }
.top-actions { display: flex; gap: 8px; }

.menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 16px;
  width: min(320px, calc(100vw - 32px));
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 6px;
}
.menu button {
  display: block; width: 100%; text-align: left; border: 0; background: none;
  padding: 11px 12px; border-radius: 9px; cursor: pointer; font-size: 15px;
}
.menu button:hover, .menu button:focus-visible { background: var(--paper-2); }
.menu-note { margin: 4px 12px 8px; color: var(--ink-3); font-size: 12.5px; line-height: 1.45; }

.panel {
  grid-area: panel;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  padding: 0 28px 40px;
  scrollbar-gutter: stable;
}

.stage-wrap {
  grid-area: stage;
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 50% 40%, transparent 55%, rgba(0, 0, 0, .05)),
    var(--stage);
}
#stage { display: block; }
.app[data-step="1"].has-photo #stage { cursor: grab; touch-action: none; }
.app[data-step="1"].has-photo #stage:active { cursor: grabbing; }

/* ---------- Βήματα ---------- */

.steps {
  position: sticky;
  top: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 0 -28px 8px;
  padding: 18px 28px 14px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.steps button {
  position: relative;
  border: 0;
  background: none;
  padding: 0;
  display: grid;
  justify-items: center;
  gap: 6px;
  cursor: pointer;
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 500;
}
/* η «κλωστή» που ενώνει τα βήματα */
.steps button::before {
  content: "";
  position: absolute;
  top: 13px;
  left: calc(-50% + 16px);
  right: calc(50% + 16px);
  height: 1.5px;
  background: var(--line-2);
}
.steps button:first-child::before { display: none; }
.steps button.done::before, .steps button[aria-current="step"]::before { background: var(--thread); }
.steps .num {
  width: 27px; height: 27px;
  display: grid; place-items: center;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  font-size: 13px; font-weight: 650;
  background: var(--paper);
  font-variant-numeric: tabular-nums;
}
.steps .ico { display: none; }
.steps button.done { color: var(--ink-2); }
.steps button.done .num { border-color: var(--ink); color: var(--ink); }
.steps button[aria-current="step"] { color: var(--ink); font-weight: 650; }
.steps button[aria-current="step"] .num { background: var(--thread); border-color: var(--thread); color: var(--on-thread); }
.steps button:disabled { cursor: not-allowed; opacity: .45; }

/* ---------- Κείμενα ---------- */

.kicker { margin: 18px 0 2px; color: var(--thread); font-size: 12.5px; font-weight: 650; letter-spacing: .02em; }
h2 { margin: 0 0 6px; font-size: 30px; line-height: 1.15; font-weight: 680; letter-spacing: -0.025em; }
h3 { margin: 0 0 6px; font-size: 15px; font-weight: 650; letter-spacing: -0.005em; }
.lead { margin: 0 0 16px; color: var(--ink-2); }
.hint { margin: 4px 0 10px; color: var(--ink-3); font-size: 13px; line-height: 1.45; }
.note { margin: 10px 0; font-size: 13.5px; color: var(--ink-2); }
.note.warn { color: var(--thread); }
.small { font-size: 12.5px; color: var(--ink-3); }

.group { padding: 18px 0 8px; border-top: 1px solid var(--line); margin-top: 18px; }
.row { display: flex; flex-wrap: wrap; gap: 10px; }
.row.center { justify-content: center; }
.actions { display: grid; gap: 10px; margin-top: 24px; }

/* ---------- Κουμπιά ---------- */

.btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  min-height: 44px;
  padding: 0 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 620;
  line-height: 1.1;
  cursor: pointer;
  text-align: center;
  transition: background-color .15s, border-color .15s, color .15s, transform .06s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--ink); color: var(--paper); }
.btn.primary:hover { background: color-mix(in srgb, var(--ink) 86%, var(--thread)); }
.btn.accent { background: var(--thread); color: var(--on-thread); }
.btn.accent:hover { background: var(--thread-2); }
.btn.ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn.ghost:hover { border-color: var(--ink-3); background: color-mix(in srgb, var(--paper-2) 60%, transparent); }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.icon-only { width: 36px; padding: 0; }
.btn.wide { width: 100%; }
.btn.big { min-height: 64px; font-size: 18px; }
.btn:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.link { border: 0; background: none; padding: 0; color: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.grid-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.grid-buttons .btn { padding: 0 10px; font-size: 14px; }
.grid-buttons .span2 { grid-column: 1 / -1; }

/* ---------- Πεδία ---------- */

.field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 2px 12px;
  margin: 12px 0;
}
.field > span { font-size: 13.5px; color: var(--ink-2); font-weight: 520; }
.field > output { font-size: 13.5px; font-variant-numeric: tabular-nums; font-weight: 600; }
.field > input[type="range"], .field > .seg { grid-column: 1 / -1; }
.field > .seg { margin-top: 6px; }
.field.inline { grid-template-columns: 1fr 110px; }
.field input[type="number"] {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: var(--card);
  padding: 0 10px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 30px;
  margin: 0;
  background: transparent;
  cursor: pointer;
  --fill: 50%;
}
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(var(--thread), var(--thread)) 0 / var(--fill) 100% no-repeat, var(--line-2);
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px; height: 20px;
  margin-top: -9px;
  border-radius: 50%;
  background: var(--card);
  border: 1.5px solid var(--ink);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .18);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line-2); border-radius: 2px; }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--thread); border-radius: 2px; }
input[type="range"]::-moz-range-thumb { width: 17px; height: 17px; border-radius: 50%; background: var(--card); border: 1.5px solid var(--ink); }
input[type="range"]:focus-visible { outline: none; }
input[type="range"]:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--thread); outline-offset: 2px; }

.seg {
  display: flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
}
.seg button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 36px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  padding: 0 8px;
  color: var(--ink-2);
  font-size: 13.5px;
  font-weight: 560;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.seg button:has(.sw) { display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.sw {
  width: 15px; height: 15px; flex: none;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--b, #fff) 0 41%, var(--t, #000) 41% 59%, var(--b, #fff) 59%);
  box-shadow: 0 0 0 1px rgba(128, 120, 110, .55);
}

.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14.5px; min-height: 36px; margin: 4px 0; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track {
  width: 38px; height: 22px; flex: none;
  border-radius: 999px;
  background: var(--line-2);
  position: relative;
  transition: background-color .15s;
}
.switch .track::after {
  content: "";
  position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--card);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
  transition: transform .15s;
}
.switch input:checked + .track { background: var(--thread); }
.switch input:checked + .track::after { transform: translateX(16px); }
.switch input:focus-visible + .track { outline: 2px solid var(--thread); outline-offset: 2px; }

.select select {
  min-height: 36px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--card);
  padding: 0 12px;
  font-size: 14px;
}

.colors { display: flex; gap: 16px; margin: 4px 0 8px; }
.colors label { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.colors input[type="color"] {
  width: 38px; height: 38px;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: 50%;
  background: none;
  cursor: pointer;
  overflow: hidden;
}
.colors input[type="color"]::-webkit-color-swatch-wrapper { padding: 3px; }
.colors input[type="color"]::-webkit-color-swatch { border: 0; border-radius: 50%; }
.colors input[type="color"]::-moz-color-swatch { border: 0; border-radius: 50%; }

details.adv, details.howto {
  margin: 16px 0 0;
  border-top: 1px solid var(--line);
  padding-top: 10px;
}
details > summary {
  cursor: pointer;
  list-style: none;
  font-weight: 650;
  font-size: 15px;
  padding: 6px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
details > summary::-webkit-details-marker { display: none; }
details > summary::after { content: "+"; margin-left: auto; color: var(--ink-3); font-weight: 400; font-size: 20px; line-height: 1; }
details[open] > summary::after { content: "–"; }
details.howto p { color: var(--ink-2); font-size: 14px; margin: 6px 0 12px; }

/* ---------- Πρόοδος και αποτελέσματα ---------- */

.progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; margin: 12px 0 6px; }
.progress .bar { height: 100%; width: 0; background: var(--thread); transition: width .2s; }
.run-text { margin: 0 0 12px; font-variant-numeric: tabular-nums; color: var(--ink-2); }

.stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin: 8px 0 4px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.stats div { background: var(--card); padding: 12px 14px; }
.stats dt { font-size: 12.5px; color: var(--ink-3); }
.stats dd { margin: 2px 0 0; font-size: 20px; font-weight: 650; letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
.stats dd small { display: block; font-size: 13px; font-weight: 500; color: var(--ink-2); letter-spacing: 0; }

/* ---------- Πλέξιμο ---------- */

.weave { margin-top: 20px; }
.weave-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 18px 14px;
  margin: 8px 0 10px;
  font-variant-numeric: tabular-nums;
}
.weave-card p { margin: 0; }
.w-step { color: var(--ink-3); font-size: 13px; }
.w-from { color: var(--ink-2); font-size: 16px; margin-top: 2px !important; }
.w-to { display: flex; align-items: baseline; gap: 12px; font-size: clamp(64px, 9vw, 104px); font-weight: 720; line-height: 1.02; letter-spacing: -0.03em; color: var(--thread); }
.w-to .arrow { font-size: .42em; font-weight: 400; color: var(--ink-3); transform: translateY(-.25em); }
.w-after { color: var(--ink-3); font-size: 14px; }
.weave-card.finished .w-to { font-size: 44px; }
.weave-controls { display: grid; grid-template-columns: 1fr 3fr; gap: 10px; }
.weave-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; margin: 10px 0; }
.weave-tools .field { margin: 0; flex: 1 1 220px; }
.keys { margin-top: 12px; }

/* ---------- Σκηνή ---------- */

.chips {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 2px;
  padding: 3px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--card) 82%, transparent);
  border: 1px solid var(--line);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 2px 10px rgba(0, 0, 0, .06);
  z-index: 4;
}
.chips:empty { display: none; }
.chips button {
  border: 0; background: transparent; border-radius: 999px;
  min-height: 32px; padding: 0 14px;
  font-size: 13px; font-weight: 560; color: var(--ink-2);
  cursor: pointer; white-space: nowrap;
}
.chips button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }

.stage-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  cursor: pointer;
}
.empty-ring {
  position: absolute;
  width: min(78%, 78vh);
  aspect-ratio: 1;
  border-radius: 50%;
  border: 1.5px dashed var(--line-2);
  background:
    repeating-conic-gradient(from 0deg, var(--pin) 0 0.35deg, transparent 0.35deg 3.6deg) border-box;
  -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  mask: radial-gradient(farthest-side, transparent calc(100% - 7px), #000 calc(100% - 6px));
  opacity: .8;
}
.empty-text { position: relative; max-width: 440px; }
.empty-kicker { margin: 0 0 10px; color: var(--thread); font-size: 13.5px; font-weight: 600; font-style: italic; }
.empty-text h1 { margin: 0 0 12px; font-size: clamp(24px, 3.2vw, 36px); line-height: 1.12; font-weight: 680; letter-spacing: -0.025em; }
.empty-text p { margin: 0 0 20px; color: var(--ink-2); }

.stage-hint {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  background: color-mix(in srgb, var(--card) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 13px;
  color: var(--ink-2);
  white-space: nowrap;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.drop-hint {
  position: fixed;
  inset: 12px;
  display: grid;
  place-items: center;
  border: 2px dashed var(--thread);
  border-radius: 20px;
  background: color-mix(in srgb, var(--paper) 80%, transparent);
  font-size: 22px;
  font-weight: 650;
  color: var(--thread);
  z-index: 100;
  pointer-events: none;
  opacity: 0;
  transition: opacity .15s;
}
body.dragging .drop-hint { opacity: 1; }

/* ---------- Διάλογος, ειδοποιήσεις ---------- */

dialog.help {
  width: min(680px, calc(100vw - 24px));
  max-height: calc(100dvh - 48px);
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  color: var(--ink);
  padding: 28px 32px 20px;
  box-shadow: var(--shadow);
}
dialog.help::backdrop { background: rgba(20, 18, 16, .45); backdrop-filter: blur(3px); }
dialog.help h2 { font-size: 26px; margin-bottom: 14px; }
dialog.help h3 { margin-top: 18px; }
dialog.help p, dialog.help li { color: var(--ink-2); font-size: 14.5px; }
dialog.help ul { padding-left: 20px; }
.help-close { position: absolute; top: 14px; right: 14px; margin: 0; }

.toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  transform: translateY(20px);
  max-width: min(380px, calc(100vw - 32px));
  background: var(--ink);
  color: var(--paper);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  z-index: 200;
}
.toast.show { opacity: 1; transform: none; }

.app.busy { cursor: progress; }
.app.busy .stage-wrap::after {
  content: "";
  position: absolute;
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 2px solid var(--line-2);
  border-top-color: var(--thread);
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Χωρίς φωτογραφία κρύβονται τα εργαλεία της */
.app:not(.has-photo) .needs-photo { display: none; }

/* ---------- Κινητό ---------- */

@media (max-width: 899px) {
  .app { display: block; height: auto; min-height: 100dvh; }
  .top { position: sticky; top: 0; padding: 8px 14px; padding-top: max(8px, env(safe-area-inset-top)); }
  .brand .tag { display: none; }
  .stage-wrap { aspect-ratio: 1; width: 100%; max-height: 72vh; }
  .app[data-step="4"] .stage-wrap { aspect-ratio: auto; height: 42vh; height: 42dvh; }
  .app[data-step="1"]:not(.has-photo) .stage-wrap { aspect-ratio: auto; height: 58vh; }
  .panel {
    border-right: 0;
    overflow: visible;
    padding: 0 18px calc(96px + env(safe-area-inset-bottom));
  }
  .steps {
    position: fixed;
    top: auto;
    bottom: 0;
    left: 0;
    right: 0;
    margin: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--line);
    border-bottom: 0;
    background: color-mix(in srgb, var(--paper) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 40;
  }
  .steps button { padding: 6px 0 4px; gap: 3px; font-size: 11.5px; border-radius: 12px; }
  .steps button::before { display: none; }
  .steps .num { display: none; }
  .steps .ico { display: block; width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
  .steps .ico .dots circle { fill: currentColor; stroke: none; }
  .steps button[aria-current="step"] { color: var(--thread); background: color-mix(in srgb, var(--thread) 9%, transparent); }
  .kicker { margin-top: 16px; }
  h2 { font-size: 26px; }
  .toast { left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translate(-50%, 20px); }
  .toast.show { transform: translate(-50%, 0); }
  .w-to { font-size: clamp(56px, 17vw, 88px); }
  .app[data-step="4"] .stage-wrap { height: 38vh; height: 38dvh; }
  .app[data-step="4"] .kicker { display: none; }
  .app[data-step="4"] h2 { margin-top: 14px; font-size: 22px; }
  /* στο κινητό τα κουμπιά του πλεξίματος μένουν πάντα ορατά πάνω από την κάτω μπάρα */
  .app[data-step="4"] .weave-controls {
    position: sticky;
    bottom: calc(68px + env(safe-area-inset-bottom));
    z-index: 10;
    padding: 14px 0 8px;
    background: linear-gradient(to top, var(--paper) 78%, transparent);
  }
  .keys { display: none; }
  /* το iPhone κάνει ζουμ σε πεδία με γράμματα κάτω από 16px */
  .field input[type="number"], .select select { font-size: 16px; }
  /* οριζόντια θέση σε iPhone με «εγκοπή» */
  .top { padding-left: max(14px, env(safe-area-inset-left)); padding-right: max(14px, env(safe-area-inset-right)); }
  .panel { padding-left: max(18px, env(safe-area-inset-left)); padding-right: max(18px, env(safe-area-inset-right)); }
  .steps { padding-left: max(6px, env(safe-area-inset-left)); padding-right: max(6px, env(safe-area-inset-right)); }
  dialog.help { padding: 22px 20px 16px; }
  .empty-ring { width: min(84%, 50vh); }
}

@media (max-width: 380px) {
  .grid-buttons { grid-template-columns: 1fr; }
  .seg button { font-size: 12.5px; padding: 0 4px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
