.routine-table { margin-inline: 22px; }
.routine-hint { display: flex; align-items: center; gap: 5px; margin-bottom: 4px; color: var(--muted); font-size: .79rem; }
.routine-table table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.routine-table th, .routine-table td { text-align: left; padding: 6px 8px; }
.routine-table thead th { color: var(--accent-ink); font-size: .92rem; text-align: center; }
.parent-rule { border-top: 1px solid var(--line); }
.parent-rule td { text-align: center; }
.rule-label { display: flex; align-items: center; gap: 8px; line-height: 1.2; }
.rule-label svg { color: var(--accent); }
.rule-label small { display: block; margin-top: 3px; color: var(--muted); font-weight: 500; font-size: .77rem; white-space: nowrap; }
.rule-column { width: 33%; }
.mark-cell { display: grid; grid-template-columns: minmax(44px, 1fr) 44px; gap: 4px; margin-inline: auto; width: min(100%, 193px); }
.quick-confirm, .quick-menu, .quick-status {
  display: flex; justify-content: center; align-items: center; gap: 5px;
  min-height: 44px; padding: 4px; border: 1px solid var(--line); border-radius: 8px;
  color: var(--accent-ink); background: #f3f7ff; font-size: .86rem; font-weight: 680; line-height: 1.1;
}
.quick-confirm:hover, .quick-menu:hover, .quick-menu[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.quick-status svg { display: none; }
.quick-status.ok, .mark-option.ok[aria-pressed="true"] { color: var(--success); background: var(--success-soft); }
.quick-status.missed, .mark-option.missed[aria-pressed="true"] { color: var(--red); background: var(--red-soft); }
.quick-status.excused, .mark-option.excused[aria-pressed="true"] { color: var(--amber-ink); background: var(--amber); }
.mark-cell[aria-busy] { opacity: .72; }
.mark-editor .mark-options { display: flex; flex-wrap: wrap; gap: 5px; }
.mark-comment summary { min-height: 44px; display: flex; align-items: center; gap: 6px; color: var(--accent-ink); font-size: .88rem; font-weight: 660; }
.mark-comment button, .mark-comment p { margin-top: 7px; }
.mark-comment p { font-size: .83rem; }
.rule-off { color: var(--muted); font-size: .8rem; }
.quick-editor { padding: 13px 15px 4px; border: 1px solid var(--line); border-radius: 9px; background: #f3f7ff; }
.quick-editor > h3 { margin: 0 0 5px; }
.quick-editor .rule-note { margin-left: 0; }
.parent-routine > .subdetail { margin-top: 8px; }

.sister-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.sister-columns > * { min-width: 0; }
.sister-columns > * + * { border-left: 1px solid var(--line); }
.child-heading { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 7px; margin: 3px 22px 7px; }
.child-heading .counter { font-size: .87rem; }
.family-chores { border-top: 1px solid var(--line); }
.family-chores .chore { line-height: 1.3; }
.parent-task-mark { position: relative; flex: none; width: 33px; }
.parent-task-mark .task-sticker { width: 32px; height: 32px; }
.parent-task-mark .task-sticker svg { width: 19px; height: 19px; }
.family-chores .chore .parent-task-mark .checkbox { position: absolute; right: -2px; bottom: -2px; width: 14px; height: 14px; border-radius: 50%; background: #fff; border-color: #9eb0cf; }
.family-chores .chore.checked .parent-task-mark .checkbox { background: var(--success); border-color: #fff; }
.parent-task-mark .checkbox svg { width: 11px; height: 11px; }
.family-chores .section-heading { align-items: center; }
.family-chores .chore-label small { margin-top: 3px; }
.family-chores .exception-line .badge { white-space: normal; }
.family-chores .subdetail { margin-bottom: 8px; }
.family-chores .subdetail summary { line-height: 1.25; }
.lesson-child { padding-bottom: 3px; }
.lesson-child + .lesson-child { border-top: 1px solid var(--line); padding-top: 12px; }
.lesson-child h3 { margin: 0 22px 5px; }
.lesson-child .section-note { margin-block: 6px; color: var(--muted); }
.lesson-child .rows { padding-bottom: 4px; }
.family-bonus-title { margin: 0 22px 8px; display: flex; justify-content: space-between; gap: 8px; }
.family-rewards .week { gap: 3px; }
.parent-today .pending-link { gap: 3px; }
.parent-today .pending-link small { overflow-wrap: anywhere; }

@media (max-width: 760px) {
  .routine-table { margin-inline: 8px; }
  .rule-column { width: 25%; }
  .routine-table th, .routine-table td { padding: 5px 3px; }
  .child-heading, .family-bonus-title, .lesson-child h3 { margin-inline: 13px; }
  .sister-column .rows, .sister-column .exception-line, .family-rewards .sister-columns .reward-block { padding-inline: 11px; }
  .sister-column .section-note, .sister-column .subdetail { margin-inline: 11px; }
  .family-chores .chore { gap: 6px; font-size: .9rem; min-height: 49px; }
  .parent-task-mark { width: 27px; }
  .parent-task-mark .task-sticker { width: 26px; height: 26px; }
  .parent-task-mark .task-sticker svg { width: 16px; height: 16px; }
  .family-chores .chore small, .family-chores .subdetail summary { font-size: .79rem; }
  .family-rewards .week { gap: 1px; }
  .family-rewards .week-day span { font-size: .67rem; }
  .family-rewards .week-day svg { width: 12px; }
}


@media (max-width: 520px) {
  .rule-label svg { display: none; }
  .quick-confirm span { display: none; }
  .quick-status svg { display: block; }
  .quick-state-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
}

@media (max-width: 360px) {
  .rule-label { gap: 4px; font-size: .87rem; }
  .family-chores .section-heading h2 { font-size: 1.12rem; }
  .family-chores .section-heading .button { padding-inline: 8px; font-size: .79rem; white-space: nowrap; }
}

.tutor-slot { margin: 4px 22px 9px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; color: var(--muted); font-size: .87rem; font-variant-numeric: tabular-nums; }
.tutor-slot a { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; color: var(--accent-ink); font-weight: 670; text-decoration: underline; text-underline-offset: 3px; }
.lesson-child .tutor-slot + .section-note { margin-block-start: 0; }
.tutor-rules .agreement-list small { display: block; }

@media (max-width: 760px) {
  .tutor-slot { margin-inline: 13px; }
  .lesson-child .routine-row .badge { white-space: normal; text-align: left; }
}

@media (max-width: 760px) {
  .page-heading:has(.tutor-jump) { flex-direction: row; flex-wrap: wrap; align-items: end; gap: 8px; }
  .tutor-jump { min-height: 44px; }
}
