/*
 * Wheel of Life: "the paper worksheet, colored in".
 * Ballpoint-blue ink on cool paper, one colored pencil per life area.
 * The wheel is the one bold element; everything around it stays quiet.
 * Layout uses logical properties (inline-start = right in RTL).
 */

@font-face {
  font-family: 'Rubik';
  src: url('../fonts/Rubik-Variable.ttf') format('truetype');
  font-weight: 300 900;
  font-display: swap;
}
@font-face {
  font-family: 'Suez One';
  src: url('../fonts/SuezOne-Regular.ttf') format('truetype');
  font-weight: 400;
  font-display: swap;
}

:root {
  --paper: #F4F6FA;
  --paper-dot: #DFE4EE;
  --surface: #FFFFFF;
  --ink: #1C2B5A;
  --ink-soft: #4A5677;
  --pen: #2747C9;
  --pen-dark: #1B34A0;
  --pen-tint: #E8EDFB;
  --line: #D5DBE8;
  --line-strong: #AEB8CF;
  --danger: #B3261E;
  --ok: #2E7D4F;
  --ok-tint: #E3F2E9;

  --font-body: 'Rubik', 'Segoe UI', Arial, sans-serif;
  --font-display: 'Suez One', 'Rubik', Georgia, serif;

  /* Type scale: ratio 1.25 from a 17px base. */
  --step--1: 0.85rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.56rem;
  --step-3: 1.95rem;
  --step-4: 2.6rem;

  --radius-s: 6px;
  --radius-m: 10px;
  --radius-l: 18px;
  --space: 1rem;
  --max: 1180px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 17px;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--paper);
  /* Faint dot grid, like a notebook page. */
  background-image: radial-gradient(var(--paper-dot) 1px, transparent 1.2px);
  background-size: 22px 22px;
  min-height: 100vh;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.25;
  font-weight: 400;
}

p {
  margin: 0 0 0.75em;
}

a {
  color: var(--pen);
  text-underline-offset: 3px;
}

a:hover {
  color: var(--pen-dark);
}

:focus-visible {
  outline: 3px solid var(--pen);
  outline-offset: 2px;
  border-radius: 4px;
}

[tabindex='-1']:focus {
  outline: none;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.muted {
  color: var(--ink-soft);
}

.noscript {
  padding: 2rem;
  text-align: center;
}

/* ---------- Top bar ---------- */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space);
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.9rem 1.25rem;
}

.brand {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--ink);
  text-decoration: none;
}

.saved {
  font-size: var(--step--1);
  color: var(--ok);
  opacity: 0;
  transition: opacity 0.3s;
}

.saved.is-visible {
  opacity: 1;
}

/* ---------- Page frame ---------- */

.page {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0.5rem 1.25rem 4rem;
}

.page.narrow {
  max-width: 820px;
}

.page-head {
  margin-block-end: 1.5rem;
}

.page-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  margin-block: 0.5rem 0.25rem;
}

.section {
  margin-block-start: 3rem;
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  margin-block-end: 1rem;
}

.back-link {
  font-size: var(--step--1);
  text-decoration: none;
}

.back-link::before {
  content: '→ ';
}

.empty {
  padding: 1.5rem;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius-m);
  color: var(--ink-soft);
  background: var(--surface);
}

.empty-inline {
  color: var(--ink-soft);
  margin: 0;
}

/* ---------- Buttons and fields ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4em;
  min-height: 44px;
  padding: 0.5rem 1.1rem;
  border: 1.5px solid transparent;
  border-radius: var(--radius-s);
  font: inherit;
  font-weight: 500;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  background: none;
  color: var(--ink);
}

.btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--pen);
  color: #fff;
}

.btn-primary:hover:not(:disabled) {
  background: var(--pen-dark);
  color: #fff;
}

.btn-quiet {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.btn-quiet:hover:not(:disabled) {
  border-color: var(--pen);
  color: var(--pen);
}

.btn-quiet.btn-danger {
  color: var(--danger);
}

.btn-quiet.btn-danger:hover {
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger-solid {
  background: var(--danger);
  color: #fff;
}

.btn-large {
  min-height: 52px;
  padding-inline: 1.6rem;
  font-size: var(--step-1);
}

.btn-small {
  min-height: 34px;
  padding: 0.3rem 0.7rem;
  font-size: var(--step--1);
}

.btn-add {
  min-height: 40px;
  padding-inline: 0.2rem;
  color: var(--pen);
  font-weight: 500;
}

.btn-add:hover {
  text-decoration: underline;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-block: 1rem;
}

.icon-btn {
  flex: none;
  width: 40px;
  height: 40px;
  border: 1.5px solid transparent;
  border-radius: var(--radius-s);
  background: none;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--ink-soft);
  cursor: pointer;
}

.icon-btn:hover {
  color: var(--danger);
  border-color: var(--line);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-block-end: 1rem;
}

.field-label {
  font-weight: 500;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.input {
  width: 100%;
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  border: 1.5px solid var(--line-strong);
  border-radius: var(--radius-s);
  background: var(--surface);
  font: inherit;
  color: var(--ink);
}

.input::placeholder {
  color: #8A93AD;
}

.input:focus-visible {
  border-color: var(--pen);
  outline-offset: 0;
}

.textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.6;
}

.field-warning {
  flex-basis: 100%;
  margin: 0.25rem 0 0;
  font-size: var(--step--1);
  color: #8A4B00;
}

.hint {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-block: 0.5rem;
}

/* ---------- Home ---------- */

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem;
  align-items: center;
  padding-block: 1.5rem 1rem;
}

.hero-title {
  font-family: var(--font-display);
  font-size: clamp(2.6rem, 6vw, 4.2rem);
  line-height: 1.05;
  margin-block-end: 0.75rem;
}

.lead {
  font-size: var(--step-1);
  max-width: 32ch;
  margin-block-end: 1.5rem;
}

.privacy {
  margin-block-start: 2rem;
  padding: 1rem 1.25rem;
  border-inline-start: 4px solid var(--pen);
  background: var(--surface);
  border-start-end-radius: var(--radius-m);
  border-end-end-radius: var(--radius-m);
  max-width: 46ch;
}

.privacy-title {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--step-0);
  margin-block-end: 0.35rem;
}

.privacy p {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.hero-wheel {
  margin: 0;
}

.hero-wheel figcaption {
  text-align: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

/* The single orchestrated moment: the wheel's colors grow out from the center on the home page. */
.hero-wheel .wheel-fills {
  animation: wheel-grow 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

@keyframes wheel-grow {
  from {
    transform: scale(0.15);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.wheel-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.wheel-row {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem;
  padding: 0.75rem 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.wheel-row-thumb {
  display: block;
  width: 76px;
}

.wheel-row-title {
  font-weight: 600;
  font-size: var(--step-1);
  color: var(--ink);
  text-decoration: none;
}

.wheel-row-title:hover {
  color: var(--pen);
}

.wheel-row-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.wheel-row-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  justify-content: flex-end;
}

.wheel-row-actions .btn {
  min-height: 38px;
  padding: 0.35rem 0.8rem;
  font-size: var(--step--1);
}

.badge {
  display: inline-block;
  padding: 0.1rem 0.6rem;
  border-radius: 999px;
  background: var(--pen-tint);
  color: var(--pen-dark);
  font-size: var(--step--1);
  font-weight: 500;
}

.badge--done {
  background: var(--ok-tint);
  color: var(--ok);
}

.badge--today {
  background: var(--pen);
  color: #fff;
}

.compare-pick {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem;
}

.compare-pick .field {
  flex: 1 1 240px;
  margin: 0;
}

.compare-pick .btn {
  flex: none;
}

/* ---------- Wheel (SVG) ---------- */

.wheel {
  display: block;
  width: 100%;
  height: auto;
  /* SVG text anchors are computed for an LTR base; Hebrew text inside still renders RTL. */
  direction: ltr;
  overflow: visible;
}

.wheel-paper {
  fill: #fff;
}

.wheel-rings circle {
  fill: none;
  stroke: #E3E7F0;
  stroke-width: 1;
}

.wheel-tint {
  opacity: 0.12;
}

.wheel-fill {
  opacity: 0.9;
}

.wheel-subline {
  stroke: var(--line-strong);
  stroke-width: 0.9;
}

.wheel-divider {
  stroke: var(--ink);
  stroke-width: 1.8;
}

.wheel-rim {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
}

.wheel-center {
  fill: #fff;
  stroke: var(--ink);
  stroke-width: 1.8;
}

.wheel-center-text {
  font-family: var(--font-display);
  font-size: 12.5px;
  fill: var(--ink);
}

.wheel-gut {
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.2;
  stroke-linecap: round;
}

.wheel-older {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.2;
  stroke-dasharray: 6 4;
}

.wheel-label-name {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 500;
  fill: var(--ink);
}

.wheel-label-score {
  font-family: var(--font-display);
  font-size: 19px;
  fill: var(--ink);
}

.wheel--mini .wheel-rings,
.wheel--mini .wheel-sublines {
  display: none;
}

.wheel--mini .wheel-divider {
  stroke-width: 5;
}

.wheel--mini .wheel-rim,
.wheel--mini .wheel-center {
  stroke-width: 7;
}

.wheel--mini .wheel-gut {
  display: none;
}

/* Phones: the wheel without side labels, with this list underneath. */
.area-legend {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.3rem 1rem;
  font-size: var(--step--1);
}

.area-legend li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  padding-block: 0.2rem;
  border-block-end: 1px dashed var(--line);
}

.area-legend-score {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.wheel-compact .wheel {
  max-width: 320px;
  margin-inline: auto;
}

.wheel-legend {
  font-size: var(--step--1);
  color: var(--ink-soft);
  margin-block-start: 0.75rem;
}

.wheel-legend p {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.25rem 0;
}

.legend-swatch {
  flex: none;
  display: inline-block;
  width: 26px;
  height: 14px;
}

.legend-swatch--fill {
  background: linear-gradient(90deg, #F0B429 0 33%, #3FA66B 33% 66%, #E0567A 66%);
  border-radius: 3px;
}

.legend-swatch--gut {
  height: 4px;
  background: var(--ink);
  border-radius: 2px;
}

.legend-swatch--older {
  height: 0;
  border-top: 2.5px dashed var(--ink);
}

/* ---------- Wizard ---------- */

.wizard {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 1.25rem 4rem;
}

.wizard-head {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-block-end: 1.5rem;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 0.35rem;
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: none;
}

.stepper-item a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.4rem;
  border-block-end: 3px solid var(--line);
  text-decoration: none;
  color: var(--ink-soft);
  font-size: var(--step--1);
}

.stepper-num {
  flex: none;
  display: grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  background: var(--surface);
  font-weight: 600;
  font-size: 0.8rem;
}

.stepper-item.is-done a {
  border-block-end-color: var(--ok);
}

.stepper-item.is-done .stepper-num {
  border-color: var(--ok);
  background: var(--ok-tint);
  color: var(--ok);
}

.stepper-item.is-current a {
  border-block-end-color: var(--pen);
  color: var(--ink);
  font-weight: 600;
}

.stepper-item.is-current .stepper-num {
  border-color: var(--pen);
  background: var(--pen);
  color: #fff;
}

.wizard-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 520px);
  gap: 2.5rem;
  align-items: start;
}

.wizard-aside {
  position: sticky;
  top: 1rem;
}

.panel-wheel-title {
  margin: 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.step-title {
  font-family: var(--font-display);
  font-size: var(--step-3);
  margin-block: 0.15rem 0.5rem;
}

.step-intro {
  font-size: var(--step-1);
  max-width: 60ch;
  margin-block-end: 1.5rem;
}

.step-nav {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  margin-block-start: 2rem;
  padding-block-start: 1.25rem;
  border-block-start: 1px solid var(--line);
}

.meta-fields {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
  gap: 1rem;
  margin-block-end: 0.5rem;
}

/* Area cards: one per life area, marked with that area's pencil color. */
.area-card {
  margin-block-end: 1rem;
  padding: 1rem 1.25rem 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-inline-start: 5px solid var(--area);
  border-radius: var(--radius-m);
}

.area-card-title {
  font-size: var(--step-1);
  font-weight: 600;
  margin-block-end: 0.75rem;
}

.area-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.area-dot {
  flex: none;
  width: 0.8em;
  height: 0.8em;
  border-radius: 50%;
  background: var(--area);
}

.item-list {
  list-style: none;
  margin: 0 0 0.25rem;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.item-row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.item-row--wrap {
  flex-wrap: wrap;
}

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

/* Score list: label + 10-segment picker per row. */
.score-list {
  display: grid;
  gap: 0.6rem;
}

.score-item {
  display: grid;
  grid-template-columns: minmax(8rem, 12rem) minmax(0, 1fr);
  align-items: center;
  gap: 1rem;
}

.score-list > .score-item:not(:last-child) {
  padding-block-end: 0.6rem;
  border-block-end: 1px dashed var(--line);
}

.score-item-label {
  font-weight: 500;
}

.score-picker {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.score-row {
  display: flex;
}

.score-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
}

/* The segments fill up to the chosen score (from the right, in reading order). */
.score-label {
  flex: 1 1 0;
  min-width: 0;
  display: grid;
  place-items: center;
  height: 40px;
  border: 1.5px solid var(--line-strong);
  border-inline-start-width: 0;
  background: var(--surface);
  font-size: var(--step--1);
  font-weight: 500;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.score-row .score-label:first-of-type {
  border-inline-start-width: 1.5px;
  border-start-start-radius: var(--radius-s);
  border-end-start-radius: var(--radius-s);
}

.score-row .score-label:last-of-type {
  border-start-end-radius: var(--radius-s);
  border-end-end-radius: var(--radius-s);
}

.score-label:hover {
  background: var(--pen-tint);
}

.score-label.is-filled {
  background: color-mix(in srgb, var(--area) 38%, #fff);
  color: var(--ink);
}

.score-label.is-current {
  background: var(--area);
  color: var(--ink);
  font-weight: 700;
  font-size: var(--step-0);
}

.score-input:focus-visible + .score-label {
  outline: 3px solid var(--pen);
  outline-offset: 1px;
  position: relative;
  z-index: 1;
}

.score-chip {
  display: inline-grid;
  place-items: center;
  min-width: 1.8rem;
  height: 1.8rem;
  margin-inline-start: 0.5rem;
  padding-inline: 0.3rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--area) 35%, #fff);
  font-size: var(--step--1);
  font-weight: 600;
  vertical-align: middle;
}

.sub-block + .sub-block {
  margin-block-start: 1.1rem;
  padding-block-start: 1rem;
  border-block-start: 1px dashed var(--line);
}

.sub-title {
  font-size: var(--step-0);
  font-weight: 600;
  margin-block-end: 0.5rem;
}

.result-block {
  margin-block: 0.5rem 0.9rem;
  padding-inline-start: 0.9rem;
  border-inline-start: 2px solid color-mix(in srgb, var(--area) 50%, #fff);
}

.result-text {
  font-weight: 500;
  margin-block-end: 0.4rem;
}

.hint-box {
  margin-block-end: 1.25rem;
  padding: 0.9rem 1.1rem;
  background: var(--pen-tint);
  border-radius: var(--radius-m);
  max-width: 70ch;
}

.hint-box p {
  margin: 0;
}

.hint-title {
  font-weight: 600;
  color: var(--pen-dark);
}

/* ---------- Tables ---------- */

.table-wrap {
  overflow-x: auto;
  margin-block-end: 1.25rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-m);
}

.summary {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--step--1);
}

.summary th,
.summary td {
  padding: 0.55rem 0.8rem;
  text-align: start;
  vertical-align: middle;
  border-block-end: 1px solid var(--line);
}

.summary thead th {
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--paper);
  white-space: nowrap;
}

.summary tr.row-area-start > * {
  border-block-start: 1.5px solid var(--line-strong);
}

.summary .cell-area {
  font-weight: 600;
  white-space: nowrap;
  border-inline-start: 4px solid var(--area);
}

.summary .cell-num {
  text-align: center;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.summary .cell-strong {
  font-weight: 700;
}

.delta--up {
  color: var(--ok);
  font-weight: 700;
}

.delta--down {
  color: var(--danger);
  font-weight: 700;
}

/* ---------- Actions / daily task ---------- */

.today {
  padding: 1.25rem 1.5rem;
  margin-block-end: 1.5rem;
  background: var(--surface);
  border: 2px solid var(--pen);
  border-radius: var(--radius-l);
}

.today--empty {
  border-style: dashed;
  border-color: var(--line-strong);
}

.today-title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  color: var(--pen);
  margin-block-end: 0.5rem;
}

.today-action {
  font-size: var(--step-2);
  font-weight: 600;
  line-height: 1.35;
  margin-block-end: 0.5rem;
}

.today-action.is-done {
  text-decoration: line-through;
  text-decoration-color: var(--ok);
  text-decoration-thickness: 2px;
}

.today-context,
.today-result {
  margin: 0.15rem 0;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.progress {
  margin-block-end: 1.5rem;
}

.progress p {
  margin-block-end: 0.35rem;
  font-size: var(--step--1);
  color: var(--ink-soft);
}

.progress progress {
  width: 100%;
  height: 10px;
  appearance: none;
  border: 0;
  border-radius: 999px;
  background: var(--line);
  overflow: hidden;
}

.progress progress::-webkit-progress-bar {
  background: var(--line);
  border-radius: 999px;
}

.progress progress::-webkit-progress-value {
  background: var(--ok);
  border-radius: 999px;
}

.progress progress::-moz-progress-bar {
  background: var(--ok);
  border-radius: 999px;
}

.action-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.35rem;
}

.action-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.3rem 0.5rem;
  border-radius: var(--radius-s);
}

.action-row.is-today {
  background: var(--pen-tint);
}

.action-text {
  flex: 1 1 auto;
  cursor: pointer;
}

.action-row.is-done .action-text {
  color: var(--ink-soft);
  text-decoration: line-through;
}

.checkbox {
  flex: none;
  width: 1.3rem;
  height: 1.3rem;
  accent-color: var(--ok);
  cursor: pointer;
}

.recent-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.recent-list li {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0;
  border-block-end: 1px dashed var(--line);
}

.recent-list li.is-done span:last-child {
  text-decoration: line-through;
  color: var(--ink-soft);
}

.recent-date {
  flex: none;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

/* ---------- Compare ---------- */

.compare-body {
  display: grid;
  grid-template-columns: minmax(0, 6fr) minmax(0, 5fr);
  gap: 2.5rem;
  align-items: start;
  margin-block-start: 1.5rem;
}

.compare-wheel {
  margin: 0;
}

/* ---------- Print view ---------- */

.print-wheel {
  max-width: 640px;
  margin: 1rem auto 1.5rem;
}

.note-text {
  white-space: pre-wrap;
}

.print-actions {
  margin: 0;
  padding-inline-start: 1.25rem;
}

.print-actions .is-done {
  text-decoration: line-through;
}

/* ---------- Dialogs and toast ---------- */

.dialog {
  width: min(520px, calc(100vw - 2rem));
  padding: 0;
  border: 0;
  border-radius: var(--radius-l);
  color: var(--ink);
  background: var(--surface);
  box-shadow: 0 24px 60px rgba(28, 43, 90, 0.25);
}

.dialog::backdrop {
  background: rgba(28, 43, 90, 0.35);
}

.dialog-form {
  padding: 1.5rem;
}

.dialog-title {
  font-family: var(--font-display);
  font-size: var(--step-2);
  margin-block-end: 0.75rem;
}

.dialog-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-block-start: 1.25rem;
}

.choice {
  border: 0;
  margin: 0.5rem 0 0;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.choice-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.6rem 0.75rem;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-s);
  cursor: pointer;
}

.choice-option:has(input:checked) {
  border-color: var(--pen);
  background: var(--pen-tint);
}

.choice-option input {
  margin-block-start: 0.3rem;
  accent-color: var(--pen);
}

.warnings {
  margin-block-start: 0.75rem;
  font-size: var(--step--1);
}

.warnings summary {
  cursor: pointer;
  font-weight: 500;
}

.warnings ul {
  max-height: 12rem;
  overflow: auto;
  padding-inline-start: 1.2rem;
}

.toast {
  position: fixed;
  inset-inline: 1rem;
  bottom: 1rem;
  z-index: 50;
  max-width: 480px;
  margin-inline: auto;
  padding: 0.8rem 1.1rem;
  border-radius: var(--radius-m);
  background: var(--ink);
  color: #fff;
  box-shadow: 0 10px 30px rgba(28, 43, 90, 0.3);
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}

.toast.is-visible {
  opacity: 1;
  transform: none;
}

.toast--error {
  background: var(--danger);
}

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .hero,
  .wizard-body,
  .compare-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-wheel {
    order: -1;
    max-width: 520px;
    margin-inline: auto;
  }

  .wizard-aside {
    position: static;
    order: -1;
    max-width: 440px;
    width: 100%;
    margin-inline: auto;
  }
}

@media (max-width: 640px) {
  html {
    font-size: 16px;
  }

  .stepper-label {
    display: none;
  }

  .stepper-item.is-current .stepper-label {
    display: inline;
  }

  .stepper {
    grid-template-columns: repeat(6, auto);
    justify-content: start;
  }

  .stepper-item.is-current {
    grid-column: span 1;
  }

  .score-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.4rem;
  }

  .meta-fields {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .wheel-row {
    grid-template-columns: 60px minmax(0, 1fr);
  }

  .wheel-row-thumb {
    width: 60px;
  }

  .wheel-row-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .area-card {
    padding-inline: 0.9rem;
  }

  .today-action {
    font-size: var(--step-1);
  }
}

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

/* ---------- Print ---------- */

@media print {
  html {
    font-size: 12pt;
  }

  body {
    background: #fff;
  }

  .no-print,
  .topbar,
  .toast {
    display: none !important;
  }

  .page {
    padding: 0;
    max-width: none;
  }

  .area-card,
  .table-wrap {
    break-inside: avoid;
    border-color: #999;
  }

  .print-break {
    break-before: page;
  }

  .print-wheel {
    max-width: 15cm;
  }

  .wheel-fills {
    animation: none !important;
  }

  * {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
