/* Parent mode: calm, adult, same visual family (lavender/mint/sun). Tablet-first. */
.screen--parent { padding-top: max(14px, env(safe-area-inset-top)); }
.parent { flex: 1; min-height: 0; display: flex; flex-direction: column; font-family: var(--font-nunito); color: var(--ink); }
.parent h1, .parent h2, .parent h3, .parent h4 { font-family: var(--font-fredoka); margin: 0; }
.pv-muted { color: var(--ink-soft); }

/* ---------- buttons / inputs ---------- */
.pv-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 52px; padding: 10px 20px; cursor: pointer;
  border: 2px solid #c9c1dc; border-radius: 16px; background: #fff; box-shadow: 0 3px 0 #c9c1dc; color: var(--ink);
  font: 700 17px/1.2 var(--font-nunito); touch-action: manipulation; transition: transform 100ms, box-shadow 100ms;
}
.pv-btn:active { transform: translateY(3px); box-shadow: 0 0 0 #c9c1dc; }
.pv-btn--primary { background: var(--lavender); border-color: #5f489e; box-shadow: 0 3px 0 #5f489e; color: #2f2546; }
.pv-btn--primary:active { box-shadow: 0 0 0 #5f489e; }
.pv-btn--danger { border-color: #a7637e; box-shadow: 0 3px 0 #a7637e; background: #fff3f6; color: #7d2c4a; }
.pv-btn--danger:active { box-shadow: 0 0 0 #a7637e; }
.pv-btn--back { padding-left: 12px; }
.pv-btn-icon { display: block; width: 24px; height: 24px; }
.pv-btn-icon .icon { width: 24px; height: 24px; display: block; }
.pv-seg[aria-pressed="true"], .pv-toggle[aria-checked="true"] { background: #e6f7f0; border-color: #4d977f; box-shadow: 0 3px 0 #4d977f; color: #1f5645; }
.pv-input { min-height: 52px; padding: 8px 14px; border: 2px solid #c9c1dc; border-radius: 14px; background: #fff; font: 600 18px var(--font-nunito); color: var(--ink); width: 220px; max-width: 100%; }
.pv-input--pin { width: 120px; letter-spacing: 0.3em; text-align: center; }
.pv-input:focus-visible, .pv-btn:focus-visible, .pv-tab:focus-visible, .pm-cell:focus-visible, .pd-swatch:focus-visible { outline: 3px solid var(--lavender-dark); outline-offset: 2px; }

/* ---------- PIN ---------- */
.parent--pin { align-items: center; justify-content: center; overflow-y: auto; }
.pin-box { display: flex; flex-direction: column; align-items: center; gap: 10px; margin: auto; padding: 8px 0; text-align: center; max-width: 440px; width: 100%; }
.pin-lock { width: 52px; height: 52px; color: var(--lavender-dark); }
.pin-lock .icon { width: 100%; height: 100%; }
.pin-box h1 { font-size: 30px; }
.pin-prompt { margin: 0; font-size: 19px; color: var(--ink-soft); }
.pin-dots { display: flex; gap: 18px; height: 34px; align-items: center; }
.pin-dot { width: 24px; height: 24px; border-radius: 50%; border: 3px solid var(--lavender-dark); background: #fff; transition: background 120ms, transform 120ms; }
.pin-dot.is-on { background: var(--lavender-dark); transform: scale(1.1); }
.pin-dots.is-shaking { animation: pin-shake 420ms cubic-bezier(.36,.07,.19,.97); }
@keyframes pin-shake { 15% { transform: translateX(-12px); } 35% { transform: translateX(10px); } 55% { transform: translateX(-7px); } 75% { transform: translateX(4px); } }
.pin-message { margin: 0; min-height: 24px; color: var(--rose-dark); font-weight: 700; font-size: 16px; }
.parent--pin .numeric-keypad { width: min(100%, 340px); gap: 10px; --key-size: 70px; }
.pin-note { margin: 6px 0 4px; font-size: 14px; color: var(--ink-soft); max-width: 340px; }

/* ---------- main frame ---------- */
.pv-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-bottom: 10px; }
.pv-title { display: flex; align-items: center; gap: 10px; }
.pv-title h1 { font-size: 28px; }
.pv-title-icon { width: 30px; height: 30px; color: var(--lavender-dark); }
.pv-title-icon .icon { width: 100%; height: 100%; display: block; }
.pv-tabs { display: flex; gap: 8px; padding: 6px; border-radius: 20px; background: rgb(255 255 255 / 0.7); border: 2px solid var(--line); overflow-x: auto; flex: none; }
.pv-tab { flex: 1 1 0; min-height: 52px; padding: 8px 14px; border: 0; border-radius: 14px; background: transparent; color: var(--ink-soft); font: 700 17px var(--font-nunito); cursor: pointer; white-space: nowrap; touch-action: manipulation; }
.pv-tab[aria-selected="true"] { background: var(--lavender); color: #2f2546; box-shadow: 0 3px 0 #5f489e; }
.pv-content { flex: 1; min-height: 0; overflow-y: auto; margin-top: 12px; padding: 2px 4px 24px 2px; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.pv-content:focus { outline: none; }
.pv-pane { animation: pane-in 0.3s ease both; }
.pv-stack { display: flex; flex-direction: column; gap: 16px; }
.pv-lead { margin: 0; font-size: 17px; color: var(--ink-soft); }
.pv-card { background: rgb(255 255 255 / 0.9); border: 2px solid var(--line); border-radius: 22px; padding: 18px 20px; box-shadow: 0 3px 0 rgb(var(--shadow-color) / 0.06); }
.pv-card h2 { font-size: 22px; margin-bottom: 12px; }
.pv-card h3 { font-size: 17px; }
.pv-badge { display: inline-block; margin-left: 10px; padding: 3px 10px; border-radius: 999px; background: #e6f7f0; color: #1f5645; font: 700 13px var(--font-nunito); vertical-align: middle; }
.pv-badge.is-locked { background: #ece9f3; color: #5d5670; }

/* ---------- Übersicht ---------- */
.pv-goals { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.pv-goal { padding: 14px 16px; border-radius: 18px; background: var(--surface-soft); border: 2px solid transparent; }
.pv-goal.is-next { border-color: var(--lavender); }
.pv-goal-skill { font: 700 14px var(--font-nunito); color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.06em; }
.pv-goal-group { font: 700 24px var(--font-fredoka); margin: 2px 0 10px; }
.pv-bar { height: 12px; border-radius: 99px; background: #e5defa; overflow: hidden; }
.pv-bar span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--mint), #5fc2a4); }
.pv-goal-sub { margin-top: 6px; font-size: 15px; color: var(--ink-soft); }
.pv-goal-next { margin-top: 8px; font: 700 14px var(--font-nunito); color: var(--lavender-dark); }
.pv-weeks { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px 18px; }
.pv-week { padding: 10px 12px 6px; border-radius: 18px; background: var(--surface-soft); min-width: 0; }
.pv-week h3 { margin-bottom: 4px; color: var(--ink-soft); font-size: 15px; }
.pv-week.is-full { background: #f3f9ee; }
.pv-week .rainbow-week { max-width: 100%; }
.pv-table-wrap { overflow-x: auto; }
.pv-table { width: 100%; border-collapse: collapse; font-size: 16px; }
.pv-table th { text-align: left; padding: 8px 10px; font: 700 13px var(--font-nunito); text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-soft); border-bottom: 2px solid var(--line); white-space: nowrap; }
.pv-table td { padding: 10px; border-bottom: 1px solid #eee9f6; vertical-align: top; }
.pv-table tr:last-child td { border-bottom: 0; }
.pv-table .c-date, .pv-table .c-duration { white-space: nowrap; }
.pv-table .c-errors, .pv-table .c-help { text-align: center; font-variant-numeric: tabular-nums; }
.pv-table td.has-value { font-weight: 800; color: var(--rose-dark); }
.pv-table td.c-help.has-value { color: #7a5a14; }
.pv-table th.c-errors, .pv-table th.c-help { text-align: center; }
.pv-skill { display: inline-block; padding: 2px 10px; border-radius: 999px; font-weight: 700; font-size: 14px; background: #ece6ff; color: #4b3a86; }
.pv-skill--add { background: #fff1cc; color: #6b5217; }
.pv-chip { display: inline-block; margin: 0 6px 4px 0; padding: 2px 9px; border-radius: 10px; background: #fff0f4; border: 1px solid #f0c7d3; font: 700 14px var(--font-nunito); white-space: nowrap; }
.pv-table tr.is-wrong td { color: var(--rose-dark); }

/* ---------- Karte ---------- */
.pm-legend { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px 22px; font-size: 15px; }
.pm-legend li { display: flex; align-items: center; gap: 8px; }
.pm-sub { margin: -6px 0 10px; font-size: 14px; }
.pm-cell { --cell-bg: #fff; --cell-border: #c9c1dc; --cell-ink: var(--ink); }
.pm-cell.is-neu { --cell-bg: #f3f0fa; --cell-border: #cdc4e6; --cell-ink: #5d5670; }
.pm-cell.is-uebt { --cell-bg: #ffe9a8; --cell-border: #d9a93b; --cell-ink: #5a4310; }
.pm-cell.is-sicher { --cell-bg: #bfeadb; --cell-border: #4d977f; --cell-ink: #1f5645; }
.pm-cell.is-locked { --cell-bg: repeating-linear-gradient(135deg, #ebe8f0 0 6px, #f7f5fa 6px 12px); --cell-border: #c9c5d3; --cell-ink: #8b8499; }
button.pm-cell { appearance: none; min-height: 52px; min-width: 0; padding: 0 4px; border: 2px solid var(--cell-border); border-radius: 12px; background: var(--cell-bg); color: var(--cell-ink); font: 700 18px var(--font-atkinson); cursor: pointer; touch-action: manipulation; font-variant-numeric: tabular-nums; }
button.pm-cell.is-selected { outline: 3px solid var(--lavender-dark); outline-offset: 1px; }
button.pm-cell { position: relative; }
button.pm-cell--mul.is-sicher::after { content: "✓"; position: absolute; top: 2px; right: 5px; font-size: 10px; line-height: 1; }
.pm-swatch { display: inline-block; width: 26px; height: 26px; border: 2px solid var(--cell-border); border-radius: 8px; background: var(--cell-bg); flex: none; }
.pm-mul { display: grid; grid-template-columns: 52px repeat(10, minmax(0, 1fr)); gap: 6px; align-items: center; }
.pm-colhead, .pm-rowhead { text-align: center; font: 700 15px var(--font-nunito); color: var(--ink-soft); }
.pm-rowhead { font-size: 17px; color: var(--ink); }
.pm-empty { min-height: 52px; border-radius: 12px; background: repeating-linear-gradient(135deg, transparent 0 5px, #f1eef7 5px 6px); opacity: 0.6; }
.pm-stage { margin-top: 14px; }
.pm-stage h4 { font-size: 16px; margin-bottom: 8px; color: var(--ink-soft); }
.pm-cells { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 8px; }
button.pm-cell--add { font-size: 16px; white-space: nowrap; }
button.pm-cell--add.is-sicher { box-shadow: inset 0 -4px 0 rgb(77 151 127 / 0.35); }
.pm-easy { margin-top: 16px; }
.pm-easy summary { min-height: 48px; display: flex; align-items: center; cursor: pointer; font: 700 17px var(--font-nunito); color: var(--lavender-dark); }
.pm-detail { position: sticky; bottom: 0; z-index: 3; padding: 14px 18px; border-radius: 20px; background: #fff; border: 2px solid var(--lavender-dark); box-shadow: 0 -6px 24px rgb(var(--shadow-color) / 0.16); max-height: 46vh; overflow-y: auto; }
.pm-detail[hidden] { display: none; }
.pm-detail-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; margin-bottom: 8px; }
.pm-detail-head h3 { font-size: 24px; }
.pm-detail-meta { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: center; margin-top: 6px; font-size: 15px; color: var(--ink-soft); }
.pm-state { padding: 2px 10px; border-radius: 999px; border: 2px solid var(--cell-border); background: var(--cell-bg); color: var(--cell-ink); font-weight: 700; }
.pm-attempts { font-size: 15px; }

/* ---------- Demo / settings ---------- */
.pd-banner { display: flex; flex-direction: column; gap: 2px; margin-bottom: 16px; padding: 12px 16px; border-radius: 16px; background: #fff3c9; border: 2px dashed #d9a93b; color: #5a4310; font-size: 15px; }
.pd-banner strong { font: 800 19px var(--font-nunito); }
.pd-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px 22px; }
.pd-block { display: flex; flex-direction: column; gap: 8px; align-items: flex-start; min-width: 0; padding: 4px 0 10px; }
.pd-block h3 { font-size: 18px; }
.pd-block p { margin: 0; font-size: 15px; }
.pd-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.pd-date { display: block; }
.pd-status { min-height: 20px; font-size: 15px; color: #1f5645; font-weight: 700; }
.pd-confirm { padding: 12px 14px; border-radius: 16px; background: #fff3f6; border: 2px solid #e8b9c8; }
.pd-confirm p { margin-bottom: 10px; font-weight: 700; }
.pd-swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.pd-swatch { width: 48px; height: 48px; border-radius: 50%; border: 3px solid #fff; background: var(--sw); box-shadow: 0 0 0 2px #c9c1dc; cursor: pointer; padding: 0; }
.pd-swatch[aria-pressed="true"] { box-shadow: 0 0 0 4px var(--lavender-dark); transform: scale(1.08); }
.pd-settings { margin-bottom: 8px; }

@media (max-width: 700px) {
  .pv-goals, .pv-weeks, .pd-grid { grid-template-columns: 1fr; }
  .pv-title h1 { font-size: 22px; }
  .pm-mul { grid-template-columns: 38px repeat(10, minmax(0, 1fr)); gap: 3px; }
  button.pm-cell--mul { font-size: 13px; min-height: 40px; border-radius: 8px; }
  button.pm-cell--mul.is-sicher::after { display: none; }
  .pm-cells { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
  .pv-tabs { gap: 4px; padding: 4px; }
  .pv-tab { flex: 1 1 auto; padding: 6px 4px; font-size: 14px; }
}
