/* ==========================================================================
   MůjRestart.cz — trauma-informed, klidný design
   Paleta: pískové/šedomodré/zelenkavé tóny, žádná zářivá bílá, žádná červená
   ========================================================================== */

:root {
  /* Paleta — trauma-informed + Apple HIG jemné materiály */
  --bg: #f2ece3;
  --bg-soft: #e8dfd2;
  --surface: #faf6ef;
  --surface-2: #efe6d8;
  --ink: #3c3630;
  --ink-soft: #6c6459;
  --sage: #8a9a83;
  --sage-dark: #6f8069;
  /* Text / tlačítka na světlém pozadí (WCAG AA) */
  --sage-text: #4f6050;
  --sage-primary: #5a6b54;
  --sage-light: #d4dfd0;
  --sand: #e7cf8c;
  --sand-dark: #c9a955;
  --blue-grey: #7c93a3;
  --blue-grey-dark: #4a5f6d;
  --warn: #c98a5b;
  --danger: #7d4a38;

  /* Semantické aliasy (primární akce a povrch) */
  --color-primary: var(--sage-primary);
  --color-primary-hover: var(--sage-text);
  --color-primary-soft: var(--sage-light);
  --color-on-primary: var(--surface);
  --color-bg: var(--bg);
  --color-surface: var(--surface);
  --color-text: var(--ink);
  --color-text-muted: var(--ink-soft);
  --color-border: var(--border-subtle);
  --color-success: var(--sage-text);
  --color-warning: var(--warn);
  --color-danger: var(--danger);

  /* Spacing (zatím nepoužito) */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 40px;

  /* Apple-like tvar a hloubka */
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --radius-sm: 10px;
  --radius-pill: 999px;

  --border-hairline: 1px solid rgba(60, 54, 48, 0.08);
  --border-subtle: 1px solid rgba(60, 54, 48, 0.12);

  --shadow-1: 0 1px 2px rgba(60, 54, 48, 0.06), 0 4px 16px rgba(60, 54, 48, 0.06);
  --shadow-2: 0 8px 24px rgba(60, 54, 48, 0.1), 0 2px 6px rgba(60, 54, 48, 0.06);
  --shadow-inset: inset 0 1px 0 rgba(255, 252, 245, 0.65);

  --glass-bg: rgba(250, 246, 239, 0.82);
  --glass-border: rgba(255, 252, 245, 0.55);
  --glass-blur: saturate(180%) blur(20px);

  --ease-apple: cubic-bezier(0.25, 0.1, 0.25, 1);
  --ease-spring: cubic-bezier(0.34, 1.2, 0.64, 1);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; }

[hidden] {
  display: none !important;
}
p {
    font-size: 15px;
}
/* ---------- Přístupnost: skrytý text pro čtečky obrazovky ---------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

html {
  overflow-x: clip;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  line-height: 1.47;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
}

body {
  overscroll-behavior-y: none;
}

button {
  font-family: inherit;
  cursor: pointer;
}

/* ---------- Přístupnost: viditelný focus jen při navigaci klávesnicí ---------- */
:focus {
  outline: none;
}
:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 2px;
  border-radius: 4px;
}
/* U kulatých/malých prvků trochu větší odstup, aby outline nebyla "přilepená" */
.icon-btn:focus-visible,
.cal-cell:focus-visible,
.score-ring:focus-visible {
  outline-offset: 3px;
}

textarea, input {
  font-family: inherit;
}

#app {
  position: relative;
  width: 100%;
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: var(--safe-top);
  background: var(--bg);
  overflow-x: clip;
  overflow-y: hidden;
  isolation: isolate;
}

.view {
  min-height: calc(100vh - var(--safe-top));
  min-height: calc(100dvh - var(--safe-top));
  display: flex;
  flex-direction: column;
  animation: fadeIn 0.35s var(--ease-apple);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* ---------- Buttons ---------- */
.btn {
  min-height: 56px;
  min-width: 56px;
  border-radius: var(--radius-md);
  border: none;
  padding: 14px 22px;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.02em;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background-color 0.2s var(--ease-apple), opacity 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple), filter 0.2s var(--ease-apple);
}
.btn:active {
  opacity: 0.82;
  filter: brightness(0.96);
}

.btn-primary {
  background: var(--sage-primary);
  color: var(--color-on-primary);
  box-shadow: var(--shadow-1), var(--shadow-inset);
}
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary {
  background: var(--surface);
  color: var(--ink);
  border: var(--border-hairline);
  box-shadow: var(--shadow-1);
}

.btn-ghost {
  background: rgba(250, 246, 239, 0.6);
  color: var(--ink-soft);
  border: var(--border-hairline);
}

.btn-text {
  background: transparent;
  color: var(--blue-grey-dark);
  min-height: 48px;
  min-width: 48px;
  padding: 12px 16px;
  font-weight: 500;
}

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid rgba(181, 115, 91, 0.35);
}

.btn-lg {
  width: 100%;
  font-size: 18px;
  min-height: 60px;
}

.icon-btn {
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: none;
  background: transparent;
  border-radius: 50%;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  transition: background-color 0.2s var(--ease-apple), opacity 0.2s var(--ease-apple);
}
.icon-btn:hover { background: rgba(239, 230, 216, 0.85); }
.icon-btn:active { opacity: 0.75; }

/* ---------- Cards (grouped inset style) ---------- */
.card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 20px;
  margin: 0 16px 16px;
  border: var(--border-hairline);
  box-shadow: var(--shadow-1);
}

.card-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.hint-text {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 8px 0 0;
  line-height: 1.5;
}

.disclaimer {
    color: var(--ink);
    font-size: 15px;
    line-height: 1.6;
    margin: 24px 0 24px;
    gap: 10px;
    background-color: #f0eadd00;
    border-radius: var(--radius-md);
    padding: 1.25rem;
    text-align: left;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

/* ---------- Toast ---------- */
#toast-region {
  position: fixed;
  top: calc(var(--safe-top) + 12px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: min(420px, 92vw);
  pointer-events: none;
}
.toast {
  background: rgba(111, 128, 105, 0.94);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: #faf6ef;
  padding: 14px 18px;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 252, 245, 0.2);
  box-shadow: var(--shadow-2);
  font-size: 15px;
  font-weight: 500;
  text-align: center;
  animation: toastIn 0.35s var(--ease-spring);
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   ONBOARDING
   ========================================================================== */
#ui-icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

#view-onboarding {
  min-height: 0;
}

.onb-wrap {
  padding: 16px 24px 40px;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow-x: clip;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.onb-welcome-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
}

.onb-step[data-step="features"],
.onb-step[data-step="help"] {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.onb-step { display: flex; flex-direction: column; gap: 0; }
.onb-icon { font-size: 56px; text-align: center; margin-bottom: 8px; }
.onb-wrap h1 { font-size: 28px; margin: 0 0 4px; text-align: center; letter-spacing: -0.03em; font-weight: 700; }
.onb-wrap h2 { font-size: 22px; margin: 0 0 4px; letter-spacing: -0.02em; font-weight: 700; }
.onb-text { color: var(--ink-soft); line-height: 1.6; font-size: 15px; text-align: center; }
.onb-step[data-step="goal"] .onb-text,
.onb-step[data-step="startdate"] .onb-text,
.onb-step[data-step="reason"] .onb-text { text-align: left; }

.privacy-box {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  align-items: flex-start;
  margin: 8px 0;
  border: var(--border-hairline);
  box-shadow: var(--shadow-1);
}
.privacy-box p { margin: 0; font-size: 14px; line-height: 1.5; }
.privacy-icon { font-size: 22px; }

.onb-nav {
  display: flex;
  gap: 12px;
  margin-top: 12px;
}
.onb-nav .btn-primary { flex: 1; }

.field-label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
  color: var(--ink);
}

.text-input {
  width: 100%;
  border: var(--border-subtle);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  font-size: 17px;
  color: var(--ink);
  resize: vertical;
  box-shadow: inset 0 1px 2px rgba(60, 54, 48, 0.04);
  transition: border-color 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}
.text-input:focus-visible {
  outline: none;
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 4px rgba(111, 128, 105, 0.18), inset 0 1px 2px rgba(60, 54, 48, 0.04);
}
.text-input.field-error,
.text-input[aria-invalid="true"] {
  border: 2px solid var(--danger);
}

.choice-group {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 8px 0;
}
.choice-card {
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px;
  min-height: 56px;
  color: var(--ink);
  box-shadow: var(--shadow-1);
  transition: border-color 0.2s var(--ease-apple), background-color 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}
.choice-card.selected {
  border-color: var(--sage-text);
  background: var(--sage-light);
  box-shadow: 0 0 0 2px rgba(79, 96, 80, 0.35), var(--shadow-1);
}
.choice-card:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 2px;
}
.choice-emoji { font-size: 28px; }
.choice-title { font-weight: 700; display: block; font-size: 15px; }
.choice-desc { display: block; color: var(--ink-soft); font-size: 14px; margin-top: 2px; }

/* ==========================================================================
   DASHBOARD
   ========================================================================== */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px 10px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: var(--border-hairline);
}
.app-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.logo-mark { font-size: 22px; }

.dashboard-scroll {
  flex: 1;
  overflow-y: auto;
  padding-bottom: 140px;
}

.streak-card {
  text-align: center;
  background: linear-gradient(165deg, var(--sage-light) 0%, var(--surface) 55%);
  border: var(--border-hairline);
}
.streak-number { font-size: 56px; font-weight: 800; color: var(--sage-text); line-height: 1; letter-spacing: -0.04em; }
.streak-label { font-size: 15px; color: var(--ink-soft); margin-top: 4px; }
.streak-goal { font-size: 14px; color: var(--ink-soft); margin-top: 10px; }

.cta-checkin {
  display: flex;
  align-items: center;
  gap: 14px;
  width: calc(100% - 32px);
  margin: 0 16px 16px;
  background: var(--sage-primary);
  color: var(--color-on-primary);
  border: 1px solid rgba(255, 252, 245, 0.12);
  border-radius: var(--radius-xl);
  padding: 18px 20px;
  min-height: 72px;
  box-shadow: var(--shadow-2);
  transition: opacity 0.2s var(--ease-apple), filter 0.2s var(--ease-apple);
}
.cta-checkin:active { opacity: 0.88; filter: brightness(0.96); }
.cta-emoji { font-size: 30px; }
.cta-text { display: flex; flex-direction: column; text-align: left; flex: 1; }
.cta-text strong { font-size: 16px; }
.cta-text small { opacity: 0.9; font-size: 14px; }
.cta-arrow { font-size: 26px; opacity: 0.85; }

#milestone-card { background: var(--sand); }
#milestone-card p { margin: 0; line-height: 1.6; font-size: 14.5px; }

#radar-canvas { display: block; margin: 0 auto; max-width: 100%; }

.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
  font-weight: 600;
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
  text-align: center;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
}
.cal-cell {
  width: 100%;
  min-height: 0;
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 4px 2px;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-soft);
  background: var(--surface-2);
  border: var(--border-hairline);
  position: relative;
  transition: box-shadow 0.2s var(--ease-apple), background-color 0.2s var(--ease-apple);
}
.cal-day-num { line-height: 1.1; }
.cal-day-status {
  font-size: 9px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink-soft);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-cell.has-clean .cal-day-status { color: var(--sage-text); }
.cal-cell.has-slip .cal-day-status { color: var(--warn); }
.cal-cell.empty { background: transparent; border-color: transparent; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--blue-grey); background: var(--surface); }
.cal-cell.has-clean { background: var(--sage-light); color: var(--ink); }
.cal-cell.has-slip { background: var(--sand); color: var(--ink); }
.cal-cell.future { opacity: 0.35; }
.cal-cell.editable-past { cursor: pointer; }
.cal-cell.editable-past:hover { outline: 2px solid var(--blue-grey); }
.calendar-legend {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 13px;
}
.calendar-legend li {
  display: flex;
  align-items: center;
  gap: 6px;
}
.cal-legend-swatch {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: var(--border-hairline);
  flex-shrink: 0;
}
.cal-legend-clean { background: var(--sage-light); }
.cal-legend-slip { background: var(--sand); }
.cal-legend-empty { background: var(--surface-2); }

.savings-grid {
  display: flex;
  justify-content: space-around;
  text-align: center;
  margin-bottom: 8px;
}
.savings-value { font-size: 24px; font-weight: 800; color: var(--sage-text); }
.savings-label { font-size: 14px; color: var(--ink-soft); margin-top: 2px; }

.score-wrap { display: flex; align-items: center; gap: 16px; }
.score-ring {
  width: 84px;
  height: 84px;
  border-radius: 50%;
  background: conic-gradient(var(--sage) 0deg, var(--bg-soft) 0deg);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.score-ring::before {
  content: "";
  position: absolute;
}
.score-ring span {
  background: var(--surface);
  width: 64px;
  height: 64px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 18px;
}

.bottom-spacer { height: 8px; }

body.is-pin-locked .fab-crisis {
  visibility: hidden;
  pointer-events: none;
}

.fab-crisis {
  position: fixed;
  bottom: calc(var(--safe-bottom) + 76px);
  right: 18px;
  max-width: 480px;
  background: rgba(74, 95, 109, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  color: #faf6ef;
  border: 1px solid rgba(255, 252, 245, 0.22);
  border-radius: var(--radius-pill);
  padding: 14px 18px;
  min-height: 56px;
  min-width: 56px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow-2);
  z-index: 50;
  transition: opacity 0.2s var(--ease-apple), transform 0.2s var(--ease-spring);
}
.fab-crisis:active { opacity: 0.88; }

/* ==========================================================================
   WIZARD (Check-in / Crisis / Settings / DayDetail)
   ========================================================================== */
.wizard-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 10px;
}
.wizard-progress {
  flex: 1;
  height: 6px;
  background: var(--bg-soft);
  border-radius: 4px;
  overflow: hidden;
}
.wizard-progress-bar {
  height: 100%;
  background: var(--sage-primary);
  width: 0%;
  transition: width 0.3s ease;
}

.score-ring.is-empty {
  background: conic-gradient(var(--sage) 0deg, var(--bg-soft) 0deg);
}

.trend-point--calm { color: var(--sage-dark); }
.trend-point--mood { color: var(--blue-grey-dark); }
.trend-point--energy { color: var(--sand-dark); }
.trend-point--sleep { color: var(--blue-grey); }

.modal-lead {
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.wizard-step-label {
  font-size: 12.5px;
  color: var(--ink-soft);
  white-space: nowrap;
}

.wizard-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 20px 24px;
}

.wizard-step { display: none; flex-direction: column; gap: 16px; }
.wizard-step.active { display: flex; }

.wizard-step h2 { font-size: 22px; margin: 6px 0 0; letter-spacing: -0.02em; font-weight: 700; }
.step-sub { color: var(--ink-soft); font-size: 14px; line-height: 1.5; margin: 0 0 4px; }

.field-block { display: flex; flex-direction: column; gap: 8px; }

.segmented {
  display: flex;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: rgba(232, 223, 210, 0.85);
  gap: 3px;
  padding: 3px;
  border: var(--border-hairline);
}
.segment {
  flex: 1;
  border: none;
  background: transparent;
  padding: 12px 6px;
  border-radius: calc(var(--radius-md) - 3px);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-soft);
  min-height: 48px;
  transition: background-color 0.2s var(--ease-apple), color 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}
.segment.selected {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(60, 54, 48, 0.12), var(--shadow-inset);
}
.segment:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 1px;
  z-index: 1;
}
.segmented.tri .segment.selected[data-value="no"] { background: var(--surface); color: var(--blue-grey-dark); }
.segmented.tri .segment.selected[data-value="partial"] { background: var(--surface); color: var(--ink); }

.slider {
  width: 100%;
  min-height: 48px;
  height: 48px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  touch-action: none;
}
.slider::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue-grey), var(--sand));
}
.slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid rgba(60, 54, 48, 0.12);
  margin-top: -11px;
  box-shadow: 0 2px 8px rgba(60, 54, 48, 0.18), 0 0 0 0.5px rgba(255, 252, 245, 0.8);
}
.slider:focus-visible::-webkit-slider-thumb {
  box-shadow: 0 0 0 3px var(--blue-grey-dark), 0 2px 8px rgba(60, 54, 48, 0.18);
}
.slider::-moz-range-track {
  height: 10px;
  border-radius: 6px;
  background: linear-gradient(90deg, var(--blue-grey), var(--sand));
}
.slider::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface);
  border: 0.5px solid rgba(60, 54, 48, 0.12);
  box-shadow: 0 2px 8px rgba(60, 54, 48, 0.18);
}
.slider:focus-visible::-moz-range-thumb {
  box-shadow: 0 0 0 3px var(--blue-grey-dark), 0 2px 8px rgba(60, 54, 48, 0.18);
}

.slider-craving::-webkit-slider-runnable-track { background: linear-gradient(90deg, var(--sage-light), var(--warn)); }
.slider-craving::-moz-range-track { background: linear-gradient(90deg, var(--sage-light), var(--warn)); }

.craving-scale { display: flex; align-items: center; gap: 14px; }
.craving-min, .craving-max { font-size: 24px; color: var(--ink-soft); font-weight: 700; }
.craving-value-label { text-align: center; font-weight: 700; color: var(--ink); font-size: 15px; }

.praise-box, .slip-box {
  background: var(--sage-light);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 4px;
}
.slip-box { background: var(--sand); }
.slip-metaphor { font-weight: 600; line-height: 1.6; margin: 0 0 12px; }

.tag-group { display: flex; flex-wrap: wrap; gap: 8px; }
.tag {
  border: var(--border-hairline);
  background: var(--surface);
  border-radius: var(--radius-pill);
  padding: 12px 16px;
  font-size: 14px;
  color: var(--ink);
  min-height: 48px;
  transition: background-color 0.2s var(--ease-apple), border-color 0.2s var(--ease-apple), color 0.2s var(--ease-apple);
}
.tag:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 2px;
}
.tag.selected {
  background: var(--sage-primary);
  color: var(--color-on-primary);
  border-color: var(--sage-primary);
}

.reason-reminder {
  background: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 16px;
  margin-top: 8px;
}
.reason-reminder-label { font-size: 14px; color: var(--ink-soft); font-weight: 600; }
.reason-reminder p { margin: 6px 0 0; font-style: italic; line-height: 1.5; }

.wizard-footer {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px calc(var(--safe-bottom) + 14px);
  border-top: var(--border-hairline);
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
}
.wizard-footer .btn-primary,
.wizard-footer #checkin-save { flex: 1; }

/* ---------- Choice group inline for consumption step ---------- */
[data-consumption].selected { border-color: var(--sage-text); background: var(--sage-light); }

/* ==========================================================================
   CRISIS
   ========================================================================== */
.crisis-header {
  background: rgba(95, 118, 132, 0.96);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-bottom: 1px solid rgba(255, 252, 245, 0.12);
}
.crisis-header .icon-btn { color: #fff; }
.crisis-header .wizard-step-label { color: rgba(255,255,255,0.85); }

.crisis-body {
  flex: 1;
  padding: 16px 20px 32px;
  overflow-y: auto;
}
.crisis-body h2 { margin-top: 4px; }

.crisis-menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 16px;
}
.crisis-tile {
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-lg);
  padding: 16px 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  min-height: 120px;
  box-shadow: var(--shadow-1);
  font-size: 14px;
  color: var(--ink);
  transition: opacity 0.2s var(--ease-apple), box-shadow 0.2s var(--ease-apple);
}
.crisis-tile:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 2px;
}
.crisis-tile:active { opacity: 0.85; }
.crisis-tile small { color: var(--ink-soft); font-weight: 400; }
.crisis-tile--full {
  width: 100%;
  margin-bottom: 4px;
}
.crisis-tile-emoji { font-size: 30px; }

.btn.tool-back {
  align-self: flex-start;
  padding-left: 0;
  margin-bottom: 0;
}

.breathing-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  margin: 30px 0 10px;
  height: 220px;
}
.breathing-circle {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--sage-light), var(--sage));
  transition: transform 4s ease-in-out;
}
.breathing-circle.grow { transform: scale(1.6); }
.breathing-label {
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
  color: var(--ink-soft);
}
.breathing-timer {
  text-align: center;
  font-size: 32px;
  font-weight: 800;
  color: var(--blue-grey-dark);
  margin-bottom: 20px;
}

.grounding-list { display: flex; flex-direction: column; gap: 12px; margin-top: 12px; }
.halt-check-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.call-list { display: flex; flex-direction: column; gap: 12px; margin-top: 16px; }
.grounding-item,
.halt-check-item,
.call-item {
  background: var(--surface);
  border-radius: var(--radius-lg);
  padding: 16px;
  box-shadow: var(--shadow-1);
  border: var(--border-hairline);
}
.grounding-item strong { display: block; margin-bottom: 4px; }
.halt-check-item { line-height: 1.5; }
.call-item {
  display: flex;
  align-items: center;
  gap: 14px;
  text-decoration: none;
  color: var(--ink);
  min-height: 56px;
}
.call-emoji { font-size: 26px; }

/* ==========================================================================
   SETTINGS extras
   ========================================================================== */
.settings-actions { display: flex; flex-direction: column; gap: 12px; margin-top: 8px; }
.divider { border: none; border-top: 1px solid var(--bg-soft); margin: 24px 0; }

/* ==========================================================================
   MODAL
   ========================================================================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  box-sizing: border-box;
  background: rgba(60, 54, 48, 0.35);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: max(12px, var(--safe-top)) 12px calc(var(--safe-bottom) + 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
html:has(#modal-overlay:not([hidden])),
body:has(#modal-overlay:not([hidden])) {
  overflow: hidden;
}
.modal-box {
  background: var(--surface);
  border-radius: var(--radius-xl);
  padding: 24px 20px 20px;
  max-width: 380px;
  width: 100%;
  max-height: min(640px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px));
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex-shrink: 0;
  margin: auto;
  border: var(--border-hairline);
  box-shadow: var(--shadow-2);
  animation: sheetUp 0.35s var(--ease-spring);
}
.modal-box:not(.modal-box--scroll) {
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}
@keyframes sheetUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.modal-box h3 { margin-top: 0; }
.modal-box--scroll {
  max-height: min(640px, calc(100dvh - var(--safe-top) - var(--safe-bottom) - 24px));
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 20px 12px;
  flex-shrink: 0;
}
.modal-header h3 {
  margin: 0;
  flex: 1;
  padding-right: 4px;
}
.modal-header .modal-close {
  flex-shrink: 0;
  margin: -4px -4px 0 0;
}
.modal-body--prose {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 20px 20px;
  flex: 1;
  min-height: 0;
  -webkit-overflow-scrolling: touch;
}
.modal-body--prose p,
.modal-body--prose .modal-lead {
  margin: 0 0 14px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.modal-body--prose > p:last-of-type:not(:only-of-type) {
  margin-bottom: 14px;
}
.modal-body--prose a {
  color: var(--sage-text);
  font-weight: 600;
  text-decoration: none;
}
.modal-body--prose a:hover {
  color: var(--sage-dark);
  text-decoration: underline;
}
.modal-actions { display: flex; gap: 10px; margin-top: 18px; }
.modal-actions .btn { flex: 1; }

/* ==========================================================================
   MAIN NAV
   ========================================================================== */
.main-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(480px, 100%);
  display: flex;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: var(--border-hairline);
  padding: 6px 10px calc(var(--safe-bottom) + 8px);
  z-index: 40;
  box-shadow: 0 -1px 0 rgba(255, 252, 245, 0.5), 0 -8px 24px rgba(60, 54, 48, 0.08);
}
.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  min-width: 48px;
  padding: 6px 8px;
  border: none;
  background: transparent;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  border-radius: var(--radius-md);
  transition: background-color 0.2s var(--ease-apple), color 0.2s var(--ease-apple);
}
.nav-item[aria-current="page"] {
  color: var(--sage-text);
  background: rgba(212, 223, 208, 0.55);
}
.nav-item[aria-current="page"]::before {
  content: "";
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--sage-text);
  margin-bottom: 1px;
}
.nav-item[aria-current="page"] .ui-icon {
  color: var(--sage-text);
}

/* ==========================================================================
   INFOBOX (PWA install banner)
   ========================================================================== */
.infobox {
  display: flex;
  gap: 12px;
  margin: 0 16px 16px;
  padding: 16px;
  background: var(--sage-light);
  border: 2px solid var(--sage);
  border-radius: var(--radius-lg);
}
.infobox-icon { font-size: 28px; flex-shrink: 0; }
.infobox-body { flex: 1; }
.infobox-body .btn { margin-top: 10px; width: 100%; }
.infobox-dismiss { min-height: 44px; font-size: 13px; }

/* ==========================================================================
   TRENDS CHART
   ========================================================================== */
.trends-figure { margin: 0; }
.trends-svg {
  width: 100%;
  height: auto;
  display: block;
  touch-action: pan-y;
}
.trends-svg .axis-label { font-size: 9px; fill: var(--ink-soft); }
.trends-svg .grid-line { stroke: var(--bg-soft); stroke-width: 1; }
.trends-svg .axis-line { stroke: var(--ink-soft); stroke-width: 1; }

.trends-svg .line-calm   { stroke: var(--sage-dark); stroke-width: 2.5; fill: none; }
.trends-svg .line-mood   { stroke: var(--blue-grey-dark); stroke-width: 2; fill: none; stroke-dasharray: 8 4; }
.trends-svg .line-energy { stroke: var(--sand-dark); stroke-width: 2; fill: none; stroke-dasharray: 2 4; }
.trends-svg .line-sleep  { stroke: var(--blue-grey); stroke-width: 2; fill: none; stroke-dasharray: 8 4 2 4; }

.trends-svg .dot-visible { fill: currentColor; stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.trends-svg .dot-hit {
  fill: transparent;
  stroke: transparent;
  cursor: pointer;
}
.trends-svg .dot-hit:focus-visible {
  outline: none;
}
.trends-svg .dot-hit:focus-visible + .dot-visible {
  stroke: var(--blue-grey-dark);
  stroke-width: 3;
}

.trends-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}
.trend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 8px 12px;
  border: 2px solid var(--bg-soft);
  border-radius: var(--radius-sm);
  background: var(--surface);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.trend-toggle:focus-visible {
  outline: 3px solid var(--blue-grey-dark);
  outline-offset: 2px;
}
.trend-toggle.is-active {
  border-color: var(--sage-text);
  background: var(--sage-light);
}
.trend-toggle[aria-disabled="true"] { opacity: 0.85; cursor: default; }
.trend-line-sample { width: 24px; height: 0; border-top-width: 3px; border-top-style: solid; }
.trend-line-dashed  { border-top-style: dashed; }
.trend-line-dotted  { border-top-style: dotted; }
.trend-line-dashdot { border-top-style: dashed; border-top-width: 2px; }

/* ==========================================================================
   JOURNAL
   ========================================================================== */
#view-journal .dashboard-scroll {
  padding-inline: 16px;
}

.journal-intro { margin: 8px 0 0; }
#view-journal #journal-empty { margin: 12px 0 0; }

.journal-feed {
  list-style: none;
  margin: 12px 0 0;
  padding: 0 0 0 20px;
  border-left: 3px solid var(--bg-soft);
}
.journal-entry {
  position: relative;
  margin-bottom: 16px;
  padding: 20px;
  background: var(--surface);
  border: var(--border-hairline);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-1);
}
.journal-entry::before {
  content: "";
  position: absolute;
  left: -27px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--sage);
  border: 2px solid var(--surface);
}
.journal-entry.has-slip::before { background: var(--sand-dark); }
.journal-date {
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
  margin: 0 0 8px;
}
.journal-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 8px;
}
.journal-note {
  margin: 12px 0 0;
  padding: 14px 16px;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  line-height: 1.6;
  white-space: pre-wrap;
}
.journal-entry button {
  margin-top: 12px;
  min-height: 48px;
}

/* ==========================================================================
   SETTINGS — checkbox row
   ========================================================================== */
.checkbox-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  cursor: pointer;
}
.checkbox-row input[type="checkbox"] {
  width: 24px;
  height: 24px;
  accent-color: var(--sage-dark);
  flex-shrink: 0;
}

/* ==========================================================================
   RESPONSIVE tweaks
   ========================================================================== */
@media (max-width: 399px) {
  .calendar-weekdays,
  .calendar-grid {
    gap: 4px;
  }
  .cal-cell {
    font-size: 12px;
    padding: 2px 1px;
  }
  .cal-day-status {
    font-size: 8px;
  }
}

@media (min-width: 500px) {
  #app {
    border-radius: var(--radius-xl);
    margin-top: 12px;
    margin-bottom: 12px;
    box-shadow: var(--shadow-2);
    border: var(--border-hairline);
    min-height: calc(100vh - 24px);
    min-height: calc(100dvh - 24px);
  }
  .view {
    min-height: calc(100vh - var(--safe-top) - 24px);
    min-height: calc(100dvh - var(--safe-top) - 24px);
  }
}

/* ==========================================================================
   RESPEKT K POHYBU — prefers-reduced-motion
   Pro uživatele citlivé na pohyb/blikání vypínáme nebo minimalizujeme animace.
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  .view {
    animation: none;
  }

  .toast {
    animation: none;
  }

  .btn:active,
  .icon-btn:active,
  .choice-card:active,
  .crisis-tile:active,
  .cta-checkin:active,
  .fab-crisis:active {
    transform: none;
    opacity: 1;
    filter: none;
  }

  .modal-box {
    animation: none;
  }

  /* Dýchací kruh: žádné pulzování/zvětšování — jen pomalá změna průhlednosti,
     tempo dýchání udává textový popisek a odpočet, ne pohyb. */
  .breathing-circle {
    transition: opacity 4s ease-in-out;
    transform: none !important;
  }
  .breathing-circle.grow {
    transform: none !important;
    opacity: 0.55;
  }
}

/* ==========================================================================
   ONBOARDING — welcome krok (nadpis, anonymita, PIN v privacy boxu)
   ========================================================================== */

.onb-step[data-step="welcome"] .onb-title {
  font-size: 26px;
  margin: 0 0 8px;
  text-align: center;
  line-height: 1.3;
  max-width: 100%;
}

.onb-step[data-step="welcome"] .onb-title-main {
  color: var(--sage-text);
  font-weight: 700;
}

.onb-step[data-step="welcome"] .onb-title-sub {
  display: block;
  color: var(--ink);
  font-weight: 600;
  margin-top: 2px;
  max-width: 100%;
}

.onb-anonymous {
  position: relative;
  display: inline-block;
  max-width: 100%;
  line-height: inherit;
  text-wrap: balance;
  overflow-wrap: break-word;
}

.onb-anonymous-text {
  position: relative;
  z-index: 1;
  color: var(--sage-text);
  font-weight: 700;
}

.onb-anonymous-underline {
  position: absolute;
  left: 0;
  bottom: -0.18em;
  height: 2px;
  width: 0;
  background-color: var(--sage-dark);
  border-radius: 999px;
  animation: onb-underline-grow 1.4s ease-out 0.3s forwards;
}

@keyframes onb-underline-grow {
  from { width: 0; }
  to   { width: 100%; }
}

.privacy-box .privacy-pin {
  font-style: italic;
  text-align: center;
  color: var(--ink);
}

@media (prefers-reduced-motion: reduce) {
  .onb-anonymous-underline {
    animation: none;
    width: 100%;
  }
}

/* ==========================================================================
   Úpravy pro Welcome obrazovku
   ========================================================================== */

/* Zajištění zelené barvy pro H1 */
.color-sage {
  color: var(--sage-text);
}

/* Oprava seznamu funkcí s oddělovací čarou */
.onb-features {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
  background-color: var(--surface);
  border-radius: var(--radius-lg);
  padding: 0.35rem 0;
  text-align: left;
  border: var(--border-hairline);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

.onb-features li {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  font-size: 15px;
  color: var(--ink);
  padding: 0.85rem 1.1rem;
}

.onb-features li:not(:last-child) {
  border-bottom: var(--border-hairline);
  padding-bottom: 0.85rem;
  margin-bottom: 0;
}
.feature-icon {
  flex-shrink: 0;
  margin-top: 2px;
  font-size: 22px;
  background: var(--surface-2);
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: var(--border-hairline);
}
.feature-text {
  display: block;
  line-height: 1.4;
}

/* Oprava rozbitého boxu o soukromí (přepis tvé původní třídy) */
/*
.privacy-box {
  display: flex;
  flex-direction: column; 
  gap: 10px;
  background-color: var(--surface-2);
  border-radius: var(--radius-md);
  padding: 1.25rem;
  text-align: left;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
*/

/* Specifická úprava jen pro welcome obrazovku */
.onb-step[data-step="welcome"] .privacy-box {
  flex-direction: column;
  background-color: var(--surface-2);
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.privacy-box-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-size: 0.95rem;
}
.privacy-icon {
  flex-shrink: 0;
  font-size: 20px;
  background: var(--surface-2);
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: var(--border-hairline);
}
.privacy-box p {
  margin: 0;
  font-size: 15px;
  color: var(--ink-soft);
  line-height: 1.5;
}
/* ==========================================================================
   ONBOARDING — Detail sledovaných funkcí (Krok "features")
   ========================================================================== */
   .features-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 12px;
    margin-bottom: 24px;
  }
  
  .feature-card {
    display: flex;
    align-items: center;
    gap: 16px;
    background: var(--surface);
    border-radius: var(--radius-lg);
    padding: 14px 16px;
    box-shadow: var(--shadow-1);
    border: var(--border-hairline);
    text-align: left;
  }
  
  .feature-emoji {
    font-size: 22px;
    flex-shrink: 0;
    background: var(--surface-2);
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    border: var(--border-hairline);
  }

.icon-tile,
.feature-icon,
.feature-emoji,
.privacy-icon {
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  padding: 0;
  background: var(--surface-2);
  border: 1px solid var(--border-hairline);
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
  
  .feature-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
  }
  
  .feature-info strong {
    color: var(--ink);
    font-size: 15px;
  }
  
  .feature-info span {
    color: var(--ink-soft);
    font-size: 13px;
    line-height: 1.4;
  }
  /* ==========================================================================
   ONBOARDING — Detail Pomoci (Krok "help")
   ========================================================================== */
.card-danger {
  border: 2px solid rgba(181, 115, 91, 0.35); /* Využívá tvou var(--danger) s průhledností */
  margin: 0 0 16px 0; /* Vyresetuje vnější okraje původní karty pro Onboarding */
}

.card-margins {
  margin: 0 0 16px 0;
}

.color-ink {
  color: var(--ink) !important;
}

.no-margin-top {
  margin-top: 0 !important;
}

.help-contact-group {
  margin-top: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: var(--ink);
}

.help-btn-row {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}

.help-btn-row .btn {
  flex: 1;
  text-decoration: none;
  font-size: 14px;
}

.help-link-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.help-ext-link {
  font-weight: 700;
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: 15px;
}

.help-ext-link:hover {
  color: var(--sage-dark);
  text-decoration-color: var(--sage-dark);
}

.help-link-item p {
  margin-top: 4px;
}
button.fab-crisis {
  padding: 12px 16px !important;
}
/* ==========================================================================
   ONBOARDING — Patička (Footer)
   ========================================================================== */
.onb-footer {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid var(--bg-soft);
  text-align: center;
  font-size: 14px;
  color: var(--ink-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.onb-footer p {
  margin: 0;
  line-height: 1.5;
}

.onb-footer a {
  color: var(--sage-text);
  text-decoration: none;
  font-weight: 600;
}

.btn-text-link {
  background: transparent;
  border: none;
  padding: 12px 16px;
  min-height: 48px;
  min-width: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  font-family: inherit;
}

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

.app-trust-links {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-top: 24px;
  padding-top: 16px;
  text-align: center;
  border-top: 1px solid var(--bg-soft);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.app-trust-links .btn-text-link {
  max-width: 100%;
  white-space: normal;
  text-align: center;
}

.footer-signature {
  font-style: italic;
  opacity: 0.85;
  margin-top: 4px;
}

/* Úprava stylů pro text v modálním okně (aby seznam vypadal čistě) */
.modal-box ul,
.modal-box ol {
  padding-left: 20px;
  margin: 12px 0;
  color: var(--ink-soft);
  font-size: 14px;
  line-height: 1.6;
}
.modal-box ul li,
.modal-box ol li {
  margin-bottom: 8px;
}
button.btn.btn-ghost.btn-lg {
  border: var(--border-hairline);
  color: var(--sage-dark);
  background: rgba(250, 246, 239, 0.75);
}
button.btn.btn-text.btn-lg {
  border: none;
  color: var(--blue-grey-dark);
  background: transparent;
  box-shadow: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* ==========================================================================
   PIN OCHRANA A ZAMYKACÍ OBRAZOVKA
   ========================================================================== */

/* Formulář v nastavení */
.pin-setup-box {
  background: var(--surface-2);
  padding: 14px;
  border-radius: var(--radius-md);
  margin-top: 4px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadeIn 0.2s ease-out;
}

.pin-input-row {
  display: flex;
  gap: 8px;
}

.pin-input-row .btn {
  flex-shrink: 0;
  min-height: 48px;
  padding: 0 16px;
}

.pin-input {
  letter-spacing: 0.3em;
  font-size: 18px;
  font-family: monospace;
}

/* Zamykací obrazovka (Lockscreen) */
.lockscreen-view {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 10000;
  width: 100%;
  max-width: 480px;
  transform: translateX(-50%);
  margin: 0;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px 20px calc(var(--safe-bottom) + 20px);
  padding-top: max(16px, var(--safe-top));
  box-sizing: border-box;
  overflow-x: clip;
  overflow-y: auto;
}

.lockscreen-content {
  width: 100%;
  max-width: 320px;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  animation: toastIn 0.3s ease-out;
}

.lockscreen-title {
  margin: 8px 0 4px;
  font-size: 24px;
  color: var(--ink);
}

.lockscreen-crisis-btn {
  margin-top: 20px;
  width: 100%;
  max-width: 320px;
}

.pin-large-input {
  margin-top: 24px;
  font-size: 28px;
  letter-spacing: 0.4em;
  text-align: center;
  font-family: monospace;
  padding: 16px;
  border-radius: var(--radius-md);
  height: 64px;
}

.color-danger {
  color: var(--danger) !important;
}

.forgot-pin-btn {
  margin-top: 40px;
}

/* ---------- UI Icons (SVG sprite, brand-visual) ---------- */
.ui-icon {
  display: block;
  color: var(--ink);
  flex-shrink: 0;
}
.ui-icon--inline {
  display: inline-block;
  vertical-align: -0.2em;
}
.ui-icon--xs { width: 16px; height: 16px; }
.ui-icon--sm { width: 20px; height: 20px; }
.ui-icon--md { width: 24px; height: 24px; }
.ui-icon--lg { width: 28px; height: 28px; }
.ui-icon--xl { width: 44px; height: 44px; }
.ui-icon--hero { width: 56px; height: 56px; }

.onb-icon,
.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.onb-icon .ui-icon,
.logo-mark .ui-icon {
  color: var(--sage-text);
}
.feature-icon,
.feature-emoji,
.privacy-icon,
.choice-emoji,
.call-emoji,
.crisis-tile-emoji,
.cta-emoji,
.infobox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.icon-btn .ui-icon { color: var(--ink-soft); }
.crisis-header .icon-btn .ui-icon { color: #faf6ef; }
.cta-checkin .ui-icon,
.fab-crisis .ui-icon { color: #faf6ef; }
.nav-item .ui-icon { color: var(--ink-soft); }
.btn .ui-icon { color: currentColor; }
.btn-danger .ui-icon { color: var(--danger); }
.field-label--icon {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.field-label--icon .ui-icon { color: var(--blue-grey-dark); }
.halt-check-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.halt-check-item .ui-icon {
  width: 22px;
  height: 22px;
  margin-top: 2px;
  color: var(--blue-grey-dark);
  flex-shrink: 0;
}
.craving-min .ui-icon,
.craving-max .ui-icon {
  color: var(--ink-soft);
}
.cta-arrow {
  display: inline-flex;
  align-items: center;
}
.cta-arrow .ui-icon { opacity: 0.85; }

.tool-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* CSP: šířka progress / skóre přes data atributy (bez inline style z JS) */
.score-ring[data-score="0"] { background: conic-gradient(var(--sage-dark) 0deg, var(--bg-soft) 0deg); }
.score-ring[data-score="5"] { background: conic-gradient(var(--sage-dark) 18deg, var(--bg-soft) 0deg); }
.score-ring[data-score="10"] { background: conic-gradient(var(--sage-dark) 36deg, var(--bg-soft) 0deg); }
.score-ring[data-score="15"] { background: conic-gradient(var(--sage-dark) 54deg, var(--bg-soft) 0deg); }
.score-ring[data-score="20"] { background: conic-gradient(var(--sage-dark) 72deg, var(--bg-soft) 0deg); }
.score-ring[data-score="25"] { background: conic-gradient(var(--sage-dark) 90deg, var(--bg-soft) 0deg); }
.score-ring[data-score="30"] { background: conic-gradient(var(--sage-dark) 108deg, var(--bg-soft) 0deg); }
.score-ring[data-score="35"] { background: conic-gradient(var(--sage-dark) 126deg, var(--bg-soft) 0deg); }
.score-ring[data-score="40"] { background: conic-gradient(var(--sage-dark) 144deg, var(--bg-soft) 0deg); }
.score-ring[data-score="45"] { background: conic-gradient(var(--sage-dark) 162deg, var(--bg-soft) 0deg); }
.score-ring[data-score="50"] { background: conic-gradient(var(--sage-dark) 180deg, var(--bg-soft) 0deg); }
.score-ring[data-score="55"] { background: conic-gradient(var(--sage-dark) 198deg, var(--bg-soft) 0deg); }
.score-ring[data-score="60"] { background: conic-gradient(var(--sage-dark) 216deg, var(--bg-soft) 0deg); }
.score-ring[data-score="65"] { background: conic-gradient(var(--sage-dark) 234deg, var(--bg-soft) 0deg); }
.score-ring[data-score="70"] { background: conic-gradient(var(--sage-dark) 252deg, var(--bg-soft) 0deg); }
.score-ring[data-score="75"] { background: conic-gradient(var(--sage-dark) 270deg, var(--bg-soft) 0deg); }
.score-ring[data-score="80"] { background: conic-gradient(var(--sage-dark) 288deg, var(--bg-soft) 0deg); }
.score-ring[data-score="85"] { background: conic-gradient(var(--sage-dark) 306deg, var(--bg-soft) 0deg); }
.score-ring[data-score="90"] { background: conic-gradient(var(--sage-dark) 324deg, var(--bg-soft) 0deg); }
.score-ring[data-score="95"] { background: conic-gradient(var(--sage-dark) 342deg, var(--bg-soft) 0deg); }
.score-ring[data-score="100"] { background: conic-gradient(var(--sage-dark) 360deg, var(--bg-soft) 0deg); }
.wizard-progress-bar[data-pct="0"] { width: 0%; }
.wizard-progress-bar[data-pct="5"] { width: 5%; }
.wizard-progress-bar[data-pct="10"] { width: 10%; }
.wizard-progress-bar[data-pct="15"] { width: 15%; }
.wizard-progress-bar[data-pct="20"] { width: 20%; }
.wizard-progress-bar[data-pct="25"] { width: 25%; }
.wizard-progress-bar[data-pct="30"] { width: 30%; }
.wizard-progress-bar[data-pct="35"] { width: 35%; }
.wizard-progress-bar[data-pct="40"] { width: 40%; }
.wizard-progress-bar[data-pct="45"] { width: 45%; }
.wizard-progress-bar[data-pct="50"] { width: 50%; }
.wizard-progress-bar[data-pct="55"] { width: 55%; }
.wizard-progress-bar[data-pct="60"] { width: 60%; }
.wizard-progress-bar[data-pct="65"] { width: 65%; }
.wizard-progress-bar[data-pct="70"] { width: 70%; }
.wizard-progress-bar[data-pct="75"] { width: 75%; }
.wizard-progress-bar[data-pct="80"] { width: 80%; }
.wizard-progress-bar[data-pct="85"] { width: 85%; }
.wizard-progress-bar[data-pct="90"] { width: 90%; }
.wizard-progress-bar[data-pct="95"] { width: 95%; }
.wizard-progress-bar[data-pct="100"] { width: 100%; }
.btn .ui-icon--inline {
  margin-right: 6px;
}