/* Ämtliplan-Seite (aemtliplan.html): Inhalt + Vorlage zum Ausdrucken */
.ap-hero { padding-top: 48px; }
.ap-crumbs { font-size: 14px; color: var(--quiet); }
.ap-crumbs a { color: var(--quiet); }
.ap-hero .pill { align-self: flex-start; }
.ap-hero .lead { max-width: none; }
.ap-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.narrow-in { max-width: 780px; }
.ap-note, .ap-small-text { font-size: 15px; color: var(--quiet); margin: 0; }
section p { margin: 0; }
section .stack > p:not(.lead) { color: var(--ink-2); font-size: 17px; }

/* Ämtli nach Alter */
.ap-ages { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; }
.ap-age { background: var(--sand); border-radius: 20px; padding: 18px 18px 14px; }
.ap-age h3 { font-size: 19px; }
.ap-age-sub { font-size: 14px; color: var(--quiet); margin: 2px 0 10px !important; }
.ap-age ul { margin: 0; padding-left: 18px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }

/* Schritte */
.ap-steps { margin: 0; padding: 0; list-style: none; counter-reset: s; display: flex; flex-direction: column; gap: 14px; }
.ap-steps li { counter-increment: s; position: relative; padding: 16px 18px 16px 64px; background: var(--white); border-radius: 20px; color: var(--ink-2); }
.ap-steps li::before { content: counter(s); position: absolute; left: 16px; top: 14px; width: 34px; height: 34px; border-radius: 50%; background: var(--sage-soft); color: var(--sage-dark); font-weight: 900; display: grid; place-items: center; }
.ap-steps strong { color: var(--ink); }

/* Werkzeug */
.ap-tool { display: grid; grid-template-columns: minmax(280px, 380px) 1fr; gap: 28px; align-items: start; }
.ap-form { display: flex; flex-direction: column; gap: 18px; }
.ap-form fieldset { border: 0; margin: 0; padding: 18px; background: var(--sand); border-radius: 20px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ap-form legend { float: left; width: 100%; padding: 0; font-weight: 900; font-size: 17px; margin-bottom: 4px; }
.ap-form input[type=text] { width: 100%; min-height: 46px; padding: 0 14px; border: 1.5px solid var(--line-2); border-radius: 12px; background: var(--white); font: inherit; color: var(--ink); }
.ap-form input[type=text]:focus { outline: 2px solid var(--sage); outline-offset: 1px; }
.ap-names { display: flex; flex-direction: column; gap: 8px; }
.ap-name { display: flex; gap: 8px; }
.ap-del { flex: none; width: 46px; min-height: 46px; border-radius: 12px; border: 1.5px solid var(--line-2); background: var(--white); color: var(--quiet); font-size: 20px; cursor: pointer; }
.ap-small { min-height: 44px; align-self: flex-start; }
.ap-hint { font-size: 14px; color: var(--quiet); margin: 0; }
.ap-group { margin-top: 6px; }
.ap-group b { display: block; font-size: 13px; color: var(--quiet); margin-bottom: 6px; }
.ap-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.ap-chip { min-height: 44px; padding: 0 14px; border-radius: 22px; border: 1.5px solid var(--line-2); background: var(--white); color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.ap-chip[aria-pressed=true] { background: var(--sage); border-color: var(--sage); color: var(--white); }
.ap-chip[aria-pressed=true]::before { content: '✓ '; }
.ap-own { display: flex; gap: 8px; margin-top: 6px; }
.ap-own .ap-small { flex: none; }
.ap-radio { display: flex; gap: 10px; align-items: flex-start; min-height: 44px; cursor: pointer; }
.ap-radio input { width: 22px; height: 22px; margin: 2px 0 0; accent-color: var(--sage); flex: none; }
.ap-radio small { display: block; color: var(--quiet); font-size: 14px; }
.ap-field { font-weight: 800; font-size: 15px; margin-top: 6px; }
.ap-buttons { display: flex; flex-wrap: wrap; gap: 10px; }
.ap-preview-wrap { position: sticky; top: 88px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.ap-preview { background: var(--sand); border-radius: 20px; padding: 14px; overflow: hidden; }
.ap-preview .ap-sheet { box-shadow: var(--shadow); border-radius: 6px; }

@media (max-width: 860px) {
  .ap-tool { grid-template-columns: 1fr; }
  .ap-preview-wrap { position: static; }
}

/* Das Blatt (Vorschau und Druck) – Masse in em, damit es mit der Schriftgrösse skaliert */
.ap-sheet { background: #fff; color: var(--ink); padding: 1.6em 1.8em; font-size: 10px; display: flex; flex-direction: column; gap: 1.2em; aspect-ratio: 297 / 210; }
.ap-sheet-head { display: flex; align-items: flex-end; gap: 1.5em; }
.ap-sheet-head h2 { font-size: 2.6em; letter-spacing: -.02em; line-height: 1; }
.ap-sheet-head span { font-size: 1.4em; color: var(--ink-2); }
.ap-sheet-week { margin-left: auto; font-size: 1.3em; color: var(--ink-2); white-space: nowrap; }
.ap-sheet-week i { display: inline-block; width: 9em; border-bottom: 1px solid var(--line-2); font-style: normal; }
.ap-sheet-head img { width: 3.2em; height: 3.2em; }
.ap-table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: fixed; flex: 1; font-size: 1.25em; }
.ap-table th, .ap-table td { border-bottom: 1px solid var(--line); padding: .35em .5em; text-align: center; vertical-align: middle; }
.ap-table thead th { background: var(--sage-soft); color: var(--sage-dark); font-weight: 900; border: 0; padding: .55em .4em; }
.ap-table thead th:first-child { border-radius: .6em 0 0 .6em; }
.ap-table thead th:last-child { border-radius: 0 .6em .6em 0; }
.ap-table th.ap-job { text-align: left; width: 26%; font-weight: 800; }
.ap-table td.ap-who { width: 13%; font-weight: 800; color: var(--sage-dark); }
.ap-table tbody tr:nth-child(even) td, .ap-table tbody tr:nth-child(even) th { background: var(--sage-tint); }
.ap-cell { display: flex; flex-direction: column; align-items: center; gap: .2em; }
.ap-cell small { font-size: .8em; font-weight: 800; color: var(--ink-2); line-height: 1.1; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ap-box { width: 1.5em; height: 1.5em; border: 1.5px solid var(--line-2); border-radius: .35em; background: #fff; }
.ap-blank { display: block; border-bottom: 1px solid var(--line-2); height: 1.2em; }
.ap-sheet-foot { display: flex; justify-content: space-between; font-size: 1.05em; color: var(--quiet); }

/* Druckblatt in echter Grösse (mm): unsichtbar ausserhalb des Bildschirms, damit vorlage.js die Schrift einpassen kann.
   Dieselben Masse gelten für die Vorschau (.ap-real, verkleinert per transform). */
#ap-print-out { position: fixed; left: -10000px; top: 0; visibility: hidden; pointer-events: none; }
.ap-real .ap-sheet { width: 297mm; height: 209mm; aspect-ratio: auto; padding: 11mm 13mm; font-size: 3.6mm; overflow: hidden; border-radius: 0; box-shadow: none; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
.ap-scale { position: relative; overflow: hidden; }
.ap-scale-in { position: absolute; left: 0; top: 0; transform-origin: top left; box-shadow: var(--shadow); }
.ap-sheet-foot { align-items: center; gap: 1.2em; }
.ap-sheet-foot > span:nth-child(2) { margin-left: auto; text-align: right; }
.ap-qr { display: flex; align-items: center; gap: .5em; flex: none; line-height: 1.2; }
.ap-qr img { width: 4.2em; height: 4.2em; }
.ap-qr span { display: flex; flex-direction: column; font-size: .9em; }
.ap-qr b { color: var(--ink); }

@media print {
  @page { size: A4 landscape; margin: 0; }
  body > :not(#ap-print-out) { display: none !important; }
  body { background: #fff !important; }
  #ap-print-out { position: static; left: auto; visibility: visible; display: block !important; }
}
/* Titel nie umbrechen (sonst wählt vorlage.js lieber eine kleinere Schrift); Fusstexte teilen sich den Platz */
.ap-sheet-head h2 { white-space: nowrap; }
.ap-sheet-foot > span:not(.ap-qr) { flex: 1 1 0; min-width: 0; }
