:root {
  color-scheme: light;
  --canvas: #f5f4ef;
  --surface: #ffffff;
  --ink: #222b27;
  --muted: #657265;
  --green: #285a45;
  --green-soft: #edf3ea;
  --border: #e2e5db;
  --sidebar-width: 224px;
  --content-max: 1440px;
  --detail-width: 360px;
  --text-scale: 1;
  --font-multiplier: 1;
  --card-padding: 17px;
  --card-gap: 12px;
  --radius: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font-size: calc(14px * var(--text-scale) * var(--font-multiplier));
  line-height: 1.5;
}
body[data-font="large"] { --font-multiplier: 1; }
body[data-density="compact"] { --card-padding: 12px; --card-gap: 8px; }
button, input, textarea, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .46; }
a { color: inherit; text-decoration: none; }
button, a, input, select, textarea { -webkit-tap-highlight-color: transparent; }
button, a { touch-action: manipulation; }
svg { flex: none; width: 20px; height: 20px; stroke-linecap: round; stroke-linejoin: round; }
button svg, .btn svg { width: 18px; height: 18px; }
h1, h2, h3, h4, p { margin-top: 0; }
h1, h2, h3, h4 { line-height: 1.25; letter-spacing: -.025em; }
h1 { font-size: calc(32px * var(--text-scale)); font-weight: 700; margin-bottom: 9px; }
h2 { font-size: calc(18px * var(--text-scale)); font-weight: 650; margin-bottom: 12px; }
h3 { font-size: calc(15px * var(--text-scale)); font-weight: 650; }
p { margin-bottom: 12px; }
small { font-size: .86em; }
[hidden], .hidden { display: none !important; }
:focus-visible { outline: 2px solid #3d7757; outline-offset: 3px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.line-clamp {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.muted { color: var(--muted); }
.mobile-only, .mobile-brand { display: none; }

.preview-frame { width: 100%; min-height: 100dvh; }
.app-shell { display: flex; align-items: flex-start; min-height: 100dvh; }
.sidebar {
  position: sticky; top: 0; flex: 0 0 var(--sidebar-width);
  width: var(--sidebar-width); height: 100dvh; padding: 30px 18px 22px;
  background: #fcfcf8; border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 11px; padding: 0 7px; }
.brand-icon, .brand-mark {
  width: 36px; height: 36px; flex: none; display: grid; place-items: center;
  background: var(--green); color: #fff; border-radius: 11px;
}
.brand-icon svg, .brand-mark svg { width: 22px; height: 22px; }
.brand-icon:is(svg) { width: 32px; height: 32px; padding: 5px; }
.brand strong, .brand-name { display: block; font-size: 16px; line-height: 1.25; letter-spacing: -.02em; }
.brand small, .brand-subtitle { display: block; margin-top: 3px; color: var(--muted); font-size: 11px; }
.sidebar nav, .sidebar .nav-links { display: flex; flex-direction: column; gap: 5px; margin-top: 32px; }
.nav-link {
  display: flex; align-items: center; gap: 11px; width: 100%; min-height: 43px;
  border: 0; border-radius: 10px; padding: 11px 13px;
  background: transparent; color: #788176; text-align: left; font-weight: 500;
  transition: background 150ms, color 150ms;
}
.nav-link svg { width: 20px; height: 20px; }
.nav-link:hover { color: var(--green); background: #f0f3eb; }
.nav-link.active { color: var(--green); background: #eaf1e6; font-weight: 650; }
.family-children { margin-top: 34px; padding: 0 7px; }
.family-children h3, .sidebar-label {
  margin: 0 0 12px; color: #8c9488; font-size: 10px;
  font-weight: 650; text-transform: uppercase; letter-spacing: .1em;
}
.child-mini { display: flex; align-items: center; gap: 9px; min-height: 39px; margin: 5px 0; font-size: 12px; }
.child-mini small { display: block; color: var(--muted); line-height: 1.4; }
.child-mini .avatar { width: 28px; height: 28px; font-size: 11px; border-radius: 9px; }
.sidebar-footer { margin-top: auto; padding: 24px 7px 0; font-size: 11px; line-height: 1.6; color: #8a9287; }
.sidebar-footer p { margin-bottom: 5px; }
.sidebar-footer strong { color: #64705f; font-weight: 500; }

.workspace { flex: 1; min-width: 0; padding: 0 32px 40px; }
.workspace > * { width: 100%; max-width: var(--content-max); margin-left: auto; margin-right: auto; }
.topbar {
  min-height: 76px; display: flex; align-items: center; justify-content: space-between;
  gap: 18px; margin-bottom: 26px; border-bottom: 1px solid var(--border);
}
.breadcrumb { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #8a9287; white-space: nowrap; }
.breadcrumb strong { color: #5e6b5d; font-weight: 500; }
.topbar-actions { display: flex; align-items: center; gap: 9px; flex: none; }
.page-intro { margin-bottom: 23px; }
.page-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-header .page-intro { margin-bottom: 0; }
.eyebrow { margin-bottom: 8px; color: #8a9385; font-size: 10px; letter-spacing: .11em; text-transform: uppercase; font-weight: 650; }
.subheading { color: #7c8577; margin: 0; font-size: .96em; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 19px; }
.filter-bar { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.filter-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 7px 12px; background: transparent; border: 1px solid transparent;
  border-radius: 8px; font-size: 12px; color: #77816f; white-space: nowrap;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.filter-chip:hover { border-color: #d8ded0; background: #fafbf7; }
.filter-chip.active { color: var(--green); background: #e9f0e4; border-color: #d9e4d0; font-weight: 600; }
.search-field {
  display: flex; align-items: center; gap: 8px; min-width: 160px; max-width: 285px;
  width: 230px; height: 37px; padding: 8px 11px; border: 1px solid #e0e4d9;
  border-radius: 9px; background: #fcfcf8; color: #9aa18f;
}
.search-field svg { width: 17px; height: 17px; }
.search-field input { width: 100%; min-width: 0; border: 0; background: transparent; padding: 0; outline: 0; color: var(--ink); font-size: 12px; }
.search-field input::placeholder { color: #a0a795; }
.search-field:focus-within { border-color: #72947b; box-shadow: 0 0 0 2px #e7efe3; }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, var(--detail-width)); align-items: start; gap: 24px; }
.primary-column, .secondary-column { min-width: 0; }
.summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-bottom: 25px; }
.stat-card { padding: 16px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.stat-card strong, .stat-value { display: block; font-size: calc(27px * var(--text-scale)); font-weight: 650; line-height: 1.15; letter-spacing: -.04em; color: #344b3c; }
.stat-card small, .stat-label { display: block; margin-top: 7px; color: #8a9383; font-size: 11px; }
.stat-card.overdue strong, .stat-card.overdue .stat-value { color: #a06945; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 13px; }
.section-heading h2 { margin: 0; font-size: calc(17px * var(--text-scale)); }
.section-heading small, .section-heading .count { color: #959d8d; font-size: 11px; font-weight: 400; }
.section-heading .btn { flex: none; }

.task-list { display: flex; flex-direction: column; gap: var(--card-gap); }
.task-card {
  min-width: 0; padding: var(--card-padding); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius);
  transition: border-color 150ms, background 150ms;
}
.task-card:hover { border-color: #cbd5c2; }
.task-card.selected { border-color: #7c9c7b; box-shadow: 0 0 0 1px #7c9c7b; }
.task-card.completed { background: #fafbf7; }
.task-card.completed .task-title { color: #98a08f; text-decoration: line-through; text-decoration-thickness: 1px; }
.task-main { display: flex; align-items: flex-start; gap: 13px; min-width: 0; }
.task-mark {
  flex: none; width: 22px; height: 22px; display: grid; place-items: center;
  margin-top: 2px; padding: 0; border: 1.5px solid #d7dece; border-radius: 50%;
  background: #fff; color: var(--green);
}
.task-mark svg { width: 13px; height: 13px; }
.task-mark:hover { border-color: var(--green); }
.completed .task-mark, .task-mark[aria-pressed="true"] { border-color: #658760; background: #658760; color: #fff; }
.is-announcement .task-mark { border-radius: 6px; color: #729088; background: #f0f5f1; border-color: #d3e3d8; }
.is-request .task-mark { border-color: #decba1; color: #aa8546; }
.task-content { flex: 1; min-width: 0; }
.task-title { display: block; padding: 0; margin: 0; border: 0; background: none; text-align: left; color: #384236; font-size: calc(15px * var(--text-scale) * var(--font-multiplier)); font-weight: 600; line-height: 1.4; letter-spacing: -.015em; }
.task-content p, .task-snippet { color: #8a9382; font-size: .9em; line-height: 1.55; margin: 6px 0 0; }
.task-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px 9px; margin-top: 10px; color: #929a87; font-size: 11px; }
.task-meta > span { display: inline-flex; align-items: center; }
.task-meta svg { width: 13px; height: 13px; margin-right: 4px; }
.task-actions { display: flex; align-items: center; gap: 5px; flex: none; }
.task-actions .btn.icon { width: 27px; height: 27px; min-height: 27px; color: #98a18d; }
.task-list.rows { gap: 0; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--surface); }
.task-list.rows .task-card { border: 0; border-bottom: 1px solid var(--border); border-radius: 0; box-shadow: none; }
.task-list.rows .task-card:last-child { border-bottom: 0; }
.task-list.rows .task-card.selected { background: #eff4ec; border-left: 3px solid #6b9567; padding-left: calc(var(--card-padding) - 3px); }

.homework-date-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0 0 17px; }
.homework-date-heading h2 { margin: 0; color: var(--green); font-size: calc(20px * var(--text-scale)); }
.homework-children { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); align-items: start; gap: 20px; }
.homework-child { min-width: 0; padding: 18px; border: 1px solid var(--border); border-top: 3px solid #cec4e0; border-radius: var(--radius); background: #f8faf5; }
.homework-child.blue { border-top-color: #a7c3d7; }
.homework-child.amber { border-top-color: #d8c39a; }
.homework-child.green { border-top-color: #afc6ad; }
.homework-child-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; }
.homework-child-heading > div { min-width: 0; flex: 1; }
.homework-child-heading h2 { margin: 0 0 3px; font-size: calc(19px * var(--text-scale)); overflow-wrap: anywhere; }
.homework-child-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.homework-child .task-card { padding: 16px; }
.homework-item h3 { margin: 10px 0 8px; }
.homework-item-top { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.homework-basis { color: #657b60; font-size: 11px; }
.homework-summary { margin: 0; color: var(--muted); line-height: 1.6; font-size: 13px; white-space: pre-line; overflow-wrap: anywhere; }
.homework-family-status { display: grid; gap: 7px; margin: 14px 0; }
.homework-task-toggle { display: flex; align-items: center; gap: 9px; padding: 0; border: 0; background: none; text-align: left; color: #57724f; font-size: 12px; }
.homework-task-toggle .task-mark { margin: 0; }
.homework-work { margin-top: 14px; padding-top: 11px; border-top: 1px solid var(--border); }
.homework-work > summary { cursor: pointer; color: #526a4d; font-size: 13px; font-weight: 600; }
.homework-work > summary span { margin-left: 6px; color: var(--muted); font-size: 11px; font-weight: 400; }
.homework-work-list { display: grid; gap: 10px; margin-top: 13px; }
.homework-work-row { display: flex; align-items: flex-start; gap: 9px; font-size: 13px; line-height: 1.5; }
.homework-work-row input { flex: none; margin: 3px 0 0; accent-color: var(--green); }
.homework-materials { display: grid; gap: 8px; margin-top: 14px; }
.homework-item-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.homework-empty { padding: 19px 15px; border: 1px dashed #d7dfd0; border-radius: 10px; background: #fff; }
.homework-empty h3 { margin: 0 0 7px; font-size: 14px; line-height: 1.5; font-weight: 500; }
.homework-empty p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.homework-child-footer { margin-top: 14px; }
.homework-child-footer .btn { max-width: 100%; white-space: normal; text-align: left; }
.homework-scope-note { margin-top: 20px; }
body[data-preview="phone"] .homework-children { grid-template-columns: minmax(0, 1fr); }
body[data-preview="phone"] .homework-child { padding: 13px; }
.source-badge, .kind-badge, .status-badge { display: inline-flex; align-items: center; gap: 4px; width: fit-content; padding: 3px 7px; border-radius: 5px; font-size: 10px; line-height: 1.3; font-weight: 500; white-space: nowrap; }
.source-badge.metodbox, .source-badge.methodbox { color: #5c795c; background: #eef3e8; }
.source-badge.whatsapp { color: #789253; background: #f1f5e6; }
.source-badge.sms { color: #9b8b66; background: #f5f0e4; }
.source-badge.manual { color: #838d7c; background: #f0f2eb; }
.kind-badge { color: #939b89; background: #f5f6f0; }
.status-badge.todo { color: #9d895d; background: #f6f1e5; }
.status-badge.inProgress, .status-badge.in-progress { color: #738594; background: #eef2f4; }
.status-badge.done { color: #77926b; background: #edf4e8; }
.status-badge.overdue { color: #b08465; background: #fbf0e7; }
.child-dot { display: inline-block; flex: none; width: 6px; height: 6px; margin-right: 5px; border-radius: 50%; background: #a7b399; }
.child-dot.violet { background: #aa9bc3; }
.child-dot.blue { background: #8bacc2; }
.child-dot.amber { background: #c9b279; }

.detail-panel {
  position: sticky; top: 22px; max-height: calc(100dvh - 44px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  scrollbar-width: thin; scrollbar-color: #d3dbca transparent;
}
.detail-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 20px 20px 16px; border-bottom: 1px solid #eef0e7; }
.detail-header h2 { font-size: calc(17px * var(--text-scale)); margin: 7px 0 0; line-height: 1.4; }
.detail-header .eyebrow { margin-bottom: 0; }
.detail-body { padding: 18px 20px 20px; }
.detail-section + .detail-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid #edf0e5; }
.detail-section h3 { font-size: calc(12px * var(--text-scale)); letter-spacing: 0; margin: 0 0 10px; color: #818c76; }
.detail-section p { line-height: 1.6; overflow-wrap: anywhere; }
.detail-section .task-meta { margin-top: 0; }
.detail-section a { color: var(--green); text-decoration: underline; text-underline-offset: 3px; }
.translation-tabs { display: flex; gap: 17px; border-bottom: 1px solid #e8eddf; margin-bottom: 13px; }
.translation-tabs button { padding: 7px 0 9px; border: 0; border-bottom: 2px solid transparent; background: none; color: #9aa58c; font-size: 11px; }
.translation-tabs button.active, .translation-tabs button[aria-selected="true"] { border-bottom-color: #72906a; color: #56784e; font-weight: 600; }
.translation-text { color: #616e58; font-size: .94em; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.original-text { margin-top: 11px; padding: 12px; color: #89957f; background: #f7f9f2; border-radius: 9px; font-size: .86em; line-height: 1.6; white-space: pre-wrap; overflow-wrap: anywhere; }
.attachment { --file-accent: #316448; --file-bg: #edf6ee; --file-border: #b7d5be; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 72px; padding: 13px; margin-top: 10px; border: 1px solid var(--file-border); border-left: 5px solid var(--file-accent); background: var(--file-bg); border-radius: 12px; color: #222b27; text-align: left; overflow-wrap: anywhere; line-height: 1.45; box-shadow: 0 2px 5px #5e412808; }
.attachment[data-kind="pdf"] { --file-accent: #a83b2b; --file-bg: #fff2ee; --file-border: #edb4a6; }
.attachment[data-kind="docx"] { --file-accent: #275b9b; --file-bg: #edf4ff; --file-border: #b5cceb; }
.attachment[data-kind="audio"] { --file-accent: #4c51a8; --file-bg: #f0f2ff; --file-border: #bbc0ec; }
.attachment[data-kind="image"] { --file-accent: #946000; --file-bg: #fff6e2; --file-border: #e3c88d; }
.attachment:hover { border-color: var(--file-accent); box-shadow: 0 3px 10px #5e412816; }
.attachment:focus-visible { outline: 3px solid #3d7757; outline-offset: 3px; }
.attachment .attachment-icon { display: grid; place-items: center; flex: 0 0 40px; width: 40px; height: 44px; border-radius: 9px; background: var(--file-accent); color: #fff; }
.attachment-icon svg { width: 24px; height: 24px; }
.attachment small { color: #657265; }
.detail-section details { margin-top: 8px; }
.detail-section summary { cursor: pointer; color: #78866a; padding: 5px 0; font-size: 12px; }
.detail-section details[open] summary { margin-bottom: 8px; }

.calendar { padding: 19px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.calendar-topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.calendar-topbar h2 { margin: 0; font-size: calc(18px * var(--text-scale)); }
.calendar-topbar > div { display: flex; align-items: center; gap: 8px; }
.calendar-weekdays { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); margin-bottom: 9px; color: #98a18c; font-size: 11px; text-align: center; }
.calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 1px; overflow: hidden; background: var(--border); border: 1px solid var(--border); border-radius: 9px; }
.calendar-cell { min-width: 0; min-height: 125px; padding: 8px; border: 0; background: #fff; color: #747f6b; text-align: left; cursor: pointer; }
.calendar-cell:hover { background: #f8faf3; }
.calendar-cell.outside { background: #fbfcf8; color: #c1c8b8; }
.calendar-cell.selected { background: #f2f7ec; box-shadow: inset 0 0 0 1.5px #80a374; }
.day-number { display: grid; place-items: center; width: 25px; height: 25px; margin-bottom: 5px; border-radius: 50%; font-size: 12px; line-height: 1; }
.calendar-cell.today .day-number { background: #6d8e60; color: #fff; font-weight: 600; }
.calendar-event { display: block; width: 100%; margin: 4px 0 0; padding: 5px 6px; border: 0; border-left: 2px solid #9fbb88; border-radius: 4px; background: #f0f5e9; color: #758b61; font-size: 9px; line-height: 1.35; text-align: left; overflow: hidden; overflow-wrap: anywhere; }
.calendar-event.done { background: #f4f6f0; color: #a7b39a; border-left-color: #ccd6c0; text-decoration: line-through; }
.calendar-event.announcement { color: #a18b62; background: #f9f3e8; border-left-color: #d3bc8b; }
.calendar-mobile-agenda { display: none; }

.children-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 18px; }
.child-card { padding: 22px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); }
.child-card h2 { margin: 14px 0 4px; font-size: calc(18px * var(--text-scale)); }
.child-card p { color: #98a28a; font-size: .9em; }
.avatar { display: grid; place-items: center; width: 49px; height: 49px; border-radius: 14px; background: #eef1e8; color: #86976f; font-size: 18px; font-weight: 600; }
.avatar.violet { background: #f0ebf6; color: #a08eba; }
.avatar.blue { background: #eaf0f4; color: #8ca9ba; }
.avatar.amber { background: #f7f0df; color: #bba366; }
.progress { height: 5px; margin: 16px 0 8px; overflow: hidden; border-radius: 10px; background: #eef2e7; }
.progress > span, .progress > div { display: block; height: 100%; background: #95b181; border-radius: inherit; }
progress.progress { display: block; width: 100%; border: 0; appearance: none; -webkit-appearance: none; }
progress.progress::-webkit-progress-bar { background: #eef2e7; border-radius: 10px; }
progress.progress::-webkit-progress-value { background: #95b181; border-radius: 10px; }
progress.progress::-moz-progress-bar { background: #95b181; border-radius: 10px; }
.child-card .task-meta { margin-top: 12px; }
.empty-state { padding: 46px 26px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius); color: #8d9781; text-align: center; }
.empty-state > svg { width: 34px; height: 34px; margin-bottom: 15px; color: #b3bea4; }
.empty-state h2 { color: #6d7d5d; font-size: calc(20px * var(--text-scale)); }
.empty-state p { max-width: 390px; margin: 0 auto 18px; font-size: .95em; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 37px; padding: 8px 13px; border: 1px solid transparent; border-radius: 8px; background: transparent; color: #6f7d62; font-size: 12px; font-weight: 500; line-height: 1.25; white-space: nowrap; transition: background 150ms, border-color 150ms, color 150ms; }
.btn.primary { background: var(--green); border-color: var(--green); color: #fff; }
.btn.primary:hover:not(:disabled) { background: #214d3a; border-color: #214d3a; }
.btn.secondary { background: #fff; border-color: #dfe6d6; color: #748166; }
.btn.secondary:hover:not(:disabled) { background: #f7faf2; border-color: #cbd8bf; }
.btn.ghost:hover:not(:disabled) { background: #eef3e7; color: #607a50; }
.btn.icon, .icon { display: inline-flex; align-items: center; justify-content: center; width: 35px; height: 35px; padding: 0; border: 0; border-radius: 8px; background: transparent; color: #8e9b80; }
.btn.icon:hover, button.icon:hover { background: #f0f4e9; color: #638153; }
.btn.danger { color: #a98269; background: #fbf3ec; border-color: #f0e2d7; }
.btn.danger:hover:not(:disabled) { background: #f7ebe0; }
.btn.small { min-height: 29px; padding: 5px 9px; font-size: 10px; }
.notice { padding: 12px 14px; margin-bottom: 17px; background: #eef3e7; border: 1px solid #dce7d0; border-radius: 10px; color: #758965; font-size: 12px; line-height: 1.6; }
.notice p:last-child { margin-bottom: 0; }
.toast { position: fixed; z-index: 110; bottom: 24px; left: calc(50% + var(--sidebar-width) / 2); transform: translateX(-50%); max-width: min(520px, calc(100vw - 32px)); padding: 12px 17px; border-radius: 10px; background: #344b3d; color: #fff; font-size: 12px; box-shadow: 0 5px 20px #22372618; }
.toast:empty { display: none; }

.modal-overlay { position: fixed; z-index: 90; inset: 0; display: flex; align-items: center; justify-content: center; padding: 22px; background: #1f302d38; }
.modal { display: flex; flex-direction: column; width: 100%; max-width: 520px; max-height: calc(100dvh - 44px); overflow: hidden; background: #fff; border: 1px solid #e0e6d8; border-radius: 17px; box-shadow: 0 16px 56px #1c322526; }
.modal.wide { max-width: 720px; }
.modal-header { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 21px 23px 18px; border-bottom: 1px solid #edf1e6; }
.modal-header h2 { margin: 0; font-size: calc(19px * var(--text-scale)); }
.modal-body { flex: 1; min-height: 0; padding: 22px 23px; overflow-y: auto; }
.modal-footer { display: flex; justify-content: flex-end; align-items: center; gap: 9px; padding: 16px 23px; border-top: 1px solid #edf1e6; background: #fcfdf9; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 16px; }
.form-field { display: flex; flex-direction: column; min-width: 0; gap: 7px; margin-bottom: 16px; }
.form-field.full { grid-column: 1 / -1; }
.form-field label { color: #6f7f60; font-size: 12px; font-weight: 600; }
.form-field input, .form-field select, .form-field textarea { min-width: 0; width: 100%; padding: 10px 11px; border: 1px solid #dce4d2; border-radius: 8px; background: #fff; color: #66775b; font-size: 12px; line-height: 1.5; }
.form-field input:focus, .form-field select:focus, .form-field textarea:focus { outline: 0; border-color: #7f9e6f; box-shadow: 0 0 0 2px #eaf2e2; }
.form-field textarea { min-height: 110px; resize: vertical; }
.form-field small { color: #9aa68c; font-size: 10px; line-height: 1.6; }
.form-field [aria-invalid="true"] { border-color: #be967d; }
input[type="checkbox"], input[type="radio"], input[type="range"] { accent-color: #6b9259; }
input[type="checkbox"] { width: 16px; height: 16px; flex: none; }
.error { margin: 8px 0 0; color: #ad8468; font-size: 12px; line-height: 1.5; }

.panel-overlay { position: fixed; z-index: 70; inset: 0; background: #23352b2b; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 150ms, visibility 150ms; }
.panel-overlay.visible { opacity: 1; visibility: visible; pointer-events: auto; }
.design-panel { position: fixed; z-index: 80; top: 0; right: 0; bottom: 0; width: 340px; max-width: calc(100vw - 20px); background: #fff; border-left: 1px solid #dde5d3; overflow-y: auto; transform: translateX(100%); visibility: hidden; transition: transform 150ms, visibility 150ms; box-shadow: -6px 0 28px #2335270c; scrollbar-width: thin; scrollbar-color: #d3dbca transparent; }
.design-panel.open { transform: translateX(0); visibility: visible; }
.design-header { position: sticky; top: 0; z-index: 1; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 22px; background: #fff; border-bottom: 1px solid #e9efdf; }
.design-header h2 { margin: 0 0 5px; font-size: 19px; }
.design-header p { margin: 0; color: #99a58c; font-size: 11px; line-height: 1.6; }
.design-group { padding: 19px 22px; border-bottom: 1px solid #eef2e7; }
.design-group h3 { margin: 0 0 12px; font-size: 12px; color: #7c8d6a; letter-spacing: 0; }
.design-group p { font-size: 11px; color: #9aa78c; line-height: 1.6; }
.segmented { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 3px; padding: 3px; border: 1px solid #e5ecdc; border-radius: 9px; background: #f6f9f0; }
.segmented button { padding: 8px 3px; min-height: 33px; border: 0; border-radius: 6px; background: none; color: #98a689; font-size: 10px; line-height: 1.3; }
.segmented button.active, .segmented button[aria-pressed="true"] { background: #fff; color: #6b8b54; box-shadow: 0 1px 3px #3e562017; font-weight: 600; }
.range-label { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 8px; font-size: 11px; color: #879777; }
.range-label output, .range-label strong { font-weight: 500; font-variant-numeric: tabular-nums; color: #a0ae8e; }
.design-group input[type="range"] { width: 100%; height: 17px; margin: 4px 0 3px; }
.design-group label:not(.range-label) { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 10px 0; font-size: 11px; color: #8a9b77; }
.design-group select { width: 100%; padding: 9px; border: 1px solid #dde7d1; border-radius: 8px; background: #fff; color: #7b9066; }
.design-footer { padding: 18px 22px; }
.design-footer .btn { width: 100%; }

/* Component details from the live page: native controls keep their semantics and focus. */
.brand > div { font-size: 16px; font-weight: 650; line-height: 1.3; letter-spacing: -.02em; }
.brand > div small { font-weight: 400; letter-spacing: 0; font-size: 10px; color: var(--muted); }
.sidebar > .sidebar-label { margin: 18px 7px 0; font-size: 8px; letter-spacing: .07em; }
.sidebar nav { margin-top: 23px; }
.sidebar-section-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; color: #7c8972; font-size: 10px; letter-spacing: .08em; }
.sidebar-section-heading .btn.icon { width: 26px; height: 26px; }
.child-mini { width: 100%; padding: 6px 5px; border: 0; border-radius: 8px; background: transparent; color: #65725f; text-align: left; font-weight: 500; }
.child-mini:hover, .child-mini.active { background: #edf2e7; }
.child-mini small { font-size: 11px; }
.child-count, .nav-count { display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: auto; border-radius: 6px; background: #edf2e7; color: #809270; font-size: 10px; line-height: 1; }
.local-mode { margin-top: 18px; color: #6d7d60; font-size: 11px; }
.local-mode small { display: block; padding-left: 13px; margin-top: 2px; color: #8c9980; }
.online-dot { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #9db880; vertical-align: 1px; }
.demo-pill { border: 1px solid #e1e8d8; border-radius: 5px; padding: 3px 7px; color: #899979; font-size: 10px; }
.date-chip { display: inline-flex; align-items: center; gap: 7px; padding: 8px 11px; border: 1px solid #e0e6d7; border-radius: 8px; background: #fafbf7; color: #728363; font-size: 12px; white-space: nowrap; }
.date-chip svg { width: 15px; height: 15px; }
.filter-divider { width: 1px; height: 19px; background: #dce3d3; margin: 0 5px; flex: none; }
.select-label { position: relative; display: inline-flex; flex: none; }
.select-label select { height: 35px; max-width: 180px; padding: 7px 27px 7px 10px; appearance: none; border: 1px solid #dfe6d5; border-radius: 8px; background: #fbfcf8; color: #728063; font-size: 12px; cursor: pointer; }
.select-label::after { content: ""; position: absolute; pointer-events: none; right: 11px; top: 13px; width: 5px; height: 5px; border-right: 1.5px solid #8c9b7d; border-bottom: 1.5px solid #8c9b7d; transform: rotate(45deg); }
.text-button { display: inline-flex; align-items: center; gap: 7px; padding: 4px 0; border: 0; background: transparent; color: #678753; font-size: 12px; font-weight: 500; text-align: left; }
.text-button:hover { color: #3c692e; }
.text-button svg { width: 15px; height: 15px; }
.section-heading h2 { display: inline-flex; align-items: center; gap: 7px; }
.count-pill { display: inline-flex; justify-content: center; align-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 6px; background: #ecf1e5; color: #80966b; font-size: 11px; font-weight: 500; letter-spacing: 0; line-height: 1; }
.feed-section { margin-bottom: 25px; }
.page-footnote { margin: 20px 0 0; font-size: 11px; line-height: 1.65; color: #88967c; }
.stat-card .stat-label { display: flex; align-items: center; justify-content: space-between; gap: 7px; margin: 0 0 13px; font-size: 12px; color: #7b8a6d; }
.stat-label svg { width: 16px; height: 16px; color: #a8b897; }
.stat-card strong { font-size: calc(30px * var(--text-scale)); }
.stat-card strong small { display: inline; margin: 0; font-size: 13px; font-weight: 400; line-height: 1; letter-spacing: 0; color: #91a180; }
.stat-card > span { display: block; margin-top: 7px; font-size: 11px; color: #89977c; }
.stat-card.attention strong { color: #ac895c; }
.task-content h3 { margin: 0; }
.task-card-top, .detail-card-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-bottom: 9px; }
.source-badge, .kind-badge, .status-badge { font-size: 12px; padding: 3px 7px; }
.source-badge svg { width: 12px; height: 12px; }
.source-badge.metodbox, .source-badge.methodbox { color: #537347; }
.source-badge.whatsapp { color: #667e43; }
.source-badge.sms { color: #877347; }
.kind-badge { color: #808f70; }
.status-badge.todo { color: #8c7543; }
.status-badge.inProgress { color: #657c8a; }
.status-badge.done { color: #668451; }
.status-badge.overdue { color: #9c714c; }
.task-meta { font-size: 12px; color: #7a876f; }
.task-content p, .task-snippet { color: #687563; font-size: 13px; }
.task-mark.started > span { width: 7px; height: 7px; border-radius: 50%; background: #adc19b; }
.message-icon { display: grid; place-items: center; flex: none; width: 23px; height: 23px; margin-top: 2px; color: #8b9d78; }
.message-icon svg { width: 19px; height: 19px; }
.overdue-text { color: #a37b53; }
.linked-note { color: #759260; }
.inline-original { margin-top: 11px; }
.inline-original summary { width: fit-content; cursor: pointer; color: #7e946c; font-size: 12px; }
.inline-original p { padding-top: 7px; color: #778a67; font-size: 12px; white-space: pre-wrap; overflow-wrap: anywhere; }
.btn { font-size: 13px; }
.btn.small { font-size: 12px; }
.btn.icon > span { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.detail-header { color: #89987a; font-size: 12px; }
.detail-body > h2 { margin: 11px 0 9px; font-size: calc(20px * var(--text-scale)); line-height: 1.35; color: #53694a; }
.detail-body > .detail-card-top, .detail-body > h2, .detail-body > .detail-meta { grid-column: 1 / -1; }
.detail-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: #88987a; font-size: 12px; margin-bottom: 19px; }
.detail-section h3 { font-size: 13px; color: #748a61; }
.detail-section h3 svg { width: 14px; height: 14px; vertical-align: -2px; margin-right: 3px; }
.translation-tabs button { font-size: 12px; }
.translation-text { color: #5f7254; font-size: 14px; }
.original-text { color: #70865f; font-size: 13px; }
.fact-row { display: flex; justify-content: space-between; gap: 12px; margin: 8px 0; font-size: 12px; color: #88997a; }
.fact-row strong { text-align: right; font-weight: 500; color: #758c64; }
.helper-text { font-size: 12px; color: #899b78; line-height: 1.6; margin: 11px 0 0; }
.attachment { font-size: calc(14px * var(--text-scale)); font-weight: 600; }
.attachment-copy { min-width: 0; flex: 1; }
.attachment small { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 12px; font-weight: 400; }
.attachment small svg { width: 14px; height: 14px; }
.attachment[data-status="ready"] small { color: var(--file-accent); font-weight: 600; }
.attachment[data-status="error"] small { color: #a6382b; font-weight: 600; }
.attachment-kind { flex: none; font-size: 11px; font-weight: 700; padding: 5px 7px; border: 1px solid var(--file-border); border-radius: 6px; background: #fff; color: var(--file-accent); }
.task-meta .task-materials { padding: 4px 8px; border: 1px solid #e8c58b; border-radius: 7px; background: #fff1d4; color: #80500c; font-weight: 600; }
.family-task-item + .family-task-item { margin-top: 18px; }
.family-task-item .form-field { margin-bottom: 11px; }
.family-task .form-field > span { font-size: 12px; color: #839973; font-weight: 400; }
.form-field > span { color: #748a61; font-size: 13px; font-weight: 500; }
.form-field input, .form-field select, .form-field textarea { font-size: 13px; }
.checkbox-label { display: flex; align-items: center; gap: 9px; font-size: 13px; color: #768c62; }
.day-number { border: 0; padding: 0; background: transparent; color: inherit; cursor: pointer; }
.calendar-topbar { flex-wrap: wrap; }
.calendar-navigation { flex-wrap: wrap; }
.calendar-agenda { margin-top: 8px; }
.agenda-row { display: flex; align-items: center; gap: 12px; padding: 14px 0; border-bottom: 1px solid #ebf0e2; }
.agenda-row:last-child { border-bottom: 0; }
.agenda-row .avatar { flex: none; width: 35px; height: 35px; border-radius: 10px; font-size: 13px; }
.agenda-row > div { flex: 1; min-width: 0; }
.agenda-row small { display: block; margin-top: 4px; color: #8b9e78; font-size: 12px; }
.agenda-row .status-badge { flex: none; }
.empty-day { margin: 16px 0 5px; color: #8ea278; font-size: 13px; }
.mini-calendar { margin-top: 19px; padding: 17px 19px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.mini-calendar .section-heading h2 { font-size: 16px; }
.upcoming-row { display: flex; align-items: center; gap: 11px; width: 100%; padding: 11px 0; border: 0; border-bottom: 1px solid #eef3e5; background: transparent; color: #80956c; text-align: left; font-size: 12px; }
.upcoming-row > span:not(.upcoming-date) { flex: 1; min-width: 0; }
.upcoming-row small { display: block; font-size: 10px; color: #9bae87; margin-top: 2px; }
.upcoming-row > svg { width: 14px; height: 14px; color: #a5b792; }
.upcoming-date { display: flex; flex-direction: column; justify-content: center; align-items: center; flex: none; width: 34px; height: 39px; border-radius: 7px; background: #f2f7e9; color: #7d9a64; font-size: 16px; font-weight: 600; line-height: 1.1; }
.upcoming-date small { font-size: 9px; margin-top: 3px; font-weight: 400; }
.mini-calendar > .text-button { margin-top: 12px; }
.child-card-header { display: flex; align-items: center; justify-content: space-between; }
.avatar.large { width: 57px; height: 57px; font-size: 21px; border-radius: 17px; }
.child-stats { display: flex; gap: 24px; padding-top: 17px; margin-top: 21px; border-top: 1px solid #ecf2e1; }
.child-stats span { color: #94a981; font-size: 12px; }
.child-stats strong { display: block; color: #758f61; font-size: 23px; font-weight: 600; line-height: 1.2; margin-bottom: 3px; }
.child-card > .btn { width: 100%; margin-top: 15px; }
.add-child-card { display: flex; align-items: center; justify-content: center; flex-direction: column; min-height: 270px; gap: 10px; background: transparent; border-style: dashed; color: #8ca477; }
.add-child-card > svg { width: 28px; height: 28px; }
.add-child-card strong { font-size: 15px; font-weight: 500; }
.add-child-card > span { font-size: 12px; color: #a2b38d; }
.notice { display: flex; align-items: flex-start; gap: 11px; margin-top: 24px; font-size: 13px; }
.notice > svg { flex: none; width: 19px; height: 19px; margin-top: 2px; }
.notice strong { display: block; margin-bottom: 3px; font-size: 13px; font-weight: 500; }
.source-card-icon { display: grid; place-items: center; width: 45px; height: 45px; border-radius: 12px; background: #edf4e3; color: #86a16e; }
.source-card-icon.whatsapp { background: #f0f6e1; color: #94ad6c; }
.source-card-icon.sms { background: #f7f1e1; color: #bca26c; }
.source-card .subheading { margin: 15px 0; font-size: 13px; line-height: 1.6; }
.source-total { color: #99af81; font-size: 12px; }
.source-total strong { color: #7c9964; font-size: 18px; font-weight: 600; margin-right: 4px; }
.empty-state h3 { color: #6d8858; font-size: 19px; }
.toast { display: flex; align-items: center; gap: 9px; font-size: 13px; }
.toast svg { width: 17px; height: 17px; }
.design-body > .helper-text { margin: 17px 22px 0; }
.design-group > label:not(.design-toggle):not(.range-label) { display: block; font-size: 13px; color: #7f9668; margin: 0 0 10px; }
.design-group p, .design-group .helper-text { font-size: 12px; }
.segmented button { font-size: 12px; }
.segmented.small button { min-height: 26px; padding: 4px 9px; font-size: 11px; }
.design-toggle { position: relative; display: flex; align-items: center; width: 100%; }
.design-toggle > span:first-child { flex: 1; }
.design-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.toggle-track { position: relative; width: 32px; height: 18px; flex: none; border-radius: 10px; background: #dce7cf; transition: background 150ms; }
.toggle-track::after { content: ""; position: absolute; width: 14px; height: 14px; top: 2px; left: 2px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px #40552414; transition: transform 150ms; }
.design-toggle input:checked + .toggle-track { background: #88a56e; }
.design-toggle input:checked + .toggle-track::after { transform: translateX(14px); }
.design-toggle input:focus-visible + .toggle-track { outline: 2px solid #446b37; outline-offset: 3px; }
.design-group label.design-toggle { font-size: 12px; }
.design-footer { position: sticky; bottom: 0; display: flex; gap: 10px; background: #fff; border-top: 1px solid #e6efd9; }
.design-footer .btn { width: auto; flex: 1; }

/* Full modal detail always wins over a collapsed inline detail, including phone previews. */
.modal .detail-panel.in-modal { display: block !important; position: static !important; width: 100% !important; max-height: none !important; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
.modal .detail-panel.in-modal .detail-header { display: none; }
.modal .detail-panel.in-modal .detail-body { display: block !important; padding: 0; }
.modal .detail-panel.in-modal .detail-section + .detail-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid #edf0e5; }

.task-meta, .helper-text, .detail-meta, .stat-card > span,
.stat-card .stat-label, .child-card > p, .child-stats span,
.page-footnote, .upcoming-row small, .design-group p,
.design-group .helper-text, .form-field small, .range-label,
.family-task .form-field > span, .fact-row { color: var(--muted); }
.original-text { color: #65765c; }
.task-card.completed .task-title { color: #65765b; }
.source-badge.whatsapp { color: #577334; }
.kind-badge { color: #657558; }
.status-badge.todo { color: #776031; }
.status-badge.inProgress { color: #526a7a; }
.status-badge.done { color: #4e6e41; }
.status-badge.overdue { color: #906039; }
.design-header p, .design-group label.design-toggle,
.design-group > label:not(.design-toggle):not(.range-label) { color: #627552; }
.design-group label.design-toggle, .range-label { font-size: 13px; }
.segmented button { color: #75876a; }
.segmented button.active, .segmented button[aria-pressed="true"] { color: #4c7138; }

body[data-layout="wide"] .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
body[data-layout="wide"] .secondary-column .detail-panel { position: static; max-height: none; }
body[data-layout="wide"] .detail-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body[data-layout="wide"] .detail-section + .detail-section { margin: 0; padding-top: 0; border-top: 0; }
body[data-density="compact"] .task-meta { margin-top: 7px; }
body[data-density="compact"] .summary-strip { margin-bottom: 19px; }
body[data-density="compact"] .stat-card { padding: 12px 15px; }
body[data-density="compact"] .detail-header { padding: 16px 18px 13px; }
body[data-density="compact"] .detail-body { padding: 15px 18px; }

@media (max-width: 1299px) {
  .workspace { padding-left: 25px; padding-right: 25px; }
  .dashboard-grid { gap: 19px; }
  .summary-strip { gap: 9px; }
  .stat-card { padding: 14px 13px; }
}
@media (max-width: 1099px) {
  .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .detail-panel { position: static; max-height: none; }
  .secondary-column .detail-panel, .secondary-column .mini-calendar { display: none; }
  .detail-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
  .detail-section + .detail-section { margin: 0; padding-top: 0; border-top: 0; }
  .topbar { gap: 10px; }
  .topbar .search-field { width: 180px; }
  .calendar-cell { min-height: 112px; padding: 6px; }
}
@media (min-width: 761px) and (max-width: 920px) {
  .sidebar { padding-left: 12px; padding-right: 12px; flex-basis: 190px; width: 190px; }
  .workspace { padding-left: 20px; padding-right: 20px; }
  .breadcrumb { display: none; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-header { align-items: flex-start; }
  .calendar-cell { min-height: 95px; padding: 5px; }
  .calendar-event { font-size: 8px; padding: 4px; }
}

@media (max-width: 760px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: calc(77px + env(safe-area-inset-bottom)); padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid #e3ead8; background: #fffffff5; overflow: visible; }
  .sidebar .brand, .sidebar .family-children, .sidebar .sidebar-footer, .sidebar .sidebar-label { display: none; }
  .sidebar nav, .sidebar .nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; }
  .nav-link { flex-direction: column; justify-content: center; gap: 4px; min-height: 61px; padding: 7px 1px; text-align: center; font-size: 10px; line-height: 1.25; border-radius: 9px; }
  .nav-link > span { max-width: 100%; overflow-wrap: anywhere; }
  .nav-link svg { width: 20px; height: 20px; }
  .nav-link.active { background: #f0f5e8; }
  .nav-count { display: none; }
  .workspace { width: 100%; padding: 0 17px calc(98px + env(safe-area-inset-bottom)); }
  .topbar { min-height: 66px; gap: 10px; flex-wrap: wrap; padding: 15px 0 12px; margin-bottom: 22px; }
  .breadcrumb { display: none; }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: #425e38; font-weight: 650; font-size: 13px; }
  .mobile-brand svg { width: 23px; height: 23px; }
  .topbar-actions { gap: 5px; margin-left: auto; }
  .topbar-actions .btn { padding: 7px 9px; font-size: 12px; min-height: 35px; }
  .topbar .search-field { order: 3; flex-basis: 100%; width: 100%; max-width: none; height: 36px; }
  .page-header { align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 19px; }
  .page-intro { margin-bottom: 20px; }
  h1 { font-size: calc(26px * var(--text-scale)); }
  .eyebrow { font-size: 9px; margin-bottom: 7px; }
  .subheading { font-size: .9em; }
  .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
  .stat-card { padding: 12px 13px; }
  .stat-card .stat-label { margin-bottom: 8px; }
  .stat-card > span { display: none; }
  .stat-card strong, .stat-value { font-size: calc(28px * var(--text-scale)); }
  .toolbar { gap: 9px; margin-bottom: 14px; }
  .filter-bar { flex-wrap: wrap; overflow: visible; width: 100%; padding-bottom: 0; }
  .filter-divider { flex: 0 0 100%; width: 100%; height: 0; margin: 0; background: none; }
  .select-label { flex: 1 1 0; min-width: 0; }
  .select-label select { width: 100%; max-width: none; }
  .filter-chip { min-height: 35px; padding: 7px 10px; font-size: 12px; }
  .search-field { width: 100%; max-width: none; }
  .dashboard-grid { display: block; }
  .task-card { padding: 14px; }
  .task-main { gap: 10px; }
  .task-title { font-size: calc(14px * var(--text-scale) * var(--font-multiplier)); }
  .task-meta { font-size: 12px; gap: 6px; }
  .task-actions .btn.icon { width: 25px; height: 25px; }
  .detail-panel { display: none; position: fixed; z-index: 45; top: 0; left: 0; right: 0; bottom: calc(77px + env(safe-area-inset-bottom)); width: auto; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
  .secondary-column:has(.detail-panel.mobile-open) { display: block; }
  .secondary-column .detail-panel.mobile-open { display: block; }
  .detail-body, body[data-layout="wide"] .detail-body { display: block; padding: 20px; }
  .detail-section + .detail-section, body[data-layout="wide"] .detail-section + .detail-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid #edf0e5; }
  .mobile-only { display: inline-flex; }
  .detail-header { position: sticky; top: 0; z-index: 1; background: #fff; }
  .calendar { padding: 15px 12px; }
  .calendar-topbar { gap: 8px; margin-bottom: 16px; }
  .calendar-topbar h2 { font-size: 16px; }
  .calendar-topbar .btn { padding: 6px 8px; min-height: 31px; font-size: 10px; }
  .calendar-cell { position: relative; min-height: 57px; padding: 5px 2px; text-align: center; }
  .day-number { margin: 0 auto 4px; font-size: 12px; }
  .calendar-event { display: none; }
  .calendar-cell:has(.calendar-event)::after { content: ""; display: block; width: 4px; height: 4px; margin: 0 auto; border-radius: 50%; background: #9bb686; }
  .calendar-mobile-agenda { display: block; margin-top: 22px; }
  .children-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
  .child-card { padding: 20px; }
  .toast { bottom: calc(91px + env(safe-area-inset-bottom)); left: 50%; }
  .modal-overlay { padding: 12px; }
  .modal, .modal.wide { max-height: calc(100dvh - 24px); border-radius: 14px; }
  .modal-header { padding: 18px; }
  .modal-body { padding: 18px; }
  .modal-footer { padding: 13px 18px; }
  .form-grid { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .form-field input, .form-field textarea, .form-field select { font-size: 16px; }
}

/* The inspector lives outside these frames; preview sizes never resize its controls. */
body[data-preview="tablet"] .preview-frame { width: min(900px, calc(100vw - 32px)); min-height: calc(100dvh - 40px); margin: 20px auto; border: 1px solid #dce4d3; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px #3c522011; }
body[data-preview="tablet"] .app-shell { min-height: calc(100dvh - 40px); }
body[data-preview="tablet"] .sidebar { min-height: calc(100dvh - 40px); height: calc(100dvh - 40px); }
body[data-preview="tablet"] .workspace { padding-left: 22px; padding-right: 22px; }
body[data-preview="tablet"] .dashboard-grid { grid-template-columns: minmax(0, 1fr); }
body[data-preview="tablet"] .secondary-column { display: none; }
body[data-preview="tablet"] .detail-panel { position: static; max-height: none; }
body[data-preview="tablet"] .detail-body { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
body[data-preview="tablet"] .detail-section + .detail-section { margin: 0; padding: 0; border: 0; }
body[data-preview="tablet"] .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-preview="tablet"] .breadcrumb { display: none; }
body[data-preview="tablet"] .calendar-cell { min-height: 95px; padding: 5px; }
body[data-preview="tablet"] .calendar-event { font-size: 8px; padding: 4px; }

body[data-preview="phone"] .preview-frame { position: relative; width: min(390px, calc(100vw - 24px)); height: min(844px, calc(100dvh - 40px)); min-height: 480px; margin: 20px auto; overflow: hidden; border: 1px solid #d9e2cf; border-radius: 21px; background: var(--canvas); box-shadow: 0 6px 26px #3d522014; }
body[data-preview="phone"] .app-shell { display: block; height: 100%; min-height: 0; }
body[data-preview="phone"] .sidebar { position: absolute; z-index: 40; top: auto; bottom: 0; left: 0; right: 0; width: 100%; height: 77px; padding: 6px 8px; border: 0; border-top: 1px solid #e3ead8; background: #fff; overflow: visible; }
body[data-preview="phone"] .sidebar .brand,
body[data-preview="phone"] .sidebar .family-children,
body[data-preview="phone"] .sidebar .sidebar-footer,
body[data-preview="phone"] .sidebar .sidebar-label { display: none; }
body[data-preview="phone"] .sidebar nav, body[data-preview="phone"] .sidebar .nav-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; }
body[data-preview="phone"] .nav-link { flex-direction: column; justify-content: center; gap: 4px; min-height: 61px; padding: 7px 1px; text-align: center; font-size: 10px; line-height: 1.25; border-radius: 9px; }
body[data-preview="phone"] .nav-link > span { max-width: 100%; overflow-wrap: anywhere; }
body[data-preview="phone"] .nav-link.active { background: #f0f5e8; }
body[data-preview="phone"] .nav-count { display: none; }
body[data-preview="phone"] .workspace { width: 100%; height: 100%; padding: 0 17px 98px; overflow-y: auto; }
body[data-preview="phone"] .topbar { min-height: 66px; gap: 10px; flex-wrap: wrap; padding: 15px 0 12px; margin-bottom: 22px; }
body[data-preview="phone"] .breadcrumb { display: none; }
body[data-preview="phone"] .mobile-brand { display: flex; align-items: center; gap: 8px; color: #425e38; font-weight: 650; font-size: 13px; }
body[data-preview="phone"] .mobile-brand svg { width: 23px; height: 23px; }
body[data-preview="phone"] .topbar-actions { gap: 5px; margin-left: auto; }
body[data-preview="phone"] .topbar-actions .btn { padding: 7px 9px; font-size: 12px; min-height: 35px; }
body[data-preview="phone"] .topbar .search-field { order: 3; flex-basis: 100%; width: 100%; max-width: none; height: 36px; }
body[data-preview="phone"] .page-header { align-items: flex-start; flex-wrap: wrap; gap: 14px; margin-bottom: 19px; }
body[data-preview="phone"] .page-intro { margin-bottom: 20px; }
body[data-preview="phone"] h1 { font-size: calc(26px * var(--text-scale)); }
body[data-preview="phone"] .eyebrow { font-size: 9px; margin-bottom: 7px; }
body[data-preview="phone"] .subheading { font-size: .9em; }
body[data-preview="phone"] .summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; margin-bottom: 20px; }
body[data-preview="phone"] .stat-card { padding: 12px 13px; }
body[data-preview="phone"] .stat-card .stat-label { margin-bottom: 8px; }
body[data-preview="phone"] .stat-card > span { display: none; }
body[data-preview="phone"] .stat-card strong, body[data-preview="phone"] .stat-value { font-size: calc(28px * var(--text-scale)); }
body[data-preview="phone"] .toolbar { gap: 9px; margin-bottom: 14px; }
body[data-preview="phone"] .filter-bar { flex-wrap: wrap; overflow: visible; width: 100%; padding-bottom: 0; }
body[data-preview="phone"] .filter-divider { flex: 0 0 100%; width: 100%; height: 0; margin: 0; background: none; }
body[data-preview="phone"] .select-label { flex: 1 1 0; min-width: 0; }
body[data-preview="phone"] .select-label select { width: 100%; max-width: none; }
body[data-preview="phone"] .filter-chip { min-height: 35px; padding: 7px 10px; font-size: 12px; }
body[data-preview="phone"] .search-field { width: 100%; max-width: none; }
body[data-preview="phone"] .dashboard-grid { display: block; }
body[data-preview="phone"] .task-card { padding: 14px; }
body[data-preview="phone"] .task-main { gap: 10px; }
body[data-preview="phone"] .task-title { font-size: calc(14px * var(--text-scale) * var(--font-multiplier)); }
body[data-preview="phone"] .task-meta { font-size: 12px; gap: 6px; }
body[data-preview="phone"] .task-actions .btn.icon { width: 25px; height: 25px; }
body[data-preview="phone"] .detail-panel { display: none; position: absolute; z-index: 45; top: 0; left: 0; right: 0; bottom: 77px; width: 100%; max-height: none; margin: 0; border: 0; border-radius: 0; box-shadow: none; }
body[data-preview="phone"] .secondary-column:has(.detail-panel.mobile-open) { display: block; }
body[data-preview="phone"] .secondary-column .detail-panel.mobile-open { display: block; }
body[data-preview="phone"] .detail-body { display: block; padding: 20px; }
body[data-preview="phone"] .detail-section + .detail-section { margin-top: 21px; padding-top: 17px; border-top: 1px solid #edf0e5; }
body[data-preview="phone"] .mobile-only { display: inline-flex; }
body[data-preview="phone"] .detail-header { position: sticky; top: 0; z-index: 1; background: #fff; }
body[data-preview="phone"] .calendar { padding: 15px 12px; }
body[data-preview="phone"] .calendar-topbar { gap: 8px; margin-bottom: 16px; }
body[data-preview="phone"] .calendar-topbar h2 { font-size: 16px; }
body[data-preview="phone"] .calendar-topbar .btn { padding: 6px 8px; min-height: 31px; font-size: 10px; }
body[data-preview="phone"] .calendar-cell { position: relative; min-height: 57px; padding: 5px 2px; text-align: center; }
body[data-preview="phone"] .day-number { margin: 0 auto 4px; font-size: 12px; }
body[data-preview="phone"] .calendar-event { display: none; }
body[data-preview="phone"] .calendar-cell:has(.calendar-event)::after { content: ""; display: block; width: 4px; height: 4px; margin: 0 auto; border-radius: 50%; background: #9bb686; }
body[data-preview="phone"] .calendar-mobile-agenda { display: block; margin-top: 22px; }
body[data-preview="phone"] .children-grid { grid-template-columns: minmax(0, 1fr); gap: 13px; }
body[data-preview="phone"] .child-card { padding: 20px; }
body[data-preview="phone"] .toast { bottom: 109px; left: 50%; max-width: min(360px, calc(100vw - 40px)); }

/* Local source connection and reviewed imports. */
.data-mode { flex: none; }
.data-mode button { white-space: nowrap; }
.connection-card { margin-bottom: 24px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.connection-card > .section-heading { align-items: flex-start; gap: 18px; }
.connection-title { display: flex; align-items: center; gap: 14px; }
.connection-title .source-card-icon { flex: none; margin: 0; }
.connection-title h2 { margin: 0 0 4px; }
.connection-title p { margin: 0; }
.connection-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 18px 0 12px; }
.connection-summary span, .connection-summary strong { display: block; }
.connection-summary span { margin-bottom: 5px; color: var(--muted); font-size: 12px; }
.connection-summary strong { font-size: 14px; font-weight: 600; }
.connection-actions, .pairing-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; margin-top: 18px; }
.connection-card .error { margin: 14px 0 0; }
.connection-notice { padding: 12px 14px; border-radius: 9px; background: #f4f4eb; color: #657049; font-size: 13px; line-height: 1.6; }
.connection-empty { margin: 20px 0; padding: 18px; border: 1px dashed #d4ddcb; border-radius: 11px; background: #fbfcf8; }
.connection-empty strong { display: block; margin-bottom: 5px; font-size: 14px; }
.connection-empty p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.connection-profiles { margin-top: 24px; }
.connection-profiles > h3 { margin-bottom: 8px; font-size: 14px; }
.profile-row { display: flex; justify-content: space-between; align-items: center; gap: 18px; padding: 16px 0; border-top: 1px solid var(--border); }
.profile-row > div { min-width: 0; }
.profile-row strong { display: block; font-size: 14px; }
.profile-row p { margin: 5px 0 8px; color: var(--muted); font-size: 12px; }
.profile-row .kind-badge { margin-right: 5px; }
.profile-row .btn { flex: none; }
.connection-instructions { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.connection-instructions > summary, .revision-card > summary { cursor: pointer; color: var(--green); font-size: 13px; font-weight: 600; }
.connection-instructions ol { margin: 16px 0; padding-left: 20px; line-height: 1.75; color: var(--muted); font-size: 13px; }
.connection-instructions li + li { margin-top: 8px; }
.pairing-actions .pairing-field { flex: 1 1 280px; margin-bottom: 0; }
.pairing-actions > .helper-text { flex-basis: 100%; margin: 0; }
.pairing-field input { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; }
.preview-summary { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.preview-summary strong { font-size: 17px; }
.preview-summary > span { color: var(--muted); font-size: 13px; }
.import-preview-list { display: grid; gap: 12px; margin-top: 18px; }
.preview-row { padding: 16px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.preview-row.ambiguous { border-color: #ddcfae; background: #fdfaf3; }
.preview-row .section-heading { margin-bottom: 8px; gap: 12px; align-items: flex-start; }
.preview-row h3 { font-size: 14px; margin: 0; overflow-wrap: anywhere; }
.preview-row > p { margin: 7px 0; font-size: 13px; white-space: pre-wrap; }
.source-raw { margin: 12px 0; }
.source-raw > span, .source-raw > small { display: block; color: var(--muted); font-size: 12px; }
.source-raw > p { margin: 6px 0; padding: 10px 12px; border-radius: 8px; background: #f6f7f1; color: #526047; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.revision-card { margin-top: 10px; padding: 12px; border: 1px solid var(--border); border-radius: 9px; }
.revision-card > p { margin: 12px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; font-size: 13px; }
@media (max-width: 760px) {
  .connection-card { padding: 18px; }
  .connection-card > .section-heading { flex-direction: column; gap: 12px; }
  .connection-summary { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .profile-row { flex-direction: column; align-items: stretch; gap: 12px; }
  .profile-row .btn { align-self: flex-start; }
  .data-mode button { padding: 6px 8px; font-size: 11px; }
  .preview-row .section-heading { flex-direction: column; }
}
body[data-preview="phone"] .connection-card { padding: 18px; }
body[data-preview="phone"] .connection-card > .section-heading { flex-direction: column; gap: 12px; }
body[data-preview="phone"] .connection-summary { grid-template-columns: minmax(0, 1fr); gap: 12px; }
body[data-preview="phone"] .profile-row { flex-direction: column; align-items: stretch; gap: 12px; }
body[data-preview="phone"] .profile-row .btn { align-self: flex-start; }
body[data-preview="phone"] .data-mode button { padding: 6px 8px; font-size: 11px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Shared family state and the local learning library. */
.shared-banner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 0 0 24px; padding: 12px 16px; background: #edf3ea; border: 1px solid #d9e4d3; border-radius: 11px; color: var(--green); }
.shared-banner > div { flex: 1 1 240px; }
.shared-banner strong { font-size: 13px; font-weight: 600; }
.shared-banner p { margin: 4px 0 0; font-size: 12px; color: #536448; line-height: 1.5; }
.shared-banner.attention { background: #fcf6e7; border-color: #e8dcb9; color: #7d622a; }
.shared-banner.attention p { color: #796844; }
.service-summary { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; padding: 18px 0; margin: 15px 0 8px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.service-summary span, .service-summary small { display: block; color: var(--muted); font-size: 12px; }
.service-summary strong { display: block; margin: 5px 0; font-size: 14px; font-weight: 600; }
.learning-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 24px 0 10px; }
.learning-column { min-width: 0; }
.learning-column > h3, .learning-column .section-heading h3 { font-size: 14px; margin: 0 0 12px; letter-spacing: 0; }
.learning-column .section-heading { margin-bottom: 0; gap: 10px; flex-wrap: wrap; }
.learning-column .section-heading .text-button { font-size: 12px; margin-bottom: 12px; }
.learning-column h4 { font-size: 13px; letter-spacing: 0; margin: 18px 0 8px; color: #536448; }
.learning-column .original-text { background: #f4f6f0; color: #374737; padding: 15px; font-size: 14px; line-height: 1.9; margin: 0 0 10px; }
.learning-column .translation-text { font-size: 14px; color: #465442; line-height: 1.75; white-space: pre-wrap; overflow-wrap: anywhere; }
.explanation-text { font-size: 15px; line-height: 1.7; white-space: pre-wrap; color: var(--ink); margin: 12px 0; overflow-wrap: anywhere; }
.analysis-label { display: inline-block; padding: 4px 8px; background: #edf3ea; color: #52654b; border-radius: 5px; font-size: 11px; line-height: 1.5; }
.manual-russian { margin-top: 19px; padding-top: 1px; border-top: 1px dashed var(--border); }
.manual-russian h4 { margin-top: 14px; }
.modal .learning-layout { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.modal .learning-layout .russian-column { border-left: 1px solid var(--border); padding-left: 22px; }
.annotated-text { overflow: visible; }
.phrase-unit { position: relative; display: inline; }
.phrase-mark { display: inline; border: 0; border-bottom: 1px dashed #5f8151; border-radius: 2px; padding: 1px 0; margin: 0; background: #e5eddb; color: #24553b; line-height: inherit; font: inherit; text-align: inherit; white-space: inherit; }
.phrase-mark:hover, .phrase-mark:focus-visible { background: #d6e6c7; }
.phrase-tooltip { display: none; position: absolute; z-index: 15; left: 0; bottom: calc(100% + 9px); width: max-content; max-width: 220px; border: 1px solid #d8e1d1; border-radius: 8px; padding: 9px 11px; background: #fff; color: #26392b; font-size: 12px; line-height: 1.4; font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif; white-space: normal; box-shadow: 0 4px 15px #23392512; }
.phrase-tooltip small { display: block; margin-top: 5px; color: var(--muted); font-size: 11px; }
.phrase-unit:hover .phrase-tooltip, .phrase-unit:focus-within .phrase-tooltip { display: block; }
.phrase-overlay { position: fixed; z-index: 150; inset: 0; display: flex; align-items: center; justify-content: center; padding: 20px; background: #1f302d45; }
.phrase-popover { display: flex; flex-direction: column; width: min(100%, 460px); max-height: calc(100dvh - 40px); border: 1px solid var(--border); border-radius: 15px; background: #fff; overflow: hidden; box-shadow: 0 8px 32px #162c2420; }
.phrase-popover .modal-header { align-items: flex-start; }
.phrase-popover h2 { font-size: 23px; line-height: 1.4; word-break: break-word; }
.phrase-popover h3 { font-size: 14px; margin-top: 22px; margin-bottom: 10px; }
.phrase-meaning { font-size: 18px; margin: 14px 0 12px; line-height: 1.5; }
.morpheme-list { display: grid; gap: 8px; }
.morpheme { display: grid; grid-template-columns: minmax(65px, auto) minmax(0, 1fr); align-items: baseline; gap: 14px; padding: 9px 11px; background: #f5f7f1; border-radius: 7px; }
.morpheme strong { color: #285a45; font-size: 15px; overflow-wrap: anywhere; }
.morpheme span { font-size: 13px; line-height: 1.5; color: #536248; }
.morpheme span small { display: block; margin-bottom: 3px; color: var(--muted); font-size: 11px; }
.phrase-context { padding: 12px 14px; background: #f4f6f0; border-radius: 8px; font-size: 14px; line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.phrase-context mark { color: #24553b; background: #dce8d0; border-radius: 3px; padding: 1px 2px; }
.library-materials { margin-top: 22px; padding: 16px; border: 1px solid #e8ceaa; border-radius: 14px; background: #fffbf4; }
.library-materials h3 { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; color: #694b27; font-size: 15px; font-weight: 700; }
.library-materials .count-pill { background: #f4dfbb; color: #694b27; }
.library-materials .attachment { width: 100%; }
.schedule-toolbar { justify-content: space-between; }
.schedule-toolbar .filter-bar { flex-wrap: wrap; overflow: visible; }
.schedule-total { flex: none; color: var(--muted); font-size: 13px; }
.schedule-section { margin-top: 26px; }
.schedule-section .section-heading h2 { color: var(--ink); }
.schedule-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 20px; align-items: start; }
.schedule-card { min-width: 0; padding: 22px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.schedule-card-header { display: flex; align-items: center; flex-wrap: wrap; justify-content: space-between; gap: 9px; margin-bottom: 15px; }
.schedule-type { display: inline-flex; align-items: center; gap: 7px; padding: 6px 9px; border-radius: 7px; background: #edf3ea; color: #285a45; font-size: 12px; font-weight: 600; }
.schedule-type.weekly { background: #fff6e2; color: #775400; }
.schedule-type svg { width: 17px; height: 17px; }
.schedule-card > h3 { margin: 0 0 11px; color: var(--ink); font-size: calc(20px * var(--text-scale)); line-height: 1.4; overflow-wrap: anywhere; }
.schedule-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; color: var(--muted); font-size: 12px; margin-bottom: 18px; }
.schedule-meta > span:last-child { flex-basis: 100%; margin-top: 2px; }
.schedule-russian { margin-bottom: 18px; }
.schedule-russian h4 { margin: 0 0 8px; color: #285a45; font-size: 13px; }
.schedule-russian p { max-height: 280px; overflow-y: auto; margin: 0; padding-right: 5px; font-size: calc(14px * var(--text-scale)); line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; color: var(--ink); }
.schedule-preview { display: block; width: 100%; overflow: hidden; margin: 0 0 12px; padding: 0; border: 1px solid #e5d3a7; border-radius: 10px; background: #fffdf7; text-align: left; color: #775400; }
.schedule-preview img { display: block; width: 100%; height: 240px; object-fit: contain; padding: 10px; background: #fff; }
.schedule-preview > span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 10px; font-size: 13px; font-weight: 600; }
.schedule-preview:hover { border-color: #b18a40; }
.schedule-materials .attachment { margin-top: 10px; }
.schedule-original { margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--border); }
.schedule-original summary { padding: 5px 0; color: var(--green); font-size: 13px; cursor: pointer; }
.schedule-original p { max-height: 180px; overflow-y: auto; margin: 10px 0 0; padding: 12px; background: #f5f7f1; border-radius: 8px; color: var(--ink); font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.schedule-card-footer { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 15px; }
@media (max-width: 760px) {
  .schedule-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
  .schedule-card { padding: 17px; }
  .schedule-card > h3 { font-size: calc(18px * var(--text-scale)); }
  .schedule-preview img { height: 210px; }
}
body[data-preview="phone"] .schedule-grid { grid-template-columns: minmax(0, 1fr); gap: 15px; }
body[data-preview="phone"] .schedule-card { padding: 17px; }
body[data-preview="phone"] .schedule-card > h3 { font-size: calc(18px * var(--text-scale)); }
body[data-preview="phone"] .schedule-preview img { height: 210px; }
.material-viewer { width: 100%; min-height: 120px; }
.pdf-viewer { width: 100%; height: min(66dvh, 680px); border: 1px solid var(--border); border-radius: 8px; background: #f0f1ec; display: block; }
.image-viewer { display: block; max-width: 100%; max-height: 68dvh; width: auto; height: auto; margin: 0 auto; border-radius: 8px; }
.audio-viewer { display: flex; align-items: center; gap: 18px; padding: 34px 18px; border: 1px solid var(--border); background: #f4f7ef; border-radius: 10px; }
.audio-viewer > svg { width: 30px; height: 30px; color: var(--green); }
.audio-viewer audio { min-width: 0; width: 100%; }
.material-empty { text-align: center; border: 1px solid var(--border); border-radius: 10px; background: #f7f8f3; padding: 36px 24px; }
.material-empty > svg { color: #7d9472; width: 36px; height: 36px; margin-bottom: 13px; }
.material-empty h3 { font-size: 18px; }
.material-empty p { max-width: 440px; margin: 0 auto 8px; color: #596a50; line-height: 1.7; }
.material-file-error { background: #fff2ee; border-color: #edb4a6; }
.material-file-error > svg, .material-file-error h3 { color: #a6382b; }
.docx-viewer { border: 1px solid #b5cceb; border-radius: 10px; padding: 18px; background: #f6f9ff; }
.docx-viewer-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 12px; }
.docx-viewer-heading h4 { margin: 0; color: #222b27; font-size: 15px; }
.docx-viewer .attachment-kind { color: #275b9b; border-color: #b5cceb; }
.docx-viewer > .btn { margin-bottom: 15px; }
.docx-viewer .extracted-text { max-height: min(58dvh, 650px); padding: 14px; border: 1px solid #d6e2f2; border-radius: 8px; background: #fff; font-size: 14px; color: #222b27; }
.extracted-text { white-space: pre-wrap; overflow-wrap: anywhere; font-family: inherit; font-size: 13px; line-height: 1.7; color: #465442; max-height: 320px; overflow: auto; }
.pending-changes { padding: 0; margin: 20px 0; list-style: none; display: grid; gap: 10px; }
.pending-changes li { border: 1px solid var(--border); border-radius: 9px; padding: 12px; overflow-wrap: anywhere; }
.pending-changes strong, .pending-changes span { display: block; }
.pending-changes span { color: var(--muted); font-size: 13px; margin-top: 5px; }
.pending-changes p { white-space: pre-wrap; margin: 10px 0 0; font-size: 13px; }
@media (max-width: 760px) {
  .shared-banner { gap: 8px; margin-bottom: 18px; padding: 11px 12px; }
  .shared-banner > div { flex-basis: 100%; }
  .service-summary { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .modal .learning-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .modal .learning-layout .russian-column { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
  .phrase-overlay { padding: 12px; }
  .phrase-popover { max-height: calc(100dvh - 24px); }
  .phrase-tooltip { display: none !important; }
  .pdf-viewer { height: 60dvh; }
  .audio-viewer { gap: 9px; padding: 24px 10px; }
}
body[data-preview="phone"] .shared-banner { gap: 8px; margin-bottom: 18px; padding: 11px 12px; }
body[data-preview="phone"] .shared-banner > div { flex-basis: 100%; }
body[data-preview="phone"] .service-summary,
body[data-preview="phone"] .modal .learning-layout { grid-template-columns: minmax(0, 1fr); }
body[data-preview="phone"] .modal .learning-layout .russian-column { border-left: 0; border-top: 1px solid var(--border); padding: 18px 0 0; }
body[data-preview="phone"] .phrase-tooltip { display: none !important; }

/* Keep the source file beside its language help on a wide screen. */
.material-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; }
.material-original, .material-reading { min-width: 0; }
.material-original > h3, .material-analysis > h3 { margin: 0 0 14px; font-size: 15px; letter-spacing: 0; }
.material-analysis h4 { margin: 18px 0 9px; font-size: 14px; letter-spacing: 0; }
.material-reading .explanation-text { font-size: 14px; }
.material-analysis > .btn { margin-top: 13px; }
.material-check-note { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.material-translation .translation-text { max-height: 240px; overflow: auto; color: #465442; font-size: 14px; line-height: 1.75; padding-right: 5px; }
.material-translation .translation-complete { max-height: none; overflow: visible; }
.material-extraction { margin-top: 20px; }
.material-extraction .extracted-text { max-height: 280px; overflow: auto; padding: 0 4px 5px; font-size: 14px; line-height: 1.8; }
.material-extraction .phrase-tooltip { left: 0; bottom: auto; top: calc(100% + 5px); max-width: 200px; }
@media (min-width: 950px) {
  .modal.wide.material-modal { max-width: 1280px; }
  .material-grid { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 28px; }
  .material-original .pdf-viewer { height: min(72dvh, 780px); }
  .material-reading { max-height: min(77dvh, 825px); overflow: auto; padding-left: 24px; padding-right: 5px; border-left: 1px solid var(--border); }
}
body[data-preview="tablet"] .modal.wide.material-modal { max-width: 720px; }
body[data-preview="phone"] .modal { max-width: 390px; }
body[data-preview="phone"] .modal.wide.material-modal { max-width: 390px; }
body[data-preview="tablet"] .material-grid,
body[data-preview="phone"] .material-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
body[data-preview="tablet"] .material-reading,
body[data-preview="phone"] .material-reading { max-height: none; overflow: visible; padding: 0; border: 0; }
body[data-preview="phone"] .material-original .pdf-viewer { height: 60dvh; }

.material-reading .explanation-text { max-height: 140px; overflow: auto; padding-right: 5px; }
.material-phrases { margin: 16px 0; }
.material-phrases > h4 { margin: 0 0 9px; }
.material-phrase-list { display: flex; flex-wrap: wrap; align-content: flex-start; gap: 7px; padding: 3px 4px 4px 1px; }
.material-phrase-list .phrase-unit { display: inline-block; max-width: 100%; }
.phrase-chip { padding: 5px 9px; border: 1px solid #d5e1cc; border-radius: 7px; background: #edf3e6; color: #285a45; font-size: 13px; line-height: 1.5; text-align: left; overflow-wrap: anywhere; max-width: 100%; }
.phrase-chip:hover { background: #e0ecd5; border-color: #b7cca9; }

/* Reviewed school documents, independent from family task completion. */
.digitization-notice { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 16px 0; padding: 12px 16px; border: 1px solid #d7e3d2; border-radius: 10px; background: #eef5eb; color: #285a45; font-size: 13px; line-height: 1.5; }
.digitization-notice.attention { background: #fff7e5; border-color: #ead8ab; color: #71531d; }
.digitization-notice .btn { flex: none; }
.timetable-board, .bell-board, .learning-plan-card { min-width: 0; margin-top: 20px; padding: 24px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.structured-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; margin-bottom: 16px; }
.structured-header > div { min-width: 0; }
.structured-header h2 { margin: 6px 0 8px; color: var(--ink); font-size: calc(22px * var(--text-scale)); line-height: 1.35; overflow-wrap: anywhere; }
.structured-header .btn { flex: none; }
.structured-header .helper-text { margin: 0; font-size: 13px; }
.structured-note { margin: 12px 0 18px; padding: 12px 14px; border-radius: 8px; background: #f5f7f1; color: #465442; font-size: 14px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.period-note { margin: 0 0 15px; color: #657265; font-size: 13px; line-height: 1.5; }
.digitized-stale { margin: 12px 0; padding: 12px 14px; border-left: 3px solid #9a854e; background: #f8f3e7; color: #6e542c; font-size: 13px; line-height: 1.6; }
.is-stale .lesson-table { filter: grayscale(1); }
.is-stale .assignment-item { background: #f5f5f1; }
.timetable-scroll { display: block; overflow-x: auto; border: 1px solid #dce5d7; border-radius: 10px; overscroll-behavior-x: contain; }
.lesson-table tr > th:first-child { position: sticky; left: 0; z-index: 1; }
.timetable-scroll-hint { display: none; align-items: center; justify-content: center; gap: 7px; margin: 9px 0 0; color: var(--muted); font-size: 12px; }
.timetable-scroll-hint svg { flex: none; width: 14px; height: 14px; }
.weekly-timetables { margin-top: 23px; }
.weekly-timetables > .section-heading { margin-bottom: 0; }
.weekly-unavailable { margin: 18px 0 0; padding: 13px 15px; background: #f0f2eb; border: 1px solid var(--border); border-radius: 10px; color: #5a6755; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.lesson-table { width: 100%; min-width: 660px; border-spacing: 0; border-collapse: separate; table-layout: fixed; text-align: left; }
.lesson-table th, .lesson-table td { padding: 12px 10px; border-right: 1px solid #e2e8dd; border-bottom: 1px solid #e2e8dd; vertical-align: top; font-size: 13px; line-height: 1.45; }
.lesson-table tr > :last-child { border-right: 0; }
.lesson-table tbody tr:last-child > * { border-bottom: 0; }
.lesson-table thead th { color: #285a45; background: #eef4e9; font-size: 13px; font-weight: 600; }
.lesson-table thead th:first-child, .lesson-table tbody th { width: 90px; background: #f8faf5; }
.lesson-table tbody th strong { display: block; color: #465442; font-size: 16px; margin-bottom: 5px; }
.lesson-table tbody th span { display: block; font-size: 12px; color: #657265; font-variant-numeric: tabular-nums; }
.lesson-table td strong { color: #222b27; font-size: 13px; font-weight: 600; white-space: pre-line; overflow-wrap: anywhere; }
.lesson-table small { display: block; margin-top: 5px; font-size: 12px; color: #657265; overflow-wrap: anywhere; }
.lesson-table th.is-today { background: #285a45; color: #fff; }
.lesson-table th.is-today small { color: #e0edd9; }
.lesson-table td.is-today { background: #f0f6ed; }
.lesson-table td.source-blank { background: #f1f2ef; }
.lesson-table td.source-blank strong { color: #657265; font-weight: 400; }
.schedule-days { display: flex; gap: 6px; margin-bottom: 18px; }
.schedule-days button { position: relative; flex: 1; min-width: 0; padding: 10px 5px; border: 1px solid #dce5d7; border-radius: 8px; background: #f7faf4; color: #52634b; font-size: 13px; font-weight: 600; }
.schedule-days button.active { border-color: #285a45; background: #285a45; color: white; }
.today-dot { display: block; width: 4px; height: 4px; margin: 4px auto 0; border-radius: 50%; background: currentColor; }
.timetable-agenda { display: block; }
.timetable-daily { margin-top: 18px; padding-top: 10px; border-top: 1px solid var(--border); }
.timetable-daily > summary { padding: 7px 0; color: var(--green); font-size: 13px; cursor: pointer; }
.timetable-daily[open] > summary { margin-bottom: 13px; }
.today-label { padding: 5px 8px; border-radius: 6px; background: #eef5e8; color: #285a45; font-size: 12px; }
.lesson-row { display: grid; grid-template-columns: 115px minmax(0, 1fr); gap: 17px; padding: 14px 0; border-top: 1px solid #e8eddf; }
.lesson-clock strong { display: block; color: #285a45; font-size: 13px; font-variant-numeric: tabular-nums; }
.lesson-clock span { display: block; margin-top: 5px; color: #657265; font-size: 12px; }
.lesson-row h4 { margin: 0; color: #222b27; font-size: 15px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.lesson-row p { margin: 7px 0 0; font-size: 13px; line-height: 1.5; color: #657265; }
.lesson-row.source-blank h4 { color: #657265; font-weight: 400; }
.structured-source { margin-top: 20px; padding-top: 13px; border-top: 1px solid var(--border); }
.structured-source summary, .schedule-documents > summary { padding: 7px 0; color: #285a45; font-size: 14px; cursor: pointer; }
.structured-source h4 { font-size: 13px; margin: 16px 0 7px; }
.structured-source p { max-height: 240px; overflow: auto; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.timetable-notes { margin-top: 18px; border-top: 1px solid var(--border); padding-top: 10px; }
.timetable-notes > summary { padding: 7px 0; color: #285a45; font-size: 13px; cursor: pointer; }
.timetable-notes .structured-note { margin: 9px 0 0; }
.reviewed-learning { margin: 20px 0; padding: 13px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.reviewed-learning > summary { color: #285a45; font-size: 14px; cursor: pointer; line-height: 1.5; }
.reviewed-learning > [data-library-for] { margin-top: 17px; }
.material-digitized { margin-bottom: 22px; padding: 16px; border: 1px solid #d2e0ca; border-radius: 10px; background: #f4f8ef; }
.material-digitized h3 { margin: 0 0 10px; color: #285a45; font-size: 15px; line-height: 1.5; }
.material-digitized h4 { margin: 0 0 9px; color: #222b27; font-size: 14px; line-height: 1.5; }
.material-digitized-day { margin: 12px 0 8px; color: #285a45; font-size: 13px; font-weight: 600; }
.material-digitized-list { margin: 12px 0; padding: 0; list-style: none; max-height: 310px; overflow: auto; }
.material-digitized-list > li { padding: 10px 0; border-top: 1px solid #dfe8d8; font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.material-digitized-list strong { display: block; color: #222b27; white-space: pre-line; }
.material-digitized-list .digitized-time { display: block; color: #52704b; font-size: 12px; font-variant-numeric: tabular-nums; }
.material-digitized-list summary { color: #285a45; font-size: 12px; cursor: pointer; }
.material-digitized-list p { margin: 6px 0; font-size: 13px; white-space: pre-wrap; }
.schedule-documents { margin-top: 26px; padding: 16px 20px; border: 1px solid var(--border); border-radius: 12px; background: #fafbf6; }
.bell-times { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 9px; }
.bell-time { display: flex; flex-direction: column; gap: 7px; padding: 12px; border: 1px solid #e1e8dc; border-radius: 8px; background: #f7faf4; font-size: 13px; }
.bell-time strong { color: #285a45; font-variant-numeric: tabular-nums; }
.bell-time.break, .bell-time.lunch { background: #fff8e9; border-color: #ebdfc5; }
.learning-plan-list { margin: 0; padding: 0; list-style: none; }
.learning-plan-list > li { margin-top: 12px; padding: 15px; border: 1px solid #e1e8dc; border-radius: 9px; background: #f7faf4; color: #222b27; font-size: 14px; line-height: 1.65; }
.learning-plan-list > li > span { display: block; color: #657265; font-size: 12px; margin-top: 4px; }
.learning-plan-list p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.learning-plan-list summary { color: #285a45; font-size: 12px; cursor: pointer; margin-top: 8px; }
.school-event-row { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; align-items: start; gap: 13px; padding: 16px; margin-bottom: 10px; border: 1px solid #e1e7db; border-radius: 10px; background: white; }
.school-event-icon { display: flex; align-items: center; justify-content: center; width: 36px; height: 36px; border-radius: 9px; background: #f2eadf; color: #825528; }
.school-event-row.exam .school-event-icon { background: #fbe8e2; color: #a74430; }
.school-event-row.holiday .school-event-icon { background: #e7f0dd; color: #44633b; }
.school-event-type { color: #657265; font-size: 12px; }
.school-event-row h3 { margin: 5px 0; font-size: 15px; line-height: 1.45; }
.school-event-row .text-button { color: #222b27; font-size: 15px; font-weight: 600; text-align: left; overflow-wrap: anywhere; }
.school-event-row p { margin: 5px 0 0; color: #657265; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.school-event-row .btn { margin-top: 5px; }
.calendar-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 0 0 19px; color: #657265; font-size: 12px; }
.calendar-legend > span { display: inline-flex; align-items: center; gap: 7px; }
.legend-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #9aad88; }
.legend-dot.exam { background: #cf765d; }.legend-dot.holiday { background: #789662; }.legend-dot.event { background: #b49053; }
.school-calendar-event { display: flex; align-items: flex-start; gap: 4px; background: #fff6e7; color: #795829; border-left: 2px solid #b49053; }
.school-calendar-event.exam { background: #fdefe8; color: #97412f; border-left-color: #cf765d; }
.school-calendar-event.holiday { background: #edf4e5; color: #486540; border-left-color: #789662; }
.school-calendar-event svg { flex: none; width: 13px; height: 13px; margin-top: 2px; }
.school-calendar-event span { min-width: 0; overflow-wrap: anywhere; }
.assignment-items > h4 { margin: 10px 0 14px; color: #285a45; font-size: 15px; line-height: 1.5; }
.assignment-item-list { display: grid; gap: 9px; }
.assignment-item { padding: 13px; border: 1px solid #dce5d7; border-radius: 9px; background: #f8faf5; }
.assignment-item.completed { background: #eef5e8; }
.assignment-item-label { display: flex; align-items: flex-start; gap: 10px; color: #222b27; font-size: 14px; line-height: 1.6; cursor: pointer; }
.assignment-item-label input { flex: none; width: 19px; height: 19px; margin: 3px 0 0; accent-color: #285a45; }
.assignment-item-label input:disabled + span { color: #657265; }
.assignment-item.completed .assignment-item-label span { color: #44633b; }
.assignment-item-heading { display: block; color: #222b27; font-size: 14px; line-height: 1.6; }
.assignment-item > small { display: block; margin-top: 7px; color: #657265; font-size: 12px; }
.assignment-item p { margin: 8px 0 0; color: #465442; font-size: 13px; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.assignment-item summary { margin-top: 9px; color: #285a45; font-size: 12px; cursor: pointer; }
@media (max-width: 760px) {
  .timetable-board, .bell-board, .learning-plan-card { padding: 17px; }
  .structured-header { flex-wrap: wrap; gap: 12px; }
  .structured-header h2 { font-size: calc(19px * var(--text-scale)); }
  .timetable-scroll-hint { display: flex; }
  .timetable-agenda { display: block; }
  .schedule-days { display: flex; }
  .lesson-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
  .bell-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .school-event-row { grid-template-columns: 32px minmax(0, 1fr); padding: 13px; gap: 11px; }
  .school-event-row > .btn { grid-column: 2; justify-self: start; margin-top: 0; }
  .school-event-icon { width: 32px; height: 32px; }
  .digitization-notice { align-items: flex-start; flex-direction: column; gap: 7px; }
}
body[data-preview="phone"] .timetable-board, body[data-preview="phone"] .bell-board, body[data-preview="phone"] .learning-plan-card { padding: 17px; }
body[data-preview="phone"] .structured-header { flex-wrap: wrap; gap: 12px; }
body[data-preview="phone"] .structured-header h2 { font-size: calc(19px * var(--text-scale)); }
body[data-preview="phone"] .timetable-scroll-hint,
body[data-preview="tablet"] .timetable-scroll-hint { display: flex; }
body[data-preview="phone"] .timetable-agenda { display: block; }
body[data-preview="phone"] .schedule-days { display: flex; }
body[data-preview="phone"] .lesson-row { grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
body[data-preview="phone"] .bell-times { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-preview="phone"] .school-event-row { grid-template-columns: 32px minmax(0, 1fr); padding: 13px; gap: 11px; }
body[data-preview="phone"] .school-event-row > .btn { grid-column: 2; justify-self: start; margin-top: 0; }
body[data-preview="phone"] .school-event-icon { width: 32px; height: 32px; }
body[data-preview="phone"] .digitization-notice { align-items: flex-start; flex-direction: column; gap: 7px; }

/* School administration notices keep the same original message and family task. */
.organization-categories { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 25px; }
.organization-categories .filter-chip { background: #fff; border-color: var(--border); min-height: 42px; padding: 9px 12px; color: #536252; }
.organization-categories .filter-chip svg { width: 17px; height: 17px; }
.organization-categories .filter-chip.active { color: var(--green); background: #e9f0e4; border-color: #b8cbb4; }
.category-count { min-width: 22px; padding: 1px 6px; border-radius: 6px; background: #f1f3ec; color: #5c6d58; text-align: center; font-size: 12px; }
.organization-categories .active .category-count { background: #dce8d6; }
.organization-section > .section-heading { flex-wrap: wrap; gap: 12px; }
.organization-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.organization-grid > .empty-state { grid-column: 1 / -1; }
.organization-card { min-width: 0; padding: 21px; border: 1px solid var(--border); border-radius: var(--radius); background: #fff; }
.organization-card-top { display: flex; align-items: center; gap: 9px; margin-bottom: 15px; flex-wrap: wrap; }
.organization-card-top .source-badge { margin-left: auto; }
.organization-category-icon { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; color: #537247; background: #edf3e6; }
.organization-category-icon.excursion { color: #336b74; background: #e7f2f2; }
.organization-category-icon.clothing { color: #795f91; background: #f1ebf7; }
.organization-category-icon.meeting { color: #496c99; background: #eaf0f8; }
.organization-category-icon.documents { color: #886528; background: #faf1dd; }
.organization-category-label { color: #5a6b57; font-size: 12px; font-weight: 600; }
.organization-card h2 { margin-bottom: 10px; }
.organization-title { border: 0; padding: 0; background: none; text-align: left; color: var(--ink); font: inherit; line-height: 1.35; overflow-wrap: anywhere; }
.organization-title:hover { color: var(--green); }
.organization-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; margin-bottom: 13px; overflow-wrap: anywhere; }
.organization-meta > span { max-width: 100%; }
.organization-preview { color: #566354; font-size: .96em; line-height: 1.6; -webkit-line-clamp: 3; overflow-wrap: anywhere; }
.organization-family { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding-top: 12px; margin-top: 15px; border-top: 1px solid #edf0e7; font-size: 12px; }
.organization-family > span, .organization-family > div, .organization-due, .organization-files { display: inline-flex; align-items: center; gap: 6px; }
.organization-family > div { flex-wrap: wrap; }
.organization-family > span { color: #65755f; }
.organization-family svg, .organization-files svg { width: 15px; height: 15px; }
.organization-due { color: #596956; }
.organization-card-footer { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.organization-card-footer .btn { margin-left: auto; }
.organization-files { color: #62755b; font-size: 12px; }
.organization-dates { margin: 0 0 28px; }
.organization-dates > .section-heading { flex-wrap: wrap; gap: 12px; }
@media (max-width: 950px) { .organization-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .organization-card { padding: 17px; }
  .organization-categories { gap: 6px; margin-bottom: 19px; }
  .organization-categories .filter-chip { padding: 8px 10px; font-size: 12px; }
  .organization-card h2 { font-size: calc(18px * var(--text-scale)); }
}
body[data-preview="tablet"] .organization-grid,
body[data-preview="phone"] .organization-grid { grid-template-columns: minmax(0, 1fr); }
body[data-preview="phone"] .organization-card { padding: 17px; }
body[data-preview="phone"] .organization-categories { gap: 6px; margin-bottom: 19px; }
body[data-preview="phone"] .organization-categories .filter-chip { padding: 8px 10px; font-size: 12px; }

/* Reviewed school letters keep the complete translation beside a discoverable source. */
.policy-list { display: grid; gap: 24px; }
.policy-card { min-width: 0; padding: 25px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
.policy-card-header { display: flex; align-items: start; justify-content: space-between; flex-wrap: wrap; gap: 18px; }
.policy-card-header > div { min-width: 0; flex: 1 1 400px; }
.policy-card-header h2 { margin: 12px 0 10px; font-size: calc(24px * var(--text-scale)); line-height: 1.35; overflow-wrap: anywhere; }
.policy-category { display: inline-flex; align-items: center; gap: 8px; padding: 7px 10px; border-radius: 9px; background: #eaf2e6; color: #285a45; font-size: 13px; font-weight: 600; }
.policy-category svg { width: 17px; height: 17px; }
.policy-meta { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 15px; color: var(--muted); font-size: 13px; }
.policy-notes { margin: 19px 0 12px; padding: 14px 16px; border-left: 3px solid #a6bd91; border-radius: 0 8px 8px 0; color: #52634b; background: #f4f6ee; line-height: 1.65; white-space: pre-wrap; overflow-wrap: anywhere; }
.policy-source-pages { display: flex; flex-wrap: wrap; gap: 5px; margin: 8px 0; }
.policy-source-pages:empty { display: none; }
.policy-full { margin-top: 17px; border-top: 1px solid var(--border); }
.policy-full > summary { padding: 17px 0 8px; color: #285a45; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.5; }
.policy-phrases { margin: 22px 0; padding: 17px 0; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.policy-phrases h3 { margin: 0 0 6px; font-size: 15px; }
.policy-phrase-list { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.policy-phrase-list .phrase-chip { max-width: 100%; text-align: left; overflow-wrap: anywhere; }
.policy-reading { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(240px, .85fr); gap: 30px; margin-top: 23px; align-items: start; }
.policy-russian h3 { margin: 0 0 19px; color: #285a45; font-size: 17px; }
.policy-paragraph { margin-bottom: 20px; min-width: 0; }
.policy-paragraph > p { margin: 0; font-size: calc(15px * var(--text-scale)); line-height: 1.8; white-space: pre-wrap; overflow-wrap: anywhere; }
.policy-paragraph > .policy-explanation { margin-top: 8px; padding-left: 12px; border-left: 2px solid #d7e2cd; color: #596b53; font-size: 14px; }
.policy-original { border: 1px solid #e4e9dc; border-radius: 10px; background: #fafbf6; min-width: 0; }
.policy-original > summary { padding: 15px; color: #285a45; cursor: pointer; font-size: 14px; font-weight: 600; }
.policy-original-body { padding: 3px 15px 0; }
.policy-source-page { display: block; margin-top: 7px; color: var(--muted); font-size: 12px; }
.policy-card-footer { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 13px; margin-top: 15px; border-top: 1px solid var(--border); }
.material-policy-text { max-height: 440px; overflow-y: auto; padding-right: 8px; margin: 15px 0; }
.material-policy-text > p { margin-bottom: 15px; white-space: pre-wrap; line-height: 1.75; overflow-wrap: anywhere; }
@media (max-width: 950px) {
  .policy-reading { grid-template-columns: minmax(0, 1fr); gap: 22px; }
}
@media (max-width: 760px) {
  .policy-card { padding: 18px; }
  .policy-card-header h2 { font-size: calc(20px * var(--text-scale)); }
  .policy-card-header > div { flex-basis: 100%; }
  .policy-notes { padding: 12px; font-size: 13px; }
  .policy-phrase-list { gap: 7px; }
}
body[data-preview="tablet"] .policy-reading,
body[data-preview="phone"] .policy-reading { grid-template-columns: minmax(0, 1fr); gap: 22px; }
body[data-preview="phone"] .policy-card { padding: 18px; }
body[data-preview="phone"] .policy-card-header h2 { font-size: calc(20px * var(--text-scale)); }
body[data-preview="phone"] .policy-card-header > div { flex-basis: 100%; }
body[data-preview="phone"] .policy-notes { padding: 12px; font-size: 13px; }

/* Parent overview: source-backed attention and tomorrow's plans stay separate from family task status. */
.parent-dashboard { margin: 0 0 30px; }
.parent-dashboard > .section-heading { flex-wrap: wrap; gap: 10px; margin-bottom: 15px; }
.parent-dashboard-scope { color: var(--muted); font-size: 12px; }
.parent-dashboard-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: start; gap: 16px; }
.parent-dashboard-grid > .empty-state { grid-column: 1 / -1; }
.parent-child-card { min-width: 0; padding: 19px; border: 1px solid var(--border); border-top: 3px solid #cec4e0; border-radius: var(--radius); background: var(--surface); }
.parent-child-card.blue { border-top-color: #a7c3d7; }
.parent-child-card.amber { border-top-color: #d8c39a; }
.parent-child-card.green { border-top-color: #afc6ad; }
.parent-child-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 20px; }
.parent-child-heading > div { min-width: 0; flex: 1; }
.parent-child-heading .avatar { flex: none; width: 37px; height: 37px; border-radius: 11px; }
.parent-child-heading h2 { margin: 0 0 3px; font-size: calc(20px * var(--text-scale)); overflow-wrap: anywhere; }
.parent-child-heading p { margin: 0; color: var(--muted); font-size: 12px; }
.parent-attention-count { flex: none; padding: 4px 7px; border-radius: 7px; background: #f5eade; color: #73512e; font-size: 11px; font-weight: 650; }
.parent-block-heading { display: flex; flex-wrap: wrap; align-items: baseline; gap: 5px 10px; margin-bottom: 11px; }
.parent-block-heading h3 { display: flex; align-items: center; gap: 7px; margin: 0; font-size: calc(14px * var(--text-scale)); }
.parent-block-heading h3 svg { width: 17px; height: 17px; color: #647e66; }
.parent-block-heading > span { color: var(--muted); font-size: 12px; }
.parent-attention-list { display: grid; gap: 9px; }
.parent-attention-item { min-width: 0; padding: 12px; border: 1px solid #e8ddce; border-left: 3px solid #cfa366; border-radius: 10px; background: #fcf9f3; }
.parent-attention-item.remark, .parent-attention-item.cancellation { border-color: #ead9d3; border-left-color: #c3846e; background: #fcf6f3; }
.parent-attention-item.exam-result { border-color: #dce6df; border-left-color: #7f9f82; background: #f7faf5; }
.parent-attention-item.review { border-color: #dfe4dc; border-left-color: #afbaad; background: #fafbf8; }
.parent-attention-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 7px; margin-bottom: 6px; color: #786044; font-size: 11px; font-weight: 600; }
.parent-attention-item.review .parent-attention-meta { color: var(--muted); }
.parent-attention-meta .source-badge { padding: 2px 5px; font-size: 12px; }
.parent-attention-meta .source-badge svg { width: 12px; height: 12px; }
.parent-attention-item h4 { margin: 0 0 6px; font-size: calc(14px * var(--text-scale)); line-height: 1.35; overflow-wrap: anywhere; }
.parent-attention-item > p { margin: 0 0 8px; font-size: 12px; line-height: 1.5; color: #53614f; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.parent-attention-item .btn { min-height: 31px; padding: 5px 0; text-align: left; font-size: 12px; }
.parent-evidence summary, .parent-more summary, .parent-review summary { cursor: pointer; font-size: 12px; color: #536b52; }
.parent-evidence { margin: 8px 0; }
.parent-evidence p { margin: 7px 0 2px; font-size: 12px; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; }
.parent-more, .parent-review { margin-top: 12px; }
.parent-more > .parent-attention-list, .parent-review > .parent-attention-list { margin-top: 10px; }
.parent-review > .parent-coverage { margin: 7px 0 10px; }
.parent-coverage { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.parent-tomorrow { margin-top: 20px; padding-top: 17px; border-top: 1px solid var(--border); }
.parent-tomorrow .parent-block-heading { margin-bottom: 13px; }
.parent-tomorrow-changes { margin-bottom: 14px; }
.parent-tomorrow-changes > h4 { margin-bottom: 8px; font-size: 12px; }
.parent-schedule-label { margin: 15px 0 7px; color: #4d624c; font-size: 12px; font-weight: 650; }
.parent-tomorrow-list { margin: 0; padding: 0; list-style: none; }
.parent-lesson { display: grid; grid-template-columns: 73px minmax(0, 1fr) 24px; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid #edf0e8; }
.parent-lesson:last-child { border-bottom: 0; }
.parent-lesson-time { color: #67725e; font-size: 12px; line-height: 1.4; font-variant-numeric: tabular-nums; }
.parent-lesson > div { min-width: 0; }
.parent-lesson .text-button, .parent-lesson strong { display: inline; padding: 0; color: var(--ink); font-size: 12px; line-height: 1.45; text-align: left; font-weight: 600; overflow-wrap: anywhere; }
.parent-lesson small { display: block; margin-top: 2px; color: var(--muted); font-size: 11px; }
.parent-lesson > .btn { width: 24px; min-width: 24px; height: 27px; min-height: 27px; padding: 0; }
.parent-lesson > .btn svg { width: 15px; height: 15px; }
.parent-lesson.extra { border-left: 2px solid #a4b7d2; padding-left: 8px; }
.parent-lesson.event { border-left: 2px solid #c6b488; padding-left: 8px; }
.parent-lesson.source-blank .text-button { color: var(--muted); font-weight: 400; }
.parent-coverage.period-unknown { margin-top: 7px; font-size: 11px; }
.parent-week-link { display: inline-flex; align-items: center; gap: 7px; margin-top: 15px; font-size: 12px; }
.parent-week-link svg { width: 15px; height: 15px; }
.parent-feed-heading { flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.parent-feed-heading .muted { font-size: 12px; }
.parent-nav-badge { display: inline-grid; min-width: 20px; height: 20px; place-items: center; border-radius: 7px; color: #76572f; background: #f3e4ce; font-size: 11px; font-weight: 650; }
.child-count:empty { display: none; }
@media (max-width: 1299px) {
  .parent-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 950px) {
  .parent-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
  .parent-child-card { padding: 18px; }
}
@media (max-width: 760px) {
  .parent-dashboard { margin-bottom: 24px; }
  .parent-child-card { padding: 16px; }
  .parent-child-heading { margin-bottom: 17px; }
  .parent-tomorrow { margin-top: 17px; padding-top: 15px; }
  .parent-attention-count { font-size: 11px; }
}
body[data-preview="tablet"] .parent-dashboard-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
body[data-preview="phone"] .parent-dashboard-grid { grid-template-columns: minmax(0, 1fr); }
body[data-preview="phone"] .parent-dashboard { margin-bottom: 24px; }
body[data-preview="phone"] .parent-child-card { padding: 16px; }
body[data-preview="phone"] .parent-child-heading { margin-bottom: 17px; }
body[data-preview="phone"] .parent-tomorrow { margin-top: 17px; padding-top: 15px; }
.parent-dashboard-grid:has(> .parent-child-card:only-child) { grid-template-columns: minmax(0, 1fr); }
.parent-source-health { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 18px; margin-bottom: 15px; padding: 11px 14px; border: 1px solid var(--border); border-radius: 10px; background: #f9faf5; }
.parent-source-health > div { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 170px; }
.parent-source-health > div > svg { width: 17px; height: 17px; color: #718569; }
.parent-source-health strong { display: block; font-size: 12px; font-weight: 500; }
.parent-source-health small { display: block; margin-top: 2px; font-size: 11px; color: var(--muted); }
.parent-manual-sources { color: var(--muted); font-size: 11px; }
.parent-source-health > .btn { min-height: 30px; padding: 4px 0; font-size: 12px; }
.parent-source-coverage { flex-basis: 100%; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.timetable-appointment + .timetable-appointment { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); }
@media (max-width: 760px) {
  .parent-source-health { gap: 7px 12px; padding: 10px 12px; }
  .parent-source-health > div { flex-basis: 100%; }
}
body[data-preview="phone"] .parent-source-health { gap: 7px 12px; padding: 10px 12px; }
body[data-preview="phone"] .parent-source-health > div { flex-basis: 100%; }

/* Shareable views keep date selection close to the content it controls. */
.temporal-toolbar { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 18px; margin: 14px 0 22px; }
.temporal-toolbar .select-label { display: grid; gap: 5px; }
.temporal-toolbar .select-label > span, .focus-date > span { color: var(--muted); font-size: 11px; }
.temporal-toolbar select, .focus-date input { min-height: 38px; padding: 8px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--surface, #fff); color: var(--text); font: inherit; font-size: 12px; }
.date-choices { display: flex; align-items: end; flex-wrap: wrap; gap: 8px; }
.date-choices .filter-chip { min-height: 38px; }
.focus-date { display: grid; gap: 5px; }
.feed-time-filters { padding: 13px 15px; border: 1px solid var(--border); border-radius: 12px; background: #fafbf7; }
.filter-error { flex-basis: 100%; margin: 0; color: #965c35; font-size: 12px; }
.share-url { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; overflow-wrap: anywhere; resize: vertical; }
.share-destination { margin-top: 0; }
.detail-share { margin-bottom: 8px; }
.schedule-focus { margin: 12px 0 28px; padding: 20px; border: 1px solid var(--border); border-radius: 16px; background: #f7faf5; }
.schedule-focus-events { display: grid; gap: 10px; }
.schedule-focus-events .school-event { background: #fff; }
@media (max-width: 760px) {
  .topbar-actions { flex-wrap: wrap; gap: 7px; }
  .temporal-toolbar { gap: 10px; align-items: stretch; }
  .temporal-toolbar .date-choices { width: 100%; }
  .temporal-toolbar .select-label { flex: 1; min-width: 135px; }
  .temporal-toolbar .focus-date { flex: 1; min-width: 145px; }
  .schedule-focus { padding: 14px; }
}
.schedule-focus-row { display: grid; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: start; gap: 14px; padding: 15px; border: 1px solid var(--border); border-radius: 11px; background: #fff; }
.schedule-focus-row h3 { margin: 0 0 5px; font-size: 14px; }
.schedule-focus-row p { margin: 5px 0; font-size: 12px; }
.schedule-focus-row > div > small { font-size: 11px; }
.schedule-focus-row.event { border-left: 3px solid #c6b488; }
@media (max-width: 760px) {
  .schedule-focus-row { grid-template-columns: 85px minmax(0, 1fr); gap: 9px; padding: 12px; }
  .schedule-focus-row > .btn { grid-column: 2; justify-self: start; }
}

/* One primary navigation surface; old route URLs remain secondary views. */
.parent-section-tabs { display: flex; flex-wrap: wrap; gap: 6px; margin: -8px 0 24px; padding: 0 0 16px; border-bottom: 1px solid var(--border); }
.parent-section-link { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; padding: 9px 14px; border-radius: 9px; color: var(--muted); font-size: 14px; font-weight: 500; line-height: 1.4; text-decoration: none; }
.parent-section-link:hover { color: var(--green); background: #f0f3eb; }
.parent-section-link.active { color: var(--green); background: var(--green-soft); font-weight: 650; }

/* Portrait iPads use the same five destinations as a phone. A sidebar is
   reserved for landscape windows with at least 900 × 600 CSS pixels. */
@media (orientation: portrait), (max-width: 899px), (max-height: 599px) {
  .app-shell { display: block; }
  .sidebar { position: fixed; z-index: 40; top: auto; right: 0; bottom: 0; left: 0; width: 100%; height: calc(77px + env(safe-area-inset-bottom)); min-height: 0; padding: 6px 10px calc(6px + env(safe-area-inset-bottom)); border: 0; border-top: 1px solid var(--border); background: #fffffff5; overflow: visible; }
  .sidebar .brand, .sidebar .family-children, .sidebar .sidebar-footer, .sidebar .sidebar-label { display: none; }
  .sidebar .parent-primary-nav { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 2px; margin: 0; }
  .parent-primary-nav .nav-link { flex-direction: column; justify-content: center; gap: 5px; min-height: 61px; padding: 6px 2px; text-align: center; font-size: 12px; line-height: 1.25; border-radius: 9px; }
  .parent-primary-nav .nav-link > span { max-width: 100%; overflow-wrap: anywhere; }
  .parent-primary-nav .nav-link svg { width: 20px; height: 20px; }
  .parent-primary-nav .nav-count { display: none; }
  .workspace { width: 100%; padding-bottom: calc(98px + env(safe-area-inset-bottom)); }
  .mobile-brand { display: flex; align-items: center; gap: 8px; color: #425e38; font-weight: 650; font-size: 13px; }
  .breadcrumb { display: none; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .topbar-actions { margin-left: auto; }
  .parent-section-tabs { gap: 4px; }
  .parent-section-link { min-height: 42px; padding: 9px 12px; }
  body[data-preview="tablet"] .preview-frame { position: relative; height: calc(100dvh - 40px); min-height: 0; }
  body[data-preview="tablet"] .app-shell { height: 100%; min-height: 0; }
  body[data-preview="tablet"] .sidebar { position: absolute; height: 77px; min-height: 0; }
  body[data-preview="tablet"] .workspace { height: 100%; overflow-y: auto; padding-bottom: 98px; }
}
body[data-preview="phone"] .sidebar .parent-primary-nav { grid-template-columns: repeat(5, minmax(0, 1fr)); }
body[data-preview="phone"] .parent-primary-nav .nav-link { font-size: 12px; }
