:root {
  color-scheme: light;
  --bg: #eef2f6;
  --surface: #ffffff;
  --surface-soft: #f3f6fa;
  --ink: #14202b;
  --muted: #657386;
  --line: #d8e0e8;
  --primary: #17212b;
  --primary-strong: #0e151d;
  --accent: #2f6fd6;
  --warn: #b2453d;
  --blue: #2f6fd6;
  --shadow: 0 18px 42px rgba(19, 32, 43, 0.1);
  --radius: 8px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(47, 111, 214, 0.14), transparent 26rem),
    linear-gradient(180deg, #f8fafc 0%, var(--bg) 46%);
  color: var(--ink);
}

button,
select,
textarea,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
  padding: 24px;
  background:
    linear-gradient(150deg, rgba(47, 111, 214, 0.18), transparent 36%),
    linear-gradient(180deg, #17212b 0%, #0d141c 100%);
  color: #f7f9fb;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: var(--radius);
  background: linear-gradient(135deg, #2f6fd6, #8d5bd6);
  color: #ffffff;
  font-weight: 800;
  box-shadow: 0 12px 24px rgba(47, 111, 214, 0.28);
}

.brand strong {
  letter-spacing: 0;
}

.brand strong,
.brand span {
  display: block;
}

.brand span,
.sidebar-status {
  color: #9eadbe;
  font-size: 0.88rem;
}

.nav-list {
  display: grid;
  gap: 8px;
}

.nav-item {
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  background: transparent;
  color: inherit;
  text-align: left;
  font-weight: 700;
  transition: background 160ms ease, transform 160ms ease, border-color 160ms ease;
}

.nav-item:hover,
.nav-item.active {
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.09);
  box-shadow: inset 3px 0 0 #2f6fd6;
}

.nav-item:hover {
  transform: translateX(2px);
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  line-height: 1.25;
}

.status-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: #d8993d;
}

.sidebar-status.cloud-ok .status-dot {
  background: #39b977;
}

.main {
  min-width: 0;
  padding: 24px;
}

.topbar,
.section-head,
.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.topbar {
  margin-bottom: 22px;
}

.daily-stage {
  position: relative;
  display: grid;
  grid-template-columns: minmax(260px, 0.82fr) minmax(0, 1.18fr);
  gap: 22px;
  align-items: stretch;
  margin-bottom: 16px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 111, 214, 0.18), transparent 42%),
    linear-gradient(160deg, #1b2734 0%, #101820 100%);
  box-shadow: 0 24px 64px rgba(16, 24, 32, 0.22);
  color: #f7f9fb;
}

.daily-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.055) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: linear-gradient(90deg, rgba(0, 0, 0, 0.35), #000);
  pointer-events: none;
}

.stage-copy,
.child-pulse {
  position: relative;
  z-index: 1;
}

.stage-copy {
  display: flex;
  min-height: 214px;
  flex-direction: column;
  justify-content: space-between;
}

.stage-copy h2 {
  max-width: 420px;
  margin: 0;
  color: #ffffff;
  font-size: clamp(2rem, 4vw, 4.4rem);
  font-weight: 900;
  line-height: 0.95;
  letter-spacing: 0;
}

.daily-stage .eyebrow {
  color: #9fbcff;
}

.next-action {
  display: grid;
  gap: 4px;
  max-width: 380px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: #cdd7e3;
}

.next-action strong {
  color: #ffffff;
}

.next-label {
  color: #8ea1b8;
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.child-pulse {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.kid-card {
  display: grid;
  min-height: 214px;
  align-content: end;
  gap: 7px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--child-color) 30%, transparent), rgba(255, 255, 255, 0.07) 58%),
    rgba(255, 255, 255, 0.06);
  color: #f7f9fb;
  text-align: left;
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.kid-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--child-color) 62%, white);
}

.kid-avatar {
  display: grid;
  width: 52px;
  height: 52px;
  margin-bottom: auto;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: var(--child-color);
  color: white;
  font-weight: 900;
}

.kid-name {
  font-size: 1.35rem;
  font-weight: 900;
}

.kid-age,
.kid-meta {
  color: #c9d3df;
  font-size: 0.84rem;
}

.kid-meter {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.kid-meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--child-color);
}

.topbar h1,
.section-head h2,
.panel h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(1.75rem, 2vw, 2.45rem);
  font-weight: 850;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

select,
textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.8);
}

select {
  min-height: 42px;
  padding: 0 36px 0 12px;
}

textarea {
  width: 100%;
  resize: vertical;
  padding: 12px;
  line-height: 1.45;
}

.icon-button,
.primary-button,
.ghost-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
}

.icon-button {
  width: 42px;
  background: var(--surface);
  border-color: var(--line);
  color: var(--primary);
}

.icon-button.active {
  background: var(--ink);
  border-color: var(--ink);
  color: white;
}

.primary-button {
  padding: 0 16px;
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  font-weight: 700;
}

.primary-button:hover {
  background: var(--primary-strong);
}

.ghost-button {
  padding: 0 14px;
  border-color: var(--line);
  background: var(--surface);
  color: var(--primary);
  font-weight: 700;
}

.full-width {
  width: 100%;
}

.view {
  display: none;
}

.active-view {
  display: block;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-panel,
.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.metric-panel {
  position: relative;
  overflow: hidden;
  padding: 16px;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.metric-panel:hover,
.panel:hover {
  box-shadow: 0 22px 58px rgba(19, 32, 43, 0.14);
}

.metric-panel:hover {
  transform: translateY(-2px);
}

.metric-panel::before {
  content: "";
  position: absolute;
  inset: 0 0 auto;
  height: 3px;
  background: linear-gradient(90deg, #2f6fd6, #2f8f62, #8d5bd6, #d86b9a);
}

.metric-panel span,
.metric-panel small {
  display: block;
  color: var(--muted);
}

.metric-panel strong {
  display: block;
  margin: 8px 0 4px;
  color: var(--ink);
  font-size: 2rem;
  line-height: 1;
}

.panel {
  padding: 18px;
}

.panel h2,
.panel h3 {
  font-weight: 800;
}

.dashboard-layout,
.import-grid,
.chores-layout,
.child-layout,
.learning-layout,
.documents-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 16px;
}

.chore-editor {
  grid-column: 1 / -1;
}

.chores-layout {
  grid-template-columns: minmax(220px, 0.65fr) minmax(280px, 0.85fr) minmax(380px, 1.25fr);
  align-items: start;
}

.points-panel,
.area-overview-panel,
.room-detail-panel {
  min-height: 0;
}

.area-overview-panel {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.room-detail-panel {
  max-height: calc(100vh - 150px);
  overflow: auto;
}

.chore-editor,
.week-plan-panel {
  grid-column: 1 / -1;
}

.chore-editor.editing-active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(47, 111, 214, 0.12), var(--shadow);
}

.learning-profiles {
  display: grid;
  gap: 10px;
}

.learning-card {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--child-color);
  border-radius: var(--radius);
  background: #f8fafc;
}

.learning-card header {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 10px 12px;
  align-items: center;
}

.learning-card strong,
.learning-card span,
.learning-card small {
  display: block;
}

.learning-card span,
.learning-card small {
  color: var(--muted);
}

.learning-card p {
  grid-column: 1 / -1;
  margin: 0;
  font-weight: 750;
}

.learning-card small {
  grid-column: 1 / -1;
}

.private-note {
  display: grid;
  gap: 4px;
  margin: 8px 0 12px;
  padding: 10px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--muted);
}

.private-note strong {
  color: var(--ink);
}

.learning-editor label {
  display: grid;
  gap: 6px;
}

.learning-editor label > span {
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 850;
}

.learning-editor input,
.learning-editor textarea {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.learning-editor textarea {
  resize: vertical;
}

.coach-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.coach-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  font-weight: 850;
}

.coach-rules {
  display: grid;
  gap: 4px;
  margin-top: 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: #f2f5f9;
  color: var(--muted);
}

.coach-rules strong {
  color: var(--ink);
}

.documents-layout {
  align-items: start;
}

.document-preview {
  width: 100%;
  max-height: 360px;
  object-fit: contain;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8fafc;
}

.mobile-capture-actions {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 8px;
  margin: 10px 0 14px;
}

.capture-button,
.ghost-capture-button {
  display: grid;
  min-height: 48px;
  place-items: center;
  border-radius: var(--radius);
  font-weight: 900;
  text-align: center;
}

.capture-button {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: #ffffff;
}

.ghost-capture-button {
  border: 1px solid var(--line);
  background: #ffffff;
  color: var(--ink);
}

.capture-button input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.document-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.document-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.document-form label.wide {
  grid-column: 1 / -1;
}

.document-form input,
.document-form select,
.document-form textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.document-calendar-box {
  display: grid;
  gap: 12px;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dce5ef;
  border-radius: var(--radius);
  background: #f7f9fc;
}

.document-calendar-box > strong {
  display: block;
}

.document-pages {
  display: grid;
  gap: 10px;
  margin-bottom: 14px;
}

.document-page-summary,
.document-page-pill {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--muted);
  font-weight: 800;
}

.document-page-pill strong,
.document-page-pill span {
  display: block;
}

.document-page-pill strong {
  color: var(--ink);
}

.document-page-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 10px;
}

.document-page-thumb {
  position: relative;
  display: grid;
  gap: 6px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.document-page-thumb img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 6px;
  background: #f2f5f9;
}

.document-page-thumb span {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.document-page-thumb button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  width: 26px;
  height: 26px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: rgba(20, 32, 43, 0.86);
  color: white;
  font-size: 1rem;
  font-weight: 900;
}

.document-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.document-list {
  display: grid;
  gap: 10px;
}

.folder-admin {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
}

.folder-admin label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-weight: 800;
}

.folder-admin select,
.folder-admin input {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.folder-assignment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.folder-toggle {
  display: inline-flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 7px !important;
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--ink) !important;
  font-size: 0.86rem;
}

.folder-toggle input {
  width: 16px;
  min-height: 16px;
  accent-color: var(--primary);
}

.folder-toggle-static {
  min-width: 0;
  font-weight: 850;
}

.folder-manage-chip {
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.folder-manage-chip .folder-toggle {
  border-radius: 999px 4px 4px 999px;
}

.folder-delete-button {
  display: inline-grid;
  width: 34px;
  min-height: 34px;
  place-items: center;
  border: 1px solid #f0c7c1;
  border-radius: 4px 999px 999px 4px;
  background: #fff5f3;
  color: var(--warn);
  font-weight: 900;
}

.folder-delete-button:hover {
  border-color: var(--warn);
  background: #ffe9e5;
}

.folder-add-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.folder-add-row button {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--primary);
  border-radius: var(--radius);
  background: var(--primary);
  color: white;
  font-weight: 800;
}

.subcategory-admin {
  display: grid;
  gap: 10px;
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.document-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--child-color);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.document-card img,
.document-thumb {
  width: 92px;
  height: 118px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  object-fit: cover;
}

.document-thumb {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 1.5rem;
}

.document-card p {
  margin: 8px 0 0;
  color: var(--ink);
}

.document-link {
  margin-top: 8px;
  padding: 8px;
  border-radius: 6px;
  background: #eaf1fb;
  color: var(--primary);
  font-size: 0.86rem;
  font-weight: 800;
}

.document-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.document-card-actions button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  font-weight: 800;
}

.section-head {
  margin-bottom: 16px;
}

.section-head.compact {
  margin-bottom: 10px;
}

.item-list,
.timeline,
.review-list,
.points-list {
  display: grid;
  gap: 10px;
}

.list-item,
.timeline-item,
.review-card,
.point-row {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.list-item {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  overflow: hidden;
  transition: transform 140ms ease, border-color 140ms ease, background 140ms ease;
}

.list-item:hover,
.timeline-item:hover,
.review-card:hover,
.point-row:hover {
  border-color: color-mix(in srgb, var(--child-color, var(--accent)) 42%, var(--line));
  background: #f8fafc;
}

.list-item-action {
  cursor: pointer;
}

.list-item-action:hover {
  transform: translateY(-1px);
}

.list-item::before,
.review-card::before,
.point-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--child-color, var(--accent));
}

.list-item strong,
.timeline-item strong,
.review-card strong {
  display: block;
}

.entry-row,
.entry-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.entry-row {
  justify-content: space-between;
}

.entry-actions {
  justify-content: flex-end;
}

.delete-button {
  min-height: 34px;
  padding: 0 10px;
  border: 1px solid #efc8c2;
  border-radius: var(--radius);
  background: #fff5f3;
  color: var(--warn);
  font-weight: 850;
}

.delete-button:hover {
  border-color: var(--warn);
  background: #ffe9e5;
}

.compact-button {
  min-height: 34px;
  padding: 0 10px;
  white-space: nowrap;
}

.subtask-list {
  margin: 8px 0 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.45;
}

.chore-area-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.chore-area-group header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
}

.chore-area-group header span,
.chore-step-preview {
  color: var(--muted);
  font-size: 0.84rem;
}

.area-select-button {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  text-align: left;
}

.area-rule-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.summary-pill {
  max-width: 100%;
  padding: 5px 7px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.summary-more {
  padding: 5px 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

.summary-pill:hover,
.area-select-button:hover strong {
  color: var(--accent);
}

.chore-rule-list {
  display: grid;
  gap: 8px;
}

.chore-rule-row {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
  overflow: hidden;
}

.chore-rule-row::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--child-color, var(--accent));
}

.room-planner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-soft);
}

.room-planner label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.selected-room-rules {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.selected-room-rules .empty-state {
  padding: 12px;
  min-height: auto;
}

.room-rule-card {
  display: grid;
  gap: 8px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
}

.room-rule-card header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.room-rule-card .subtask-list {
  margin-top: 2px;
  font-size: 0.82rem;
}

.room-rule-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.room-rule-meta span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.visually-compact-field {
  opacity: 0.72;
}

.weekday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0 12px;
}

.weekday-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.weekday-toggle span {
  display: inline-flex;
  min-width: 42px;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  font-weight: 850;
}

.weekday-toggle input:checked + span {
  border-color: var(--accent);
  background: rgba(47, 111, 214, 0.12);
  color: var(--accent);
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.date-warning {
  color: var(--warn);
  font-weight: 850;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  background: #e5ebf3;
  color: var(--primary);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.badge.warn {
  background: #f9e2de;
  color: var(--warn);
}

.badge.blue {
  background: #dfeafb;
  color: var(--blue);
}

.priority-badge {
  background: #edf1f6;
}

.review-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.review-number {
  display: inline-grid;
  min-width: 34px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--primary);
  color: white;
  font-size: 0.8rem;
  font-weight: 900;
}

.date-fix {
  display: grid;
  gap: 6px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #efc8c2;
  border-radius: var(--radius);
  background: #fff5f3;
}

.date-fix span {
  color: var(--warn);
  font-size: 0.82rem;
  font-weight: 850;
}

.date-fix input {
  min-height: 38px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--ink);
}

.date-fix-control {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.date-fix-control button {
  min-height: 38px;
  white-space: nowrap;
}

.screenshot-link {
  min-height: 34px;
  margin-top: 10px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  font-weight: 800;
}

.timeline-item {
  position: relative;
  padding: 12px;
  border-left: 4px solid var(--child-color, var(--primary));
  transition: border-color 140ms ease, background 140ms ease;
}

.priority-high {
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--child-color, var(--accent)) 13%, transparent), transparent 54%),
    #f8fafc;
}

.priority-medium {
  background: #f4f7fb;
}

.priority-low {
  opacity: 0.68;
  background: #f5f6f8;
}

.priority-low strong {
  font-weight: 700;
}

.upload-box {
  display: grid;
  gap: 8px;
  place-items: center;
  min-height: 180px;
  margin-bottom: 14px;
  border: 2px dashed #aab8c8;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 111, 214, 0.08), rgba(141, 91, 214, 0.08)),
    var(--surface-soft);
  text-align: center;
  transition: border-color 160ms ease, transform 160ms ease;
}

.upload-box:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}

.upload-box.drag-active {
  border-color: var(--accent);
  background:
    linear-gradient(135deg, rgba(47, 111, 214, 0.16), rgba(141, 91, 214, 0.12)),
    #f8fbff;
}

.upload-box input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.upload-box span {
  font-size: 2rem;
}

.upload-box small {
  max-width: 290px;
  color: var(--muted);
}

.screenshot-preview {
  width: 100%;
  max-height: 260px;
  object-fit: contain;
  margin-bottom: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fafafa;
}

.screenshot-strip {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
}

.screenshot-strip strong,
.screenshot-strip span {
  display: block;
}

.screenshot-strip span {
  color: var(--muted);
  font-size: 0.84rem;
}

.screenshot-strip img {
  grid-column: 1 / -1;
  width: 100%;
  max-height: 430px;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #101820;
}

.ocr-actions {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  margin-bottom: 14px;
}

.ocr-status {
  min-height: 42px;
  display: flex;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f9fc;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 700;
}

.primary-button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 700;
}

.code-map {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.code-map span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 34px;
  padding: 0 10px 0 6px;
  border: 1px solid color-mix(in srgb, var(--child-color) 34%, var(--line));
  border-radius: 999px;
  background: color-mix(in srgb, var(--child-color) 10%, white);
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 800;
}

.code-map strong {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 50%;
  background: var(--child-color);
  color: white;
  font-size: 0.78rem;
}

.review-card {
  position: relative;
  padding: 12px;
  overflow: hidden;
  transition: border-color 140ms ease, background 140ms ease;
}

.review-toolbar {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 111, 214, 0.08), transparent),
    #f8fafc;
}

.review-counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-counts span,
.review-bulk-actions button {
  min-height: 34px;
  border-radius: 999px;
}

.review-counts span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0 10px;
  background: white;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.review-counts strong {
  color: var(--ink);
}

.review-bulk-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.review-bulk-actions button {
  padding: 0 12px;
  border: 1px solid var(--line);
  background: white;
  color: var(--primary);
  font-weight: 800;
}

.review-bulk-actions button:first-child {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.review-group {
  display: grid;
  gap: 10px;
}

.review-group > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 2px 0;
}

.review-group h3 {
  margin: 0;
  font-size: 1rem;
}

.review-group header span {
  color: var(--muted);
  font-size: 0.84rem;
}

.review-group header > strong {
  display: grid;
  min-width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 50%;
  background: #e8edf4;
}

.review-group-list {
  display: grid;
  gap: 10px;
}

.review-group-low .review-group-list {
  max-height: 360px;
  overflow: auto;
}

.review-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.review-actions button {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  font-weight: 700;
}

.review-actions button:first-child {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.segmented {
  display: inline-grid;
  grid-auto-flow: column;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

.segmented button {
  min-height: 40px;
  padding: 0 12px;
  border: 0;
  background: var(--surface);
}

.segmented button.active {
  background: linear-gradient(135deg, #17212b, #2b3b4d);
  color: white;
}

.filter-row {
  justify-content: flex-start;
  margin-bottom: 14px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 8px;
}

.day-cell {
  min-height: 150px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 28px rgba(19, 32, 43, 0.06);
}

.day-cell header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.calendar-entry {
  display: block;
  margin-top: 6px;
  padding: 7px;
  border-radius: 6px;
  background: #edf3fb;
  color: var(--ink);
  font-size: 0.82rem;
  border-left: 3px solid var(--accent);
}

.points-list {
  gap: 12px;
}

.point-row {
  position: relative;
  padding: 12px;
  overflow: hidden;
}

.point-bar {
  height: 10px;
  margin-top: 8px;
  border-radius: 999px;
  background: #dce4ed;
  overflow: hidden;
}

.point-bar span {
  display: block;
  height: 100%;
  background: var(--accent);
}

.focus-panel {
  background: linear-gradient(180deg, #ffffff 0%, #f4f7fb 100%);
}

.done-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: white;
  color: var(--primary);
  font-weight: 800;
}

.done-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

@media (max-width: 980px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 12px;
  }

  .brand,
  .sidebar-status {
    display: none;
  }

  .nav-list {
    display: grid;
    grid-auto-columns: minmax(76px, 1fr);
    grid-auto-flow: column;
    grid-template-columns: none;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .nav-item {
    grid-template-columns: 1fr;
    justify-items: center;
    gap: 3px;
    padding: 8px 4px;
    font-size: 0.78rem;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .summary-grid,
  .daily-stage,
  .dashboard-layout,
  .import-grid,
  .chores-layout,
  .child-layout,
  .learning-layout,
  .documents-layout {
    grid-template-columns: 1fr;
  }

  .area-overview-panel,
  .room-detail-panel {
    max-height: none;
    overflow: visible;
  }

  .room-planner {
    grid-template-columns: 1fr;
  }

  .child-pulse {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kid-card,
  .stage-copy {
    min-height: 170px;
  }

  .calendar-grid {
    grid-template-columns: 1fr;
  }

  .day-cell {
    min-height: 110px;
  }
}

@media (max-width: 560px) {
  .section-head,
  .filter-row {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar-actions,
  .ocr-actions,
  .filter-row select,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .icon-button {
    flex: 0 0 42px;
  }

  .review-bulk-actions button {
    width: 100%;
  }

  .document-form {
    grid-template-columns: 1fr;
  }

  .document-actions button {
    width: 100%;
  }

  .folder-add-row {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .daily-stage {
    padding: 16px;
  }

  .child-pulse {
    grid-template-columns: 1fr;
  }

  .kid-card {
    min-height: 128px;
  }
}
