:root {
  color-scheme: light dark;

  --bg: #f5f3ec;
  --bg-soft: #ffffff;
  --bg-elev: #ffffff;
  --ink: #1c2420;
  --ink-soft: #475149;
  --muted: #6b766e;
  --line: #e1ddd1;
  --line-strong: #cdc7b6;

  --brand: #0f5d44;
  --brand-strong: #08412f;
  --brand-soft: #e0f1e8;
  --accent: #d35a2c;
  --accent-strong: #a13c14;
  --accent-soft: #fbe7d8;
  --warn: #b87a07;
  --danger: #b13a2c;
  --danger-soft: #fde6e2;
  --success: #1f7a52;

  --heat-0: transparent;
  --heat-1: rgba(15, 93, 68, 0.10);
  --heat-2: rgba(15, 93, 68, 0.22);
  --heat-3: rgba(211, 90, 44, 0.28);
  --heat-4: rgba(211, 90, 44, 0.45);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;

  --shadow-xs: 0 1px 2px rgba(20, 30, 25, 0.06);
  --shadow-sm: 0 4px 12px rgba(20, 30, 25, 0.08);
  --shadow-md: 0 12px 28px rgba(20, 30, 25, 0.10);
  --shadow-lg: 0 24px 60px rgba(20, 30, 25, 0.14);

  --focus-ring: 0 0 0 3px rgba(15, 93, 68, 0.28);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #131713;
    --bg-soft: #1b201c;
    --bg-elev: #232925;
    --ink: #ecefe9;
    --ink-soft: #c0c6bf;
    --muted: #8c948c;
    --line: #2e352f;
    --line-strong: #3d453f;

    --brand: #4eb18b;
    --brand-strong: #69c6a1;
    --brand-soft: rgba(78, 177, 139, 0.16);
    --accent: #e08458;
    --accent-strong: #f0a075;
    --accent-soft: rgba(224, 132, 88, 0.18);
    --danger: #e6786a;
    --danger-soft: rgba(230, 120, 106, 0.18);
    --success: #6ec79b;

    --heat-1: rgba(78, 177, 139, 0.14);
    --heat-2: rgba(78, 177, 139, 0.30);
    --heat-3: rgba(224, 132, 88, 0.36);
    --heat-4: rgba(224, 132, 88, 0.58);

    --shadow-xs: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 4px 12px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 12px 28px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 24px 60px rgba(0, 0, 0, 0.55);

    --focus-ring: 0 0 0 3px rgba(78, 177, 139, 0.45);
  }
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto 0;
  z-index: -1;
  height: 360px;
  background:
    radial-gradient(120% 80% at 20% 0%, rgba(211, 90, 44, 0.20), transparent 60%),
    radial-gradient(120% 80% at 80% 0%, rgba(15, 93, 68, 0.32), transparent 60%),
    linear-gradient(180deg, rgba(15, 93, 68, 0.18), rgba(15, 93, 68, 0));
  pointer-events: none;
}

@media (prefers-color-scheme: dark) {
  body::before {
    background:
      radial-gradient(120% 80% at 20% 0%, rgba(211, 90, 44, 0.18), transparent 60%),
      radial-gradient(120% 80% at 80% 0%, rgba(78, 177, 139, 0.22), transparent 60%),
      linear-gradient(180deg, rgba(0, 0, 0, 0.4), transparent);
  }
}

button, input, select, textarea {
  font: inherit;
  color: inherit;
}

a {
  color: var(--brand);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 8px;
  background: var(--bg-elev);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus {
  left: 8px;
  outline: 3px solid var(--brand);
}

/* ----- Topbar ----- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid color-mix(in srgb, var(--line) 70%, transparent);
}

.topbar-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  color: #fff;
  box-shadow: var(--shadow-sm);
}

.brand-title {
  display: block;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.connection-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-size: 0.85rem;
  font-weight: 700;
}

.connection-state .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--success);
  box-shadow: 0 0 0 0 currentColor;
  animation: pulse 2.2s var(--ease) infinite;
}

.connection-state.offline {
  background: var(--danger-soft);
  color: var(--danger);
}
.connection-state.offline .dot {
  background: var(--danger);
  animation: none;
}

@keyframes pulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 50%, transparent); }
  70% { box-shadow: 0 0 0 8px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* ----- App shell ----- */
.app-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 60px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 28px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-strong);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  margin-bottom: 14px;
  font-size: clamp(2.2rem, 4.6vw, 3.4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 800;
}

.intro {
  margin: 0;
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
  max-width: 60ch;
}

.intro strong {
  color: var(--ink);
  font-weight: 700;
}

.hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stat {
  padding: 18px 18px;
  border-radius: var(--radius);
  background: var(--bg-elev);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}

.stat-best {
  grid-column: span 2;
  background: linear-gradient(135deg, var(--brand-soft), var(--accent-soft));
  border-color: color-mix(in srgb, var(--accent) 30%, transparent);
}

.stat-value {
  display: block;
  font-size: 2.2rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.02em;
}

.stat-label {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.9rem;
}

.stat-label strong {
  color: var(--ink);
  font-weight: 700;
}

/* ----- Layout ----- */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 24px;
  align-items: start;
}

.form-panel,
.summary-panel {
  background: var(--bg-elev);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-md);
}

.summary-panel {
  position: sticky;
  top: 76px;
  max-height: calc(100vh - 96px);
  overflow-y: auto;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}

/* ----- Fieldsets ----- */
.card-fieldset {
  margin: 0 0 18px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
}

.card-fieldset legend {
  padding: 0 8px;
  margin-left: -4px;
  font-weight: 800;
  font-size: 0.92rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--brand-strong);
}

@media (prefers-color-scheme: dark) {
  .card-fieldset legend { color: var(--brand-strong); }
}

.card-fieldset legend em {
  color: var(--accent);
  font-style: normal;
}

.field-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink-soft);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}

.field-label em {
  color: var(--accent);
  font-style: normal;
}

label {
  display: block;
  color: var(--ink);
  font-weight: 500;
}

input[type="text"],
input[type="number"],
input[type="email"],
select,
textarea {
  width: 100%;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 11px 13px;
  transition: border-color 120ms var(--ease), box-shadow 120ms var(--ease);
}

input[type="text"]::placeholder,
input[type="number"]::placeholder,
textarea::placeholder {
  color: color-mix(in srgb, var(--muted) 80%, transparent);
}

textarea {
  resize: vertical;
  min-height: 100px;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--focus-ring);
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.subfield {
  margin-bottom: 14px;
}

.notes-label {
  display: block;
  margin-top: 14px;
}

.char-counter {
  float: right;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}
.char-counter.near-limit { color: var(--accent); }
.char-counter.at-limit { color: var(--danger); }

.hint {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.5;
  font-size: 0.95rem;
}

/* ----- Segmented control + chips ----- */
.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 4px;
  background: var(--bg);
  border-radius: 12px;
  border: 1px solid var(--line);
}

.segmented label {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 38px;
  padding: 6px 12px;
  border-radius: 8px;
  background: transparent;
  font-weight: 600;
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease);
}

.segmented label:has(input:checked) {
  background: var(--bg-elev);
  color: var(--brand-strong);
  box-shadow: var(--shadow-xs);
}

.segmented input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.guests-row {
  margin-top: 14px;
}

.checks {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--bg-elev);
  color: var(--ink-soft);
  font-weight: 600;
  font-size: 0.92rem;
  cursor: pointer;
  transition: background 120ms var(--ease), border-color 120ms var(--ease), color 120ms var(--ease);
}

.chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chip:has(input:checked) {
  background: var(--brand-soft);
  border-color: var(--brand);
  color: var(--brand-strong);
}

.chip:hover { border-color: var(--brand); }

.chip:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

/* ----- Slot grid ----- */
.slot-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.slot-card {
  position: relative;
  display: block;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-elev);
  padding: 14px 14px 12px;
  transition: transform 120ms var(--ease), border-color 120ms var(--ease), box-shadow 120ms var(--ease), background 200ms var(--ease);
  overflow: hidden;
}

.slot-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.slot-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--heat, transparent);
  transition: background 240ms var(--ease);
  pointer-events: none;
}

.slot-card > * {
  position: relative;
}

.slot-card:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

.slot-card:has(input:checked) {
  border-color: var(--brand);
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
}

.slot-card:has(input:focus-visible) {
  box-shadow: var(--focus-ring);
}

.slot-card-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 10px;
}

.slot-card-day {
  font-weight: 800;
  font-size: 0.96rem;
  letter-spacing: -0.01em;
}

.slot-card-meal {
  font-size: 0.82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-strong);
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
}

@media (prefers-color-scheme: dark) {
  .slot-card-meal { color: var(--accent-strong); }
}

.slot-card-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.85rem;
  color: var(--ink-soft);
}

.slot-card-count {
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  min-width: 22px;
}

.slot-card-bar {
  position: relative;
  flex: 1;
  height: 6px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink) 8%, transparent);
  overflow: hidden;
}

.slot-card-bar-fill {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--brand), var(--accent));
  border-radius: inherit;
  transition: width 320ms var(--ease);
}

.slot-card:has(input:checked) .slot-card-meal {
  background: var(--brand);
  color: #fff;
}

/* ----- Buttons ----- */
.primary-button,
.secondary-button,
.ghost-button,
.danger-button,
.danger-link {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  font-family: inherit;
  transition: background 140ms var(--ease), color 140ms var(--ease), border-color 140ms var(--ease), transform 80ms var(--ease), box-shadow 140ms var(--ease);
}

.primary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 12px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(180deg, var(--brand), var(--brand-strong));
  color: #fff;
  box-shadow: 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent);
  letter-spacing: 0.01em;
}

.primary-button:hover { transform: translateY(-1px); box-shadow: 0 10px 24px color-mix(in srgb, var(--brand) 40%, transparent); }
.primary-button:active { transform: translateY(0); }
.primary-button:disabled { opacity: 0.6; cursor: progress; transform: none; }
.primary-button:focus-visible { outline: none; box-shadow: var(--focus-ring), 0 8px 20px color-mix(in srgb, var(--brand) 30%, transparent); }

.secondary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--bg-elev);
  color: var(--ink);
  font-size: 0.88rem;
}

.secondary-button:hover,
.ghost-button:hover {
  border-color: var(--brand);
  color: var(--brand-strong);
}

.secondary-button:focus-visible,
.ghost-button:focus-visible {
  outline: none;
  box-shadow: var(--focus-ring);
}

.danger-button {
  min-height: 38px;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  background: var(--danger);
  color: #fff;
}
.danger-button:hover { background: color-mix(in srgb, var(--danger) 86%, black); }

.danger-link {
  align-self: flex-start;
  background: none;
  color: var(--danger);
  text-decoration: underline;
  padding: 6px 0;
  font-size: 0.9rem;
}
.danger-link:hover { color: color-mix(in srgb, var(--danger) 80%, black); }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  border: 1px solid var(--line);
  background: var(--bg-elev);
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 120ms var(--ease), color 120ms var(--ease), border-color 120ms var(--ease);
}
.icon-button:hover { color: var(--brand-strong); border-color: var(--brand); }
.icon-button.danger:hover { color: var(--danger); border-color: var(--danger); }
.icon-button:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.form-footer {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 6px;
}

.export-actions {
  display: flex;
  gap: 6px;
}

/* ----- Summary panel ----- */
.summary-block {
  margin-bottom: 22px;
}

.summary-block h3 {
  margin-bottom: 10px;
  font-size: 0.78rem;
  font-weight: 800;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.best-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding-left: 0;
  list-style: none;
  counter-reset: best;
}

.best-list li {
  position: relative;
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  counter-increment: best;
}

.best-list li::before {
  content: counter(best);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 7px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.8rem;
}

.best-list li:nth-child(1)::before { background: var(--brand); color: #fff; }
.best-list li:nth-child(2)::before { background: var(--accent-soft); color: var(--accent-strong); }

.best-list .slot-name { font-weight: 700; font-size: 0.95rem; }
.best-list .slot-meta { color: var(--muted); font-size: 0.82rem; }
.best-list .slot-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.85rem;
}

/* ----- Response cards ----- */
.responses {
  display: grid;
  gap: 10px;
}

.response-card {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-soft);
  transition: border-color 120ms var(--ease), background 120ms var(--ease);
}

.response-card:hover { border-color: var(--line-strong); }

.response-card.own-response {
  border-color: color-mix(in srgb, var(--brand) 60%, transparent);
  background: var(--brand-soft);
}

.response-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.response-name {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 700;
  letter-spacing: -0.005em;
}

.response-badge {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
}

.response-meta {
  margin: 0 0 6px;
  color: var(--ink-soft);
  font-size: 0.88rem;
  line-height: 1.45;
}

.response-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin: 6px 0;
  padding: 0;
  list-style: none;
}

.response-tags li {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.response-slots {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: italic;
}

.empty {
  margin: 0;
  padding: 14px;
  text-align: center;
  color: var(--muted);
  font-style: italic;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
}

/* ----- Footer ----- */
.page-footer {
  margin-top: 36px;
  padding: 18px 0 0;
  color: var(--muted);
  font-size: 0.85rem;
  text-align: center;
  border-top: 1px solid var(--line);
}
.page-footer p { margin: 0; }

/* ----- Toasts ----- */
.toast-container {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 10px;
  max-width: min(360px, calc(100% - 32px));
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: grid;
  grid-template-columns: 22px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--bg-elev);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.92rem;
  color: var(--ink);
  transform: translateX(20px);
  opacity: 0;
  animation: toast-in 200ms var(--ease) forwards;
}

.toast.leaving {
  animation: toast-out 180ms var(--ease) forwards;
}

@keyframes toast-in {
  to { transform: translateX(0); opacity: 1; }
}
@keyframes toast-out {
  to { transform: translateX(20px); opacity: 0; }
}

.toast-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-strong);
  font-weight: 800;
  font-size: 0.8rem;
}

.toast.toast-error { border-color: color-mix(in srgb, var(--danger) 40%, var(--line-strong)); }
.toast.toast-error .toast-icon { background: var(--danger-soft); color: var(--danger); }

.toast.toast-success .toast-icon { background: var(--brand-soft); color: var(--brand-strong); }

.toast-close {
  background: none;
  border: 0;
  color: var(--muted);
  cursor: pointer;
  padding: 4px;
  border-radius: 6px;
}
.toast-close:hover { color: var(--ink); }

/* ----- Confirm dialog ----- */
.confirm-dialog {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--bg-elev);
  color: var(--ink);
  padding: 0;
  width: min(420px, calc(100% - 32px));
  box-shadow: var(--shadow-lg);
}

.confirm-dialog::backdrop {
  background: rgba(8, 14, 11, 0.42);
  backdrop-filter: blur(2px);
}

.confirm-dialog form {
  padding: 20px;
}

.confirm-dialog h3 {
  margin: 0 0 8px;
  font-size: 1.05rem;
}

.confirm-dialog p {
  margin: 0 0 18px;
  color: var(--ink-soft);
}

.confirm-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

/* ----- Responsive ----- */
@media (max-width: 980px) {
  .hero,
  .layout {
    grid-template-columns: 1fr;
  }
  .hero { align-items: start; }
  .summary-panel {
    position: static;
    max-height: none;
  }
}

@media (max-width: 640px) {
  .app-shell {
    width: calc(100% - 24px);
    padding-top: 20px;
  }
  .topbar-inner {
    width: calc(100% - 24px);
  }
  .form-panel,
  .summary-panel { padding: 18px; border-radius: var(--radius); }
  .card-fieldset { padding: 14px; }
  .field-grid { grid-template-columns: 1fr; }
  .hero-stats { grid-template-columns: 1fr 1fr; }
  .stat-best { grid-column: span 2; }
  .brand-sub { display: none; }
  .connection-state .connection-label { display: none; }
  .connection-state { padding: 6px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
