:root {
  --navy: #143b5a;
  --navy-2: #0e2d45;
  --blue: #176b9c;
  --blue-2: #e9f4fa;
  --ink: #17232d;
  --muted: #63717c;
  --line: #d7e1e7;
  --green: #167855;
  --green-bg: #e5f5ee;
  --amber: #a05a08;
  --amber-bg: #fff0da;
  --red: #b33d3d;
  --red-bg: #fdeaea;
  --gray-bg: #eef2f4;
  --white: #fff;
  --shadow: 0 12px 34px rgba(20, 59, 90, .08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: #f5f8fa; color: var(--ink); font-family: "Yu Gothic UI", "Noto Sans JP", sans-serif; font-size: 15px; line-height: 1.6; }
button, input, select { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .55; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.eyebrow { margin: 0 0 3px; color: var(--blue); font-size: .74rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.wide { width: 100%; }

.brand-mark { display: inline-flex; width: 47px; height: 47px; align-items: center; justify-content: center; border-radius: 13px; background: var(--navy); color: var(--white); font-size: .78rem; font-weight: 800; letter-spacing: .08em; }
.brand-mark.small { width: 34px; height: 34px; border-radius: 9px; font-size: .65rem; }

.login-screen { position: fixed; inset: 0; z-index: 50; display: flex; align-items: center; justify-content: center; padding: 22px; background: radial-gradient(circle at 15% 15%, #2b8ab9 0, transparent 38%), linear-gradient(135deg, #10334e, #176b9c); }
.login-box { width: min(430px, 100%); padding: 30px; border: 1px solid rgba(255,255,255,.4); border-radius: 20px; background: var(--white); box-shadow: 0 28px 80px rgba(0,0,0,.25); }
.login-box h1 { margin: 7px 0 5px; color: var(--navy); font-size: 1.7rem; }
.login-lead { margin: 0 0 20px; color: var(--muted); }
.trial-warning { display: flex; gap: 8px; margin: -7px 0 16px; padding: 10px 11px; border-radius: 9px; background: var(--amber-bg); color: #6f430c; font-size: .82rem; }
.trial-warning strong { flex: 0 0 auto; }
.field { display: block; margin: 13px 0; }
.field span { display: block; margin-bottom: 5px; font-weight: 800; }
.field input { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; outline: none; }
.field input:focus, .select-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(23,107,156,.14); }
.primary, .secondary, .header-button, .text-button, .link-button { border-radius: 9px; padding: 9px 13px; font-weight: 800; }
.primary { border: 1px solid var(--blue); background: var(--blue); color: var(--white); }
.primary:hover { background: #115c87; }
.secondary { border: 1px solid var(--line); background: var(--white); color: var(--navy); }
.secondary:hover { border-color: var(--blue); background: var(--blue-2); }
.error-text { min-height: 1.5em; margin: 8px 0 0; color: var(--red); font-weight: 800; }
.demo-accounts { margin-top: 18px; padding: 13px; border-radius: 12px; background: #f0f6f9; font-size: .88rem; }
.demo-accounts strong { display: block; margin-bottom: 5px; color: var(--navy); }
.demo-accounts small { display: block; margin-top: 8px; color: var(--muted); }
.account-choice { display: flex; width: 100%; align-items: center; justify-content: space-between; margin: 5px 0; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); color: var(--ink); text-align: left; }
.account-choice:hover { border-color: var(--blue); }
.account-choice code { color: var(--blue); }
.trial-guide { margin-top: 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.trial-guide summary { padding: 10px 12px; color: var(--navy); font-weight: 800; cursor: pointer; }
.trial-guide ol { margin: 0; padding: 0 28px 13px 35px; color: var(--muted); font-size: .82rem; }
.trial-guide li + li { margin-top: 4px; }

.app-header { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 10px max(20px, calc((100vw - 1240px) / 2)); background: var(--navy); color: var(--white); box-shadow: 0 3px 15px rgba(0,0,0,.13); }
.header-brand, .header-actions { display: flex; align-items: center; gap: 10px; }
.header-brand small { display: block; opacity: .72; font-size: .74rem; }
.header-brand strong { display: block; }
.account-badge { padding: 5px 9px; border: 1px solid rgba(255,255,255,.25); border-radius: 7px; background: rgba(255,255,255,.08); font-size: .8rem; }
.sync-badge { font-size: .78rem; font-weight: 700; color: #cbd5df; white-space: nowrap; }
.sync-badge[data-tone="ok"] { color: #9de2bd; }
.sync-badge[data-tone="error"] { color: #ffb4b4; }
.header-button { border: 1px solid rgba(255,255,255,.35); background: transparent; color: var(--white); }
.header-button:hover { background: rgba(255,255,255,.12); }
.notification-button { display: inline-flex; align-items: center; gap: 6px; }
.notification-badge { display: inline-flex; min-width: 20px; height: 20px; align-items: center; justify-content: center; padding: 0 5px; border-radius: 999px; background: #ffcf66; color: #513500; font-size: .72rem; }
.notification-list { display: grid; gap: 8px; }
.notification-item { display: grid; grid-template-columns: 1fr auto; gap: 10px; align-items: center; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.notification-item strong, .notification-item small { display: block; }
.notification-item small { margin-top: 2px; color: var(--muted); }
.notification-empty { margin: 0; padding: 20px; color: var(--muted); text-align: center; }
.login-guide { padding: 18px; border: 2px solid var(--navy); }
.login-guide h3 { margin-top: 0; color: var(--navy); }
.login-guide > div { display: flex; justify-content: space-between; gap: 12px; margin: 9px 0; padding: 10px; background: #f5f9fb; }
.login-guide code { font-size: 1rem; font-weight: 800; }
@media print { body * { visibility: hidden; } #loginGuide, #loginGuide * { visibility: visible; } #loginGuide { position: fixed; inset: 20mm; } }

.page { max-width: 1240px; margin: auto; padding: 28px 22px 60px; }
.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.page-heading h2 { margin: 0 0 3px; color: var(--navy); font-size: 1.75rem; }
.heading-controls, .head-actions, .filter-buttons, .sample-assets, .legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.heading-controls label, .parent-child-switch label { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: .85rem; font-weight: 800; }
.select-control { min-width: 155px; padding: 9px 11px; border: 1px solid var(--line); border-radius: 9px; background: var(--white); color: var(--ink); }
.select-control.compact { width: 100%; min-width: 0; margin-top: 8px; padding: 7px 9px; font-size: .86rem; }
.text-button { border: 0; background: transparent; color: var(--muted); font-size: .82rem; }
.text-button:hover { color: var(--blue); text-decoration: underline; }

.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 18px; padding: 12px 15px; border-left: 4px solid var(--blue); border-radius: 7px; background: var(--blue-2); }
.notice strong { flex: 0 0 auto; color: var(--navy); }
.notice.warning { border-left-color: var(--amber); background: var(--amber-bg); }
.notice.caution { border-left-color: #7e59a8; background: #f1eafb; }
.compact-alert { margin: -7px 0 14px; color: var(--muted); font-size: .8rem; }


.section-card { margin-bottom: 18px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--white); box-shadow: var(--shadow); }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.section-head h3 { margin: 0; color: var(--navy); font-size: 1.12rem; }
.section-head p { margin-top: 3px; margin-bottom: 0; font-size: .86rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { padding: 10px 11px; border-bottom: 1px solid #e9eef1; text-align: left; white-space: nowrap; }
th { background: #f8fafb; color: var(--muted); font-size: .76rem; }
td { font-size: .88rem; }
tr:last-child td { border-bottom: 0; }
.person-cell strong { display: block; color: var(--navy); }
.person-cell small { color: var(--muted); font-size: .74rem; }
.row-button { border: 0; background: var(--blue-2); color: var(--blue); font-weight: 800; }
.row-button:hover { background: #d9edf6; }
.pill { display: inline-flex; align-items: center; justify-content: center; min-height: 25px; padding: 3px 8px; border-radius: 999px; font-size: .72rem; font-weight: 800; }
.pill.done { background: var(--green-bg); color: var(--green); }
.pill.wait { background: var(--amber-bg); color: var(--amber); }
.pill.review { background: #f0eafa; color: #74529d; }
.pill.off { background: var(--gray-bg); color: #68757d; }
.pill.late { background: var(--red-bg); color: var(--red); }
.pill.blue { background: var(--blue-2); color: var(--blue); }
.count-badge { display: inline-flex; min-width: 33px; min-height: 27px; align-items: center; justify-content: center; padding: 3px 9px; border-radius: 999px; background: var(--blue-2); color: var(--blue); font-size: .8rem; font-weight: 800; }

.admin-columns { display: grid; grid-template-columns: 1.45fr .8fr; gap: 18px; }
.section-description { margin: 3px 0 0; color: var(--muted); font-size: .88rem; }
.family-account-list { display: grid; gap: 10px; }
.family-account-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 10px; background: #fbfdfe; }
.family-account-main { min-width: 0; }
.family-account-main > div { display: flex; align-items: center; gap: 9px; }
.family-account-main code { display: inline-block; margin-top: 4px; color: var(--blue); font-size: .84rem; }
.family-account-main p { margin: 5px 0 0; color: var(--muted); }
.family-account-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.family-active { display: flex; align-items: center; gap: 8px; padding-top: 25px; }
.family-child-fieldset { margin: 18px 0 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.family-child-fieldset legend { padding: 0 6px; color: var(--navy); font-weight: 700; }
.family-child-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.family-child-option { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 8px; background: #f2f6f8; }
.lifecycle-summary { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 17px 19px; }
.lifecycle-item { padding: 12px; border: 1px solid var(--line); border-radius: 9px; background: #f8fafb; }
.lifecycle-item strong, .lifecycle-item small { display: block; }
.lifecycle-item strong { color: var(--navy); }
.lifecycle-item small { margin-top: 3px; color: var(--muted); }
.upload-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 17px 19px; }
.upload-card { display: flex; min-height: 128px; flex-direction: column; align-items: flex-start; padding: 13px; border: 1px solid var(--line); border-radius: 9px; background: #fbfcfd; }
.upload-card.featured { border-color: #a9d2e4; background: #f2fafd; }
.upload-card h4 { margin: 5px 0 2px; color: var(--navy); }
.upload-card p { flex: 1; margin: 0 0 10px; color: var(--muted); font-size: .8rem; }
.doc-icon { display: inline-flex; width: 36px; height: 30px; align-items: center; justify-content: center; border-radius: 7px; background: var(--navy); color: var(--white); font-size: .68rem; font-weight: 800; }
.muted-icon { background: #91a0a9; }
.upload-state { display: block; min-height: 1.25em; margin-top: 7px; color: var(--green); font-size: .74rem; font-weight: 800; }
.upload-actions { width: 100%; }
.pending-card { background: #fafafa; }
.sample-assets { padding: 0 19px 16px; font-size: .82rem; }
.sample-assets strong { margin-right: 4px; color: var(--navy); }
.link-button { padding: 3px 7px; border: 0; background: var(--blue-2); color: var(--blue); font-size: .78rem; }
.link-button:hover { text-decoration: underline; }
.review-box { margin: 0 19px 17px; padding: 12px; border: 1px solid #e0c994; border-radius: 10px; background: #fffaf0; }
.review-box h4 { margin: 0 0 5px; color: var(--amber); }
.review-box ul { margin: 7px 0 0; padding-left: 20px; font-size: .83rem; }

.send-summary { margin: 17px; padding: 13px; border-radius: 10px; background: #f5f9fb; }
.send-summary-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: .84rem; }
.send-summary-row:last-child { border-bottom: 0; }
.button-stack { display: grid; gap: 8px; padding: 0 17px; }
.button-stack button { width: 100%; }
.send-result { margin: 15px 17px 0; color: var(--green); font-size: .83rem; font-weight: 800; }
.legend { padding: 15px 17px 17px; color: var(--muted); font-size: .76rem; }
.legend span { display: inline-flex; align-items: center; gap: 4px; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; }
.dot.green { background: var(--green); }
.dot.amber { background: var(--amber); }
.dot.gray { background: #8d9ba4; }

.filter-buttons { justify-content: flex-end; }
.filter-button { border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--navy); padding: 7px 10px; font-size: .75rem; font-weight: 800; }
.filter-button.active { border-color: var(--navy); background: var(--navy); color: var(--white); }
.collapsible-card summary { padding: 15px 19px; color: var(--navy); font-weight: 800; cursor: pointer; }
.collapsible-card[open] summary { border-bottom: 1px solid var(--line); }
.compact-filters { padding: 13px 19px 8px; justify-content: flex-start; }
.doc-list-table { overflow-x: auto; }
.doc-list-table .subtle { color: var(--muted); font-size: .76rem; }
.status-action { display: inline-flex; gap: 5px; align-items: center; }

.return-list { overflow-x: auto; }
.return-person { border-bottom: 1px solid #e9eef1; }
.return-person:last-child { border-bottom: 0; }
.return-person summary { display: grid; grid-template-columns: minmax(130px, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 19px; cursor: pointer; list-style-position: inside; }
.return-person summary strong { color: var(--navy); }
.return-person-docs { padding: 0 19px 13px; }
.return-batch { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 10px 12px; border-top: 1px solid var(--line); background: #f8fafb; font-size: .82rem; }
.return-batch span { color: var(--muted); }
.return-detail-row { display: grid; grid-template-columns: minmax(130px, 1fr) auto minmax(120px, .7fr) auto; gap: 10px; align-items: center; padding: 10px 12px; border-top: 1px solid var(--line); background: #f8fafb; font-size: .82rem; }
.return-actions { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }
@media (max-width: 600px) { .return-batch { flex-wrap: wrap; } }
.return-empty { margin: 0; padding: 17px 19px; color: var(--muted); }
.activity-list { margin: 0; padding: 2px 19px 15px 35px; list-style: none; }
.activity-list li { position: relative; padding: 10px 0 10px 12px; border-left: 2px solid #c6dce8; font-size: .84rem; }
.activity-list li::before { position: absolute; top: 17px; left: -6px; width: 9px; height: 9px; border-radius: 50%; background: var(--blue); content: ""; }
.activity-list small { display: block; color: var(--muted); }

.parent-heading { align-items: end; }
.parent-child-switch { padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--white); }
.child-hero { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 14px 18px; border: 1px solid #b8d8e7; border-radius: 10px; background: #f1f8fb; }
.child-hero h3 { margin: 0; color: var(--navy); font-size: 1.5rem; }
.child-hero p { margin: 2px 0 0; color: var(--muted); }
.child-hero .hero-stats { display: flex; gap: 18px; }
.hero-stat strong { display: block; color: var(--navy); font-size: 1.4rem; }
.hero-stat span { display: block; color: var(--muted); font-size: .74rem; }
.parent-doc-list { display: grid; grid-template-columns: 1fr; gap: 0; padding: 0; }
.parent-doc { display: grid; grid-template-columns: auto 1fr auto auto; gap: 11px; align-items: center; padding: 13px 17px; border-bottom: 1px solid var(--line); background: #fff; }
.parent-doc:last-child { border-bottom: 0; }
.parent-doc.unread { border-color: #9bcde2; box-shadow: 0 4px 13px rgba(23,107,156,.08); }
.parent-doc .doc-main h4 { margin: 0; color: var(--navy); font-size: .95rem; }
.parent-doc .doc-main p { margin: 2px 0 0; color: var(--muted); font-size: .77rem; }
.parent-doc .doc-actions { display: flex; gap: 7px; }
.parent-doc .doc-actions button { min-width: 120px; }
.help-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 17px 19px; }
.help-grid div { padding: 12px; border-radius: 10px; background: #f6f9fa; }
.help-grid strong, .help-grid span { display: block; }
.help-grid strong { color: var(--navy); font-size: .86rem; }
.help-grid span { margin-top: 4px; color: var(--muted); font-size: .76rem; }

.modal-root { position: fixed; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 18px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(13, 35, 51, .58); }
.modal-panel { position: relative; width: min(920px, 100%); max-height: 94vh; overflow: auto; border-radius: 16px; background: var(--white); box-shadow: 0 25px 90px rgba(0,0,0,.28); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; padding: 17px 19px; border-bottom: 1px solid var(--line); }
.modal-head h3 { margin: 0; color: var(--navy); }
.modal-head p { margin: 3px 0 0; color: var(--muted); font-size: .8rem; }
.modal-close { width: 32px; height: 32px; border: 0; border-radius: 50%; background: var(--gray-bg); color: var(--navy); font-weight: 900; }
.modal-body { padding: 17px 19px; }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; padding: 0 19px 19px; }
.submission-progress { flex-basis: 100%; margin: 0 0 8px; padding: 12px; border-radius: 9px; background: #eaf4fc; color: #174c71; font-weight: 700; }
.modal-footer:has(.submission-progress) { flex-wrap: wrap; }
.submission-progress.error { background: #fff1ed; color: #a33225; }
.modal-footer button:disabled { opacity: .65; cursor: wait; }
.modal-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; }
.modal-note { margin: 0 0 12px; padding: 10px 12px; border-radius: 8px; background: #f5f9fb; color: var(--muted); font-size: .82rem; }
.pdf-frame { width: 100%; min-height: 470px; border: 1px solid var(--line); border-radius: 8px; background: #f5f5f5; }
.pdf-preview { display: grid; gap: 10px; width: 100%; overflow: hidden; border: 1px solid var(--line); border-radius: 8px; background: #e8edf0; }
.pdf-preview canvas { display: block; width: 100% !important; height: auto !important; background: #fff; }
.pdf-loading { margin: 0; padding: 30px 12px; text-align: center; color: var(--muted); }
.child-doc-grid { display: grid; gap: 9px; }
.child-doc-row { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.child-doc-row strong { color: var(--navy); }
.child-doc-row small { display: block; color: var(--muted); }
.target-control { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; background: var(--white); font-size: .78rem; }
.actual-layout { display: grid; gap: 18px; }
.actual-pdf-first { order: 1; }
.actual-check-section { order: 2; }
.compact-master-head { min-height: 58px; }
.master-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 12px 17px 0; }
.actual-pages { display: grid; gap: 10px; }
.actual-page { overflow: hidden; border: 1px solid var(--line); border-radius: 10px; }
.actual-page-head { padding: 8px 10px; background: #f6f9fa; color: var(--navy); font-size: .8rem; font-weight: 800; }
.actual-row { display: grid; grid-template-columns: 35px 37px 1fr 29px; gap: 5px; align-items: center; padding: 7px 9px; border-top: 1px solid #edf0f2; font-size: .78rem; }
.actual-row.checked { background: #eff9f5; }
.actual-row input { width: 19px; height: 19px; }
.actual-additions { display: flex; gap: 3px; flex-wrap: wrap; margin-top: 2px; }
.actual-additions span { padding: 1px 4px; border-radius: 4px; background: var(--blue-2); color: var(--blue); font-size: .65rem; }
.actual-controls { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; padding: 9px 10px; border-radius: 9px; background: var(--blue-2); font-size: .8rem; }
.check-all { display: flex; align-items: center; gap: 7px; font-weight: 800; }
.check-all input { width: 19px; height: 19px; }
.signature-box { margin-top: 13px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; }
.signature-box strong { color: var(--navy); }
.signature-canvas { display: block; width: 100%; height: 105px; margin-top: 7px; border: 1px solid #aebbc3; border-radius: 7px; background: #fff; touch-action: none; }
.signature-actions { display: flex; justify-content: flex-end; margin-top: 5px; }
.signature-actions button { border: 0; background: transparent; color: var(--muted); font-size: .75rem; }
.signature-expand-button { border: 1px solid var(--line) !important; border-radius: 7px; padding: 7px 10px; background: #f5f9fb !important; color: var(--navy) !important; }
.signature-focus-overlay { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 14px; background: rgba(9, 28, 42, .86); }
.signature-focus-panel { width: min(960px, 100%); max-height: calc(100dvh - 28px); display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 16px; background: #fff; box-shadow: 0 20px 50px rgba(0,0,0,.25); }
.signature-focus-head { display: grid; gap: 3px; }
.signature-focus-head strong { color: var(--navy); font-size: 1rem; }
.signature-focus-head span { color: var(--muted); font-size: .78rem; }
.signature-focus-canvas-wrap { flex: 1; min-height: 0; display: flex; align-items: center; }
.signature-canvas-focus { width: 100%; height: min(52vw, 320px); min-height: 190px; margin: 0; border: 2px solid var(--blue); border-radius: 10px; touch-action: none; }
.signature-focus-actions { display: flex; justify-content: flex-end; gap: 8px; }
.signature-focus-actions button { min-height: 44px; padding: 10px 16px; }
@media (orientation: landscape) and (max-height: 600px) { .signature-canvas-focus { height: min(40vh, 240px); min-height: 150px; } }
.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; margin-top: 10px; }
.calendar-grid b { padding: 4px; text-align: center; color: var(--muted); font-size: .75rem; }
.calendar-day { min-height: 46px; padding: 6px 3px; border: 1px solid var(--line); border-radius: 7px; background: white; color: var(--ink); }
.calendar-day.sunday { color: var(--red); }
.calendar-day.saturday { color: #356da8; }
.calendar-day.selected { border-color: var(--blue); background: var(--blue); color: white; }
.calendar-day:disabled { opacity: .45; }
.asset-view { display: grid; gap: 12px; }
.asset-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border-radius: 9px; background: #f5f9fb; color: var(--muted); font-size: .8rem; }
.send-review-list { margin: 0; padding-left: 20px; }
.send-review-list li { margin: 4px 0; font-size: .84rem; }
.confirm-box { display: flex; gap: 9px; align-items: flex-start; margin-top: 12px; padding: 10px; border-radius: 8px; background: #f5f9fb; font-size: .82rem; }
.confirm-box input { width: 18px; height: 18px; flex: 0 0 auto; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 11px; }
.form-grid .field { margin: 0; }

.toast { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: none; max-width: min(420px, calc(100vw - 40px)); padding: 12px 16px; border-radius: 10px; background: #18384e; color: white; box-shadow: 0 10px 28px rgba(0,0,0,.2); }

@media (max-width: 980px) {
  .admin-columns, .actual-layout { grid-template-columns: 1fr; }
  .lifecycle-summary { grid-template-columns: 1fr; }
  .family-child-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .help-grid { grid-template-columns: repeat(2, 1fr); }
  .return-detail-row { grid-template-columns: 1fr auto; }
  .return-actions { justify-content: flex-start; }
}
@media (max-width: 720px) {
  .app-header { align-items: flex-start; flex-direction: column; padding: 10px 14px; }
  .header-actions { width: 100%; justify-content: flex-end; }
  .page { padding: 20px 13px 45px; }
  .page-heading, .section-head, .child-hero { align-items: flex-start; flex-direction: column; }
  .heading-controls, .parent-child-switch { width: 100%; }
  .heading-controls label, .parent-child-switch label { width: 100%; justify-content: space-between; }
  .heading-controls .select-control, .parent-child-switch .select-control { flex: 1; }
  .upload-grid, .parent-doc-list { grid-template-columns: 1fr; }
  .filter-buttons { justify-content: flex-start; }
  .modal-two-col { grid-template-columns: 1fr; }
  .modal-root { align-items: flex-start; padding: 8px 8px max(96px, calc(env(safe-area-inset-bottom) + 72px)); }
  .modal-panel { width: 100%; max-height: calc(100dvh - max(112px, calc(env(safe-area-inset-bottom) + 88px))); border-radius: 12px; }
  .modal-body { padding: 12px; }
  .modal-footer { position: sticky; bottom: 0; z-index: 3; padding: 12px 12px max(14px, env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); box-shadow: 0 -8px 18px rgba(20,59,90,.09); }
  .modal-footer button { min-height: 46px; flex: 1; }
  .pdf-preview { max-height: none; }
}
@media (max-width: 480px) {
  .login-box { padding: 22px; }
  .account-badge { display: none; }
  .family-account-card { align-items: flex-start; }
  .family-account-actions { width: 100%; justify-content: flex-start; }
  .family-child-grid { grid-template-columns: 1fr; }
  .help-grid { grid-template-columns: 1fr; }
  .return-person summary { grid-template-columns: 1fr auto; }
  .return-person summary .pill { grid-column: 1 / -1; width: fit-content; }
  .return-detail-row { grid-template-columns: 1fr; gap: 6px; }
  .parent-doc { grid-template-columns: auto 1fr; }
  .parent-doc > .pill { grid-column: 2; grid-row: 1; justify-self: end; }
  .parent-doc .doc-actions { grid-column: 1 / -1; }
  .actual-row { grid-template-columns: 31px 31px 1fr 25px; gap: 3px; font-size: .72rem; }
}
.tool-download { display: inline-block; margin-top: .65rem; color: #176b9c; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.tool-package-button { display: inline-flex; align-items: center; justify-content: center; text-decoration: none; }
.upload-help { display: block; margin-top: .45rem; color: #63717c; line-height: 1.55; }
.tool-download-details { width: 100%; margin-top: .25rem; color: #63717c; font-size: .82rem; }
.tool-download-details summary { width: fit-content; cursor: pointer; }
.tool-download-details .tool-package-button { margin-top: .4rem; font-size: .82rem; }
.protocol-launch { display: inline-flex; align-items: center; justify-content: center; margin-top: .45rem; text-decoration: none; }
.report-list { display: grid; gap: 1rem; }
.report-item { border: 1px solid #d8e0e5; border-radius: 12px; padding: .75rem; background: #f8fafb; }

/* Quiet, document-first visual system */
:root {
  --navy: #263831; --navy-2: #1c2d27; --blue: #476750; --blue-2: #edf2ea;
  --ink: #282d28; --muted: #646c63; --line: #deded3;
  --green: #40674b; --green-bg: #edf3e9; --amber: #92662e; --amber-bg: #f8f0dd;
  --red: #a24d43; --red-bg: #faeeea; --gray-bg: #f1f0e9; --shadow: none;
}
body { background: #f7f6f1; font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic UI", "Noto Sans JP", sans-serif; line-height: 1.7; }
button, select, input { accent-color: var(--blue); }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible { outline: 3px solid #a9bba5; outline-offset: 2px; }
.login-screen { background: #eaece4; }
.login-box { border: 1px solid #d4d8cb; border-radius: 5px; box-shadow: 0 14px 42px rgba(36, 48, 35, .09); }
.login-box h1 { font-size: 1.55rem; letter-spacing: .02em; }
.brand-mark, .brand-mark.small { border-radius: 3px; background: var(--navy); letter-spacing: 0; }
.eyebrow { color: #697567; font-size: .72rem; letter-spacing: .06em; }
.app-header { padding-top: 13px; padding-bottom: 13px; border-bottom: 1px solid var(--line); background: #fffefa; color: var(--ink); box-shadow: none; }
.header-brand { gap: 12px; }
.header-brand strong { font-size: .95rem; letter-spacing: .02em; }
.header-brand small { color: var(--muted); opacity: 1; }
.account-badge { border-color: var(--line); background: #f6f6ef; }
.header-button { border-color: var(--line); background: transparent; color: var(--ink); }
.header-button:hover { background: #f0f1ea; }
.sync-badge { color: var(--muted); }
.sync-badge[data-tone="ok"] { color: var(--green); }
.sync-badge[data-tone="error"] { color: var(--red); }
.notification-badge { background: #f4e7c4; color: #694d22; }
.page { max-width: 1160px; padding-top: 36px; }
.page-heading { align-items: flex-end; margin-bottom: 22px; }
.page-heading h2 { color: var(--ink); font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 700; letter-spacing: .025em; }
.heading-intro { margin: 5px 0 0; color: var(--muted); font-size: .9rem; }
.primary, .secondary, .header-button, .text-button, .link-button, .select-control, .field input { border-radius: 5px; font-weight: 700; }
.primary { border-color: var(--navy); background: var(--navy); }
.primary:hover { background: #354d40; }
.secondary { color: var(--ink); }
.secondary:hover { border-color: #a8b5a5; background: #f1f3ec; }
.select-control, .field input { min-height: 42px; }
.field input:focus, .select-control:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dce8d7; }
.section-card { border-radius: 6px; box-shadow: none; }
.section-head { min-height: 66px; padding: 18px 22px; }
.section-head h3 { color: var(--ink); font-size: 1.04rem; font-weight: 700; letter-spacing: .01em; }
.admin-columns { grid-template-columns: minmax(0, 1.35fr) minmax(280px, .75fr); gap: 14px; align-items: start; }
.upload-grid { gap: 0; padding: 0 22px 15px; }
.upload-card, .upload-card.featured, .pending-card { min-height: 135px; padding: 15px 12px 15px 0; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; background: transparent; }
.upload-card:nth-child(even) { padding-left: 16px; }
.upload-card h4 { color: var(--ink); font-weight: 700; }
.upload-card:last-child, .upload-card:nth-last-child(2) { border-bottom: 0; }
.upload-state { color: var(--green); }
.send-summary { margin: 15px 20px; padding: 0; border-radius: 0; background: transparent; }
.send-summary-row { padding: 10px 0; }
.button-stack { padding: 0 20px; }
.send-result { margin: 15px 20px 22px; color: var(--ink); font-weight: 400; line-height: 1.65; }
.send-result strong { font-weight: 700; }
.pill, .count-badge, .filter-button { border-radius: 4px; }
.pill.review { background: #f2eee3; color: #766347; }
.pill.off { color: #6b7069; }
.count-badge { background: #eef0e8; color: var(--navy); }
.row-button, .link-button { background: var(--blue-2); color: var(--navy); }
.row-button:hover { background: #e0e9db; }
th { background: #f5f5ef; }
th, td, .return-person, .parent-doc { border-bottom-color: var(--line); }
.notice, .modal-note, .confirm-box { border-radius: 4px; background: #f1f2eb; }
.notice.warning { background: var(--amber-bg); }
.family-account-card, .lifecycle-item, .parent-child-switch, .child-doc-row { border-radius: 5px; background: #fffefa; }
.family-child-option, .return-detail-row, .help-grid div { background: #f5f5ef; }
.child-hero { padding: 21px 23px; border: 1px solid var(--line); border-left: 4px solid #8ca58d; border-radius: 5px; background: #fffefa; }
.child-hero h3 { color: var(--ink); font-size: 1.35rem; }
.parent-doc-list { gap: 0; }
.parent-doc { min-height: 92px; padding: 16px 22px; }
.parent-doc.unread { border-color: var(--line); border-left: 3px solid #779576; box-shadow: none; }
.parent-doc .doc-main h4 { color: var(--ink); font-size: 1rem; }
.parent-doc .doc-actions button { min-height: 40px; }
.doc-icon { border-radius: 4px; background: #e7ebe2; color: var(--navy); }
.modal-backdrop { background: rgba(28, 39, 31, .58); }
.modal-panel { border-radius: 6px; box-shadow: 0 22px 64px rgba(18, 28, 20, .19); }
.modal-head h3 { color: var(--ink); }
.modal-close { border-radius: 4px; }
.modal-footer { background: #fffefa; }
.submission-progress { border-radius: 4px; background: #edf3e9; color: var(--navy); }
.signature-box, .signature-canvas, .pdf-preview, .pdf-frame, .calendar-day { border-radius: 4px; }
.signature-expand-button, .asset-meta, .actual-controls { background: #f1f2eb !important; }
.signature-actions, .signature-focus-actions { gap: 8px; flex-wrap: wrap; }
.signature-actions button, .signature-focus-actions button { min-height: 40px; padding: 7px 11px; border: 1px solid var(--line); border-radius: 5px; background: #fffefa; color: var(--ink); font-size: .82rem; font-weight: 700; }
.signature-eraser-button.active, .signature-eraser-button[aria-pressed="true"] { border-color: var(--navy); background: var(--navy); color: white; }
.signature-focus-actions .primary { border-color: var(--navy); background: var(--navy); color: white; }
.toast { border-radius: 5px; background: var(--navy); }
.return-dates { display: grid; gap: 2px; }
@media (max-width: 980px) { .admin-columns { grid-template-columns: 1fr; } }
@media (max-width: 720px) {
  .app-header { gap: 10px; padding: 11px 14px; }
  .header-actions { justify-content: space-between; gap: 6px; }
  .header-button { padding: 7px 9px; font-size: .8rem; }
  .page { padding: 22px 13px 50px; }
  .page-heading { gap: 15px; }
  .section-head { min-height: 0; padding: 16px; }
  .upload-grid { padding: 0 16px 14px; }
  .upload-card, .upload-card.featured { min-height: 0; padding: 17px 0; border-bottom: 1px solid var(--line); }
  .upload-card:nth-child(even) { padding-left: 0; }
  .upload-card:nth-last-child(2) { border-bottom: 1px solid var(--line); }
  .parent-doc { padding: 16px; }
  .parent-doc .doc-actions button { width: 100%; }
  .modal-panel { border-radius: 5px; }
  #app[data-role="parent"] .app-header { flex-direction: row; align-items: center; gap: 8px; padding: 7px 10px; }
  #app[data-role="parent"] .header-brand { min-width: 0; flex: 1; gap: 7px; }
  #app[data-role="parent"] .header-brand .brand-mark { width: 31px; height: 31px; font-size: .68rem; }
  #app[data-role="parent"] .header-brand strong { overflow: hidden; font-size: .82rem; text-overflow: ellipsis; white-space: nowrap; }
  #app[data-role="parent"] .header-brand small, #app[data-role="parent"] .account-badge { display: none; }
  #app[data-role="parent"] .header-actions { width: auto; flex: none; justify-content: flex-end; gap: 4px; }
  #app[data-role="parent"] .sync-badge { position: fixed; top: 52px; right: 10px; z-index: 30; padding: 4px 8px; border: 1px solid var(--line); border-radius: 4px; background: #fffefa; box-shadow: 0 3px 10px rgba(28,45,39,.1); font-size: .7rem; }
  #app[data-role="parent"] .header-button { min-width: 0; padding: 5px 7px; font-size: .72rem; }
  #app[data-role="parent"] #refreshBtn { width: 31px; height: 31px; padding: 0; overflow: hidden; font-size: 0; }
  #app[data-role="parent"] #refreshBtn::before { content: "↻"; font-size: 1.05rem; line-height: 1; }
  #app[data-role="parent"] .page { padding-top: 15px; }
  #app[data-role="parent"] .page-heading { margin-bottom: 12px; }
  #app[data-role="parent"] .parent-heading > div:first-child { display: none; }
  #app[data-role="parent"] .parent-heading { gap: 0; }
  #app[data-role="parent"] .child-hero { padding: 13px 16px; }
  #app[data-role="parent"] .child-hero h3 { display: none; }
  #app[data-role="parent"] .child-hero p { margin-top: 1px; font-size: .78rem; }
}
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 20px; border-bottom: 1px solid var(--line); padding-bottom: 10px; }
.admin-nav button { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 6px; padding: 10px 15px; font: inherit; font-size: .95rem; cursor: pointer; }
.admin-nav button.active { background: var(--navy); border-color: var(--navy); color: white; font-weight: 700; }
.admin-nav button:focus-visible, .work-item button:focus-visible { outline: 3px solid #2479af; outline-offset: 2px; }
.work-item { display: grid; grid-template-columns: minmax(180px, 1fr) auto auto; gap: 12px; align-items: center; padding: 14px 18px; border-top: 1px solid var(--line); }
.work-item small { display: block; margin-top: 4px; color: var(--muted); }
@media (max-width: 720px) { .admin-nav { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); } .admin-nav button { padding: 11px 7px; } .work-item { grid-template-columns: 1fr auto; } .work-item .pill { grid-column: 1; width: fit-content; } .work-item button { grid-column: 2; grid-row: 1 / 3; } }
.queue-group { border-top: 1px solid var(--line); }
.queue-group:first-child { border-top: 0; }
.queue-group h4, .queue-group > summary, .queue-month > summary { margin: 0; padding: 15px 18px; color: var(--ink); font-size: 1rem; font-weight: 700; }
.queue-group h4 span { margin-left: 8px; color: var(--muted); }
.queue-group > summary, .queue-month > summary { cursor: pointer; }
.queue-group summary strong { margin-left: 8px; color: var(--blue); }
.queue-month { border-top: 1px solid var(--line); }
.queue-month > summary { padding-left: 30px; background: #f7f9fa; }
.admin-nav a { border: 1px solid var(--line); background: var(--white); color: var(--ink); border-radius: 6px; padding: 10px 15px; font-size: .95rem; text-decoration: none; text-align: center; }
.admin-nav a.active { background: var(--navy); border-color: var(--navy); color: white; font-weight: 700; }
.admin-nav a:focus-visible { outline: 3px solid #2479af; outline-offset: 2px; }
@media (max-width: 720px) { .admin-nav a { padding: 11px 7px; } }
.queue-person { border-top: 1px solid var(--line); }
.queue-person > summary { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; padding: 14px 18px; cursor: pointer; }
.queue-person > summary strong { min-width: 7em; color: var(--ink); }
.queue-doc-preview { flex: 1 1 180px; color: var(--muted); font-size: .9rem; }
.queue-person-docs { padding-left: 18px; background: #f8fafb; }
.queue-person-docs .work-item:first-child { border-top: 0; }
@media (max-width: 720px) { .queue-person > summary strong { min-width: 0; } .queue-doc-preview { flex-basis: 100%; order: 3; } .queue-person-docs { padding-left: 0; } }
.boot-screen { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; background: var(--white); color: var(--muted); font-size: 1rem; }

/* Kitchen BLESS: white and gold administrator shell. Parent and login views retain their layout. */
#app[data-role="admin"] { --navy: #6b5526; --blue: #927331; --blue-2: #f6efde; --ink: #37332b; --muted: #746d61; --line: #e6dfd2; --shadow: none; color: var(--ink); }
body:has(#app[data-role="admin"]:not(.hidden)) { background: #fbfaf7; }
#app[data-role="admin"] .app-header { min-height: 67px; margin-left: 208px; padding: 10px 30px; background: #fffdfa; border-bottom-color: var(--line); }
#app[data-role="admin"] .header-brand { display: none; }
#app[data-role="admin"] .header-actions { margin-left: auto; }
#app[data-role="admin"] .account-badge { background: transparent; }
#app[data-role="admin"] .notification-badge { background: #ad8930; color: #fff; }
#app[data-role="admin"] .page { max-width: none; margin: 0 0 0 208px; padding: 34px 34px 65px; }
#app[data-role="admin"] [data-admin-panel] { max-width: 1120px; margin: 0 auto; }
#app[data-role="admin"] .admin-nav { position: fixed; z-index: 25; inset: 0 auto 0 0; display: flex; width: 208px; flex-direction: column; flex-wrap: nowrap; gap: 3px; margin: 0; padding: 0 11px 16px; overflow-y: auto; border-right: 1px solid var(--line); border-bottom: 0; background: #fffdfa; }
#app[data-role="admin"] .admin-identity { position: relative; display: flex; align-items: center; gap: 9px; min-height: 118px; margin: 0 -11px 16px; padding: 17px 14px 28px; border-bottom: 1px solid var(--line); }
#app[data-role="admin"] .admin-identity img { width: 42px; height: 42px; flex: none; object-fit: cover; border-radius: 4px; }
#app[data-role="admin"] .admin-identity strong { display: block; font-size: .79rem; line-height: 1.4; }
#app[data-role="admin"] .admin-identity small { display: block; margin-top: 5px; color: var(--muted); font-size: .63rem; white-space: nowrap; }
#app[data-role="admin"] .brand-strokes { position: absolute; bottom: 18px; left: 65px; width: 26px; height: 3px; border-radius: 3px; background: #08c4d1; }
#app[data-role="admin"] .brand-strokes::after { position: absolute; left: 31px; width: 17px; height: 3px; border-radius: 3px; background: #e52bb7; content: ""; }
#app[data-role="admin"] .admin-nav a { width: 100%; padding: 11px 13px; border: 0; border-left: 3px solid transparent; border-radius: 5px; background: transparent; color: #615a4d; font-size: .86rem; text-align: left; }
#app[data-role="admin"] .admin-nav a:hover { background: #f8f3e9; }
#app[data-role="admin"] .admin-nav a.active { padding-left: 13px; border-left-color: #b49436; background: #f4ecda; color: #675016; font-weight: 700; }
#app[data-role="admin"] .admin-brand-footer { margin-top: auto; padding: 20px 6px 0; }
#app[data-role="admin"] .admin-brand-footer img { display: block; width: 100%; max-height: 45px; object-fit: contain; object-position: left center; }
#app[data-role="admin"] .page-heading { margin-bottom: 23px; }
#app[data-role="admin"] .page-heading h2 { color: var(--ink); }
#app[data-role="admin"] .eyebrow { color: #987b36; }
#app[data-role="admin"] .primary { border-color: #8f7130; background: #8f7130; color: #fff; }
#app[data-role="admin"] .secondary, #app[data-role="admin"] .header-button { border: 1px solid #8f7130; background: #8f7130; color: #fff; }
#app[data-role="admin"] .primary:hover { border-color: #735923; background: #735923; color: #fff; }
#app[data-role="admin"] .secondary:hover, #app[data-role="admin"] .header-button:hover { border-color: #735923; background: #735923; color: #fff; }
#app[data-role="admin"] .section-card { border-color: var(--line); border-radius: 5px; box-shadow: none; }
#app[data-role="admin"] .section-head { border-bottom-color: var(--line); }
#app[data-role="admin"] .count-badge, #app[data-role="admin"] .pill.blue { background: #f6efde; color: #745821; }
#app[data-role="admin"] .queue-person-docs, #app[data-role="admin"] .queue-month > summary, #app[data-role="admin"] .return-detail-row, #app[data-role="admin"] .return-batch { background: #fbfaf7; }
#app[data-role="admin"] .upload-card.featured { background: transparent; }
#app[data-role="admin"] .row-button { background: #f6efde; color: #70551c; }
#app[data-role="admin"] th { background: #fbfaf7; }
@media (max-width: 800px) {
  #app[data-role="admin"] .app-header { min-height: 52px; margin-left: 0; padding: 8px 13px; flex-direction: row; align-items: center; }
  #app[data-role="admin"] .page { margin: 0; padding: 0 13px 55px; }
  #app[data-role="admin"] .admin-nav { position: static; width: auto; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 4px; margin: 0 -13px 23px; padding: 0 10px 12px; overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  #app[data-role="admin"] .admin-identity { grid-column: 1 / -1; min-height: 62px; margin: 0 -10px 7px; padding: 9px 13px; border-bottom: 1px solid var(--line); }
  #app[data-role="admin"] .admin-identity img { width: 34px; height: 34px; }
  #app[data-role="admin"] .admin-identity small { margin-top: 1px; }
  #app[data-role="admin"] .brand-strokes { bottom: 7px; left: 57px; }
  #app[data-role="admin"] .admin-nav a, #app[data-role="admin"] .admin-nav a.active { padding: 8px 4px; border-left: 0; border-bottom: 3px solid transparent; font-size: .75rem; text-align: center; white-space: nowrap; }
  #app[data-role="admin"] .admin-nav a.active { border-bottom-color: #b49436; }
  #app[data-role="admin"] .admin-brand-footer { display: none; }
  #app[data-role="admin"] .header-actions { width: 100%; justify-content: flex-end; }
}
@media (max-width: 480px) {
  #app[data-role="admin"] .admin-nav a, #app[data-role="admin"] .admin-nav a.active { font-size: .65rem; }
  #app[data-role="admin"] .account-badge { display: none; }
}

.calendar-readonly .calendar-day:disabled { opacity: 1; cursor: default; }

.publication-family { padding: 14px; }
.publication-family h4 { margin: 0 0 8px; }
.publication-family pre { overflow-wrap: anywhere; font: inherit; }
.publication-item { flex-wrap: wrap; margin: 8px 0; }
.publication-item label { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.publication-item input { width: 18px; height: 18px; vertical-align: middle; }
.publication-item button { flex: 0 0 auto; }
.publication-review-modal { width: min(1440px, 98vw); height: 94dvh; max-height: 94dvh; display: flex; flex-direction: column; overflow: hidden; }
.publication-review-modal > .modal-head { flex: 0 0 auto; }
.publication-review-modal > .modal-body { min-height: 0; flex: 1; overflow: hidden; padding: 0 19px; }
.publication-review-layout { height: 100%; display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; }
.publication-review-layout.has-pdf-preview { grid-template-columns: minmax(340px, .9fr) minmax(0, 1.1fr); }
.publication-list { min-height: 0; overflow: auto; padding: 10px 4px 20px; scrollbar-gutter: stable; }
.publication-common-editor { padding: 12px; margin-bottom: 14px; border: 1px solid var(--line); border-radius: 6px; }
.publication-review-modal summary { cursor: pointer; padding: 8px 0; }
.publication-review-modal textarea { width: 100%; resize: vertical; line-height: 1.6; }
.publication-message-preview { padding: 14px; border: 1px solid var(--line); background: #faf9f5; border-radius: 5px; white-space: pre-wrap; }
.publication-pdf-panel { min-height: 0; min-width: 0; display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 5px; overflow: hidden; background: #f0efe9; }
.publication-pdf-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px; background: white; }
.publication-pdf-head h4 { margin: 0; }
#sendPdfBody { overflow: auto; min-height: 0; flex: 1; padding: 8px; }
#sendPdfBody .pdf-preview { max-height: none; overflow: visible; margin-top: 10px; }
.publication-review-modal > .modal-footer { position: relative; flex: 0 0 auto; display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 19px; border-top: 1px solid var(--line); }
.publication-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; font-size: 14px; }
.publication-controls label { display: flex; align-items: center; gap: 7px; }
.publication-controls input { width: 18px; height: 18px; }
.publication-footer-actions { display: flex; gap: 10px; margin-left: auto; }
@media (max-width: 850px) {
 .publication-review-modal { height: calc(100dvh - max(112px, calc(env(safe-area-inset-bottom) + 88px))); max-height: calc(100dvh - max(112px, calc(env(safe-area-inset-bottom) + 88px))); }
 .publication-review-layout.has-pdf-preview { grid-template-columns: minmax(0, 1fr); }
 .publication-review-modal > .modal-body { position: relative; padding: 0 10px; }
 .publication-pdf-panel { position: absolute; inset: 0 10px; z-index: 4; }
 .publication-review-modal > .modal-footer { padding: 10px; }
 .publication-footer-actions { width: 100%; }
 .publication-footer-actions button { flex: 1; }
}

/* The review toolbar must not inherit notice's non-shrinking horizontal layout. */
.review-banner { min-width: 0; width: 100%; padding: 10px 16px; border-left: 4px solid var(--amber); background: var(--amber-bg); }
.review-banner-label { margin: 0; color: var(--ink); font-size: .8rem; font-weight: 700; overflow-wrap: anywhere; }
.review-switch { min-width: 0; margin-top: 4px; }
.review-switch summary { width: fit-content; max-width: 100%; cursor: pointer; font-size: .8rem; }
.review-switch-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; max-width: 640px; margin-top: 8px; }
.review-switch-actions button { min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); color: var(--ink); font-size: .8rem; line-height: 1.5; white-space: normal; overflow-wrap: anywhere; }
.header-brand > div { min-width: 0; }
.header-brand .brand-mark { flex: none; }
@media (max-width: 720px) {
  #app[data-role="parent"] .app-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  #app[data-role="parent"] .header-brand { width: 100%; }
  #app[data-role="parent"] .header-brand > div { flex: 1; }
  #app[data-role="parent"] .header-actions { min-width: 0; white-space: nowrap; }
  #app[data-role="parent"] .sync-badge { position: absolute; top: calc(100% + 4px); right: 10px; }
  .review-banner { padding: 8px 12px; }
}
@media (max-width: 720px) {
  #app[data-role="parent"] .parent-doc { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon body status" "actions actions actions"; align-items: start; }
  #app[data-role="parent"] .parent-doc > .doc-icon { grid-area: icon; }
  #app[data-role="parent"] .parent-doc > .doc-main { grid-area: body; min-width: 0; overflow-wrap: anywhere; }
  #app[data-role="parent"] .parent-doc > .pill { grid-area: status; width: fit-content; max-width: 100%; white-space: nowrap; justify-self: end; }
  #app[data-role="parent"] .parent-doc > .doc-actions { grid-area: actions; min-width: 0; }
}

#app[data-role="admin"] .upload-actions { display:flex; flex-wrap:wrap; gap:12px; margin:12px 0; align-items:center; }
#app[data-role="admin"] .upload-card > button, #app[data-role="admin"] .upload-card > a.protocol-launch { margin:10px 0; }
#app[data-role="admin"] .upload-card .upload-actions button { margin:0; }

.utilization-config { display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:0 16px; }
.utilization-config input,.utilization-config select { width:100%;padding:9px;border:1px solid var(--line);border-radius:5px; }
#utilResult { margin:14px 0;overflow-wrap:anywhere; }
@media(max-width:600px){.utilization-config{grid-template-columns:1fr;}}

.portal-feedback {
  display: grid;
  gap: .4rem;
  margin-block: 1rem;
}
.portal-feedback textarea {
  width: 100%;
  box-sizing: border-box;
  font: inherit;
  font-size: max(1em, 16px);
  resize: vertical;
}

.portal-calendar-notice {
  margin-block: .65rem;
  padding: .65rem .85rem;
  border: 1px solid #ebc3bb;
  border-inline-start: 4px solid #b83c30;
  border-radius: 8px;
  background: #fff4f1;
  color: #842b22;
  overflow-wrap: anywhere;
}
.portal-calendar-notice div { white-space: pre-wrap; margin-top: .25rem; }
.calendar-notice-editor { margin: 16px 20px; padding: 14px; border: 1px solid var(--line); border-radius: 8px; }
.calendar-notice-editor .portal-feedback { margin: 0 0 10px; }
.portal-feedback textarea { padding: .65rem .75rem; border: 1px solid var(--line); border-radius: 8px; background: white; }
.parent-doc .doc-main { min-width: 0; overflow-wrap: anywhere; }
.report-item { min-width: 0; }
@media (max-width: 480px) {
  #app[data-role="parent"] .parent-doc {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-areas: "icon status" "body body" "actions actions";
    gap: 8px 12px;
  }
  #app[data-role="parent"] .parent-doc > .pill { grid-column: 2; grid-row: 1; align-self: center; }
}

.roster-actions { display: flex; flex-wrap: wrap; gap: 6px; }

.calendar-notice-editor summary { cursor: pointer; font-weight: 700; }
.calendar-notice-editor[open] summary { margin-bottom: 12px; }
.calendar-notice-preview:not([hidden]) { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 400; }
.calendar-notice-editor[open] .calendar-notice-preview { display: none; }
.queue-person > summary::after { content: "›"; margin-left: auto; }
.queue-person[open] > summary::after { transform: rotate(90deg); }
#cancelSelectionActions[hidden] { display: none; }

.plan-position-modal { width: min(1100px, 96vw); height: min(850px, 94dvh); max-height: 94dvh; display: flex; flex-direction: column; overflow: hidden; }
.plan-position-modal > .modal-head, .plan-position-modal > .modal-footer { flex: 0 0 auto; }
.plan-position-modal > .modal-body { flex: 1; min-height: 0; display: grid; grid-template-rows: auto auto auto minmax(0, 1fr); gap: 8px; overflow: hidden; }
.plan-position-modal > .modal-body > p { margin: 0; }
.plan-position-toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.plan-position-preview { min-height: 0; overflow: auto; display: flex; align-items: center; justify-content: center; background: #f2f1ee; border: 1px solid var(--line); }
.plan-position-preview canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 100%; cursor: crosshair; touch-action: none; user-select: none; }
.plan-position-preview.expanded { display: block; }
.plan-position-preview.expanded canvas { width: max(100%, 1000px); max-width: none; max-height: none; height: auto; }
.plan-position-modal > .modal-footer { position: static; padding: 10px 19px; border-top: 1px solid var(--line); }
@media (max-width: 720px) { .plan-position-modal { width: 100%; height: 92dvh; max-height: 92dvh; } .plan-position-toolbar button { padding: 7px 10px; min-height: 36px; } }

/* Mail controls use their own layout; checkboxes must never inherit text-field sizing. */
#adminMail { padding: 20px; }
#adminMail > h3:first-child { margin-top: 0; }
.mail-actions { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; margin: 18px 0; }
.mail-actions > button { width: 100%; min-height: 44px; margin: 0; white-space: normal; }
.mail-reminder-panel { margin: 20px 0; padding: 20px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.mail-reminder-panel > h4 { margin: 0 0 10px; font-size: 1rem; }
.mail-help { color: var(--muted); font-size: .875rem; }
.reminder-recipients { min-width: 0; max-height: 360px; max-height: min(42vh, 360px); overflow-y: auto; margin: 18px 0 10px; padding: 0 12px; border: 1px solid var(--line); border-radius: 5px; }
.reminder-recipients legend { padding: 0 6px; font-size: .9375rem; font-weight: 700; }
.reminder-recipient { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: start; gap: 12px; padding: 14px 4px; cursor: pointer; }
.reminder-recipient + .reminder-recipient { border-top: 1px solid var(--line); }
.reminder-recipient input[type="checkbox"] { width: 20px; height: 20px; min-height: 0; margin: 3px 0 0; padding: 0; flex: none; }
.reminder-recipient-info { display: grid; min-width: 0; gap: 3px; font-size: .9375rem; overflow-wrap: anywhere; }
.reminder-recipient-email, .reminder-recipient-documents, .reminder-recipient-status { font-size: .875rem; }
.reminder-recipient-documents { color: var(--muted); }
.reminder-recipient:has(input:checked) { background: #f5f1e6; }
.reminder-recipient:has(input:disabled) { cursor: default; }
.reminder-recipient:has(input:disabled) .reminder-recipient-status { color: var(--muted); }
#reminderTemplate { display: block; width: 100%; min-height: 160px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; font: inherit; resize: vertical; }
#reminderConfirmation { margin: 16px 0; }
#reminderConfirmation details { padding: 10px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
#reminderConfirmation button { margin-top: 16px; }
@media (max-width: 600px) { #adminMail { padding: 14px; } .mail-actions { grid-template-columns: minmax(0, 1fr); } .reminder-recipients { padding: 0 8px; } }

.family-guide { color: #171717; background: white; padding: 1rem; overflow-wrap: anywhere; }
.family-guide h3,.family-guide h4 { margin: 0 0 .5em; }
.family-guide h3 { font-size: 1.4rem; }
.family-guide h4 { font-size: 1.2rem; }
.family-guide dl { margin: 1.2em 0; }
.family-guide dd { margin: .15em 0 .7em; font: bold 1.35em monospace; white-space: pre-wrap; }
.family-guide img,.family-guide small { display: block; }
#familyGuidePrint { display: none; }
@media print {
  body:has(> #familyGuidePrint) { display: block !important; overflow: visible !important; height: auto !important; }
  body:has(> #familyGuidePrint) > :not(#familyGuidePrint) { display: none !important; }
  #familyGuidePrint, #familyGuidePrint * { visibility: visible !important; }
  #familyGuidePrint { display: block; position: static; padding: 8mm; font: 12pt/1.5 sans-serif; }
}
