:root {
  --ink: #19323c;
  --muted: #657781;
  --paper: #fffdf9;
  --blue: #167a93;
  --blue-soft: #dff2f3;
  --coral: #ef6b55;
  --coral-soft: #fff0e9;
  --line: #dce7e7;
  --shadow: 0 18px 55px rgba(42, 77, 80, .11);
  /* Editorial serif similar to the supplied AI Radar reference.
     Uses native system fonts only, so the planner has no external font dependency. */
  --font-display: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", serif;
}
/* V2: svátky, jmeniny, délka aktivit a opakování */
.parent-links { display: flex; align-items: center; gap: 4px; }
.week-activities { display: grid; grid-template-columns: repeat(7,minmax(0,1fr)); gap: 9px; }
.activity-day { min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
.activity-day > header { min-height: 84px; padding: 12px; border-bottom: 1px solid var(--line); background: #f0f7f6; }
.activity-day h3 { display: flex; justify-content: space-between; gap: 5px; margin: 0; font-size: 13px; }
.activity-day h3 span { color: var(--muted); font-size: 10px; font-weight: 500; }
.activity-list { display: grid; gap: 6px; padding: 7px; }
.activity-day .activity-card { min-height: 0; padding: 7px; }
.activity-day .activity-card time { display: block; margin-bottom: 3px; color: var(--blue); font-size: 10px; font-weight: 900; }
.activity-day .activity-card strong { white-space: normal; }
.activity-card.is-recurring { border-left-color: #7767b9; background: #f0ecfb; }
.activity-card.is-recurring small { display: block; margin-top: 4px; color: #7767b9; font-size: 8px; font-weight: 800; }
.calendar-meta { display: grid; gap: 3px; margin: 6px 0 9px; }
.holiday-badge, .nameday-badge { display: block; font-size: 8px; line-height: 1.25; }
.holiday-badge { color: #a44131; }
.nameday-badge { color: #657781; font-weight: 700; }
.is-holiday { border-color: #efb4a8; }
.is-holiday > header { background: #fff1ed; }
.school-day .calendar-meta { min-height: 22px; margin-top: -6px; }
.event-editor-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 24px; border-bottom: 1px solid var(--line); background: #f8fbfa; }
.event-editor-toolbar p { margin: 0; color: #7767b9; font-size: 11px; font-weight: 700; }
.event-editor-list { display: grid; gap: 8px; padding: 14px 18px; }
.event-editor-row { display: grid; grid-template-columns: 100px 100px minmax(180px,1fr) minmax(150px,.8fr) 38px; gap: 8px; align-items: end; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: #fbfdfd; }
.event-editor-row label span, .recurring-form label > span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.event-editor-row input, .event-editor-row select, .recurring-form input, .recurring-form select { width: 100%; height: 40px; padding: 0 9px; border: 1px solid #d9e4e4; border-radius: 9px; background: white; color: var(--ink); }
.remove-event, .delete-button { height: 40px; border: 1px solid #f0c7bf; border-radius: 9px; background: #fff2ef; color: #ad4938; cursor: pointer; font-size: 21px; font-weight: 900; }
.empty-editor { margin: 0; padding: 24px; color: var(--muted); text-align: center; }
.recurring-layout { display: grid; grid-template-columns: minmax(350px,.8fr) minmax(420px,1.2fr); gap: 18px; margin-top: 24px; }
.recurring-form { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; padding: 0 24px 24px; }
.recurring-form .wide { grid-column: 1 / -1; }
.recurring-list { display: grid; gap: 9px; padding: 0 18px 18px; }
.recurring-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px; border: 1px solid var(--line); border-radius: 14px; }
.recurring-item.inactive { opacity: .55; }
.recurring-item strong, .recurring-item small, .recurring-when { display: block; }
.recurring-item strong { margin: 3px 0; }
.recurring-item small { color: var(--muted); font-size: 10px; }
.recurring-when { color: #7767b9; font-size: 10px; font-weight: 900; }
.recurring-actions { display: flex; gap: 6px; }
.delete-button { padding: 0 11px; font-size: 12px; }
.error-text { color: #a83d2d !important; }

@media (max-width: 980px) {
  .week-activities { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .event-editor-row { grid-template-columns: 90px 90px 1fr 1fr 38px; }
  .recurring-layout { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .parent-links { display: grid; grid-template-columns: 1fr 1fr; }
  .week-activities { grid-template-columns: 1fr; }
  .activity-day > header { min-height: 0; }
  .event-editor-toolbar { padding: 10px 12px; }
  .event-editor-list { padding: 10px; }
  .event-editor-row { grid-template-columns: 1fr 1fr 38px; }
  .event-editor-row label:nth-child(3), .event-editor-row label:nth-child(4) { grid-column: 1 / 3; }
  .event-editor-row .remove-event { grid-column: 3; grid-row: 1; }
  .recurring-form { padding: 0 14px 18px; }
  .recurring-item { align-items: stretch; flex-direction: column; }
}
@media print {
  .week-activities { grid-template-columns: repeat(7,minmax(0,1fr)); gap: 1mm; }
  .activity-day > header { min-height: 18mm; padding: 1.5mm; }
  .activity-day h3 { font-size: 8px; }
  .calendar-meta { margin: 1mm 0; }
  .holiday-badge, .nameday-badge { font-size: 5.5px; }
  .activity-list { gap: 1mm; padding: 1mm; }
  .activity-day .activity-card { padding: 1mm; }
  .activity-day .activity-card time, .activity-day .activity-card strong { font-size: 6px; }
  .activity-day .activity-card span, .activity-card.is-recurring small { font-size: 5px; }
}
/* V3: rozšířený rodinný plánovač */
.admin-quick-links { display:flex; flex-wrap:wrap; gap:7px; margin:0 0 16px; }
.admin-quick-links a { padding:9px 12px; border:1px solid var(--line); border-radius:10px; color:var(--blue); background:white; font-size:12px; font-weight:800; text-decoration:none; }
.school-break-badge { color:#7767b9; font-size:8px; }
.event-editor-row { grid-template-columns:90px 90px minmax(180px,1fr) minmax(150px,1fr) 38px; }
.event-editor-row label:nth-child(5), .event-editor-row label:nth-child(6), .event-editor-row label:nth-child(7) { grid-column:span 1; }
.event-editor-row .remove-event { grid-column:5; grid-row:1; }
.conflict-note { align-self:center; color:#b23d2b; font-size:11px; }
.event-editor-row select { width:100%; height:40px; padding:0 8px; border:1px solid #d9e4e4; border-radius:9px; background:white; }
.event-editor-toolbar p a { color:#62558f; }
.activity-card { border-left-color:var(--category-color,var(--blue)); }
.category-skola { --category-color:#3f7ab8; }
.category-sport { --category-color:#4f9366; }
.category-krouzek { --category-color:#7767b9; }
.category-lekar { --category-color:#c04f78; }
.category-rodina { --category-color:#bf7a27; }
.category-ostatni { --category-color:#167a93; }
.has-conflict { outline:2px solid #e34d37; background:#fff0ed !important; }
.recurring-scope { display:grid; grid-template-columns:1fr 1fr; gap:10px; padding:12px; border:1px solid #d9d1ef; border-radius:12px; background:#f5f2fc; }
.recurring-scope[hidden] { display:none; }
.recurring-scope > strong { grid-column:1/-1; color:#62558f; }
.today-content { display:grid; gap:16px; margin-top:24px; }
.today-hero { padding:24px; border-radius:22px; color:white; background:linear-gradient(135deg,#167a93,#65b8b3); text-align:center; }
.today-hero p { margin:0 0 7px; font-size:18px; font-weight:900; text-transform:capitalize; }
.today-hero strong,.today-hero span { display:block; }
.today-columns { display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.today-columns > article { padding:18px; border:1px solid var(--line); border-radius:18px; background:white; }
.today-item { display:grid; gap:3px; margin-top:8px; padding:12px; border-left:5px solid var(--category-color,var(--coral)); border-radius:10px; background:#f8fbfa; }
.today-item time { color:var(--blue); font-weight:900; }
.today-item span { color:var(--muted); font-size:12px; }
.today-footer { text-align:center; }
.today-footer a { color:var(--blue); font-weight:900; }
.shared-form { margin-top:24px; }
.child-checks { display:flex; flex-wrap:wrap; gap:9px; margin:0; padding:0 24px 18px; border:0; }
.child-checks label { padding:10px 14px; border:1px solid var(--line); border-radius:10px; background:#f8fbfa; font-weight:800; }
.shared-fields { display:grid; grid-template-columns:repeat(4,1fr); gap:12px; padding:18px 24px; border-top:1px solid var(--line); }
.shared-fields label span { display:block; margin-bottom:5px; color:var(--muted); font-size:10px; font-weight:800; }
.shared-fields input,.shared-fields select { width:100%; height:40px; padding:0 9px; border:1px solid #d9e4e4; border-radius:9px; background:white; }
.shared-fields .wide { grid-column:span 2; }
.trash-list { margin-top:24px; padding:12px; }
.trash-item { display:flex; align-items:center; justify-content:space-between; gap:12px; padding:12px; border-bottom:1px solid var(--line); }
.trash-item span { display:block; margin-top:3px; color:var(--muted); font-size:10px; }
.trash-item > div:last-child { display:flex; gap:6px; }

@media(max-width:760px){
  .today-columns { grid-template-columns:1fr; }
  .shared-fields { grid-template-columns:1fr 1fr; padding:14px; }
  .shared-fields .wide { grid-column:1/-1; }
  .event-editor-row { grid-template-columns:1fr 1fr 38px; }
  .event-editor-row label:nth-child(n+3) { grid-column:1/3; }
  .event-editor-row .remove-event { grid-column:3; grid-row:1; }
  .recurring-scope { grid-template-columns:1fr; }
  .trash-item { align-items:stretch; flex-direction:column; }
}
@media print{
  .admin-quick-links { display:none!important; }
}



.chooser-page { min-height: 100vh; background: radial-gradient(circle at 10% 5%, rgba(239,107,85,.2), transparent 26rem), radial-gradient(circle at 95% 15%, rgba(22,122,147,.18), transparent 28rem), #eaf3f2; }
.chooser-shell { width: min(1050px, calc(100% - 32px)); margin: 0 auto; padding: 70px 0; }
.chooser-header { max-width: 640px; margin: 0 auto 38px; text-align: center; }
.chooser-header .brand-mark { margin: 0 auto 18px; }
.chooser-header h1 { margin-bottom: 10px; font-size: clamp(34px, 6vw, 62px); }
.chooser-intro { margin-bottom:0; color: var(--muted); font-size: 17px; line-height: 1.6; }
.chooser-datetime { display:inline-flex; align-items:center; gap:14px; margin-top:20px; padding:12px 20px; border:1px solid rgba(255,255,255,.9); border-radius:18px; background:rgba(255,255,255,.82); box-shadow:0 12px 32px rgba(42,77,80,.12); backdrop-filter:blur(8px); }
.chooser-date { color:var(--ink); font-size:16px; font-weight:900; }
.chooser-datetime > span { color:#9eb1b3; font-size:18px; }
.chooser-clock { min-width:112px; color:var(--blue); font-family:ui-monospace,SFMono-Regular,Consolas,monospace; font-size:25px; font-variant-numeric:tabular-nums; font-weight:900; letter-spacing:.04em; }
.children-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 22px; }
.child-card { width: min(270px, 100%); padding: 18px 18px 22px; border: 1px solid rgba(255,255,255,.85); border-radius: 26px; background: white; box-shadow: var(--shadow); color: var(--ink); text-align: center; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease; }
.child-card:hover { transform: translateY(-5px) rotate(-.5deg); box-shadow: 0 25px 65px rgba(42,77,80,.18); }
.photo-wrap { width: 100%; aspect-ratio: 1 / 1; display: block; overflow: hidden; margin-bottom: 17px; border-radius: 20px; background: var(--blue-soft); }
.photo-wrap img { width: 100%; height: 100%; object-fit: cover; }
.photo-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: white; background: linear-gradient(135deg, var(--blue), #65b8b3); font-size: 92px; font-weight: 900; }
.child-card.color-2 .photo-fallback { background: linear-gradient(135deg, var(--coral), #f7ad72); }
.child-card.color-3 .photo-fallback { background: linear-gradient(135deg, #7767b9, #b395d6); }
.child-card.color-4 .photo-fallback { background: linear-gradient(135deg, #4f9366, #8ac58c); }
.child-card.color-5 .photo-fallback { background: linear-gradient(135deg, #bf7a27, #edbd54); }
.child-card strong { display: block; margin-bottom: 6px; font-size: 24px; }
.child-card > span:last-child { color: var(--blue); font-size: 12px; font-weight: 800; }
.empty-state { max-width: 650px; margin: 20px auto; padding: 35px; border: 1px solid var(--line); border-radius: 22px; background: white; text-align: center; }
.empty-state h2 { margin-bottom: 8px; }
.empty-state p { margin-bottom: 0; color: var(--muted); }
.empty-state.error { color: #9b3326; background: #fff2ef; }
.back-link { width: 40px; height: 40px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--blue); font-size: 24px; text-decoration: none; }
.avatar-small, .avatar-medium { display: grid; place-items: center; overflow: hidden; color: white; background: var(--coral); font-weight: 900; }
.avatar-small { width: 50px; height: 50px; border-radius: 16px; font-size: 22px; }
.avatar-medium { width: 58px; height: 58px; border-radius: 16px; font-size: 24px; }
.avatar-small img, .avatar-medium img { width: 100%; height: 100%; object-fit: cover; }

.admin-nav { display: flex; gap: 8px; margin: 25px 0 18px; padding: 5px; border-radius: 16px; background: #eaf2f1; }
.admin-nav button { flex: 1; padding: 12px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.admin-nav button.active { color: var(--ink); background: white; box-shadow: 0 5px 15px rgba(38,72,75,.09); }
.children-admin-list { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; padding: 0 24px 20px; }
.child-admin-card { display: grid; grid-template-columns: 58px 1fr auto; align-items: center; gap: 12px; padding: 12px; border: 1px solid var(--line); border-radius: 16px; }
.child-admin-card.inactive { opacity: .58; }
.child-admin-card strong, .child-admin-card small { display: block; }
.child-admin-card small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.secondary-button { padding: 10px 13px; border: 1px solid var(--line); border-radius: 10px; background: white; color: var(--blue); cursor: pointer; font-weight: 800; }
.child-form { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 20px 24px 24px; border-top: 1px solid var(--line); background: #f8fbfa; }
.child-form label > span, .child-select > span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 11px; font-weight: 800; }
.child-form input[type="text"], .child-form input:not([type]), .child-form select, .child-select select { width: 100%; min-height: 42px; padding: 8px 11px; border: 1px solid #d9e4e4; border-radius: 10px; background: white; color: var(--ink); }
.child-form input[type="file"] { width: 100%; min-height: 42px; padding: 8px; border: 1px dashed #b9cccc; border-radius: 10px; background: white; }
.check-label { grid-column: 1 / -1; display: flex; align-items: center; gap: 8px; }
.check-label span { margin: 0 !important; }
.form-actions { grid-column: 1 / -1; display: flex; justify-content: flex-end; gap: 9px; }
.form-message { grid-column: 1 / -1; margin: 0; color: #35715f; font-size: 12px; text-align: right; }
.error-text { color: #a83d2d !important; }
.child-select { min-width: 170px; }
.child-select select { font-weight: 800; }
.place-input > span { position: absolute; top: 9px; left: 11px; z-index: 1; color: #839399; }

@media (max-width: 760px) {
  .chooser-shell { padding: 40px 0; }
  .chooser-datetime { width:100%; max-width:310px; justify-content:center; gap:9px; padding:11px 13px; }
  .chooser-date { font-size:13px; }
  .chooser-clock { min-width:95px; font-size:20px; }
  .children-grid { gap: 14px; }
  .child-card { width: calc(50% - 8px); padding: 10px 10px 16px; border-radius: 19px; }
  .photo-wrap { margin-bottom: 10px; border-radius: 14px; }
  .child-card strong { font-size: 18px; }
  .child-card > span:last-child { font-size: 10px; }
  .photo-fallback { font-size: 60px; }
  .children-admin-list { grid-template-columns: 1fr; padding: 0 14px 16px; }
  .child-form { grid-template-columns: 1fr; padding: 16px 14px; }
  .child-form > *, .check-label, .form-actions, .form-message { grid-column: 1; }
  .parent-top .child-select { display: block; margin: 16px 0; }
  .child-admin-card { grid-template-columns: 50px 1fr auto; }
  .avatar-medium { width: 50px; height: 50px; }
}

* { box-sizing: border-box; }
html { background: #e9f2f1; }
body { margin: 0; color: var(--ink); font-family: Arial, Helvetica, sans-serif; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
svg { width: 20px; height: 20px; flex: 0 0 auto; }

.planner-shell { min-height: 100vh; padding: 28px; background:
  radial-gradient(circle at 8% 4%, rgba(239,107,85,.18), transparent 24rem),
  radial-gradient(circle at 95% 18%, rgba(22,122,147,.16), transparent 28rem),
  #eaf3f2; }
.planner-page { max-width: 1460px; margin: 0 auto; padding: 28px 34px 22px; border: 1px solid rgba(255,255,255,.8); border-radius: 30px; background: rgba(255,253,249,.93); box-shadow: var(--shadow); }
.app-header { display: flex; align-items: center; gap: 16px; }
.brand-mark { width: 50px; height: 50px; display: grid; place-items: center; border-radius: 16px; color: white; background: var(--coral); box-shadow: 0 10px 20px rgba(239,107,85,.25); transform: rotate(-3deg); }
.brand-mark span { font-size: 26px; font-weight: 900; transform: rotate(3deg); }
.eyebrow { margin: 0 0 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
h1, h2, h3, p { margin-top: 0; }
/* V9: editorial display typography inspired by AI Radar */
h1, h2,
.school-day h3, .mobile-day h3, .activity-day h3,
.child-card strong {
  font-family: var(--font-display);
  font-weight: 700;
}
h1 { margin-bottom: 0; font-size: clamp(25px, 3vw, 38px); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-size: 24px; line-height: 1.12; letter-spacing: -.025em; }

.week-controls { display: flex; align-items: stretch; justify-content: center; gap: 8px; margin: 26px 0 30px; }
.icon-button, .week-button, .print-button, .copy-button, .viewer-link { border: 1px solid var(--line); background: white; border-radius: 14px; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease; }
.icon-button:hover, .week-button:hover, .print-button:hover, .copy-button:hover, .viewer-link:hover { transform: translateY(-1px); border-color: #b8cccc; box-shadow: 0 8px 20px rgba(36, 83, 87, .09); }
.icon-button { width: 48px; display: grid; place-items: center; }
.week-button { min-width: 250px; min-height: 52px; padding: 8px 18px; display: flex; align-items: center; justify-content: center; gap: 10px; }
.week-button svg { color: var(--blue); }
.week-button span { display: flex; flex-direction: column; align-items: flex-start; font-weight: 800; }
.week-button small { color: var(--muted); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.print-button { padding: 0 18px; display: flex; align-items: center; gap: 8px; margin-left: 8px; color: white; border-color: var(--blue); background: var(--blue); font-weight: 800; }
.print-week { display: none; }

.section-heading { display: flex; align-items: center; gap: 12px; margin-bottom: 13px; }
.section-icon { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 13px; }
.section-icon.coral { color: var(--coral); background: var(--coral-soft); }
.section-icon.blue { color: var(--blue); background: var(--blue-soft); }
.school-section { margin-bottom: 32px; }
.school-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.school-day { min-height: 175px; padding: 15px; border: 1px solid #eaded5; border-radius: 16px; background: linear-gradient(180deg, #fffaf6, #fff); }
.school-day h3, .mobile-day h3 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; font-size: 15px; }
.school-day h3 span, .mobile-day h3 span { color: var(--muted); font-size: 12px; font-weight: 500; }
.subject-list { display: grid; gap: 6px; }
.subject { display: grid; grid-template-columns: 23px 1fr; gap: 1px 5px; padding-bottom: 5px; border-bottom: 1px dashed #eaded5; }
.subject:last-child { border-bottom: 0; }
.period { grid-row: 1 / 3; width: 23px; height: 23px; display: grid; place-items: center; color: var(--coral); background: var(--coral-soft); border-radius: 7px; font-size: 11px; font-weight: 900; }
.subject strong { overflow: hidden; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.subject small { overflow: hidden; color: var(--muted); font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.empty-small { color: #8b989e; font-size: 12px; line-height: 1.45; }

.activity-table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 18px; background: white; }
.activity-table { width: 100%; min-width: 1060px; border-collapse: separate; border-spacing: 0; table-layout: fixed; }
.activity-table th, .activity-table td { border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.activity-table tr > *:last-child { border-right: 0; }
.activity-table tbody tr:last-child > *, .activity-table tfoot tr:last-child > * { border-bottom: 0; }
.activity-table thead th { height: 57px; color: var(--ink); background: #f4f9f8; }
.activity-table thead th:first-child, .activity-table tbody th, .activity-table tfoot th { width: 58px; color: var(--muted); background: #f8fbfa; font-size: 11px; }
.activity-table thead th strong, .activity-table thead th span { display: block; }
.activity-table thead th span { margin-top: 3px; color: var(--muted); font-size: 10px; font-weight: 500; }
.activity-table td { height: 43px; padding: 3px; vertical-align: top; }
.activity-table td.has-activity { background: #e8f5f5; }
.activity-card { min-height: 35px; padding: 5px 7px; border-left: 3px solid var(--blue); border-radius: 6px; background: #dff1f2; }
.activity-card strong { display: block; overflow: hidden; color: #145c6d; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.activity-card span, .mobile-activity span { display: flex; align-items: center; gap: 3px; overflow: hidden; margin-top: 2px; color: #51737a; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
.activity-card svg, .mobile-activity svg { width: 11px; height: 11px; }
.activity-table tfoot th, .activity-table tfoot td { min-height: 42px; padding: 9px 6px; color: #6d5a4b; background: #fff8ec; font-size: 10px; vertical-align: top; }
.mobile-days { display: none; }
footer { padding-top: 18px; color: var(--muted); font-size: 11px; text-align: center; }
.status-card { padding: 40px; border: 1px solid var(--line); border-radius: 18px; background: white; color: var(--muted); text-align: center; }
.status-card.error { color: #9b3326; background: #fff2ef; }

.parent-shell .planner-page { max-width: 1050px; }
.parent-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.parent-top .week-controls { margin: 24px 0; }
.viewer-link { padding: 13px 16px; color: var(--blue); font-size: 13px; font-weight: 800; text-decoration: none; }
.mode-tabs { display: flex; gap: 8px; margin: 4px 0 16px; padding: 5px; border-radius: 16px; background: #eaf2f1; }
.mode-tabs button { flex: 1; padding: 12px; display: flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 12px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 800; }
.mode-tabs button.active { color: var(--ink); background: white; box-shadow: 0 5px 15px rgba(38,72,75,.09); }
.editor-card { overflow: hidden; border: 1px solid var(--line); border-radius: 22px; background: white; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 22px 24px; }
.copy-button { padding: 10px 13px; color: var(--blue); font-size: 12px; font-weight: 800; }
.copy-button:disabled, .save-button:disabled { opacity: .6; cursor: wait; }
.day-tabs { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; padding: 6px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: #f4f8f7; }
.day-tabs.five { grid-template-columns: repeat(5, 1fr); }
.day-tabs button { padding: 9px 4px; border: 1px solid transparent; border-radius: 10px; background: transparent; color: var(--muted); cursor: pointer; }
.day-tabs button span, .day-tabs button small { display: block; }
.day-tabs button span { font-weight: 900; }
.day-tabs button small { margin-top: 2px; font-size: 10px; }
.day-tabs button.active { color: white; border-color: var(--blue); background: var(--blue); box-shadow: 0 5px 12px rgba(22,122,147,.2); }
.editor-grid { padding: 8px 18px; }
.editor-grid-head, .editor-row { display: grid; grid-template-columns: 65px minmax(200px, 1.2fr) minmax(160px, .8fr); gap: 10px; align-items: center; }
.editor-grid-head { padding: 8px 10px 5px; color: var(--muted); font-size: 10px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.editor-row { min-height: 51px; padding: 5px 10px; border-top: 1px solid #edf2f2; }
.editor-row time { color: var(--blue); font-size: 13px; font-weight: 900; }
.editor-row input, .note-field input { width: 100%; height: 38px; padding: 0 12px; border: 1px solid #d9e4e4; border-radius: 10px; outline: none; background: #fbfdfd; color: var(--ink); }
.editor-row input:focus, .note-field input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(22,122,147,.10); }
.place-input { position: relative; }
.place-input svg { position: absolute; top: 10px; left: 10px; width: 17px; height: 17px; color: #839399; }
.place-input input { padding-left: 34px; }
.note-field { display: block; padding: 13px 28px 19px; border-top: 1px solid var(--line); background: #fffaf0; }
.note-field span { display: block; margin-bottom: 7px; color: #876e56; font-size: 11px; font-weight: 800; }
.note-field input { background: white; }
.save-bar { min-height: 70px; display: flex; align-items: center; justify-content: flex-end; gap: 20px; padding: 12px 24px; border-top: 1px solid var(--line); background: #f4f8f7; color: #35715f; font-size: 12px; font-weight: 700; }
.save-error { color: #a83d2d; }
.save-button { min-width: 170px; padding: 12px 18px; border: 0; border-radius: 12px; color: white; background: var(--coral); box-shadow: 0 8px 18px rgba(239,107,85,.22); cursor: pointer; font-weight: 900; }
.school-editor .editor-row time { display: flex; align-items: center; gap: 8px; }
.school-editor .editor-row time strong { font-size: 16px; }
.school-editor .editor-row time small { color: var(--muted); font-size: 9px; font-weight: 500; }
.parent-note { margin: 14px 0 0; color: var(--muted); font-size: 11px; text-align: center; }

@media (max-width: 760px) {
  .planner-shell { padding: 0; }
  .planner-page { min-height: 100vh; padding: 20px 16px; border: 0; border-radius: 0; box-shadow: none; }
  .app-header { gap: 11px; }
  .brand-mark { width: 43px; height: 43px; border-radius: 13px; }
  h1 { font-size: 24px; }
  .week-controls { margin: 20px 0 24px; }
  .week-button { min-width: 0; flex: 1; padding: 7px 10px; }
  .print-button { width: 48px; padding: 0; justify-content: center; margin-left: 0; font-size: 0; }
  .activity-table-wrap { display: none; }
  .school-grid { grid-template-columns: 1fr; }
  .mobile-days { display: grid; gap: 12px; }
  .mobile-day { overflow: hidden; border: 1px solid var(--line); border-radius: 16px; background: white; }
  .mobile-day h3 { margin: 0; padding: 13px 14px; background: #f0f7f6; }
  .mobile-school { display: flex; flex-wrap: wrap; gap: 5px; padding: 10px 13px; border-bottom: 1px solid var(--line); }
  .mobile-school span { padding: 4px 7px; border-radius: 7px; color: #9a4b3d; background: var(--coral-soft); font-size: 10px; font-weight: 700; }
  .mobile-activity { display: grid; grid-template-columns: 52px 1fr; gap: 8px; padding: 10px 13px; border-bottom: 1px solid #edf2f2; }
  .mobile-activity time { color: var(--blue); font-size: 12px; font-weight: 900; }
  .mobile-activity strong { display: block; font-size: 13px; }
  .free-day { margin: 0; padding: 13px; color: #8a989e; font-size: 12px; }
  .day-note { margin: 0; padding: 10px 13px; color: #715f4e; background: #fff8ec; font-size: 11px; }
  .parent-top { display: block; }
  .parent-top .week-controls { margin-bottom: 10px; }
  .viewer-link { display: block; margin-bottom: 16px; text-align: center; }
  .mode-tabs button { font-size: 12px; }
  .editor-heading { display: block; padding: 18px; }
  .copy-button { width: 100%; margin-top: 13px; }
  .day-tabs { overflow-x: auto; display: flex; }
  .day-tabs button { min-width: 58px; flex: 1; }
  .day-tabs.five button { min-width: 80px; }
  .editor-grid { padding: 6px 9px; }
  .editor-grid-head { display: none; }
  .editor-row { grid-template-columns: 48px 1fr; gap: 6px; padding: 7px 5px; }
  .editor-row > .place-input, .school-editor .editor-row > input:last-child { grid-column: 2; }
  .editor-row input { height: 40px; }
  .school-editor .editor-row time { grid-row: 1 / 3; display: block; }
  .school-editor .editor-row time small { display: block; margin-top: 3px; }
  .note-field { padding: 13px 14px; }
  .save-bar { position: sticky; bottom: 0; padding: 10px 14px; }
  .save-button { min-width: 150px; }
}

/* V2.1: jasně oddělená školní výuka a historické verze rozvrhu */
.school-section { padding: 18px; border: 2px solid #f2c9bb; border-radius: 22px; background: linear-gradient(180deg,#fff6f0,#fffdfb); }
.activities-section { padding: 18px; border: 2px solid #bcdde1; border-radius: 22px; background: linear-gradient(180deg,#f2fbfb,#ffffff); }
.school-section .subject { padding: 5px 4px; border-left: 3px solid var(--subject-color,#ef6b55); border-bottom: 1px dashed #eaded5; border-radius: 5px; }
.school-section .subject .period { color: white; background: var(--subject-color,#ef6b55); }
.lesson-time { color: var(--subject-color,#ef6b55) !important; font-weight: 900; }
.teacher-name::before { content: 'Učitel: '; font-weight: 800; }
.holiday-cancelled { padding: 9px; border-radius: 9px; color: #9b3326; background: #fff0ec; font-weight: 800; }
.effective-date { min-width: 190px; }
.effective-date span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 10px; font-weight: 800; }
.effective-date input { width: 100%; height: 40px; padding: 0 10px; border: 1px solid #d9e4e4; border-radius: 9px; background: white; color: var(--ink); }
.school-version-note { margin: -8px 24px 16px; padding: 10px 12px; border-left: 3px solid #7767b9; border-radius: 8px; color: #62558f; background: #f3f0fb; font-size: 11px; }

@media (max-width:760px) {
  .school-section, .activities-section { padding: 12px; }
  .effective-date { margin-top: 12px; }
  .school-version-note { margin: -4px 14px 12px; }
}

@media print {
  @page { size: A4 landscape; margin: 7mm; }
  html, body, .planner-shell { background: white !important; }
  .planner-shell { min-height: 0; padding: 0; }
  .planner-page { max-width: none; padding: 0; border: 0; border-radius: 0; box-shadow: none; background: white; }
  .app-header { margin-bottom: 4mm; }
  .brand-mark { width: 34px; height: 34px; box-shadow: none; }
  .brand-mark span { font-size: 19px; }
  h1 { font-size: 22px; }
  h2 { font-size: 15px; }
  .eyebrow { font-size: 8px; }
  .no-print, footer { display: none !important; }
  .print-week { display: block; position: absolute; top: 2mm; right: 0; font-size: 11px; font-weight: 800; }
  .section-heading { margin-bottom: 2mm; }
  .section-icon { width: 28px; height: 28px; }
  .section-icon svg { width: 15px; height: 15px; }
  .school-section { margin-bottom: 4mm; }
  .school-grid { gap: 2mm; }
  .school-day { min-height: 28mm; padding: 2mm; border-radius: 2mm; }
  .school-day h3 { margin-bottom: 1mm; font-size: 10px; }
  .subject-list { gap: 0; }
  .subject { grid-template-columns: 15px 1fr; padding: 0; }
  .period { width: 14px; height: 14px; font-size: 7px; border-radius: 3px; }
  .subject strong { font-size: 7px; }
  .subject small { font-size: 6px; }
  .empty-small { font-size: 7px; }
  .activity-table-wrap { overflow: visible; border-radius: 2mm; }
  .activity-table { min-width: 0; }
  .activity-table thead th { height: 8mm; }
  .activity-table td { height: 6mm; padding: 1px; }
  .activity-table thead th:first-child, .activity-table tbody th, .activity-table tfoot th { width: 13mm; font-size: 7px; }
  .activity-card { min-height: 5mm; padding: 1px 3px; border-left-width: 2px; }
  .activity-card strong { font-size: 7px; }
  .activity-card span { font-size: 6px; }
  .activity-table tfoot td, .activity-table tfoot th { padding: 1mm; font-size: 6px; }
  .mobile-days { display: none !important; }
}
/* V4–V6: volba týdne, režimu a rychlého dne */
.week-picker-label { position:relative; cursor:pointer; }
.week-picker-label input[type="week"] { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.week-button small b { color:var(--blue); font-size:11px; }
.today-shortcut { min-height:48px; padding:0 12px; border:1px solid var(--line); border-radius:14px; color:var(--blue); background:white; cursor:pointer; font-weight:900; }
.viewer-mode-switch { display:flex; width:fit-content; max-width:100%; margin:0 auto 16px; padding:5px; border:1px solid var(--line); border-radius:15px; background:#eaf2f1; }
.viewer-mode-switch button { min-width:145px; padding:10px 16px; border:0; border-radius:10px; color:var(--muted); background:transparent; cursor:pointer; font-weight:900; }
.viewer-mode-switch button.active { color:white; background:var(--blue); box-shadow:0 5px 12px rgba(22,122,147,.22); }
.quick-days-panel { margin:-4px 0 22px; }
.quick-days-panel > p { margin:0 0 7px; color:var(--muted); font-size:10px; font-weight:900; letter-spacing:.08em; text-align:center; text-transform:uppercase; }
.quick-day-navigator { display:grid; grid-template-columns:44px minmax(0,1fr) 44px; gap:8px; align-items:stretch; }
.quick-day-navigator > button { border:1px solid var(--line); border-radius:12px; color:var(--blue); background:white; cursor:pointer; font-size:24px; }
.quick-days { display:grid; grid-template-columns:repeat(7,minmax(0,1fr)); gap:5px; padding:5px; border-radius:14px; background:#eaf2f1; }
.quick-day-button { min-width:0; padding:9px 3px; border:0; border-radius:9px; color:var(--muted); background:transparent; cursor:pointer; }
.quick-day-button strong,.quick-day-button small { display:block; }
.quick-day-button strong { overflow:hidden; font-size:11px; text-overflow:ellipsis; }
.quick-day-button small { margin-top:3px; font-size:9px; }
.quick-day-button.active { color:white; background:var(--blue); box-shadow:0 5px 12px rgba(22,122,147,.2); }
.quick-day-button.is-today { color:white; background:linear-gradient(135deg,var(--coral),#f29a63); box-shadow:0 5px 14px rgba(239,107,85,.3); }
.quick-day-button.is-today strong { font-size:15px; letter-spacing:.08em; }
.quick-day-button.is-today.active { outline:3px solid rgba(239,107,85,.23); outline-offset:2px; }
.daily-date-heading { margin-bottom:14px; text-align:center; }
.daily-date-heading h2 { font-size:26px; }
.daily-date-heading .calendar-meta { justify-items:center; }
.daily-school,.daily-activities { margin-bottom:16px; }
.school-day.single-day { min-height:0; max-width:620px; padding:16px; }
.daily-activity-list { display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr)); gap:9px; }
.daily-activity-list .activity-card { padding:12px; }
.daily-activity-list .activity-card time { display:block; margin-bottom:4px; color:var(--blue); font-size:12px; font-weight:900; }
.daily-activity-list .activity-card strong { display:block; white-space:normal; }
.daily-activity-list .activity-card span { font-size:10px; }
@media(max-width:760px){
  .viewer-mode-switch { width:100%; }
  .viewer-mode-switch button { min-width:0; flex:1; padding:10px 6px; }
  .week-controls { flex-wrap:wrap; }
  .week-picker-label { order:2; min-width:calc(100% - 112px); }
  .week-controls .icon-button { order:1; }
  .week-controls .icon-button + .week-picker-label + .icon-button { order:3; }
  .today-shortcut { order:4; flex:1; }
  .print-button { order:5; }
  .quick-day-navigator { grid-template-columns:1fr 1fr; }
  .quick-days { grid-column:1/-1; grid-row:1; grid-template-columns:repeat(4,minmax(0,1fr)); }
  .quick-day-button { min-width:0; }
  #previous-day { grid-column:1; grid-row:2; min-height:38px; }
  #following-day { grid-column:2; grid-row:2; min-height:38px; }
  .daily-date-heading h2 { font-size:22px; }
}

/* V10: jednotná editorial typografie + čitelnější velikosti na obrazovce */
:root {
  --font-editorial: "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino, Georgia, "Times New Roman", "Apple Color Emoji", "Segoe UI Emoji", serif;
}

/* Font je záměrně jednotný v celé aplikaci – navigace, tlačítka, formuláře,
   tabulky, štítky, metadata i obsah. */
*, *::before, *::after {
  font-family: var(--font-editorial) !important;
}
button, input, select, textarea, option {
  font-family: var(--font-editorial) !important;
}

@media screen {
  body { font-size: 16px; line-height: 1.42; }

  /* Drobné pomocné texty nesmí být na běžné obrazovce titěrné. */
  .eyebrow,
  .quick-days-panel > p,
  .week-button small,
  .week-button small b,
  .activity-table thead th span,
  .event-editor-row label span,
  .recurring-form label > span,
  .shared-fields label span,
  .child-form label > span,
  .child-select > span,
  .effective-date span,
  .editor-grid-head {
    font-size: 12px;
    line-height: 1.3;
  }

  /* Dny v rychlé navigaci – hlavně názvy typu „Čtvrtek“. */
  .quick-day-button { padding-top: 10px; padding-bottom: 10px; }
  .quick-day-button strong { font-size: 13px; line-height: 1.2; }
  .quick-day-button small { font-size: 11px; line-height: 1.2; }
  .quick-day-button.is-today strong { font-size: 16px; }

  /* Nadpisy jednotlivých dnů a datum. */
  .school-day h3,
  .mobile-day h3,
  .activity-day h3 { font-size: 16px; line-height: 1.25; }
  .school-day h3 span,
  .mobile-day h3 span,
  .activity-day h3 span { font-size: 12px; line-height: 1.25; }

  /* Svátky/jmeniny – na V9 byly 8 px, což bylo zbytečně malé. */
  .calendar-meta { gap: 4px; }
  .holiday-badge,
  .nameday-badge,
  .school-break-badge {
    font-size: 11px;
    line-height: 1.35;
  }
  .school-day .calendar-meta { min-height: 30px; }

  /* Obsah školního rozvrhu. */
  .subject strong { font-size: 13px; line-height: 1.3; }
  .subject small { font-size: 11px; line-height: 1.3; }
  .period { font-size: 12px; }
  .empty-small { font-size: 14px; line-height: 1.5; }

  /* Odpolední aktivity. */
  .activity-day > header { padding: 13px; }
  .activity-day .activity-card time { font-size: 12px; line-height: 1.3; }
  .activity-day .activity-card strong,
  .activity-card strong { font-size: 13px; line-height: 1.35; }
  .activity-card span,
  .mobile-activity span,
  .daily-activity-list .activity-card span { font-size: 11px; line-height: 1.35; }
  .activity-card.is-recurring small { font-size: 10px; line-height: 1.3; }

  /* Tabulky, zápatí a administrace. */
  .activity-table thead th:first-child,
  .activity-table tbody th,
  .activity-table tfoot th { font-size: 12px; }
  .activity-table tfoot th,
  .activity-table tfoot td { font-size: 11px; line-height: 1.35; }
  footer { font-size: 12px; }
  .viewer-link,
  .copy-button,
  .save-bar,
  .secondary-button,
  .delete-button,
  .admin-quick-links a { font-size: 13px; }
  .day-tabs button { font-size: 14px; }
  .day-tabs button small { font-size: 11px; }
  .editor-row time { font-size: 14px; }
  .note-field span,
  .parent-note,
  .recurring-item small,
  .recurring-when,
  .trash-item span,
  .school-version-note { font-size: 12px; line-height: 1.4; }

  /* Formuláře: pohodlná čitelnost i na telefonu. */
  input, select, textarea { font-size: 16px; line-height: 1.35; }
}

@media screen and (max-width: 760px) {
  body { font-size: 16px; }
  .eyebrow { font-size: 12px; }
  .quick-day-button strong { font-size: 13px; }
  .quick-day-button small { font-size: 11px; }
  .school-day h3, .mobile-day h3, .activity-day h3 { font-size: 16px; }
  .holiday-badge, .nameday-badge, .school-break-badge { font-size: 12px; }
  .mobile-school span { font-size: 12px; }
  .mobile-activity time { font-size: 13px; }
  .mobile-activity strong { font-size: 15px; }
  .mobile-activity span { font-size: 12px; }
  .free-day { font-size: 14px; }
  .day-note { font-size: 13px; }
}

/* V11: unified whole-week timeline */
.unified-week-section { margin-top: 4px; }
.week-schedule-wrap { display:grid; grid-template-columns:72px minmax(0,5fr) minmax(190px,1.05fr); gap:10px; align-items:start; overflow-x:auto; padding-bottom:6px; }
.week-time-axis { position:relative; min-width:72px; margin-top:87px; border-right:1px solid #cfdede; }
.week-time-axis::after { content:""; position:absolute; inset:0 0 0 54px; background:repeating-linear-gradient(to bottom, transparent 0, transparent 19px, #e8eeee 19px, #e8eeee 20px); pointer-events:none; }
.week-time-label { position:absolute; right:12px; transform:translateY(-50%); color:var(--muted); font-size:11px; line-height:1; font-weight:700; white-space:nowrap; }
.week-time-label:nth-child(4n+1) { color:var(--ink); font-weight:900; }
.week-timeline-grid { display:grid; grid-template-columns:repeat(5,minmax(145px,1fr)); gap:8px; min-width:760px; }
.week-timeline-day { min-width:0; overflow:hidden; border:1px solid #d9e4e4; border-radius:16px; background:#fff; }
.week-timeline-day > header { min-height:86px; padding:11px 10px 8px; border-bottom:1px solid var(--line); background:#f6faf9; }
.week-timeline-day > header h3, .weekend-day > header h3 { display:flex; justify-content:space-between; gap:6px; margin:0; font-size:16px; }
.week-timeline-day > header h3 span, .weekend-day > header h3 span { color:var(--muted); font-size:12px; font-weight:500; }
.week-timeline-day .calendar-meta { min-height:20px; margin:5px 0 4px; }
.week-day-legend { display:flex; gap:5px; flex-wrap:wrap; }
.week-day-legend span { padding:2px 6px; border-radius:999px; font-size:10px; font-weight:800; }
.legend-school { color:#8b4a37; background:#fff0e9; }
.legend-activity { color:#145c6d; background:#dff2f3; }
.week-timeline-track { position:relative; background:repeating-linear-gradient(to bottom, #fff 0, #fff 19px, #e8eeee 19px, #e8eeee 20px); }
.week-timeline-track::before { content:""; position:absolute; inset:0; background:repeating-linear-gradient(to bottom, rgba(239,107,85,.035) 0, rgba(239,107,85,.035) 79px, rgba(22,122,147,.025) 79px, rgba(22,122,147,.025) 80px); pointer-events:none; }
.week-timed-event { position:absolute; z-index:2; left:5px; right:5px; min-height:20px; overflow:hidden; padding:3px 5px 4px 7px; border-radius:7px; box-shadow:0 2px 5px rgba(42,77,80,.08); }
.week-timed-event time { display:block; margin-bottom:1px; font-size:10px; line-height:1.05; font-weight:900; }
.week-timed-event strong { display:block; overflow:hidden; font-size:12px; line-height:1.12; text-overflow:ellipsis; white-space:nowrap; }
.week-timed-event span { display:block; overflow:hidden; margin-top:1px; font-size:9px; line-height:1.1; text-overflow:ellipsis; white-space:nowrap; }
.week-timed-event.is-school { border-left:4px solid var(--subject-color,#ef6b55); background:#fff3ed; color:#6f4033; }
.week-timed-event.is-school time { color:#9c5643; }
.week-timed-event.is-activity { border-left:4px solid var(--category-color,var(--blue)); background:#e6f5f5; color:#145c6d; }
.week-timed-event.is-activity time { color:var(--blue); }
.week-timed-event.has-conflict { outline:2px solid #e34d37; background:#fff0ed; }
.week-timeline-empty { position:absolute; top:18px; left:10px; right:10px; color:#8b989e; font-size:12px; text-align:center; }
.week-timeline-day .day-note { margin:0; padding:8px 9px; border-top:1px solid var(--line); background:#fff8ec; font-size:11px; }
.weekend-column { display:grid; grid-template-rows:1fr 1fr; gap:10px; min-width:190px; }
.weekend-day { min-height:0; overflow:hidden; border:1px solid #d9e4e4; border-radius:16px; background:white; }
.weekend-day > header { padding:12px; border-bottom:1px solid var(--line); background:#f4f9f8; }
.weekend-day .calendar-meta { margin:6px 0 0; }
.weekend-activity-list { display:grid; gap:7px; padding:10px; }
.weekend-day .activity-card { min-height:0; padding:8px; }
.weekend-day .activity-card time { display:block; margin-bottom:3px; color:var(--blue); font-size:11px; font-weight:900; }
.weekend-day .activity-card strong { white-space:normal; font-size:13px; }
.weekend-day .day-note { margin:0; padding:9px 10px; border-top:1px solid var(--line); background:#fff8ec; font-size:11px; }

@media (max-width: 1050px) {
  .week-schedule-wrap { grid-template-columns:64px minmax(760px,5fr) 190px; }
  .week-time-axis { min-width:64px; }
}
@media (max-width: 760px) {
  .week-schedule-wrap { margin-left:-6px; margin-right:-6px; grid-template-columns:58px minmax(700px,5fr) 180px; gap:6px; }
  .week-time-axis { min-width:58px; margin-top:83px; }
  .week-time-label { right:8px; font-size:10px; }
  .week-timeline-grid { min-width:700px; gap:6px; }
  .week-timeline-day > header { min-height:82px; padding:9px 8px 7px; }
  .week-timeline-day > header h3, .weekend-day > header h3 { font-size:14px; }
  .week-timed-event { left:3px; right:3px; padding-left:5px; }
  .week-timed-event strong { font-size:11px; }
}
@media print {
  .week-schedule-wrap { overflow:visible; grid-template-columns:12mm minmax(0,5fr) 30mm; gap:1.2mm; }
  .week-time-axis { min-width:12mm; margin-top:16mm; }
  .week-time-label { right:2mm; font-size:5.5pt; }
  .week-timeline-grid { min-width:0; gap:1mm; }
  .week-timeline-day > header { min-height:16mm; padding:1.5mm; }
  .week-timeline-day > header h3, .weekend-day > header h3 { font-size:7pt; }
  .week-timed-event { left:.7mm; right:.7mm; padding:.5mm; border-radius:1mm; box-shadow:none; }
  .week-timed-event time { font-size:5pt; }
  .week-timed-event strong { font-size:6pt; }
  .week-timed-event span { font-size:4.5pt; }
  .weekend-column { min-width:30mm; gap:1mm; }
}


/* V12: týden od 8:00, skutečně oddělené pruhy ŠKOLA / AKTIVITY a větší text uvnitř kalendáře. */
.week-day-legend {
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:0;
  margin:6px -10px -8px;
  border-top:1px solid var(--line);
}
.week-day-legend span {
  padding:5px 4px;
  border-radius:0;
  font-size:12px;
  line-height:1.15;
  text-align:center;
  text-transform:uppercase;
  letter-spacing:.02em;
}
.week-day-legend span + span { border-left:1px solid var(--line); }
.week-timeline-track {
  display:grid;
  grid-template-columns:1fr 1fr;
  background:none;
}
.week-timeline-track::before { z-index:1; }
.week-timeline-lane {
  position:relative;
  min-width:0;
  height:100%;
  background:repeating-linear-gradient(to bottom, #fff 0, #fff 19px, #e8eeee 19px, #e8eeee 20px);
}
.week-timeline-lane + .week-timeline-lane { border-left:1px solid #d7e2e2; }
.week-timeline-lane.school-lane { background-color:#fffaf7; }
.week-timeline-lane.activity-lane { background-color:#f9fdfd; }
.week-timed-event { left:3px; right:3px; padding:3px 4px 4px 5px; }

/* +2 px proti V11 pro texty uvnitř týdenního kalendáře. */
.week-time-label { font-size:13px; }
.week-timeline-day > header h3,
.weekend-day > header h3 { font-size:18px; }
.week-timeline-day > header h3 span,
.weekend-day > header h3 span { font-size:14px; }
.week-timeline-day .holiday-badge,
.week-timeline-day .nameday-badge,
.week-timeline-day .school-break-badge,
.weekend-day .holiday-badge,
.weekend-day .nameday-badge,
.weekend-day .school-break-badge { font-size:13px; }
.week-timed-event time { font-size:12px; }
.week-timed-event strong { font-size:14px; line-height:1.15; }
.week-timed-event span { font-size:11px; line-height:1.15; }
.week-timeline-empty { font-size:14px; }
.week-timeline-day .day-note { font-size:13px; }
.weekend-day .activity-card time { font-size:13px; }
.weekend-day .activity-card strong { font-size:15px; }
.weekend-day .activity-card span,
.weekend-day .activity-card small { font-size:13px; }
.weekend-day .day-note { font-size:13px; }

@media (max-width:760px) {
  .week-day-legend { margin:6px -8px -7px; }
  .week-time-label { font-size:12px; }
  .week-timeline-day > header h3,
  .weekend-day > header h3 { font-size:16px; }
  .week-timeline-day > header h3 span,
  .weekend-day > header h3 span { font-size:14px; }
  .week-timed-event strong { font-size:13px; }
  .week-timed-event time { font-size:12px; }
  .week-timed-event span { font-size:11px; }
}

/* V13: jeden sloupec na pracovní den + denní zobrazení jako časové osy. */
.week-day-legend { display:none !important; }
.week-timeline-track {
  display:block;
  position:relative;
  background:repeating-linear-gradient(to bottom,#fff 0,#fff 19px,#e8eeee 19px,#e8eeee 20px);
}
.week-timeline-track::before {
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(to bottom,rgba(239,107,85,.025) 0,rgba(239,107,85,.025) 79px,rgba(22,122,147,.018) 79px,rgba(22,122,147,.018) 80px);
  pointer-events:none;
}
.week-timeline-day > header { min-height:72px; }
.week-time-axis { margin-top:73px; }

.daily-timeline-stack { width:min(100%,980px); margin:0 auto; display:grid; gap:14px; }
.daily-timeline-section { padding:14px 16px 16px; margin:0; }
.daily-timeline-section .section-heading { margin-bottom:10px; }
.daily-timeline { display:grid; grid-template-columns:68px minmax(0,1fr); gap:0; }
.daily-time-axis { position:relative; border-right:1px solid #cfdede; }
.daily-time-axis::after { content:""; position:absolute; inset:0 0 0 50px; background:repeating-linear-gradient(to bottom,transparent 0,transparent 19px,#e8eeee 19px,#e8eeee 20px); pointer-events:none; }
.daily-time-label { position:absolute; right:10px; transform:translateY(-50%); color:var(--muted); font-size:13px; line-height:1; font-weight:700; white-space:nowrap; }
.daily-time-label:nth-child(4n+1) { color:var(--ink); font-weight:900; }
.daily-timeline-track { position:relative; min-width:0; background:repeating-linear-gradient(to bottom,#fff 0,#fff 19px,#e8eeee 19px,#e8eeee 20px); }
.daily-timeline-track.school-track { background-color:#fffaf7; }
.daily-timeline-track.activity-track { background-color:#f9fdfd; }
.daily-timed-event { left:10px; right:10px; padding:5px 8px 6px 10px; border-radius:9px; }
.daily-timed-event time { font-size:13px; }
.daily-timed-event strong { font-size:16px; line-height:1.15; white-space:normal; }
.daily-timed-event span { font-size:13px; line-height:1.2; white-space:normal; }
.daily-timeline-empty { position:absolute; top:18px; left:16px; right:16px; margin:0; padding:10px 12px; border-radius:9px; color:var(--muted); background:rgba(255,255,255,.76); font-size:14px; }
.school-track .daily-timeline-empty { color:#9b3326; background:#fff0ec; font-weight:800; }
.daily-note { margin:0; padding:12px 14px; border:1px solid var(--line); border-radius:12px; background:#fff8ec; font-size:14px; }

@media (max-width:760px) {
  .week-time-axis { margin-top:69px; }
  .daily-timeline-stack { width:100%; }
  .daily-timeline-section { padding:12px 8px 12px; }
  .daily-timeline { grid-template-columns:56px minmax(0,1fr); }
  .daily-time-label { right:7px; font-size:12px; }
  .daily-time-axis::after { left:42px; }
  .daily-timed-event { left:6px; right:6px; padding-left:8px; }
  .daily-timed-event strong { font-size:15px; }
  .daily-timed-event time,.daily-timed-event span { font-size:12px; }
}

@media print {
  .week-time-axis { margin-top:13mm; }
  .daily-timeline-stack { width:100%; gap:2mm; }
  .daily-timeline-section { padding:2mm; }
  .daily-timeline { grid-template-columns:12mm minmax(0,1fr); }
  .daily-time-label { right:1.5mm; font-size:5.5pt; }
  .daily-timed-event { left:1mm; right:1mm; padding:.6mm 1mm; box-shadow:none; }
  .daily-timed-event time { font-size:5.5pt; }
  .daily-timed-event strong { font-size:7pt; }
  .daily-timed-event span { font-size:5.5pt; }
}


/* V14: denní přehled je jedna společná časová osa; barvy událostí zůstávají podle typu. */
.daily-timeline-stack { width:min(100%,980px); }
.daily-timeline-section.combined-day-section { padding:14px 16px 16px; }
.daily-timeline-track.combined-track {
  background:repeating-linear-gradient(to bottom,#fff 0,#fff 19px,#e8eeee 19px,#e8eeee 20px);
}
.daily-timeline-track.combined-track::before {
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(to bottom,rgba(22,122,147,.018) 0,rgba(22,122,147,.018) 79px,rgba(239,107,85,.018) 79px,rgba(239,107,85,.018) 80px);
  pointer-events:none;
}
.daily-timeline-track.combined-track .daily-timed-event { z-index:2; }
@media (max-width:760px) {
  .daily-timeline-section.combined-day-section { padding:12px 8px; }
}

/* V15: víkend v týdenním přehledu používá stejný poměr času 8:00–20:00 jako pracovní dny. */
.weekend-day {
  display:flex;
  flex-direction:column;
}
.weekend-timeline-track {
  position:relative;
  flex:1 1 auto;
  min-height:0;
  overflow:hidden;
  background:repeating-linear-gradient(to bottom,#fff 0,#fff calc(100% / 48 - 1px),#e8eeee calc(100% / 48 - 1px),#e8eeee calc(100% / 48));
}
.weekend-timeline-track::before {
  content:"";
  position:absolute;
  inset:0;
  background:repeating-linear-gradient(to bottom,rgba(22,122,147,.018) 0,rgba(22,122,147,.018) calc(100% / 12 - 1px),rgba(22,122,147,.045) calc(100% / 12 - 1px),rgba(22,122,147,.045) calc(100% / 12));
  pointer-events:none;
}
.weekend-timed-event {
  position:absolute;
  z-index:2;
  left:7px;
  right:7px;
  overflow:hidden;
  padding:6px 7px 7px 9px;
  border-radius:8px;
  border-left:4px solid var(--category-color,var(--blue));
  background:#e6f5f5;
  color:#145c6d;
  box-shadow:0 2px 5px rgba(42,77,80,.08);
}
.weekend-timed-event time {
  display:block;
  margin-bottom:2px;
  color:var(--blue);
  font-size:12px;
  line-height:1.08;
  font-weight:900;
}
.weekend-timed-event strong {
  display:block;
  overflow:hidden;
  font-size:14px;
  line-height:1.14;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.weekend-timed-event span {
  display:block;
  overflow:hidden;
  margin-top:2px;
  font-size:11px;
  line-height:1.12;
  text-overflow:ellipsis;
  white-space:nowrap;
}
.weekend-timed-event.has-conflict { outline:2px solid #e34d37; background:#fff0ed; }
.weekend-timeline-track > .free-day {
  position:absolute;
  top:12px;
  left:8px;
  right:8px;
  margin:0;
  text-align:center;
}
@media (max-width:760px) {
  .weekend-timed-event { left:5px; right:5px; padding:5px 6px 6px 7px; }
  .weekend-timed-event time { font-size:11px; }
  .weekend-timed-event strong { font-size:13px; }
  .weekend-timed-event span { font-size:10px; }
}
@media print {
  .weekend-timed-event { left:.8mm; right:.8mm; padding:.7mm; border-radius:1mm; box-shadow:none; }
  .weekend-timed-event time { font-size:5pt; }
  .weekend-timed-event strong { font-size:6pt; }
  .weekend-timed-event span { font-size:4.5pt; }
}

/* V16: mobilní týden bez horizontálního rozpadání + skryté jmeniny. */
.nameday-badge { display:none !important; }
.mobile-week-list { display:none; }

@media (max-width:760px) {
  /* Desktopová časová tabulka se na telefonu nahrazuje čitelným seznamem dnů. */
  .unified-week-section .week-schedule-wrap { display:none !important; }
  .mobile-week-list {
    display:grid;
    gap:12px;
    width:100%;
    min-width:0;
    margin-top:12px;
  }
  .mobile-week-day {
    min-width:0;
    overflow:hidden;
    border:1px solid #d9e4e4;
    border-radius:16px;
    background:#fff;
  }
  .mobile-week-day > header {
    padding:12px 13px 10px;
    border-bottom:1px solid var(--line);
    background:#f4f9f8;
  }
  .mobile-week-day > header h3 {
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:12px;
    margin:0;
    font-size:19px;
    line-height:1.2;
  }
  .mobile-week-day > header h3 span {
    flex:0 0 auto;
    color:var(--muted);
    font-size:14px;
    font-weight:600;
  }
  .mobile-week-day .calendar-meta {
    min-height:0;
    margin:5px 0 0;
  }
  .mobile-week-events { display:grid; }
  .mobile-week-event {
    display:grid;
    grid-template-columns:92px minmax(0,1fr);
    gap:10px;
    align-items:start;
    min-width:0;
    padding:11px 12px;
    border-bottom:1px solid #e7eeee;
    border-left:5px solid var(--category-color,var(--blue));
  }
  .mobile-week-event:last-child { border-bottom:0; }
  .mobile-week-event.is-school {
    border-left-color:var(--subject-color,#ef6b55);
    background:#fff3ed;
    color:#6f4033;
  }
  .mobile-week-event.is-activity { background:#eef8f8; color:#145c6d; }
  .mobile-week-event time {
    padding-top:1px;
    color:inherit;
    font-size:14px;
    line-height:1.2;
    font-weight:900;
    white-space:nowrap;
  }
  .mobile-week-event strong {
    display:block;
    min-width:0;
    font-size:17px;
    line-height:1.15;
    overflow-wrap:anywhere;
  }
  .mobile-week-event span {
    display:block;
    min-width:0;
    margin-top:3px;
    color:var(--muted);
    font-size:13px;
    line-height:1.3;
    overflow-wrap:anywhere;
  }
  .mobile-week-empty {
    margin:0;
    padding:18px 14px;
    color:var(--muted);
    font-size:14px;
  }
  .unified-week-section > .section-heading h2 { font-size:26px; }
  .unified-week-section > .section-heading .eyebrow { font-size:12px; }
}

/* V17: compact daily view on phones – same visual rhythm as compact weekly cards */
@media (max-width: 760px) {
  .daily-timeline-section.combined-day-section {
    padding:0;
    overflow:hidden;
    border:1px solid #d9e4e4;
    border-radius:16px;
    background:#fff;
  }
  .daily-timeline-section.combined-day-section > .section-heading {
    padding:12px 13px 10px;
    margin:0;
    border-bottom:1px solid var(--line);
    background:#f4f9f8;
  }
  .daily-timeline-section.combined-day-section > .section-heading .section-icon { display:none; }
  .daily-timeline-section.combined-day-section > .section-heading .eyebrow { font-size:11px; }
  .daily-timeline-section.combined-day-section > .section-heading h2 { font-size:22px; line-height:1.15; }

  .daily-timeline {
    display:block;
  }
  .daily-time-axis {
    display:none;
  }
  .daily-timeline-track.combined-track {
    height:auto !important;
    min-height:0;
    display:grid;
    background:#fff;
  }
  .daily-timeline-track.combined-track::before { display:none; }
  .daily-timeline-track.combined-track .daily-timed-event {
    position:relative;
    top:auto !important;
    left:auto;
    right:auto;
    height:auto !important;
    min-height:0;
    display:grid;
    grid-template-columns:92px minmax(0,1fr);
    column-gap:10px;
    align-items:start;
    margin:0;
    padding:11px 12px;
    border:0;
    border-bottom:1px solid #e7eeee;
    border-left:5px solid var(--category-color,var(--blue));
    border-radius:0;
    box-shadow:none;
    overflow:visible;
  }
  .daily-timeline-track.combined-track .daily-timed-event:last-child { border-bottom:0; }
  .daily-timeline-track.combined-track .daily-timed-event.is-school {
    border-left-color:var(--subject-color,#ef6b55);
    background:#fff3ed;
    color:#6f4033;
  }
  .daily-timeline-track.combined-track .daily-timed-event.is-activity {
    background:#eef8f8;
    color:#145c6d;
  }
  .daily-timeline-track.combined-track .daily-timed-event time {
    grid-column:1;
    grid-row:1 / span 3;
    padding-top:1px;
    color:inherit;
    font-size:14px;
    line-height:1.2;
    font-weight:900;
    white-space:nowrap;
  }
  .daily-timeline-track.combined-track .daily-timed-event strong {
    grid-column:2;
    display:block;
    min-width:0;
    font-size:17px;
    line-height:1.15;
    overflow-wrap:anywhere;
  }
  .daily-timeline-track.combined-track .daily-timed-event span {
    grid-column:2;
    display:block;
    min-width:0;
    margin-top:3px;
    color:var(--muted);
    font-size:13px;
    line-height:1.3;
    overflow-wrap:anywhere;
  }
  .daily-timeline-track.combined-track .daily-timeline-empty {
    position:static;
    margin:0;
    padding:18px 14px;
    border-radius:0;
    background:#fff;
    color:var(--muted);
    font-size:14px;
  }
}

/* V18: více prostoru pod hlavičkou + kompaktní akce také na desktopu. */
.viewer-mode-switch {
  margin-top: 20px;
}

/* Týden: používej kompaktní seznam událostí na všech obrazovkách. */
.unified-week-section .week-schedule-wrap { display:none !important; }
.mobile-week-list {
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
  width:100%;
  min-width:0;
  margin-top:14px;
}
.mobile-week-day {
  min-width:0;
  overflow:hidden;
  border:1px solid #d9e4e4;
  border-radius:16px;
  background:#fff;
}
.mobile-week-day > header {
  padding:12px 14px 10px;
  border-bottom:1px solid var(--line);
  background:#f4f9f8;
}
.mobile-week-day > header h3 {
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin:0;
  font-size:20px;
  line-height:1.2;
}
.mobile-week-day > header h3 span {
  flex:0 0 auto;
  color:var(--muted);
  font-size:14px;
  font-weight:600;
}
.mobile-week-day .calendar-meta { min-height:0; margin:5px 0 0; }
.mobile-week-events { display:grid; }
.mobile-week-event {
  display:grid;
  grid-template-columns:105px minmax(0,1fr);
  gap:12px;
  align-items:start;
  min-width:0;
  padding:12px 14px;
  border-bottom:1px solid #e7eeee;
  border-left:5px solid var(--category-color,var(--blue));
}
.mobile-week-event:last-child { border-bottom:0; }
.mobile-week-event.is-school {
  border-left-color:var(--subject-color,#ef6b55);
  background:#fff3ed;
  color:#6f4033;
}
.mobile-week-event.is-activity { background:#eef8f8; color:#145c6d; }
.mobile-week-event time {
  padding-top:1px;
  color:inherit;
  font-size:14px;
  line-height:1.2;
  font-weight:900;
  white-space:nowrap;
}
.mobile-week-event strong {
  display:block;
  min-width:0;
  font-size:17px;
  line-height:1.15;
  overflow-wrap:anywhere;
}
.mobile-week-event span {
  display:block;
  min-width:0;
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
  line-height:1.3;
  overflow-wrap:anywhere;
}
.mobile-week-empty { margin:0; padding:18px 14px; color:var(--muted); font-size:14px; }

/* Denní program: stejný kompaktní seznam na desktopu i mobilu. */
.daily-timeline-section.combined-day-section {
  padding:0;
  overflow:hidden;
  border:1px solid #d9e4e4;
  border-radius:16px;
  background:#fff;
}
.daily-timeline-section.combined-day-section > .section-heading {
  padding:13px 15px 11px;
  margin:0;
  border-bottom:1px solid var(--line);
  background:#f4f9f8;
}
.daily-timeline-section.combined-day-section > .section-heading .section-icon { display:none; }
.daily-timeline-section.combined-day-section > .section-heading .eyebrow { font-size:11px; }
.daily-timeline-section.combined-day-section > .section-heading h2 { font-size:23px; line-height:1.15; }
.daily-timeline { display:block; }
.daily-time-axis { display:none; }
.daily-timeline-track.combined-track {
  height:auto !important;
  min-height:0;
  display:grid;
  background:#fff;
}
.daily-timeline-track.combined-track::before { display:none; }
.daily-timeline-track.combined-track .daily-timed-event {
  position:relative;
  top:auto !important;
  left:auto;
  right:auto;
  height:auto !important;
  min-height:0;
  display:grid;
  grid-template-columns:105px minmax(0,1fr);
  column-gap:12px;
  align-items:start;
  margin:0;
  padding:12px 14px;
  border:0;
  border-bottom:1px solid #e7eeee;
  border-left:5px solid var(--category-color,var(--blue));
  border-radius:0;
  box-shadow:none;
  overflow:visible;
}
.daily-timeline-track.combined-track .daily-timed-event:last-child { border-bottom:0; }
.daily-timeline-track.combined-track .daily-timed-event.is-school {
  border-left-color:var(--subject-color,#ef6b55);
  background:#fff3ed;
  color:#6f4033;
}
.daily-timeline-track.combined-track .daily-timed-event.is-activity {
  background:#eef8f8;
  color:#145c6d;
}
.daily-timeline-track.combined-track .daily-timed-event time {
  grid-column:1;
  grid-row:1 / span 3;
  padding-top:1px;
  color:inherit;
  font-size:14px;
  line-height:1.2;
  font-weight:900;
  white-space:nowrap;
}
.daily-timeline-track.combined-track .daily-timed-event strong {
  grid-column:2;
  display:block;
  font-size:17px;
  line-height:1.15;
  white-space:normal;
  overflow-wrap:anywhere;
}
.daily-timeline-track.combined-track .daily-timed-event span {
  grid-column:2;
  display:block;
  margin-top:3px;
  color:var(--muted);
  font-size:13px;
  line-height:1.3;
  white-space:normal;
  overflow-wrap:anywhere;
}
.daily-timeline-empty {
  position:relative;
  top:auto;
  left:auto;
  right:auto;
  margin:0;
  padding:18px 14px;
  border-radius:0;
}

@media (min-width:1100px) {
  .mobile-week-list { grid-template-columns:repeat(2,minmax(0,1fr)); }
  .daily-timeline-stack { width:min(100%,1050px); }
}

@media (max-width:760px) {
  .viewer-mode-switch { margin-top:24px; margin-bottom:18px; }
  .mobile-week-list { grid-template-columns:1fr; gap:12px; margin-top:12px; }
  .mobile-week-event,
  .daily-timeline-track.combined-track .daily-timed-event {
    grid-template-columns:92px minmax(0,1fr);
    gap:10px;
    padding:11px 12px;
  }
}

@media print {
  /* Tisk si ponechá původní časovou tabulku. */
  .unified-week-section .week-schedule-wrap { display:grid !important; }
  .mobile-week-list { display:none !important; }
  .daily-timeline { display:grid; }
  .daily-time-axis { display:block; }
  .daily-timeline-track.combined-track { height:960px !important; display:block; }
}

/* V19: víkendové akce v kompaktním týdnu mají výšku podle skutečné délky.
   Referenční jednotka: 45 minut = jeden běžný školní blok. */
.mobile-week-event.is-weekend-activity {
  min-height: calc(68px * var(--weekend-duration-ratio, 1));
  align-content:start;
}

@media (max-width: 760px) {
  .mobile-week-event.is-weekend-activity {
    min-height: calc(68px * var(--weekend-duration-ratio, 1));
  }
}


/* V20: desktopový denní přehled zachovává proporce délky událostí.
   45 minut = výška jednoho běžného školního bloku; delší akce rostou úměrně. */
@media screen and (min-width: 761px) {
  .daily-timeline-track.combined-track .daily-timed-event {
    min-height: calc(68px * var(--daily-duration-ratio, 1));
    align-content: start;
  }
}

/* V21: čitelnější nadpis rychlé volby dne a nadpis denního data */
@media screen {
  .quick-days-panel > p,
  .daily-date-heading > .eyebrow {
    font-size: 14px !important;
    line-height: 1.3;
  }
}

/* V25 – ruční výjimky z opakovaných akcí */
.recurring-exceptions-card { margin-top: 18px; }
.recurring-exceptions-card .editor-heading { align-items: flex-start; gap: 18px; }
.editor-help { max-width: 520px; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.recurring-exception-item { background: #fff8f5; border-color: #f0d3c9; }
.recurring-exception-item .recurring-when { color: #a64d3b; }
.recurring-actions { flex-wrap: wrap; }
.cancel-occurrence { border-color: #e9c8bd; color: #9b4a3c; background: #fff8f5; }
.cancel-occurrence:hover { background: #ffefea; }
.restore-exception { color: #35715f; border-color: #c9ddd5; background: #f5fbf8; }
@media (max-width: 760px) {
  .recurring-exceptions-card .editor-heading { display: block; }
  .editor-help { margin-top: 8px; font-size: 12px; }
  .recurring-actions { width: 100%; }
  .recurring-actions button { flex: 1 1 auto; }
}

/* V26 – přehledná správa jednotlivých termínů opakované série */
.recurring-series-actions { width: 190px; display: grid; grid-template-columns: 1fr; gap: 7px; flex: 0 0 190px; }
.recurring-series-actions button { width: 100%; min-height: 42px; }
.recurring-series-manager { grid-column: 1 / -1; align-self: start; width: 100%; }
.recurring-series-manager[hidden] { display: none; }
.recurring-manager-heading { align-items: center; }
.recurring-manager-help { margin: -8px 20px 14px; max-width: none; }
.recurring-manager-notice { margin: 0 0 10px; padding: 10px 12px; border-radius: 10px; background: #f3f8f8; color: var(--muted); font-size: 12px; }
.recurring-occurrence-list { display: grid; gap: 9px; padding: 0 18px 18px; max-height: none; overflow: visible; min-width: 0; }
.recurring-occurrence-row { display: grid; grid-template-columns: minmax(150px,180px) minmax(0,1fr) minmax(300px,340px); gap: 16px; align-items: center; padding: 13px 14px; border: 1px solid var(--line); border-radius: 13px; background: #fff; min-width: 0; }
.recurring-occurrence-row.cancelled { background: #fff8f5; border-color: #f0d3c9; }
.recurring-occurrence-row.overridden { background: #f7f5ff; border-color: #dcd5f2; }
.occurrence-week strong, .occurrence-week span, .occurrence-detail > span, .occurrence-detail > strong, .occurrence-detail small { display: block; }
.occurrence-week strong { font-size: 13px; color: var(--ink); }
.occurrence-week span { margin-top: 3px; font-size: 12px; color: var(--muted); text-transform: capitalize; }
.occurrence-detail > span { font-size: 11px; font-weight: 800; color: var(--muted); }
.occurrence-detail > strong { margin-top: 2px; font-size: 15px; }
.occurrence-detail small { margin-top: 2px; font-size: 11px; color: var(--muted); }
.occurrence-actions { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 7px; }
.recurring-occurrence-row.cancelled .occurrence-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
.occurrence-actions button { width: 100%; min-height: 40px; }
.occurrence-status { display: inline-block; width: max-content; margin-top: 5px; padding: 3px 7px; border-radius: 999px; font-size: 10px; font-weight: 900; text-transform: uppercase; letter-spacing: .04em; }
.occurrence-status.cancelled { background: #fbe3dc; color: #9d432f; }
.occurrence-status.overridden { background: #ebe6fb; color: #65558f; }

@media (max-width: 900px) {
  .recurring-series-manager { grid-column: 1 / -1; }
  .recurring-series-actions { width: 100%; flex-basis: auto; grid-template-columns: 1fr 1fr; }
  .recurring-series-actions .delete-recurring { grid-column: 1 / -1; }
  .recurring-occurrence-row { grid-template-columns: 1fr; gap: 9px; }
  .occurrence-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .recurring-occurrence-row.cancelled .occurrence-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .recurring-manager-help { margin-left: 14px; margin-right: 14px; }
}

/* V27 – správce série přes celou šířku, bez vnitřných posuvníků. */
.recurring-page .recurring-layout > .editor-card:nth-child(1),
.recurring-page .recurring-layout > .editor-card:nth-child(2) { min-width: 0; }
.recurring-series-manager .editor-heading { padding-bottom: 12px; }
.recurring-series-manager .occurrence-detail,
.recurring-series-manager .occurrence-week { min-width: 0; }
.recurring-series-manager .occurrence-detail strong,
.recurring-series-manager .occurrence-detail small { overflow-wrap: anywhere; }
@media (min-width: 901px) {
  .recurring-series-manager { margin-top: 2px; }
  .recurring-occurrence-list { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .recurring-manager-heading { align-items: flex-start; gap: 10px; }
  .recurring-manager-heading #recurring-manager-close { flex: 0 0 auto; }
  .recurring-occurrence-list { padding-left: 12px; padding-right: 12px; }
}

/* V28 – Web Push připomínky aktivit */
.push-reminder-panel {
  width:min(100%,760px);
  margin:-4px auto 18px;
  padding:11px 13px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  border:1px solid #d5e4e3;
  border-radius:14px;
  background:#f3f9f8;
}
.push-reminder-panel[hidden] { display:none; }
.push-reminder-copy { min-width:0; display:grid; gap:2px; }
.push-reminder-copy strong { color:var(--ink); font-size:14px; }
.push-reminder-copy span { color:var(--muted); font-size:12px; line-height:1.35; }
.push-reminder-panel.is-active { border-color:#b9d9cf; background:#f1faf6; }
.push-reminder-panel.is-warning { border-color:#ead4c9; background:#fff8f4; }
.push-reminder-panel .secondary-button { flex:0 0 auto; min-width:128px; }

.notifications-page .planner-page { max-width:1080px; }
.push-admin-card { margin-top:18px; }
.push-admin-warning { margin-top:18px; border-color:#efcbbb; background:#fff9f5; }
.push-admin-warning p, .push-admin-card > p { margin:0 20px 18px; color:var(--muted); line-height:1.55; }
.push-admin-help { max-width:none; }
.push-device-list { display:grid; gap:10px; padding:0 18px 18px; }
.push-device-row { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px; border:1px solid var(--line); border-radius:13px; background:white; }
.push-device-row > div { display:grid; gap:3px; min-width:0; }
.push-device-row strong { font-size:17px; }
.push-device-row span { color:var(--ink); font-size:13px; }
.push-device-row small { color:var(--muted); font-size:11px; }
.cron-url-box { margin:0 20px 14px; padding:12px 14px; overflow-wrap:anywhere; border:1px solid var(--line); border-radius:11px; background:#f6f8f8; }
.cron-url-box code { white-space:normal; font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; font-size:12px; }
.push-steps { margin:0 20px 20px; padding-left:22px; color:var(--ink); }
.push-steps li { margin:7px 0; line-height:1.45; }

@media (max-width:760px) {
  .push-reminder-panel { margin-top:-2px; margin-bottom:16px; align-items:flex-start; }
  .push-reminder-panel .secondary-button { min-width:0; padding:9px 11px; }
  .push-device-row { align-items:flex-start; flex-direction:column; }
  .push-device-row form, .push-device-row button { width:100%; }
}


/* V29 – individuální ovládání push upozornění aktivit */
.activity-notify-label{min-width:150px}.inline-check{display:flex;align-items:center;gap:8px;min-height:40px}.inline-check input{width:20px;height:20px;accent-color:#14859b}.notify-state{display:inline-flex!important;align-items:center;gap:5px;font-weight:700}.notify-state.on{color:#167a93}.notify-state.off{color:#8b6f69}.occurrence-status.notify{margin-left:6px}.occurrence-status.notify.on{background:#e7f5f3;color:#126f79}.occurrence-status.notify.off{background:#f1efed;color:#806a64}.notify-occurrence.notify-off{border-color:#8ac9c5;background:#eef9f7}.notify-series-check{padding-top:4px}
@media(max-width:760px){.activity-notify-label{min-width:0}.occurrence-actions .notify-occurrence{width:100%}}
/* V30 – pojmenovaná push zařízení */
.push-device-group{display:block}.push-child-head{display:flex!important;justify-content:space-between;align-items:center;margin-bottom:10px}.push-device-detail{display:flex;justify-content:space-between;gap:18px;align-items:center;padding:12px 0;border-top:1px solid var(--line)}.push-device-detail>div:first-child{display:grid;gap:3px}.push-device-actions{display:flex;gap:8px;align-items:center}.push-device-actions form{display:flex;gap:7px;align-items:center}.device-name-input{min-width:160px;padding:9px 10px;border:1px solid var(--line);border-radius:9px;font:inherit}@media(max-width:760px){.push-device-detail,.push-device-actions,.push-device-actions form{width:100%;align-items:stretch;flex-direction:column}.device-name-input{width:100%}}

/* V31 – kompaktní tři akce vedle sebe v editoru série */
@media (max-width: 620px){.occurrence-actions{grid-template-columns:1fr}.recurring-occurrence-row.cancelled .occurrence-actions{grid-template-columns:1fr}}

/* V32 – kompaktní nastavení série a čistší přehled konkrétních týdnů */
.recurring-options {
  display: grid;
  gap: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: #f8fbfa;
}
.recurring-option {
  display: grid;
  grid-template-columns: 20px minmax(0,1fr);
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 8px 11px;
  cursor: pointer;
}
.recurring-option + .recurring-option { border-top: 1px solid var(--line); }
.recurring-form .recurring-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  accent-color: #14859b;
  cursor: pointer;
}
.recurring-option > span { min-width: 0; margin: 0 !important; }
.recurring-option strong,
.recurring-option small { display: block; }
.recurring-option strong {
  color: var(--ink);
  font-size: 12px;
  line-height: 1.25;
}
.recurring-option small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
}

.recurring-occurrence-row {
  grid-template-columns: minmax(132px,160px) minmax(0,1fr) minmax(270px,300px);
  gap: 12px;
  padding: 11px 13px;
}
.occurrence-week strong { font-size: 12px; }
.occurrence-week span { font-size: 11px; }
.occurrence-detail > span { font-size: 10px; }
.occurrence-detail > strong { font-size: 14px; line-height: 1.2; }
.occurrence-detail small { font-size: 10px; }
.occurrence-state {
  display: inline-flex;
  align-items: center;
  width: max-content;
  max-width: 100%;
  margin-top: 5px;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 1.2;
  white-space: normal;
}
.occurrence-state.cancelled { color: #934532; background: #fbe6df; }
.occurrence-state.overridden { color: #65558f; background: #eee9fb; }
.occurrence-actions {
  grid-template-columns: minmax(150px,1.35fr) minmax(90px,1fr) minmax(90px,1fr);
  gap: 6px;
  align-items: stretch;
}
.occurrence-actions button {
  min-height: 38px;
  padding: 7px 8px;
  border-radius: 9px;
  font-size: 11px;
  line-height: 1.15;
  white-space: normal;
}
.occurrence-actions .notify-occurrence {
  color: #126f79;
  border-color: #bcdeda;
  background: #f0f9f7;
}
.occurrence-actions .notify-occurrence.notify-off {
  color: #766862;
  border-color: #ddd6d2;
  background: #f8f6f5;
}
.recurring-occurrence-row.cancelled .occurrence-actions {
  grid-template-columns: repeat(2,minmax(0,1fr));
}

@media (max-width: 900px) {
  .recurring-occurrence-row { grid-template-columns: minmax(120px,145px) minmax(0,1fr); }
  .occurrence-actions { grid-column: 1 / -1; }
}
@media (max-width: 620px) {
  .recurring-option { min-height: 46px; padding: 8px 10px; }
  .recurring-occurrence-row { grid-template-columns: 1fr; gap: 7px; }
  .occurrence-actions,
  .recurring-occurrence-row.cancelled .occurrence-actions { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .recurring-occurrence-row.cancelled .occurrence-actions { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .occurrence-actions button { min-width: 0; white-space: normal; }
}

/* V33 – zařízení jako hotové řádky; editor názvu se zobrazí až na vyžádání */
.notifications-page .push-device-group{padding:0;overflow:hidden}
.notifications-page .push-child-head{padding:14px 16px;margin:0;background:rgba(236,246,246,.55);border-bottom:1px solid var(--line)}
.notifications-page .push-device-group>small{display:block;padding:15px 16px}
.notifications-page .push-device-detail{display:grid;grid-template-columns:minmax(220px,1fr) auto;gap:14px 20px;align-items:center;padding:14px 16px;border-top:0;border-bottom:1px solid var(--line)}
.notifications-page .push-device-detail:last-child{border-bottom:0}
.notifications-page .push-device-summary{display:grid;gap:2px;min-width:0}
.notifications-page .push-device-summary strong{font-size:17px;overflow-wrap:anywhere}
.notifications-page .push-device-summary span{font-size:12px;color:var(--ink)}
.notifications-page .push-device-summary small{font-size:11px;color:var(--muted)}
.notifications-page .push-device-actions{display:grid;grid-template-columns:repeat(3,max-content);gap:7px;align-items:center}
.notifications-page .push-device-action-form{display:contents}
.notifications-page .push-device-actions button{min-height:38px;padding:8px 11px;white-space:nowrap}
.notifications-page .push-device-rename-form{grid-column:1/-1;padding:12px 14px;background:var(--paper,#fbfcfb);border:1px solid var(--line);border-radius:11px}
.notifications-page .push-device-rename-form[hidden]{display:none!important}
.notifications-page .push-device-rename-form label{display:block;margin-bottom:6px;font-size:12px;font-weight:700;color:var(--muted)}
.notifications-page .push-device-rename-fields{display:grid;grid-template-columns:minmax(180px,1fr) auto auto;gap:7px;align-items:center}
.notifications-page .device-name-input{width:100%;min-width:0}
@media(max-width:760px){
  .notifications-page .push-device-detail{grid-template-columns:1fr;padding:13px}
  .notifications-page .push-device-actions{grid-template-columns:repeat(3,1fr);width:100%}
  .notifications-page .push-device-actions button{width:100%;padding:8px 6px}
  .notifications-page .push-device-actions button span{display:none}
  .notifications-page .push-device-rename-form{grid-column:1}
  .notifications-page .push-device-rename-fields{grid-template-columns:1fr auto auto}
}

/* V34 – jasný název akce pro notifikaci v konkrétním termínu */
.occurrence-actions .notify-occurrence{font-weight:800}
@media(max-width:620px){.occurrence-actions{grid-template-columns:minmax(0,1.45fr) minmax(0,.8fr) minmax(0,.8fr)}}

/* V35 – přehlednější rodičovská hlavička, centrované akce a rodičovský vstup z dětského plánu. */
.admin-main-header { align-items:flex-start; }
.admin-main-title { min-width:0; flex:1; }
.admin-title-row { display:flex; align-items:baseline; flex-wrap:wrap; gap:.18em .28em; min-width:0; }
.admin-title-row h1 { flex:0 0 auto; }
.admin-title-child-select { display:inline-flex; min-width:0; }
.admin-title-child-select select {
  max-width:100%;
  min-width:130px;
  padding:0 34px 1px 4px;
  border:0;
  border-bottom:2px solid rgba(22,122,147,.2);
  border-radius:0;
  outline:none;
  color:var(--blue);
  background-color:transparent;
  font-family:var(--font-display);
  font-size:clamp(25px,3vw,38px);
  font-weight:700;
  line-height:1.08;
  letter-spacing:-.035em;
  cursor:pointer;
}
.admin-title-child-select select:focus { border-bottom-color:var(--blue); }
.admin-action-row {
  justify-content:center;
  align-items:center;
  flex-wrap:nowrap;
  gap:7px;
  margin:0 auto 14px;
  overflow-x:auto;
  scrollbar-width:thin;
}
.admin-action-row a {
  flex:0 0 auto;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:5px;
  min-height:40px;
  white-space:nowrap;
}
.admin-week-controls { margin:18px auto 24px !important; justify-content:center; }
.footer-separator { padding:0 4px; }
.admin-footer-link { color:var(--blue); font-weight:800; text-decoration:none; }
.admin-footer-link:hover { text-decoration:underline; }
.admin-login-shell { max-width:680px; }
.admin-login-card { margin-top:28px; }
.admin-login-field { display:block; padding:0 24px 22px; }
.admin-login-field span { display:block; margin-bottom:7px; color:var(--muted); font-size:12px; font-weight:800; }
.admin-login-field input { width:100%; min-height:48px; padding:10px 13px; border:1px solid var(--line); border-radius:11px; outline:none; background:#fbfdfd; color:var(--ink); font-size:16px; }
.admin-login-field input:focus { border-color:var(--blue); box-shadow:0 0 0 3px rgba(22,122,147,.10); }
.admin-login-message { margin:0 24px 18px; padding:11px 13px; border:1px solid #efcbbb; border-radius:10px; color:#9b3326; background:#fff4ef; font-weight:700; }
@media (max-width:760px) {
  .admin-main-header { align-items:center; }
  .admin-title-row { gap:.1em .25em; }
  .admin-title-row h1,
  .admin-title-child-select select { font-size:24px; }
  .admin-title-child-select select { min-width:105px; padding-right:26px; }
  .admin-action-row { justify-content:flex-start; margin-left:-2px; margin-right:-2px; padding-bottom:4px; }
  .admin-action-row a { min-height:38px; padding:8px 10px; font-size:12px; }
  .admin-week-controls { margin-top:14px !important; }
  .admin-login-card { margin-top:22px; }
}
