/* Final screen layer: a quiet forest-and-paper workspace.
   Printable client forms keep their own typography and layout. */
@media screen {
  :root {
    --paper: #f5f7f4;
    --paper-bright: #ffffff;
    --ink: #203d3c;
    --ink-soft: #536e69;
    --forest: #205c56;
    --forest-deep: #174a46;
    --line: #dce5df;
    --line-strong: #b8cac0;
    --terra: #ad563b;
    --shadow: 0 4px 18px rgb(24 62 51 / 4%);
    --font-ui: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Yu Gothic", "Meiryo", sans-serif;
    --font-heading: "Yu Mincho", "Hiragino Mincho ProN", serif;
    font-family: var(--font-ui);
  }
  body { background: var(--paper); }
  body.login-page { background: #eef3ed; font-family: inherit; }
  .login-card { background: white; border-color: var(--line); box-shadow: var(--shadow); }
  .login-brand small { font-size: 12px; }
  .login-card input { background: white; }
  .sidebar { background: #204f4a; box-shadow: none; }
  .brand strong { letter-spacing: .04em; }
  .brand span:last-child, .facility-identity span { color: #d3e2d9; font-size: 12px; }
  .facility-identity strong { font-family: inherit; font-size: 14px; }
  .current-child { border-radius: 12px; background: #2c5e57; box-shadow: none; }
  .current-child::after { display: none; }
  .primary-nav button { font-size: 14px; color: #e0eae5; }
  .primary-nav button[aria-current="page"] { background: #396b61; box-shadow: inset 3px 0 #efb28d; }
  .primary-nav button span { font-size: 12px; color: #d4e4da; }
  .admin-nav strong { font-size: 13px; }
  .admin-nav small { font-size: 12px; color: #d0dfd6; }
  .topbar { background: #ffffff; box-shadow: none; border-color: var(--line); }
  .staff-context span, .save-state, .workspace-context { font-size: 12px; }
  .page-heading h1 { font-family: var(--font-heading); font-size: clamp(26px, 2.3vw, 34px); line-height: 1.4; letter-spacing: .015em; font-weight: 700; }
  .page-heading { margin-bottom: 24px; }
  .eyebrow { font-size: 12px; letter-spacing: .08em; }
  .page-view h2, .dialog-heading h2 { font-family: var(--font-heading); font-size: 23px; line-height: 1.45; letter-spacing: .01em; }
  .page-view h3 { font-family: var(--font-heading); font-size: 18px; line-height: 1.5; }
  .button { min-height: 44px; border-radius: 9px; font-size: 14px; font-weight: 700; box-shadow: none; }
  .button-primary, .button-primary:hover { box-shadow: none; }
  .button-secondary { background: white; border-color: var(--line-strong); }
  .button:disabled { cursor: not-allowed; }
  .section-tabs { box-shadow: none; border-color: var(--line); background: #eaf0eb; }
  .section-tabs button { min-height: 44px; font-size: 14px; }
  .detail-sheet, .subsection-card, .document-lane, .record-card { border-radius: 14px; background: white; box-shadow: var(--shadow); }
  .detail-grid dt { font-size: 13px; color: var(--ink-soft); }
  .detail-grid dd { font-size: 16px; line-height: 1.65; overflow-wrap: anywhere; }
  .record-card h3 { font-size: 19px; }
  .record-meta, .document-date-meta, .document-reference-inline summary small { font-size: 12px; line-height: 1.6; }
  .readiness-copy, .document-workflow-copy, .document-item .document-workflow-copy { border-radius: 0 8px 8px 0; font-size: 14px; }
  .document-lane h2 { font-size: 25px; }
  .document-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .document-actions > :first-child, .document-actions > .pdf-action-error { grid-column: 1 / -1; }
  .document-lane-index::after { font-family: inherit; font-size: 11px; }
  .document-reference-shared { background: white; border-radius: 14px; }
  .form-dialog { border-radius: 16px; }
  .dialog-heading h2 + p { font-size: 14px; }
  .field { min-width: 0; }
  .field > span, .field > label > span, .checkbox-field legend { font-size: 14px; line-height: 1.6; }
  .field em, .field small { font-size: 12px; line-height: 1.6; }
  .field input, .field select, .field textarea { min-width: 0; max-width: 100%; min-height: 50px; font-size: 16px; border-radius: 9px; }
  .field input[type="checkbox"], .field input[type="radio"] { min-height: 0; }
  .custom-field-row textarea { height: 50px; min-height: 50px; line-height: 1.6; }
  .custom-field-row .button { min-height: 50px; }
  .field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible,
  .button:focus-visible, summary:focus-visible, .section-tabs button:focus-visible {
    outline: 2px solid #a64d30; outline-offset: 3px; box-shadow: none;
  }
  .pdf-action-error { padding: 14px; border: 1px solid #dcaba0; border-radius: 9px; background: #fff4f0; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
  .daily-summary-parent-card strong { font-family: inherit; font-size: 18px; }
  .daily-summary-parent-card p, .daily-summary-parent-health p { font-size: 15px; white-space: pre-wrap; overflow-wrap: anywhere; }
  .daily-summary-parent-health strong { font-size: 15px; }
  .daily-summary-record-detail { padding-top: 10px; border-top: 1px solid var(--line); }
  .daily-summary-record-detail summary { cursor: pointer; min-height: 44px; padding: 10px 0; font-size: 13px; font-weight: 700; color: var(--forest); }
  .daily-summary-record-detail p { margin-top: 8px; }
  .daily-summary-print-full { display: none; }
  .document-jump-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
  .document-jump-nav a { display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 10px 14px; border: 1px solid var(--line-strong); border-radius: 9px; background: var(--paper-bright); color: var(--forest); text-decoration: none; font-size: 14px; font-weight: 700; }
  .document-jump-nav a span { color: var(--ink-soft); font-size: 12px; font-variant-numeric: tabular-nums; }
  .document-jump-nav a:hover { background: var(--paper); }
  .document-jump-nav a:focus-visible { outline: 2px solid var(--terra); outline-offset: 3px; }
  .document-lane h2 { scroll-margin-top: 100px; text-wrap: balance; }
  .editor-group { min-width: 0; margin: 0 0 12px; padding: 0; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-bright); }
  fieldset.editor-group { padding: 8px 0 0; }
  .editor-group > legend { padding: 0 8px; margin-left: 12px; font-size: 15px; font-weight: 700; color: var(--forest); }
  .editor-group > summary { min-height: 48px; padding: 14px 16px; cursor: pointer; font-size: 15px; font-weight: 700; overflow-wrap: anywhere; }
  .editor-group[open] > summary { border-bottom: 1px solid var(--line); }
  .editor-group > summary small { display: inline-block; margin-left: 12px; font-size: 12px; font-weight: 400; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .editor-group-fields { padding: 16px; row-gap: 16px; }
  .editor-group-fields > .field { margin: 0; }
  .editor-group-controls { display: flex; flex-wrap: wrap; gap: 8px; }
  #child-edit-form > .dialog-actions, #child-register-form > .dialog-actions, #plan-editor-form > .dialog-actions { position: sticky; z-index: 7; bottom: -1px; background: var(--paper-bright); padding: 12px 0 max(12px, env(safe-area-inset-bottom)); }
  #child-edit-form, #child-register-form, #plan-editor-form { scroll-padding-bottom: 100px; }
  @media (max-width: 600px) {
    .document-jump-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .document-jump-nav a { padding: 10px; font-size: 13px; gap: 6px; overflow-wrap: anywhere; }
    .editor-group-fields { padding: 12px; }
    .editor-group > summary { padding: 14px 12px; }
    #child-edit-form > .dialog-actions, #child-register-form > .dialog-actions, #plan-editor-form > .dialog-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
    #child-edit-form > .dialog-actions .button, #child-register-form > .dialog-actions .button, #plan-editor-form > .dialog-actions .button { width: auto; flex: 1 1 auto; }
    #open-child-delete-dialog { flex-basis: 100% !important; }
  }
  /* Documents workspace: status, purpose, then one primary action. */
  #view-documents .document-flow-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: stretch; gap: 20px; max-width: none; }
  #view-documents .document-lane { display: flex; flex-direction: column; min-width: 0; overflow: hidden; border: 1px solid var(--line); border-radius: 14px; background: var(--paper-bright); }
  #view-documents .document-lane-index { display: none; }
  #view-documents .document-lane-heading { padding: 20px 22px 16px; border-bottom: 1px solid var(--line); }
  #view-documents .document-lane h2 { margin: 10px 0 6px; font-family: var(--font-heading); font-size: 22px; line-height: 1.4; }
  #view-documents .document-purpose { font-size: 13px; color: var(--ink-soft); line-height: 1.65; text-wrap: pretty; }
  #view-documents .document-state { display: inline-flex; width: fit-content; padding: 4px 9px; border-radius: 6px; font-size: 12px; font-weight: 700; line-height: 1.5; color: var(--forest); background: #e6f2ea; }
  #view-documents .document-state[data-state="empty"] { color: var(--ink-soft); background: #f0f3f1; }
  #view-documents .document-state[data-state="draft"], #view-documents .document-state[data-state="returned"] { color: #855319; background: #fff1da; }
  #view-documents .document-lane-record { display: flex; flex: 1; flex-direction: column; gap: 14px; padding: 18px 22px 20px; --document-action-width: 100%; }
  #view-documents .document-item, #view-documents .document-lane.assessment .document-item { display: grid; gap: 10px; min-width: 0; padding: 0; }
  #view-documents .document-version { font-family: inherit; font-size: 12px; font-weight: 600; color: var(--ink-soft); }
  #view-documents .document-date-meta, #view-documents .document-lane.assessment .document-date-meta { display: grid; gap: 3px; font-size: 12px; padding: 0; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  #view-documents .document-actions { display: flex; flex-direction: row; flex-wrap: wrap; gap: 8px; width: 100%; }
  #view-documents .document-actions .button { min-height: 44px; padding: 10px 14px; width: auto; flex: 1 1 auto; font-size: 14px; }
  #view-documents .document-actions > .pdf-action-error { flex-basis: 100%; }
  #view-documents .document-source-tools { border-top: 1px solid var(--line); padding-top: 4px; }
  #view-documents .document-source-tools > summary, #view-documents .document-context-details > summary, #view-documents .document-history > summary { cursor: pointer; padding: 10px 0; min-height: 44px; font-size: 13px; font-weight: 600; color: var(--forest); }
  #view-documents .document-source-tools .document-lane-controls { width: 100%; gap: 10px; padding: 4px 0 0; }
  #view-documents .document-lane-controls .button { width: 100%; min-height: 44px; font-size: 14px; }
  #view-documents .readiness-copy, #view-documents .document-workflow-copy { padding: 0; border: 0; background: none; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
  #view-documents .document-context-details { margin: 0; }
  #view-documents .document-history { border-top: 1px solid var(--line); margin-top: 14px; }
  #view-documents .document-history .document-item { padding: 14px 0; border-top: 1px solid var(--line); }
  #view-documents .document-history .button-primary { background: white; border-color: var(--line-strong); color: var(--forest); }
  #view-documents .document-lane[data-has-document="false"] .document-source-tools { border: 0; padding: 0; }
  #view-documents .document-lane[data-has-document="false"] .document-list.empty-state { min-height: 0; padding: 0; text-align: left; place-content: start; }
  #view-documents .document-list.empty-state strong { font-size: 13px; color: var(--ink-soft); font-weight: 400; }
  #view-documents .document-lane.supplemental, #view-documents .document-reference-shared { grid-column: 1 / -1; }
  #view-documents .document-reference-shared { width: 100%; margin: 0; }
  #view-documents .document-reference-shared summary { padding: 16px 22px; }
  #view-documents .document-reference-shared summary strong { font-family: inherit; font-size: 17px; }
  #view-documents .document-reference-shared summary small { font-size: 12px; }
  #view-documents .document-reference-shared summary em { display: none; }
  #view-documents .document-jump-nav { gap: 6px; margin-bottom: 20px; }
  #view-documents .document-jump-nav a { font-size: 12px; padding: 8px 10px; border: 0; background: transparent; text-decoration: underline; text-underline-offset: 4px; }
  @media (max-width: 1100px) {
    #view-documents .document-flow-columns { grid-template-columns: minmax(0, 1fr); }
  }
  @media (max-width: 600px) {
    #view-documents .document-lane-heading { padding: 16px; }
    #view-documents .document-lane-record { padding: 16px; }
    #view-documents .document-lane h2 { font-size: 20px; }
  }
  @media (max-width: 820px) {
    .page-heading { align-items: flex-start; gap: 16px; }
    .page-heading h1 { font-size: 26px; }
    .document-lane h2 { font-size: 22px; }
    .child-heading-actions { flex-wrap: wrap; }
    .dialog-heading h2 { font-size: 22px; }
  }
  .attendance-record-progress { grid-column: 1 / -1; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-bright); }
  .attendance-record-progress p { margin: 6px 0; font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; }
  .attendance-record-progress small { font-size: 12px; color: var(--ink-soft); }
  .attendance-record-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
  .attendance-record-tools label { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; cursor: pointer; }
  .attendance-record-tools input { width: 18px; height: 18px; }
  .attendance-identity .attendance-journal-badge { display: inline-block; margin-top: 8px; padding: 4px 8px; border-radius: 5px; color: #73501c; background: #fff1da; font-size: 12px; font-weight: 700; }
  .attendance-identity .attendance-journal-badge.is-complete { color: var(--forest); background: #e6f2ea; }
  .attendance-identity .attendance-journal-badge.is-draft { color: #70541f; background: #f7edcf; }
  .attendance-identity .attendance-journal-badge.is-unknown { color: var(--ink-soft); background: #f0f3f1; }
  #journal-list .record-body { min-width: 0; }
  #journal-list .journal-details { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
  #journal-list .journal-field { min-width: 0; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper-bright); }
  #journal-list .journal-field dt { margin: 0 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); color: var(--forest); font-size: 14px; line-height: 1.5; text-wrap: balance; }
  #journal-list .journal-field dd { margin: 0; font-size: 16px; line-height: 1.9; overflow-wrap: anywhere; }
  #journal-list .journal-field p { margin: 0; max-width: 48em; white-space: pre-wrap; text-wrap: pretty; }
  #journal-list .journal-field p + p { margin-top: 1em; }
  @media (max-width: 600px) {
    #journal-list .journal-field { padding: 16px; }
    #journal-list .record-actions { flex-wrap: wrap; }
  }
  .document-save-actions { flex-wrap: wrap; gap: 8px; padding-bottom: max(16px, env(safe-area-inset-bottom)); }
  .document-save-actions [data-editor-save-status] { flex: 1 0 100%; margin: 0; font-size: 13px; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
  .document-save-actions [data-editor-save-status][data-dirty="true"] { color: #855319; }
  .document-save-actions .button { min-height: 44px; font-size: 14px; padding: 10px 14px; }
  #discard-editor-dialog { max-width: 520px; padding: 24px; }
  @media (max-width: 600px) {
    .document-save-actions .button { flex: 1 1 auto; }
  }
  @media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
  }
}
@media print {
  body.daily-summary-printing #daily-summary-dialog {
    animation: none !important; opacity: 1 !important; transform: none !important; overflow: visible;
  }
  body.daily-summary-printing .daily-summary-card { min-height: 0; }
  body.daily-summary-printing .daily-summary-illustration img { filter: none; }
  .daily-summary-excerpt, .daily-summary-record-detail { display: none !important; }
  .daily-summary-print-full { display: block !important; white-space: pre-wrap; overflow-wrap: anywhere; }
  .daily-summary-parent-health p { white-space: pre-wrap; overflow-wrap: anywhere; }
}
/* Optional scratch notes and explicit AI review use the existing form palette. */
.pdf-repair-list { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: .5rem; }
.pdf-repair-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem 1rem; padding: .75rem; background: var(--paper-bright); border: 1px solid var(--line); border-radius: 8px; }
.pdf-repair-list li > div { flex: 1 1 12rem; }
.pdf-repair-list small { display: block; color: var(--ink-soft); font-size: .8125rem; }
#view-documents .pdf-repair-list .button { flex: 0 1 auto; }
.pdf-repair-panel { margin-block: 1rem; padding: 1rem; border: 1px solid #dcaba0; border-radius: 9px; background: #fff4f0; }
.pdf-repair-panel p, .pdf-action-error p { margin: .5rem 0 0; text-wrap: pretty; }
.pdf-repair-panel strong, .pdf-action-error strong { font-family: inherit; }
.pdf-repair-hint { color: #893b2b; line-height: 1.6; font-variant-numeric: tabular-nums; }
textarea.pdf-repair-target { border-color: #ad563b; box-shadow: inset 3px 0 #ad563b; }
@media (max-width: 600px) { .pdf-repair-list .button { width: 100%; } }
.journal-memo { min-width: 0; padding: 1rem; border: 1px solid #c9dad1; border-radius: 12px; background: #f4f8f4; }
.journal-memo .field { margin: 0; }
.journal-memo-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.journal-memo > .journal-memo-actions .button { min-height: 40px; padding: 8px 15px; border-radius: 9px; box-shadow: none; font-family: var(--font-ui); font-size: 13px; font-weight: 600; line-height: 1.4; }
.journal-memo > #journal-memo-help { display: block; margin-top: 8px; color: var(--ink-soft); font-size: 12px; line-height: 1.55; }
.journal-memo-actions output { font-size: .875rem; }
.journal-memo-text { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.75; margin: .5rem 0 0; }
.journal-memo-candidate { min-width: 0; padding: .875rem; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--paper-bright); }
.journal-memo-candidate[data-selected="true"] { border-color: var(--forest); box-shadow: inset 3px 0 var(--forest); }
.journal-memo-candidate[data-empty="true"] { background: transparent; color: var(--ink-soft); }
.journal-memo-candidate .journal-memo-text p { margin: 0; text-wrap: pretty; }
.journal-memo-candidate .journal-memo-text p + p { margin-top: .625rem; }
#journal-memo-preview { margin-top: 1.5rem; padding-top: 1.25rem; border-top: 1px solid var(--line-strong); }
.journal-memo-preview-heading { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: .5rem; }
.journal-memo-preview-heading h3 { margin: 0; font-family: inherit; font-size: 1.125rem; text-wrap: balance; }
#journal-memo-selection { font-size: .875rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
#journal-memo-selection-help { margin: .5rem 0 1rem; font-size: .875rem; color: var(--ink-soft); text-wrap: pretty; }
#journal-memo-candidates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: .75rem; }
.journal-memo .checkbox-field { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; min-height: 2.25rem; cursor: pointer; }
.journal-memo .checkbox-field strong { font-size: .9375rem; }
.journal-memo-mode { margin-left: auto; padding: .125rem .5rem; background: var(--paper); border-radius: 6px; font-size: .75rem; color: var(--ink-soft); white-space: nowrap; }
.journal-memo-preview-actions { padding-top: .75rem; }
.journal-memo input[type="checkbox"] { width: auto; flex-shrink: 0; }
@media (max-width: 600px) {
  .journal-memo-actions .button { flex: 1 1 100%; }
  #journal-memo-candidates { grid-template-columns: minmax(0, 1fr); }
}

/* Daily work queue: keep the name, status and next action on one scan line. */
@media screen {
  .attendance-scope { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; }
  .attendance-scope button { min-height: 44px; padding: 10px 20px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; background: white; color: var(--forest); cursor: pointer; }
  .attendance-scope button[aria-pressed="true"] { color: white; background: var(--forest); border-color: var(--forest); }
  #view-today .attendance-toolbar { grid-template-columns: minmax(180px, 240px) minmax(0, 1fr); }
  #view-today .attendance-record-progress { border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 14px 0 0; }
  #view-today .attendance-record-progress p { line-height: 1.7; text-wrap: pretty; }
  #view-today .attendance-record-tools { gap: 10px; }
  #attendance-record-filter { width: auto; max-width: 100%; min-height: 44px; padding: 8px 28px 8px 10px; border: 1px solid var(--line-strong); border-radius: 6px; color: var(--ink); background: white; font: inherit; font-size: 14px; }
  .attendance-bulk-panel { grid-column: 1 / -1; border-top: 1px solid var(--line); padding-top: 12px; }
  .attendance-bulk-panel > summary { min-height: 36px; color: var(--ink-soft); font-size: 14px; cursor: pointer; }
  #view-today .attendance-bulk-controls { border: 0; padding-top: 6px; }
  #view-today .attendance-list:not(.empty-state) { gap: 0; border: 1px solid var(--line); border-radius: 10px; background: white; }
  #view-today .attendance-row, #view-today .attendance-list-heading { display: grid; grid-template-columns: 28px minmax(140px, 1fr) 116px minmax(100px, .7fr) 154px; gap: 12px; align-items: center; padding: 12px 16px; }
  #view-today .attendance-list-heading { color: var(--ink-soft); font-size: 12px; font-weight: 700; background: var(--paper); border-radius: 10px 10px 0 0; }
  #view-today .attendance-row { border: 0; border-top: 1px solid var(--line); border-radius: 0; background: transparent; }
  #view-today .attendance-row > * { min-width: 0; }
  #view-today:not(:has(#attendance-bulk-panel[open])) .attendance-selection { visibility: hidden; }
  #view-today .attendance-identity strong { font-size: 15px; line-height: 1.5; }
  #view-today .attendance-status-field { margin: 0; }
  #view-today .attendance-status-field select { width: 100%; min-width: 0; min-height: 44px; padding: 8px 22px 8px 8px; font: inherit; font-size: 13px; border: 1px solid var(--line-strong); border-radius: 6px; background-color: white; color: var(--ink); }
  .attendance-record-cell .attendance-journal-badge { display: inline-block; padding: 5px 8px; border-radius: 5px; background: #fff1da; color: #73501c; font-size: 12px; font-weight: 700; line-height: 1.6; font-variant-numeric: tabular-nums; }
  .attendance-record-cell .is-complete { color: var(--forest); background: #e6f2ea; }
  .attendance-record-cell .is-draft { color: #70541f; background: #f7edcf; }
  .attendance-record-cell .is-unknown { color: var(--ink-soft); background: var(--paper); }
  #view-today .attendance-links { grid-column: auto; display: grid; gap: 2px; justify-items: stretch; }
  #view-today .attendance-links .button { min-height: 44px; padding: 8px; font-size: 13px; }
  #view-today .attendance-open-child { min-height: 32px; font-size: 12px; }
  #view-today .attendance-filter { transition: none; transform: none; }
}
@media screen and (max-width: 1100px) {
  #view-today .attendance-list-heading { display: none; }
  #view-today .attendance-row { grid-template-columns: 24px minmax(0, 1fr) 130px; gap: 8px 12px; }
  #view-today .attendance-status-field { grid-column: 3; }
  #view-today .attendance-record-cell { grid-column: 2; }
  #view-today .attendance-links { grid-column: 3; }
}
@media screen and (max-width: 600px) {
  #view-today .attendance-toolbar { grid-template-columns: minmax(0, 1fr); padding: 12px; }
  .attendance-scope button { flex: 1; padding: 8px; font-size: 13px; }
  #view-today .attendance-row { grid-template-columns: 20px minmax(0, 1fr); padding: 12px; }
  #view-today .attendance-status-field, #view-today .attendance-record-cell, #view-today .attendance-links { grid-column: 2; }
  #view-today .attendance-links { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
  #view-today .attendance-record-tools label { flex-wrap: wrap; }
}

/* Indeterminate activity marker: visible only while the open dialog is busy. */
#assessment-generation-dialog[open] #assessment-generation-submit[aria-busy="true"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  opacity: 1;
  background: var(--forest);
  color: #fff;
  cursor: wait;
}
#assessment-generation-dialog[open] #assessment-generation-submit[aria-busy="true"]::before {
  content: "";
  display: block;
  flex: 0 0 auto;
  width: 16px;
  height: 16px;
  box-sizing: border-box;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
}
@media (prefers-reduced-motion: no-preference) {
  #assessment-generation-dialog[open] #assessment-generation-submit[aria-busy="true"]::before {
    animation: assessment-busy-spin .9s linear infinite;
  }
}
@keyframes assessment-busy-spin {
  to { transform: rotate(360deg); }
}

/* Consistent, on-demand writing controls across document and record editors. */
.field-writing-heading { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.field-writing-heading .assessment-writing-toggle { margin-inline-start: auto; min-height: 32px; padding: 5px 9px; font-size: 12px; }
.field-writing-tools { min-width: 0; padding: 12px; }
.field-writing-tools > label { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; min-width: 0; }
.field-writing-tools .assessment-writing-note { grid-column: 1 / -1; }
.assessment-legacy-note { margin: 12px 16px; color: var(--ink-soft); font-size: 13px; }
#assessment-editor-form .assessment-step-nav button > strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#plan-editor-form .plan-step-nav button > strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#plan-editor-form:has([data-plan-pages]) { max-height: min(calc(88dvh - 2px), 898px); }
#plan-editor-form .plan-step > .field-grid { min-width: 0; }
#plan-editor-form [data-plan-pages] .assessment-page-controls { margin-bottom: 20px; }
#plan-editor-form [data-plan-pages] .document-goal-editor { grid-column: 1 / -1; min-width: 0; }
.document-create-status { flex: 1 1 100%; margin: 8px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.document-create-status[data-failed="true"] { color: var(--error); }
@media (max-width: 480px) {
  #plan-editor-form [data-plan-page-controls] { display: grid; grid-template-columns: 1fr 1fr; }
  #plan-editor-form [data-plan-position] { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}

/* 運用設定：操作範囲を先に示し、職員と事業所を一度に並べない。 */
.admin-access-summary, .staff-role-help { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: var(--paper-bright); }
.admin-access-summary p, .staff-role-help p { margin: 6px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.staff-role-help { grid-column: 1 / -1; }
.staff-role-help .staff-access-warning { color: var(--error); }
#staff-edit-dialog, #staff-invite-dialog { width: min(720px, calc(100vw - 32px)); }
#staff-edit-dialog > form, #staff-invite-dialog > form { padding: 34px 38px 30px; }
#staff-edit-dialog .dialog-heading, #staff-invite-dialog .dialog-heading { padding-bottom: 22px; border-bottom: 1px solid var(--line); }
#staff-edit-dialog .dialog-heading h2, #staff-invite-dialog .dialog-heading h2 { margin-block: 7px 6px; }
#staff-edit-dialog .dialog-heading > p:last-child, #staff-invite-dialog .dialog-heading > p:last-child { color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.staff-edit-fields { grid-template-areas: "role status" "help help"; gap: 0 22px; align-items: start; }
.staff-edit-fields .staff-role-field { grid-area: role; }
.staff-edit-fields .staff-status-field { grid-area: status; }
.staff-edit-fields .staff-role-help { grid-area: help; margin-top: 20px; padding: 20px 22px; border-left: 4px solid var(--forest); background: #f8faf8; }
.staff-edit-fields .staff-role-help strong { color: var(--forest); font-size: 16px; }
.staff-edit-fields .staff-role-help p { max-width: 58ch; margin-top: 8px; }
#staff-edit-form > .dialog-actions, #staff-invite-form > .dialog-actions { margin-top: 28px; padding-top: 22px; }
.admin-panel-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0; }
.admin-panel-nav [aria-pressed="true"] { background: var(--forest); color: white; border-color: var(--forest); }
#main-content > .save-undo-notice { position: static; inset: auto; transform: none; width: auto; max-width: none; margin: 0 0 20px; }
.admin-staff-filters { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 12px; margin: 16px 0; }
.admin-staff-filters output { grid-column: 1 / -1; color: var(--ink-soft); font-size: 13px; font-variant-numeric: tabular-nums; }
#view-admin .staff-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1.35fr) auto; align-items: center; }
#view-admin .staff-card h2 { font-family: var(--font-heading); font-size: 17px; }
#view-admin .staff-card a, #view-admin .staff-card p { overflow-wrap: anywhere; font-size: 13px; }
#view-admin .staff-identity-status { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
#view-admin .staff-identity-status .status-chip { align-self: auto; font-size: 11px; }
#view-admin .staff-role small { display: block; max-width: 28em; margin-top: 6px; font-size: 12px; line-height: 1.6; color: var(--ink-soft); }
#view-admin .staff-role { display: grid; justify-items: start; gap: 2px; }
#view-admin .staff-role > strong { white-space: nowrap; }
#view-admin .staff-role > small { min-width: 0; white-space: normal; overflow-wrap: anywhere; }
#view-admin .staff-actions { flex-wrap: wrap; }
#view-admin .staff-card > * { min-width: 0; }
@media (max-width: 1000px) {
  #view-admin .staff-card { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
}
@media (max-width: 600px) {
  .admin-staff-filters, #view-admin .staff-card { grid-template-columns: minmax(0, 1fr); }
  #view-admin .staff-actions .button { width: 100%; }
  .admin-panel-nav .button { flex: 1; }
  #staff-edit-dialog > form, #staff-invite-dialog > form { padding: 24px 20px 20px; }
  .staff-edit-fields { grid-template-areas: "role" "status" "help"; grid-template-columns: minmax(0, 1fr); }
  .staff-edit-fields .staff-role-help { margin-top: 18px; padding: 17px 18px; }
}
@media (max-width: 860px) {
  .primary-nav { grid-template-columns: repeat(4, minmax(0, 1fr)); overflow: visible; }
  .primary-nav button { min-width: 0; min-height: 44px; overflow-wrap: anywhere; }
}
@media (max-width: 600px) {
  .primary-nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.custom-field-row .field > span { min-height: 32px; display: flex; align-items: center; }
@media (max-width: 600px) {
  .field-writing-heading .assessment-writing-toggle { min-height: 40px; }
  .custom-field-row .field > span { min-height: 40px; }
  .field-writing-tools { display: flex; flex-wrap: wrap; gap: 8px; }
  .field-writing-tools > label, .field-writing-tools > output, .field-writing-tools > .writing-assist-status { flex-basis: 100%; }
}

/* Record types stay visible before opening the editor. */
.primary-nav .record-nav-shortcut { padding-block: 10px; margin-top: -4px; }
.primary-nav .record-nav-shortcut > strong { font-size: 13px; font-weight: 700; }
.primary-nav .record-nav-shortcut > small { grid-column: 2; margin-top: 3px; color: #c2d4cf; font-size: 11px; }
#supplemental-records-title { scroll-margin-top: 100px; }
.support-record-picker > h3, .support-record-list-title { margin: 0 0 8px; font-size: 18px; color: var(--forest); }
.support-record-picker > p { margin: 0 0 20px; color: var(--ink-soft); font-size: 14px; }
.support-record-shortcuts { display: grid; gap: 20px; }
.support-record-kind-group h4 { margin: 0 0 10px; color: var(--ink-soft); font-size: 14px; }
.support-record-kind-choices { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.support-record-kind-button { display: grid; gap: 8px; min-width: 0; padding: 18px; border: 1px solid #b9d3c9; border-radius: 10px; background: #f4f9f6; color: var(--forest); text-align: left; }
.support-record-kind-button strong { font-size: 16px; line-height: 1.5; overflow-wrap: anywhere; }
.support-record-kind-button small { color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.support-record-kind-button > span { align-self: end; font-size: 13px; font-weight: 700; }
.support-record-kind-button:hover:not(:disabled) { border-color: var(--forest); background: #e6f2ea; }
.support-record-kind-button:focus-visible { outline: 3px solid #a64d30; outline-offset: 3px; }
.support-record-kind-button:disabled { opacity: .6; cursor: not-allowed; }
.support-record-picker + .document-lane-controls { margin-block: 16px 24px; }
@media (max-width: 850px) { .support-record-kind-choices { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .support-record-kind-choices { grid-template-columns: minmax(0, 1fr); } }

/* Support records use the same readable page structure as assessments. */
#support-record-editor-dialog { width: min(1040px, calc(100vw - 32px)); }
#support-record-editor-form { max-height: min(calc(88dvh - 2px), 898px); padding-bottom: 0; }
#support-record-editor-form > .field { margin-bottom: 18px; }
#support-record-editor-form .record-step-nav { grid-template-columns: repeat(var(--record-page-count), minmax(0, 1fr)); }
#support-record-editor-form .record-step-nav button > strong { white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere; }
#support-record-editor-form .field-grid, #support-record-editor-fields, #support-record-editor-form [data-record-step] { min-width: 0; }
#support-record-editor-form .assessment-page-controls { margin-bottom: 20px; }
#support-record-editor-form > .dialog-actions { position: sticky; z-index: 7; bottom: -1px; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: var(--paper-bright); }
@media (max-width: 640px) {
  #support-record-editor-form .record-step-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  #support-record-editor-form > .dialog-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  #support-record-editor-form > .dialog-actions .button { width: auto; flex: 1 1 auto; }
}
@media (max-width: 480px) {
  #support-record-editor-form [data-record-page-controls] { display: grid; grid-template-columns: 1fr 1fr; }
  #support-record-editor-form [data-record-position] { grid-column: 1 / -1; grid-row: 1; text-align: center; }
}

/* Confirm a plan in one form; retain the detailed audit trail on demand. */
#plan-finalization-dialog { width: min(880px, calc(100vw - 32px)); }
#plan-finalization-form { max-height: min(calc(88dvh - 2px), 898px); padding-bottom: 0; }
#plan-finalization-form > section { margin-block: 24px; }
#plan-finalization-form h3 { margin: 0 0 12px; font-size: 18px; }
#plan-finalization-form .field-grid { min-width: 0; }
.finalization-confirmation { display: flex; align-items: flex-start; gap: 12px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--paper); line-height: 1.7; }
.finalization-confirmation input { flex: 0 0 20px; width: 20px; height: 20px; min-height: 20px; margin-top: 3px; accent-color: var(--forest); }
#plan-finalization-form > .dialog-actions { position: sticky; bottom: -1px; z-index: 7; padding: 12px 0 max(12px, env(safe-area-inset-bottom)); background: var(--paper-bright); }
#workflow-actions { padding: 0; border: 0; background: none; }
#workflow-actions > details { flex-basis: 100%; }
#workflow-dialog details > summary { padding: 12px 0; color: var(--ink-soft); cursor: pointer; }
#workflow-actions details .button { margin: 8px 8px 0 0; }
#workflow-records p { overflow-wrap: anywhere; line-height: 1.7; }
@media (max-width: 640px) {
  #plan-finalization-form > .dialog-actions { flex-direction: row; flex-wrap: wrap; gap: 8px; }
  #plan-finalization-form > .dialog-actions .button { width: auto; flex: 1 1 auto; }
}

/* Keep saved records navigable as their count increases. */
.support-record-list-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 12px; margin: 16px 0; }
.support-record-list-tools .field { flex: 0 1 420px; min-width: 240px; }
.support-record-list-tools p { color: var(--ink-soft); font-size: 13px; margin: 0 0 10px; }
.support-record-pagination { display: flex; gap: 8px; }
@media (max-width: 520px) { .support-record-pagination { width: 100%; } .support-record-pagination .button { flex: 1; } }
#supplemental-record-list.document-list { display: grid; gap: 0; border-top: 1px solid var(--line); }
#supplemental-record-list > .document-item { display: grid; grid-template-columns: minmax(260px, 1fr) auto; grid-template-areas: "summary actions" "meta actions"; gap: 5px 24px; align-items: center; padding: 17px 0; border-bottom: 1px solid var(--line); }
#supplemental-record-list .support-record-summary { display: flex; grid-area: summary; align-items: center; flex-wrap: wrap; gap: 8px; min-width: 0; }
#supplemental-record-list .support-record-summary strong { font-family: var(--font-ui); font-size: 15px; font-weight: 650; line-height: 1.45; }
#supplemental-record-list .document-date-meta { grid-area: meta; padding: 0; font-size: 11px; line-height: 1.5; }
#supplemental-record-list .document-actions { display: flex; grid-area: actions; flex-direction: row; align-items: center; width: auto; gap: 7px; }
#supplemental-record-list .document-actions .button { flex: 0 0 auto; width: auto; min-height: 38px; padding: 7px 13px; font-size: 12px; white-space: nowrap; }
@media (max-width: 760px) {
  .support-record-list-tools .field { flex-basis: 100%; min-width: 0; }
  #supplemental-record-list > .document-item { grid-template-columns: minmax(0, 1fr); grid-template-areas: "summary" "meta" "actions"; gap: 8px; padding: 16px 0; }
  #supplemental-record-list .document-actions { flex-wrap: wrap; }
  #supplemental-record-list .document-actions .button { flex: 1 1 auto; }
}
.support-record-pagination .button { border: 1px solid var(--line); background: var(--paper-bright); color: var(--forest); }

/* Keep saving within reach while editing long daily records. */
#journal-form { scroll-padding-bottom: 165px; }
#journal-form > .journal-save-actions {
  position: sticky;
  z-index: 7;
  bottom: -28px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  padding: 12px 0 max(12px, env(safe-area-inset-bottom));
  background: var(--paper-bright);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 16px var(--paper-bright);
}
.journal-save-actions > output, .journal-save-actions > p { grid-column: 1 / -1; margin: 0; font-size: 12px; line-height: 1.5; color: var(--ink-soft); }
.journal-save-actions > .button { width: auto; min-width: 0; padding: 10px 12px; white-space: normal; }
@media (max-width: 600px) {
  #journal-form > .journal-save-actions { bottom: -22px; grid-template-columns: auto minmax(0, 1fr) minmax(0, 1fr); }
  .journal-save-actions > .button { padding: 10px 8px; font-size: 13px; }
}

.journal-photo-source-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.journal-photo-source-actions > .button { flex: 1 1 150px; min-height: 44px; white-space: normal; }
.journal-camera-help { margin: 8px 0 0; color: var(--ink-soft); font-size: 12px; line-height: 1.6; }

/* Shared record updates remain in the normal flow and never cover save controls. */
.shared-record-notice { margin: 12px 0; padding: 14px 16px; border: 1px solid #bcb579; border-radius: 12px; background: #fffbea; color: #36443b; }
.shared-record-notice p { margin: 0 0 10px; overflow-wrap: anywhere; }
.shared-record-notice[hidden] { display: none; }
.record-update-meta { color: #526f6c; font-size: .9rem; }
.shared-record-comparison { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.shared-record-comparison textarea, .shared-input-copy textarea { width: 100%; box-sizing: border-box; line-height: 1.7; }
.shared-input-copy { margin: 12px 0; padding: 12px; border: 1px solid #b7ccc5; border-radius: 12px; background: #f3f8f5; }
#shared-record-dialog { max-height: 88dvh; overflow-y: auto; }
#shared-record-dialog .dialog-actions { flex-wrap: wrap; position: sticky; bottom: 0; background: #fff; padding: 12px 0; z-index: 1; }
@media (max-width: 640px) {
  .shared-record-comparison { grid-template-columns: minmax(0, 1fr); }
  #shared-record-dialog .dialog-actions button { width: 100%; white-space: normal; }
}

/* Adapted from 3piece-dev-group/day-service static/css/base.css @ 8590ea6.
   Screen-only: official PDF/print layouts keep their styling. */
@media screen {
  :root{--paper:#f3efe7;--paper-bright:#fffdf8;--ink:#172d31;--ink-soft:#486064;--forest:#4e7d89;--forest-deep:#3f6974;--line:#d8d2c6;--line-strong:#b6c8ca;--shadow:0 10px 28px rgb(48 53 42 / 5%)}
  body{background:radial-gradient(circle at 86% 3%,rgba(145,165,130,.16),transparent 26rem),linear-gradient(135deg,#f4f1eb 0%,#ece8df 100%);color:var(--ink)}.workspace{background:transparent;color:var(--ink)}
  .sidebar{background:linear-gradient(150deg,#16333b 0%,#10292f 74%);color:#d8e3e5}
  .current-child{background:rgb(255 255 255 / 4%);border-color:#486068}
  .primary-nav button{font-size:15px;font-weight:500;color:#c8d6d9;border-radius:13px;gap:10px}
  .primary-nav button[aria-current="page"]{background:#2c464e;box-shadow:inset 3px 0 #d69972;color:#fff}
  .primary-nav button:hover{background:rgb(255 255 255 / 8%)}
  .primary-nav .nav-icon{display:inline-flex;width:22px;height:22px;color:#9eb6bd;letter-spacing:0}
  .primary-nav .nav-icon svg{width:22px;height:22px}
  .topbar{min-height:82px;justify-content:space-between;gap:20px;background:#f4f1eb;border-bottom:1px solid #d8d2c6;padding-block:15px}
  .workspace-page-title{margin:0;font-family:"Yu Mincho","Hiragino Mincho ProN",serif;font-size:24px;font-weight:700;letter-spacing:.035em;line-height:1.5}
  .session-context{margin-left:auto;justify-content:flex-end;gap:10px}
  .topbar .button,.topbar .logout-button{font-weight:500}
  .page-heading h1{color:#172d31;letter-spacing:.01em;font-size:32px;font-weight:700}
  .button-primary{background:#4e7d89;border-color:#4e7d89;color:#fff}
  .button-primary:hover{background:#386672;border-color:#386672}
  .button-secondary{background:#fffdf8;border-color:#8daab1;color:#426c78;font-weight:500}
  .button-secondary:hover{background:#e3edf0}
  .service-tabs button[aria-current=page]{background:#4e7d89;color:#fff}
  .service-workspace{padding-top:16px}
  .service-card,.detail-sheet,.subsection-card,.record-card{background:#fffdf8;border-color:#d8d2c6;box-shadow:var(--shadow)}
  .service-table{background:#fffdf8;font-size:15px}
  .service-table thead{background:#dce8e9;color:#536f77}
  .service-table th{padding:15px 18px;border-bottom:2px solid #bcb7ab;font-weight:600}
  .service-table td{border-color:#d8d2c6;padding:16px 18px}
  .service-scroll{border-color:#d8d2c6;border-radius:20px;box-shadow:var(--shadow)}
  .service-status{background:#dce8e9;color:#436f7b;border-color:#a9c5cd}
  .service-workspace input:not([type=checkbox]),.service-workspace select,.service-workspace textarea{background:#fffdf9;border-color:#b3c6ca;color:#243b42}
  .service-workspace input[type=checkbox]{accent-color:#4e7d89}
  .service-summary>div{background:#dfeaec}
  .service-calendar-day[aria-pressed=true]{border-color:#4e7d89;background:#e0ecee}
  .service-matrix th:first-child,.service-matrix td:first-child{background:#f7f4ec}
  @media(max-width:860px){.workspace-page-title{font-size:21px}.topbar{gap:10px;padding:16px 18px;flex-wrap:wrap}.session-context{flex-wrap:wrap}.primary-nav button{font-size:13px}.service-workspace{padding-top:0}}
  @media(max-width:600px){.workspace-page-title{width:100%}.topbar .session-context{margin-left:0;width:100%;justify-content:flex-start}.page-heading h1{font-size:28px}}
}

/* day-service 8590ea6: shared application layout and complete workflow surfaces. */
@media screen {
  .app-shell{grid-template-columns:240px minmax(0,1fr)}
  .sidebar{padding:24px 12px 14px;gap:18px;height:100dvh;overflow-y:auto;display:flex;flex-direction:column}
  .sidebar .brand{padding:0 10px}.sidebar .brand strong{font-size:22px}.sidebar .facility-identity{margin:0 10px;padding:0;border:0;font-size:12px}.sidebar .facility-identity>span{display:none}
  .primary-nav{gap:5px}.primary-nav button{min-height:46px;padding:10px 12px;font-size:14px;font-weight:500;border-radius:12px;gap:12px;line-height:1.5}.nav-icon{width:20px;height:20px}.nav-settings{display:grid;gap:5px;margin-top:12px;padding-top:12px;border-top:1px solid #dce6df}.nav-settings button{width:100%}
  .sidebar-help-link{display:flex;margin-top:auto;min-height:42px;align-items:center;padding:10px 12px;border-top:1px solid #395056;color:#dce8e9;font-size:12px;font-weight:700;text-decoration:none}.sidebar-help-link:hover{color:#fff;background:#ffffff0d}.sidebar-help-link:focus-visible{outline:3px solid #dce8e9;outline-offset:2px}.sidebar-account{margin-top:0;border:1px solid #395056;border-radius:12px;display:flex;align-items:center;gap:8px;padding:12px}.sidebar-account .staff-context{display:flex!important;min-width:0;flex:1;color:#dce8e9}.sidebar-account .staff-context strong{color:inherit;font-size:13px}.sidebar-account .staff-context span{font-size:10px;color:#9fb4b8}.sidebar-account .logout-button{font-size:10px;border:0;background:transparent;color:#dce8e9;padding:4px;min-width:0}
  .topbar{padding:18px 36px;min-height:76px}.workspace-page-title{font-size:23px}.topbar .session-context{margin-left:auto}.topbar .session-context>a[href='/journal.html']{display:none!important}
  #toggle-navigation{display:none}.workspace>main{padding:48px 36px 64px}.page-view,.service-workspace{max-width:none}
  .workspace>.current-child{display:none;width:auto;max-width:500px;margin:20px 36px 0;padding:10px 16px;border:1px solid #d8d2c6;background:#fffdf8;color:#486064;border-radius:12px;min-height:0;gap:4px;box-shadow:none;text-align:left}
  .workspace>.current-child strong{color:#172d31;font-size:16px}.workspace>.current-child span{color:#486064;font-size:11px}.app-shell[data-view=child] .workspace>.current-child,.app-shell[data-view=contact] .workspace>.current-child,.app-shell[data-view=documents] .workspace>.current-child{display:flex}
  .page-heading h1,.reference-heading h1{font-size:24px;font-weight:700;line-height:1.5;margin:0;color:#172d31}.page-heading{margin-bottom:24px}.page-heading p{font-size:13px;line-height:1.7}.page-heading .eyebrow{color:#4e7d89;font-size:11px;letter-spacing:.1em}
  .reference-workspace{display:block!important}.reference-heading{display:flex;align-items:center;justify-content:space-between;gap:16px;flex-wrap:wrap;margin-bottom:22px}.reference-heading h1{display:flex;gap:10px;align-items:center}.reference-heading .heading-icon{width:24px;height:24px}.reference-heading .calendar-month-nav{margin:0}.reference-heading .calendar-month-picker{font-size:16px;min-width:120px}
  .reference-actions,.reference-filter{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-bottom:20px}.reference-filter{align-items:end}.reference-filter .field{margin:0;min-width:160px;max-width:340px}.reference-filter .field:first-child{min-width:230px}.reference-filter .field>span{font-size:12px}.reference-actions .button,.reference-filter .button,.service-tabs .button{font-size:13px;padding:9px 13px;min-height:40px;border-radius:8px;background:transparent}.reference-actions [aria-current=page]{background:#6099f3;color:#fff;border-color:#6099f3}.reference-actions [data-service-action=load-billing]{border-color:#198754;color:#198754}
  .reference-alert{padding:18px 20px;background:#dce8e9;color:#3f6974;border:1px solid transparent;border-radius:8px;line-height:1.8;font-size:14px;margin:18px 0}.reference-alert.warning{background:#faefd9;border-color:#a26713;color:#8d540b}.reference-alert-row{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #dac8a7;padding:8px 0}.reference-alert-row:first-of-type{margin-top:12px}.reference-alert-row .button{border:0;background:transparent;padding:4px 0;color:inherit}.reference-date{font-size:14px;color:#63797d;margin:0 0 26px}.reference-section-title{font-size:18px;margin:28px 0 14px;color:#3f6974}
  .reference-list{border:1px solid #d8d2c6;border-radius:18px;overflow:hidden;background:#fffdf8;box-shadow:0 8px 20px rgb(25 43 43 / 4%)}.reference-list-row{display:flex;width:100%;align-items:center;justify-content:space-between;gap:16px;padding:18px 22px;border:0;border-bottom:1px solid #d8d2c6;background:transparent;text-align:left;color:#172d31;cursor:pointer}.reference-list-row:last-child{border-bottom:0}.reference-list-row:hover{background:#eef3f1}.reference-list-row strong{font-size:17px}.reference-list-row small{display:block;font-size:12px;color:#718083;margin-top:8px}.reference-empty{padding:24px;text-align:center;color:#7a8587;font-size:13px;margin:0}.reference-columns{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin:24px 0}.reference-card{background:#fffdf8;border:1px solid #d8d2c6;border-radius:18px;overflow:hidden;padding:22px}.reference-card>h2{margin:-22px -22px 20px;padding:14px 22px;background:#dce8e9;color:#3f6974;font-size:16px}.reference-quick{display:grid;gap:9px}.reference-quick .button{text-align:left;font-weight:500;background:transparent}.reference-profile{display:grid;grid-template-columns:70px 1fr;gap:18px;margin-bottom:30px;font-size:14px}.reference-profile dd{margin:0}.reference-profile dt{color:#728185}
  .reference-week-nav{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:24px}.reference-week-nav strong{font-family:'Yu Mincho',serif;font-size:16px}.reference-week-nav a{margin-left:auto}.reference-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px;align-items:start}.reference-week-day{background:#fffdf8;border:1px solid #dde4e5;border-radius:12px;overflow:hidden}.reference-week-day>header{padding:10px;background:#f3f7f7;text-align:center;border-bottom:1px solid #dde4e5}.reference-week-day>header small{display:block;font-size:11px;color:#6a9098}.reference-week-day>header strong{font-family:'Yu Mincho',serif;font-size:23px;font-weight:500}.reference-week-day[data-weekday='6']>header{color:#3a6bba}.reference-week-day[data-weekday='0']>header{color:#c0392b}.reference-week-day.is-today>header{background:#0f6e56;color:white}.reference-week-day.is-today>header small{color:white}.reference-week-day>div{padding:7px;display:grid;gap:6px}.reference-visit{display:block;width:100%;border:1px solid #d8dedf;background:#f0f2f2;color:#5a6e70;border-radius:7px;padding:9px 7px;text-align:left;cursor:pointer;overflow-wrap:anywhere}.reference-visit strong{font-size:12px;font-weight:500}.reference-visit small{display:block;font-size:10px;margin-top:4px}.reference-visit[data-state=draft]{background:#faeeda;border-color:#e8c98a;color:#7a5220}.reference-visit[data-state=final]{background:#eaf3de;border-color:#b8d89e;color:#2e5a25}.reference-visit[data-state=absent]{background:#f5f5f5;color:#959595}.reference-week-day>.button{font-size:11px;min-height:36px;background:transparent;border:0;border-top:1px dashed #dde4e5;border-radius:0;width:100%;padding:8px 2px;color:#6a9098}
  .reference-matrix-scroll{max-width:100%;overflow:auto;border:1px solid #d8d2c6}.reference-matrix{border-collapse:collapse;table-layout:fixed;width:100%;min-width:950px;background:#fffdf8;font-size:12px}.reference-matrix th,.reference-matrix td{border-right:1px solid #d8d2c6;border-bottom:1px solid #d8d2c6;padding:0;text-align:center}.reference-matrix thead th{padding:12px 1px;background:#f8f9fa;border-bottom:2px solid #b7b0a3;color:#486064;font-weight:500}.reference-matrix thead small{display:block;font-size:10px;margin-top:5px}.reference-matrix tr>:first-child{position:sticky;left:0;width:102px;background:#fffdf8;z-index:1;padding:10px 8px;text-align:left;font-weight:600;overflow-wrap:anywhere}.reference-matrix tr>:last-child{width:67px;background:#f8f9fa;font-weight:600;border-right:0}.reference-matrix thead [data-weekday='6']{background:#f0f4ff;color:#3366cc}.reference-matrix thead [data-weekday='0']{background:#fff0f0;color:#c33}.reference-billing-cell{border:0;background:transparent;color:#4e7d89;display:flex;width:100%;min-height:38px;align-items:center;justify-content:center;flex-direction:column;padding:2px;cursor:pointer;border-radius:0;font-size:11px!important}.reference-billing-cell:hover{outline:2px solid #4e7d89;outline-offset:-2px}.reference-billing-cell[data-status=attended]{background:#e3eeee}.reference-billing-cell[data-status=absent]{background:#f0f0f0}.reference-billing-cell[data-status=transferred]{background:#faefd9}.reference-billing-badge{display:inline-block;background:#4e7d89;color:#fff;border-radius:6px;padding:1px 5px;font-size:11px}.reference-billing-cell[data-status=absent] .reference-billing-badge,.reference-billing-badge.absent{background:#6c757d}.reference-billing-cell[data-status=transferred] .reference-billing-badge,.reference-billing-badge.transferred{background:#854f0b}.reference-billing-cell small{line-height:1.1;font-size:9px}.unreviewed{color:#854f0b}.reference-billing-legend{display:flex;gap:10px;align-items:center;flex-wrap:wrap;font-size:12px;color:#747b7c;margin:20px 0}.reference-totals{font-weight:600}.reference-total{color:#4e7d89}.service-modal{width:min(850px,calc(100vw - 32px));max-height:90dvh;border:1px solid #d8d2c6;border-radius:18px;background:#fffdf8;color:#172d31;padding:20px;box-shadow:0 18px 80px #10292f44}.service-modal::backdrop{background:#10292f77}.service-modal-close{display:block;margin-left:auto;border:0;background:transparent;padding:8px;color:#486064;cursor:pointer}.service-modal .service-card{margin:0;border:0;box-shadow:none;background:transparent;padding:14px}.service-modal .service-card .service-card{border:1px solid #d8d2c6;margin:14px 0}.service-modal .service-status{margin:8px 0}.service-card{background:#fffdf8;border-radius:18px}.service-scroll{border-color:#d8d2c6;border-radius:12px}.service-table{font-size:14px}.service-table th,.service-table td{padding:14px 12px}.service-tabs{border:0;margin:0 0 20px;padding:0}.service-workspace .service-card h2{font-size:18px}.service-workspace input,.service-workspace select{min-height:42px}
  .reference-journal-layout{display:grid!important;grid-template-columns:280px minmax(0,1fr);gap:22px;align-items:start}.reference-journal-nav{display:grid;gap:10px;max-height:75dvh;overflow:auto}.reference-journal-entry{display:block;background:#fffdf8;border:1px solid #d8d2c6;padding:16px;border-radius:12px;text-align:left;color:#172d31;font-weight:600;font-size:13px;cursor:pointer}.reference-journal-entry small{display:block;font-weight:400;font-size:12px;color:#728184;margin-top:10px;line-height:1.6}.reference-journal-entry[aria-pressed=true]{border:2px solid #4e7d89;background:#eaf1f0}.reference-journal-layout .record-item{display:block;border:1px solid #d8d2c6;border-radius:18px;padding:26px;background:#fffdf8;margin:0}.reference-journal-layout .record-item[hidden]{display:none}.reference-journal-layout .record-date{font-family:'Yu Mincho',serif;font-size:19px;border-bottom:1px solid #d8d2c6;padding:0 0 20px;margin-bottom:20px}.reference-journal-layout .record-date strong{font-family:inherit;color:#4e7d89;font-size:14px}.reference-journal-layout .record-body{padding:0}.reference-journal-layout .record-body>h2{font-size:18px}.journal-details dt{font-size:12px;color:#4e7d89}.journal-details dd{line-height:1.9}
  .detail-sheet,.guardian-card,.document-workspace,.admin-section,.staff-card,.facility-card,.workflow-card,.record-workspace{border-radius:18px;border-color:#d8d2c6;background:#fffdf8;box-shadow:0 8px 24px #172d3108}.detail-grid{gap:0}.detail-grid>div{background:transparent;border:0;border-bottom:1px solid #e4ded2;border-radius:0;padding:20px}.detail-grid dt{font-size:12px;color:#6d8084}.detail-grid dd{font-size:15px;color:#172d31}.document-tabs button,.child-tabs button{font-size:13px;min-height:42px;border-radius:8px}.document-tab-panel{background:#fffdf8;border-radius:18px}.dialog{background:#fffdf8;border-color:#d8d2c6;border-radius:18px}.dialog-heading h2{font-family:'Yu Mincho',serif;color:#172d31}.field input,.field textarea,.field select{border-color:#bdcdd0;border-radius:7px}.button{font-weight:500}.button-primary{background:#4e7d89;border-color:#4e7d89}.button-secondary{color:#4e7d89;border-color:#8ca4ac}.service-status[data-error=true]{color:#933d36}
  .service-tag-row{padding:12px 0;border-bottom:1px solid #e3ded4}.service-tag-row .field>span{font-size:11px}
}
@media screen and (max-width:1100px){.app-shell{grid-template-columns:220px minmax(0,1fr)}.workspace>main{padding:32px 24px}.topbar{padding:16px 24px}.reference-week{grid-template-columns:repeat(4,minmax(0,1fr))}.reference-journal-layout{grid-template-columns:220px minmax(0,1fr)}}
@media screen and (max-width:860px){.app-shell{display:block}.sidebar{position:fixed;inset:0 auto 0 0;width:250px;z-index:100;transform:translateX(-100%);visibility:hidden;transition:transform .18s ease,visibility .18s}.primary-nav{display:flex;flex-direction:column}.primary-nav button{justify-content:flex-start;text-align:left}.primary-nav .nav-icon{display:block}.sidebar .brand,.sidebar .facility-identity,.sidebar-account{display:flex}.sidebar .facility-identity{flex-direction:column}.sidebar .brand>div{display:block}body[data-nav-open] .sidebar{transform:none;visibility:visible;box-shadow:20px 0 50px #10292f33}#toggle-navigation{display:block;background:transparent;color:#4e7d89;border:1px solid #bdcdd0;border-radius:8px;width:40px;height:40px;flex:none;font-size:20px;cursor:pointer}.topbar{position:sticky;top:0;display:flex;flex-wrap:nowrap;gap:12px;z-index:110;padding:12px 16px;min-height:64px}.workspace-page-title{font-size:18px;min-width:0;overflow-wrap:anywhere}.topbar .session-context{width:auto;flex:none}.workspace>main{padding:28px 18px 48px}.workspace>.current-child{margin:16px 18px 0}.reference-columns{grid-template-columns:1fr}.reference-heading{gap:14px}.reference-heading h1,.page-heading h1{font-size:22px}.reference-journal-layout{grid-template-columns:1fr}.reference-journal-nav{display:flex;max-height:none;overflow:auto}.reference-journal-entry{min-width:210px}.service-modal{padding:12px}.reference-filter .field{min-width:0;flex:1}.reference-filter .field:first-child{min-width:180px}}
@media screen and (max-width:640px){.reference-week{grid-template-columns:1fr}.reference-week-day>header{text-align:left;display:flex;align-items:center;gap:10px;padding:10px 14px}.reference-week-day>header strong{font-size:19px}.reference-week-day>header small{font-size:12px}.reference-visit strong{font-size:14px}.reference-week-day>div{padding:10px}.reference-week-nav a{margin-left:0}.reference-alert-row{align-items:start;flex-direction:column}.reference-heading .calendar-month-nav{width:100%;justify-content:space-between}.reference-list-row{padding:16px}.reference-journal-layout .record-item{padding:18px}.reference-filter{gap:12px}.service-modal .service-card{padding:8px}}
@media(prefers-reduced-motion:reduce){.sidebar{transition:none}}
@media screen{.sidebar-account .staff-context{flex-direction:column;align-items:flex-start;border:0;padding:0}.reference-memo{background:#f8fafb;border:1px solid #e4eaec;border-radius:10px;padding:12px 14px;margin-bottom:12px}.reference-memo p{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.8;margin:0 0 8px}.reference-memo small{color:#7c9095}.reference-journal-layout [hidden]{display:none!important}#view-service-home>.reference-workspace>.reference-heading{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.service-modal .service-day-list{margin-top:14px}}

@media screen and (max-width:860px){.sidebar{padding-top:84px}body[data-nav-open]{overflow:hidden}.workspace>.current-child{flex-wrap:wrap;align-items:center}.workspace>.current-child strong{flex-basis:100%;order:2}.workspace>.current-child span:last-child{margin-left:auto}}

/* Secondary writing controls stay below the input, not beside its label. */
.field-writing-footer{display:flex;justify-content:flex-end;min-width:0;margin-top:2px}
.field-writing-footer .assessment-writing-toggle{min-height:32px;padding:5px 4px;border:0;border-radius:4px;background:transparent;color:#59747a;font-size:12px;font-weight:500;line-height:1.5}
.field-writing-footer .assessment-writing-toggle:hover,.field-writing-footer .assessment-writing-toggle[aria-expanded=true]{background:#e8efed;color:#315d68}
.assessment-writing-disclosure:not([open]){display:none}
.assessment-writing-disclosure[open]{margin-top:4px;border:1px solid #d6e0db;background:#f2f5f2;border-radius:8px}
@media(max-width:520px){.field-writing-footer .assessment-writing-toggle{min-height:44px;padding:8px 4px}}

/* A neighbouring writing tool must not distribute spare row height into labels. */
.form-dialog .field-grid > .field{align-content:start}

/* Keep each daily-living rating and its narrative together. */
.assessment-daily-support{grid-column:1/-1;min-width:0;margin-top:24px}
.assessment-daily-support>h3{margin:0;font-size:17px;color:#315d68}
.daily-support-intro{margin:8px 0 16px;font-size:13px;line-height:1.8;color:#526c70}
.daily-support-item{border:1px solid #d8e1dc;border-radius:10px;padding:18px;margin:0 0 16px;background:#fbfcf9;min-width:0}
.daily-support-item>h4{margin:0 0 12px;font-size:16px;color:#203d38}
.daily-support-pair{grid-template-columns:minmax(0,1fr) minmax(0,2fr);gap:16px;align-items:start}
#assessment-editor-form .daily-support-pair>.field{margin:0;align-content:start}
.daily-support-pair .field>.daily-support-help{font-size:12px;line-height:1.8;color:#617574}
.daily-support-example{margin:10px 0 0;font-size:12px;line-height:1.8;color:#617574}
@media(max-width:700px){.daily-support-pair{grid-template-columns:1fr}.daily-support-item{padding:14px}.daily-support-intro{font-size:12px}}

/* Certificate alerts: make each affected person and required action immediately scannable. */
@media screen {
  .reference-alert.warning { padding: 0; overflow: hidden; border-color: #d39a32; border-radius: 18px; background: #fff8e7; color: #593d12; box-shadow: 0 8px 22px rgb(111 74 13 / 8%); }
  .reference-alert-heading { display: flex; align-items: center; gap: 12px; padding: 18px 20px; border-bottom: 1px solid #ead5a7; background: #fff2cf; }
  .reference-alert-heading-icon { display: grid; flex: 0 0 34px; width: 34px; height: 34px; place-items: center; border-radius: 50%; background: #f5b82e; color: #4f3307; font-size: 21px; font-weight: 800; line-height: 1; }
  .reference-alert-heading strong { display: block; color: #69430a; font-size: 17px; line-height: 1.45; }
  .reference-alert-heading small { display: block; margin-top: 2px; color: #86642e; font-size: 12px; line-height: 1.5; }
  .reference-alert-list { display: grid; gap: 10px; padding: 14px; }
  .reference-alert-row { display: grid; width: 100%; grid-template-columns: minmax(180px, .85fr) minmax(240px, 1.15fr); align-items: center; gap: 18px; margin: 0; padding: 14px 16px; border: 1px solid #ead9b8; border-radius: 14px; background: #fff; color: #263d35; text-align: left; cursor: pointer; box-shadow: 0 3px 0 #f4e8cc; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
  .reference-alert-row:first-of-type { margin-top: 0; }
  .reference-alert-row:hover { border-color: #c99129; box-shadow: 0 4px 0 #ead39d; transform: translateY(-1px); }
  .reference-alert-row:focus-visible { outline: 3px solid #8e5b10; outline-offset: 2px; }
  .reference-alert-person { display: flex; min-width: 0; align-items: center; gap: 12px; }
  .reference-alert-avatar { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 13px; background: #ffdf72; color: #5a3a09; font-size: 17px; font-weight: 800; }
  .reference-alert-person strong { min-width: 0; overflow-wrap: anywhere; color: #213b32; font-size: 16px; line-height: 1.5; }
  .reference-alert-detail { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 14px; }
  .reference-alert-detail small { display: block; margin-bottom: 2px; color: #8a7250; font-size: 10px; font-weight: 700; letter-spacing: .08em; }
  .reference-alert-detail b { display: block; overflow-wrap: anywhere; color: #765019; font-size: 13px; line-height: 1.55; }
  .reference-alert-arrow { flex: 0 0 auto; color: #9b6c20; font-size: 28px; line-height: 1; }
}

@media screen and (max-width: 640px) {
  .reference-alert-heading { align-items: flex-start; padding: 16px; }
  .reference-alert-list { padding: 10px; }
  .reference-alert-row { grid-template-columns: minmax(0, 1fr); gap: 10px; padding: 13px; }
  .reference-alert-detail { padding-left: 54px; }
}

/* Present service type and facility as one concise affiliation line. */
@media screen {
  .sidebar .brand {
    display: block;
    padding: 0 12px;
  }

  .sidebar .brand > div {
    display: block;
  }

  .sidebar .brand-mark {
    display: none;
  }

  .sidebar .brand strong {
    line-height: 1.25;
  }

  .sidebar .brand-context {
    display: flex;
    min-width: 0;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 8px;
    margin: 6px 0 0;
    color: #d3e2d9;
    font-size: 10px;
    letter-spacing: .04em;
    line-height: 1.55;
  }

  .sidebar .brand-context > span,
  .sidebar .brand-context > b {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  .sidebar .brand-context > b {
    color: #f4f7f5;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .03em;
  }

  html[data-ui-theme="pop"] .sidebar .brand-context {
    color: #6b7e73;
  }

  html[data-ui-theme="pop"] .sidebar .brand-context > b {
    color: #26332f;
  }
}

/* Home: a quiet operational dashboard with clear reading order. */
@media screen {
  #view-service-home .service-content { max-width: 1240px; margin: 0 auto; }
  .home-dashboard { display: grid; gap: 22px; }
  .home-overview { display: grid; grid-template-columns: minmax(250px, .75fr) minmax(560px, 1.25fr); align-items: stretch; gap: 18px; }
  .home-overview-copy { position: relative; min-height: 162px; padding: 25px 28px; overflow: hidden; border: 1px solid #d8e2dc; border-radius: 20px; background: #235f51; color: #fff; }
  .home-overview-copy::after { content: ''; position: absolute; right: -38px; bottom: -62px; width: 176px; height: 176px; border: 34px solid rgb(255 255 255 / 8%); border-radius: 50%; }
  .home-overview-copy .reference-date { position: relative; z-index: 1; margin: 0 0 17px; color: #dcece6; font-size: 13px; font-weight: 600; letter-spacing: .08em; }
  .home-overview-copy h2 { position: relative; z-index: 1; margin: 0; color: #fff; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 29px; font-weight: 600; letter-spacing: .06em; }
  .home-overview-copy > p:last-child { position: relative; z-index: 1; margin: 9px 0 0; color: #dcece6; font-size: 13px; }
  .home-metrics { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin: 0; }
  .home-metrics > div { display: flex; min-width: 0; flex-direction: column; justify-content: space-between; padding: 21px 18px 18px; border: 1px solid #d8e2dc; border-radius: 18px; background: #fffdf8; box-shadow: 0 7px 18px rgb(29 73 62 / 5%); }
  .home-metrics dt { color: #6d7d79; font-size: 12px; font-weight: 600; letter-spacing: .05em; }
  .home-metrics dd { margin: 20px 0 0; color: #1b4038; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 38px; font-weight: 600; line-height: 1; }
  .home-metrics dd small { margin-left: 4px; color: #6d7d79; font-family: inherit; font-size: 13px; }
  .home-panel { overflow: hidden; border: 1px solid #d8e2dc; border-radius: 20px; background: #fffdf8; box-shadow: 0 8px 22px rgb(29 73 62 / 5%); }
  .home-panel > header { display: flex; align-items: center; justify-content: space-between; gap: 18px; min-height: 82px; padding: 17px 22px; border-bottom: 1px solid #e3e9e5; }
  .home-panel > header h2 { margin: 3px 0 0; color: #234b43; font-size: 19px; font-weight: 700; }
  .home-panel > header p { margin: 5px 0 0; color: #71817c; font-size: 11px; line-height: 1.5; }
  .home-panel > header > strong { display: inline-flex; min-width: 50px; min-height: 34px; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 999px; background: #e6f0eb; color: #315f53; font-size: 13px; }
  .home-panel-actions { display: flex; align-items: center; gap: 10px; }
  .home-panel-actions > strong { display: inline-flex; min-width: 50px; min-height: 34px; align-items: center; justify-content: center; padding: 5px 10px; border-radius: 999px; background: #e6f0eb; color: #315f53; font-size: 13px; }
  .home-panel-actions .button { min-height: 38px; padding: 7px 14px; border-radius: 9px; font-size: 11px; }
  html[data-ui-theme] #view-service-home .home-panel-actions .button-primary, html[data-ui-theme] #view-service-home .home-schedule-empty .button-primary { border-color: #275f52; background: #275f52; box-shadow: none; color: #fff; }
  html[data-ui-theme] #view-service-home .home-panel-actions .button-primary:hover:not(:disabled), html[data-ui-theme] #view-service-home .home-schedule-empty .button-primary:hover:not(:disabled) { border-color: #1f5045; background: #1f5045; box-shadow: none; color: #fff; }
  .home-panel-kicker { color: #7c908a; font-size: 9px; font-weight: 800; letter-spacing: .16em; }
  .session-context > .home-alert-popover { position: relative; z-index: 45; flex: 0 0 auto; }
  .home-alert-popover > summary { display: flex; width: fit-content; min-height: 42px; align-items: center; gap: 8px; margin-left: auto; padding: 5px 10px 5px 6px; border: 1px solid #dfb553; border-radius: 999px; background: #fffaf0; color: #684609; box-shadow: 0 5px 18px rgb(64 52 25 / 12%); cursor: pointer; list-style: none; transition: border-color .16s ease, box-shadow .16s ease, transform .16s ease; }
  .home-alert-popover > summary::-webkit-details-marker { display: none; }
  .home-alert-popover > summary:hover { border-color: #c68f1f; box-shadow: 0 10px 30px rgb(64 52 25 / 20%); transform: translateY(-1px); }
  .home-alert-popover > summary:focus-visible { outline: 3px solid #8f691f; outline-offset: 3px; }
  .home-alert-popover > summary > span { display: grid; width: 30px; height: 30px; place-items: center; border-radius: 50%; background: #f6c64e; color: #5f3f08; font-size: 16px; font-weight: 900; }
  .home-alert-popover > summary > b { font-size: 12px; }
  .home-alert-popover > summary > strong { padding: 3px 7px; border-radius: 999px; background: #f9e6af; font-size: 11px; }
  .home-alert-popover > summary > small { color: #8a6a2d; font-size: 10px; font-weight: 700; }
  .home-alert-popover[open] > summary { border-color: #d3a33d; background: #fff4d8; }
  .home-alert-popover-panel { position: absolute; top: calc(100% + 10px); right: 0; width: min(390px, calc(100vw - 32px)); max-height: min(520px, calc(100vh - 110px)); overflow: hidden; border: 1px solid #e3bb60; border-radius: 18px; background: #fffdf8; box-shadow: 0 18px 50px rgb(36 49 44 / 22%); }
  .home-alert-popover-panel > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 17px 18px 14px; border-bottom: 1px solid #f0dfb8; background: #fff9ea; }
  .home-alert-popover-panel > header h2 { margin: 4px 0 0; color: #4f4a35; font-size: 17px; }
  .home-alert-popover-panel > header p { margin: 5px 0 0; color: #7e7357; font-size: 10px; line-height: 1.55; }
  .home-alert-popover-panel > header > strong { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #f7c955; color: #684609; font-size: 11px; }
  .home-alert-popover-panel .home-alert-list { max-height: min(360px, calc(100vh - 230px)); padding: 10px; }
  .home-alert-popover-panel .home-alert-item { min-height: 62px; grid-template-columns: 38px minmax(0, 1fr) auto; padding: 10px 11px; }
  .home-alert-popover-panel .home-alert-avatar { width: 38px; height: 38px; border-radius: 11px; font-size: 13px; }
  .home-visit-list, .home-alert-list { display: grid; max-height: 560px; align-content: start; gap: 10px; padding: 14px; overflow-y: auto; scrollbar-color: #b9cdc5 transparent; scrollbar-width: thin; }
  .home-schedule-primary .home-visit-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-schedule-primary .home-empty { grid-column: 1 / -1; }
  .home-visit-item, .home-alert-item { display: grid; width: 100%; min-height: 72px; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid #e0e6e2; border-radius: 13px; background: #fff; color: #213d37; text-align: left; cursor: pointer; transition: border-color .16s ease, background .16s ease, transform .16s ease; }
  .home-visit-item { grid-template-columns: 42px minmax(0, 1fr) auto auto; }
  .home-alert-item { grid-template-columns: 42px minmax(0, 1fr) auto; }
  .home-visit-item:hover, .home-alert-item:hover { border-color: #8cb3a5; background: #f6faf7; transform: translateY(-1px); }
  .home-visit-item strong, .home-alert-item strong { display: block; font-size: 14px; }
  .home-visit-item small, .home-alert-item small { display: block; margin-top: 4px; color: #70827e; font-size: 11px; line-height: 1.5; }
  .home-visit-item > b, .home-alert-item > b { color: #83958f; font-size: 23px; font-weight: 400; }
  .home-visit-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 50%; background: #dfeee7; color: #285b4e; font-size: 15px; font-weight: 800; }
  .home-visit-item[data-status='arrived'] .home-visit-avatar { background: #2e705f; color: #fff; }
  .home-visit-person { min-width: 0; }
  .home-visit-person strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .home-alert-avatar { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 12px; background: #ffdc76; color: #62420b; font-size: 15px; font-weight: 800; }
  .home-absence-list { display: flex; align-items: center; gap: 14px; padding: 12px 16px; border-top: 1px solid #e3e9e5; background: #f7f8f6; }
  .home-absence-list > strong { flex: 0 0 auto; color: #687873; font-size: 11px; }
  .home-absence-list > div { display: flex; min-width: 0; flex-wrap: wrap; gap: 7px; }
  .home-absence-list button { padding: 6px 10px; border: 1px solid #d8dfdb; border-radius: 999px; background: #fff; color: #53645f; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; }
  .home-absence-list button:hover { border-color: #9aaba5; background: #f2f5f3; }
  .home-empty { display: grid; min-height: 164px; place-items: center; align-content: center; padding: 24px; color: #647772; text-align: center; }
  .home-empty > span { display: grid; width: 36px; height: 36px; margin-bottom: 11px; place-items: center; border-radius: 50%; background: #e3efe9; color: #356c5d; font-weight: 800; }
  .home-empty strong { color: #36534c; font-size: 14px; }
  .home-empty p { margin: 6px 0 0; color: #7b8a86; font-size: 11px; line-height: 1.6; }
  .home-schedule-empty .button { margin-top: 16px; min-height: 40px; padding: 8px 16px; border-radius: 9px; font-size: 11px; }
  .home-empty-compact { min-height: 120px; }
}

@media screen and (max-width: 1120px) {
  .home-overview { grid-template-columns: 1fr; }
  .home-overview-copy { min-height: 138px; }
  .home-schedule-primary .home-visit-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media screen and (max-width: 640px) {
  .home-dashboard { gap: 14px; }
  .home-overview-copy { min-height: 0; padding: 21px; }
  .home-overview-copy h2 { font-size: 25px; }
  .home-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .home-metrics > div { min-height: 112px; padding: 16px; }
  .home-metrics dd { margin-top: 14px; font-size: 32px; }
  .home-schedule-primary .home-visit-list { grid-template-columns: 1fr; }
  .home-panel > header { align-items: flex-start; }
  .home-panel-actions { align-items: flex-end; flex-direction: column; }
  .home-visit-list, .home-alert-list { max-height: 460px; }
  .home-absence-list { align-items: flex-start; flex-direction: column; gap: 8px; }
  .home-alert-popover-panel { position: fixed; top: 70px; right: 12px; left: 12px; width: auto; max-height: min(500px, calc(100vh - 82px)); }
  .home-alert-popover-panel .home-alert-list { max-height: min(340px, calc(100vh - 214px)); }
}

@media screen and (max-width: 860px) {
  .session-context > .home-alert-popover > summary { min-height: 40px; gap: 5px; padding: 5px 7px 5px 5px; }
  .session-context > .home-alert-popover > summary > span { width: 28px; height: 28px; }
  .session-context > .home-alert-popover > summary > b,
  .session-context > .home-alert-popover > summary > small { display: none; }
}

@media screen and (max-width: 430px) {
  .home-metrics { grid-template-columns: 1fr; }
  .home-metrics > div { min-height: 92px; }
  .home-visit-item { grid-template-columns: 38px minmax(0, 1fr) auto; }
  .home-visit-avatar { width: 38px; height: 38px; }
  .home-visit-item > b { display: none; }
}

/* Recurring settings stay available inside the collapsed monthly tools area. */
@media screen {
  .calendar-settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin: 16px 0; }
  .calendar-settings-grid > div { display: flex; min-height: 68px; align-items: center; justify-content: space-between; gap: 18px; padding: 12px 14px 12px 17px; border: 1px solid #d5e1da; border-radius: 13px; background: #f8fbf9; }
  .calendar-settings-grid strong, .calendar-settings-grid small { display: block; }
  .calendar-settings-grid strong { color: #284d44; font-size: 13px; }
  .calendar-settings-grid small { margin-top: 4px; color: #73847f; font-size: 10px; }
  .calendar-settings-grid .button { min-width: 116px; min-height: 38px; padding: 7px 12px; border-radius: 9px; box-shadow: none; font-size: 11px; }
  html[data-ui-theme] #view-service-calendar .calendar-settings-grid .button-primary { border-color: #275f52; background: #275f52; box-shadow: none; color: #fff; }
  html[data-ui-theme] #view-service-calendar .calendar-settings-grid .button-primary:hover:not(:disabled) { border-color: #1f5045; background: #1f5045; box-shadow: none; color: #fff; }
  .calendar-section-heading span { color: #6d837d; font-size: 9px; font-weight: 800; letter-spacing: .14em; }
  .calendar-section-heading h2 { margin: 5px 0 0; color: #214b41; font-size: 20px; font-weight: 700; }
  .calendar-section-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin: 0 0 13px; }
  .calendar-section-heading p { margin: 0; color: #72817d; font-size: 11px; }
  .calendar-reading-guide { display: grid; grid-template-columns: max-content minmax(0, 1fr); align-items: center; gap: 14px 24px; margin: 0 0 13px; padding: 14px 16px; border: 1px solid #d8e3dd; border-radius: 13px; background: #f5f8f6; }
  .calendar-reading-guide > strong { color: #315f54; font-size: 12px; }
  .calendar-reading-guide > div { display: flex; flex-wrap: wrap; gap: 8px 16px; }
  .calendar-reading-guide > div > span { display: inline-flex; align-items: center; gap: 6px; color: #687a74; font-size: 10px; }
  .calendar-reading-guide .calendar-badge { font-size: 10px; }
  .calendar-action-hint { margin: 10px 0 24px; color: #657771; font-size: 11px; text-align: right; }
}

@media screen and (max-width: 980px) {
  .calendar-settings-grid { grid-template-columns: 1fr; }
}

@media screen and (max-width: 640px) {
  .calendar-settings-grid > div { align-items: flex-start; flex-direction: column; gap: 10px; }
  .calendar-settings-grid .button { width: 100%; }
  .calendar-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
  .calendar-reading-guide { grid-template-columns: 1fr; gap: 10px; padding: 13px; }
  .calendar-reading-guide > div { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
  .calendar-reading-guide > div > span { align-items: flex-start; flex-direction: column; gap: 4px; line-height: 1.45; }
  .calendar-action-hint { text-align: left; }
}

/* Recipient certificate: compact selection, clear mode switch, and readable cards. */
@media screen {
  #view-service-records .service-content { max-width: 1180px; margin: 0 auto; }
  #view-service-records .reference-filter { max-width: 1180px; margin: 0 auto 16px; padding: 15px 18px; border: 1px solid #d9e4de; border-radius: 14px; background: #f7faf8; }
  #view-service-records .reference-filter .field { width: min(100%, 360px); max-width: 360px; }
  #view-service-records .reference-filter .field > span { margin-bottom: 6px; color: #58716a; font-size: 11px; font-weight: 700; letter-spacing: .05em; }
  #view-service-records .reference-filter select { min-height: 44px; background: #fff; font-size: 14px; }
  .records-mode-nav { display: inline-grid; grid-auto-flow: column; gap: 4px; margin: 0 0 18px; padding: 4px; border: 1px solid #d8e3dd; border-radius: 12px; background: #edf3ef; }
  .records-mode-nav .button { min-width: 142px; min-height: 40px; padding: 8px 18px; border: 0; border-radius: 9px; background: transparent; box-shadow: none; color: #526b64; font-size: 13px; font-weight: 700; }
  .records-mode-nav .button:hover { background: #fff; color: #27594d; }
  .records-mode-nav .button[aria-current='page'] { background: #275f52; box-shadow: 0 3px 8px rgb(31 83 70 / 18%); color: #fff; }
  .certificate-workspace { overflow: hidden; border: 1px solid #d7e2dc; border-radius: 20px; background: #fffdf8; box-shadow: 0 10px 26px rgb(28 70 59 / 6%); }
  .certificate-hero { display: flex; min-height: 142px; align-items: center; justify-content: space-between; gap: 24px; padding: 27px 30px; border-bottom: 1px solid #dfe7e2; background: linear-gradient(115deg, #f0f6f2 0%, #fffdf8 67%); }
  .certificate-kicker { color: #6b817b; font-size: 9px; font-weight: 800; letter-spacing: .17em; }
  .certificate-hero h2 { margin: 7px 0 0; color: #204a40; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 25px; font-weight: 600; letter-spacing: .04em; }
  .certificate-hero p { margin: 9px 0 0; color: #647a74; font-size: 12px; line-height: 1.7; }
  .certificate-hero .button-primary { flex: 0 0 auto; min-height: 44px; padding-inline: 20px; border-color: #275f52; background: #275f52; }
  .certificate-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; padding: 20px; }
  .certificate-card { overflow: hidden; border: 1px solid #dbe4df; border-radius: 15px; background: #fff; }
  .certificate-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; padding: 18px 20px 15px; border-bottom: 1px solid #e5ebe7; }
  .certificate-card > header span:first-child { display: block; color: #72847f; font-size: 10px; font-weight: 700; letter-spacing: .06em; }
  .certificate-card > header strong { display: block; margin-top: 5px; color: #183f36; font-size: 18px; letter-spacing: .04em; }
  .certificate-status { flex: 0 0 auto; padding: 5px 9px; border-radius: 999px; background: #e5f1eb; color: #35695b; font-size: 10px; font-weight: 700; }
  .certificate-card dl { display: grid; grid-template-columns: 1.45fr .7fr .9fr; margin: 0; padding: 18px 20px; }
  .certificate-card dl > div { min-width: 0; padding: 0 16px; border-left: 1px solid #e4eae6; }
  .certificate-card dl > div:first-child { padding-left: 0; border-left: 0; }
  .certificate-card dl > div:last-child { padding-right: 0; }
  .certificate-card dt { color: #758680; font-size: 10px; font-weight: 700; }
  .certificate-card dd { margin: 7px 0 0; color: #294c43; font-size: 13px; font-weight: 700; line-height: 1.55; }
  .certificate-card dd small { margin: 0 5px; color: #778984; font-size: 9px; font-weight: 600; }
  .certificate-card > footer { display: flex; justify-content: flex-end; padding: 0 20px 18px; }
  .certificate-card > footer .button { min-height: 37px; padding: 7px 14px; border-color: #a9beb5; border-radius: 9px; background: #fff; color: #315e52; font-size: 11px; }
  .certificate-empty { display: grid; min-height: 196px; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 28px 30px; border: 1px dashed #cddbd4; border-radius: 14px; background: #fafcf9; }
  .certificate-empty-mark { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; background: #e5f0ea; color: #35695b; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 17px; font-weight: 700; }
  .certificate-empty strong { color: #294d44; font-size: 15px; }
  .certificate-empty p { margin: 7px 0 0; color: #71827d; font-size: 11px; line-height: 1.65; }
  .certificate-empty .button-primary { min-height: 42px; padding-inline: 18px; border-color: #275f52; background: #275f52; }
  html[data-ui-theme] #view-service-records .certificate-workspace .button-primary { border-color: #275f52; background: #275f52; box-shadow: none; color: #fff; }
  html[data-ui-theme] #view-service-records .certificate-workspace .button-primary:hover:not(:disabled) { border-color: #1f5045; background: #1f5045; box-shadow: none; color: #fff; }
}

@media screen and (max-width: 960px) {
  .certificate-list { grid-template-columns: 1fr; }
}

@media screen and (max-width: 640px) {
  .records-mode-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .records-mode-nav .button { min-width: 0; }
  .certificate-hero { align-items: flex-start; flex-direction: column; padding: 22px; }
  .certificate-list { padding: 14px; }
  .certificate-card dl { grid-template-columns: 1fr; gap: 13px; }
  .certificate-card dl > div { padding: 13px 0 0; border-top: 1px solid #e4eae6; border-left: 0; }
  .certificate-card dl > div:first-child { padding-top: 0; border-top: 0; }
  .certificate-empty { min-height: 0; grid-template-columns: 44px minmax(0, 1fr); padding: 22px; }
  .certificate-empty-mark { width: 44px; height: 44px; }
  .certificate-empty .button { grid-column: 1 / -1; width: 100%; }
}

/* Daily roster: the calendar opens into a bulk-first attendance workflow. */
@media screen {
  .service-modal.day-roster-modal { width: min(1040px, calc(100vw - 32px)); padding: 18px 22px 24px; }
  .day-roster { padding: 6px 8px 8px !important; }
  .day-roster-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px; padding: 4px 4px 22px; border-bottom: 1px solid #dce5df; }
  .day-roster-heading > div > span { color: #668079; font-size: 11px; font-weight: 700; letter-spacing: .08em; }
  .day-roster-heading h2 { margin: 7px 0 0 !important; color: #204a40; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 25px !important; font-weight: 600; letter-spacing: .04em; }
  .day-roster-heading p { margin: 8px 0 0; color: #6d7f7a; font-size: 12px; }
  .day-roster-heading dl { display: grid; grid-template-columns: repeat(3, minmax(72px, 1fr)); gap: 8px; margin: 0; }
  .day-roster-heading dl > div { min-width: 76px; padding: 10px 13px; border: 1px solid #dce5df; border-radius: 12px; background: #f7faf8; }
  .day-roster-heading dt { color: #71847e; font-size: 10px; font-weight: 700; }
  .day-roster-heading dd { margin: 5px 0 0; color: #254b42; font-size: 20px; font-weight: 700; line-height: 1; }
  .day-roster-heading dd small { margin-left: 3px; color: #71847e; font-size: 9px; }
  .day-roster-toolbar { position: sticky; z-index: 2; top: -18px; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 -8px; padding: 14px 12px; border-bottom: 1px solid #dce5df; background: rgb(255 253 248 / 96%); backdrop-filter: blur(10px); }
  .day-roster-toolbar > div { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
  .day-roster-toolbar .button { min-height: 38px; padding: 7px 13px; border-radius: 9px; box-shadow: none !important; font-size: 12px; }
  .day-roster-selection { min-width: 64px; color: #315b50; font-size: 12px; text-align: center; }
  html[data-ui-theme] .day-roster-toolbar [data-status='scheduled'] { border-color: #6f939c; background: #eff5f6; color: #355d66; }
  html[data-ui-theme] .day-roster-toolbar [data-status='arrived'] { border-color: #78a892; background: #edf7f1; color: #286044; }
  html[data-ui-theme] .day-roster-toolbar [data-status='absent'] { border-color: #bd9b92; background: #fbf1ee; color: #78493e; }
  html[data-ui-theme] .day-roster-toolbar [data-status]:hover:not(:disabled) { filter: brightness(.97); transform: translateY(-1px); }
  .day-roster-toolbar [data-status]:disabled { cursor: not-allowed; opacity: .42; }
  .day-roster-list { display: grid; max-height: min(52vh, 560px); gap: 8px; padding: 13px 0 2px; overflow-y: auto; scrollbar-color: #b8cac2 transparent; scrollbar-width: thin; }
  .day-roster-row { display: grid; grid-template-columns: minmax(0, 1fr) 82px 66px; align-items: center; gap: 12px; min-height: 68px; padding: 9px 12px; border: 1px solid #dce5e0; border-radius: 12px; background: #fff; transition: border-color .15s ease, background .15s ease; }
  .day-roster-row:has(input:checked) { border-color: #7ea99b; background: #f4faf7; box-shadow: inset 3px 0 #3c7868; }
  .day-roster-row > label { display: grid; min-width: 0; grid-template-columns: 20px 40px minmax(0, 1fr); align-items: center; gap: 12px; cursor: pointer; }
  .day-roster-row input { margin: 0; }
  .day-roster-avatar { display: grid; width: 40px; height: 40px; place-items: center; border-radius: 11px; background: #e4f0ea; color: #35695b; font-size: 13px; font-weight: 800; }
  .day-roster-person { min-width: 0; }
  .day-roster-person strong { display: block; overflow: hidden; color: #24483f; font-size: 14px; text-overflow: ellipsis; white-space: nowrap; }
  .day-roster-person small { display: block; overflow: hidden; margin-top: 4px; color: #788782; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
  .day-roster-status { justify-self: stretch; padding: 5px 8px; border-radius: 999px; background: #f0f2f1; color: #687570; font-size: 10px; font-weight: 700; text-align: center; }
  .day-roster-status[data-kind='scheduled'] { background: #e7eff1; color: #426873; }
  .day-roster-status[data-kind='arrived'] { background: #dff0e7; color: #276044; }
  .day-roster-status[data-kind='absent'] { background: #f5e7e3; color: #7b473a; }
  .day-roster-row > .button { min-height: 34px; padding: 6px 10px; border-radius: 8px; background: #fff; box-shadow: none; color: #45675f; font-size: 10px; }
  .day-roster-detail-placeholder { width: 66px; }
}

@media screen and (max-width: 760px) {
  .service-modal.day-roster-modal { padding: 12px; }
  .day-roster-heading { grid-template-columns: 1fr; gap: 16px; padding-bottom: 18px; }
  .day-roster-heading dl { width: 100%; }
  .day-roster-toolbar { position: static; align-items: stretch; flex-direction: column; margin-inline: -4px; }
  .day-roster-toolbar > div:last-child { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .day-roster-toolbar > div:last-child .button { padding-inline: 6px; }
  .day-roster-list { max-height: none; }
  .day-roster-row { grid-template-columns: minmax(0, 1fr) 68px; }
  .day-roster-row > .button, .day-roster-detail-placeholder { grid-column: 2; width: 100%; }
}

/* Visit editor: a calm, focused sheet with clearly separated actions. */
@media screen {
  .service-modal.visit-modal { position: relative; width: min(760px, calc(100vw - 32px)); padding: 0; overflow-x: hidden; overflow-y: auto; border-color: #cfdcd6; border-radius: 22px; background: #fffdf8; box-shadow: 0 24px 72px rgb(24 48 41 / 28%); scrollbar-color: #aec4bb transparent; scrollbar-width: thin; }
  .visit-modal .service-modal-close { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; width: 40px; height: 40px; margin: 0; padding: 0; place-items: center; border: 1px solid #c4d4cd; border-radius: 50%; background: rgb(255 255 255 / 82%); color: transparent; font-size: 0; box-shadow: 0 4px 14px rgb(32 69 58 / 8%); backdrop-filter: blur(8px); transition: border-color .16s ease, background .16s ease, transform .16s ease; }
  .visit-modal .service-modal-close::after { content: '×'; color: #315c51; font-size: 23px; font-weight: 400; line-height: 1; }
  .visit-modal .service-modal-close:hover { border-color: #71998d; background: #f2f8f5; transform: rotate(4deg); }
  .visit-modal .service-status { margin: 18px 28px 0; }
  .visit-modal .visit-editor-card { padding: 0 !important; }
  .visit-editor-heading { padding: 27px 78px 23px 30px; border-bottom: 1px solid #dbe5df; background: linear-gradient(130deg, #f4f8f4 0%, #fffdf8 68%); }
  .visit-editor-heading > span { color: #668078; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
  .service-workspace .visit-editor-heading h2 { margin: 6px 0 0; color: #234b41; font-family: 'Yu Mincho', 'Hiragino Mincho ProN', serif; font-size: 24px; font-weight: 600; letter-spacing: .04em; }
  .visit-editor-heading p { margin: 8px 0 0; color: #71817c; font-size: 11px; line-height: 1.6; }
  .visit-editor-card > fieldset { padding: 24px 30px 0; }
  .visit-editor-grid { gap: 18px 16px; }
  .visit-editor-grid .field > span, .visit-editor-card > fieldset > .field > span { display: block; margin-bottom: 7px; color: #39574f; font-size: 11px; font-weight: 700; }
  .visit-editor-grid input, .visit-editor-grid select, .visit-editor-card textarea { border-color: #b9ccc4; border-radius: 10px; background: #fff; }
  .visit-editor-card textarea { min-height: 108px; line-height: 1.7; }
  .visit-transport-options { gap: 9px; margin: 20px 0; }
  .visit-transport-options label { min-height: 42px; padding: 8px 12px; border: 1px solid #d5e0db; border-radius: 10px; background: #f8faf8; color: #3e5c54; font-size: 12px; cursor: pointer; }
  .visit-transport-options label:has(input:checked) { border-color: #80a99c; background: #edf6f1; color: #285d4d; box-shadow: inset 3px 0 #43806e; }
  .visit-transport-options input { margin: 0; }
  .visit-editor-footer { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-top: 26px; padding: 20px 30px 26px; border-top: 1px solid #dbe5df; background: #fafbf8; }
  .visit-editor-footer .button { min-height: 44px; padding: 9px 17px; border-radius: 10px; box-shadow: none; font-size: 12px; }
  .visit-editor-footer .button-primary { min-width: 178px; border-color: #275f52; background: #275f52; }
  .visit-editor-footer .button-secondary { border-color: transparent; background: transparent; color: #55736b; }
  .visit-editor-footer .button-secondary:hover { border-color: #c5d5cf; background: #f1f6f3; }
}

@media screen and (max-width: 640px) {
  .service-modal.visit-modal { width: calc(100vw - 20px); max-height: 94dvh; border-radius: 18px; }
  .visit-modal .service-modal-close { top: 10px; right: 10px; width: 38px; height: 38px; }
  .visit-editor-heading { padding: 22px 64px 19px 20px; }
  .service-workspace .visit-editor-heading h2 { font-size: 21px; }
  .visit-editor-card > fieldset { padding: 20px 20px 0; }
  .visit-transport-options { display: grid; grid-template-columns: 1fr; }
  .visit-editor-footer { align-items: stretch; flex-direction: column; gap: 10px; margin-top: 22px; padding: 16px 20px 20px; }
  .visit-editor-footer .button { width: 100%; }
  .visit-editor-footer .button-primary { order: -1; }
}

/* Child editor: five clearly named information groups with quick navigation. */
@media screen {
  .child-editor-form .dialog-heading { padding-bottom: 4px; }
  .child-editor-form .dialog-heading h2 { margin-bottom: 5px; }
  .child-editor-form .dialog-heading > p:last-child { margin-top: 6px; color: #6c7f79; }
  .child-editor-guide { position: sticky; z-index: 6; top: -28px; display: grid; gap: 9px; margin: 17px 0 20px; padding: 13px 14px; border: 1px solid #d5e1db; border-radius: 14px; background: rgb(250 252 249 / 96%); box-shadow: 0 7px 20px rgb(31 68 57 / 7%); backdrop-filter: blur(10px); }
  .child-editor-guide > strong { color: #4d6961; font-size: 10px; letter-spacing: .12em; }
  .child-editor-guide-links { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 7px; }
  .child-editor-guide button { display: flex; min-width: 0; min-height: 38px; align-items: center; gap: 7px; padding: 7px 9px; border: 1px solid #d7e1dc; border-radius: 9px; background: #fff; color: #35584e; font: inherit; font-size: 11px; font-weight: 700; cursor: pointer; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
  .child-editor-guide button span { display: grid; width: 23px; height: 23px; flex: 0 0 23px; place-items: center; border-radius: 7px; background: #e7f0eb; color: #487064; font-size: 9px; }
  .child-editor-guide button:hover { border-color: #8fb0a5; background: #f2f8f4; transform: translateY(-1px); }
  .child-editor-section { scroll-margin-top: 88px; }
  .child-editor-form .editor-group, .child-editor-form .profile-field-visibility, .child-editor-form .custom-fields-editor { margin: 0 0 15px; overflow: hidden; border: 1px solid #d3dfd9; border-radius: 15px; background: #fff; box-shadow: 0 5px 18px rgb(31 68 57 / 4%); }
  .child-editor-form fieldset.editor-group { padding: 0; }
  .child-editor-form fieldset.editor-group > legend { float: left; display: grid; width: 100%; grid-template-columns: 34px minmax(0, 1fr); grid-template-rows: auto auto; align-items: center; gap: 2px 10px; margin: 0; padding: 16px 18px; border-bottom: 1px solid #e0e8e4; background: #f8faf7; }
  .child-editor-form fieldset.editor-group > .editor-group-fields { clear: both; }
  .child-editor-form .editor-group > summary, .child-editor-form .profile-field-visibility > summary { position: relative; display: grid; min-height: 68px; grid-template-columns: 34px minmax(0, 1fr) 24px; grid-template-rows: auto auto; align-items: center; gap: 2px 10px; padding: 14px 17px; list-style: none; border: 0; background: #f8faf7; }
  .child-editor-form .editor-group > summary::-webkit-details-marker, .child-editor-form .profile-field-visibility > summary::-webkit-details-marker { display: none; }
  .child-editor-form .editor-group > summary::after, .child-editor-form .profile-field-visibility > summary::after { content: '＋'; grid-column: 3; grid-row: 1 / 3; color: #59766d; font-size: 19px; font-weight: 400; text-align: center; }
  .child-editor-form .editor-group[open] > summary::after, .child-editor-form .profile-field-visibility[open] > summary::after { content: '−'; }
  .child-editor-form .editor-group[open] > summary, .child-editor-form .profile-field-visibility[open] > summary { border-bottom: 1px solid #e0e8e4; }
  .child-editor-form .editor-group-section-index { display: grid; width: 30px; height: 30px; grid-column: 1; grid-row: 1 / 3; place-items: center; border-radius: 9px; background: #e1eee7; color: #376557; font-size: 10px; font-weight: 800; letter-spacing: .04em; }
  .child-editor-form .editor-group-section-title { grid-column: 2; color: #274f44; font-size: 14px; font-weight: 800; }
  .child-editor-form .editor-group-section-description { grid-column: 2; margin: 0; color: #758680; font-size: 10px; font-weight: 500; line-height: 1.45; }
  .child-editor-form .editor-group-fields { padding: 20px 18px; }
  .child-editor-form .profile-field-visibility { padding: 0; }
  .child-editor-form .profile-field-visibility > p { margin: 0; padding: 16px 18px 4px; }
  .child-editor-form .profile-field-checks { margin: 0; padding: 12px 18px 18px; }
  .child-editor-form .profile-field-checks label { min-height: 34px; padding: 6px 8px; border-radius: 8px; background: #f8faf8; }
  .child-editor-form .custom-fields-editor { padding: 0; }
  .child-editor-form .custom-fields-editor-heading { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 10px; padding: 16px 18px; border-bottom: 1px solid #e0e8e4; background: #f8faf7; }
  .child-editor-form .custom-fields-editor-heading > .editor-group-section-index { grid-column: 1; }
  .child-editor-form .custom-fields-editor-heading > div { grid-column: 2; }
  .child-editor-form .custom-fields-editor-heading > .button { grid-column: 3; }
  .child-editor-form .custom-field-rows { padding: 14px 18px 18px; }
  .child-editor-form > .dialog-actions { margin-top: 18px; border-top: 1px solid #d8e2dd; box-shadow: 0 -10px 20px rgb(255 255 255 / 92%); }
  #child-edit-form #open-child-delete-dialog { margin-right: auto; }
}

@media screen and (max-width: 640px) {
  .child-editor-guide { top: -22px; margin-top: 14px; padding: 11px; }
  .child-editor-guide-links { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .child-editor-guide button:last-child { grid-column: 1 / -1; }
  .child-editor-form fieldset.editor-group > legend { padding: 14px; }
  .child-editor-form .editor-group-fields { padding: 15px 14px; }
  .child-editor-form .custom-fields-editor-heading { grid-template-columns: 34px minmax(0, 1fr); padding: 14px; }
  .child-editor-form .custom-fields-editor-heading > .button { width: 100%; grid-column: 1 / -1; }
  .child-editor-form .custom-field-rows { padding: 12px 14px 15px; }
}

/* Journal reader: a calm, scannable record index and reading surface. */
@media screen {
  #journal-list.reference-journal-layout { grid-template-columns: 248px minmax(0, 1fr); gap: 20px; overflow: visible; }
  #journal-list .reference-journal-nav { position: sticky; top: 84px; gap: 0; max-height: calc(100dvh - 110px); overflow: auto; padding: 0 8px 0 0; border-top: 1px solid #d8e1dd; scrollbar-width: thin; scrollbar-color: #b7c9c2 transparent; }
  #journal-list .reference-journal-entry { position: relative; display: grid; gap: 6px; min-height: 0; padding: 13px 10px 13px 15px; overflow: hidden; border: 0; border-bottom: 1px solid #d8e1dd; border-radius: 0; background: transparent; box-shadow: none; font-size: 13px; transition: background .15s ease, color .15s ease; }
  #journal-list .reference-journal-entry::before { position: absolute; inset: 10px auto 10px 0; width: 3px; border-radius: 0 3px 3px 0; background: #b4c8c0; content: ""; }
  #journal-list .reference-journal-entry:hover { background: #f5f9f7; }
  #journal-list .reference-journal-entry[aria-pressed="true"] { background: #edf5f1; box-shadow: none; }
  #journal-list .reference-journal-entry[aria-pressed="true"]::before { background: #39715f; }
  #journal-list .reference-journal-entry-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
  #journal-list .reference-journal-entry-heading time { color: #264d43; font-weight: 800; font-variant-numeric: tabular-nums; }
  #journal-list .reference-journal-entry-status { flex: 0 0 auto; padding: 3px 7px; border-radius: 999px; background: #e6f1eb; color: #386654; font-size: 10px; font-weight: 800; }
  #journal-list .reference-journal-entry--draft .reference-journal-entry-status { background: #fff0ce; color: #815b15; }
  #journal-list .reference-journal-entry small { margin: 0; overflow: hidden; color: #6b7d77; font-size: 11px; line-height: 1.5; text-overflow: ellipsis; white-space: nowrap; }

  #journal-list .journal-record-card { overflow: hidden; padding: 0; border: 1px solid #d9e3de; border-radius: 14px; background: #fff; box-shadow: none; }
  #journal-list .journal-record-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 11px 18px; margin: 0; padding: 19px 22px 16px; border-bottom: 1px solid #e1e8e5; background: #fff; }
  #journal-list .journal-record-date-main { display: grid; gap: 5px; min-width: 0; }
  #journal-list .journal-record-label { color: #71837d; font-family: inherit; font-size: 10px; font-weight: 800; letter-spacing: .12em; }
  #journal-list .journal-record-date-main time { color: #24483e; font-family: var(--font-ui); font-size: 20px; font-weight: 650; font-variant-numeric: tabular-nums; line-height: 1.35; }
  #journal-list .journal-record-status { align-self: start; padding: 6px 11px; border-radius: 999px; background: #e2efe8; color: #33624f; font-family: inherit; font-size: 11px; font-weight: 800; }
  #journal-list .journal-record-card--draft .journal-record-status { background: #ffedc4; color: #805b17; }
  #journal-list .journal-record-activity { display: flex; grid-column: 1 / -1; gap: 10px; align-items: baseline; margin: 0; font-family: inherit; }
  #journal-list .journal-record-activity span { color: #71837d; font-size: 11px; font-weight: 700; }
  #journal-list .journal-record-activity strong { color: #315f52; font-family: inherit; font-size: 14px; }
  #journal-list .record-body { padding: 20px 22px 24px; }
  #journal-list .journal-record-content-title { margin: 0 0 4px; color: #233d36; font-size: 16px; }
  #journal-list .record-update-meta { margin: 0 0 14px; color: #71837d; font-size: 11px; }
  #journal-list .journal-memo { margin: 0 0 12px; border: 0; border-block: 1px solid #e1e8e5; border-radius: 0; background: transparent; }
  #journal-list .journal-memo summary { padding: 11px 2px; color: #49685f; font-size: 13px; font-weight: 600; }
  #journal-list .journal-memo-text { margin: 0; padding: 0 2px 13px; color: #536a63; line-height: 1.75; }
  #journal-list .record-draft-note { margin: 0 0 12px; padding: 9px 11px; border-left: 2px solid #d69a25; border-radius: 4px; background: #fffaf0; color: #765313; font-size: 11px; line-height: 1.55; }
  #journal-list .journal-details { gap: 0; border-top: 1px solid #e1e8e5; }
  #journal-list .journal-field { position: relative; padding: 17px 2px 18px; overflow: hidden; border: 0; border-bottom: 1px solid #e1e8e5; border-radius: 0; background: transparent; }
  #journal-list .journal-field::before { display: none; }
  #journal-list .journal-field dt { margin-bottom: 8px; padding: 0; border: 0; color: #315f52; font-size: 13px; }
  #journal-list .journal-field dd { color: #263a34; font-size: 15px; line-height: 1.9; }
  #journal-list .journal-field.is-empty { background: transparent; }
  #journal-list .journal-field.is-empty dd { color: #7e8b87; }
}

@media screen and (max-width: 860px) {
  #journal-list .reference-journal-nav { position: static; max-height: none; padding: 2px 0 8px; }
  #journal-list .reference-journal-entry { min-width: 220px; }
}

@media screen and (max-width: 600px) {
  #view-contact .support-record-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  #view-contact .support-record-actions .button { width: 100%; min-height: 44px; padding: 8px 10px; line-height: 1.45; }
  #journal-list .journal-record-header { padding: 19px 18px 17px; }
  #journal-list .journal-record-date-main time { font-size: 19px; }
  #journal-list .record-body { padding: 19px 17px 20px; }
  #journal-list .journal-field { padding: 15px 15px 16px 19px; }
  #journal-list .journal-field dd { font-size: 14px; line-height: 1.85; }
}

/* Child profile actions: one neutral family, with a clear active reorder state. */
@media screen {
  .child-heading-actions { align-items: center; gap: 9px; }
  .child-heading-actions .button { box-shadow: none; }
  #reorder-child-profile-button { border-color: #6d9c93; background: rgb(255 255 255 / 88%); color: var(--forest); }
  #reorder-child-profile-button[aria-pressed="true"] { border-color: #356d5d; background: #356d5d; color: #fff; }
  #reorder-child-profile-button[aria-pressed="true"]:hover { border-color: #2c5e50; background: #2c5e50; }
}
/* Keep the actual scope of every workspace visible in one consistent location. */
.workspace-scope { display:flex; align-items:center; flex-wrap:wrap; gap:11px 14px; margin:20px 36px 0; padding:12px 14px; border:1px solid #cbdcd4; border-radius:12px; background:#f3f7f5; color:#244f44; }
.workspace-scope-summary { margin:0; font-size:14px; font-weight:700; }
.workspace-scope[data-scope="individual"] { background:#edf5f1; border-left:4px solid #285f52; }
#workspace-scope .current-child { display:flex; min-height:46px; align-items:center; flex-wrap:wrap; gap:3px 12px; flex:1; margin:0; padding:7px 12px; min-width:0; max-width:none; border:1px solid #b9cec4; border-radius:9px; background:#fff; box-shadow:none; color:#244f44; text-align:left; cursor:pointer; }
#workspace-scope .current-child[hidden], #workspace-scope .scope-back[hidden] { display:none; }
#workspace-scope .current-child::after { display:none; }
#workspace-scope .current-child .eyebrow { color:#647a71; font-size:11px; font-weight:600; letter-spacing:.04em; }
#workspace-scope #current-child-meta { color:#647a71; font-size:11px; font-weight:400; }
#workspace-scope #current-child-name { margin:0; color:#173f34; font-family:var(--font-ui); font-size:18px; font-weight:650; line-height:1.35; letter-spacing:.01em; overflow-wrap:anywhere; }
#workspace-scope .scope-change { margin-left:auto; padding:4px 7px; border-radius:6px; color:#35685a; background:#eef5f1; font-size:11px; font-weight:600; line-height:1.2; }
.scope-back { padding:8px 13px; min-height:42px; border:1px solid #b9cec4; border-radius:9px; background:#fff; color:#315f53; font-family:var(--font-ui); font-size:13px; font-weight:500; cursor:pointer; }
@media(max-width:860px) { .workspace-scope { margin:14px 18px 0; padding:12px; gap:10px; } #workspace-scope .current-child { flex-basis:100%; } .workspace-scope-summary { font-size:13px; } }
/* Task entry points and navigation within a single person's record. */
#workspace-scope[hidden] { display:none; }
.workspace-scope-summary:empty { display:none; }
.person-work-nav { display:flex; flex-wrap:wrap; gap:5px; width:100%; border-top:1px solid #d3e0da; padding-top:10px; }
.person-work-nav button { border:0; border-radius:8px; padding:8px 15px; min-height:40px; background:transparent; color:#3b6157; cursor:pointer; font-family:var(--font-ui); font-size:14px; font-weight:500; line-height:1.4; letter-spacing:.01em; }
.person-work-nav button[aria-current="page"] { background:#285f52; color:#fff; font-weight:650; }
.work-target { max-width:980px; margin:auto; }
.work-target > h1 { margin:0 0 12px; font-size:24px; color:#203d38; }
.work-target > p { color:#536c62; line-height:1.8; }
.work-target > input { display:block; width:100%; max-width:480px; min-height:46px; padding:12px; margin:24px 0; border:1px solid #a9c3b6; border-radius:8px; font:inherit; }
.work-target-list { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px; margin-bottom:24px; }
.work-target-person { display:grid; grid-template-columns:1fr auto; gap:8px 16px; text-align:left; padding:20px; border:1px solid #ccdcd4; border-radius:12px; background:white; color:#244f44; cursor:pointer; font:inherit; }
.work-target-person strong { font-size:18px; overflow-wrap:anywhere; }
.work-target-person small { grid-column:1; color:#63766d; }
.work-target-person > span { grid-column:2; grid-row:1 / 3; align-self:center; font-size:13px; }
.work-target-person:hover { background:#f0f6f2; border-color:#285f52; }
@media(max-width:640px) { .work-target-list { grid-template-columns:1fr; } .work-target > h1 { font-size:21px; } .person-work-nav button { padding:10px; } }
