:root {
    --bg: #f5f7fb;
    --panel: #ffffff;
    --ink: #172033;
    --muted: #667085;
    --line: #dde3ee;
    --primary: #166b72;
    --primary-dark: #0f4e55;
    --accent: #c4562d;
    --good: #197a4f;
    --bad: #b42318;
    --shadow: 0 18px 45px rgba(22, 32, 51, .08);
}

* { box-sizing: border-box; }
html { font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); }
body { margin: 0; min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
button, .button {
    border: 0;
    border-radius: 8px;
    background: var(--primary);
    color: #fff;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font: inherit;
    font-weight: 750;
    min-height: 44px;
    padding: 0 16px;
}
button:hover, .button:hover { background: var(--primary-dark); }
.ghost { background: #eef3f5; color: var(--primary); }
.ghost:hover { background: #dfeaec; }
.full { width: 100%; }
.small-link { font-weight: 750; white-space: nowrap; }

.sidebar {
    background: #fff;
    border-right: 1px solid var(--line);
    bottom: 0;
    display: flex;
    flex-direction: column;
    gap: 18px;
    left: 0;
    padding: 22px;
    position: fixed;
    top: 0;
    width: 252px;
    z-index: 10;
}
.sidebar-head {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
}
.brand { align-items: center; color: var(--ink); display: flex; font-weight: 850; gap: 10px; }
.brand-mark {
    align-items: center;
    background: var(--primary);
    border-radius: 8px;
    color: white;
    display: inline-flex;
    height: 38px;
    justify-content: center;
    width: 38px;
}
.sidebar-collapse-toggle {
    background: #eef3f5;
    border-radius: 999px;
    color: var(--primary);
    flex: 0 0 30px;
    font-size: 22px;
    font-weight: 900;
    height: 30px;
    min-height: 30px;
    padding: 0;
    width: 30px;
}
.sidebar-collapse-toggle:hover { background: #dfeaec; }
.sidebar nav { display: grid; gap: 6px; }
.sidebar nav a { border-radius: 8px; color: var(--ink); font-weight: 700; padding: 11px 12px; }
.sidebar nav a:hover { background: #eef3f5; color: var(--primary); }
.mobile-topbar { display: none; }

.shell { margin-left: 252px; padding: 30px; padding-bottom: 92px; }
body.sidebar-collapsed .sidebar {
    align-items: center;
    gap: 14px;
    padding: 18px 10px;
    width: 72px;
}
body.sidebar-collapsed .shell { margin-left: 72px; }
body.sidebar-collapsed .sidebar-head {
    flex-direction: column;
    gap: 10px;
}
body.sidebar-collapsed .sidebar .brand span:not(.brand-mark),
body.sidebar-collapsed .sidebar nav a,
body.sidebar-collapsed .sidebar form { display: none; }
body.sidebar-collapsed .sidebar-collapse-toggle {
    transform: rotate(180deg);
}
.auth-shell { align-items: center; display: flex; justify-content: center; min-height: 100vh; padding: 24px; }
.auth-card, .panel, .table-card, .timeline {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 22px;
}
.auth-card { max-width: 420px; width: 100%; }
.auth-card.wide { max-width: 760px; }
h1, h2 { letter-spacing: 0; margin: 0; }
h1 { font-size: 30px; line-height: 1.15; }
h2 { font-size: 20px; margin-bottom: 16px; }
p { color: var(--muted); line-height: 1.5; margin: 8px 0 0; }

.page-head {
    align-items: center;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 18px;
}
.photos-head { margin-bottom: 10px; }
.photos-head h1 { font-size: 28px; }
.photos-head .button { min-height: 40px; padding: 0 14px; }
.alert { border-radius: 8px; font-weight: 700; margin-bottom: 16px; padding: 12px 14px; }
.alert.success { background: #e6f4ee; color: var(--good); }
.alert.info { background: #edf5ff; color: #1763a9; }
.alert.error { background: #fdebea; color: var(--bad); }

.stack, .grid-form { display: grid; gap: 14px; }
.grid-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wide-field, .grid-form button, .form-actions { grid-column: 1 / -1; }
label { color: #344054; display: grid; font-size: 14px; font-weight: 750; gap: 7px; }
input, select, textarea {
    background: #fff;
    border: 1px solid #cfd7e5;
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    min-height: 38px;
    padding: 8px 10px;
    width: 100%;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); outline: 3px solid rgba(22, 107, 114, .15); }
input::placeholder, textarea::placeholder { color: #c2cad8; opacity: 1; }
.field-hint {
    color: #98a2b3;
    display: block;
    font-size: 12px;
    font-weight: 650;
    line-height: 1.35;
    margin-top: -2px;
}
.form-actions { display: flex; gap: 10px; }
.small-button { font-size: 12px; min-height: 32px; padding: 0 10px; }
.danger { background: #b42318; }
.danger:hover { background: #8f1d14; }
.section-head-inline { align-items: start; display: flex; justify-content: space-between; margin-bottom: 12px; }
.section-head-inline h2 { margin-bottom: 6px; }
.profile-family-panel { margin-top: 16px; }
.profile-form .form-actions button { min-height: 40px; padding: 0 14px; }
.family-person-form {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) minmax(0, .7fr) auto;
}
.family-person-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.person-chip {
    align-items: center;
    background: #f6f8fb;
    border: 1px solid var(--line);
    border-radius: 999px;
    display: inline-flex;
    font-size: 13px;
    gap: 6px;
    padding: 5px 7px 5px 10px;
}
.person-chip form { display: inline-flex; }
.editable-person-chip {
    border-radius: 8px;
    padding: 6px;
}
.person-edit-form {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(90px, 1fr) minmax(80px, .8fr) auto;
}
.person-edit-form input { min-height: 30px; padding: 5px 7px; }
.person-edit-form button { font-size: 12px; height: 30px; min-height: 30px; padding: 0 8px; width: auto; }
.person-delete-form button { background: #f2e6e5; color: var(--bad); }
.person-chip button {
    background: #e9eef5;
    border-radius: 999px;
    color: var(--muted);
    font-size: 12px;
    height: 22px;
    min-height: 22px;
    padding: 0;
    width: 22px;
}
.inline-page-title {
    color: var(--ink);
    font-size: 18px;
    margin: 0;
}
.inline-page-title strong { font-size: 22px; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-classification-form { margin-bottom: 8px; }
.admin-classification-form select { min-height: 32px; width: auto; }
.tag {
    background: #e6f4ee;
    border-radius: 999px;
    color: var(--good);
    display: inline-block;
    font-size: 11px;
    font-weight: 850;
    margin-top: 6px;
    padding: 3px 8px;
}
.inline-links { display: flex; gap: 14px; justify-content: space-between; margin-top: 16px; }
.share-form {
    display: grid;
    gap: 12px;
    grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) auto;
}
.share-form label:nth-of-type(1) { grid-column: 1; }
.share-form label:nth-of-type(2) { grid-column: 3 / 5; }
.share-form label:nth-of-type(3) { grid-column: 1; }
.share-form label:nth-of-type(4) { grid-column: 3 / 5; }
.share-form label:nth-of-type(5) { grid-column: 1; }
.share-form label:nth-of-type(6) { grid-column: 3; }
.share-form > button { grid-column: 1 / -1; }
.or-separator {
    align-self: end;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
    padding: 0 2px 10px;
    text-align: center;
}
.profile-help {
    align-self: end;
    display: inline-flex;
    grid-column: 4;
    justify-content: flex-start;
    padding-bottom: 1px;
    position: relative;
}
.profile-help-popover {
    background: #172033;
    border-radius: 8px;
    color: white;
    display: none;
    font-size: 12px;
    line-height: 1.4;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 42px;
    width: min(340px, 82vw);
    z-index: 50;
}
.profile-help:hover .profile-help-popover,
.profile-help.help-open .profile-help-popover { display: block; }

.metric-grid { display: grid; gap: 14px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.metric {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 18px;
}
.metric span { color: var(--muted); display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.metric strong { display: block; font-size: 32px; margin-top: 4px; }

.timeline { display: grid; gap: 14px; }
.timeline-item {
    border-left: 4px solid var(--primary);
    display: grid;
    gap: 10px;
    grid-template-columns: 150px 1fr;
    padding: 4px 0 4px 14px;
}
.timeline-item time { color: var(--muted); font-weight: 750; }
.timeline-item span { color: var(--accent); display: block; font-size: 13px; font-weight: 850; text-transform: uppercase; }
.timeline-item strong { display: block; margin-top: 2px; }

.responsive-table { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 13px 10px; text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 13px; text-transform: uppercase; }
.compact-records-table th,
.compact-records-table td {
    font-size: 12px;
    line-height: 1.35;
    padding: 8px 10px;
}
.compact-records-table td:nth-child(1) { white-space: nowrap; }
.compact-records-table td:nth-child(4) {
    color: var(--muted);
    max-width: 360px;
}
.table-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.table-actions a,
.table-actions button {
    background: #eef3f5;
    border-radius: 6px;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    min-height: 28px;
    padding: 0 9px;
}
.table-actions a:hover,
.table-actions button:hover {
    background: #dfeaec;
    text-decoration: none;
}
.compact-filter {
    display: grid;
    gap: 8px;
    margin-bottom: 14px;
}
.document-filter {
    grid-template-columns: minmax(220px, 1fr) auto;
    max-width: 660px;
    padding: 12px;
}
.document-filter input,
.document-filter button {
    min-height: 36px;
}
.document-list { display: grid; gap: 8px; }
.document-list-item {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: inherit;
    display: grid;
    gap: 12px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 66px;
    padding: 11px 13px;
    text-decoration: none;
    transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.document-list-item:hover,
.document-list-item:focus-visible {
    border-color: color-mix(in srgb, var(--primary) 38%, var(--line));
    box-shadow: 0 8px 20px color-mix(in srgb, var(--primary) 10%, transparent);
    outline: none;
    text-decoration: none;
    transform: translateY(-1px);
}
.document-list-content { min-width: 0; }
.document-list-content strong {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    overflow-wrap: anywhere;
}
.document-list-meta {
    color: var(--muted);
    display: flex;
    flex-wrap: wrap;
    font-size: 12px;
    gap: 4px 12px;
    margin-top: 4px;
}
.document-detail-dates strong { display: inline-flex; flex-wrap: wrap; gap: 0; }
.document-download-list { display: grid; gap: 8px; }
.document-download-name { min-width: 0; }
.document-download-name strong,
.document-download-name small { display: block; }
.document-download-name small {
    color: var(--muted);
    font-size: 11px;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.document-files-field {
    border: 1px solid var(--line);
    border-radius: 10px;
    display: grid;
    gap: 10px;
    padding: 12px;
}
.document-files-heading {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}
.document-files-heading span { color: var(--muted); font-size: 12px; font-weight: 750; }
.document-current-files {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.document-current-file {
    align-items: center;
    background: #f7fafb;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px;
}
.document-file-badge {
    align-items: center;
    background: color-mix(in srgb, var(--primary) 10%, #fff);
    border-radius: 6px;
    color: var(--primary-dark);
    display: inline-flex;
    font-size: 9px;
    font-weight: 900;
    height: 30px;
    justify-content: center;
    width: 34px;
}
.document-current-file-name { min-width: 0; }
.document-current-file-name strong,
.document-current-file-name small { display: block; }
.document-current-file-name small {
    color: var(--muted);
    font-size: 10px;
    font-weight: 650;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.document-remove-file {
    align-items: center;
    color: var(--bad);
    display: flex;
    font-size: 11px;
    gap: 5px;
    grid-column: 1 / -1;
}
.document-remove-file input {
    min-height: 16px;
    width: 16px;
}
.document-upload-control { gap: 6px; }
.danger-zone {
    margin-top: 14px;
}
.danger-zone h2 {
    color: var(--bad);
}
.child-danger-zone {
    align-items: end;
    border-color: color-mix(in srgb, var(--bad) 24%, var(--line));
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(360px, .8fr);
}
.child-danger-copy h2 { font-size: 17px; margin-bottom: 5px; }
.child-danger-copy p { font-size: 13px; margin: 0; max-width: 760px; }
.child-delete-form {
    align-items: end;
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(190px, 1fr) auto;
}
.child-delete-form label { font-size: 12px; gap: 5px; }
.child-delete-form input { min-height: 40px; }
.child-delete-form .danger { min-height: 40px; white-space: nowrap; }
.milestone-template-table th,
.milestone-template-table td {
    font-size: 12px;
    line-height: 1.35;
    padding: 7px 9px;
}
.milestone-template-table td span:not(.template-status) {
    color: var(--muted);
    display: block;
    font-size: 11px;
    margin-top: 3px;
}
.template-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    white-space: nowrap;
}
.template-status.done { background: #dcfce7; color: #166534; }
.template-status.pending { background: #f1f5f9; color: #475467; }
.milestone-filter-panel {
    display: grid;
    gap: 10px;
    grid-template-columns: 1.1fr .8fr 1fr 1fr;
    margin-bottom: 14px;
    padding: 12px;
}
.milestone-filter-panel .wide-field {
    grid-column: 1 / 4;
}
.milestone-filter-panel button {
    align-self: end;
    min-height: 38px;
}
.milestone-filter-panel input,
.milestone-filter-panel select {
    font-size: 13px;
    min-height: 36px;
}
.suggestions-only-table td:nth-child(1) { width: 96px; }
.suggestions-only-table td:nth-child(2) { width: 150px; }
.suggestions-only-table td:nth-child(3) { min-width: 360px; }
.suggestions-only-table td:nth-child(4) {
    text-align: right;
    width: 92px;
}
.type-category-cell .type-label::after { content: "/"; }
.suggestion-register-button {
    background: #eef3f5;
    border-radius: 6px;
    color: var(--primary);
    display: inline-flex;
    font-size: 11px;
    font-weight: 850;
    justify-content: center;
    min-width: 58px;
    padding: 5px 7px;
}
.suggestion-register-button:hover { background: #dfeaec; }
.suggestion-done {
    color: var(--good);
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin-top: 3px;
}
.muted-mini { color: var(--muted); font-size: 11px; }
.inline-delete-form { margin-top: 4px; }
.delete-text-button {
    background: transparent;
    color: var(--bad);
    display: inline;
    font-size: 11px;
    font-weight: 800;
    min-height: 0;
    padding: 0;
}
.delete-text-button:hover {
    background: transparent;
    text-decoration: underline;
}
.empty { color: var(--muted); padding: 18px; text-align: center; }
.action-grid { display: grid; gap: 12px; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-bottom: 18px; }
.action-grid.single-action { grid-template-columns: minmax(180px, 280px); }
.detail-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.detail-grid div { border-bottom: 1px solid var(--line); padding-bottom: 12px; }
.detail-grid span { color: var(--muted); display: block; font-size: 13px; font-weight: 800; text-transform: uppercase; }
.detail-grid strong { display: block; font-weight: 650; margin-top: 4px; white-space: pre-wrap; }
.file-list { display: grid; gap: 10px; }
.child-switcher { min-width: 220px; }
.bottom-nav { display: none; }
.help-dot {
    align-items: center;
    background: #eef3f5;
    border-radius: 999px;
    color: var(--primary);
    display: inline-flex;
    font-weight: 900;
    height: 22px;
    justify-content: center;
    margin-left: 6px;
    position: relative;
    width: 22px;
}
.help-dot:hover::after {
    background: #172033;
    border-radius: 8px;
    color: white;
    content: attr(data-help);
    font-size: 12px;
    font-weight: 600;
    left: 0;
    line-height: 1.4;
    padding: 10px;
    position: absolute;
    top: 28px;
    width: min(280px, 80vw);
    z-index: 40;
}
.photo-filter {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
    margin-bottom: 12px;
    padding: 8px;
}
.photo-filter input { font-size: 13px; min-height: 34px; padding: 7px 9px; }
.photo-filter button[type="submit"] { min-height: 34px; padding: 0 13px; }
.age-filter { display: flex; gap: 6px; position: relative; }
.age-filter input::placeholder { color: #c2cad8; font-weight: 500; opacity: 1; }
.help-button {
    border-radius: 50%;
    flex: 0 0 34px;
    font-weight: 900;
    min-height: 34px;
    padding: 0;
}
.help-popover {
    background: #172033;
    border-radius: 8px;
    color: white;
    display: none;
    font-size: 12px;
    line-height: 1.4;
    padding: 10px;
    position: absolute;
    right: 0;
    top: 42px;
    width: min(310px, 80vw);
    z-index: 50;
}
.age-filter.help-open .help-popover { display: block; }
.photo-folder-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 6px;
    overflow-x: auto;
    padding-bottom: 4px;
}
.folder-pill {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 800;
    gap: 6px;
    min-height: 32px;
    padding: 0 11px;
}
.folder-pill.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.folder-pill span {
    background: rgba(22, 107, 114, .12);
    border-radius: 999px;
    color: inherit;
    font-size: 11px;
    padding: 2px 6px;
}
.photo-folder-tools {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1fr);
    margin-bottom: 8px;
}
.photo-folder-tools form {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding: 6px;
}
.photo-folder-tools input,
.photo-folder-tools select { font-size: 13px; min-height: 34px; padding: 7px 9px; }
.photo-folder-tools .small-button { min-height: 34px; padding: 0 10px; }
.photo-folder-tools.folder-tools-home { grid-template-columns: minmax(0, 420px); }
.photo-bulk-actions {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
}
.photo-bulk-actions form { min-width: 0; }
.photo-bulk-actions form:last-child { grid-template-columns: auto; }
.small-button.danger {
    background: #fff1f1;
    color: #b42318;
}
.small-button.danger:hover { background: #ffe3e3; }
.danger-text { color: #b42318; }
.folder-create-notice {
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
    grid-column: 1 / -1;
}
.folder-card-grid {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
}
.folder-sort-form {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}
.folder-sort-form label {
    align-items: center;
    display: flex;
    flex-direction: row;
    font-size: 12px;
    gap: 8px;
}
.folder-sort-form select {
    font-size: 13px;
    min-height: 34px;
    padding: 6px 28px 6px 9px;
    width: auto;
}
.folder-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    overflow: hidden;
}
.folder-mosaic {
    aspect-ratio: 4 / 3;
    background: #eef3f5;
    display: grid;
    gap: 2px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    overflow: hidden;
}
.folder-mosaic.count-1 { display: block; }
.folder-mosaic.count-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.folder-mosaic img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}
.folder-empty-icon {
    align-items: center;
    color: var(--primary);
    display: flex;
    font-size: 13px;
    font-weight: 850;
    grid-column: 1 / -1;
    justify-content: center;
}
.folder-card-info {
    display: grid;
    gap: 3px;
    padding: 10px 12px;
}
.folder-card-info strong { font-size: 13px; }
.folder-card-info span { color: var(--muted); font-size: 12px; }
.folder-context {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    margin: 2px 0 10px;
}
.folder-context > div { align-items: baseline; display: flex; gap: 8px; }
.folder-context strong { font-size: 17px; }
.folder-context span { color: var(--muted); font-size: 13px; }
.folder-manage-actions {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: flex-end;
}
.folder-manage-actions form,
.folder-rename-widget {
    align-items: center;
    display: flex;
    gap: 5px;
}
.folder-rename-toggle { display: none; }
.folder-manage-actions input[name="name"] {
    font-size: 12px;
    min-height: 30px;
    padding: 5px 8px;
    width: min(190px, 44vw);
}
.folder-manage-actions .small-button {
    font-size: 11px;
    min-height: 30px;
    padding: 0 8px;
}
.gallery-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.photo-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; position: relative; }
.photo-select {
    align-items: center;
    background: rgba(255,255,255,.92);
    border-radius: 999px;
    display: inline-flex;
    height: 30px;
    justify-content: center;
    left: 8px;
    padding: 0;
    position: absolute;
    top: 8px;
    width: 30px;
    z-index: 2;
}
.photo-select input { min-height: auto; width: auto; }
.photo-card img { aspect-ratio: 4 / 3; display: block; object-fit: cover; width: 100%; }
.photo-card div { padding: 12px; }
.photo-card strong { font-size: 13px; }
.photo-card .photo-meta { color: var(--muted); font-size: 12px; line-height: 1.35; }
.photo-card .photo-meta strong { color: var(--ink); font-size: inherit; }
.photo-card span { color: var(--muted); display: block; font-size: 12px; margin-top: 4px; }
.drop-zone { border: 2px dashed #aab6c8; border-radius: 8px; padding: 18px; text-align: center; }
.photo-upload-grid { display: grid; gap: 14px; margin-top: 16px; }
.photo-upload-card { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 12px; grid-template-columns: 112px 1fr; padding: 12px; }
.photo-upload-card img { aspect-ratio: 1; border-radius: 8px; object-fit: cover; width: 100%; }
.photo-fields { display: grid; gap: 8px; }
.family-people-picker {
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 10px;
    padding: 12px;
}
.family-people-picker > div {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.family-people-picker label {
    align-items: center;
    background: #f6f8fb;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    flex-direction: row;
    font-size: 13px;
    gap: 6px;
    padding: 7px 9px;
}
.family-people-picker input { min-height: auto; width: auto; }
.compact-fill-button { font-size: 13px; min-height: 36px; padding: 0 12px; width: fit-content; }
.photo-folder-select { max-width: 360px; }
.date-age-line { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(120px, .75fr) 1fr; }
.date-age-line span { color: var(--primary); font-size: 13px; font-weight: 850; padding-bottom: 9px; }
.photo-two-cols { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; }
.date-age-row { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(160px, .7fr) 1fr; }
.date-age-row span { color: var(--primary); font-size: 13px; font-weight: 850; padding-bottom: 9px; }
.photo-actions-row { display: grid; gap: 8px; grid-template-columns: 1fr auto; }
.compact-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.chart-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.growth-reference-toolbar {
    align-items: center;
    display: flex;
    gap: 18px;
    justify-content: space-between;
    margin-bottom: 16px;
    padding: 12px 14px;
}
.growth-reference-heading {
    display: grid;
    flex: 1;
    gap: 2px;
    min-width: 190px;
}
.growth-reference-heading strong { color: var(--text); font-size: 14px; }
.growth-reference-heading span { color: var(--muted); font-size: 12px; }
.growth-range-control {
    background: #f3f7f8;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: grid;
    gap: 4px;
    grid-template-columns: repeat(4, minmax(92px, auto));
    padding: 4px;
}
.growth-range-control button {
    background: transparent;
    border: 0;
    border-radius: 6px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 800;
    min-height: 34px;
    padding: 0 10px;
}
.growth-range-control button:hover { background: rgba(255, 255, 255, .8); color: var(--primary); }
.growth-range-control button.active {
    background: #fff;
    box-shadow: 0 2px 8px rgba(22, 32, 51, .10);
    color: var(--primary);
}
.growth-chart-panel { min-width: 0; }
.growth-chart-frame {
    height: 340px;
    position: relative;
    width: 100%;
}
.growth-chart-canvas { display: block; }
.growth-chart-note {
    background: #f7fafc;
    border-left: 3px solid var(--primary);
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin: 8px 0 0;
    padding: 8px 10px;
}
.growth-page-head { align-items: center; }
.growth-create-button { white-space: nowrap; }
.growth-create-icon { height: 15px; width: 15px; }
.growth-view-control { display: none; }
.growth-records-panel { padding: 18px; }
.growth-records-heading { align-items: center; display: flex; justify-content: space-between; margin-bottom: 4px; }
.growth-records-heading h2 { margin-bottom: 0; }
.growth-records-table { margin-top: 2px; }
.growth-records-table table { border-collapse: separate; border-spacing: 0 8px; min-width: 680px; }
.growth-records-table thead th { border: 0; color: #7b879d; font-size: 11px; letter-spacing: .04em; padding: 0 12px 4px; }
.growth-records-table tbody tr { background: #fbfdfe; box-shadow: 0 2px 8px rgba(31, 48, 80, .035); }
.growth-records-table tbody td { border-bottom: 1px solid #e9eff4; border-top: 1px solid #e9eff4; padding: 12px; vertical-align: middle; }
.growth-records-table tbody td:first-child { border-bottom-left-radius: 12px; border-left: 1px solid #e9eff4; border-top-left-radius: 12px; }
.growth-records-table tbody td:last-child { border-bottom-right-radius: 12px; border-right: 1px solid #e9eff4; border-top-right-radius: 12px; }
.growth-record-actions-heading { width: 78px; }
.growth-age-pill { align-items: center; background: #e9f7f4; border: 1px solid #d5eee8; border-radius: 14px; color: var(--primary-dark); display: inline-flex; flex-direction: column; font-weight: 850; justify-content: center; line-height: 1.05; min-height: 46px; min-width: 52px; padding: 5px 7px; }
.growth-age-pill strong { font-size: 13px; }
.growth-age-pill small { font-size: 10px; font-weight: 800; margin-top: 2px; }
.growth-measure-list { display: flex; flex-wrap: wrap; gap: 6px; }
.growth-measure { background: #f2f6f8; border-radius: 8px; display: inline-flex; gap: 5px; padding: 5px 7px; white-space: nowrap; }
.growth-measure small { color: #748197; font-size: 11px; font-weight: 750; }
.growth-measure strong { color: var(--text); font-size: 12px; }
.growth-record-notes { color: var(--muted); font-size: 12px; line-height: 1.45; max-width: 320px; }
.growth-record-notes.is-empty { color: #aab4c3; }
.growth-record-actions { text-align: right; white-space: nowrap; }
.growth-record-action-buttons { align-items: center; display: inline-flex; gap: 6px; }
.growth-record-action-buttons form { display: inline-flex; }
.growth-record-actions .icon-action { align-items: center; background: #f5fbfa; border: 1px solid #dcefeb; border-radius: 999px; color: var(--primary-dark); display: inline-flex; height: 30px; justify-content: center; margin: 0; min-height: 0; padding: 0; width: 30px; }
.growth-record-actions .icon-action.danger { background: #fff5f5; border-color: #ffd7d7; color: #c93030; }
.growth-record-actions .icon-action::after { content: none; }
.growth-record-actions .icon-action .mini-svg { display: block; height: 14px; width: 14px; }
.timeline-actions {
    align-items: center;
    display: flex;
    gap: 10px;
    margin-top: 8px;
}
.timeline-actions a,
.timeline-actions button {
    background: transparent;
    color: var(--primary);
    font-size: 12px;
    font-weight: 800;
    min-height: auto;
    padding: 0;
    text-decoration: none;
}
.timeline-actions button:hover,
.timeline-actions a:hover {
    background: transparent;
    color: var(--primary-dark);
    text-decoration: underline;
}
.empty-state-panel {
    margin-top: 12px;
}
.diary-book {
    display: grid;
    gap: 12px;
}
.diary-card {
    background: #fffdf8;
    border: 1px solid #eadfca;
    border-radius: 8px;
    box-shadow: 0 14px 35px rgba(22, 32, 51, .06);
    padding: 16px;
}
.diary-card-head {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: space-between;
    margin-bottom: 10px;
}
.diary-card time {
    color: var(--muted);
    font-size: 12px;
    font-weight: 850;
}
.diary-card-head span {
    background: #eef3f5;
    border-radius: 999px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 900;
    padding: 4px 9px;
}
.diary-card h2 {
    font-size: 18px;
    margin-bottom: 8px;
}
.diary-card p {
    color: #344054;
    font-size: 14px;
    margin-top: 0;
}
.diary-entry-body {
    align-items: start;
    display: grid;
    gap: 12px;
    grid-template-columns: auto 1fr;
}
.diary-thumb {
    border: 1px solid #eadfca;
    border-radius: 8px;
    display: block;
    overflow: hidden;
    width: 86px;
}
.diary-thumb img {
    aspect-ratio: 1;
    display: block;
    object-fit: cover;
    width: 100%;
}
.compact-form { gap: 10px; }
.compact-form textarea { min-height: 74px; }
.treatment-grid { display: grid; gap: 8px; grid-template-columns: 1.4fr .7fr .8fr 1fr; }
.vaccine-source-note {
    border-left: 4px solid var(--primary);
    color: var(--muted);
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 14px;
    padding: 12px 14px;
}
.vaccine-source-note strong { color: var(--ink); display: block; margin-bottom: 3px; }
.vaccine-filter-panel {
    display: grid;
    gap: 8px;
    grid-template-columns: minmax(0, 1fr) 180px auto;
    margin-bottom: 12px;
    padding: 10px;
}
.vaccine-filter-panel input,
.vaccine-filter-panel select {
    font-size: 13px;
    min-height: 34px;
    padding: 7px 9px;
}
.vaccine-view-mode-control {
    align-items: center;
    background: #f5f8fa;
    border: 1px solid #dce8eb;
    border-radius: 10px;
    display: inline-flex;
    gap: 2px;
    min-height: 34px;
    padding: 3px;
}
.vaccine-view-mode-button {
    align-items: center;
    background: transparent;
    border: 0;
    border-radius: 7px;
    color: #78909b;
    cursor: pointer;
    display: inline-flex;
    height: 26px;
    justify-content: center;
    padding: 0;
    transition: background .18s ease, color .18s ease, box-shadow .18s ease;
    width: 30px;
}
.vaccine-view-mode-button:hover { background: #e8f4f1; color: var(--primary-dark); }
.vaccine-view-mode-button.is-active { background: #fff; box-shadow: 0 1px 3px rgb(32 77 76 / .14); color: var(--primary-dark); }
.vaccine-view-mode-button:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.vaccine-view-mode-icon { height: 16px; width: 16px; }
.table-note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.4;
    margin: -4px 0 12px;
}
.vaccine-section-head {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: space-between;
}
.vaccine-section-head h2 { margin: 0; }
.vaccine-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    margin-bottom: 14px;
    padding: 12px;
}
.vaccine-toolbar form { margin: 0; min-width: 260px; }
.vaccine-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    justify-content: flex-end;
}
.status-dot {
    align-items: center;
    color: var(--muted);
    display: inline-flex;
    font-size: 12px;
    font-weight: 800;
    gap: 5px;
}
.status-dot::before {
    border-radius: 999px;
    content: "";
    height: 9px;
    width: 9px;
}
.status-dot.done::before, .vaccine-status.done { background: #dcfce7; color: #166534; }
.status-dot.soon::before, .vaccine-status.soon { background: #dbeafe; color: #1d4ed8; }
.status-dot.overdue::before, .vaccine-status.overdue { background: #fee2e2; color: #b42318; }
.status-dot.future::before, .vaccine-status.future { background: #f1f5f9; color: #475467; }
.status-dot.special::before, .vaccine-status.special { background: #fef3c7; color: #92400e; }
.status-dot.optional::before, .vaccine-status.optional { background: #eef2ff; color: #3730a3; }
.vaccine-table th,
.vaccine-table td {
    font-size: 12px;
    line-height: 1.35;
    padding: 9px 10px;
    vertical-align: top;
}
.vaccine-table th {
    font-size: 11px;
    padding: 9px 10px;
    vertical-align: top;
}
.vaccine-table tr[hidden] { display: none !important; }
.compact-vaccine-table {
    table-layout: fixed;
    width: 100%;
}
.compact-vaccine-table th:nth-child(1) { width: 128px; }
.compact-vaccine-table th:nth-child(2) { width: 170px; }
.compact-vaccine-table th:nth-child(3) { width: 88px; }
.compact-vaccine-table td { word-break: normal; overflow-wrap: anywhere; }
.compact-action-button {
    align-items: center;
    display: inline-flex;
    font-size: 12px;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    text-decoration: none;
    white-space: nowrap;
}
.vaccine-row.status-done { background: #f7fef9; }
.vaccine-row.status-soon { background: #f8fbff; }
.vaccine-row.status-overdue { background: #fffafa; }
.vaccine-row.status-special { background: #fffcf2; }
.vaccine-table td strong { display: block; }
.vaccine-table td span:not(.vaccine-status) {
    color: var(--muted);
    display: block;
    font-size: 10px;
    margin-top: 2px;
}
.vaccine-row-timing { white-space: nowrap; }
.vaccine-row-timing .vaccine-row-age,
.vaccine-row-timing .vaccine-row-due {
    color: var(--ink);
    display: block;
    font-size: 11px;
    font-weight: 800;
    margin: 0;
}
.vaccine-row-timing .vaccine-row-due { color: var(--muted); font-size: 10px; font-weight: 700; margin-top: 3px; }
.vaccine-row.is-actionable { cursor: pointer; }
.vaccine-row.is-actionable:focus-visible { outline: 2px solid var(--primary); outline-offset: -2px; }
.vaccine-row-edit.icon-action {
    align-items: center;
    background: #f5fbfa;
    border: 1px solid #dcefeb;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    height: 30px;
    justify-content: center;
    margin: 0;
    min-height: 0;
    padding: 0;
    text-decoration: none;
    width: 30px;
}
.vaccine-row-edit.icon-action.danger { background: #fff5f5; border-color: #ffd7d7; color: #c93030; }
.vaccine-row-edit.icon-action::after { content: none; }
.vaccine-row-edit.icon-action .mini-svg { display: block; height: 14px; width: 14px; }
.vaccine-table small {
    color: var(--muted);
    display: block;
    font-size: 11px;
    line-height: 1.35;
    margin-top: 4px;
}
.vaccine-status {
    border-radius: 999px;
    display: inline-flex;
    font-size: 11px;
    font-weight: 900;
    padding: 4px 8px;
    white-space: nowrap;
}
.vaccine-action-details {
    min-width: 240px;
}
.vaccine-action-details summary {
    background: #eef3f5;
    border-radius: 7px;
    color: var(--primary);
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 900;
    list-style: none;
    min-height: 30px;
    padding: 7px 10px;
}
.vaccine-action-details summary::-webkit-details-marker { display: none; }
.vaccine-inline-form {
    display: grid;
    gap: 5px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 7px;
    min-width: 430px;
}
.vaccine-inline-form input,
.vaccine-inline-form select,
.vaccine-inline-form textarea {
    font-size: 12px;
    min-height: 30px;
    padding: 5px 7px;
}
.vaccine-inline-form textarea,
.vaccine-inline-form input[type="file"] { grid-column: 1 / -1; }
.vaccine-inline-form .small-button {
    font-size: 12px;
    grid-column: 1 / -1;
    min-height: 30px;
    padding: 0 9px;
}
.inline-delete-form { display: inline-flex; margin-top: 6px; }
.vaccine-record-form [hidden] { display: none; }
.vaccine-table tr.is-filter-hidden { display: none !important; }
body[data-vaccine-view-mode="compact"] .compact-vaccine-table .vaccine-protection-heading,
body[data-vaccine-view-mode="compact"] .compact-vaccine-table td[data-label="Protege contra"],
body[data-vaccine-view-mode="compact"] .vaccine-row-protection,
body[data-vaccine-view-mode="compact"] .table-note {
    display: none;
}
.form-note {
    background: #fff8e6;
    border: 1px solid #f6d98b;
    border-radius: 8px;
    color: #7a4f01;
    font-size: 13px;
    font-weight: 750;
    line-height: 1.4;
    padding: 10px 12px;
}
.muted-text { color: var(--muted); font-size: 12px; font-weight: 750; }
.floating-top-button {
    background: var(--primary);
    border-radius: 999px;
    bottom: 16px;
    box-shadow: 0 10px 28px rgba(16, 24, 40, .22);
    color: #fff;
    display: none;
    font-size: 0;
    height: 34px;
    min-height: 34px;
    padding: 0;
    position: fixed;
    right: 14px;
    width: 34px;
    z-index: 40;
}
.floating-top-button::before {
    content: "↑";
    font-size: 18px;
    font-weight: 900;
    line-height: 1;
}
.photos-top-button { display: inline-flex; }
.photo-viewer {
    background: #0b101b;
    color: white;
    display: grid;
    grid-template-rows: auto 1fr auto;
    min-height: calc(100vh - 60px);
    margin: -30px;
    position: relative;
}
.photo-viewer-bar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    padding: 12px;
}
.photo-viewer img {
    align-self: center;
    justify-self: center;
    max-height: calc(100vh - 170px);
    max-width: 100%;
    object-fit: contain;
}
.photo-nav {
    align-items: center;
    background: rgba(255,255,255,.16);
    border-radius: 999px;
    color: #fff;
    display: flex;
    font-size: 34px;
    height: 46px;
    justify-content: center;
    padding: 0 0 4px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    z-index: 4;
}
.photo-nav:hover { background: rgba(255,255,255,.26); }
.photo-nav[hidden] { display: none; }
.photo-nav-prev { left: 16px; }
.photo-nav-next { right: 16px; }
.photo-viewer-info { padding: 12px 18px 18px; }
.photo-viewer-info span { color: #d0d5dd; display: block; font-size: 13px; margin-top: 4px; }
.photo-viewer-people strong { color: #fff; font-weight: 850; }
.photo-edit-preview {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}
.photo-edit-preview img {
    border-radius: 8px;
    max-height: 340px;
    max-width: 100%;
    object-fit: contain;
}

@media (max-width: 900px) {
    .mobile-topbar {
        align-items: center;
        background: #fff;
        border-bottom: 1px solid var(--line);
        display: flex;
        justify-content: space-between;
        min-height: 58px;
        padding: 10px 14px;
        position: sticky;
        top: 0;
        z-index: 30;
    }
    .menu-toggle { min-height: 36px; padding: 0 12px; }
    .sidebar {
        border-bottom: 1px solid var(--line);
        border-right: 0;
        bottom: auto;
        display: none;
        left: 0;
        padding: 12px 14px;
        right: 0;
        top: 58px;
        width: auto;
    }
    body.menu-open .sidebar { display: block; }
    .sidebar .brand, .sidebar form { display: none; }
    .sidebar-head { display: block; }
    .sidebar-collapse-toggle { display: none; }
    body.sidebar-collapsed .sidebar {
        align-items: stretch;
        padding: 12px 14px;
        width: auto;
    }
    body.sidebar-collapsed .shell { margin-left: 0; }
    body.sidebar-collapsed .sidebar nav a { display: block; }
    .sidebar nav { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .shell { margin-left: 0; padding: 18px; padding-bottom: 24px; }
    .page-head { align-items: stretch; flex-direction: column; }
    .photos-head { align-items: center; flex-direction: row; margin-bottom: 8px; }
    .photos-head h1 { font-size: 25px; }
    .photos-head .button { font-size: 13px; min-height: 36px; padding: 0 12px; }
    .photos-subtitle { display: none; }
    .grid-form, .metric-grid, .action-grid, .detail-grid, .chart-grid, .compact-grid, .treatment-grid { grid-template-columns: 1fr; }
    .section-head-inline p { font-size: 13px; line-height: 1.35; }
    .profile-form { gap: 8px; }
    .profile-form label { gap: 5px; }
    .profile-form input, .profile-form select { min-height: 36px; padding: 7px 9px; }
    .profile-form .form-actions button { font-size: 13px; min-height: 36px; padding: 0 12px; }
    .family-person-form { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 6px; }
    .family-person-form input { min-height: 36px; padding: 7px 9px; }
    .family-person-form button { font-size: 13px; min-height: 36px; padding: 0 10px; }
    .family-person-list { gap: 6px; }
    .person-chip { font-size: 12px; max-width: 100%; }
    .editable-person-chip { width: 100%; }
    .person-edit-form { flex: 1; grid-template-columns: minmax(0, 1fr) minmax(0, .8fr) auto; }
    .inline-page-title { font-size: 14px; line-height: 1.3; }
    .inline-page-title strong { font-size: 18px; }
    .growth-chart-frame { height: 430px; }
    .chart-grid .panel { padding: 16px 12px; }
    .growth-reference-toolbar { align-items: stretch; flex-direction: column; gap: 9px; padding: 10px; }
    .growth-range-control { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
    .growth-range-control button { min-height: 32px; padding: 0 6px; }
    .growth-page-head { align-items: center; flex-direction: row; gap: 8px; justify-content: space-between; }
    .growth-page-head .button { font-size: 12px; min-height: 34px; padding: 0 10px; }
    .growth-view-control { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
    .growth-view-control > span { color: var(--muted); font-size: 12px; font-weight: 800; }
    .growth-view-buttons { background: #f3f7f8; border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; }
    .growth-view-buttons button { background: transparent; border: 0; border-radius: 6px; color: var(--muted); font-size: 12px; font-weight: 800; min-height: 30px; padding: 0 9px; }
    .growth-view-buttons button.active { background: #fff; box-shadow: 0 2px 8px rgba(22, 32, 51, .10); color: var(--primary); }
    .growth-page[data-growth-view-mode="summary"] .chart-grid { gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .growth-page[data-growth-view-mode="summary"] .chart-grid .panel { border-radius: 14px; padding: 10px 7px; }
    .growth-page[data-growth-view-mode="summary"] .growth-chart-panel h2 { font-size: 16px; margin-bottom: 8px; }
    .growth-page[data-growth-view-mode="summary"] .growth-chart-frame { height: 230px; }
    .growth-page[data-growth-view-mode="summary"] .growth-chart-note { display: none; }
    .growth-records-panel { padding: 14px; }
    .growth-records-table { overflow: visible; }
    .growth-records-table table { border-collapse: separate; border-spacing: 0; display: block; min-width: 0; }
    .growth-records-table thead { display: none; }
    .growth-records-table tbody { display: block; }
    .growth-records-table tr { align-items: center; background: transparent; border: 0; border-bottom: 1px solid #e6edf4; border-radius: 0; box-shadow: none; display: grid; gap: 9px 12px; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto auto; min-height: 0; padding: 13px 8px 10px; position: relative; }
    .growth-records-table td { border: 0 !important; display: block; min-width: 0; padding: 0; }
    .growth-records-table td::before { display: none; }
    .growth-records-table .growth-record-age { grid-column: 1; grid-row: 1; }
    .growth-records-table .growth-record-measurements { grid-column: 1 / -1; grid-row: 2; }
    .growth-records-table .growth-record-notes { grid-column: 1 / -1; grid-row: 3; max-width: none; }
    .growth-records-table .growth-record-notes.is-empty { display: none; }
    .growth-records-table .growth-record-actions { grid-column: 2; grid-row: 1; position: static; }
    .growth-record-action-buttons { background: transparent; border-radius: 0; gap: 5px; padding: 0; }
    .growth-age-pill { align-items: baseline; background: transparent; border: 0; border-radius: 0; color: #0a9b20; flex-direction: row; justify-content: flex-start; min-height: 0; min-width: 0; padding: 0; }
    .growth-age-pill strong { font-size: 13px; }
    .growth-age-pill small { font-size: 13px; margin: 0 0 0 4px; }
    .growth-measure-list { display: grid; gap: 7px 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .growth-measure { align-items: baseline; justify-content: flex-start; min-width: 0; padding: 4px 6px; }
    .growth-measure:nth-child(n+4) { grid-column: span 1; }
    .growth-measure small { font-size: 10px; }
    .growth-measure strong { font-size: 11px; }
    .growth-record-actions .icon-action { height: 26px; width: 26px; }
    .growth-record-actions .icon-action .mini-svg { height: 13px; width: 13px; }
    .share-form { grid-template-columns: 1fr; }
    .share-form label:nth-of-type(n), .share-form > button { grid-column: 1; }
    .or-separator { padding: 0; }
    .profile-help { grid-column: 1; padding-bottom: 0; }
    .admin-classification-form select { width: 100%; }
    .vaccines-head { align-items: center; flex-direction: row; gap: 8px; justify-content: space-between; }
    .vaccines-head h1 { font-size: 24px; line-height: 1.1; }
    .vaccines-head p { font-size: 12px; line-height: 1.25; }
    .vaccines-head .form-actions { gap: 6px; }
    .vaccines-head .button { font-size: 12px; min-height: 34px; padding: 0 10px; }
    .vaccine-source-note { font-size: 12px; margin-bottom: 10px; padding: 10px 12px; }
    .vaccine-filter-panel {
        grid-template-columns: 1fr 112px 94px;
        padding: 8px;
    }
    .vaccine-filter-panel input,
    .vaccine-filter-panel select {
        font-size: 12px;
        min-height: 32px;
        padding: 6px 8px;
    }
    .vaccine-toolbar { align-items: stretch; flex-direction: column; gap: 8px; padding: 10px; }
    .vaccine-toolbar form { min-width: 0; }
    .vaccine-legend { justify-content: flex-start; }
    .status-dot { font-size: 11px; }
    .vaccine-inline-form {
        grid-template-columns: 1fr 1fr;
        min-width: 0;
        width: 100%;
    }
    .vaccine-inline-form input,
    .vaccine-inline-form .small-button { min-height: 32px; }
    .compact-vaccine-table { table-layout: auto; }
    .compact-vaccine-table th:nth-child(n) { width: auto; }
    .compact-action-button { font-size: 12px; min-height: 30px; width: fit-content; }
    .vaccine-card { padding: 12px; }
    .vaccine-card h2 { font-size: 18px; margin-bottom: 8px; }
    .vaccine-table tr.vaccine-row {
        border-bottom: 2px solid #d7dde8;
        display: grid;
        gap: 0;
        grid-template-columns: 1fr 1fr;
        padding: 8px 0 12px;
    }
    .vaccine-table tr.vaccine-row td {
        align-items: start;
        border: 0;
        display: grid;
        gap: 5px;
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 5px 0;
    }
    .vaccine-table tr.vaccine-row td:nth-child(1),
    .vaccine-table tr.vaccine-row td:nth-child(2) { grid-column: span 1; }
    .vaccine-table tr.vaccine-row td:nth-child(n+3) { grid-column: 1 / -1; }
    .vaccine-table tr.vaccine-row td::before {
        font-size: 11px;
        line-height: 1.2;
    }
    .vaccine-table td strong { font-size: 12px; }
    .vaccine-table td span:not(.vaccine-status),
    .vaccine-table small { font-size: 10px; }
    .vaccine-status {
        justify-content: center;
        min-width: 128px;
    }
    .floating-top-button { display: inline-flex; }
    .photos-head { align-items: center; display: flex; gap: 8px; justify-content: space-between; margin-bottom: 8px; }
    .photos-head h1 { font-size: 24px; line-height: 1.12; }
    .photos-head .button { font-size: 12px; min-height: 34px; padding: 0 10px; white-space: nowrap; }
    .documents-head { align-items: center; flex-direction: row; gap: 8px; }
    .documents-head h1 { font-size: 24px; }
    .documents-head p { display: none; }
    .documents-head .button { font-size: 12px; min-height: 34px; padding: 0 10px; white-space: nowrap; }
    .document-filter {
        gap: 6px;
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 8px;
    }
    .document-filter button {
        font-size: 12px;
        min-height: 34px;
    }
    .document-filter input {
        font-size: 12px;
        min-height: 34px;
        padding: 6px 8px;
    }
    .document-list { gap: 7px; }
    .document-list-item { gap: 9px; min-height: 60px; padding: 9px; }
    .document-list-content strong { font-size: 13px; }
    .document-list-meta { font-size: 11px; gap: 3px 8px; }
    .document-download-name strong { font-size: 12px; }
    .document-current-files { grid-template-columns: 1fr; }
    .photo-folder-bar { margin-bottom: 5px; }
    .photo-folder-tools { grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr); gap: 6px; }
    .photo-folder-tools.folder-tools-home { grid-template-columns: 1fr; }
    .photo-folder-tools form { grid-template-columns: minmax(0, 1fr) auto; padding: 5px; }
    .photo-folder-tools input, .photo-folder-tools select { font-size: 12px; min-height: 32px; padding: 6px 8px; }
    .photo-folder-tools .small-button { font-size: 11px; min-height: 32px; padding: 0 8px; }
    .photo-bulk-actions { grid-template-columns: minmax(0, 1fr) auto; gap: 5px; }
    .photo-bulk-actions form { padding: 5px; }
    .photo-bulk-actions form:last-child { padding-left: 0; }
    .folder-pill { font-size: 12px; min-height: 30px; padding: 0 10px; }
    .photo-filter { gap: 5px; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; margin-bottom: 9px; padding: 6px; }
    .photo-filter input { font-size: 12px; min-height: 32px; padding: 6px 8px; }
    .photo-filter .filter-people { grid-column: 1; }
    .photo-filter .filter-age { grid-column: 2 / 4; }
    .photo-filter .filter-location { grid-column: 1; }
    .photo-filter .filter-event { grid-column: 2; }
    .photo-filter button[type="submit"] { font-size: 12px; grid-column: 3; min-height: 32px; padding: 0 11px; }
    .photo-filter .help-button { flex-basis: 32px; min-height: 32px; width: 32px; }
    .photo-filter .age-filter { min-width: 0; }
    .folder-context { margin-bottom: 8px; }
    .folder-context strong { font-size: 15px; }
    .folder-context span { font-size: 12px; }
    .folder-manage-actions { align-items: flex-start; gap: 4px; }
    .folder-rename-widget { justify-content: flex-end; }
    .folder-rename-toggle { display: inline-flex; }
    .folder-rename-widget .folder-rename-form { display: none; }
    .folder-rename-widget.is-open {
        flex-basis: 100%;
        justify-content: flex-end;
        order: 3;
    }
    .folder-rename-widget.is-open .folder-rename-toggle { display: none; }
    .folder-rename-widget.is-open .folder-rename-form {
        display: flex;
        justify-content: flex-end;
        width: 100%;
    }
    .folder-rename-widget.is-open input[name="name"] { width: min(220px, 62vw); }
    .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
    .folder-card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
    .folder-card-info { padding: 8px 9px; }
    .folder-card-info strong { font-size: 12px; line-height: 1.25; }
    .folder-card-info span { font-size: 11px; }
    .photo-card div { padding: 9px; }
    .photo-card strong { font-size: 12px; line-height: 1.25; }
    .photo-card .photo-meta { font-size: 11px; }
    .photo-card span { font-size: 11px; line-height: 1.3; }
    .photo-card .photo-people { display: none; }
    .photo-card p { font-size: 11px; line-height: 1.35; }
    .photo-upload-card { grid-template-columns: 82px 1fr; padding: 8px; }
    .photo-upload-card img { align-self: start; }
    .compact-fill-button { font-size: 12px; min-height: 34px; width: 100%; }
    .date-age-line { grid-template-columns: 1fr auto; }
    .date-age-line span { align-self: start; padding-top: 28px; white-space: nowrap; }
    .photo-two-cols { grid-template-columns: 1fr 1fr; }
    .photo-actions-row { grid-template-columns: 1fr 1fr; }
    .photo-actions-row .small-button { min-height: 34px; padding: 0 8px; }
    .photo-viewer { margin: -18px; min-height: calc(100vh - 58px); }
    .photo-nav { font-size: 28px; height: 38px; width: 38px; }
    .photo-nav-prev { left: 8px; }
    .photo-nav-next { right: 8px; }
    .timeline-item { grid-template-columns: 1fr; }
    h1 { font-size: 26px; }
    .bottom-nav { display: none; }
    table, thead, tbody, tr, th, td { display: block; }
    thead { display: none; }
    tr { border-bottom: 1px solid var(--line); padding: 10px 0; }
    td { border: 0; display: grid; gap: 6px; grid-template-columns: 110px 1fr; padding: 7px 0; }
    td::before { color: var(--muted); content: attr(data-label); font-size: 12px; font-weight: 850; text-transform: uppercase; }
    .compact-records-table tr { padding: 7px 0; }
    .compact-records-table td {
        font-size: 12px;
        grid-template-columns: 76px 1fr;
        padding: 5px 0;
    }
    .compact-records-table td:nth-child(4) { max-width: none; }
    .table-actions a,
    .table-actions button {
        font-size: 11px;
        min-height: 26px;
        padding: 0 8px;
    }
    .diary-entry-body {
        gap: 9px;
        grid-template-columns: auto 1fr;
    }
    .diary-thumb { width: 64px; }
    .diary-card { padding: 12px; }
    .diary-card h2 { font-size: 16px; }
    .diary-card p { font-size: 13px; }
    .milestone-filter-panel {
        grid-template-columns: 1fr 1fr;
        padding: 10px;
    }
    .milestone-filter-panel .wide-field {
        grid-column: 1 / -1;
    }
    .milestone-filter-panel button {
        grid-column: 1 / -1;
    }
    .suggestions-head {
        gap: 8px;
    }
    .suggestions-head .button {
        align-self: flex-start;
        font-size: 12px;
        min-height: 32px;
        padding: 0 12px;
        width: auto;
    }
    .suggestions-only-table table,
    .suggestions-only-table tbody { display: block; }
    .suggestions-only-table thead { display: none; }
    .suggestions-only-table tr {
        align-items: center;
        border-bottom: 1px solid #cfd7e5;
        display: grid;
        gap: 5px;
        grid-template-columns: 42px 62px minmax(0, 1fr) 56px;
        min-height: 34px;
        padding: 3px 0;
    }
    .suggestions-only-table td {
        border: 0;
        display: block;
        font-size: 10px;
        min-width: 0;
        padding: 0;
        width: auto !important;
    }
    .suggestions-only-table td::before { display: none; }
    .suggestions-only-table td:nth-child(1),
    .suggestions-only-table td:nth-child(2) {
        color: var(--ink);
        line-height: 1.2;
    }
    .type-category-cell .type-label,
    .type-category-cell .category-label {
        display: block;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .type-category-cell .type-label::after { content: ""; }
    .type-category-cell .category-label {
        color: var(--muted);
        font-size: 9px;
        margin-top: 1px;
    }
    .suggestions-only-table td:nth-child(3) {
        min-width: 0;
    }
    .suggestions-only-table td:nth-child(3) strong {
        display: block;
        font-size: 10px;
        line-height: 1.2;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .suggestions-only-table td:nth-child(3) span {
        display: block;
        font-size: 9px;
        line-height: 1.2;
        margin-top: 1px;
        max-height: 11px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    .suggestions-only-table td:nth-child(4) {
        text-align: right;
    }
    .suggestion-register-button {
        border-radius: 4px;
        font-size: 9px;
        min-width: 0;
        padding: 3px 5px;
    }
    .suggestion-done,
    .muted-mini,
    .inline-delete-form { display: none; }
    .vaccine-table tr.vaccine-row {
        border-bottom: 3px solid #b8c2d3;
        display: grid;
        gap: 0;
        grid-template-columns: 1fr 1fr;
        padding: 8px 0 12px;
    }
    .vaccine-table tr.vaccine-row td {
        align-items: start;
        border: 0;
        display: grid;
        gap: 5px;
        grid-template-columns: 96px minmax(0, 1fr);
        padding: 5px 0;
    }
    .vaccine-table tr.vaccine-row td:nth-child(1),
    .vaccine-table tr.vaccine-row td:nth-child(2),
    .vaccine-table tr.vaccine-row td:nth-child(5),
    .vaccine-table tr.vaccine-row td:nth-child(6) { grid-column: span 1; }
    .vaccine-table tr.vaccine-row td:nth-child(3),
    .vaccine-table tr.vaccine-row td:nth-child(4) { grid-column: 1 / -1; }
    .vaccine-table tr.vaccine-row td::before {
        font-size: 11px;
        line-height: 1.2;
    }
    .vaccine-status {
        justify-content: center;
        min-width: 0;
        width: 100%;
    }
    .vaccine-table tr.vaccine-row td:nth-child(6) {
        grid-template-columns: 58px minmax(0, 1fr);
        padding-left: 8px;
    }
    .vaccine-table tr.vaccine-row td:nth-child(5) {
        padding-right: 8px;
    }
    .vaccine-table tr.vaccine-row td:nth-child(5)::before,
    .vaccine-table tr.vaccine-row td:nth-child(6)::before {
        align-self: center;
    }
    .vaccine-table tr.vaccine-row td:nth-child(6) .compact-action-button {
        justify-self: start;
    }
    .vaccine-table tr.vaccine-row td[data-label="Vacina"] span,
    .vaccine-table tr.vaccine-row td[data-label="Protege contra"] small {
        grid-column: 1 / -1;
        padding-left: 0;
    }
    body[data-vaccine-view-mode="compact"] .vaccine-table tr.vaccine-row td:nth-child(5),
    body[data-vaccine-view-mode="compact"] .vaccine-table tr.vaccine-row td:nth-child(6) {
        grid-column: span 1;
    }
    .vaccine-history-table tr.vaccine-history-row td:nth-child(1),
    .vaccine-history-table tr.vaccine-history-row td:nth-child(2),
    .vaccine-history-table tr.vaccine-history-row td:nth-child(4),
    .vaccine-history-table tr.vaccine-history-row td:nth-child(6) {
        grid-column: span 1;
    }
    .vaccine-history-table tr.vaccine-history-row td:nth-child(3),
    .vaccine-history-table tr.vaccine-history-row td:nth-child(5) {
        grid-column: 1 / -1;
    }
    .vaccine-history-table tr.vaccine-history-row td:nth-child(6) {
        grid-template-columns: 58px minmax(0, 1fr);
        padding-left: 8px;
    }
    .vaccine-history-table tr.vaccine-history-row td:nth-child(6)::before {
        align-self: center;
    }
}

@media (max-width: 900px) and (orientation: landscape) {
    .shell { padding: 14px; }
    .gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .folder-card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .mobile-topbar { position: sticky; }
    .sidebar nav { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Caderneta de vacinas: cartões compactos, sem a grade de rótulos do desktop. */
@media (max-width: 900px) {
    .vaccine-toolbar { align-items: flex-start; }
    .vaccine-filter-panel {
        grid-template-columns: minmax(0, 1fr) 118px auto;
        gap: 6px;
    }
    .vaccine-view-mode-control { min-height: 32px; }
    .vaccine-view-mode-button { height: 24px; width: 27px; }
    .vaccine-card .responsive-table { overflow: visible; }
    .vaccine-card .vaccine-table { border-collapse: separate; border-spacing: 0; width: 100%; }
    .vaccine-card .vaccine-table thead { display: none; }
    .vaccine-card .vaccine-table tbody { display: block; }
    .vaccine-card .vaccine-table tr.vaccine-row {
        background: transparent;
        border: 0;
        border-bottom: 1px solid #e3ebef;
        display: grid;
        gap: 6px 9px;
        grid-template-areas:
            "vaccine status"
            "timing actions"
            "protection protection";
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 13px 4px;
    }
    .vaccine-card .vaccine-table tr.vaccine-row:first-child { padding-top: 4px; }
    .vaccine-card .vaccine-table tr.vaccine-row:last-child { border-bottom: 0; padding-bottom: 4px; }
    .vaccine-card .vaccine-table tr.vaccine-row td {
        align-items: center;
        background: transparent;
        border: 0;
        display: block;
        min-width: 0;
        padding: 0;
    }
    .vaccine-card .vaccine-table tr.vaccine-row td::before { content: none; display: none; }
    .vaccine-card .vaccine-table tr.vaccine-row td.vaccine-row-timing { grid-area: timing; }
    .vaccine-card .vaccine-table tr.vaccine-row td[data-label="Vacina"] { grid-area: vaccine; }
    .vaccine-card .vaccine-table tr.vaccine-row td[data-label="Protege contra"] { grid-area: protection; }
    .vaccine-card .vaccine-table tr.vaccine-row td[data-label="Status"] { grid-area: status; justify-self: end; }
    .vaccine-card .vaccine-table tr.vaccine-row td.vaccine-row-actions { grid-area: actions; justify-self: end; }
    .vaccine-card .vaccine-table td[data-label="Vacina"] strong { color: #083b73; font-size: 14px; line-height: 1.2; }
    .vaccine-card .vaccine-table td[data-label="Vacina"] span:not(.vaccine-status) { font-size: 10px; line-height: 1.2; margin-top: 3px; }
    .vaccine-card .vaccine-table td[data-label="Protege contra"] { color: var(--muted); font-size: 11px; line-height: 1.3; }
    .vaccine-card .vaccine-table td[data-label="Protege contra"] small { font-size: 10px; margin-top: 2px; }
    .vaccine-card .vaccine-row-timing { align-items: center; display: flex !important; gap: 7px; min-height: 30px; }
    .vaccine-card .vaccine-row-timing .vaccine-row-age,
    .vaccine-card .vaccine-row-timing .vaccine-row-due {
        background: #f2f7f8;
        border-radius: 999px;
        color: #58717a;
        display: inline-flex;
        font-size: 10px;
        font-weight: 850;
        line-height: 1;
        margin: 0;
        padding: 5px 7px;
    }
    .vaccine-card .vaccine-row-timing .vaccine-row-age { background: #e7f7f1; color: #087765; }
    .vaccine-card .vaccine-status { font-size: 10px; min-width: 0; padding: 5px 7px; width: auto; }
    .vaccine-card .vaccine-row-edit.icon-action { height: 28px; width: 28px; }
    .vaccine-card .vaccine-row-edit.icon-action .mini-svg { display: block; height: 13px; width: 13px; }
    .vaccine-card .vaccine-row.is-actionable:hover { background: #f7fcfb; }
    body[data-vaccine-view-mode="compact"] .vaccine-card .vaccine-table tr.vaccine-row {
        grid-template-areas:
            "vaccine status"
            "timing actions";
    }
    body[data-vaccine-view-mode="compact"] .vaccine-card .vaccine-table td[data-label="Protege contra"] { display: none; }
}

/* Visual refresh: Prontuario Infantil */
:root {
    --bg: #f6f9fd;
    --panel: rgba(255, 255, 255, .94);
    --ink: #111a3b;
    --muted: #65708a;
    --line: #e5ecf5;
    --primary: #0f9a8f;
    --primary-dark: #08756d;
    --accent: #ffb84d;
    --good: #15916f;
    --bad: #de3b45;
    --blue: #4ea4f6;
    --rose: #ff6f8f;
    --lilac: #8b78f6;
    --shadow: 0 18px 42px rgba(38, 52, 92, .08);
    --soft-shadow: 0 10px 26px rgba(38, 52, 92, .07);
}

html { background: var(--bg); }
body { background: linear-gradient(180deg, #f8fbff 0%, #f2f7fc 100%); color: var(--ink); }
button, .button { border-radius: 12px; box-shadow: 0 8px 18px rgba(15, 154, 143, .16); min-height: 42px; }
.ghost { background: #f1f7f7; box-shadow: none; }
.small-button, .compact-action-button, .suggestion-register-button { border-radius: 10px; }

.sidebar {
    border-right: 0;
    box-shadow: 14px 0 38px rgba(34, 53, 84, .05);
    gap: 14px;
    overflow: hidden;
    padding: 26px 18px;
    width: 250px;
}
.brand { color: var(--ink); font-size: 17px; font-weight: 900; line-height: 1.1; }
.brand-logo { border-radius: 14px; height: 42px; width: 42px; }
.brand-mark { display: none; }
.sidebar-head { margin-bottom: 18px; }
.sidebar-collapse-toggle { background: #f4f8fb; box-shadow: none; color: #50617e; }
.app-nav { gap: 5px; position: relative; z-index: 2; }
.sidebar nav a {
    align-items: center;
    border-radius: 14px;
    color: #273657;
    display: flex;
    gap: 12px;
    min-height: 42px;
    padding: 10px 12px;
}
.sidebar nav a::before {
    align-items: center;
    border: 1px solid #dbe7f2;
    border-radius: 10px;
    color: #405679;
    content: "";
    display: inline-flex;
    flex: 0 0 25px;
    font-size: 13px;
    height: 25px;
    justify-content: center;
    width: 25px;
}
.sidebar nav a[data-nav-icon="home"]::before { content: "H"; }
.sidebar nav a[data-nav-icon="summary"]::before { content: "R"; }
.sidebar nav a[data-nav-icon="health"]::before { content: "+"; }
.sidebar nav a[data-nav-icon="growth"]::before { content: "^"; }
.sidebar nav a[data-nav-icon="vaccine"]::before { content: "V"; }
.sidebar nav a[data-nav-icon="milestone"]::before { content: "*"; }
.sidebar nav a[data-nav-icon="diary"]::before { content: "D"; }
.sidebar nav a[data-nav-icon="photo"]::before { content: "F"; }
.sidebar nav a[data-nav-icon="document"]::before { content: "A"; }
.sidebar nav a[data-nav-icon="child"]::before { content: "C"; }
.sidebar nav a[data-nav-icon="doctor"]::before { content: "M"; }
.sidebar nav a[data-nav-icon="access"]::before { content: "S"; }
.sidebar nav a[data-nav-icon="profile"]::before { content: "P"; }
.sidebar nav a[data-nav-icon="admin"]::before { content: "G"; }
.sidebar nav a:hover, .sidebar nav a.is-active { background: #dff6ef; color: #08756d; }
.sidebar nav a.is-active::before { background: #c7f0e4; border-color: #c7f0e4; color: #08756d; }
.sidebar-user {
    align-items: center;
    border-top: 1px solid var(--line);
    display: flex;
    gap: 10px;
    margin-top: auto;
    padding-top: 14px;
    position: relative;
    z-index: 2;
}
.sidebar-user strong, .sidebar-user small { display: block; line-height: 1.2; }
.sidebar-user small { color: var(--muted); font-size: 12px; }
.sidebar-garden { bottom: -4px; left: 0; pointer-events: none; position: absolute; width: 100%; z-index: 0; }
.sidebar form { position: relative; z-index: 2; }

.shell {
    container-type: inline-size;
    margin-left: 250px;
    max-width: 1280px;
    padding: 26px 34px 54px;
}
.app-topline { align-items: center; display: flex; justify-content: flex-end; margin-bottom: 14px; }
.topline-actions { align-items: center; display: flex; gap: 14px; }
.notification-bell {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
    height: 42px;
    position: relative;
    width: 42px;
}
.notification-bell::before { color: #23314f; content: "!"; font-weight: 900; left: 17px; position: absolute; top: 9px; }
.notification-bell::after {
    background: #f03e55;
    border: 2px solid #fff;
    border-radius: 999px;
    color: #fff;
    content: "3";
    font-size: 10px;
    font-weight: 900;
    height: 18px;
    line-height: 15px;
    position: absolute;
    right: -4px;
    text-align: center;
    top: -5px;
    width: 18px;
}
.top-child-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 16px;
    box-shadow: var(--soft-shadow);
    color: var(--ink);
    display: flex;
    gap: 10px;
    min-width: 180px;
    padding: 10px 14px;
}
.top-child-card strong, .top-child-card small { display: block; line-height: 1.2; }
.top-child-card small { color: var(--muted); font-size: 12px; }
.avatar {
    align-items: center;
    background: linear-gradient(180deg, #dff6ef 0%, #b8e9df 100%);
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 7px 18px rgba(15, 154, 143, .18);
    color: #08756d;
    display: inline-flex;
    flex: 0 0 46px;
    font-weight: 900;
    height: 46px;
    justify-content: center;
    width: 46px;
}
.avatar.small { flex-basis: 38px; height: 38px; width: 38px; }
.avatar.mini { border-width: 2px; flex-basis: 28px; height: 28px; width: 28px; }
.avatar.xl { flex-basis: 104px; font-size: 38px; height: 104px; width: 104px; }

.auth-card, .panel, .table-card, .timeline { border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); }
.page-head { margin-bottom: 18px; }
.page-head h1 { color: var(--ink); font-size: 30px; font-weight: 900; }
.page-head p { color: #697690; font-size: 15px; }
.dashboard-head { align-items: center; }
.soft-select select, .child-switcher select { background: #fff; border-radius: 14px; box-shadow: var(--soft-shadow); min-width: 190px; }

.hero-child-card {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(280px, .9fr) 1.4fr;
    margin-bottom: 22px;
    padding: 22px;
}
.hero-child-main, .hero-child-facts { align-items: center; display: flex; gap: 18px; }
.hero-child-main h2 { font-size: 24px; margin-bottom: 4px; }
.hero-child-main p { margin: 0 0 10px; }
.active-dot { color: #15916f; font-size: 13px; font-weight: 800; }
.active-dot::before { background: #29c48d; border-radius: 999px; content: ""; display: inline-block; height: 8px; margin-right: 6px; width: 8px; }
.hero-child-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.hero-child-facts > div { background: #f8fbfd; border-radius: 16px; padding: 16px; }
.hero-child-facts span, .metric span { color: var(--muted); font-size: 12px; font-weight: 850; }
.hero-child-facts strong { display: block; margin-top: 5px; }
.next-card { background: #fff6df !important; }
.next-card small { color: var(--muted); display: block; margin-top: 4px; }

.metric-grid { gap: 16px; }
.metric {
    border: 1px solid transparent;
    border-radius: 18px;
    box-shadow: var(--soft-shadow);
    color: var(--ink);
    min-height: 112px;
    padding: 18px;
}
.metric strong { font-size: 28px; }
.metric small { color: var(--muted); display: block; min-height: 16px; }
.tone-mint { background: #eaf9f3; }
.tone-lilac { background: #f1edff; }
.tone-rose { background: #fff0f3; }
.tone-sky { background: #eaf6ff; }

.dashboard-grid { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.35fr) minmax(320px, .8fr); margin-bottom: 16px; }
.dashboard-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.section-head-inline { align-items: flex-start; gap: 12px; }
.section-head-inline h2 { font-size: 18px; }
.growth-snapshot {
    align-items: center;
    background: linear-gradient(180deg, #f7fcfb 0%, #eefaf6 100%);
    border: 1px solid #d8f0e8;
    border-radius: 16px;
    display: flex;
    gap: 18px;
    min-height: 150px;
    padding: 22px;
}
.growth-snapshot strong { font-size: 38px; }
.growth-snapshot span { color: var(--primary); font-size: 22px; font-weight: 900; }
.growth-snapshot small { color: var(--muted); }
.soft-list { display: grid; gap: 8px; }
.soft-list-item {
    background: #fbfdff;
    border: 1px solid var(--line);
    border-radius: 14px;
    color: var(--ink);
    display: grid;
    gap: 4px;
    padding: 13px 14px;
}
.soft-list-item time { color: var(--primary); font-size: 12px; font-weight: 900; }
.soft-list-item span { color: var(--muted); font-size: 13px; }
.dashboard-photo-grid { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.dashboard-photo-grid a, .dashboard-photo-grid img { aspect-ratio: 1; border-radius: 14px; display: block; overflow: hidden; width: 100%; }
.dashboard-photo-grid img { object-fit: cover; }
.dashboard-routine-grid { margin-top: 0; }
.dashboard-routine-card { padding: 16px; }
.dashboard-routine-head { align-items: flex-start; display: flex; gap: 10px; justify-content: space-between; }
.dashboard-routine-head h2 { color: #093e73; font-size: 17px; margin: 0 0 4px; }
.dashboard-routine-head p { color: #667c92; font-size: 11px; line-height: 1.45; margin: 0; max-width: 210px; }
.dashboard-routine-actions { display: flex; flex: 0 0 auto; gap: 6px; }
.dashboard-routine-actions a { align-items: center; background: #eef9f7; border: 1px solid #d5eee9; border-radius: 10px; color: #087b6d; display: inline-flex; font-size: 10px; font-weight: 850; gap: 4px; min-height: 32px; padding: 0 8px; text-decoration: none; }
.dashboard-routine-actions a:hover, .dashboard-routine-actions a:focus-visible { background: #ddf5ef; color: #05665b; outline: 0; }
.dashboard-routine-actions span { font-size: 15px; line-height: 1; }
.dashboard-routine-preview { border-top: 1px solid #e1eaee; margin-top: 12px; padding-top: 7px; }
.dashboard-routine-day + .dashboard-routine-day { margin-top: 8px; }
.dashboard-routine-day > time { color: #087b6d; display: block; font-size: 11px; font-weight: 900; margin: 0 0 2px; }
.dashboard-routine-day p { border-bottom: 1px solid #e2ebef; color: #667b8f; font-size: 10px; line-height: 1.45; margin: 0; overflow-wrap: anywhere; padding: 4px 0; }
.dashboard-routine-day p:last-child { border-bottom: 0; }
.dashboard-routine-day p > span { color: #506f88; }
.dashboard-routine-day p strong { color: #123d68; font-weight: 850; }
.dashboard-routine-day p em { color: #667b8f; font-style: normal; }
.dashboard-routine-day p small { color: #718197; font-size: inherit; }

input, select, textarea { border-color: #d8e2ef; border-radius: 12px; }
.grid-form { gap: 12px; }
th { color: #65708a; font-size: 12px; }
td { color: #172033; }
tr:hover td { background: #fbfdff; }
.vaccine-table tr.status-done td, .status-done, .vaccine-status.done { background-color: #effcf5; }
.vaccine-table tr.status-overdue td, .status-overdue, .vaccine-status.overdue { background-color: #fff5f5; }
.vaccine-table tr.status-soon td, .status-soon, .vaccine-status.soon { background-color: #eef6ff; }
.vaccine-table tr.status-future td, .status-future, .vaccine-status.future { background-color: #f6f8fb; }
.vaccine-status, .tag, .template-status { border-radius: 999px; }
.timeline { margin-top: 16px; }
.timeline-item { border-left: 0; grid-template-columns: 108px 1fr; }
.timeline-item time { background: #e9faf5; border-radius: 14px; color: var(--primary-dark); padding: 10px; text-align: center; }

body.sidebar-collapsed .sidebar { width: 82px; }
body.sidebar-collapsed .shell { margin-left: 82px; }
body.sidebar-collapsed .sidebar nav a { display: flex; justify-content: center; padding: 10px; }
body.sidebar-collapsed .sidebar nav a::before { margin: 0; }
body.sidebar-collapsed .sidebar-user, body.sidebar-collapsed .sidebar-garden { display: none; }

@media (max-width: 1100px) {
    .dashboard-grid, .dashboard-grid.three, .hero-child-card { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
    body { background: #f3f7fb; }
    .mobile-topbar {
        border-bottom: 1px solid #e8eef6;
        box-shadow: 0 8px 22px rgba(31, 48, 80, .06);
        min-height: 66px;
        padding: 11px 18px;
    }
    .mobile-menu-icon { background: transparent; box-shadow: none; min-height: 36px; padding: 0; position: relative; width: 36px; }
    .mobile-menu-icon::before { color: var(--primary); content: "="; font-size: 28px; font-weight: 900; }
    .mobile-topbar .brand { font-size: 15px; gap: 8px; }
    .mobile-topbar .brand-logo { height: 36px; width: 36px; }
    .mobile-child-pill {
        align-items: center;
        border: 1px solid var(--line);
        border-radius: 14px;
        color: var(--ink);
        display: flex;
        font-size: 12px;
        font-weight: 850;
        gap: 6px;
        padding: 5px 8px;
    }
    .sidebar { border-radius: 0 0 22px 22px; box-shadow: 0 18px 40px rgba(31, 48, 80, .14); top: 66px; }
    .sidebar nav { grid-template-columns: 1fr 1fr; }
    .sidebar nav a { min-height: 38px; padding: 8px 10px; }
    .sidebar-user, .sidebar-garden { display: none; }
    .shell { padding: 18px 14px 86px; }
    .app-topline { display: none; }
    .page-head { align-items: center; flex-direction: row; gap: 10px; margin-bottom: 14px; }
    .page-head h1 { font-size: 22px; line-height: 1.12; }
    .page-head p { font-size: 12px; line-height: 1.25; }
    .page-head .button, .inline-actions .button { font-size: 12px; min-height: 36px; padding: 0 11px; white-space: nowrap; }
    .dashboard-head { align-items: stretch; flex-direction: column; }
    .hero-child-card { border-radius: 18px; padding: 16px; }
    .hero-child-main { gap: 12px; }
    .avatar.xl { flex-basis: 74px; font-size: 28px; height: 74px; width: 74px; }
    .hero-child-main h2 { font-size: 20px; }
    .hero-child-facts { gap: 8px; grid-template-columns: 1fr 1fr; }
    .hero-child-facts > div { padding: 12px; }
    .hero-child-facts .next-card { grid-column: 1 / -1; }
    .metric-grid.dashboard-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .metric { min-height: 92px; padding: 14px; }
    .metric strong { font-size: 24px; }
    .dashboard-grid, .dashboard-grid.three { grid-template-columns: 1fr; }
    .panel, .table-card, .timeline { border-radius: 16px; padding: 16px; }
    .child-danger-zone { align-items: stretch; grid-template-columns: 1fr; }
    .child-delete-form { grid-template-columns: 1fr auto; }
    .growth-snapshot { min-height: 112px; padding: 16px; }
    .growth-snapshot strong { font-size: 28px; }
    .bottom-nav {
        background: rgba(255, 255, 255, .96);
        border: 1px solid var(--line);
        border-radius: 22px 22px 0 0;
        box-shadow: 0 -12px 30px rgba(31, 48, 80, .08);
        display: grid;
        grid-template-columns: repeat(5, 1fr);
        left: 0;
        padding: 8px 10px 10px;
        position: fixed;
        right: 0;
    }
    .bottom-nav a { border-radius: 14px; color: #53617d; font-size: 11px; font-weight: 800; padding: 8px 4px; text-align: center; }
    .bottom-nav a.is-active { background: #e7f8f4; color: var(--primary-dark); }
    table, thead, tbody, tr, th, td { display: block; }
    tr { border-bottom: 2px solid #d5deea; padding: 8px 0; }
    td { grid-template-columns: 92px 1fr; padding: 5px 0; }
    td::before { color: #65708a; font-size: 11px; }
}

/* Vacinas: a versão final prevalece sobre as camadas de tema anteriores. */
@media (max-width: 900px) {
    .vaccine-toolbar { align-items: flex-start; }
    .vaccine-filter-panel {
        gap: 6px;
        grid-template-columns: minmax(0, 190px) 78px 92px;
        justify-content: start;
    }
    .vaccine-view-mode-control { gap: 4px; min-height: 42px; padding: 4px; }
    .vaccine-view-mode-button { height: 32px; width: 40px; }
    .vaccine-view-mode-icon { height: 18px; width: 18px; }
    .vaccine-card .responsive-table { overflow: visible; }
    .vaccine-card .vaccine-table { border-collapse: separate; border-spacing: 0; width: 100%; }
    .vaccine-card .vaccine-table thead { display: none; }
    .vaccine-card .vaccine-table tbody { display: block; }
    .vaccine-card .vaccine-table tr.vaccine-row {
        background: transparent;
        border: 0;
        border-bottom: 1px solid #e3ebef;
        display: grid;
        gap: 6px 9px;
        grid-template-areas:
            "vaccine timing"
            "vaccine status";
        grid-template-columns: minmax(0, 1fr) auto;
        padding: 13px 4px;
    }
    .vaccine-card .vaccine-table tr.vaccine-row:first-child { padding-top: 4px; }
    .vaccine-card .vaccine-table tr.vaccine-row:last-child { border-bottom: 0; padding-bottom: 4px; }
    .vaccine-card .vaccine-table tr.vaccine-row td {
        align-items: center;
        background: transparent;
        border: 0;
        display: block;
        min-width: 0;
        padding: 0;
    }
    .vaccine-card .vaccine-table tr.vaccine-row td::before { content: none; display: none; }
    .vaccine-card .vaccine-table tr.vaccine-row td.vaccine-row-timing { grid-area: timing; justify-self: end; }
    .vaccine-card .vaccine-table tr.vaccine-row td[data-label="Vacina"] {
        align-items: flex-start;
        align-self: stretch;
        display: flex;
        flex-direction: column;
        grid-area: vaccine;
        gap: 2px;
        justify-content: flex-start;
        text-align: left;
    }
    .vaccine-card .vaccine-table tr.vaccine-row td[data-label="Status"] { grid-area: status; justify-self: end; }
    .vaccine-card .vaccine-table td[data-label="Vacina"] strong { color: #083b73; font-size: 14px; line-height: 1.2; }
    .vaccine-card .vaccine-table td[data-label="Vacina"] span:not(.vaccine-status) { font-size: 10px; line-height: 1.2; margin-top: 3px; }
    .vaccine-card .vaccine-row-protection { color: var(--muted); font-size: 10px; line-height: 1.25; margin-top: 1px; text-align: left; }
    .vaccine-card .vaccine-row-timing { align-items: center; display: flex !important; gap: 7px; min-height: 30px; }
    .vaccine-card .vaccine-row-timing .vaccine-row-age,
    .vaccine-card .vaccine-row-timing .vaccine-row-due {
        background: #f2f7f8;
        border-radius: 999px;
        color: #58717a;
        display: inline-flex;
        font-size: 10px;
        font-weight: 850;
        line-height: 1;
        margin: 0;
        padding: 5px 7px;
    }
    .vaccine-card .vaccine-row-timing .vaccine-row-age { background: #f2f7f8; color: #58717a; }
    .vaccine-card .vaccine-status { font-size: 10px; min-width: 0; padding: 5px 7px; width: auto; }
    .vaccine-card .vaccine-row-edit.icon-action { height: 28px; width: 28px; }
    .vaccine-card .vaccine-row-edit.icon-action .mini-svg { display: block; height: 13px; width: 13px; }
    .vaccine-card .vaccine-row.is-actionable:hover { background: #f7fcfb; }
    body[data-vaccine-view-mode="compact"] .vaccine-card .vaccine-table tr.vaccine-row {
        grid-template-areas:
            "vaccine timing"
            "vaccine status";
    }
    body[data-vaccine-view-mode="compact"] .vaccine-card .vaccine-table td[data-label="Vacina"] span:not(.vaccine-status) { display: block; }
    body[data-vaccine-view-mode="compact"] .vaccine-card .vaccine-row-protection { display: none; }
}

/* Cadastro de crianças: lista sem cabeçalho técnico e com leitura direta no celular. */
.child-records-card { padding: 12px 16px; }
.child-record-list { display: grid; }
.child-record-item { border-bottom: 1px solid #e3ebef; }
.child-record-item:last-child { border-bottom: 0; }
.child-record-link {
    color: inherit;
    display: grid;
    gap: 7px;
    padding: 15px 4px;
    text-decoration: none;
}
.child-record-item.is-actionable .child-record-link { cursor: pointer; }
.child-record-item.is-actionable .child-record-link:hover { background: #f7fcfb; }
.child-record-item.is-actionable .child-record-link:focus-visible { border-radius: 10px; outline: 2px solid var(--primary); outline-offset: 2px; }
.child-record-primary { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.child-record-primary strong { color: #083b73; font-size: 15px; line-height: 1.2; }
.child-record-meta,
.child-record-tags { align-items: center; display: flex; flex-wrap: wrap; gap: 6px 10px; }
.child-record-meta { color: #627088; font-size: 11px; font-weight: 750; }
.child-record-meta span + span::before { color: #b7c3cf; content: "•"; margin-right: 10px; }
.child-record-tags span {
    background: #f2f7f8;
    border-radius: 999px;
    color: #526b76;
    font-size: 10px;
    font-weight: 850;
    line-height: 1;
    padding: 6px 8px;
}
.child-record-edit {
    align-items: center;
    background: #f5fbfa;
    border: 1px solid #dcefeb;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    flex: 0 0 auto;
    height: 28px;
    justify-content: center;
    width: 28px;
}
.child-record-edit .mini-svg { display: block; height: 13px; width: 13px; }

@media (max-width: 900px) {
    .child-records-card { padding: 10px 14px; }
    .child-record-link { gap: 6px; padding: 13px 2px; }
    .child-record-primary strong { font-size: 14px; }
}

/* Cadastro de médicos: resumo direto dos atendimentos por profissional. */
.doctor-records-card { padding: 12px 16px; }
.doctor-record-list { display: grid; }
.doctor-record {
    border-bottom: 1px solid #e3ebef;
    display: grid;
    gap: 8px;
    padding: 15px 4px;
}
.doctor-record:last-child { border-bottom: 0; }
.doctor-record.is-actionable { cursor: pointer; }
.doctor-record.is-actionable:hover { background: #f7fcfb; }
.doctor-record.is-actionable:focus-visible { border-radius: 10px; outline: 2px solid var(--primary); outline-offset: 2px; }
.doctor-record-primary { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.doctor-record-primary > strong { color: #083b73; font-size: 15px; line-height: 1.2; min-width: 0; }
.doctor-record-actions { align-items: center; display: inline-flex; flex: 0 0 auto; gap: 8px; }
.doctor-consultations-link { color: var(--primary-dark); font-size: 11px; font-weight: 850; text-decoration: none; white-space: nowrap; }
.doctor-consultations-link:hover { text-decoration: underline; }
.doctor-consultations-link:focus-visible { border-radius: 5px; outline: 2px solid var(--primary); outline-offset: 2px; }
.doctor-record-edit {
    align-items: center;
    background: #f5fbfa;
    border: 1px solid #dcefeb;
    border-radius: 999px;
    color: var(--primary-dark);
    display: inline-flex;
    height: 28px;
    justify-content: center;
    text-decoration: none;
    width: 28px;
}
.doctor-record-edit .mini-svg { display: block; height: 13px; width: 13px; }
.doctor-record-meta { color: #627088; display: flex; flex-wrap: wrap; font-size: 11px; font-weight: 750; gap: 5px 10px; }
.doctor-record-meta span + span::before { color: #b7c3cf; content: "•"; margin-right: 10px; }

@media (max-width: 900px) {
    .doctor-records-card { padding: 10px 14px; }
    .doctor-record { gap: 7px; padding: 13px 2px; }
    .doctor-record-primary > strong { font-size: 14px; }
    .doctor-consultations-link { font-size: 10px; }
}

/* Caderneta de saúde: linha do tempo compacta, sem reproduzir a caderneta física. */
.booklet-page-head { align-items: end; }
.booklet-kicker { color: var(--primary-dark); display: block; font-size: 11px; font-weight: 850; letter-spacing: .05em; text-transform: uppercase; }
.booklet-page-head h1 { margin-top: 3px; }
.booklet-quick-add { white-space: nowrap; }
.booklet-section-nav { background: rgba(255,255,255,.86); border: 1px solid #dce9ee; border-radius: 16px; display: flex; gap: 8px; margin-bottom: 16px; overflow-x: auto; padding: 7px; scrollbar-width: none; }
.booklet-section-nav::-webkit-scrollbar { display: none; }
.booklet-section-nav a { border-radius: 10px; color: #53677d; flex: 0 0 auto; font-size: 12px; font-weight: 800; padding: 8px 12px; text-decoration: none; }
.booklet-section-nav a:hover, .booklet-section-nav a:focus-visible { background: #e8f8f5; color: var(--primary-dark); outline: 0; }
.booklet-overview { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-bottom: 16px; }
.booklet-overview-card { align-items: center; background: linear-gradient(145deg, #fff, #f6fbfc); border: 1px solid #dce9ee; border-radius: 18px; color: #52677b; display: grid; gap: 3px 10px; grid-template-columns: auto 1fr; min-width: 0; padding: 14px; text-decoration: none; }
.booklet-overview-card:hover { border-color: #b8ded7; box-shadow: 0 8px 20px rgba(24,92,104,.08); transform: translateY(-1px); }
.booklet-overview-icon { color: var(--primary); grid-row: span 2; height: 24px; width: 24px; }
.booklet-overview-card span { font-size: 11px; font-weight: 750; }
.booklet-overview-card strong { color: #073d74; font-size: 22px; line-height: 1; }
.booklet-panel { background: #fff; border: 1px solid #dbe7ed; border-radius: 20px; box-shadow: 0 10px 28px rgba(21,74,93,.05); margin-bottom: 16px; padding: 20px; scroll-margin-top: 16px; }
.booklet-panel-heading { align-items: flex-start; display: flex; gap: 16px; justify-content: space-between; margin-bottom: 16px; }
.booklet-panel-heading h2 { color: #073d74; font-size: 20px; margin: 3px 0 4px; }
.booklet-panel-heading p { color: #61738a; font-size: 13px; margin: 0; }
.booklet-section-index { color: var(--primary-dark); font-size: 10px; font-weight: 900; letter-spacing: .08em; }
.booklet-action-button, .booklet-record-actions .icon-button, .booklet-subsection-with-action > .icon-button { align-items: center; background: #f1faf8; border: 1px solid #d8eeea; border-radius: 999px; color: var(--primary-dark); display: inline-flex; height: 32px; justify-content: center; padding: 0; width: 32px; }
.booklet-action-button svg, .booklet-record-actions svg, .booklet-subsection-with-action > .icon-button svg { height: 14px; width: 14px; }
.booklet-inline-button { font-size: 12px; padding: 9px 13px; white-space: nowrap; }
.booklet-fact-grid { border-top: 1px solid #e4edf1; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); padding-top: 14px; }
.booklet-fact-grid div { background: #f7fbfc; border-radius: 12px; min-width: 0; padding: 10px; }
.booklet-fact-grid span, .booklet-fact-grid strong { display: block; }
.booklet-fact-grid span { color: #708196; font-size: 10px; font-weight: 750; margin-bottom: 4px; }
.booklet-fact-grid strong { color: #123d68; font-size: 12px; overflow-wrap: anywhere; }
.booklet-empty-copy { color: #718198; font-size: 13px; margin: 12px 0 0; }
.booklet-subsection-heading { align-items: end; border-top: 1px solid #e4edf1; display: flex; gap: 12px; justify-content: space-between; margin-top: 18px; padding-top: 16px; }
.booklet-subsection-heading h3 { color: #0a3d74; font-size: 15px; margin: 0 0 3px; }
.booklet-subsection-heading span { color: #728197; font-size: 11px; }
.booklet-subsection-title { align-items: center; color: inherit !important; display: inline-flex; font-size: inherit !important; gap: 5px; }
.booklet-subsection-heading .booklet-help-popover { color: #fff; font-size: 11px; }
.booklet-screening-grid { display: grid; gap: 9px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.booklet-screening-card { align-items: center; background: #f9fcfd; border: 1px solid #e0ebef; border-radius: 13px; display: flex; gap: 8px; justify-content: space-between; min-width: 0; padding: 11px; }
.booklet-screening-card div { display: grid; gap: 2px; min-width: 0; }
.booklet-screening-card strong { color: #123d68; font-size: 12px; }
.booklet-screening-card span, .booklet-screening-card small { color: #687a90; font-size: 10px; font-weight: 700; }
.booklet-stage-track { display: flex; gap: 6px; margin: 0 -2px 15px; overflow-x: auto; padding: 2px; scrollbar-width: none; }
.booklet-stage-track::-webkit-scrollbar { display: none; }
.booklet-stage-track span, .booklet-stage-link { background: #f2f6f8; border: 1px solid #e2eaee; border-radius: 999px; color: #77869a; flex: 0 0 auto; font-size: 10px; font-weight: 800; padding: 7px 9px; }
.booklet-stage-link { box-shadow: none; min-height: 0; transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease; }
.booklet-stage-link:hover, .booklet-stage-link:focus-visible { background: #fff; border-color: #81c9c0; color: #087b6d; outline: 0; transform: translateY(-1px); }
.booklet-stage-track span.is-done, .booklet-stage-link.is-done { background: #e7f8f4; border-color: #bceade; color: #087b6d; }
.booklet-stage-link.is-done:hover, .booklet-stage-link.is-done:focus-visible { background: #d7f3ec; border-color: #73c9ba; }
.booklet-record-list { display: grid; }
.booklet-record-row { align-items: flex-start; border-bottom: 1px solid #e2ebef; display: grid; gap: 12px; grid-template-columns: 118px minmax(0, 1fr) auto; padding: 13px 4px; }
.booklet-record-row:last-child { border-bottom: 0; }
.booklet-record-date { display: grid; gap: 3px; }
.booklet-record-date strong { color: #0a3d74; font-size: 12px; }
.booklet-record-date span { color: var(--primary-dark); font-size: 10px; font-weight: 800; }
.booklet-record-content > strong { color: #163f69; display: block; font-size: 12px; margin-bottom: 5px; }
.booklet-record-content p { color: #63758a; font-size: 12px; margin: 7px 0 0; white-space: pre-wrap; }
.booklet-tag-row { align-items: center; display: flex; flex-wrap: wrap; gap: 5px; }
.booklet-tag-row span, .booklet-tag-row a { background: #f2f7f8; border-radius: 999px; color: #536e7d; font-size: 10px; font-weight: 750; padding: 5px 7px; text-decoration: none; }
.booklet-tag-row a { background: #edf8fb; color: #196d86; }
.booklet-record-actions { align-items: center; display: flex; gap: 6px; }
.booklet-delete-form { margin: 0; }
.booklet-delete-button { background: #fff6f6 !important; border-color: #ffe0e0 !important; color: #e35c66 !important; }
.booklet-compact-list { display: grid; margin-top: 11px; }
.booklet-compact-list > article { align-items: center; border-bottom: 1px solid #e5edf0; display: flex; gap: 12px; justify-content: space-between; padding: 10px 4px; }
.booklet-compact-list > article:last-child { border-bottom: 0; }
.booklet-compact-list > article > div:first-child { display: grid; gap: 3px; min-width: 0; }
.booklet-compact-list strong { color: #133f6a; font-size: 12px; }
.booklet-compact-list span, .booklet-compact-list small { color: #6f8196; font-size: 11px; }
.booklet-integrated-grid { display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.booklet-integrated-grid a { align-items: center; background: #f8fcfc; border: 1px solid #e0ebef; border-radius: 14px; color: inherit; display: flex; gap: 9px; min-width: 0; padding: 11px; text-decoration: none; }
.booklet-integrated-grid a:hover { background: #f0faf8; border-color: #bfe6de; }
.booklet-integrated-grid > a > span { color: var(--primary); flex: 0 0 auto; }
.booklet-integrated-grid svg { height: 19px; width: 19px; }
.booklet-integrated-grid div { display: grid; gap: 2px; min-width: 0; }
.booklet-integrated-grid strong { color: #123d68; font-size: 11px; }
.booklet-integrated-grid small { color: #718298; font-size: 10px; }
.booklet-dental-layout { display: grid; gap: 18px; grid-template-columns: minmax(260px, .8fr) minmax(0, 1.2fr); }
.booklet-odontogram { align-content: start; background: linear-gradient(145deg, #f8fcfd, #eef8f6); border: 1px solid #dcebe9; border-radius: 16px; display: grid; gap: 6px; grid-template-columns: repeat(10, minmax(0, 1fr)); padding: 14px; }
.booklet-odontogram > span, .booklet-odontogram > small { color: #60778b; font-size: 10px; font-weight: 800; grid-column: 1 / -1; }
.booklet-odontogram > small { font-weight: 600; margin-top: 5px; }
.booklet-odontogram a { align-items: center; aspect-ratio: 1; background: #fff; border: 1px solid #dce7eb; border-radius: 50%; color: #456176; display: inline-flex; font-size: 9px; font-weight: 850; justify-content: center; min-width: 0; text-decoration: none; }
.booklet-odontogram a.is-recorded { background: #dff7f1; border-color: #8bdacb; color: #087b6d; }
.booklet-odontogram a:hover, .booklet-odontogram a:focus-visible { border-color: var(--primary); outline: 0; }
.booklet-routine-list { display: grid; }
.booklet-routine-row { align-items: center; border-bottom: 1px solid #e4edf1; display: flex; gap: 11px; padding: 11px 4px; }
.booklet-routine-row:last-child { border-bottom: 0; }
.booklet-routine-icon { align-items: center; background: #eaf9f5; border-radius: 50%; color: var(--primary-dark); display: inline-flex; flex: 0 0 auto; height: 29px; justify-content: center; width: 29px; }
.booklet-routine-icon svg { height: 14px; width: 14px; }
.booklet-routine-row > div:nth-child(2) { display: grid; gap: 2px; flex: 1; min-width: 0; }
.booklet-routine-row strong { color: #123d68; font-size: 12px; }
.booklet-routine-row span { color: #718298; font-size: 11px; }
.booklet-routine-add-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.booklet-routine-add { align-items: center; background: #eef9f7; border: 1px solid #d5eee9; border-radius: 10px; box-shadow: none; color: #087b6d; display: inline-flex; font-size: 12px; font-weight: 850; gap: 5px; min-height: 35px; padding: 0 10px; }
.booklet-routine-add:hover, .booklet-routine-add:focus-visible { background: #ddf5ef; color: #05665b; outline: 0; }
.booklet-routine-add span { color: inherit; font-size: 17px; line-height: 1; }
.booklet-routine-sheet { background: #fbfdfd; border: 1px solid #dcebed; border-radius: 15px; margin-top: 12px; overflow: hidden; padding: 13px; }
.booklet-routine-sheet-head { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 11px; }
.booklet-routine-sheet-head h3 { color: #123d68; font-size: 13px; margin: 0 0 3px; }
.booklet-routine-sheet-head h3 .booklet-field-help { margin-left: 3px; }
.booklet-routine-sheet-head p { color: #718198; font-size: 11px; line-height: 1.4; margin: 0; }
.booklet-routine-sheet-head > span { background: #eaf8f5; border-radius: 999px; color: #087b6d; flex: 0 0 auto; font-size: 10px; font-weight: 850; padding: 5px 8px; }
.booklet-routine-sheet-wrap { overflow-x: auto; }
.booklet-routine-sheet table { border-collapse: separate; border-spacing: 0; min-width: 650px; width: 100%; }
.booklet-routine-sheet th { background: #f2f8f9; border-bottom: 1px solid #dce9ed; color: #5d7185; font-size: 10px; font-weight: 850; padding: 8px; text-align: left; white-space: nowrap; }
.booklet-routine-sheet td { border-bottom: 1px solid #e5edef; padding: 7px 5px; vertical-align: middle; }
.booklet-routine-sheet tbody tr:last-child td { border-bottom: 0; }
.booklet-routine-sheet input, .booklet-routine-sheet select { background: #fff; border: 1px solid #d6e3e8; border-radius: 8px; color: #173e67; font: inherit; font-size: 11px; min-height: 33px; padding: 6px 7px; width: 100%; }
.booklet-routine-sheet input::placeholder { color: #98aabc; opacity: 1; }
.booklet-routine-sheet td:nth-child(1) { min-width: 145px; }
.booklet-routine-sheet td:nth-child(2) { min-width: 85px; }
.booklet-routine-sheet td:nth-child(3) { min-width: 105px; }
.booklet-routine-sheet td:nth-child(4) { min-width: 124px; }
.booklet-routine-sheet td:nth-child(5) { min-width: 140px; }
.booklet-routine-measures { display: grid; gap: 5px; grid-template-columns: 1fr 1fr; }
.booklet-routine-sheet tbody tr.is-diaper [data-routine-feeding-measures] { opacity: .38; }
.booklet-routine-sheet tbody tr.is-diaper [data-routine-feeding-measures] input:disabled { background: #f3f6f7; border-color: #e3eaed; color: #a7b3bc; cursor: not-allowed; }
.booklet-routine-not-applicable { color: #95a5b2; display: block; font-size: 13px; text-align: center; }
.booklet-routine-remove-cell { text-align: center; width: 34px; }
.booklet-routine-remove { align-items: center; background: #fff6f6; border: 1px solid #ffe0e0; border-radius: 50%; box-shadow: none; color: #df5965; display: inline-flex; font-size: 17px; height: 27px; justify-content: center; line-height: 1; min-height: 27px; padding: 0; width: 27px; }
.booklet-routine-remove:hover, .booklet-routine-remove:focus-visible { background: #ffe9e9; outline: 0; }
.booklet-routine-sheet-empty { color: #77899b; font-size: 12px; margin: 12px 0 2px; text-align: center; }
.booklet-routine-sheet-actions { display: flex; justify-content: flex-end; margin-top: 11px; }
.booklet-routine-sheet-actions button { box-shadow: none; font-size: 12px; min-height: 36px; padding: 0 12px; }
.booklet-routine-sheet-actions button:disabled { background: #dfe8eb; color: #84939e; cursor: not-allowed; }
.routines-page-head { align-items: center; }
.routine-page-actions { display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.routine-module-sheet { margin: 0 0 16px; max-width: 980px; }
.routine-module-sheet .booklet-routine-sheet-head h2 { color: #123d68; font-size: 14px; margin: 0 0 3px; }
.routine-history-card { margin: 0 auto; max-width: 980px; padding: 19px 20px; }
.routine-history-heading { align-items: flex-start; display: flex; gap: 12px; justify-content: space-between; }
.routine-history-heading h2 { color: #093e73; font-size: 18px; margin: 0 0 4px; }
.routine-history-heading p { color: #718298; font-size: 11px; line-height: 1.4; margin: 0; }
.routine-history-heading .small-link { flex: 0 0 auto; font-size: 11px; }
.routine-history-list { border-top: 1px solid #e1eaee; margin-top: 14px; padding-top: 4px; }
.routine-day-group + .routine-day-group { margin-top: 14px; }
.routine-day-group h3 { align-items: center; background: #e9f8f5; border: 1px solid #ccebe4; border-radius: 999px; color: #087b6d; display: inline-flex; font-size: 13px; font-weight: 900; letter-spacing: .01em; margin: 12px 0 5px; min-height: 28px; padding: 0 11px; }
.routine-history-row { align-items: center; border-bottom: 1px solid #e2ebef; display: grid; gap: 10px; grid-template-columns: 48px minmax(0, 1fr) auto; min-height: 38px; padding: 7px 3px; }
.routine-history-row time { color: #536f88; font-size: 11px; font-weight: 750; }
.routine-history-content { min-width: 0; }
.routine-history-content p { color: #687e92; font-size: 12px; line-height: 1.45; margin: 0; overflow-wrap: anywhere; }
.routine-history-content strong { color: #123d68; font-weight: 850; }
.routine-history-content span { color: #59748a; }
.routine-history-content small { color: #778a9c; font-size: inherit; }
.routine-history-actions { align-items: center; display: flex; gap: 5px; }
.routine-history-actions form { margin: 0; }
.routine-history-actions .icon-button { align-items: center; background: #f1faf8; border: 1px solid #d8eeea; border-radius: 50%; color: #087b6d; display: inline-flex; height: 28px; justify-content: center; min-height: 28px; padding: 0; width: 28px; }
.routine-history-actions .icon-button svg { height: 13px; width: 13px; }
.routine-history-actions .booklet-delete-button { background: #fff6f6 !important; border-color: #ffe0e0 !important; color: #e35c66 !important; }
.sr-only { height: 1px; margin: -1px; overflow: hidden; padding: 0; position: absolute; width: 1px; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.booklet-record-view-link { border-radius: 10px; color: inherit; min-width: 0; padding: 2px 4px; text-decoration: none; transition: background .16s ease, box-shadow .16s ease; }
.booklet-record-view-link:hover, .booklet-record-view-link:focus-visible { background: #f4fbfa; box-shadow: 0 0 0 1px #d5ede8; outline: 0; }
.booklet-visit-page-head { align-items: center; }
.booklet-visit-actions { align-items: center; display: flex; gap: 8px; }
.booklet-visit-back { box-shadow: none; font-size: 12px; min-height: 34px; padding: 0 12px; }
.booklet-visit-panel { background: #fff; border: 1px solid #dbe7ed; border-radius: 20px; box-shadow: 0 10px 28px rgba(21,74,93,.05); margin: 0 auto; max-width: 980px; overflow: hidden; padding: 22px; }
.booklet-visit-summary { background: linear-gradient(135deg, #effaf8, #f7fcfd); border: 1px solid #d7ece8; border-radius: 15px; display: grid; gap: 3px; padding: 13px 15px; }
.booklet-visit-summary span, .booklet-visit-child span, .booklet-visit-facts span, .booklet-visit-measures span { color: #678095; display: block; font-size: 10px; font-weight: 800; }
.booklet-visit-summary strong { color: #083d72; font-size: 17px; }
.booklet-visit-summary small { color: #537489; font-size: 11px; font-weight: 650; }
.booklet-visit-child { align-items: center; display: flex; gap: 7px; padding: 13px 3px 1px; }
.booklet-visit-child strong { color: #123d68; font-size: 13px; }
.booklet-visit-section { border-top: 1px solid #e1ebef; margin-top: 17px; padding-top: 17px; }
.booklet-visit-section h2 { color: #093e73; font-size: 16px; margin: 0 0 12px; }
.booklet-visit-facts, .booklet-visit-measures { display: grid; gap: 9px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.booklet-visit-facts > div, .booklet-visit-measures > div { background: #f8fcfc; border: 1px solid #e1ecef; border-radius: 12px; display: grid; gap: 4px; min-width: 0; padding: 10px 11px; }
.booklet-visit-facts strong, .booklet-visit-measures strong { color: #123d68; font-size: 12px; overflow-wrap: anywhere; }
.booklet-visit-notes { background: #f8fcfc; border-left: 3px solid #9edbd0; border-radius: 0 11px 11px 0; margin-top: 11px; padding: 10px 12px; }
.booklet-visit-notes > span { color: #527087; font-size: 10px; font-weight: 850; text-transform: uppercase; }
.booklet-visit-notes p { color: #294d6d; font-size: 12px; line-height: 1.5; margin: 5px 0 0; white-space: pre-wrap; }
.booklet-visit-section-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 12px; }
.booklet-visit-section-heading h2 { margin: 0; }
.booklet-visit-section-heading a { color: #087b6d; font-size: 11px; font-weight: 800; text-decoration: none; white-space: nowrap; }
.booklet-visit-section-heading a:hover, .booklet-visit-section-heading a:focus-visible { color: #075e55; text-decoration: underline; }
.booklet-visit-checks { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booklet-visit-checks article { background: #f9fcfd; border: 1px solid #e0ebef; border-radius: 13px; min-width: 0; padding: 11px; }
.booklet-visit-checks article > div { align-items: baseline; display: flex; flex-wrap: wrap; gap: 5px 8px; }
.booklet-visit-checks strong { color: #123d68; font-size: 12px; }
.booklet-visit-checks span { background: #e9f8f4; border-radius: 999px; color: #087b6d; font-size: 10px; font-weight: 800; padding: 4px 6px; }
.booklet-visit-checks p { color: #5c7187; font-size: 11px; line-height: 1.45; margin: 8px 0 0; white-space: pre-wrap; }
.booklet-form-heading { align-items: end; }
.booklet-editor { max-width: 980px; padding: 22px; }
.booklet-form-child { align-items: center; background: #f4fbfa; border: 1px solid #dcefea; border-radius: 12px; display: flex; gap: 8px; margin-bottom: 18px; padding: 10px 12px; }
.booklet-form-child span { color: #688096; font-size: 11px; font-weight: 750; }
.booklet-form-child strong { color: #123d68; font-size: 13px; }
.booklet-form-section { border-top: 1px solid #e1ebef; margin-top: 18px; padding-top: 18px; }
.booklet-form-section:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
.booklet-form-section h2 { color: #0a3d74; font-size: 16px; margin: 0 0 12px; }
.booklet-form-grid { display: grid; gap: 13px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.booklet-form-grid label { color: #35536e; display: grid; font-size: 12px; font-weight: 800; gap: 6px; }
.booklet-form-grid input, .booklet-form-grid select, .booklet-form-grid textarea, .booklet-check-grid select, .booklet-check-grid textarea { border: 1px solid #d7e3e9; border-radius: 10px; color: #173e67; font: inherit; font-size: 13px; min-width: 0; padding: 10px; }
.booklet-form-grid input::placeholder, .booklet-form-grid textarea::placeholder, .booklet-check-grid textarea::placeholder { color: #9aaabc; font-weight: 600; opacity: 1; }
.booklet-form-grid textarea, .booklet-check-grid textarea { resize: vertical; }
.booklet-form-grid .wide-field { grid-column: 1 / -1; }
.booklet-label { align-items: center; display: inline-flex; gap: 5px; line-height: 1.25; min-height: 16px; }
.booklet-field-help { display: inline-flex; flex: 0 0 12px; height: 12px; line-height: 0; position: relative; vertical-align: middle; width: 12px; z-index: 2; }
.booklet-help-button { all: unset; box-sizing: border-box; cursor: help; display: block; flex: 0 0 12px; height: 12px !important; min-height: 12px !important; overflow: hidden; padding: 0 !important; width: 12px !important; }
.booklet-help-button, .booklet-help-button:hover, .booklet-help-button:focus, .booklet-help-button:focus-visible, .booklet-help-button:active { background: transparent !important; box-shadow: none !important; color: inherit; }
.booklet-help-icon { display: block; filter: none !important; height: 12px; pointer-events: none; transform: none !important; width: 12px; }
.booklet-help-button:focus-visible { outline: 2px solid #4f978f; outline-offset: 2px; }
.booklet-help-popover { background: #173e67; border-radius: 10px; box-shadow: 0 10px 24px rgba(17,49,78,.24); color: #fff; font-size: 11px; font-weight: 600; left: 0; line-height: 1.45; opacity: 0; padding: 10px 11px; pointer-events: none; position: absolute; top: calc(100% + 7px); transform: translateY(-3px); transition: opacity .14s ease, transform .14s ease; visibility: hidden; width: min(280px, calc(100vw - 54px)); z-index: 10; }
.booklet-field-help.is-open .booklet-help-popover { opacity: 1; pointer-events: none; transform: translateY(0); visibility: visible; }
.booklet-form-help { color: #718197; font-size: 12px; margin: -4px 0 12px; }
.booklet-check-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.booklet-check-grid fieldset { border: 1px solid #dfe9ed; border-radius: 13px; display: grid; gap: 8px; margin: 0; min-width: 0; padding: 11px; }
.booklet-check-grid legend { color: #0b3e75; font-size: 12px; font-weight: 850; padding: 0 4px; }
.booklet-safety-note { background: #fff9e8; border: 1px solid #f5df9b; border-radius: 12px; color: #7b6417; font-size: 12px; line-height: 1.5; margin-bottom: 15px; padding: 11px 13px; }
.booklet-form-actions { margin-top: 20px; }
.booklet-form-danger { margin-top: 14px; max-width: 980px; }

@media (max-width: 900px) {
    .booklet-page-head { align-items: flex-start; }
    .booklet-overview { gap: 8px; }
    .booklet-overview-card { gap: 2px 7px; padding: 10px; }
    .booklet-overview-icon { height: 19px; width: 19px; }
    .booklet-overview-card span { font-size: 9px; }
    .booklet-overview-card strong { font-size: 18px; }
    .booklet-panel { border-radius: 17px; padding: 15px; }
    .booklet-panel-heading h2 { font-size: 17px; }
    .booklet-panel-heading p { font-size: 11px; }
    .booklet-fact-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booklet-screening-grid { grid-template-columns: 1fr; }
    .booklet-record-row { gap: 9px; grid-template-columns: minmax(0, 1fr) auto; }
    .booklet-record-date { grid-column: 1; }
    .booklet-record-content { grid-column: 1; grid-row: 2; }
    .booklet-record-actions { grid-column: 2; grid-row: 1 / span 2; }
    .routines-page-head { align-items: flex-start; }
    .routine-history-card { padding: 16px; }
    .routine-history-row { grid-template-columns: 46px minmax(0, 1fr) auto; }
    .booklet-visit-panel { padding: 17px; }
    .booklet-visit-facts, .booklet-visit-measures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booklet-integrated-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .booklet-dental-layout { grid-template-columns: 1fr; }
    .booklet-form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
    .booklet-help-popover { left: 50%; max-height: calc(100dvh - 32px); overflow-y: auto; position: fixed; right: auto; top: var(--booklet-help-top, 50%); transform: translate(-50%, -4px); width: min(300px, calc(100vw - 32px)); z-index: 1000; }
    .booklet-field-help.is-open .booklet-help-popover { transform: translate(-50%, 0); }
}

@media (max-width: 480px) {
    .dashboard-routine-card { padding: 14px; }
    .dashboard-routine-head { gap: 8px; }
    .dashboard-routine-head h2 { font-size: 16px; }
    .dashboard-routine-head p { font-size: 10px; max-width: 175px; }
    .dashboard-routine-actions { gap: 5px; }
    .dashboard-routine-actions a { font-size: 9px; min-height: 30px; padding: 0 7px; }
    .booklet-quick-add { font-size: 11px; padding: 8px 10px; }
    .booklet-panel-heading { gap: 10px; }
    .booklet-routine-add-actions { gap: 5px; }
    .booklet-routine-add { font-size: 11px; min-height: 33px; padding: 0 8px; }
    .booklet-routine-sheet { padding: 10px; }
    .booklet-routine-sheet-head { gap: 8px; }
    .booklet-routine-sheet-head > span { font-size: 9px; padding: 4px 6px; }
    .booklet-routine-sheet-wrap { overflow: visible; }
    .booklet-routine-sheet table, .booklet-routine-sheet tbody, .booklet-routine-sheet tr, .booklet-routine-sheet td { display: block; min-width: 0; width: 100%; }
    .booklet-routine-sheet thead { display: none; }
    .booklet-routine-sheet tbody { display: grid; gap: 9px; }
    .booklet-routine-sheet tbody tr { background: #fff; border: 1px solid #e0eaed; border-radius: 11px; display: grid; gap: 7px; grid-template-columns: repeat(12, minmax(0, 1fr)); padding: 9px 38px 9px 9px; position: relative; }
    .booklet-routine-sheet td { border: 0; padding: 0; }
    .booklet-routine-sheet td::before { color: #6e8194; content: attr(data-label); display: block; font-size: 9px; font-weight: 850; margin-bottom: 3px; }
    .booklet-routine-sheet td.booklet-routine-remove-cell { position: absolute; right: 5px; top: 5px; width: 27px; }
    .booklet-routine-sheet td.booklet-routine-remove-cell::before { content: none; }
    .booklet-routine-sheet td:nth-child(1) { grid-column: 1 / span 7; }
    .booklet-routine-sheet td:nth-child(2) { grid-column: 8 / -1; }
    .booklet-routine-sheet td:nth-child(3) { grid-column: 1 / span 4; }
    .booklet-routine-sheet td:nth-child(4) { grid-column: 5 / -1; }
    .booklet-routine-sheet td:nth-child(5) { grid-column: 1 / -1; }
    .booklet-routine-sheet tbody tr.is-diaper td:nth-child(4) { display: none; }
    .booklet-routine-sheet tbody tr.is-diaper td:nth-child(5) { grid-column: 5 / -1; }
    .booklet-routine-measures { max-width: none; }
    .booklet-fact-grid { gap: 7px; }
    .booklet-fact-grid div { padding: 8px; }
    .booklet-integrated-grid a { gap: 7px; padding: 9px; }
    .booklet-integrated-grid small { font-size: 9px; }
    .booklet-odontogram { gap: 4px; padding: 10px; }
    .booklet-odontogram a { font-size: 8px; }
    .booklet-editor { padding: 15px; }
    .routine-page-actions { gap: 5px; }
    .routine-history-card { border-radius: 16px; padding: 14px; }
    .routine-history-heading h2 { font-size: 16px; }
    .routine-history-heading p { font-size: 10px; }
    .routine-history-row { gap: 7px; grid-template-columns: 42px minmax(0, 1fr) auto; padding: 7px 0; }
    .routine-history-content p { font-size: 11px; }
    .routine-history-actions { gap: 3px; }
    .routine-history-actions .icon-button { height: 26px; min-height: 26px; width: 26px; }
    .booklet-visit-page-head { align-items: flex-start; }
    .booklet-visit-panel { border-radius: 16px; padding: 14px; }
    .booklet-visit-summary { padding: 11px 12px; }
    .booklet-visit-summary strong { font-size: 15px; }
    .booklet-visit-section-heading { align-items: flex-start; flex-direction: column; gap: 5px; }
    .booklet-visit-checks { grid-template-columns: 1fr; }
    .booklet-form-grid, .booklet-check-grid { grid-template-columns: 1fr; }
}

/* Assinatura e cobrança */
.billing-readonly-banner { align-items: center; background: #fff6e9; border: 1px solid #f4cf8f; border-radius: 14px; color: #80520a; display: flex; gap: 16px; justify-content: space-between; margin: 0 0 16px; padding: 12px 16px; }
.billing-readonly-banner div { display: grid; gap: 2px; }
.billing-readonly-banner strong { font-size: 14px; }
.billing-readonly-banner span { font-size: 12px; }
.billing-readonly-banner .button { background: #b97810; box-shadow: none; flex: 0 0 auto; min-height: 34px; }
.billing-kicker { color: var(--primary-dark); display: block; font-size: 10px; font-weight: 900; letter-spacing: .09em; text-transform: uppercase; }
.billing-page-head { align-items: flex-start; }
.billing-page-head h1 { align-items: center; display: flex; gap: 10px; }
.billing-status-card { align-items: flex-start; display: flex; gap: 16px; margin-bottom: 16px; padding: 22px; }
.billing-status-card.status-active { border-color: #a9e6d4; }
.billing-status-card.status-past_due, .billing-status-card.status-expired, .billing-status-card.status-canceled { border-color: #f4d2a1; }
.billing-status-icon { align-items: center; background: #e3f8f2; border-radius: 14px; color: var(--primary-dark); display: flex; flex: 0 0 48px; height: 48px; justify-content: center; }
.billing-status-icon .title-svg { height: 24px; width: 24px; }
.billing-status-copy { display: grid; gap: 4px; }
.billing-status-copy h2, .billing-plan-card h2, .billing-cancel-card h2, .billing-security-card h2 { color: var(--ink); font-size: 20px; margin: 0; }
.billing-status-copy p, .billing-plan-card p, .billing-cancel-card p, .billing-security-card p { color: #61708d; font-size: 13px; line-height: 1.5; margin: 0; }
.billing-inline-note { color: #9a5d0a !important; font-weight: 700; }
.billing-setup-notice { align-items: flex-start; background: #f1f7ff; border-color: #cfe1f8; color: #285f92; display: flex; gap: 10px; margin-bottom: 16px; padding: 15px 18px; }
.billing-setup-notice .mini-svg { flex: 0 0 20px; height: 20px; margin-top: 1px; width: 20px; }
.billing-setup-notice div { display: grid; gap: 3px; }
.billing-setup-notice strong { font-size: 14px; }
.billing-setup-notice span { font-size: 12px; line-height: 1.4; }
.billing-plans-grid { display: grid; gap: 16px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-bottom: 16px; }
.billing-plan-card { display: flex; flex-direction: column; gap: 12px; min-height: 100%; padding: 22px; position: relative; }
.billing-plan-card.is-featured { border: 2px solid var(--primary); box-shadow: 0 14px 28px rgba(15, 154, 143, .15); }
.billing-plan-badge { background: var(--primary); border-radius: 999px; color: white; font-size: 10px; font-weight: 900; letter-spacing: .04em; padding: 5px 9px; position: absolute; right: 16px; text-transform: uppercase; top: 15px; }
.billing-price { color: var(--primary-dark); font-size: 24px; letter-spacing: -.03em; }
.billing-plan-card ul { color: #52627d; display: grid; font-size: 13px; gap: 8px; line-height: 1.35; list-style: none; margin: 0; padding: 0; }
.billing-plan-card li { padding-left: 20px; position: relative; }
.billing-plan-card li::before { color: var(--primary); content: '✓'; font-weight: 900; left: 0; position: absolute; }
.billing-plan-card form { margin-top: auto; }
.billing-plan-card button { width: 100%; }
.billing-plan-card button:disabled { background: #aebdcc; box-shadow: none; cursor: not-allowed; }
.billing-cancel-card { align-items: center; display: flex; gap: 18px; justify-content: space-between; margin-bottom: 16px; padding: 20px 22px; }
.billing-cancel-card > div { display: grid; gap: 5px; }
.billing-cancel-card form { flex: 0 0 auto; }
.billing-cancel-card .danger-button { border-color: #efb7be; color: #b64454; }
.billing-security-card { align-items: flex-start; background: linear-gradient(135deg, #f2fbfa, #f8fcff); border-color: #cdebe6; display: flex; gap: 14px; padding: 20px 22px; }
.billing-security-card .title-svg { color: var(--primary-dark); flex: 0 0 28px; height: 28px; width: 28px; }
.billing-security-card div { display: grid; gap: 5px; }

@media (max-width: 680px) {
    .billing-readonly-banner, .billing-cancel-card { align-items: stretch; flex-direction: column; }
    .billing-readonly-banner .button, .billing-cancel-card form, .billing-cancel-card button { width: 100%; }
    .billing-plans-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .billing-readonly-banner { border-radius: 12px; margin-bottom: 12px; padding: 11px 12px; }
    .billing-readonly-banner strong { font-size: 13px; }
    .billing-readonly-banner span { font-size: 11px; }
    .billing-status-card, .billing-plan-card, .billing-cancel-card, .billing-security-card { border-radius: 16px; padding: 16px; }
    .billing-status-card { gap: 11px; }
    .billing-status-icon { border-radius: 12px; flex-basis: 40px; height: 40px; }
    .billing-status-icon .title-svg { height: 20px; width: 20px; }
    .billing-status-copy h2, .billing-plan-card h2, .billing-cancel-card h2, .billing-security-card h2 { font-size: 17px; }
    .billing-status-copy p, .billing-plan-card p, .billing-cancel-card p, .billing-security-card p, .billing-plan-card ul { font-size: 12px; }
    .billing-price { font-size: 21px; }
    .billing-setup-notice { padding: 13px; }
}
