/* Identidade e componentes compartilhados. Prioridade para toque e telas pequenas. */
:root {
    --purple:#501342;
    --ochre:#a96100;
    --paper:#fffaf1;
    --line:#d9cbd5;
    --muted:#625766;
    --white:#fff;
    --radius:18px;
}

* {
    box-sizing:border-box;
}

body {
    margin:0;
    background:var(--paper);
    color:var(--purple);
    font:17px/1.5 system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
}

a {
    color:var(--purple);
    text-underline-offset:4px;
}

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

button,a,input,select,textarea {
    -webkit-tap-highlight-color:transparent;
}

button,.choice {
    min-height:48px;
}

button {
    cursor:pointer;
    border:1px solid var(--line);
    border-radius:12px;
    padding:10px 18px;
}

button:disabled {
    opacity:.65;
    cursor:wait;
}

input,select,textarea {
    width:100%;
    min-height:50px;
    border:1px solid #9e8c9a;
    border-radius:10px;
    padding:12px;
    background:white;
    color:#30122c;
}

input::placeholder {
    color:#726773;
}

textarea {
    min-height:90px;
    resize:vertical;
}

label {
    display:block;
    font-weight:600;
    margin-top:18px;
    margin-bottom:6px;
}

h1,h2,h3 {
    line-height:1.2;
}

h1 {
    font:700 clamp(30px,4vw,44px)/1.15 Georgia,serif;
}

h2 {
    font-size:24px;
}

h3 {
    font-size:21px;
}

p {
    max-width:70ch;
}

.topbar {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:20px;
    padding:18px max(20px,calc((100vw - 1200px)/2));
    border-bottom:1px solid var(--line);
    background:white;
}

.wordmark {
    font:bold 28px Georgia,serif;
    text-decoration:none;
}

.wordmark span {
    display:block;
    font:12px system-ui;
    color:var(--muted);
}

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

.account span {
    font-size:14px;
}

.page {
    max-width:1200px;
    margin:36px auto;
    padding:0 20px;
}

.panel {
    background:white;
    border:1px solid var(--line);
    border-radius:var(--radius);
    padding:26px;
    margin-bottom:24px;
}

.narrow {
    max-width:600px;
    margin:28px auto;
}

.primary {
    background:var(--purple);
    color:white;
    border-color:var(--purple);
    font-weight:650;
    margin-top:20px;
}

.full {
    width:100%;
}

.quiet {
    background:transparent;
    color:var(--purple);
}

.grid {
    display:grid;
    grid-template-columns:repeat(auto-fit,minmax(min(100%,320px),1fr));
    gap:20px;
}

.login-layout {
    max-width:1150px;
    margin:50px auto;
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:60px;
    padding:20px;
    align-items:center;
}

.brand {
    display:block;
    width:100%;
    max-width:490px;
    mix-blend-mode:multiply;
}

.login-panel h1 {
    margin-top:0;
}

.password-field {
    display:flex;
    align-items:center;
    border:1px solid #9e8c9a;
    border-radius:10px;
}

.password-field input {
    border:0;
    min-width:0;
}

.password-field button {
    border:0;
    font-size:14px;
}

.recovery {
    display:block;
    text-align:center;
    margin:18px 0;
}

.join {
    border-top:1px solid var(--line);
    margin-top:25px;
    padding-top:10px;
}

.choice {
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:12px;
    border:1px solid var(--line);
    border-radius:12px;
    padding:13px;
    margin:12px 0;
    text-decoration:none;
    font-weight:600;
}

.notice {
    padding:18px;
    border:1px solid var(--ochre);
    border-radius:12px;
    background:#fff0d1;
    margin:16px 0;
}

.login-layout>.notice {
    grid-column:1/-1;
}

.hint {
    font-size:14px;
    color:var(--muted);
}

.check {
    display:flex;
    align-items:flex-start;
    gap:10px;
    font-size:15px;
}

.check input {
    width:22px;
    min-height:22px;
    flex-shrink:0;
}

.inline {
    display:flex;
    gap:12px;
    align-items:center;
    margin-top:12px;
}

summary {
    cursor:pointer;
    padding:16px 0;
    font-weight:bold;
}

footer {
    text-align:center;
    font-size:13px;
    color:var(--muted);
    padding:24px;
}

.skip {
    position:absolute;
    left:10px;
    top:-100px;
    background:white;
    padding:12px;
    z-index:10;
}

.skip:focus {
    top:10px;
}

:focus-visible {
    outline:3px solid #a96100;
    outline-offset:4px;
}

@media(max-width:700px) {
    .login-layout {
        grid-template-columns:1fr;
        gap:5px;
        margin:5px auto;
        padding:16px;
    }
    .brand-panel .brand {
        max-width:230px;
        max-height:245px;
        object-fit:contain;
        margin:auto;
    }
    .login-panel {
        padding:22px;
    }
    .topbar {
        padding:12px 16px;
    }
    .account {
        gap:6px;
    }
    .wordmark {
        font-size:23px;
    }
    .wordmark span {
        display:none;
    }
    .page {
        margin:24px auto;
        padding:0 16px;
    }
    .panel {
        padding:20px;
    }
    .narrow {
        margin:20px auto;
    }
    .account span {
        max-width:120px;
        overflow-wrap:anywhere;
    }
    .grid {
        gap:0;
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior:auto!important;
    }
}

/* Erros ficam junto aos campos, sem substituir a página preenchida. */
.field-error {
    display: block;
    color: #9b1731;
    font-size: 14px;
    margin: 5px 0 12px;
}

[aria-invalid="true"] {
    border: 2px solid #9b1731;
}

.form-message:empty {
    display: none;
}

.admin-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 24px;
}

.danger {
    color: white;
    background: #932238;
    border-color: #932238;
    margin-top: 16px;
}

.delete-area {
    border-top: 1px solid var(--line);
    margin-top: 24px;
}

.panel p {
    overflow-wrap: anywhere;
}

/* Painel inspirado nos folhetos: papel, traços em roxo e pequenos acentos em ocre. */
[hidden] {
    display: none !important;
}

.icon {
    width: 24px;
    height: 24px;
    flex-shrink: 0;
    vertical-align: middle;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.brand-crop {
    display: block;
    width: 150px;
    height: 103px;
    overflow: hidden;
}

.brand-crop img {
    display: block;
    width: 178px;
    max-width: none;
    margin: -23px 0 0 -14px;
    mix-blend-mode: multiply;
}

.wordmark .brand-crop {
    font-size: inherit;
}

.app-body {
    font-size: 15px;
    background: #fffdf7;
}

.app-topbar {
    min-height: 112px;
    padding: 0 28px;
    gap: 28px;
    background: #fffdf7;
    border-color: #eee5da;
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 32px;
    margin-right: auto;
    height: 112px;
}

.main-nav a {
    display: flex;
    gap: 10px;
    align-items: center;
    align-self: stretch;
    text-decoration: none;
    font-weight: 650;
    border-bottom: 3px solid transparent;
}

.main-nav a[aria-current] {
    border-color: #db971e;
}

.safe-label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 13px;
}

.safe-label .icon {
    width: 19px;
}

.account small, .sidebar-title small {
    display: block;
    font-size: 11px;
    color: var(--muted);
    margin-top: 3px;
}

.account-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffedc7;
    border-radius: 50%;
    color: #a96100;
}

.logout-button {
    display: flex;
    align-items: center;
    gap: 8px;
    border-color: transparent;
    font-size: 13px;
}

.logout-button .icon {
    width: 19px;
}

.menu-toggle {
    display: none;
}

.app-shell {
    display: grid;
    grid-template-columns: 238px minmax(0, 1fr);
    min-height: calc(100vh - 170px);
    /* O painel acompanha toda a largura disponível, inclusive em monitores amplos. */
    width: 100%;
    max-width: none;
    margin: 0;
}

.sidebar {
    border-right: 1px solid #eee5da;
    padding: 30px 16px;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sidebar-title {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 4px 24px;
}

.sidebar-title strong {
    font-size: 15px;
}

.section-symbol {
    color: #b7770a;
}

.section-symbol .icon {
    width: 30px;
    height: 30px;
}

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

.side-nav a {
    display: flex;
    gap: 12px;
    align-items: center;
    min-height: 52px;
    text-decoration: none;
    padding: 12px;
    border: 1px solid #eee5da;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 650;
}

.side-nav a[aria-current] {
    background: #ffe9b6;
    border-color: #f4d28d;
}

.side-nav a:hover {
    background: #fff0d1;
}

.sidebar-note {
    margin-top: auto;
    padding: 70px 10px 100px;
    color: var(--muted);
    font-size: 13px;
}

.sidebar-note .icon {
    color: #ab7017;
}

.sidebar-art {
    position: absolute;
    height: 100px;
    bottom: 0;
    left: 0;
    right: 0;
    pointer-events: none;
}

.sidebar-art span {
    position: absolute;
    bottom: -65px;
    left: -70px;
    width: 280px;
    height: 125px;
    border-radius: 50%;
    background: #d99015;
    transform: rotate(15deg);
}

.sidebar-art span:nth-child(2) {
    left: -95px;
    bottom: -80px;
    background: var(--purple);
    transform: rotate(28deg);
}

.sidebar-art span:nth-child(3) {
    left: 65px;
    bottom: -105px;
    background: #ffe7b6;
    transform: rotate(-15deg);
}

.workspace.page {
    width: 100%;
    min-width: 0;
    max-width: none;
    margin: 0;
    padding: 36px clamp(20px, 3vw, 48px);
}

.page-heading {
    display: flex;
    align-items: center;
    gap: 18px;
    margin: 0 0 28px;
}

.heading-icon {
    display: grid;
    place-items: center;
    width: 58px;
    height: 58px;
    background: #ffedc7;
    color: #a96100;
    border-radius: 18px;
    flex-shrink: 0;
}

.heading-icon .icon {
    width: 32px;
    height: 32px;
}

.page-heading h1 {
    font: 700 clamp(24px, 2.5vw, 34px)/1.2 system-ui, sans-serif;
    margin: 3px 0 6px;
    letter-spacing: -.7px;
}

.page-heading p {
    margin: 0;
    color: var(--muted);
}

.page-heading .eyebrow {
    color: #a36b13;
    font-size: 10px;
    letter-spacing: 1.7px;
    font-weight: 700;
}

.overview {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 28px;
}

.overview-card {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid #eee5da;
    border-radius: 16px;
    background: #fffaf1;
    padding: 18px;
    text-decoration: none;
    font-size: 13px;
}

.overview-card > .icon {
    width: 38px;
    height: 38px;
    padding: 7px;
    box-sizing: content-box;
    background: #f4ebf1;
    border-radius: 14px;
}

.overview-card:nth-child(2) > .icon {
    background: #ffedc7;
    color: #a96100;
}

.overview-card strong {
    display: block;
    font-size: 28px;
    line-height: 1.3;
}

.directory {
    background: #fff;
    border: 1px solid #eee5da;
    border-radius: 18px;
    overflow: hidden;
}

.directory-tabs {
    display: flex;
    overflow-x: auto;
    gap: 12px;
    padding: 0 24px;
    border-bottom: 1px solid #eee5da;
    background: #fffdf8;
}

.directory-tabs a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    white-space: nowrap;
    padding: 20px 8px 17px;
    font-size: 13px;
    font-weight: 650;
    border-bottom: 3px solid transparent;
}

.directory-tabs a[aria-current] {
    border-color: #d99015;
}

.directory-tabs .icon {
    width: 21px;
    height: 21px;
}

.count {
    background: #f1e8ef;
    padding: 1px 7px;
    border-radius: 20px;
    font-size: 11px;
}

.directory-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
}

.directory-heading h2 {
    margin: 0 0 5px;
    font-size: 20px;
}

.directory-heading p {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
}

.privacy-note {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    color: var(--muted);
}

.privacy-note .icon {
    width: 17px;
    height: 17px;
}

.table-note {
    margin: 0 24px 20px;
    font-size: 13px;
    color: var(--muted);
}

.table-scroll {
    overflow-x: auto;
    width: 100%;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    text-align: left;
    min-width: 780px;
}

.data-table thead {
    background: #faf7f2;
    color: var(--muted);
}

.data-table th, .data-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f0e9e1;
    vertical-align: middle;
}

.data-table thead th {
    font-size: 11px;
    font-weight: 650;
}

.data-table tbody th {
    font-weight: 650;
    min-width: 180px;
    max-width: 280px;
}

.data-table td {
    max-width: 250px;
    overflow-wrap: anywhere;
}

.data-table tbody tr:hover {
    background: #fffdf8;
}

.data-table small {
    display: block;
    color: var(--muted);
    font-size: 11px;
    font-weight: 400;
    padding-top: 5px;
    overflow-wrap: anywhere;
}

.record-name {
    display: flex;
    align-items: center;
    gap: 8px;
    overflow-wrap: anywhere;
}

.record-name .icon {
    color: #9c6b92;
    width: 21px;
    height: 21px;
}

.status-badge {
    display: inline-block;
    border-radius: 30px;
    padding: 5px 10px;
    font-size: 11px;
    white-space: nowrap;
    background: #fff0d1;
    color: #77500d;
}

.status-active {
    background: #eaf3e8;
    color: #365e31;
}

.status-suspended, .status-rejected {
    background: #f9e9ec;
    color: #922139;
}

.status-correction {
    background: #f0e9f5;
    color: #66417b;
}

.actions-heading {
    text-align: right;
}

.row-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 6px;
}

.action-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    min-height: 44px;
    border: 1px solid #e6d9e2;
    border-radius: 9px;
    padding: 8px;
    background: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
}

.action-button .icon {
    width: 16px;
    height: 16px;
}

.action-button:hover {
    background: #f5edf2;
}

.delete-button {
    color: #922139;
    border-color: #eed5db;
}

.row-disclosure > summary {
    list-style: none;
}

.row-disclosure > summary::-webkit-details-marker {
    display: none;
}

.row-disclosure[open] {
    min-width: 280px;
    white-space: normal;
}

.action-sheet {
    padding: 20px;
    text-align: left;
    white-space: normal;
}

.action-sheet h2 {
    font-size: 23px;
    margin-top: 0;
    overflow-wrap: anywhere;
}

.action-sheet p {
    font-size: 14px;
}

.action-dialog {
    width: min(520px, calc(100% - 32px));
    max-height: calc(100dvh - 40px);
    padding: 12px;
    border: 1px solid #e6d9e2;
    border-radius: 20px;
    color: var(--purple);
    background: #fffdf8;
}

.action-dialog::backdrop {
    background: #27132488;
}

.dialog-close {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
    background: transparent;
    color: var(--purple);
    font-size: 12px;
}

.table-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px 24px;
    font-size: 12px;
    color: var(--muted);
}

.table-footer p {
    margin: 0;
}

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

.pagination a {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border: 1px solid #eee5da;
    border-radius: 9px;
    text-decoration: none;
}

.empty-state {
    padding: 50px !important;
    text-align: center;
    color: var(--muted);
}

.empty-state .icon, .empty-state strong {
    display: block;
    margin: 10px auto;
}

.history-note {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
}

.history-note .icon {
    width: 18px;
}

.mobile-table-hint {
    display: none;
}

.app-body footer {
    border-top: 1px solid #eee5da;
}

@media (max-width: 1150px) {
    .app-topbar {
        gap: 18px;
        padding: 0 20px;
    }
    .safe-label {
        display: none;
    }
    .app-shell {
        grid-template-columns: 210px minmax(0, 1fr);
    }
    .overview-card {
        padding: 14px;
        gap: 9px;
    }
    .overview-card > .icon {
        width: 27px;
        height: 27px;
    }
    .directory-tabs {
        gap: 8px;
        padding: 0 14px;
    }
}

@media (max-width: 800px) {
    .app-topbar {
        flex-wrap: wrap;
        gap: 8px 14px;
        min-height: 0;
        padding: 6px 16px;
    }
    .brand-crop {
        width: 112px;
        height: 78px;
    }
    .brand-crop img {
        width: 135px;
        margin: -17px 0 0 -11px;
    }
    .account {
        margin-left: auto;
    }
    .account-avatar {
        display: none;
    }
    .account span {
        font-size: 12px;
    }
    .account small {
        font-size: 10px;
    }
    .logout-button {
        padding: 8px;
    }
    .logout-button span {
        display: none;
    }
    .main-nav {
        height: 48px;
        order: 3;
        margin: 0 auto 0 0;
    }
    .main-nav a {
        font-size: 13px;
    }
    .main-nav .icon {
        width: 20px;
    }
    .menu-toggle {
        display: inline-flex;
        align-items: center;
        gap: 8px;
        order: 4;
        min-height: 44px;
        font-size: 13px;
    }
    .app-shell {
        display: block;
    }
    .sidebar {
        padding: 16px;
        border: 0;
        border-bottom: 1px solid #eee5da;
    }
    .sidebar-title {
        padding-bottom: 12px;
    }
    .sidebar-note, .sidebar-art {
        display: none;
    }
    .workspace.page {
        padding: 24px 16px;
    }
    .page-heading {
        gap: 12px;
        margin-bottom: 20px;
    }
    .heading-icon {
        width: 44px;
        height: 44px;
        border-radius: 13px;
    }
    .heading-icon .icon {
        width: 26px;
        height: 26px;
    }
    .page-heading h1 {
        font-size: 24px;
    }
    .page-heading p {
        font-size: 13px;
    }
    .page-heading .eyebrow {
        font-size: 9px;
    }
    .overview {
        gap: 8px;
        margin-bottom: 20px;
    }
    .overview-card {
        padding: 12px 9px;
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        font-size: 11px;
    }
    .overview-card > .icon {
        width: 22px;
        height: 22px;
        padding: 5px;
        border-radius: 9px;
    }
    .overview-card strong {
        font-size: 24px;
    }
    .directory-heading {
        padding: 20px 16px 8px;
    }
    .directory-heading h2 {
        font-size: 18px;
    }
    .privacy-note {
        display: none;
    }
    .directory-tabs {
        gap: 14px;
    }
    .directory-tabs a {
        font-size: 12px;
        padding: 16px 2px 13px;
    }
    .directory-tabs .icon {
        display: none;
    }
    .table-note {
        margin: 12px 16px;
        font-size: 12px;
    }
    .mobile-table-hint {
        display: block;
        margin: 12px 16px;
        font-size: 11px;
        color: var(--muted);
    }
    .table-footer {
        padding: 16px;
    }
    .pagination {
        gap: 8px;
        font-size: 11px;
    }
    .action-sheet {
        padding: 12px;
    }
}

/* O logotipo permanece visível mesmo nas menores larguras. */
.wordmark .brand-crop {
    display: block;
}

@media (min-width: 801px) {
    .main-nav {
        gap: 22px;
    }
    .main-nav a {
        font-size: 12px;
    }
}

@media (max-width: 800px) {
    .main-nav {
        flex: 1;
        min-width: 0;
        gap: 22px;
        overflow-x: auto;
    }
    .main-nav a {
        flex-shrink: 0;
        white-space: nowrap;
        font-size: 11px;
    }
    .menu-toggle {
        flex-shrink: 0;
    }
}

/* Duas linhas previsíveis no cabeçalho móvel: identidade e conta; navegação e menu. */
.brand-crop {
    height: 96px;
}

@media (max-width: 800px) {
    .app-topbar {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 94px;
        gap: 4px 12px;
    }
    .app-topbar > .wordmark {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
    }
    .brand-crop {
        height: 72px;
    }
    .app-topbar .account {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: end;
        max-width: calc(100% - 125px);
        min-width: 0;
    }
    .app-topbar .account > span {
        min-width: 0;
        overflow-wrap: anywhere;
    }
    .app-topbar .account form {
        flex-shrink: 0;
    }
    .main-nav {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
    }
    .menu-toggle {
        grid-column: 2;
        grid-row: 2;
        justify-content: center;
        padding: 8px;
    }
}


/* A família começa pela escolha da criança. O detalhe reutiliza o painel, sem iframes. */
.children-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 280px));
    gap: 20px;
    margin: 24px 0;
}
.child-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 12px;
    padding: 26px 18px;
    background: #fffaf1;
    border: 1px solid #eadccc;
    border-radius: 22px;
    text-decoration: none;
}
.child-card:hover {
    border-color: #b98028;
    background: #fff2d9;
}
.child-card > strong {
    font-size: 24px;
    overflow-wrap: anywhere;
}
.child-card > span {
    max-width: 100%;
    overflow-wrap: anywhere;
}
.child-card-action {
    font-size: 14px;
    font-weight: 650;
}
.child-avatar {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
}
.child-heading .child-avatar {
    width: 76px;
    height: 76px;
}
.add-child-button {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    border-radius: 14px;
    list-style: none;
    cursor: pointer;
}
.add-child-button::-webkit-details-marker {
    display: none;
}
.family-add {
    margin-bottom: 24px;
}
.school-settings, .directory-bottom {
    padding: 0 24px 24px;
}
.school-code-card {
    max-width: 700px;
    margin-top: 24px;
    padding: 24px;
    border: 1px solid #eadccc;
    border-radius: 18px;
    background: #fffaf1;
}
.school-code-card h3 {
    margin-top: 0;
}
.code-controls {
    display: flex;
    gap: 12px;
}
.code-controls input {
    min-width: 0;
    font: 650 19px monospace;
    letter-spacing: 1px;
}
.code-controls button {
    flex-shrink: 0;
}
.generate-code {
    margin-top: 20px;
}
.back-link {
    display: inline-block;
    min-height: 44px;
}
.record-details dt {
    font-size: 12px;
    color: var(--muted);
    margin-top: 16px;
}
.record-details dd {
    margin: 2px 0 0;
    overflow-wrap: anywhere;
}
@media (min-width: 801px) and (max-width: 1200px) {
    .app-topbar {
        flex-wrap: wrap;
        gap: 0 20px;
    }
    .app-topbar .main-nav {
        order: 3;
        height: 56px;
        flex-basis: 100%;
        overflow-x: auto;
    }
    .main-nav a {
        flex-shrink: 0;
        white-space: nowrap;
    }
}
@media (max-width: 600px) {
    .children-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }
    .child-card {
        padding: 20px 10px;
        gap: 10px;
    }
    .child-card > strong {
        font-size: 20px;
    }
    .child-card > span {
        font-size: 12px;
    }
    .child-card .child-avatar {
        width: 76px;
        height: 76px;
    }
    .school-settings, .directory-bottom {
        padding: 16px;
    }
    .school-code-card {
        padding: 16px;
    }
    .code-controls {
        flex-direction: column;
    }
}

/* Galeria vetorial de avatares, sem classificações por gênero. */
.avatar-picker { border: 1px solid #ded3ca; border-radius: 12px; padding: 16px; margin: 20px 0; min-width: 0; }
.avatar-picker legend { font-weight: 700; color: #63425e; padding: 0 6px; }
.avatar-options { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; max-height: 380px; overflow-y: auto; padding: 5px; }
.avatar-option { position: relative; margin: 0; cursor: pointer; }
.avatar-option > input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.avatar-option > span { display: flex; align-items: center; flex-direction: column; gap: 3px; padding: 6px; border: 3px solid transparent; border-radius: 12px; font-size: .75rem; background: #faf4e8; }
.avatar-option img { display: block; width: 100%; max-width: 90px; height: auto; }
.avatar-option input:checked + span { border-color: #734866; background: #f1e6f1; }
.avatar-option input:checked + span > span::before { content: '✓ '; }
.avatar-option input:focus-visible + span { outline: 3px solid #33241f; outline-offset: 2px; }
.avatar-custom { margin-top: 14px; }
.avatar-picker textarea { width: 100%; resize: vertical; }
