:root {
    --ink: #172033;
    --muted: #64748b;
    --line: #dbe3ef;
    --soft: #f6f8fb;
}

body {
    background: var(--soft);
    color: var(--ink);
}

body.login-body {
    background:
        linear-gradient(
            rgba(15, 23, 42, var(--login-overlay-strength, 0.68)),
            rgba(15, 23, 42, calc(var(--login-overlay-strength, 0.68) + 0.12))
        ),
        var(--login-bg-image, url("/static/login-bg.jpg")) center / cover no-repeat;
    min-height: 100vh;
}

.login-screen {
    align-items: center;
    display: flex;
    min-height: 100vh;
    padding: 22px;
}

.login-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.7);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    margin: 0 auto;
    max-width: 420px;
    padding: 28px;
    width: 100%;
}

.login-card img {
    display: block;
    height: auto;
    margin: 0 auto 18px;
    max-width: 230px;
    width: 76%;
}

.login-card h1,
.login-card p {
    text-align: center;
}

.login-card h1 {
    font-size: 1.7rem;
    margin-bottom: 4px;
}

.login-card p,
.login-card small {
    color: var(--muted);
}

.login-card small {
    display: block;
    margin-top: 18px;
    text-align: center;
}

.navbar {
    min-height: 64px;
}

.app-topbar {
    background: #0d6efd;
    box-shadow: 0 14px 36px rgba(29, 78, 216, 0.22);
    position: sticky;
    top: 0;
    z-index: 40;
}

.navbar .container-fluid {
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.brand-link {
    align-items: center;
    display: flex;
    flex: 0 0 auto;
    gap: 12px;
    margin-right: 26px;
    max-width: 280px;
    min-width: 0;
}

.brand-link img {
    background: #fff;
    border-radius: 4px;
    display: block;
    flex: 0 0 auto;
    height: 38px;
    object-fit: contain;
    padding: 2px 4px;
    width: 104px;
}

.brand-link span {
    color: #fff;
    display: block;
    font-size: 1rem;
    line-height: 1.1;
    white-space: nowrap;
}

.brand-link::after {
    background: rgba(255, 255, 255, 0.3);
    content: "";
    display: block;
    height: 28px;
    margin-left: 10px;
    width: 1px;
}

.navbar .nav-link {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.88rem;
    padding-left: 0.48rem;
    padding-right: 0.48rem;
}

.navbar .nav-link:hover,
.navbar .nav-link:focus {
    color: #fff;
}

.navbar-nav {
    align-items: center;
    gap: 8px;
}

.navbar-collapse {
    min-width: 0;
}

.app-topbar .dropdown-menu {
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 10px;
    box-shadow: 0 18px 40px rgba(15, 23, 42, 0.16);
    margin-top: 10px;
    min-width: 220px;
    padding: 8px;
}

.app-topbar .dropdown-item {
    border-radius: 8px;
    color: #172033;
    font-size: 0.9rem;
    font-weight: 700;
    padding: 9px 11px;
}

.app-topbar .dropdown-item:hover,
.app-topbar .dropdown-item:focus {
    background: #e8f1ff;
    color: #0d6efd;
}

.topbar-actions {
    align-items: center;
    display: flex;
    gap: 8px;
    margin-left: auto;
}

.home-pill {
    align-items: center;
    background: rgba(255, 255, 255, 0.16);
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    color: #fff;
    display: inline-flex;
    font-size: 0.86rem;
    font-weight: 800;
    gap: 6px;
    margin-right: 10px;
    padding: 8px 12px;
    text-decoration: none;
}

.home-pill svg {
    height: 17px;
    width: 17px;
}

.user-chip {
    align-items: center;
    display: flex;
    gap: 10px;
}

.logout-pill {
    border-radius: 999px;
    color: #fff;
    font-weight: 600;
    margin-left: auto;
    padding: 8px 10px;
    text-decoration: none;
    white-space: nowrap;
}

.logout-pill:hover,
.home-pill:hover {
    background: rgba(255, 255, 255, 0.24);
    color: #fff;
}

.page-shell {
    max-width: 1320px;
    padding: 24px;
}

.editor-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(0, 1fr) 340px;
}

.code-area {
    font-family: Consolas, "Courier New", monospace;
    font-size: 0.92rem;
    line-height: 1.55;
}

.admin-list {
    display: grid;
    gap: 10px;
}

.admin-list a {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    display: grid;
    gap: 3px;
    padding: 12px 14px;
    text-decoration: none;
}

.admin-list a.active,
.admin-list a:hover {
    border-color: #0d6efd;
    box-shadow: 0 12px 28px rgba(13, 110, 253, 0.1);
}

.admin-list span {
    color: var(--muted);
    font-size: 0.85rem;
}

.appearance-layout {
    display: grid;
    gap: 22px;
    grid-template-columns: minmax(320px, 460px) 1fr;
}

.appearance-form {
    align-self: start;
}

.appearance-preview {
    align-self: start;
}

.login-preview {
    align-items: center;
    background:
        linear-gradient(
            rgba(15, 23, 42, var(--login-overlay-strength, 0.68)),
            rgba(15, 23, 42, calc(var(--login-overlay-strength, 0.68) + 0.12))
        ),
        var(--login-bg-image, url("/static/login-bg.jpg")) center / cover no-repeat;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    display: flex;
    justify-content: center;
    min-height: 430px;
    overflow: hidden;
    padding: 28px;
}

.login-preview-card {
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(255, 255, 255, 0.72);
    border-radius: 18px;
    box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
    display: grid;
    gap: 6px;
    justify-items: center;
    max-width: 330px;
    padding: 24px;
    text-align: center;
    width: 100%;
}

.login-preview-card img {
    max-width: 190px;
    width: 74%;
}

.login-preview-card strong {
    color: var(--ink);
    font-size: 1.35rem;
}

.login-preview-card span {
    color: var(--muted);
    font-size: 0.92rem;
}

.messages {
    margin-bottom: 16px;
}

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

.page-header h1 {
    font-size: 1.75rem;
    margin: 0;
}

.page-header p {
    color: var(--muted);
    margin: 4px 0 0;
}

.brand-panel {
    align-items: center;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    gap: 18px;
    margin-bottom: 18px;
    padding: 16px 18px;
}

.brand-panel img {
    flex: 0 0 auto;
    height: 72px;
    object-fit: contain;
    width: 230px;
}

.brand-panel strong,
.brand-panel span {
    display: block;
}

.brand-panel strong {
    font-size: 1.08rem;
}

.brand-panel span {
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.35;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.stat-card,
.content-band,
.form-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.stat-card {
    padding: 18px;
}

.stat-card span {
    color: var(--muted);
    display: block;
    font-size: 0.9rem;
}

.stat-card strong {
    display: block;
    font-size: 2rem;
    line-height: 1.1;
    margin-top: 8px;
}

.dashboard-stat-link {
    color: inherit;
    text-decoration: none;
}

.dashboard-stat-link:hover {
    border-color: #9ec5fe;
    box-shadow: 0 10px 26px rgba(13, 110, 253, 0.1);
    color: inherit;
}

.section-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin: 0 0 14px;
}

.quick-actions {
    display: grid;
    gap: 10px;
}

.content-band {
    padding: 18px;
    margin-bottom: 18px;
}

.two-columns {
    display: grid;
    grid-template-columns: minmax(260px, 360px) 1fr;
    gap: 18px;
}

.form-panel {
    padding: 16px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.span-2 {
    grid-column: span 2;
}

.form-actions {
    display: flex;
    gap: 10px;
}

.check-grid,
.quantity-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.toolbar-form {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.toolbar-form .form-control,
.toolbar-form .form-select {
    width: auto;
    min-width: 120px;
}

.toolbar-form .ministry-filter {
    min-width: 220px;
}

.toolbar-form .grow-field {
    flex: 1 1 260px;
    min-width: 220px;
}

.catalog-grid {
    display: grid;
    gap: 18px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.compact-table {
    font-size: 0.92rem;
}

.availability-mobile-calendar {
    display: none;
}

.availability-mobile-summary {
    align-items: flex-start;
    display: flex;
    gap: 12px;
    justify-content: space-between;
}

.availability-mobile-summary .eyebrow {
    color: var(--muted);
    display: block;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.availability-weekdays,
.availability-calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, minmax(0, 1fr));
}

.availability-weekdays {
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    text-align: center;
}

.availability-day,
.availability-day-spacer {
    aspect-ratio: 1;
}

.availability-day {
    align-items: center;
    background: #eef6ff;
    border: 1px solid #d7e8ff;
    border-radius: 14px;
    color: #0b3b8f;
    display: flex;
    flex-direction: column;
    font-weight: 900;
    justify-content: center;
    line-height: 1.05;
    min-width: 0;
    padding: 4px;
    transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.15s ease;
}

.availability-day small {
    color: inherit;
    font-size: 0.64rem;
    font-weight: 800;
    opacity: 0.72;
}

.availability-day.is-unavailable {
    background: #fff1f2;
    border-color: #fb7185;
    color: #be123c;
}

.availability-calendar-hint {
    color: var(--muted);
    font-size: 0.84rem;
    line-height: 1.35;
    margin: 0;
}

.inline-edit {
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    gap: 8px;
}

.manual-row td {
    background: #fff8e1;
}

.scale-groups {
    display: grid;
    gap: 14px;
}

.scale-group-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
}

.scale-group-head {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px;
}

.scale-group-head strong,
.scale-group-head span {
    display: block;
}

.scale-group-head strong {
    font-size: 1rem;
}

.scale-group-head span {
    color: var(--muted);
    font-size: 0.9rem;
}

.scale-group-meta {
    align-items: flex-end;
    display: flex;
    flex-direction: column;
    gap: 3px;
    white-space: nowrap;
}

.scale-group-meta span:first-child {
    color: var(--ink);
    font-size: 1rem;
    font-weight: 800;
}

.scale-function-list {
    display: grid;
}

.scale-function-block {
    display: grid;
    grid-template-columns: 180px 1fr;
}

.scale-function-block + .scale-function-block {
    border-top: 1px solid var(--line);
}

.scale-function-title {
    background: #f8fafc;
    border-right: 1px solid var(--line);
    font-weight: 800;
    padding: 12px 14px;
}

.scale-person-list {
    display: grid;
}

.scale-person-row {
    align-items: center;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(180px, 1fr) minmax(220px, 320px) auto;
    padding: 8px 10px;
}

.scale-person-row + .scale-person-row {
    border-top: 1px solid #eef2f7;
}

.scale-person-row.manual-row {
    background: #fff8e1;
}

.scale-person-name {
    font-weight: 600;
}

.audit-details {
    max-width: 460px;
    word-break: break-word;
}

.mobile-card-list {
    display: grid;
    gap: 12px;
}

.scale-card {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 12px;
    padding: 16px;
}

.scale-card strong,
.scale-card span {
    display: block;
}

.scale-card span {
    color: var(--muted);
}

.message-template {
    font-family: Consolas, "Courier New", monospace;
    min-height: 220px;
}

.variable-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.variable-list code {
    background: #eef4ff;
    border-radius: 999px;
    color: #1d4ed8;
    padding: 5px 9px;
}

.reminder-card pre {
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 10px;
    color: var(--ink);
    font-family: inherit;
    font-size: 0.92rem;
    margin: 0;
    padding: 12px;
    white-space: pre-wrap;
}

.audit-badge {
    text-transform: uppercase;
}

.audit-badge.critico {
    background: #dc2626;
    color: #fff;
}

.audit-badge.alerta {
    background: #f59e0b;
    color: #111827;
}

.audit-badge.aviso {
    background: #0ea5e9;
    color: #fff;
}

.saints-document {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
    margin: 0 auto 28px;
    max-width: 1040px;
    overflow: hidden;
    position: relative;
}

.saints-arrow {
    align-items: center;
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(226, 232, 240, 0.9);
    border-radius: 50%;
    box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
    color: #0d6efd;
    display: flex;
    height: 44px;
    justify-content: center;
    position: absolute;
    text-decoration: none;
    top: 42px;
    transition: transform 0.16s ease, box-shadow 0.16s ease;
    width: 44px;
    z-index: 4;
}

.saints-arrow:hover {
    background: #0d6efd;
    box-shadow: 0 16px 34px rgba(13, 110, 253, 0.26);
    color: #fff;
    transform: translateY(-1px);
}

.saints-arrow-left {
    left: 18px;
}

.saints-arrow-right {
    right: 18px;
}

.saints-arrow svg {
    height: 24px;
    width: 24px;
}

.saints-dots {
    align-items: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    padding: 14px 20px 0;
}

.saints-dots a {
    background: #cbd5e1;
    border-radius: 999px;
    display: block;
    height: 8px;
    text-decoration: none;
    transition: width 0.18s ease, background 0.18s ease;
    width: 8px;
}

.saints-dots a.active {
    background: #0d6efd;
    width: 26px;
}

.saints-admin-actions {
    display: flex;
    justify-content: flex-end;
    padding: 0 42px 6px;
}

.saints-admin-actions .btn {
    align-items: center;
    display: inline-flex;
    gap: 6px;
}

.saints-header {
    align-items: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0b3b8f 100%);
    color: #fff;
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 34px 42px;
}

.saints-header img {
    background: #fff;
    border-radius: 6px;
    height: auto;
    padding: 8px 10px;
    width: 190px;
}

.saints-kicker {
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.saints-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: 0;
    line-height: 1.05;
    margin: 0;
}

.saints-header p {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1rem;
    margin: 10px 0 0;
}

.saint-profile {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(260px, 340px) 1fr;
    padding: 34px 42px 18px;
}

.saint-portrait {
    margin: 0;
}

.saint-portrait img {
    aspect-ratio: 1;
    border-radius: 8px;
    box-shadow: 0 18px 42px rgba(15, 23, 42, 0.18);
    display: block;
    object-fit: cover;
    width: 100%;
}

.saint-portrait-guadalupe img {
    aspect-ratio: 3 / 4;
    background: #f8fafc;
    object-fit: contain;
}

.saint-portrait-aparecida img {
    aspect-ratio: 1;
    background: #eef7ff;
    object-fit: contain;
}

.saint-portrait-sao-jose img {
    aspect-ratio: 3 / 4;
    background: #f8fafc;
    object-fit: cover;
}

.saint-portrait figcaption {
    color: var(--muted);
    font-size: 0.8rem;
    line-height: 1.35;
    margin-top: 10px;
}

.saint-summary {
    align-self: start;
    border-left: 4px solid #0d6efd;
    padding-left: 22px;
}

.saint-summary h2,
.saint-text h2 {
    color: #0b3b8f;
    font-size: 1.22rem;
    font-weight: 800;
    margin: 0 0 14px;
}

.saint-summary dl {
    display: grid;
    gap: 10px;
    margin: 0;
}

.saint-summary dl div {
    border-bottom: 1px solid #e6edf7;
    padding-bottom: 9px;
}

.saint-summary dt {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.saint-summary dd {
    color: var(--ink);
    font-weight: 700;
    margin: 2px 0 0;
}

.saint-text {
    columns: 2 330px;
    column-gap: 42px;
    padding: 10px 42px 34px;
}

.saint-text section {
    break-inside: avoid;
    margin: 0 0 22px;
}

.saint-text p {
    color: #243044;
    font-size: 0.98rem;
    line-height: 1.68;
    margin: 0 0 12px;
    text-align: justify;
}

.saints-footer {
    background: #f8fafc;
    border-top: 1px solid var(--line);
    color: var(--muted);
    display: grid;
    gap: 4px;
    padding: 18px 42px;
}

.saints-footer strong {
    color: var(--ink);
}

.app-dashboard {
    margin: 0 auto;
    max-width: 1100px;
}

.mobile-dashboard {
    display: none;
}

.app-title-card {
    background: #fff;
    border: 1px solid rgba(226, 232, 240, 0.86);
    border-radius: 18px;
    box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
    margin-bottom: 26px;
    padding: 18px 22px;
}

.app-title-card h1 {
    font-size: 1.42rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.app-grid {
    display: grid;
    gap: 32px 38px;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    padding: 0 8px 28px;
}

.app-shortcut {
    align-items: center;
    color: #1f2937;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 104px;
    text-align: center;
    text-decoration: none;
}

.app-shortcut span {
    align-items: center;
    border-radius: 18px;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
    display: flex;
    height: 58px;
    justify-content: center;
    width: 58px;
}

.app-shortcut svg {
    height: 25px;
    stroke-width: 2.2;
    width: 25px;
}

.app-shortcut strong {
    color: #1f2937;
    display: block;
    font-size: 0.82rem;
    font-weight: 800;
    line-height: 1.12;
    max-width: 104px;
}

.app-shortcut.blue span {
    background: #e8f5ff;
}

.app-shortcut.blue svg {
    color: #1d8ae8;
}

.app-shortcut.green span {
    background: #dcffe7;
}

.app-shortcut.green svg {
    color: #139a52;
}

.app-shortcut.amber span {
    background: #fff0d2;
}

.app-shortcut.amber svg {
    color: #cf5f11;
}

.app-shortcut.purple span {
    background: #f2e8ff;
}

.app-shortcut.purple svg {
    color: #7c3aed;
}

.app-shortcut.cover-shortcut span {
    background: #ffffff;
    overflow: hidden;
    padding: 0;
}

.app-shortcut.cover-shortcut img {
    display: block;
    height: 100%;
    object-fit: cover;
    width: 100%;
}

.literature-shell {
    margin: 0 auto 36px;
    max-width: 1120px;
}

.literature-hero {
    align-items: center;
    background: linear-gradient(135deg, #0d6efd 0%, #0b3b8f 100%);
    border-radius: 8px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.1);
    color: #fff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 30px 34px;
}

.literature-hero img {
    background: #fff;
    border-radius: 6px;
    height: auto;
    padding: 8px 10px;
    width: 180px;
}

.literature-kicker {
    color: rgba(255, 255, 255, 0.82);
    display: block;
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.literature-hero h1,
.reader-header h2 {
    font-weight: 800;
    letter-spacing: 0;
    margin: 0;
}

.literature-hero p {
    color: rgba(255, 255, 255, 0.9);
    margin: 10px 0 0;
    max-width: 680px;
}

.literature-grid {
    display: grid;
    gap: 18px;
}

.literature-search {
    align-items: end;
    display: flex;
    gap: 10px;
    margin-bottom: 18px;
}

.literature-search > div {
    flex: 1 1 360px;
}

.literature-search .btn {
    align-items: center;
    display: inline-flex;
    gap: 7px;
    white-space: nowrap;
}

.search-results {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    margin-bottom: 18px;
    padding: 20px 22px;
}

.search-results h2 {
    font-size: 1.18rem;
    font-weight: 800;
    margin: 0 0 14px;
}

.search-results article {
    border-top: 1px solid #e6edf7;
    padding: 14px 0 4px;
}

.search-results article:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.search-results a {
    font-weight: 800;
}

.search-results .page-hit {
    background: #e8f1ff;
    border-radius: 999px;
    color: #0b3b8f;
    display: inline-flex;
    font-size: 0.78rem;
    margin-right: 8px;
    padding: 4px 9px;
    text-decoration: none;
}

.search-results p {
    color: #334155;
    line-height: 1.55;
    margin: 8px 0;
}

.book-card {
    align-items: stretch;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 26px;
    grid-template-columns: minmax(190px, 240px) 1fr;
    padding: 24px;
}

.book-card.active {
    border-color: #0d6efd;
    box-shadow: 0 18px 44px rgba(13, 110, 253, 0.14);
}

.book-cover {
    align-self: start;
    background: #f8fafc;
    border-radius: 8px;
    box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
    display: block;
    overflow: hidden;
}

.book-cover img {
    display: block;
    height: auto;
    width: 100%;
}

.book-cover-placeholder {
    align-items: center;
    aspect-ratio: 3 / 4;
    background: linear-gradient(160deg, #f8fafc, #e8f1ff);
    color: #0b3b8f;
    display: flex;
    flex-direction: column;
    font-weight: 800;
    gap: 12px;
    justify-content: center;
    min-height: 260px;
    padding: 18px;
    text-align: center;
}

.book-cover-placeholder svg {
    height: 44px;
    width: 44px;
}

.book-info {
    align-self: center;
}

.book-type {
    background: #e8f1ff;
    border-radius: 999px;
    color: #0b3b8f;
    display: inline-flex;
    font-size: 0.78rem;
    font-weight: 800;
    margin-bottom: 12px;
    padding: 6px 12px;
    text-transform: uppercase;
}

.book-info h2 {
    color: var(--ink);
    font-size: 1.85rem;
    font-weight: 800;
    letter-spacing: 0;
    margin: 0 0 6px;
}

.book-subtitle {
    color: var(--muted);
    font-weight: 700;
}

.book-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.book-actions .btn,
.reader-header .btn {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.book-actions svg {
    height: 18px;
    width: 18px;
}

.reader-panel {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    margin-top: 18px;
    overflow: hidden;
}

.reader-header {
    align-items: center;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 16px;
    justify-content: space-between;
    padding: 18px 22px;
}

.reader-header .literature-kicker {
    color: var(--muted);
    margin-bottom: 4px;
}

.reader-search {
    align-items: center;
    background: #f8fafc;
    border-bottom: 1px solid var(--line);
    display: flex;
    gap: 10px;
    padding: 14px 18px;
}

.reader-search .form-control {
    flex: 1;
}

.reader-search .btn {
    align-items: center;
    display: inline-flex;
    gap: 7px;
}

.reader-panel iframe {
    border: 0;
    display: block;
    height: 72vh;
    width: 100%;
}

.kids-hero {
    align-items: center;
    background: linear-gradient(135deg, #0d6efd 0%, #2f8cff 54%, #ffd166 100%);
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
    color: #fff;
    display: flex;
    gap: 24px;
    justify-content: space-between;
    margin-bottom: 18px;
    padding: 30px 34px;
}

.kids-hero span {
    display: block;
    font-size: 0.82rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.kids-hero h1 {
    font-size: 2.1rem;
    font-weight: 900;
    letter-spacing: 0;
    line-height: 1.08;
    margin: 0;
    max-width: 760px;
}

.kids-hero p {
    color: rgba(255, 255, 255, 0.92);
    margin: 12px 0 0;
    max-width: 760px;
}

.kids-mascot {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 20px;
    color: #0b3b8f;
    display: grid;
    flex: 0 0 170px;
    gap: 4px;
    justify-items: center;
    padding: 22px 16px;
    text-align: center;
}

.kids-mascot img {
    height: 72px;
    object-fit: contain;
    width: 58px;
}

.kids-mascot div {
    display: grid;
    gap: 2px;
}

.kids-summary {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(4, 1fr);
    margin-bottom: 18px;
}

.kids-mobile-nav {
    display: none;
}

.kids-summary div,
.kids-profile,
.kids-badges div,
.kids-history div {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 10px;
}

.kids-summary div {
    padding: 16px 18px;
}

.kids-summary span,
.kids-profile span,
.kids-profile small,
.kids-history span,
.kids-badges span {
    color: var(--muted);
}

.kids-summary strong {
    color: #0b3b8f;
    display: block;
    font-size: 2rem;
    line-height: 1;
    margin-top: 6px;
}

.kids-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: 310px 1fr;
}

.kids-profile {
    display: grid;
    gap: 5px;
    padding: 16px;
}

.kids-profile strong {
    font-size: 1.35rem;
}

.kids-profile p {
    color: #0b3b8f;
    font-size: 0.88rem;
    font-weight: 800;
    margin: 6px 0 0;
}

.kids-progress {
    background: #e8f1ff;
    border-radius: 999px;
    height: 12px;
    margin-top: 8px;
    overflow: hidden;
}

.kids-progress div {
    background: linear-gradient(90deg, #0d6efd, #22c55e);
    height: 100%;
}

.kids-small-form {
    display: grid;
    gap: 10px;
    margin-top: 14px;
}

.kids-admin-details {
    border-top: 1px solid var(--line);
    margin-top: 16px;
    padding-top: 14px;
}

.kids-admin-details summary {
    align-items: center;
    color: #0d6efd;
    cursor: pointer;
    display: flex;
    font-weight: 900;
    justify-content: space-between;
    list-style: none;
}

.kids-admin-details summary::-webkit-details-marker {
    display: none;
}

.kids-admin-details summary::after {
    content: "+";
    font-size: 1.2rem;
}

.kids-admin-details[open] summary::after {
    content: "-";
}

.kids-child-link {
    align-items: center;
    background: #e8f1ff;
    border: 1px solid #bfdbfe;
    border-radius: 10px;
    color: #0b3b8f;
    display: flex;
    font-weight: 900;
    gap: 8px;
    margin-top: 14px;
    padding: 10px 12px;
    text-decoration: none;
}

.kids-child-link svg {
    height: 18px;
    width: 18px;
}

.kids-section-title {
    align-items: center;
    display: flex;
    justify-content: space-between;
    margin-bottom: 16px;
}

.kids-section-title h2 {
    font-size: 1.32rem;
    font-weight: 900;
    margin: 0;
}

.kids-section-title p {
    color: var(--muted);
    margin: 3px 0 0;
}

.kids-missions {
    display: grid;
    gap: 14px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kids-missions-mobile {
    display: none;
}

.kids-mission-card {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 12px;
    display: grid;
    gap: 8px;
    padding: 16px;
}

.kids-mission-card .btn,
.kids-action-card .btn {
    min-height: 44px;
}

.kids-mission-card span {
    color: #0d6efd;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.kids-mission-card h3 {
    font-size: 1.08rem;
    font-weight: 900;
    margin: 0;
}

.kids-mission-card p {
    color: #334155;
    margin: 0;
}

.kids-two {
    display: grid;
    gap: 18px;
    grid-template-columns: 1fr 1fr;
}

.kids-badges {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(5, 1fr);
}

.kids-badges div {
    align-items: center;
    display: grid;
    gap: 6px;
    justify-items: center;
    opacity: 0.45;
    padding: 14px 10px;
    text-align: center;
}

.kids-badges div.active {
    background: #fffdf3;
    border-color: #facc15;
    opacity: 1;
}

.kids-badges svg {
    color: #f59e0b;
    height: 30px;
    width: 30px;
}

.kids-badges strong {
    font-size: 0.9rem;
}

.kids-badges span {
    font-size: 0.78rem;
    line-height: 1.25;
}

.kids-history {
    display: grid;
    gap: 10px;
}

.kids-history div {
    padding: 12px 14px;
}

.kids-history p {
    margin: 7px 0 0;
}

.kids-link-grid {
    display: grid;
    gap: 16px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.kids-link-card {
    display: grid;
    gap: 12px;
}

.kids-link-card span {
    color: #0d6efd;
    font-size: 0.76rem;
    font-weight: 900;
    text-transform: uppercase;
}

.kids-link-card h2 {
    font-size: 1.22rem;
    font-weight: 900;
    margin: 0;
}

.kids-link-card p {
    color: var(--muted);
    margin: 0;
}

.kids-coordination-layout {
    display: grid;
    gap: 18px;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 0.62fr);
    margin-bottom: 18px;
}

.kids-toggle-form {
    align-items: center;
    display: grid;
    gap: 14px;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.switch-line {
    align-items: center;
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    display: inline-flex;
    font-weight: 900;
    gap: 8px;
    padding: 8px 12px;
    white-space: nowrap;
}

.switch-line input {
    accent-color: #0d6efd;
    height: 18px;
    width: 18px;
}

.kids-qr-preview {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 14px;
    height: 132px;
    object-fit: contain;
    padding: 8px;
    width: 132px;
}

.kids-copy-row {
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.kids-copy-input {
    color: #334155;
    font-size: 0.86rem;
}

.kid-mode-body {
    background: #f2f7ff;
    color: var(--ink);
}

.kid-mode-shell {
    margin: 0 auto;
    max-width: 520px;
    padding: 14px;
}

.kid-mode-hero,
.kid-mode-card,
.kid-mode-progress {
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 20px;
    box-shadow: 0 14px 32px rgba(15, 23, 42, 0.08);
    margin-bottom: 14px;
    overflow: hidden;
}

.kid-mode-hero {
    background: linear-gradient(135deg, #0d6efd 0%, #37a2ff 56%, #ffd166 100%);
    color: #fff;
    display: grid;
    gap: 14px;
    padding: 22px;
}

.kid-mode-hero span {
    display: block;
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    text-transform: uppercase;
}

.kid-mode-hero h1 {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: 0;
    margin: 0;
}

.kid-mode-hero p {
    color: rgba(255, 255, 255, 0.92);
    margin: 8px 0 0;
}

.kid-mode-mascot {
    align-items: center;
    background: rgba(255, 255, 255, 0.94);
    border-radius: 16px;
    color: #0b3b8f;
    display: flex;
    gap: 10px;
    padding: 12px;
}

.kid-mode-mascot img {
    height: 76px;
    object-fit: contain;
    width: 56px;
}

.kid-mode-mascot div {
    display: grid;
    gap: 2px;
}

.kid-mode-progress {
    padding: 16px;
}

.kid-mode-progress span {
    color: var(--muted);
    font-weight: 800;
}

.kid-mode-progress strong {
    color: #0b3b8f;
    display: block;
    font-size: 2.2rem;
    line-height: 1;
}

.kid-mode-progress p {
    color: #0b3b8f;
    font-weight: 900;
    margin: 10px 0 0;
}

.kid-mode-card {
    padding: 16px;
}

.kid-mode-card > svg {
    color: #0d6efd;
    height: 42px;
    margin-bottom: 10px;
    width: 42px;
}

.kid-mode-card h2 {
    font-size: 1.24rem;
    font-weight: 900;
    margin: 0 0 14px;
}

.kid-mode-missions {
    display: grid;
    gap: 12px;
}

.kid-mode-more,
.kids-more-missions {
    border-top: 1px solid var(--line);
    margin-top: 14px;
    padding-top: 12px;
}

.kid-mode-more summary,
.kids-more-missions summary {
    color: #0d6efd;
    cursor: pointer;
    font-weight: 900;
    list-style: none;
}

.kid-mode-more summary::-webkit-details-marker,
.kids-more-missions summary::-webkit-details-marker {
    display: none;
}

.kid-mode-more summary::after,
.kids-more-missions summary::after {
    content: " +";
}

.kid-mode-more[open] summary,
.kids-more-missions[open] summary {
    margin-bottom: 12px;
}

.kid-mode-more[open] summary::after,
.kids-more-missions[open] summary::after {
    content: " -";
}

.kid-mode-missions form {
    background: #f8fbff;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    display: grid;
    gap: 8px;
    padding: 14px;
}

.kid-mode-missions span {
    color: #0d6efd;
    font-size: 0.78rem;
    font-weight: 900;
    text-transform: uppercase;
}

.kid-mode-missions h3 {
    font-size: 1.05rem;
    font-weight: 900;
    margin: 0;
}

.kid-mode-missions p {
    color: #334155;
    margin: 0;
}

.kid-mode-card .btn {
    min-height: 48px;
}

.kid-mode-badges {
    display: grid;
    gap: 10px;
    grid-template-columns: repeat(2, 1fr);
}

.kid-mode-badges div {
    align-items: center;
    background: #f8fafc;
    border: 1px solid var(--line);
    border-radius: 14px;
    display: grid;
    gap: 6px;
    justify-items: center;
    opacity: 0.48;
    padding: 12px 8px;
    text-align: center;
}

.kid-mode-badges div.active {
    background: #fffdf3;
    border-color: #facc15;
    opacity: 1;
}

.kid-mode-badges svg {
    color: #f59e0b;
    height: 28px;
    width: 28px;
}

.kid-mode-badges strong {
    font-size: 0.82rem;
    line-height: 1.12;
}

.empty-reader {
    align-items: center;
    color: var(--muted);
    display: grid;
    gap: 8px;
    justify-items: center;
    min-height: 260px;
    padding: 32px;
    text-align: center;
}

.empty-reader svg {
    color: #0d6efd;
    height: 42px;
    width: 42px;
}

.empty-reader strong {
    color: var(--ink);
}

@media (max-width: 900px) {
    html {
        overflow-x: hidden;
    }

    body {
        background: #f3f6fb;
        overflow-x: hidden;
        -webkit-font-smoothing: antialiased;
    }

    .navbar {
        min-height: 54px;
    }

    .app-topbar {
        border-bottom-left-radius: 16px;
        border-bottom-right-radius: 16px;
        position: sticky;
        top: 0;
        z-index: 20;
    }

    .app-topbar .container-fluid {
        flex-wrap: nowrap;
        min-height: 54px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .navbar-toggler,
    .navbar-collapse {
        display: none !important;
    }

    .brand-link {
        gap: 8px;
        margin-right: 0;
        max-width: calc(100vw - 88px);
    }

    .brand-link::after {
        display: none;
    }

    .brand-link img {
        height: 36px;
        width: 94px;
    }

    .brand-link span {
        font-size: 0.98rem;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .logout-pill {
        font-size: 0.86rem;
        padding: 7px 8px;
    }

    .page-shell {
        padding: 16px 12px 24px;
    }

    .appearance-layout {
        grid-template-columns: 1fr;
    }

    .editor-layout {
        grid-template-columns: 1fr;
    }

    .login-preview {
        border-radius: 16px;
        min-height: 360px;
        padding: 18px;
    }

    .messages {
        left: 12px;
        position: fixed;
        right: 12px;
        top: 66px;
        z-index: 60;
    }

    .alert {
        border-radius: 14px;
        box-shadow: 0 16px 34px rgba(15, 23, 42, 0.18);
        font-size: 0.92rem;
    }

    .desktop-dashboard {
        display: none;
    }

    .mobile-dashboard {
        display: block;
    }

    .app-dashboard {
        height: auto;
        max-width: 760px;
        overflow: visible;
        padding-bottom: 18px;
    }

    .app-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .stats-grid,
    .two-columns,
    .form-grid,
    .check-grid,
    .quantity-grid,
    .catalog-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 15px 16px;
    }

    .stat-card strong {
        font-size: 1.75rem;
    }

    .span-2 {
        grid-column: span 1;
    }

    .page-header {
        align-items: flex-start;
        background: #fff;
        border: 1px solid rgba(219, 227, 239, 0.9);
        border-radius: 16px;
        box-shadow: 0 10px 24px rgba(15, 23, 42, 0.06);
        flex-direction: column;
        gap: 12px;
        margin-bottom: 14px;
        padding: 16px;
    }

    .page-header h1 {
        font-size: 1.32rem;
        line-height: 1.15;
    }

    .page-header p {
        font-size: 0.92rem;
        line-height: 1.35;
    }

    .page-header .btn {
        width: 100%;
    }

    .brand-panel {
        align-items: flex-start;
        flex-direction: column;
    }

    .brand-panel img {
        height: auto;
        max-width: 100%;
    }

    .content-band,
    .form-panel,
    .stat-card {
        border-radius: 14px;
    }

    .content-band,
    .form-panel {
        box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
        margin-bottom: 14px;
        padding: 15px;
    }

    .form-label {
        font-size: 0.86rem;
        font-weight: 700;
        margin-bottom: 6px;
    }

    .form-control,
    .form-select {
        border-radius: 12px;
        min-height: 44px;
    }

    textarea.form-control {
        min-height: 92px;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .form-actions .btn,
    .content-band > form > .btn,
    .content-band > form .span-2 > .btn,
    .form-panel .btn {
        min-height: 44px;
        width: 100%;
    }

    .form-check {
        align-items: center;
        background: #f8fafc;
        border: 1px solid #e2e8f0;
        border-radius: 12px;
        display: flex;
        gap: 9px;
        min-height: 42px;
        padding: 9px 10px 9px 38px;
    }

    .form-check .form-check-input {
        flex: 0 0 auto;
        float: none;
        margin-left: 0;
        margin-top: 0;
    }

    .form-switch {
        background: transparent;
        border: 0;
        padding-left: 0;
    }

    .check-grid,
    .quantity-grid {
        gap: 8px;
    }

    .toolbar-form {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .toolbar-form .form-control,
    .toolbar-form .form-select,
    .toolbar-form .btn {
        min-height: 44px;
        width: 100%;
    }

    .availability-form.is-own-availability .availability-mobile-calendar {
        background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
        border: 1px solid #dbe8fb;
        border-radius: 18px;
        display: grid;
        gap: 13px;
        margin-bottom: 14px;
        padding: 14px;
    }

    .availability-form.is-own-availability .availability-table-wrapper {
        display: none;
    }

    .availability-mobile-summary {
        align-items: flex-start;
        flex-direction: column;
        gap: 8px;
    }

    .availability-mobile-summary strong {
        color: #082f6f;
    }

    .availability-mobile-summary > span {
        background: #e8f1ff;
        border-radius: 999px;
        color: #0b3b8f;
        font-size: 0.82rem;
        font-weight: 800;
        padding: 6px 10px;
    }

    .availability-preference-mobile {
        display: grid;
        gap: 6px;
    }

    .availability-preference-mobile label {
        color: #475569;
        font-size: 0.84rem;
        font-weight: 800;
    }

    .availability-weekdays,
    .availability-calendar-grid {
        gap: 6px;
    }

    .availability-day:active {
        transform: scale(0.96);
    }

    .table-responsive {
        overflow: visible;
        border-radius: 12px;
    }

    .scale-groups {
        gap: 12px;
    }

    .scale-group-card {
        border-radius: 16px;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
    }

    .scale-group-head {
        align-items: flex-start;
        border-bottom: 0;
        flex-direction: column;
        gap: 8px;
        padding: 14px;
    }

    .scale-group-meta {
        align-items: flex-start;
        flex-direction: row;
        flex-wrap: wrap;
    }

    .scale-group-meta span {
        background: #eef4ff;
        border-radius: 999px;
        color: #1d4ed8;
        font-weight: 800;
        padding: 5px 9px;
    }

    .scale-function-block {
        grid-template-columns: 1fr;
    }

    .scale-function-title {
        border-right: 0;
        border-top: 1px solid var(--line);
        padding: 10px 14px;
    }

    .scale-person-row {
        grid-template-columns: 1fr;
        padding: 12px 14px;
    }

    .scale-person-row .btn,
    .scale-person-row .form-select {
        width: 100%;
    }

    .table-responsive table {
        border-collapse: separate;
        border-spacing: 0 12px;
        margin: 0;
        min-width: 0;
        width: 100%;
    }

    .table-responsive thead {
        display: none;
    }

    .table-responsive tbody,
    .table-responsive tr,
    .table-responsive td {
        display: block;
        width: 100%;
    }

    .table-responsive tr {
        background: #fff;
        border: 1px solid #dbe3ef;
        border-radius: 16px;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
        overflow: hidden;
        padding: 10px 12px;
    }

    .table-responsive td {
        border: 0;
        display: grid;
        gap: 8px;
        grid-template-columns: minmax(92px, 34%) 1fr;
        padding: 8px 0;
        text-align: left !important;
        word-break: break-word;
    }

    .table-responsive td::before {
        color: #64748b;
        content: attr(data-label);
        font-size: 0.76rem;
        font-weight: 800;
        letter-spacing: 0;
        text-transform: uppercase;
    }

    .table-responsive td[data-label=""] {
        display: block;
    }

    .table-responsive td[data-label=""]::before,
    .table-responsive td[colspan]::before {
        display: none;
    }

    .table-responsive td[colspan] {
        display: block;
    }

    .table-responsive .badge {
        justify-self: start;
    }

    .table-actions,
    .inline-edit {
        display: grid;
        gap: 8px;
        grid-template-columns: 1fr;
        width: 100%;
    }

    .table-actions .btn,
    .inline-edit .btn,
    .table-responsive td form .btn {
        min-height: 40px;
        width: 100%;
    }

    .inline-edit .form-select {
        min-width: 0;
        width: 100%;
    }

    .d-flex.justify-content-between.align-items-center {
        align-items: stretch !important;
        flex-direction: column;
        gap: 10px;
    }

    .d-flex.justify-content-between.align-items-center .btn {
        width: 100%;
    }

    .variable-list code {
        border-radius: 10px;
        display: block;
        font-size: 0.78rem;
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .scale-card {
        border-radius: 16px;
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
        padding: 15px;
    }

    .saints-document {
        border-radius: 16px;
    }

    .saints-arrow {
        height: 38px;
        top: 18px;
        width: 38px;
    }

    .saints-arrow-left {
        left: 12px;
    }

    .saints-arrow-right {
        right: 12px;
    }

    .saints-header {
        align-items: flex-start;
        flex-direction: column;
        padding: 62px 18px 22px;
    }

    .saints-header img {
        width: 150px;
    }

    .saints-header h1 {
        font-size: 1.72rem;
    }

    .saint-profile {
        grid-template-columns: 1fr;
        padding: 20px 18px 10px;
    }

    .saint-portrait img {
        margin: 0 auto;
        max-width: 280px;
    }

    .saint-summary {
        border-left: 0;
        border-top: 4px solid #0d6efd;
        padding-left: 0;
        padding-top: 16px;
    }

    .saint-text {
        columns: auto;
        padding: 6px 18px 24px;
    }

    .saint-text p {
        font-size: 0.94rem;
        line-height: 1.58;
        text-align: left;
    }

    .saints-footer {
        padding: 16px 18px;
    }

    .saints-admin-actions {
        padding: 0 18px 8px;
    }

    .literature-hero {
        align-items: flex-start;
        border-radius: 16px;
        flex-direction: column;
        padding: 22px 18px;
    }

    .literature-hero img {
        width: 150px;
    }

    .literature-hero h1 {
        font-size: 1.72rem;
    }

    .literature-search {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .literature-search .btn {
        justify-content: center;
        width: 100%;
    }

    .reader-search {
        align-items: stretch;
        display: grid;
        grid-template-columns: 1fr;
    }

    .reader-search .btn {
        justify-content: center;
        width: 100%;
    }

    .book-card {
        border-radius: 16px;
        gap: 18px;
        grid-template-columns: 1fr;
        padding: 18px;
    }

    .book-cover {
        margin: 0 auto;
        max-width: 210px;
    }

    .book-info {
        text-align: center;
    }

    .book-info h2 {
        font-size: 1.48rem;
    }

    .book-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .book-actions .btn {
        justify-content: center;
        width: 100%;
    }

    .reader-header {
        align-items: stretch;
        flex-direction: column;
        padding: 16px 18px;
    }

    .reader-header .btn {
        justify-content: center;
        width: 100%;
    }

    .reader-panel iframe {
        height: 70vh;
    }

    .kids-hero {
        align-items: stretch;
        border-radius: 16px;
        display: grid;
        gap: 14px;
        padding: 22px 18px;
    }

    .kids-hero h1 {
        font-size: 1.55rem;
    }

    .kids-mascot {
        align-items: center;
        display: flex;
        flex: auto;
        gap: 12px;
        justify-content: flex-start;
        padding: 14px;
        text-align: left;
    }

    .kids-mascot img {
        flex: 0 0 auto;
        height: 70px;
        width: 52px;
    }

    .kids-mobile-nav {
        background: rgba(255, 255, 255, 0.96);
        border: 1px solid var(--line);
        border-radius: 16px;
        box-shadow: 0 12px 28px rgba(15, 23, 42, 0.1);
        display: grid;
        gap: 8px;
        grid-template-columns: repeat(3, 1fr);
        margin: -4px 0 14px;
        padding: 8px;
        position: sticky;
        top: 66px;
        z-index: 15;
    }

    .kids-mobile-nav a {
        align-items: center;
        border-radius: 12px;
        color: #0b3b8f;
        display: flex;
        flex-direction: column;
        font-size: 0.72rem;
        font-weight: 900;
        gap: 4px;
        min-height: 54px;
        justify-content: center;
        text-decoration: none;
    }

    .kids-mobile-nav a:hover,
    .kids-mobile-nav a:focus {
        background: #e8f1ff;
    }

    .kids-mobile-nav svg {
        height: 19px;
        width: 19px;
    }

    .kids-summary,
    .kids-layout,
    .kids-two,
    .kids-badges {
        grid-template-columns: 1fr;
    }

    .kids-missions {
        display: none;
    }

    .kids-missions-mobile {
        display: grid;
        gap: 12px;
    }

    .kids-panel {
        order: -1;
    }

    .kids-panel {
        position: sticky;
        top: 136px;
        z-index: 12;
    }

    .kids-child-select {
        font-size: 1rem;
        font-weight: 800;
        min-height: 46px;
    }

    .kids-summary {
        gap: 10px;
        grid-template-columns: repeat(2, 1fr);
    }

    .kids-summary div {
        padding: 13px;
    }

    .kids-summary strong {
        font-size: 1.65rem;
    }

    .kids-mission-card {
        padding: 15px;
    }

    .kids-mission-card .btn,
    .kids-action-card .btn {
        width: 100%;
    }

    .kids-badges div {
        align-items: center;
        grid-template-columns: 40px 1fr;
        justify-items: start;
        text-align: left;
    }

    .kids-badges div span {
        grid-column: 2;
    }

    .kids-link-grid {
        grid-template-columns: 1fr;
    }

    .kids-coordination-layout,
    .kids-toggle-form,
    .kids-copy-row {
        grid-template-columns: 1fr;
    }

    .kids-toggle-form .btn,
    .kids-copy-row .btn {
        justify-content: center;
        width: 100%;
    }

    .kids-qr-preview {
        height: 112px;
        width: 112px;
    }

    .reminder-card pre,
    .audit-details {
        max-width: 100%;
        overflow-wrap: anywhere;
    }

    .login-screen {
        align-items: center;
        justify-content: center;
        min-height: 100dvh;
        padding: 16px;
    }

    .login-card {
        border-radius: 18px;
        max-width: 340px;
        padding: 18px 16px;
    }

    .login-card img {
        margin-bottom: 12px;
        max-width: 170px;
    }

    .login-card h1 {
        font-size: 1.34rem;
    }

    .login-card p {
        font-size: 0.9rem;
        margin-bottom: 14px;
    }

    .login-card .form-control-lg {
        font-size: 0.98rem;
        min-height: 42px;
        padding: 0.55rem 0.8rem;
    }

    .login-card .btn-lg {
        font-size: 1rem;
        min-height: 44px;
        padding: 0.55rem 1rem;
    }

    .login-card small {
        font-size: 0.74rem;
        margin-top: 12px;
    }
}

@media (max-width: 520px) {
    .login-screen {
        padding: 12px;
    }

    .login-card {
        border-radius: 16px;
        max-width: 292px;
        padding: 14px 13px;
    }

    .login-card img {
        margin-bottom: 8px;
        max-width: 132px;
    }

    .login-card h1 {
        font-size: 1.12rem;
        margin-bottom: 2px;
    }

    .login-card p {
        font-size: 0.78rem;
        line-height: 1.2;
        margin-bottom: 10px;
    }

    .login-card .form-label {
        font-size: 0.76rem;
        margin-bottom: 4px;
    }

    .login-card .form-label.mt-3 {
        margin-top: 8px !important;
    }

    .login-card .form-control-lg {
        border-radius: 10px;
        font-size: 0.88rem;
        min-height: 36px;
        padding: 0.42rem 0.68rem;
    }

    .login-card .btn-lg {
        border-radius: 999px;
        font-size: 0.92rem;
        min-height: 38px;
        padding: 0.42rem 0.8rem;
    }

    .login-card .btn.mt-4 {
        margin-top: 14px !important;
    }

    .login-card small {
        display: none;
    }

    .app-dashboard {
        max-width: 100%;
    }

    .app-topbar {
        border-bottom-left-radius: 12px;
        border-bottom-right-radius: 12px;
    }

    .app-title-card {
        border-radius: 12px;
        margin: 0 2px 26px;
        padding: 15px 14px;
    }

    .app-title-card h1 {
        font-size: 1.18rem;
    }

    .app-grid {
        gap: 26px 18px;
        grid-template-columns: repeat(3, minmax(0, 1fr));
        padding: 0 2px 24px;
    }

    .app-shortcut {
        min-height: 96px;
    }

    .app-shortcut span {
        border-radius: 15px;
        height: 56px;
        width: 56px;
    }

    .app-shortcut strong {
        font-size: 0.68rem;
        max-width: 92px;
    }
}
