:root {
    --navy: #09213f;
    --navy-2: #12345b;
    --teal: #147d73;
    --teal-soft: #dff5f1;
    --amber: #c22525;
    --amber-soft: #fddada;
    --red: #b84545;
    --red-soft: #fde8e8;
    --blue-soft: #e7f0ff;
    --paper: #fffdf8;
    --mist: #f3f7f6;
    --ink: #132238;
    --muted: #607086;
    --line: #dbe4ea;
    --radius: 24px;
    --shadow: 0 24px 70px rgba(9, 33, 63, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
    margin: 0;
    color: var(--ink);
    background: radial-gradient(circle at top left, #e9fbf7 0, transparent 34rem), linear-gradient(180deg, #fbfcfa 0%, #eef6f5 100%);
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.6;
}
a { color: inherit; }
.skip-link { position: absolute; left: -999px; top: 1rem; background: var(--navy); color: white; padding: .75rem 1rem; border-radius: 999px; z-index: 10; }
.skip-link:focus { left: 1rem; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.shell { width: min(1120px, calc(100% - 2rem)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 5; backdrop-filter: blur(18px); background: rgba(255, 253, 248, .82); border-bottom: 1px solid rgba(219, 228, 234, .75); }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 76px; gap: 1rem; }
.brand { display: inline-flex; align-items: center; gap: .7rem; text-decoration: none; font-weight: 800; color: var(--navy); }
.brand-mark { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 14px; color: white; background: linear-gradient(135deg, var(--navy), var(--teal)); box-shadow: 0 10px 30px rgba(20, 125, 115, .25); }
.main-nav { display: flex; align-items: center; gap: 1rem; font-weight: 700; font-size: .95rem; }
.main-nav a { text-decoration: none; color: var(--navy-2); }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 46px; padding: .8rem 1.1rem; border-radius: 999px; color: white; background: var(--teal); text-decoration: none; font-weight: 800; box-shadow: 0 14px 34px rgba(20, 125, 115, .23); border: 0; cursor: pointer; }
.button:hover, .button:focus-visible { background: #0f6c64; }
.button-secondary { color: var(--navy); background: white; border: 1px solid var(--line); box-shadow: none; }
.button-small { min-height: 38px; padding: .55rem .85rem; color: white !important; }
.hero { padding: clamp(4rem, 8vw, 7rem) 0 3.5rem; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(280px, .65fr); gap: clamp(2rem, 6vw, 4.5rem); align-items: center; }
.eyebrow { margin: 0 0 .85rem; color: var(--teal); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-weight: 900; }
h1, h2, h3 { color: var(--navy); line-height: 1.08; margin: 0 0 1rem; }
h1 { font-size: clamp(2.45rem, 7vw, 5rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.8rem, 4vw, 3rem); letter-spacing: -.04em; }
h3 { font-size: 1.2rem; }
.hero-text { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--muted); max-width: 64ch; }
.hero-actions, .trust-list { display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; }
.trust-list { list-style: none; padding: 0; margin: 1.5rem 0 0; color: var(--navy-2); font-weight: 750; }
.trust-list li { padding: .45rem .75rem; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 999px; }
.hero-card { padding: 1.25rem; border: 1px solid rgba(255,255,255,.85); border-radius: 32px; background: rgba(255,255,255,.74); box-shadow: var(--shadow); }
.mini-card { display: flex; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: 20px; margin-bottom: .8rem; background: var(--blue-soft); font-weight: 800; }
.mini-card span { color: var(--muted); font-weight: 700; }
.mini-card.danger { background: var(--red-soft); color: var(--red); }
.mini-card.warning { background: var(--amber-soft); color: var(--amber); }
.mini-card.success { background: var(--teal-soft); color: var(--teal); }
.section { padding: 4.5rem 0; }
.section-soft { background: rgba(255,255,255,.55); border-block: 1px solid rgba(219, 228, 234, .7); }
.feature-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.feature-grid article, .notice, details, .empty-state { padding: 1.25rem; border-radius: var(--radius); background: rgba(255,255,255,.82); border: 1px solid var(--line); box-shadow: 0 12px 32px rgba(9, 33, 63, .06); }
.advisor-index-section {
    background: linear-gradient(180deg, rgba(255,255,255,.66), rgba(241,247,246,.82));
}
.advisor-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}
.advisor-card {
    display: flex;
    flex-direction: column;
    min-height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255,255,255,.88);
    box-shadow: 0 14px 34px rgba(9,33,63,.07);
}
.advisor-card-kicker {
    margin: 0 0 .55rem;
    color: var(--teal);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .1em;
    text-transform: uppercase;
}
.advisor-card-title {
    margin: 0 0 .65rem;
    font-size: 1.18rem;
    line-height: 1.22;
    letter-spacing: 0;
}
.advisor-card-link {
    color: var(--navy);
    text-decoration: none;
}
.advisor-card-link:hover,
.advisor-card-link:focus-visible {
    color: var(--teal);
}
.advisor-card-excerpt {
    margin: 0 0 1rem;
    color: var(--muted);
}
.advisor-card-cta {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    margin-top: auto;
    color: var(--teal);
    font-weight: 850;
    text-decoration: none;
}
.advisor-card-cta:hover,
.advisor-card-cta:focus-visible {
    color: var(--navy);
}
.split { display: grid; grid-template-columns: 1fr .7fr; gap: 2rem; align-items: center; }
.notice { border-color: #f2b7b7; background: var(--amber-soft); color: #7a2525; font-weight: 750; }
.faq { max-width: 780px; }
details + details { margin-top: .8rem; }
summary { cursor: pointer; font-weight: 850; color: var(--navy); }
.site-footer { padding: 2.5rem 0; background: var(--navy); color: white; }
.footer-grid { display: flex; justify-content: space-between; gap: 2rem; flex-wrap: wrap; }
.site-footer nav { display: flex; gap: 1rem; flex-wrap: wrap; }
.site-footer a { color: white; }
@media (max-width: 820px) {
    .header-inner, .main-nav, .footer-grid { align-items: flex-start; }
    .header-inner { flex-direction: column; padding: 1rem 0; }
    .main-nav { width: 100%; overflow-x: auto; padding-bottom: .3rem; }
    .hero-grid, .feature-grid, .advisor-card-grid, .split { grid-template-columns: 1fr; }
    .hero { padding-top: 2.5rem; }
}
@media print {
    .site-header, .site-footer, .hero-actions { display: none; }
    body { background: white; color: black; }
    .shell { width: 100%; }
}
.page-hero { padding-top: clamp(3rem, 7vw, 5.5rem); }
.hero-card h2 { font-size: 1.35rem; letter-spacing: -.02em; }
.mini-card.info { background: var(--blue-soft); color: var(--navy-2); }
.status-stack { display: grid; gap: .7rem; }
.status-pill, .pill { display: inline-flex; align-items: center; width: fit-content; border-radius: 999px; padding: .55rem .85rem; font-weight: 850; border: 1px solid var(--line); background: white; }
.status-pill.success { color: var(--teal); background: var(--teal-soft); border-color: #a8ddd5; }
.status-pill.warning { color: var(--amber); background: var(--amber-soft); border-color: #f2b7b7; }
.status-pill.danger { color: var(--red); background: var(--red-soft); border-color: #f2b7b7; }
.status-pill.info { color: var(--navy-2); background: var(--blue-soft); border-color: #bfd3f6; }
.status-pill.muted { color: #657080; background: #eef2f4; }
.pill-row { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1rem; }
.pill { color: var(--navy-2); box-shadow: 0 8px 20px rgba(9, 33, 63, .05); }
.pricing-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin-top: 2rem; }
.pricing-grid article, .form-card, .legal-page { padding: 1.35rem; border-radius: var(--radius); background: rgba(255,255,255,.86); border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(9,33,63,.07); }
.pricing-grid strong { display: block; color: var(--teal); font-size: 1.35rem; margin-bottom: .5rem; }
.plain-list { padding-left: 1.2rem; }
.form-card { max-width: 740px; }
.form-card label { display: block; color: var(--navy); font-weight: 850; margin: 1rem 0 .35rem; }
.form-card input[type="email"], .form-card input[type="text"] { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: .9rem 1rem; font: inherit; background: white; }
.check-group { display: grid; gap: .55rem; margin: .9rem 0; }
.check-row, .checkline, .switch-row {
    display: flex !important;
    align-items: flex-start;
    gap: .65rem;
    min-width: 0;
    width: 100%;
    color: var(--navy);
    font-weight: 750 !important;
    line-height: 1.38;
    margin: .3rem 0 !important;
    cursor: pointer;
}
.check-row input[type="checkbox"], .check-row input[type="radio"],
.checkline input[type="checkbox"], .checkline input[type="radio"],
.switch-row input[type="checkbox"], .switch-row input[type="radio"] {
    flex: 0 0 1.05rem;
    width: 1.05rem !important;
    height: 1.05rem;
    margin: .22rem 0 0 !important;
    padding: 0 !important;
    cursor: pointer;
}
.check-row span, .checkline span, .switch-row span { min-width: 0; overflow-wrap: anywhere; }
.check-row:focus-within, .checkline:focus-within, .switch-row:focus-within { outline: 3px solid rgba(20,125,115,.18); outline-offset: 4px; border-radius: 12px; }
.danger-button { background: var(--red); box-shadow: 0 14px 34px rgba(184, 69, 69, .22); }
.danger-button:disabled { opacity: .45; cursor: not-allowed; box-shadow: none; }
.legal-page { max-width: 860px; }
@media (max-width: 820px) {
    .pricing-grid { grid-template-columns: 1fr; }
}
.inline-form { display: inline; margin: 0; }
.link-button { appearance: none; border: 0; background: transparent; color: var(--teal); font: inherit; font-weight: 850; padding: 0; cursor: pointer; text-decoration: underline; }
.alert { margin: 1rem 0; border-radius: 18px; padding: 1rem; border: 1px solid var(--line); background: white; font-weight: 750; }
.alert-success { color: #0f5c55; background: var(--teal-soft); border-color: #a8ddd5; }
.alert-error { color: #7a2525; background: var(--red-soft); border-color: #f2b7b7; }
.alert-warning { color: #7a2525; background: var(--amber-soft); border-color: #f2b7b7; }
.alert-info { color: var(--navy-2); background: var(--blue-soft); border-color: #bfd3f6; }
.muted { color: var(--muted); }
.auth-shell { max-width: 760px; }
.auth-page .auth-shell { display: grid; place-items: center; }
.auth-card { width: min(100%, 620px); margin-inline: auto; }
.app-body { background: linear-gradient(180deg, #eef6f5 0%, #fbfcfa 100%); }
.app-topbar { position: sticky; top: 0; z-index: 6; display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: .85rem max(1rem, calc((100vw - 1180px) / 2)); background: rgba(255,253,248,.9); backdrop-filter: blur(18px); border-bottom: 1px solid var(--line); }
.app-topnav { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; font-weight: 800; }
.app-topnav a { text-decoration: none; color: var(--navy-2); }
.nav-group { display: inline-flex; align-items: center; gap: .55rem; flex-wrap: wrap; }
.nav-secondary { padding-left: .75rem; border-left: 1px solid var(--line); }
.app-topnav a, .app-topnav .link-button { padding: .42rem .58rem; border-radius: 999px; }
.app-topnav a:hover, .app-topnav a:focus-visible, .app-topnav .link-button:hover, .app-topnav .link-button:focus-visible { background: rgba(20,125,115,.1); color: var(--teal); }
.nav-cta { color: white !important; background: var(--teal); box-shadow: 0 10px 24px rgba(20,125,115,.18); }
.nav-cta:hover, .nav-cta:focus-visible { background: #0f6c64 !important; color: white !important; }
.admin-nav-link { color: #7a2525 !important; background: var(--amber-soft); border: 1px solid #f2b7b7; }
.app-impersonation-banner {
    width: min(1240px, calc(100% - 2rem));
    margin: .5rem auto 0;
    padding: .58rem .75rem;
    border: 1px solid #bfd3ee;
    border-left: 5px solid #2f6fb6;
    border-radius: 15px;
    background: linear-gradient(120deg, #f5f9ff, #eef6ff);
    color: #183b62;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .8rem;
}
.app-impersonation-banner p { margin: 0; font-weight: 750; line-height: 1.35; }
.app-impersonation-banner .button { min-height: 36px; border-radius: 12px; background: #1f5f9f; color: #ffffff; border-color: #1f5f9f; box-shadow: 0 8px 18px rgba(31, 95, 159, .18); }
.app-impersonation-banner .button:hover,
.app-impersonation-banner .button:focus-visible { transform: translateY(-1px); background: #164b82; color: #ffffff; border-color: #164b82; }
.app-impersonation-banner .button:hover { background: #164b82; color: #ffffff; border-color: #164b82; }
.app-impersonation-banner .button:focus-visible { background: #164b82; color: #ffffff; border-color: #164b82; }
.app-impersonation-banner .button:active { transform: translateY(0); background: #123f70; color: #ffffff; border-color: #123f70; }
.app-shell { width: min(1180px, calc(100% - 2rem)); margin: 0 auto; padding: 2rem 0 4rem; }
.app-section { padding: 1rem 0 3rem; }
.app-section h1 { font-size: clamp(2rem, 4.5vw, 3.45rem); letter-spacing: -.045em; }
.app-section .page-head h1 { max-width: 16ch; margin-bottom: .45rem; }
.app-section h2 { font-size: clamp(1.35rem, 2.6vw, 2.05rem); letter-spacing: -.03em; }
.app-section .page-head { scroll-margin-top: 6rem; }
.metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1rem; margin: 1.5rem 0; }
.metric-card { padding: 1.2rem; border-radius: var(--radius); background: white; border: 1px solid var(--line); box-shadow: 0 14px 34px rgba(9,33,63,.07); }
.metric-card span { display: block; color: var(--muted); font-weight: 800; }
.metric-card strong { display: block; color: var(--navy); font-size: clamp(1.45rem, 3.4vw, 2.45rem); line-height: 1.08; letter-spacing: -.035em; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; align-items: start; }
.grid-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.wide { max-width: 980px; }
.form-card input:not([type="checkbox"]):not([type="radio"]), .form-card select, .form-card textarea, .filter-bar input, .filter-bar select { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem; font: inherit; background: white; color: var(--ink); }
.form-card textarea { resize: vertical; }
.form-card label { display: block; margin: .9rem 0 .35rem; font-weight: 850; color: var(--navy); }
.filter-bar { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(160px, .35fr) auto; gap: .7rem; align-items: end; margin: 1rem 0; }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 20px; background: white; margin: 1rem 0; }
table { width: 100%; border-collapse: collapse; min-width: 680px; }
th, td { text-align: left; padding: .8rem 1rem; border-bottom: 1px solid var(--line); vertical-align: top; }
th { color: var(--navy); background: #f6faf9; font-size: .9rem; }
tr:last-child td { border-bottom: 0; }
.admin-body .brand-mark { background: linear-gradient(135deg, var(--navy), #6b4b12); }
@media (max-width: 820px) {
    .app-topbar { align-items: flex-start; flex-direction: column; }
    .app-topnav { width: 100%; overflow-x: auto; padding-bottom: .25rem; }
    .metric-grid, .two-col, .grid-list, .filter-bar { grid-template-columns: 1fr; }
    table { min-width: 620px; }

    .admin-topbar {
        align-items: center;
        flex-direction: row;
    }

    .admin-sidebar-toggle-btn {
        display: inline-flex;
    }

    .admin-shell {
        grid-template-columns: 1fr;
        width: calc(100% - 1.5rem);
    }

    .admin-sidebar {
        position: fixed;
        top: 57px;
        left: .65rem;
        right: .65rem;
        width: min(320px, calc(100vw - 1.3rem));
        max-height: calc(100vh - 3.1rem);
        transform: translateX(-120%);
        z-index: 30;
        transition: transform .22s ease;
    }

    .admin-sidebar-close-mobile {
        display: inline-flex;
    }

    .admin-sidebar-toggle-input:checked + .admin-topbar + .admin-shell .admin-sidebar {
        transform: translateX(0);
    }
}

@media (max-width: 620px) {
    .app-impersonation-banner {
        width: calc(100% - 1.5rem);
        flex-direction: column;
        align-items: flex-start;
    }

    .app-impersonation-banner .button {
        width: 100%;
        justify-content: center;
    }
}
.pagination { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; color: var(--muted); font-weight: 750; }
.provider-actions { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1rem 0; }
.import-card { margin: 1rem 0; }
.status-pill { display: inline-flex; align-items: center; border-radius: 999px; padding: .2rem .65rem; font-size: .82rem; font-weight: 850; background: var(--line); color: var(--navy); }
.status-active { background: var(--teal-soft); color: #0f5c55; }
.status-inactive { background: #edf1f4; color: #637083; }

.page-head { display: flex; justify-content: space-between; gap: 1.25rem; align-items: flex-start; margin-bottom: 1.25rem; }
.entries-filter { grid-template-columns: repeat(5, minmax(150px, 1fr)) auto; }
.entries-table table { min-width: 940px; }
.app-filter-grid {
    display: grid;
    grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}
.action-links { display: flex; gap: .75rem; flex-wrap: wrap; }
.danger-link, .danger-text { color: var(--red) !important; }
.badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .2rem .6rem; font-size: .78rem; font-weight: 850; margin: .25rem .25rem 0 0; }
.badge-soft { background: #eef4f6; color: var(--navy-2); }
.badge-warning { background: var(--amber-soft); color: #7a2525; border: 1px solid #f2b7b7; }
.category-label {
    display: inline-flex;
    align-items: center;
    gap: .36rem;
    max-width: 100%;
    min-width: 0;
    vertical-align: middle;
}
.category-label--inline {
    display: inline-flex;
    vertical-align: baseline;
}
.category-label--detail {
    margin: .2rem 0 .45rem;
    color: var(--navy);
    font-weight: 850;
}
.category-label--admin > span {
    min-width: 0;
}
.category-icon {
    display: inline-grid;
    place-items: center;
    width: 1.25rem;
    height: 1.25rem;
    flex: 0 0 1.25rem;
    line-height: 0;
}
.category-icon img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}
.category-icon--xs {
    width: 1rem;
    height: 1rem;
    flex-basis: 1rem;
}
.category-icon--sm {
    width: 1.5rem;
    height: 1.5rem;
    flex-basis: 1.5rem;
}
.category-icon--chip {
    width: 1.65rem;
    height: 1.65rem;
    flex-basis: 1.65rem;
}
.badge.category-label,
.app-chip.category-label {
    gap: .32rem;
}
.status-success { background: var(--teal-soft); color: #0f5c55; }
.status-warning { background: var(--amber-soft); color: #7a2525; }
.status-orange { background: var(--red-soft); color: #7a2525; }
.status-danger { background: var(--red-soft); color: #7a2525; }
.status-info { background: var(--blue-soft); color: var(--navy-2); }
.status-muted { background: #edf1f4; color: #637083; }
.status-neutral { background: #f2edf8; color: #5c4a75; }
.entry-wizard { display: grid; gap: 1rem; }
.entry-wizard.form-card { max-width: 1040px; }
.wizard-step, .detail-card { position: relative; padding: clamp(1rem, 2vw, 1.45rem); border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255,255,255,.94); box-shadow: 0 14px 34px rgba(9,33,63,.055); }
.detail-card { overflow-wrap: anywhere; }
.wizard-step h2 { font-size: clamp(1.25rem, 2.5vw, 1.75rem); margin-bottom: .45rem; }
.wizard-step.is-essential { border-color: rgba(20,125,115,.28); background: linear-gradient(180deg, rgba(255,255,255,.96), rgba(244,255,252,.9)); }
.field-section-label { display: inline-flex; align-items: center; gap: .45rem; margin-bottom: .65rem; padding: .35rem .7rem; border-radius: 999px; background: var(--blue-soft); color: var(--navy-2); font-weight: 900; font-size: .85rem; }
.field-note { color: var(--muted); font-weight: 650; font-size: .94rem; margin: -.15rem 0 .4rem; }
.step-number { display: inline-grid; place-items: center; width: 34px; height: 34px; border-radius: 12px; background: var(--navy); color: white; font-weight: 900; margin-bottom: .65rem; }
.compact { padding: .85rem 1rem; margin-top: .8rem; }
.entry-deadline-summary h3 { font-size: 1rem; margin: 0 0 .45rem; }
.entry-deadline-summary .plain-list { margin: 0; }
.provider-results { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: .5rem; }
.provider-result { border: 1px solid var(--line); background: white; color: var(--navy-2); border-radius: 999px; padding: .45rem .75rem; cursor: pointer; font-weight: 800; }
.provider-result:hover, .provider-result:focus-visible { border-color: var(--teal); color: var(--teal); }
.check-grid, .checkbox-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: .55rem .75rem; margin: .8rem 0; align-items: start; }
.option-panel { border: 1px solid var(--line); border-radius: 20px; padding: 1rem; background: #f8fbfa; margin: 1rem 0; }
.option-panel legend { padding: 0 .35rem; color: var(--navy); font-weight: 900; }
.option-panel .muted { margin: .15rem 0 .7rem; }
.option-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .45rem .85rem; align-items: start; }
.form-card label[hidden], [hidden] { display: none !important; }
.mask-section[hidden] { display: none !important; }
.mask-section { border-color: rgba(20,125,115,.22); }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.detail-card dl { display: grid; grid-template-columns: minmax(150px, .46fr) 1fr; gap: .55rem 1rem; margin: 0; }
.detail-card dt { color: var(--muted); font-weight: 850; }
.detail-card dd { margin: 0; font-weight: 720; }
.tabs { display: flex; gap: .5rem; flex-wrap: wrap; margin: 1rem 0; }
.tabs a { text-decoration: none; border: 1px solid var(--line); border-radius: 999px; padding: .55rem .85rem; background: white; font-weight: 850; }
.tabs a.active { background: var(--navy); color: white; border-color: var(--navy); }
.upload-form { display: grid; grid-template-columns: minmax(180px, .4fr) 1fr auto; gap: .75rem; align-items: end; margin: 1rem 0; }
.danger-zone { border-color: #f2b7b7; background: #fffafa; }
@media (max-width: 980px) {
    .entries-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .detail-grid, .check-grid, .checkbox-grid, .upload-form { grid-template-columns: 1fr; }
    .page-head { flex-direction: column; }
}
.narrow-text { max-width: 56ch; }
.highlight-card { border-color: #a8ddd5; background: linear-gradient(180deg, #f4fffc 0%, #ffffff 100%); }
.timeline-list { display: grid; gap: .7rem; }
.timeline-list > div, .timeline-item { display: flex; justify-content: space-between; gap: 1rem; padding: .85rem 1rem; border: 1px solid var(--line); border-radius: 18px; background: linear-gradient(180deg, #fbfefd, #f5faf9); }
.costs-overview .detail-card ul { margin-top: .5rem; }
@media (max-width: 720px) {
    .timeline-list > div, .timeline-item { flex-direction: column; }
}
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 1.35rem; height: 1.35rem; margin-left: .25rem; padding: 0 .4rem; border-radius: 999px; background: var(--red); color: #fff; font-size: .78rem; font-weight: 900; }
.notification-list { display: grid; gap: .9rem; }
.notification-card { display: flex; justify-content: space-between; gap: 1rem; padding: 1.15rem; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; box-shadow: 0 14px 34px rgba(9,33,63,.06); }
.notification-card h2 { margin: .55rem 0 .25rem; }
.notification-card.is-read { opacity: .72; background: #f8fafc; }
.notification-card.severity-warning { border-color: #f2b7b7; }
.notification-card.severity-urgent { border-color: #f4bd8b; }
.notification-card.severity-critical { border-color: #f2b7b7; }
.code-block { white-space: pre-wrap; border: 1px solid var(--line); border-radius: 18px; background: #0f172a; color: #e2e8f0; padding: 1rem; overflow-x: auto; }
.stacked-form { display: grid; gap: .85rem; }
.stacked-form input:not([type="checkbox"]):not([type="radio"]), .stacked-form select, .stacked-form textarea { width: 100%; border: 1px solid var(--line); border-radius: 16px; padding: .85rem 1rem; font: inherit; background: white; color: var(--ink); }
.help-text { display: block; color: var(--muted); font-weight: 650; margin-top: .35rem; }
.status-green { background: var(--teal-soft); color: #0f5c55; }
.status-yellow { background: var(--amber-soft); color: #7a2525; }
.status-red { background: var(--red-soft); color: #7a2525; }
.status-blue { background: var(--blue-soft); color: var(--navy-2); }
.status-gray { background: #edf1f4; color: #637083; }
@media (max-width: 720px) {
    .notification-card { flex-direction: column; }
}

.hero-panel { padding: 1.4rem; border: 1px solid var(--line); border-radius: 30px; background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(223,245,241,.82)); box-shadow: 0 18px 46px rgba(9,33,63,.08); }
.inline-warning, .inline-hint { display: inline-flex; margin: .6rem .5rem 0 0; padding: .55rem .8rem; border-radius: 999px; font-weight: 850; }
.inline-warning { color: #7a2525; background: var(--amber-soft); border: 1px solid #f2b7b7; }
.inline-hint { color: var(--navy-2); background: var(--blue-soft); border: 1px solid #bfd3f6; }
.quick-actions { display: flex; flex-wrap: wrap; gap: .7rem; align-items: center; }
.metric-grid-wide { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.dashboard-grid { align-items: stretch; }
.full-width-card { max-width: none; }
.period-grid, .quick-action-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .9rem; }
.period-card, .quick-action-grid a, .entry-mobile-card { padding: 1rem; border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.9); box-shadow: 0 12px 28px rgba(9,33,63,.05); }
.period-card h3 { margin-bottom: .45rem; }
.quick-action-grid a { color: var(--navy); text-decoration: none; font-weight: 900; }
.compact-list { gap: .55rem; }
.compact-list .notification-card { box-shadow: none; }
.list-toolbar { display: flex; justify-content: space-between; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 1rem 0; }
.export-inline { display: inline-flex; align-items: center; gap: .5rem; }
.entry-card-list { display: none; gap: 1rem; margin: 1rem 0; }
.entry-mobile-card h2 { font-size: 1.25rem; margin: .5rem 0 .2rem; }
.entry-mobile-card dl { display: grid; grid-template-columns: 1fr 1fr; gap: .3rem .8rem; }
.entry-mobile-card dt { color: var(--muted); font-weight: 850; }
.entry-mobile-card dd { margin: 0; font-weight: 800; }
.deadline-row.is-critical { border-color: #f2b7b7; background: #fffafa; }
.print-header, .print-footer { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding: .75rem 0; margin-bottom: 1rem; color: var(--muted); }
.print-footer { border-top: 1px solid var(--line); border-bottom: 0; margin-top: 2rem; font-size: .9rem; }
.print-only { display: none; }
@media (max-width: 1120px) {
    .metric-grid-wide { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .period-grid, .quick-action-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
    .metric-grid-wide, .period-grid, .quick-action-grid { grid-template-columns: 1fr; }
    .entry-card-list { display: grid; }
    .entries-table { display: none; }
    .hero-panel { padding: 1rem; }
}
@media print {
    .app-topbar, .no-print, .quick-actions, .pagination, .alert, .site-header, .site-footer { display: none !important; }
    .print-only { display: block; }
    body, .app-body { background: white !important; color: #111; }
    .app-shell, .print-shell { width: 100%; max-width: none; padding: 0; }
    .detail-card, .metric-card, .period-card, .table-wrap, .notice { box-shadow: none !important; break-inside: avoid; }
    a { color: #111; text-decoration: none; }
    table { min-width: 0; font-size: .9rem; }
}
.code-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: .65rem; margin: 1rem 0; }
.code-grid code { display: block; padding: .75rem .9rem; border: 1px solid var(--line); border-radius: 14px; background: #f8fbfa; font-weight: 850; letter-spacing: .04em; }

.category-grid, .provider-public-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.category-card, .provider-card {
    display: block;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(255,255,255,.9);
    box-shadow: 0 12px 30px rgba(9,33,63,.06);
    text-decoration: none;
    font-weight: 850;
    color: var(--navy);
}
.category-card span { color: var(--teal); margin-right: .55rem; }
.provider-card h2 { font-size: 1.2rem; margin: .6rem 0 .35rem; }
.provider-card a { text-decoration: none; }
.rich-text { white-space: normal; }

/* Phase 19.5: Stitch-inspired public homepage */
body {
    background: #f8f9ff;
}

.site-header {
    background: rgba(255, 255, 255, .88);
    border-bottom-color: rgba(195, 197, 217, .34);
    box-shadow: 0 14px 32px rgba(0, 85, 255, .035);
}

.public-header-shell {
    width: min(1440px, calc(100% - 3rem));
}

.public-container,
.public-container-wide {
    width: min(1320px, calc(100% - 3rem));
}

.site-header .brand-logo {
    height: 38px;
}

.main-nav {
    gap: clamp(.8rem, 1.5vw, 1.65rem);
    font-size: .9rem;
}

.main-nav a:not(.button),
.main-nav .link-button {
    color: #0b1c30;
    font-weight: 760;
}

.main-nav .button-small {
    min-height: 40px;
    border-radius: 12px;
    padding: .62rem 1rem;
    background: #0055ff;
    box-shadow: 0 12px 26px rgba(0, 85, 255, .18);
}

.hero-home {
    overflow: clip;
    min-height: min(780px, calc(100vh - 60px));
    padding: clamp(4.8rem, 8vw, 7rem) 0 clamp(5.5rem, 9vw, 8rem);
    background: radial-gradient(circle at 78% 19%, rgba(0, 85, 255, .07), rgba(248, 249, 255, 0) 42%);
}

.hero-home::before,
.hero-home::after {
    display: none;
}

.home-hero-grid {
    display: grid;
    grid-template-columns: minmax(0, .94fr) minmax(480px, 1.06fr);
    gap: clamp(3rem, 7vw, 7rem);
    align-items: center;
}

.home-hero-logo {
    display: block;
    width: auto;
    height: 110px;
    max-width: min(100%, 500px);
    margin: 0 0 2.1rem;
}

.home-hero-title {
    display: block;
    max-width: 10ch;
    margin: 0 0 1.65rem;
    color: #0b1c30;
    font-size: clamp(3.55rem, 6.5vw, 6rem);
    line-height: .98;
    letter-spacing: -.03em;
}

.home-hero-title span {
    display: block;
}

.home-hero-accent {
    color: #0055ff;
}

.hero-home .hero-text {
    max-width: 38rem;
    margin: 0 0 2.4rem;
    color: #434656;
    font-size: clamp(1.12rem, 1.55vw, 1.34rem);
    line-height: 1.58;
}

.hero-home .hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 2rem;
}

.button {
    border-radius: 14px;
    background: #0055ff;
    box-shadow: 0 18px 34px rgba(0, 85, 255, .18);
}

.button:hover,
.button:focus-visible {
    background: #0041c8;
}

.button-secondary {
    color: #0b1c30;
    background: #fff;
    border-color: rgba(195, 197, 217, .8);
    box-shadow: 0 12px 24px rgba(15, 23, 42, .045);
}

.hero-home .hero-actions .button {
    min-height: 56px;
    padding: 1rem 1.45rem;
    font-size: 1.03rem;
}

.hero-home .home-trust-list {
    display: flex;
    gap: .9rem 1.35rem;
    flex-wrap: nowrap;
    margin: 0;
    padding: 0;
}

.home-trust-list li {
    display: inline-flex;
    align-items: center;
    gap: .42rem;
    padding: 0;
    color: #434656;
    background: transparent;
    border: 0;
    box-shadow: none;
    font-size: .92rem;
    font-weight: 740;
}

.home-trust-list span {
    display: inline-grid;
    place-items: center;
    width: 1.1rem;
    height: 1.1rem;
    border-radius: 50%;
    color: #0055ff;
    background: #ebf2ff;
    font-size: .72rem;
}

.home-hero-visual {
    position: relative;
    min-height: 620px;
    margin: 0;
}

.home-hero-visual::before {
    content: "";
    position: absolute;
    inset: 9% 4% 6% 0;
    border-radius: 999px;
    background: rgba(0, 85, 255, .06);
    filter: blur(64px);
}

.home-float-card,
.home-donut-card {
    position: absolute;
    z-index: 1;
    display: grid;
    align-items: center;
    gap: .9rem;
    border: 1px solid rgba(195, 197, 217, .22);
    border-radius: 24px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 25px 50px rgba(0, 85, 255, .08);
}

.home-float-card {
    grid-template-columns: 52px minmax(0, 1fr) auto;
    width: min(100%, 430px);
    padding: 1.05rem 1.1rem;
}

.home-card-deadline {
    top: 6%;
    left: 13%;
    width: 350px;
}

.home-card-renewal {
    top: 28%;
    left: 0;
}

.home-card-reminder {
    top: 50%;
    left: 10%;
    width: 390px;
}

.home-card-cost {
    left: 18%;
    bottom: 10%;
    width: 420px;
}

.home-float-card strong {
    display: block;
    color: #0b1c30;
    font-size: 1rem;
    line-height: 1.1;
}

.home-float-card p {
    margin: .28rem 0 0;
    color: #737688;
    font-size: .82rem;
    line-height: 1.35;
}

.home-float-icon,
.home-card-icon {
    display: inline-grid;
    place-items: center;
    color: #0055ff;
    background: #ebf2ff;
    font-weight: 900;
}

.home-float-icon {
    width: 52px;
    height: 52px;
    border-radius: 16px;
}

.home-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: .35rem .65rem;
    font-size: .78rem;
    font-weight: 900;
    white-space: nowrap;
}

.home-pill-danger {
    color: #ba1a1a;
    background: #ffdad6;
}

.home-pill-warn {
    color: #9a4b00;
    background: #fff1dd;
}

.home-toggle {
    display: flex;
    align-items: center;
    width: 48px;
    height: 26px;
    padding: 3px;
    border-radius: 999px;
    background: #0055ff;
}

.home-toggle span {
    width: 20px;
    height: 20px;
    margin-left: auto;
    border-radius: 50%;
    background: #fff;
}

.home-value {
    color: #0055ff;
    font-size: 1.55rem;
    letter-spacing: -.02em;
    white-space: nowrap;
}

.home-donut-card {
    top: 16%;
    right: 2%;
    width: 240px;
    padding: 1.45rem;
}

.home-donut-card h2 {
    margin: 0 0 .2rem;
    color: #0b1c30;
    font-size: 1rem;
    letter-spacing: 0;
}

.home-donut-card p {
    margin: 0 0 1.15rem;
    color: #737688;
    font-size: .8rem;
    font-weight: 760;
}

.home-donut {
    width: 132px;
    aspect-ratio: 1;
    margin: 0 auto;
    border-radius: 50%;
    background: conic-gradient(#0055ff 0 190deg, #60a5fa 190deg 250deg, #eef4ff 250deg);
    -webkit-mask: radial-gradient(circle, transparent 51%, #000 52%);
    mask: radial-gradient(circle, transparent 51%, #000 52%);
}

.home-shield {
    position: absolute;
    right: 12%;
    bottom: 22%;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 74px;
    height: 74px;
    border-radius: 24px;
    color: #fff;
    background: #0055ff;
    box-shadow: 0 24px 44px rgba(0, 85, 255, .28);
    font-size: 1.6rem;
    font-weight: 900;
}

.home-intro-section,
.home-section,
.home-security-section {
    padding: clamp(5rem, 10vw, 9rem) 0;
}

.home-intro-section .public-container {
    max-width: 880px;
    margin-left: max(1.5rem, calc((100vw - 1320px) / 2));
    margin-right: auto;
}

.home-intro-section h2,
.home-section-head h2,
.home-faq-section h2 {
    color: #0b1c30;
    font-size: clamp(2rem, 4vw, 3.55rem);
    letter-spacing: -.02em;
}

.home-intro-section p:not(.eyebrow),
.home-section-head p {
    max-width: 64ch;
    color: #434656;
    font-size: 1.08rem;
    line-height: 1.72;
}

.home-bento-grid {
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    gap: 1.25rem;
}

.home-bento-card {
    grid-column: span 4;
    min-height: 238px;
    padding: clamp(1.35rem, 3vw, 2.6rem);
    border: 1px solid rgba(195, 197, 217, .22);
    border-radius: 32px;
    background: #fff;
    box-shadow: 0 25px 50px rgba(0, 85, 255, .06);
}

.home-bento-large {
    grid-column: span 7;
}

.home-bento-tall {
    grid-column: span 5;
}

.home-card-icon {
    width: 48px;
    height: 48px;
    margin-bottom: 1.25rem;
    border-radius: 16px;
}

.home-bento-card h2,
.home-bento-card h3 {
    margin-bottom: 1rem;
    color: #0b1c30;
    letter-spacing: -.015em;
}

.home-bento-card h2 {
    font-size: clamp(1.7rem, 3vw, 2.45rem);
}

.home-bento-card p {
    color: #434656;
    line-height: 1.62;
}

.home-feature-detail-section {
    background: #f7f9fc;
}

.home-feature-detail-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
}

.home-feature-detail-grid article {
    min-width: 0;
    padding: clamp(1.25rem, 2.5vw, 2rem);
    border: 1px solid rgba(195, 197, 217, .34);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 18px 38px rgba(9, 33, 63, .055);
}

.home-feature-detail-grid h3 {
    margin: .1rem 0 .7rem;
    color: #0b1c30;
    font-size: 1.22rem;
    line-height: 1.22;
    letter-spacing: 0;
}

.home-feature-detail-grid p {
    margin: 0;
    color: #434656;
    line-height: 1.58;
}

.home-feature-detail-note {
    max-width: 760px;
    margin: 1.6rem auto 0;
    color: #5a6272;
    text-align: center;
}

.home-radar-graphic {
    display: grid;
    place-items: center;
    min-height: 240px;
    margin-top: 2rem;
    border-radius: 28px;
    background: #f8fafc;
}

.home-radar-graphic::before,
.home-radar-graphic::after,
.home-radar-graphic span {
    content: "";
    grid-area: 1 / 1;
    border-radius: 50%;
}

.home-radar-graphic::before {
    width: 170px;
    height: 170px;
    border: 2px solid rgba(0, 85, 255, .11);
}

.home-radar-graphic::after {
    width: 110px;
    height: 110px;
    border: 2px solid rgba(0, 85, 255, .2);
}

.home-radar-graphic span {
    width: 54px;
    height: 54px;
    background: rgba(0, 85, 255, .18);
}

.home-bars {
    display: flex;
    align-items: end;
    gap: .65rem;
    height: 150px;
    margin-top: 1.5rem;
}

.home-bars span {
    flex: 1;
    border-radius: 12px 12px 0 0;
    background: rgba(0, 85, 255, .16);
}

.home-bars span:nth-child(2) { height: 48%; background: rgba(0, 85, 255, .24); }
.home-bars span:nth-child(3) { height: 72%; background: rgba(0, 85, 255, .4); }
.home-bars span:nth-child(4) { height: 55%; background: rgba(0, 85, 255, .2); }
.home-bars span:nth-child(5) { height: 92%; background: rgba(0, 85, 255, .62); }
.home-bars span:nth-child(1) { height: 34%; }

.home-category-section {
    background: rgba(239, 244, 255, .46);
}

.home-section-head {
    max-width: 760px;
    margin: 0 auto 3rem;
    text-align: center;
}

.home-section-head p {
    margin-inline: auto;
}

.home-category-row {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.home-category-chip {
    display: inline-flex;
    align-items: center;
    gap: .65rem;
    padding: 1rem 1.55rem;
    border: 1px solid rgba(195, 197, 217, .2);
    border-radius: 20px;
    color: #0b1c30;
    background: #fff;
    box-shadow: 0 18px 34px rgba(0, 85, 255, .055);
    text-decoration: none;
    font-weight: 850;
}

.home-category-chip span {
    color: #0055ff;
}

.home-security-panel {
    position: relative;
    overflow: hidden;
    border: 1px solid rgba(234, 241, 255, .1);
    border-radius: 56px;
    padding: clamp(2rem, 6vw, 5.5rem);
    color: #eaf1ff;
    background: #213145;
    box-shadow: 0 30px 64px rgba(15, 23, 42, .12);
}

.home-security-panel > div {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.home-security-panel .eyebrow {
    color: #8cb7ff;
}

.home-security-panel h2 {
    color: #fff;
    font-size: clamp(2rem, 4vw, 3.5rem);
}

.home-security-panel p {
    color: rgba(234, 241, 255, .78);
    font-size: 1.08rem;
    line-height: 1.72;
}

.home-security-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.4rem;
    margin-top: 2.2rem;
}

.home-security-grid div {
    display: grid;
    grid-template-columns: 42px 1fr;
    gap: .35rem .9rem;
}

.home-security-grid span {
    display: grid;
    grid-row: span 2;
    place-items: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    color: #fff;
    background: rgba(0, 85, 255, .36);
}

.home-security-grid strong {
    color: #fff;
}

.home-security-grid p {
    margin: 0;
    font-size: .9rem;
}

.home-security-mark {
    position: absolute;
    right: -1rem;
    top: 50%;
    color: rgba(255, 255, 255, .035);
    font-size: clamp(16rem, 32vw, 30rem);
    font-weight: 900;
    line-height: 1;
    transform: translateY(-50%);
}

.home-pricing-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.2rem;
    align-items: stretch;
    max-width: 1240px;
    margin: 0 auto;
}

.home-pricing-grid article {
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 430px;
    padding: clamp(1.4rem, 3vw, 2.6rem);
    border: 1px solid rgba(195, 197, 217, .22);
    border-radius: 30px;
    background: #fff;
    box-shadow: 0 25px 50px rgba(0, 85, 255, .06);
}

.home-pricing-grid article.is-featured {
    color: #fff;
    background: #0055ff;
    box-shadow: 0 28px 58px rgba(0, 85, 255, .24);
    transform: scale(1.06);
}

.home-pricing-grid h3 {
    margin-bottom: .25rem;
    color: inherit;
}

.home-pricing-grid p {
    margin: 0 0 1.4rem;
    color: #737688;
}

.home-pricing-grid .is-featured p {
    color: rgba(255, 255, 255, .82);
}

.home-pricing-grid strong {
    display: block;
    margin-bottom: 1.8rem;
    color: inherit;
    font-size: clamp(2.3rem, 4vw, 3.4rem);
    line-height: 1;
    letter-spacing: -.035em;
}

.home-pricing-grid strong span {
    margin-left: .25rem;
    font-size: 1rem;
    letter-spacing: 0;
    color: currentColor;
    opacity: .72;
}

.home-pricing-grid ul {
    display: grid;
    gap: .8rem;
    margin: 0 0 2rem;
    padding: 0;
    list-style: none;
    flex: 1;
}

.home-pricing-grid li::before {
    content: "✓";
    margin-right: .55rem;
    color: #0055ff;
    font-weight: 900;
}

.home-pricing-grid .is-featured li::before {
    color: #fff;
}

.home-pricing-grid .button {
    width: 100%;
}

.home-pricing-grid .is-featured .button {
    color: #0055ff;
    background: #fff;
}

.home-plan-badge {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    padding: .28rem .55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, .2);
    font-size: .72rem;
    font-weight: 900;
    text-transform: uppercase;
}

.home-price-note {
    max-width: 760px;
    margin: 3rem auto 0;
    color: #737688;
    text-align: center;
}

.home-faq-section h2 {
    margin-bottom: 3rem;
    text-align: center;
}

.home-faq-section details {
    border: 1px solid rgba(195, 197, 217, .22);
    border-radius: 24px;
    background: #fff;
    box-shadow: 0 22px 42px rgba(0, 85, 255, .055);
}

.home-faq-section summary {
    padding: 1.35rem 1.5rem;
    list-style: none;
}

.home-faq-section summary::-webkit-details-marker {
    display: none;
}

.home-faq-section summary::after {
    content: "+";
    float: right;
    color: #0055ff;
}

.home-faq-section details[open] summary::after {
    content: "−";
}

.home-faq-section details p {
    margin: 0;
    padding: 0 1.5rem 1.5rem;
    color: #434656;
}

.site-footer {
    padding: 4.5rem 0 3rem;
    color: #0b1c30;
    background: #fff;
    border-top: 1px solid rgba(195, 197, 217, .28);
}

.public-footer-shell {
    display: grid;
    grid-template-columns: minmax(260px, 1.3fr) minmax(0, 1.7fr);
    gap: clamp(2rem, 5vw, 5rem);
}

.public-footer-brand .brand-logo {
    width: auto;
    height: 38px;
    margin-bottom: 1rem;
}

.public-footer-brand p {
    max-width: 430px;
    color: #434656;
}

.public-footer-slogan {
    margin: 0 0 .6rem;
    font-size: 1.02rem;
    line-height: 1.45;
    color: #1f354f;
    font-weight: 810;
}

.public-footer-subhint {
    margin: 0;
    color: #4c607a;
    font-size: .93rem;
    line-height: 1.35;
    max-width: 500px;
}

.public-footer-station55 {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid rgba(121, 144, 173, .28);
    border-radius: 16px;
    background: rgba(255, 255, 255, .64);
    max-width: 780px;
}

.public-footer-station55-logo {
    display: block;
    width: auto;
    height: 68px;
    max-width: 320px;
    object-fit: contain;
    margin: 0;
}

.public-footer-station55-text {
    margin: 0;
    color: #4c607a;
    max-width: 420px;
    font-size: .93rem;
    line-height: 1.35;
}

.public-footer-station55-text a {
    color: inherit;
}

.public-footer-station55-content {
    margin-top: 2px;
    max-width: 560px;
}

.public-footer-station55-content .public-footer-copyright {
    margin: .5rem 0 0;
    padding: 0;
    border-top: 0;
    color: #334358;
    line-height: 1.35;
}

@media (max-width: 720px) {
    .public-footer-station55 {
        align-items: flex-start;
        flex-direction: column;
    }

    .public-footer-station55-content {
        margin-top: 0;
    }
}

.public-footer-copyright {
    margin: 1.35rem 0 0;
    padding: 1.15rem 0 0;
    border-top: 1px solid #cfd7e1;
    color: #334358;
    font-size: .84rem;
    line-height: 1.5;
    text-align: left;
}

.site-footer nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.5rem;
}

.site-footer nav div {
    display: grid;
    gap: .55rem;
    align-content: start;
}

.site-footer nav strong {
    margin-bottom: .45rem;
    color: #0b1c30;
}

.site-footer a {
    color: #434656;
    text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
    color: #0055ff;
}

@media (max-width: 1180px) {
    .home-hero-grid {
        grid-template-columns: minmax(0, .92fr) minmax(420px, 1fr);
        gap: 2rem;
    }
    .home-card-deadline { left: 6%; }
    .home-donut-card { right: 0; }
    .home-card-cost { left: 8%; }
    .home-pricing-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        max-width: 820px;
    }
    .home-pricing-grid article.is-featured {
        transform: none;
    }
}

@media (max-width: 980px) {
    .home-hero-grid,
    .public-footer-shell {
        grid-template-columns: 1fr;
    }
    .home-hero-visual {
        min-height: 560px;
        max-width: 680px;
        width: 100%;
        margin-inline: auto;
    }
    .home-bento-card,
    .home-bento-large,
    .home-bento-tall {
        grid-column: span 12;
    }
    .home-feature-detail-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .home-pricing-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
    }
}

@media (max-width: 820px) {
    .public-header-shell,
    .public-container,
    .public-container-wide {
        width: min(100% - 1.5rem, 100%);
    }
    .site-header .brand-logo {
        height: 34px;
    }
    .hero-home {
        min-height: auto;
        padding-top: 3rem;
    }
    .home-hero-logo {
        height: 95px;
        max-width: min(100%, 360px);
        margin-bottom: 1.6rem;
    }
    .home-hero-title {
        font-size: clamp(2.7rem, 12vw, 4rem);
    }
    .hero-home .hero-text {
        font-size: 1rem;
    }
    .hero-home .hero-actions .button {
        width: 100%;
    }
    .home-hero-visual {
        display: grid;
        min-height: auto;
        gap: .8rem;
    }
    .home-hero-visual::before,
    .home-shield {
        display: none;
    }
    .home-float-card,
    .home-donut-card {
        position: relative;
        inset: auto;
        width: 100%;
        transform: none;
    }
    .home-donut-card {
        display: none;
    }
    .home-float-card {
        grid-template-columns: 46px minmax(0, 1fr);
    }
    .home-float-card > :last-child {
        justify-self: start;
    }
    .home-security-grid,
    .site-footer nav {
        grid-template-columns: 1fr;
    }
    .home-feature-detail-grid {
        grid-template-columns: 1fr;
    }
    .home-security-panel {
        border-radius: 32px;
    }
    .home-security-mark {
        display: none;
    }
    .home-intro-section .public-container {
        margin-inline: auto;
    }
}
.ad-wrap { margin-top: 1rem; }
.ad-slot, .ad-placeholder {
    display: block;
    padding: 1rem;
    border: 1px dashed var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.75);
    text-align: center;
}
.ad-slot { position: relative; overflow: hidden; }
.ad-slot .ad-slot-label {
    position: absolute;
    top: .5rem;
    left: .5rem;
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: .18rem .5rem;
    font-size: .76rem;
    font-weight: 800;
    background: rgba(255, 255, 255, .92);
    color: var(--navy);
    border: 1px solid rgba(9, 33, 63, .15);
    z-index: 1;
}
.ad-slot > a,
.ad-slot > img,
.ad-slot > .ad-slot-label,
.ad-slot > .ad-slot-label + a,
.ad-slot > .ad-slot-label + img,
.ad-slot > * {
    position: relative;
}
.ad-slot img { max-width: 100%; height: auto; border-radius: 16px; }
.ad-placeholder span { display: block; color: var(--muted); font-size: .92rem; }
.consent-banner {
    position: fixed;
    z-index: 20;
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    width: min(1120px, calc(100% - 2rem));
    margin-inline: auto;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255,255,255,.96);
    box-shadow: var(--shadow);
}
.consent-banner p { margin: .25rem 0 0; color: var(--muted); }
.consent-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; justify-content: flex-end; }
.honeypot { position: absolute !important; left: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }
@media (max-width: 760px) {
    .consent-banner { flex-direction: column; align-items: stretch; }
    .consent-actions { justify-content: stretch; }
    .consent-actions .button { width: 100%; }
}

.pricing-grid-wide { grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); align-items: stretch; }
.app-plan-grid,
.app-tariff-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 18px;
    align-items: stretch;
}

.app-plan-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.app-tariff-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}
.pricing-card {
    border: 1px solid var(--line);
    border-radius: 26px;
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,251,250,.94));
    padding: 1.25rem;
    box-shadow: 0 16px 38px rgba(9,33,63,.07);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}
.pricing-card.is-highlighted, .pricing-card.is-current { border-color: rgba(37,99,235,.45); box-shadow: 0 22px 52px rgba(37,99,235,.14); }
.pricing-card h2 { margin: 0; }
.pricing-card strong { color: var(--navy); font-size: 1.35rem; }
.pricing-card .plain-list {
    margin: 0;
    display: grid;
    gap: .42rem;
}
.pricing-card .plain-list li {
    line-height: 1.45;
}
.pricing-card-visible-terms {
    padding: .75rem .85rem .75rem 1.45rem;
    border: 1px solid rgba(191, 219, 254, .76);
    border-radius: 16px;
    background: #f8fbff;
}
.pricing-card-terms {
    color: #43546a;
    font-size: .92rem;
}
.pricing-card--public {
    min-height: 100%;
}
.pricing-card-price {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: baseline;
    gap: .15rem .42rem;
    min-height: 58px;
    padding: .78rem .85rem;
    border: 1px solid rgba(191, 219, 254, .76);
    border-radius: 16px;
    background: #f8fbff;
}

.pricing-price-main {
    color: #1d4ed8;
    font-size: clamp(1.75rem, 4vw, 2.35rem);
    font-weight: 920;
    line-height: 1;
    white-space: nowrap;
}

.pricing-price-unit {
    color: #334358;
    font-size: .95rem;
    font-weight: 850;
    white-space: nowrap;
}

.pricing-price-yearly {
    grid-column: 1 / -1;
    color: var(--muted);
    font-size: .9rem;
    font-weight: 750;
    line-height: 1.25;
}

.pricing-feature-list {
    display: grid;
    gap: .5rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.pricing-feature {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: .55rem;
    align-items: start;
    color: #263850;
    line-height: 1.36;
}

.pricing-feature-mark,
.pricing-compare-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
    min-height: 26px;
    padding: .2rem .46rem;
    border-radius: 999px;
    border: 1px solid #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    font-size: .74rem;
    font-weight: 900;
    line-height: 1.15;
    white-space: nowrap;
}

.pricing-feature--excluded .pricing-feature-mark,
.pricing-compare-pill--no {
    border-color: #fecaca;
    background: #fef2f2;
    color: #b91c1c;
}

.pricing-compare-pill--yes {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.pricing-feature--upgrade .pricing-feature-mark,
.pricing-compare-pill--upgrade,
.pricing-compare-pill--limited {
    border-color: #d3dded;
    background: #f6f8ff;
    color: #475569;
}

.pricing-compare-pill--price,
.pricing-compare-pill--highlight {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
}

.pricing-compare-pill--muted,
.pricing-compare-pill--text {
    border-color: transparent;
    background: transparent;
    color: #334358;
    padding-inline: 0;
    white-space: normal;
    justify-content: flex-start;
    text-align: left;
}

.pricing-conditions {
    display: grid;
    grid-template-columns: minmax(220px, .75fr) minmax(0, 1.35fr);
    gap: 1rem;
    align-items: start;
    margin: 0 0 1.15rem;
    padding: 1rem;
    border: 1px solid rgba(191, 219, 254, .78);
    border-radius: 18px;
    background: linear-gradient(135deg, #f8fbff, #fff);
    box-shadow: 0 16px 38px rgba(9, 33, 63, .06);
}

.pricing-conditions h2 {
    margin: 0;
    font-size: clamp(1.45rem, 3vw, 2rem);
}

.pricing-conditions-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem .85rem;
    margin: 0;
    padding: 0;
    list-style: none;
    color: #334358;
    font-weight: 750;
    line-height: 1.35;
}

.pricing-conditions-list li {
    position: relative;
    padding-left: 1rem;
}

.pricing-conditions-list li::before {
    content: "";
    position: absolute;
    top: .62em;
    left: 0;
    width: .38rem;
    height: .38rem;
    border-radius: 999px;
    background: #2563eb;
}

.pricing-card--public .pricing-card-action {
    width: 100%;
    margin-top: auto;
    min-height: 46px;
}
.pricing-card--free .pricing-card-visible-terms,
.pricing-card--free .pricing-card-terms {
    margin-bottom: 0;
}
.pricing-hero .eyebrow,
.benefit-pricing .eyebrow,
.pricing-comparison .eyebrow {
    color: #2563eb;
}

.benefit-pricing .pricing-card strong {
    color: #1d4ed8;
}

.benefit-pricing .button {
    background: #2563eb;
    box-shadow: 0 14px 34px rgba(37, 99, 235, .22);
}

.benefit-pricing .button:hover,
.benefit-pricing .button:focus-visible {
    background: #1d4ed8;
}
.pricing-comparison {
    margin-top: 1.35rem;
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255, 255, 255, .9);
    box-shadow: 0 18px 42px rgba(9, 33, 63, .07);
}

.app-plan-comparison {
    margin-top: 1rem;
}

.app-tariff-matrix-section {
    overflow: visible;
}

.account-plan-page .app-plan-sales-comparison {
    margin: 1.15rem 0 1.35rem;
    padding: clamp(1rem, 2vw, 1.45rem);
    border-color: #bfdbfe;
    background:
        linear-gradient(135deg, rgba(239, 246, 255, .96) 0%, rgba(255, 255, 255, .98) 44%, rgba(219, 234, 254, .72) 100%);
    box-shadow: 0 22px 56px rgba(37, 99, 235, .1);
}

.app-plan-comparison-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.app-plan-comparison-badge {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: .42rem .72rem;
    border-radius: 999px;
    background: #dbeafe;
    color: #1d4ed8;
    font-size: .78rem;
    font-weight: 850;
    white-space: nowrap;
}

.pricing-comparison h2 {
    margin: 0 0 .35rem;
}

.pricing-comparison-scroll {
    overflow-x: auto;
    margin-top: .95rem;
    -webkit-overflow-scrolling: touch;
}

.app-tariff-matrix-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    -webkit-overflow-scrolling: touch;
    scrollbar-gutter: stable;
    border: 1px solid rgba(191, 219, 254, .78);
    border-radius: 18px;
    background: #ffffff;
}

.pricing-comparison-table {
    width: 100%;
    min-width: 900px;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .94rem;
}

.pricing-comparison-table th,
.pricing-comparison-table td {
    padding: .72rem .78rem;
    border-bottom: 1px solid var(--line);
    text-align: left;
    vertical-align: middle;
}

.pricing-comparison-table thead th {
    background: #f3f8fd;
    color: var(--navy);
    font-weight: 820;
}

.pricing-comparison-table tbody th {
    color: var(--navy);
    font-weight: 820;
    width: 190px;
}

.pricing-comparison-table td {
    color: #334358;
    line-height: 1.35;
}

.app-tariff-matrix {
    width: 100%;
    min-width: 820px;
    table-layout: fixed;
    border-collapse: separate;
    border-spacing: 0;
    font-size: .88rem;
}

.app-tariff-matrix th,
.app-tariff-matrix td {
    padding: .68rem .72rem;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: normal;
    line-height: 1.32;
}

.app-tariff-matrix th:first-child,
.app-tariff-matrix td:first-child {
    width: 18%;
}

.app-tariff-matrix th:not(:first-child),
.app-tariff-matrix td:not(:first-child) {
    width: 20.5%;
}

.app-tariff-matrix tbody th {
    position: sticky;
    left: 0;
    z-index: 1;
    background: #f8fbff;
}

.public-tariff-matrix tbody tr:nth-child(even) th,
.public-tariff-matrix tbody tr:nth-child(even) td {
    background: rgba(248, 251, 255, .9);
}

.public-tariff-matrix tbody tr.pricing-row-highlight th,
.public-tariff-matrix tbody tr.pricing-row-highlight td {
    background: #f6f9ff;
}

.public-tariff-matrix tbody tr:hover th,
.public-tariff-matrix tbody tr:hover td {
    background: #eef6ff;
}

.public-tariff-matrix th,
.public-tariff-matrix td {
    overflow-wrap: break-word;
}

@media (max-width: 820px) {
    .pricing-conditions {
        grid-template-columns: 1fr;
    }

    .pricing-conditions-list {
        grid-template-columns: 1fr;
    }

    .pricing-card-price {
        min-height: 0;
    }
}

.account-plan-page .app-plan-comparison-table {
    min-width: 820px;
    table-layout: fixed;
    border: 1px solid rgba(191, 219, 254, .72);
    border-radius: 18px;
    overflow: visible;
    background: #ffffff;
}

.account-plan-page .app-plan-comparison-table th:first-child {
    width: 210px;
}

.account-plan-page .app-plan-comparison-table thead th {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
}

.account-plan-page .app-plan-comparison-table tbody tr:nth-child(even) th,
.account-plan-page .app-plan-comparison-table tbody tr:nth-child(even) td {
    background: rgba(248, 251, 255, .88);
}

.app-plan-column-heading {
    min-width: 0;
}

.app-plan-column-heading strong,
.app-plan-column-heading span {
    display: block;
}

.app-plan-column-heading strong {
    margin: .08rem 0 .12rem;
    color: var(--app-text, #10243d);
    font-size: 1.28rem;
}

.app-plan-column-heading > span:last-child {
    color: var(--color-text-muted);
    font-size: .78rem;
    line-height: 1.25;
}

.app-plan-column-kicker {
    color: #2563eb;
    font-size: .72rem;
    font-weight: 860;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-plan-row--price td,
.app-plan-row--action td {
    background: rgba(239, 246, 255, .72);
}

.app-plan-row--price .app-plan-cell {
    color: var(--app-text, #10243d);
    font-size: 1.05rem;
    font-weight: 860;
}

.app-plan-cell.is-current,
.app-plan-column-heading.is-current {
    background: rgba(239, 246, 255, .72);
    box-shadow: inset 3px 0 0 rgba(37, 99, 235, .62);
}

.app-current-badge {
    color: #1d4ed8;
    background: #dbeafe;
    border-color: #bfdbfe;
}

.app-plan-comparison-action {
    display: grid;
    gap: .4rem;
}

.app-plan-comparison-action form {
    margin: 0;
}

.app-plan-comparison-action .button,
.app-plan-comparison-action .status-pill {
    width: 100%;
    justify-content: center;
    text-align: center;
}

.pricing-legal-note {
    margin: .95rem 0 0;
    color: var(--muted);
    line-height: 1.45;
}

.checkout-legal-summary {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .55rem;
    margin: 1rem 0 0;
}

.checkout-legal-summary div {
    display: grid;
    gap: .18rem;
    padding: .6rem .7rem;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #f8fbff;
}

.checkout-legal-summary dt {
    color: var(--navy);
    font-weight: 820;
}

.checkout-legal-summary dd {
    margin: 0;
    color: var(--muted);
    line-height: 1.4;
}

.checkout-legal-note {
    margin: .75rem 0 0;
    color: var(--muted);
    font-size: .92rem;
    line-height: 1.42;
}
.app-plan-card,
.app-tariff-card {
    min-width: 0;
    height: auto;
    overflow: visible;
}

.app-plan-card {
    height: auto;
}

.app-tariff-card {
    height: auto;
}

.app-plan-card, .app-tariff-card {
    height: auto;
}
.app-plan-audience {
    color: var(--muted);
    margin: 0;
    font-weight: 700;
}
.app-plan-description {
    margin: 0;
}
.app-plan-price {
    display: flex;
    flex-wrap: wrap;
    gap: .25rem .6rem;
    align-items: baseline;
    margin: 0;
}
.app-plan-feature-list {
    margin: .25rem 0 0;
    padding-left: 1.1rem;
    display: grid;
    gap: .45rem;
}
.app-plan-feature-list li { margin: 0; }
.plan-kpi-card strong { font-size: 1.65rem; }
.app-plan-notes,
.plan-inline-note,
.plan-note-muted {
    margin-top: .6rem;
}
.plan-legal-stack {
    margin-top: 1.4rem;
    display: grid;
    gap: .85rem;
}
.plan-legal-panel {
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .95rem 1.05rem;
    background: #f8fbff;
}
.plan-legal-panel summary {
    list-style: none;
    font-weight: 820;
}
.plan-legal-panel summary::marker,
.plan-legal-panel summary::-webkit-details-marker {
    display: none;
}
.checkout-page .detail-grid, .account-plan-page .detail-grid { align-items: start; }
.danger-zone { border-color: #f2b7b7; background: #fffafa; }
.definition-list { display: grid; grid-template-columns: 170px 1fr; gap: .55rem 1rem; }
.definition-list dt { color: var(--muted); font-weight: 850; }
.definition-list dd { margin: 0; font-weight: 750; }
@media (max-width: 760px) { .definition-list { grid-template-columns: 1fr; } }

/* Phase 16: compact product UI system for the authenticated app. */
.app-header { display: contents; }
.button-primary { background: var(--teal); color: #fff; }
.button-secondary { color: var(--navy); }
.button-danger { background: var(--red); color: #fff; box-shadow: 0 14px 34px rgba(184,69,69,.2); }
.status-badge { display: inline-flex; align-items: center; border-radius: 999px; padding: .2rem .65rem; font-size: .82rem; font-weight: 850; }
.summary-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: clamp(1rem, 3vw, 2rem);
    align-items: center;
    padding: clamp(1.25rem, 3vw, 2rem);
    border: 1px solid rgba(20,125,115,.18);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(223,245,241,.76));
    box-shadow: 0 22px 58px rgba(9,33,63,.09);
    margin-bottom: 1.25rem;
}
.summary-card h1 { max-width: 15ch; margin-bottom: .65rem; }
.dashboard-hero-card .hero-text, .costs-hero-card .hero-text, .deadlines-hero-card .hero-text { font-size: clamp(1.05rem, 2vw, 1.28rem); color: var(--navy-2); }
.hero-action-stack { display: grid; gap: .65rem; min-width: 210px; }
.next-action-card {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid rgba(20,125,115,.18);
    border-radius: 22px;
    background: rgba(255,255,255,.84);
    box-shadow: 0 12px 28px rgba(9,33,63,.05);
}
.next-action-card span, .contract-kpis span { display: block; color: var(--muted); font-weight: 850; font-size: .86rem; }
.next-action-card strong { display: block; color: var(--navy); font-size: 1.15rem; line-height: 1.25; }
.next-action-card p { margin: .35rem 0 0; color: var(--muted); }
.dashboard-section-title {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: center;
    margin: 1.6rem 0 .8rem;
    color: var(--navy);
    font-weight: 900;
}
.dashboard-section-title a { color: var(--teal); text-decoration: none; }
.card-head { display: flex; justify-content: space-between; gap: 1rem; align-items: flex-start; }
.clean-list { display: grid; gap: .65rem; list-style: none; padding: 0; margin: .8rem 0 0; }
.clean-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .75rem .85rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #f8fbfa;
}
.clean-list span { color: var(--muted); font-weight: 750; }
.empty-copy { color: var(--muted); margin-bottom: 0; }
.notice-soft { color: var(--navy-2); background: var(--blue-soft); border-color: #bfd3f6; }
.contract-card {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
    padding: clamp(1.2rem, 3vw, 1.85rem);
    border: 1px solid rgba(20,125,115,.22);
    border-radius: 32px;
    background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(247,252,251,.94));
    box-shadow: 0 20px 50px rgba(9,33,63,.08);
    margin-bottom: 1rem;
}
.contract-card h1 { margin-bottom: .45rem; }
.contract-subline { color: var(--navy-2); font-weight: 800; margin: 0 0 .7rem; }
.contract-meta, .contract-actions { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.contract-kpis {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .75rem;
}
.contract-kpis article {
    padding: .95rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8fbfa;
}
.contract-kpis strong { display: block; color: var(--navy); font-size: 1.05rem; line-height: 1.25; }
.contract-kpis small { color: var(--muted); font-weight: 750; }
.data-list { display: grid; grid-template-columns: minmax(140px, .35fr) 1fr; gap: .55rem 1rem; }
.filter-card {
    display: block;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 24px;
    background: rgba(255,255,255,.92);
    box-shadow: 0 14px 34px rgba(9,33,63,.055);
}
.filter-card label { color: var(--navy); font-weight: 850; }
.filter-main, .filter-secondary {
    display: grid;
    grid-template-columns: minmax(240px, 1.4fr) repeat(3, minmax(150px, .7fr)) auto;
    gap: .75rem;
    align-items: end;
}
.filter-secondary { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-top: .9rem; }
.advanced-filters {
    padding: .75rem 0 0;
    margin: .75rem 0 0;
    border: 0;
    border-top: 1px solid var(--line);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}
.advanced-filters summary { width: fit-content; padding: .35rem .65rem; border-radius: 999px; background: var(--blue-soft); }
.search-field input { min-height: 50px; }
.table-card {
    padding: .65rem;
    border: 1px solid var(--line);
    border-radius: 26px;
    background: rgba(255,255,255,.82);
    box-shadow: 0 16px 38px rgba(9,33,63,.06);
}
.table-card .table-wrap { margin: 0; }
.settings-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .8rem;
    margin: .9rem 0 1rem;
}
.settings-card, .action-card {
    display: grid;
    gap: .3rem;
    padding: .95rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: #f8fbfa;
    color: var(--navy);
    text-decoration: none;
    box-shadow: 0 10px 24px rgba(9,33,63,.04);
}
.settings-card strong, .action-card strong { font-size: 1rem; }
.settings-card span, .action-card span { color: var(--muted); font-weight: 700; }
.settings-card:hover, .action-card:hover, .settings-card:focus-visible, .action-card:focus-visible { border-color: rgba(20,125,115,.45); transform: translateY(-1px); }
.danger-card { border-color: #f2b7b7; background: #fffafa; }
.account-hub {
    margin-bottom: .9rem;
    padding: 1.15rem 1.2rem;
    border: 1px solid #c8d9f0;
    border-radius: 18px;
    background:
        linear-gradient(135deg, rgba(242, 248, 255, .98), rgba(231, 241, 255, .92));
    box-shadow: 0 18px 42px rgba(31, 95, 159, .1);
}

.account-hub h2 {
    margin: 0;
}

.account-hub p {
    margin: .35rem 0 0;
}

.settings-grid--compact {
    gap: .72rem;
    margin: .7rem 0 .95rem;
}

.settings-card-primary {
    border-color: #9fc0e5;
    background: linear-gradient(135deg, #f2f8ff, #ffffff);
    box-shadow: 0 18px 42px rgba(31, 95, 159, .16);
    padding: 1.15rem;
    grid-column: 1 / -1;
}

.settings-card-primary strong {
    color: #174f87;
    font-size: 1.08rem;
}

.settings-card-cta {
    display: inline-block;
    margin-top: .2rem;
    font-size: .78rem;
    color: #1f5f9f;
    font-weight: 780;
}

.settings-card-cta::after {
    content: " ↗";
    opacity: .72;
}
.upload-panel {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: #f8fbfa;
}
.compact-empty { box-shadow: none; margin-top: .8rem; }
.activity-list { display: grid; gap: .75rem; }
.activity-item {
    padding: .9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: #f8fbfa;
}
.activity-item span { color: var(--muted); font-weight: 800; font-size: .88rem; }
.activity-item p { margin: .25rem 0 0; color: var(--muted); }
.deadline-groups { display: grid; gap: 1rem; }
.deadline-group h2 { font-size: 1.2rem; margin-bottom: .55rem; }
.deadline-row {
    display: grid !important;
    grid-template-columns: 150px minmax(0, 1fr) minmax(130px, auto);
    align-items: center;
}
.costs-date-card { grid-template-columns: minmax(220px, 340px) auto; }
@media (max-width: 980px) {
    .summary-card { grid-template-columns: 1fr; }
    .contract-kpis, .filter-main, .settings-grid { grid-template-columns: 1fr 1fr; }
    .hero-action-stack { min-width: 0; }
}
@media (max-width: 720px) {
    .contract-kpis, .filter-main, .settings-grid, .costs-date-card { grid-template-columns: 1fr; }
    .clean-list li, .card-head, .dashboard-section-title { flex-direction: column; align-items: flex-start; }
    .deadline-row { grid-template-columns: 1fr !important; }
}

/* Phase 16.1: premium SaaS app refinement. */
:root {
    --ice: #f5fbfa;
    --ice-2: #edf7f5;
    --surface: rgba(255, 255, 255, .92);
    --surface-strong: #ffffff;
    --slate: #40546b;
    --soft-shadow: 0 18px 48px rgba(9, 33, 63, .08);
    --card-shadow: 0 24px 70px rgba(9, 33, 63, .105);
    --focus: 0 0 0 4px rgba(20, 125, 115, .16);
}

.app-body {
    background:
        radial-gradient(circle at 12% -8%, rgba(20,125,115,.17), transparent 34rem),
        radial-gradient(circle at 88% 0%, rgba(9,33,63,.10), transparent 30rem),
        linear-gradient(180deg, #f7fbfa 0%, #eef7f6 44%, #fbfdfb 100%);
    color: #102238;
}

.app-topbar.app-header {
    min-height: 68px;
    padding: .7rem max(1rem, calc((100vw - 1240px) / 2));
    background: rgba(250,253,251,.86);
    border-bottom: 1px solid rgba(219,228,234,.72);
    box-shadow: 0 10px 30px rgba(9,33,63,.05);
}

.brand-copy { display: grid; line-height: 1.05; }
.brand-copy small {
    color: var(--muted);
    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.app-topnav {
    flex: 1;
    justify-content: flex-end;
    gap: .8rem;
}

.nav-primary {
    margin-inline: auto;
    padding: .25rem;
    border: 1px solid rgba(219,228,234,.82);
    border-radius: 999px;
    background: rgba(255,255,255,.72);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}

.nav-secondary {
    border-left: 0;
    padding-left: 0;
}

.app-topnav a,
.app-topnav .link-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    padding: .48rem .78rem;
    border-radius: 999px;
    transition: background .18s ease, color .18s ease, transform .18s ease, box-shadow .18s ease;
}

.app-topnav a.is-active {
    color: var(--navy);
    background: #fff;
    box-shadow: 0 8px 22px rgba(9,33,63,.09);
}

.nav-cta {
    padding-inline: 1rem !important;
    background: linear-gradient(135deg, #149184, #0f6c64);
    box-shadow: 0 14px 30px rgba(20,125,115,.26);
}

.nav-cta.is-active,
.nav-cta:hover,
.nav-cta:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 38px rgba(20,125,115,.28);
}

.admin-nav-link {
    font-size: .86rem;
    box-shadow: none;
}

.app-container,
.page-shell {
    width: min(1240px, calc(100% - 2rem));
    padding-top: clamp(1.25rem, 2.5vw, 2.15rem);
}

.app-section { padding-top: .35rem; }
.page-head,
.page-header {
    padding: clamp(1rem, 2.5vw, 1.4rem);
    border: 1px solid rgba(219,228,234,.78);
    border-radius: 30px;
    background: rgba(255,255,255,.66);
    box-shadow: 0 16px 42px rgba(9,33,63,.055);
}

.page-eyebrow,
.page-head .eyebrow { margin-bottom: .55rem; }
.page-title,
.app-section .page-head h1 {
    max-width: 18ch;
    font-size: clamp(1.9rem, 3.6vw, 3.05rem);
    letter-spacing: -.05em;
}
.page-subtitle { max-width: 68ch; font-size: 1.02rem; }

.hero-panel,
.summary-card {
    position: relative;
    overflow: hidden;
    isolation: isolate;
    border: 1px solid rgba(183,218,212,.72);
    background:
        linear-gradient(140deg, rgba(255,255,255,.96), rgba(240,250,248,.91) 54%, rgba(226,246,241,.82)),
        radial-gradient(circle at 100% 0%, rgba(20,125,115,.18), transparent 22rem);
    box-shadow: var(--card-shadow);
}

.hero-panel::after,
.contract-card::after {
    content: "";
    position: absolute;
    inset: auto -8rem -10rem auto;
    width: 22rem;
    height: 22rem;
    border-radius: 999px;
    background: rgba(20,125,115,.08);
    z-index: -1;
}

.hero-panel h1,
.summary-card h1 {
    font-size: clamp(2.15rem, 4.8vw, 4rem);
    letter-spacing: -.062em;
}

.hero-action-stack .button,
.contract-actions .button,
.page-actions .button { min-height: 42px; }

.button {
    min-height: 44px;
    border-radius: 16px;
    background: linear-gradient(135deg, #159284, #0f6f66);
    box-shadow: 0 14px 30px rgba(20,125,115,.22);
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover,
.button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(20,125,115,.26);
}

.button-secondary {
    background: rgba(255,255,255,.86);
    color: var(--navy);
    border: 1px solid rgba(219,228,234,.96);
    box-shadow: 0 8px 20px rgba(9,33,63,.045);
}

.button-secondary:hover,
.button-secondary:focus-visible {
    background: #fff;
    box-shadow: 0 12px 28px rgba(9,33,63,.08);
}

.danger-text,
.danger-link { color: #9f3434 !important; }

.metric-grid { gap: .9rem; }
.metric-card {
    position: relative;
    overflow: hidden;
    border-color: rgba(219,228,234,.86);
    background: var(--surface);
    box-shadow: var(--soft-shadow);
}

.metric-card::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    background: rgba(20,125,115,.22);
}

.metric-card-primary,
.metric-card-money,
.metric-card-payment,
.metric-card-warning {
    min-height: 132px;
    background: linear-gradient(180deg, #ffffff, #f5fbfa);
}

.metric-card-primary::before { background: var(--teal); }
.metric-card-money::before { background: #0f6f66; }
.metric-card-payment::before { background: #315f9f; }
.metric-card-warning::before { background: var(--amber); }

.metric-card strong {
    margin-top: .35rem;
    font-size: clamp(1.6rem, 3.2vw, 2.6rem);
}

.insight-card,
.timeline-card,
.data-table-card,
.form-card,
.detail-card {
    border-color: rgba(219,228,234,.82);
    background: rgba(255,255,255,.90);
    box-shadow: var(--soft-shadow);
}

.insight-card h2,
.detail-card h2 {
    font-size: clamp(1.22rem, 2.2vw, 1.72rem);
    letter-spacing: -.025em;
}

.next-action-card {
    border-color: rgba(20,125,115,.22);
    background: linear-gradient(135deg, #fff, #f0fbf8);
}

.next-action-card strong { font-size: clamp(1.12rem, 2.1vw, 1.42rem); }

.dashboard-core-metrics {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

.priority-grid {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, .85fr);
}

.timeline-list > div,
.timeline-item,
.deadline-row {
    border-color: rgba(219,228,234,.82);
    background: linear-gradient(180deg, rgba(255,255,255,.98), rgba(248,252,251,.94));
    box-shadow: 0 10px 24px rgba(9,33,63,.045);
}

.deadline-group {
    padding: 1rem;
    border: 1px solid rgba(219,228,234,.82);
    border-radius: 26px;
    background: rgba(255,255,255,.72);
}

.deadline-row {
    position: relative;
    padding-left: 1.15rem;
}

.deadline-row::before {
    content: "";
    position: absolute;
    left: .35rem;
    top: 1rem;
    bottom: 1rem;
    width: 3px;
    border-radius: 999px;
    background: rgba(20,125,115,.26);
}

.contract-card.contract-dossier {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.15rem;
    border-radius: 34px;
}

.contract-kpis article {
    border-color: rgba(219,228,234,.82);
    background: rgba(255,255,255,.82);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.85);
}

.contract-kpis strong { font-size: 1.12rem; }
.tabs {
    padding: .35rem;
    border: 1px solid rgba(219,228,234,.82);
    border-radius: 999px;
    background: rgba(255,255,255,.74);
    width: fit-content;
}
.tabs a {
    border: 0;
    background: transparent;
}
.tabs a.active {
    background: var(--navy);
    box-shadow: 0 10px 24px rgba(9,33,63,.14);
}

.filter-panel {
    border-radius: 28px;
    background: rgba(255,255,255,.86);
    box-shadow: var(--soft-shadow);
}

.filter-panel input,
.filter-panel select,
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea {
    border-color: rgba(203,216,225,.95);
    background: rgba(255,255,255,.96);
}

.entry-table-row td {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.entry-table-row:hover td {
    background: #fbfefd;
}

.entry-title-cell strong {
    color: var(--navy);
    font-size: 1.02rem;
}

.entry-mobile-card.contract-list-card {
    border-radius: 26px;
    background: var(--surface);
    box-shadow: var(--soft-shadow);
}

.table-card,
.data-table-card {
    border-radius: 30px;
    background: rgba(255,255,255,.78);
}

.table-wrap {
    border-color: rgba(219,228,234,.86);
}

th {
    color: var(--slate);
    background: #f4faf8;
    font-size: .82rem;
    letter-spacing: .035em;
    text-transform: uppercase;
}

td { color: #17283d; }

.status-pill,
.badge {
    border: 1px solid rgba(219,228,234,.78);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.78);
}

.status-green,
.status-active,
.status-success {
    background: #dff5f1;
    color: #0b645c;
    border-color: #b7ddd8;
}

.status-yellow,
.status-warning {
    background: #fddada;
    color: #7a2525;
    border-color: #f2b7b7;
}

.status-red,
.status-danger {
    background: #fdeaea;
    color: #8a2e2e;
    border-color: #f2b7b7;
}

.status-blue,
.status-info {
    background: #e7f0ff;
    color: #214a7d;
    border-color: #bfd3f6;
}

.status-gray,
.status-muted {
    background: #eef2f4;
    color: #596879;
    border-color: #d7e0e7;
}

.notice {
    box-shadow: 0 10px 26px rgba(194,37,37,.08);
}

.notice-soft {
    font-size: .95rem;
    font-weight: 700;
}

.notice-warning {
    background: var(--amber-soft);
    color: #7a2525;
    border-color: #f2b7b7;
}

.settings-card,
.action-card {
    background: linear-gradient(180deg, #fff, #f7fbfa);
    border-color: rgba(219,228,234,.86);
}

.settings-card::before,
.action-card::before {
    content: "";
    width: 34px;
    height: 34px;
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(20,125,115,.16), rgba(9,33,63,.08));
}

.action-row {
    padding-top: .2rem;
}

.content-stack { display: grid; gap: 1rem; }
.content-grid { align-items: stretch; }

@media (max-width: 1120px) {
    .dashboard-core-metrics { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .priority-grid { grid-template-columns: 1fr; }
    .app-topbar.app-header { align-items: flex-start; }
    .app-topnav { justify-content: flex-start; }
    .nav-primary { margin-inline: 0; }
}

@media (max-width: 820px) {
    .app-topbar.app-header { gap: .75rem; }
    .brand-copy small { display: none; }
    .app-header-logo {
        height: 30px;
        max-width: 150px;
    }
    .nav-primary,
    .nav-secondary {
        width: 100%;
        overflow-x: auto;
        flex-wrap: nowrap;
        justify-content: flex-start;
    }
    .app-topnav a,
    .app-topnav .link-button { white-space: nowrap; }
    .page-head,
    .page-header { border-radius: 24px; }
    .dashboard-core-metrics { grid-template-columns: 1fr; }
    .tabs { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
}

/* Phase 16.2: compact data-first SaaS color system and density migration. */
:root {
    --color-primary: #2563EB;
    --color-primary-hover: #1D4ED8;
    --color-primary-dark: #1E3A8A;
    --color-primary-soft: #DBEAFE;

    --color-accent: #DC2626;
    --color-accent-soft: #FEE2E2;
    --color-accent-dark: #991B1B;

    --color-success: #16A34A;
    --color-success-soft: #DCFCE7;

    --color-danger: #DC2626;
    --color-danger-soft: #FEE2E2;

    --color-bg: #F8FAFC;
    --color-surface: #FFFFFF;
    --color-surface-muted: #F1F5F9;

    --color-text: #0F172A;
    --color-text-muted: #64748B;
    --color-border: #E2E8F0;

    --navy: var(--color-text);
    --navy-2: var(--color-primary-dark);
    --teal: var(--color-primary);
    --teal-soft: var(--color-primary-soft);
    --amber: var(--color-accent);
    --amber-soft: var(--color-accent-soft);
    --red: var(--color-danger);
    --red-soft: var(--color-danger-soft);
    --blue-soft: var(--color-primary-soft);
    --paper: var(--color-surface);
    --mist: var(--color-surface-muted);
    --ink: var(--color-text);
    --muted: var(--color-text-muted);
    --line: var(--color-border);
    --radius: 14px;
    --shadow: 0 10px 26px rgba(15, 23, 42, .08);
    --soft-shadow: 0 8px 22px rgba(15, 23, 42, .06);
    --card-shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

body,
.app-body {
    color: var(--color-text);
    background: var(--color-bg);
    line-height: 1.48;
}

.app-topbar.app-header {
    min-height: 58px;
    padding: .45rem max(.85rem, calc((100vw - 1280px) / 2));
    background: rgba(255, 255, 255, .94);
    border-bottom: 1px solid var(--color-border);
    box-shadow: 0 4px 18px rgba(15, 23, 42, .045);
}

.brand { gap: .55rem; }
.app-header-logo {
    display: block;
    width: auto;
    height: 34px;
    max-width: 180px;
    object-fit: contain;
}
.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    box-shadow: 0 8px 18px rgba(37, 99, 235, .18);
}
.brand-copy { font-size: .95rem; }
.brand-copy small { font-size: .62rem; color: var(--color-text-muted); }

.app-topnav { gap: .55rem; font-size: .88rem; }
.nav-primary {
    gap: .12rem;
    padding: .16rem;
    border-radius: 12px;
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    box-shadow: none;
}
.nav-secondary { gap: .18rem; }
.app-topnav a,
.app-topnav .link-button {
    min-height: 34px;
    padding: .38rem .62rem;
    border-radius: 10px;
    color: var(--color-text-muted);
}
.app-topnav a.is-active {
    color: var(--color-primary-dark);
    background: var(--color-surface);
    box-shadow: 0 1px 2px rgba(15, 23, 42, .06);
}
.app-topnav a:hover,
.app-topnav a:focus-visible,
.app-topnav .link-button:hover,
.app-topnav .link-button:focus-visible {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
}
.nav-cta {
    min-height: 36px !important;
    padding: .42rem .78rem !important;
    border-radius: 10px;
    background: var(--color-primary) !important;
    box-shadow: 0 7px 16px rgba(37, 99, 235, .20);
}
.nav-cta:hover,
.nav-cta:focus-visible {
    background: var(--color-primary-hover) !important;
    box-shadow: 0 9px 20px rgba(37, 99, 235, .24);
}
.admin-nav-link {
    color: var(--muted);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 10px;
    width: 100%;
    padding: .45rem .68rem;
    margin: 0;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: .4rem;
    min-height: 36px;
    line-height: 1.1;
    font-weight: 780;
    white-space: nowrap;
    transition: background .2s ease, border-color .2s ease, color .2s ease, transform .2s ease;
}

.admin-topbar {
    position: sticky;
    top: 0;
    z-index: 14;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .9rem;
    min-height: 58px;
    padding: .58rem max(.9rem, calc((100vw - 1320px) / 2));
    background: #f5f8ff;
    border-bottom: 1px solid #d6e1f0;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .06);
}

.admin-brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: 900;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
}

.admin-brand-text {
    font-weight: 800;
    color: var(--color-text);
    letter-spacing: .01em;
}

.admin-sidebar-toggle-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.admin-sidebar-toggle-btn {
    display: none;
    align-items: center;
    justify-content: center;
    gap: .45rem;
    height: 36px;
    padding: .35rem .75rem;
    border: 1px solid var(--color-border);
    border-radius: 10px;
    background: var(--color-surface);
    font-size: .88rem;
    font-weight: 780;
    letter-spacing: .01em;
    cursor: pointer;
}

.admin-shell {
    width: min(1320px, calc(100% - 1.6rem));
    margin-inline: auto;
    padding: .8rem 0 2.2rem;
    display: grid;
    grid-template-columns: minmax(250px, 280px) minmax(0, 1fr);
    gap: 1rem;
    align-items: start;
}

.admin-sidebar {
    position: sticky;
    top: .8rem;
    align-self: start;
    max-height: calc(100vh - 1.8rem);
    overflow: auto;
    border-radius: 16px;
    padding: .72rem;
    border: 1px solid #d6e1f0;
    background: #fff;
    box-shadow: 0 14px 42px rgba(15, 23, 42, .07);
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

.admin-nav-block,
.admin-nav-footer {
    display: grid;
    gap: .38rem;
    border: 1px solid #e8eef8;
    border-radius: 12px;
    padding: .62rem;
    background: #f7fbff;
}

.admin-nav-title {
    margin: 0;
    font-size: .72rem;
    text-transform: uppercase;
    letter-spacing: .08em;
    font-weight: 860;
    color: #51647d;
}

.admin-nav-link.is-active {
    color: var(--color-primary-dark);
    background: #e6edff;
    border-color: #bfd2ff;
    transform: translateX(2px);
}

.admin-sidebar-close-mobile {
    display: none;
    width: 100%;
    border: 1px solid #d7e0f0;
    border-radius: 10px;
    background: #f6faff;
    min-height: 33px;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
}

.admin-content,
.admin-content-inner {
    min-width: 0;
}

.admin-content {
    width: 100%;
}

.admin-logout-form {
    width: 100%;
    margin-top: .35rem;
    justify-self: stretch;
}

.admin-current-user {
    margin: .35rem 0 0;
    padding: .45rem .55rem;
    border-radius: 10px;
    background: #eaf2fb;
    border: 1px solid #d5e0ef;
    color: #2f4b63;
    font-size: .78rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
}

.app-container,
.page-shell,
.app-shell {
    width: min(1280px, calc(100% - 1.5rem));
    padding: 1rem 0 2.25rem;
}
.app-section { padding: .2rem 0 2rem; }
.compact-saas-page { display: grid; gap: .85rem; }

.page-head,
.page-header {
    margin-bottom: .65rem;
    padding: .9rem 1rem;
    border-radius: 16px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    box-shadow: none;
}
.page-title,
.app-section .page-head h1 {
    font-size: clamp(1.45rem, 2.4vw, 2.2rem);
    letter-spacing: -.035em;
    margin-bottom: .3rem;
}
.page-subtitle,
.page-head .muted {
    font-size: .92rem;
    max-width: 78ch;
}
.eyebrow,
.page-eyebrow {
    margin-bottom: .35rem;
    color: var(--color-primary);
    font-size: .68rem;
    letter-spacing: .1em;
}

.hero-panel,
.summary-card {
    padding: .95rem 1rem;
    border-radius: 16px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--soft-shadow);
}
.hero-panel::after,
.contract-card::after { display: none; }
.hero-panel h1,
.summary-card h1 {
    font-size: clamp(1.65rem, 3vw, 2.5rem);
    margin-bottom: .35rem;
}
.dashboard-hero-card,
.costs-hero-card,
.deadlines-hero-card {
    grid-template-columns: minmax(0, 1fr) max-content;
}
.dashboard-hero-card .hero-text,
.costs-hero-card .hero-text,
.deadlines-hero-card .hero-text,
.hero-text {
    font-size: .98rem;
    line-height: 1.45;
}
.hero-action-stack {
    min-width: 170px;
    gap: .42rem;
}

.button {
    min-height: 38px;
    padding: .5rem .78rem;
    border-radius: 10px;
    background: var(--color-primary);
    color: #fff;
    font-size: .88rem;
    font-weight: 760;
    box-shadow: 0 6px 14px rgba(37, 99, 235, .16);
}
.button:hover,
.button:focus-visible {
    background: var(--color-primary-hover);
    transform: none;
    box-shadow: 0 8px 18px rgba(37, 99, 235, .20);
}
.button-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
    box-shadow: none;
}
.button-secondary:hover,
.button-secondary:focus-visible {
    background: var(--color-surface-muted);
    box-shadow: none;
}
.button-small,
.link-button {
    min-height: 30px;
    font-size: .84rem;
}

.metric-grid,
.dashboard-metrics {
    gap: .65rem;
    margin: .75rem 0;
}
.dashboard-core-metrics,
.compact-kpi-grid,
.metric-grid-wide {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.metric-card {
    min-height: 86px;
    padding: .75rem .8rem .75rem .9rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}
.metric-card::before { width: 3px; background: var(--color-primary-soft); }
.metric-card span {
    font-size: .76rem;
    line-height: 1.25;
    color: var(--color-text-muted);
}
.metric-card strong {
    margin-top: .2rem;
    font-size: clamp(1.25rem, 2.1vw, 1.85rem);
    line-height: 1.1;
}
.metric-card-primary::before,
.metric-card-money::before,
.metric-card-payment::before { background: var(--color-primary); }
.metric-card-warning::before { background: var(--color-accent); }

.detail-grid,
.content-grid {
    gap: .75rem;
}
.detail-card,
.insight-card,
.timeline-card,
.data-table-card,
.form-card,
.table-card {
    padding: .9rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}
.detail-card h2,
.insight-card h2,
.form-card h2 {
    font-size: clamp(1.05rem, 1.6vw, 1.35rem);
    margin-bottom: .55rem;
}
.detail-card dl {
    grid-template-columns: minmax(130px, .42fr) 1fr;
    gap: .35rem .75rem;
    font-size: .9rem;
}
.detail-card dt { color: var(--color-text-muted); }
.detail-card dd { font-weight: 680; }

.dashboard-section-title {
    margin: .95rem 0 .35rem;
    font-size: .88rem;
}
.next-action-card {
    margin-top: .65rem;
    padding: .65rem .75rem;
    border-radius: 12px;
    background: var(--color-primary-soft);
    border-color: #BFDBFE;
}
.next-action-card span,
.contract-kpis span {
    font-size: .72rem;
}
.next-action-card strong {
    font-size: 1rem;
}
.next-action-card p { margin-top: .2rem; font-size: .86rem; }

.clean-list { gap: .4rem; margin-top: .45rem; }
.clean-list li {
    padding: .5rem .6rem;
    border-radius: 10px;
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    font-size: .88rem;
}
.period-grid,
.quick-action-grid,
.action-card-grid {
    gap: .55rem;
}
.period-card,
.quick-action-grid a,
.action-card,
.settings-card {
    padding: .65rem .72rem;
    border-radius: 12px;
    border-color: var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}
.period-card h3,
.action-card strong,
.settings-card strong {
    font-size: .93rem;
    margin-bottom: .12rem;
}
.period-card p,
.action-card span,
.settings-card span {
    margin: .15rem 0;
    font-size: .82rem;
    line-height: 1.34;
}
.settings-card::before,
.action-card::before {
    display: none;
}

.filter-card,
.filter-panel {
    padding: .75rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    box-shadow: none;
}
.filter-main {
    grid-template-columns: minmax(260px, 1.35fr) repeat(3, minmax(130px, .58fr)) auto;
    gap: .5rem;
}
.filter-secondary {
    gap: .5rem;
    margin-top: .55rem;
}
.filter-card label,
.filter-panel label,
.form-card label {
    font-size: .78rem;
    font-weight: 780;
    color: var(--color-text-muted);
}
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.form-card textarea,
.filter-bar input,
.filter-bar select,
.stacked-form input:not([type="checkbox"]):not([type="radio"]),
.stacked-form select,
.stacked-form textarea {
    min-height: 36px;
    border-radius: 9px;
    padding: .45rem .58rem;
    font-size: .9rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}
.advanced-filters {
    margin-top: .55rem;
    padding-top: .55rem;
}
.advanced-filters summary {
    padding: .28rem .52rem;
    border-radius: 9px;
    background: var(--color-surface-muted);
    color: var(--color-primary-dark);
    font-size: .84rem;
}

.table-card,
.data-grid-table,
.data-table-card {
    padding: .35rem;
    border-radius: 14px;
}
.table-wrap {
    margin: .55rem 0;
    border-radius: 12px;
}
table {
    min-width: 760px;
    font-size: .88rem;
}
th,
td {
    padding: .5rem .62rem;
}
th {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    font-size: .72rem;
    letter-spacing: .025em;
}
.entry-table-row td {
    padding-top: .55rem;
    padding-bottom: .55rem;
}
.entry-title-cell strong {
    font-size: .94rem;
}
.action-links {
    gap: .42rem;
}
.action-links a,
.table-wrap .link-button {
    font-size: .82rem;
}

.status-pill,
.badge {
    padding: .16rem .46rem;
    border-radius: 999px;
    font-size: .72rem;
    font-weight: 760;
    box-shadow: none;
}
.status-green,
.status-active,
.status-success {
    background: var(--color-success-soft);
    color: #166534;
    border-color: #BBF7D0;
}
.status-yellow,
.status-warning {
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
    border-color: #FDE68A;
}
.status-red,
.status-danger {
    background: var(--color-danger-soft);
    color: #991B1B;
    border-color: #FECACA;
}
.status-blue,
.status-info,
.badge-soft {
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    border-color: #BFDBFE;
}
.status-gray,
.status-muted {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
    border-color: var(--color-border);
}
.badge-warning {
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
    border-color: #FDE68A;
}

.notice,
.empty-state {
    padding: .75rem .85rem;
    border-radius: 12px;
    box-shadow: none;
}
.notice {
    background: var(--color-accent-soft);
    border-color: #FDE68A;
    color: var(--color-accent-dark);
    font-size: .88rem;
}
.notice-soft {
    background: var(--color-surface-muted);
    border-color: var(--color-border);
    color: var(--color-text-muted);
    font-size: .84rem;
}
.alert {
    padding: .75rem .85rem;
    border-radius: 12px;
}

.contract-card.contract-dossier,
.contract-card {
    padding: .95rem;
    border-radius: 16px;
    border-color: var(--color-border);
    background: var(--color-surface);
    box-shadow: var(--soft-shadow);
}
.contract-subline {
    margin-bottom: .45rem;
    font-size: .9rem;
}
.contract-meta,
.contract-actions {
    gap: .42rem;
}
.contract-kpis {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .5rem;
}
.contract-kpis article {
    padding: .58rem .65rem;
    border-radius: 10px;
    background: var(--color-surface-muted);
}
.contract-kpis strong {
    font-size: .96rem;
}
.contract-kpis small {
    font-size: .75rem;
}
.tabs {
    padding: .2rem;
    border-radius: 12px;
    background: var(--color-surface-muted);
}
.tabs a {
    padding: .38rem .58rem;
    border-radius: 9px;
    font-size: .85rem;
}
.tabs a.active {
    background: var(--color-primary);
    box-shadow: none;
}

.deadline-groups,
.compact-timeline {
    gap: .6rem;
}
.deadline-group {
    padding: .65rem;
    border-radius: 14px;
    background: var(--color-surface);
}
.deadline-group h2 {
    font-size: .95rem;
    margin-bottom: .35rem;
}
.deadline-row {
    grid-template-columns: 118px minmax(0, 1fr) minmax(115px, auto);
    padding: .55rem .65rem .55rem .9rem;
    border-radius: 10px;
    box-shadow: none;
    font-size: .88rem;
}
.deadline-row::before {
    left: .28rem;
    top: .65rem;
    bottom: .65rem;
    width: 2px;
    background: var(--color-primary);
}

.account-summary-metrics {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.settings-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .5rem;
}
.profile-card form {
    display: grid;
    gap: .45rem;
}
.check-row,
.checkline,
.switch-row {
    gap: .45rem;
    font-size: .88rem;
}
.upload-panel,
.activity-item,
.compact-empty {
    padding: .7rem;
    border-radius: 12px;
}

.account-security-page {
    display: grid;
    gap: 1rem;
}

.account-security-head,
.account-security-card,
.account-security-table-card {
    max-width: none;
}

.account-security-status {
    margin-block: 0;
}

.account-security-retention {
    margin: 0;
}

.account-security-actions {
    align-items: stretch;
}

.account-security-section-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .9rem;
    margin-bottom: .75rem;
}

.account-security-section-head h2 {
    margin-bottom: .2rem;
}

.account-security-table-wrap {
    margin-bottom: .65rem;
}

.account-security-device-cell {
    max-width: 420px;
    overflow-wrap: anywhere;
}

.account-security-action-cell {
    min-width: 120px;
    white-space: nowrap;
}

.account-security-action-cell form {
    display: flex;
    justify-content: flex-end;
}

.totp-setup-card {
    align-self: start;
}

.totp-setup-copy {
    margin-bottom: .85rem;
}

.totp-setup-copy h2 {
    margin-bottom: .35rem;
}

.totp-setup-copy p {
    margin: 0;
}

.totp-setup-notes {
    margin: .55rem 0 0;
    padding-left: 1.1rem;
    color: var(--color-text-muted);
}

.totp-setup-notes li + li {
    margin-top: .25rem;
}

.totp-setup-grid {
    display: grid;
    grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
    gap: 1.1rem;
    align-items: start;
}

.qr-login-panel {
    align-items: start;
}

.qr-login-image {
    max-width: 260px;
    padding: .75rem;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: #fff;
    line-height: 0;
}

.qr-login-code {
    display: block;
    width: 100%;
    height: auto;
    shape-rendering: crispEdges;
}

.totp-confirm-panel {
    display: grid;
    gap: .85rem;
    min-width: 0;
}

.totp-confirm-form {
    display: grid;
    gap: .75rem;
    margin: 0;
}

.totp-confirm-form label {
    margin: 0;
}

.totp-app-link {
    display: grid;
    gap: .55rem;
}

.totp-app-link p {
    margin: 0;
}

.totp-app-link .button {
    justify-self: start;
}

.totp-secret-list {
    margin: 0;
    width: 100%;
}

.totp-secret-list dt {
    margin-bottom: .28rem;
}

.totp-secret-list code {
    display: block;
    width: 100%;
    max-width: 100%;
    padding: .55rem .65rem;
    border-radius: 10px;
    background: var(--color-surface-muted);
    overflow-wrap: anywhere;
}

.totp-recovery-card {
    scroll-margin-top: 1rem;
}

.totp-recovery-card:target {
    outline: 3px solid rgba(20,125,115,.24);
    outline-offset: 4px;
}

.totp-recovery-card h2 {
    margin-bottom: .35rem;
}

.totp-recovery-confirm-form {
    display: grid;
    gap: .75rem;
    margin-top: 1rem;
}

.totp-recovery-confirm-form .button {
    justify-self: start;
}

.totp-disable-panel {
    border-color: var(--color-border);
    background: var(--color-surface-muted);
    box-shadow: none;
}

.totp-disable-panel > summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    color: var(--color-text);
}

.totp-disable-panel > summary::after {
    content: "oeffnen";
    color: var(--color-text-muted);
    font-size: .78rem;
    font-weight: 760;
}

.totp-disable-panel[open] > summary::after {
    content: "schliessen";
}

.totp-disable-warning {
    margin: .65rem 0 .8rem;
    color: var(--color-text-muted);
    font-weight: 650;
}

.deadline-list-limit-note {
    margin: .35rem 0 .75rem;
}

@media (max-width: 980px) {
    .dashboard-hero-card,
    .costs-hero-card,
    .deadlines-hero-card,
    .filter-main {
        grid-template-columns: 1fr 1fr;
    }
    .hero-action-stack {
        grid-column: 1 / -1;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .detail-grid,
    .content-grid {
        grid-template-columns: 1fr;
    }
    .account-security-section-head,
    .totp-setup-grid {
        grid-template-columns: 1fr;
    }
    .account-security-section-head {
        display: grid;
    }
    .account-security-action-cell form {
        justify-content: flex-start;
    }
}

/* Phase 16.3a: entries page as a compact SaaS data grid. */
.button.button-secondary.button-small {
    color: var(--color-text) !important;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: .42rem .68rem;
    border: 1px solid transparent;
    border-radius: 9px;
    font: inherit;
    font-size: .86rem;
    font-weight: 760;
    line-height: 1.1;
    text-decoration: none;
    cursor: pointer;
    transition: background .16s ease, border-color .16s ease, color .16s ease;
}

.btn-primary {
    color: #fff;
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.btn-primary:hover,
.btn-primary:focus-visible {
    color: #fff;
    background: var(--color-primary-hover);
    border-color: var(--color-primary-hover);
}

.btn-secondary {
    color: var(--color-primary-dark);
    background: var(--color-surface);
    border-color: var(--color-border);
}

.btn-secondary:hover,
.btn-secondary:focus-visible {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
    border-color: #BFDBFE;
}

.btn-tertiary {
    color: var(--color-text-muted);
    background: transparent;
    border-color: transparent;
}

.btn-tertiary:hover,
.btn-tertiary:focus-visible {
    color: var(--color-primary-dark);
    background: var(--color-surface-muted);
}

.btn-danger {
    color: #fff;
    background: var(--color-danger);
    border-color: var(--color-danger);
}

.btn-sm {
    min-height: 30px;
    padding: .31rem .52rem;
    border-radius: 8px;
    font-size: .78rem;
}

.action-link {
    color: var(--color-primary-dark);
    font-size: .78rem;
    font-weight: 720;
    text-decoration: none;
}

.action-link:hover,
.action-link:focus-visible {
    color: var(--color-primary-hover);
    text-decoration: underline;
}

.action-link-danger {
    color: var(--color-danger) !important;
}

.entries-page .page-header {
    margin-bottom: .55rem;
}

.entries-page .filter-panel {
    padding: .66rem;
}

.entries-page .filter-main,
.entries-page .app-filter-grid {
    grid-template-columns: minmax(220px, 2fr) repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    align-items: end;
}

.entries-page .filter-main label,
.entries-page .filter-secondary label {
    color: var(--color-text-muted);
    font-size: .76rem;
    font-weight: 760;
}

.entries-page .advanced-filters {
    margin-top: .48rem;
    padding-top: .48rem;
    border-top: 1px solid var(--color-border);
}

.entries-page .advanced-filters summary {
    width: fit-content;
    min-height: 30px;
    padding: .33rem .54rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    font-size: .78rem;
}

.entries-page .filter-secondary {
    gap: .52rem;
    margin-top: .55rem;
}

.entries-page .app-filter-card {
    margin: .35rem 0 .35rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: 0 16px 40px rgba(15, 23, 42, .05);
}

.entries-page .app-filter-card .search-field {
    display: flex;
    flex-direction: column;
    gap: .18rem;
}

.app-entry-card {
    position: relative;
    border: 1px solid var(--color-border);
    border-radius: 14px;
    padding: 0;
    background: var(--color-surface);
    box-shadow: 0 16px 38px rgba(15, 23, 42, .06);
    overflow: hidden;
}

.app-entry-card--danger::before,
.app-entry-card--warning::before,
.app-entry-card--neutral::before {
    content: "";
    position: absolute;
    inset: 0 auto 0 0;
    width: 4px;
    border-radius: 14px 0 0 14px;
}

.app-entry-card--danger::before {
    background: var(--app-danger, #c22525);
}

.app-entry-card--warning::before {
    background: var(--app-warning, #c22525);
}

.app-entry-card--neutral::before {
    background: transparent;
}

.app-entry-card__header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 290px);
    gap: 1.125rem;
    align-items: flex-start;
    padding: 1rem 1rem .9rem;
    border-bottom: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.app-entry-card-top {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
    gap: 22px;
}

.app-entry-card__title-block {
    min-width: 0;
}

.app-entry-card__title-block h2 {
    margin: .5rem 0 .25rem;
    font-size: clamp(1.18rem, 2vw, 1.48rem);
    letter-spacing: 0;
}

.app-entry-card__title-block p {
    margin: 0;
}

.app-entry-meta {
    margin-top: .2rem;
    display: grid;
    gap: .48rem;
}

.app-entry-meta--primary {
    text-align: right;
}

.app-entry-card__summary {
    width: min(100%, 290px);
    justify-self: end;
    margin: 0;
    padding: .72rem;
    border: 1px solid rgba(148, 163, 184, .36);
    border-radius: 12px;
    background: rgba(255, 255, 255, .74);
}

.app-entry-card-summary {
    display: grid;
    gap: 0;
    min-width: 0;
    align-items: stretch;
}

.app-entry-card-summary-item {
    display: grid;
    gap: 4px;
    padding: 10px 12px;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.app-entry-card-summary-item:last-child {
    border-bottom: 0;
}

.app-entry-card-summary-label {
    color: var(--color-text-muted);
    font-size: .76rem;
    font-weight: 760;
    line-height: 1.2;
}

.app-entry-card-summary-value {
    min-width: 0;
    max-width: 100%;
    justify-self: start;
    text-align: left;
    font-size: clamp(.96rem, 1.2vw, 1.12rem);
    line-height: 1.15;
    word-break: normal;
    overflow-wrap: normal;
}

.app-entry-summary-row {
    display: grid;
    grid-template-columns: minmax(0, .95fr) minmax(0, 1.05fr);
    align-items: baseline;
    gap: .8rem;
    padding: .36rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, .22);
}

.app-entry-summary-row:first-child {
    padding-top: 0;
}

.app-entry-summary-row:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.app-entry-summary-row span {
    color: var(--color-text-muted);
    font-size: .78rem;
    font-weight: 760;
}

.app-entry-meta p {
    margin: 0;
    color: var(--color-text-muted);
}

.app-entry-meta strong {
    color: var(--color-text);
}

.app-entry-cost {
    color: var(--color-text);
    font-size: 1.2rem;
    letter-spacing: .01em;
    font-weight: 820;
    margin-top: .02rem;
}

.app-entry-summary-value,
.app-entry-card-summary-value {
    min-width: 0;
    justify-self: end;
    text-align: right;
    font-size: clamp(.96rem, 1.2vw, 1.12rem);
    line-height: 1.15;
    word-break: normal;
    overflow-wrap: normal;
}

.app-entry-card-summary-item .app-entry-card-summary-value {
    justify-self: start;
    text-align: left;
}

.app-entry-card__summary .app-money,
.app-entry-card__summary .app-entry-cost-value {
    font-size: clamp(1.05rem, 1.4vw, 1.26rem);
    line-height: 1.15;
}

.app-entry-summary-value.app-entry-card-date,
.app-entry-card .app-entry-card-date,
.app-entry-card .app-money,
.app-entry-card .app-cost-value {
    white-space: nowrap;
    word-break: normal;
    overflow-wrap: normal;
}

.app-entry-card .app-money {
    white-space: nowrap;
}

.app-entry-card .app-entry-card-date {
    white-space: nowrap;
}

.app-entry-meta-grid {
    grid-template-columns: minmax(96px, auto) 1fr;
}

.app-entry-card__details,
.app-entry-card-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    border-bottom: 1px solid var(--color-border);
}

.app-entry-card-details {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

.app-entry-detail-row,
.app-entry-card-detail {
    display: flex;
    flex-direction: column;
    grid-template-columns: minmax(96px, .78fr) minmax(0, 1.22fr);
    gap: .375rem;
    align-items: start;
    min-width: 0;
    min-height: 68px;
    padding: .82rem 1rem;
    border-top: 1px solid rgba(148, 163, 184, .28);
}

.app-entry-card-detail {
    gap: .375rem;
}

.app-entry-detail-row {
    border-top: 1px solid rgba(148, 163, 184, .28);
}

.app-entry-detail-row:nth-child(2n),
.app-entry-card-detail:nth-child(2n) {
    border-left: 1px solid rgba(148, 163, 184, .22);
}

.app-entry-detail-row dt,
.app-entry-card-detail dt,
.app-entry-detail-row dd,
.app-entry-card-detail dd,
.app-entry-card-detail-value {
    min-width: 0;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.app-entry-detail-row .app-chip,
.app-entry-card-detail .app-chip,
.app-entry-card-detail-value .app-chip {
    max-width: 100%;
    min-width: 0;
    white-space: normal;
    line-height: 1.18;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
    text-align: left;
}

.app-entry-card-detail .app-entry-card-value-text {
    display: inline;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--color-text);
    font-weight: 760;
    box-shadow: none;
}

.app-entry-card-detail .app-entry-card-value-text.category-label {
    display: inline-flex;
    align-items: center;
    gap: .32rem;
}

.app-entry-card-detail .app-entry-card-status-badge {
    max-width: 100%;
    white-space: normal;
}

.app-entry-card .app-pill,
.app-entry-card .app-badge,
.app-entry-card .app-entry-card-detail-value,
.app-entry-card .app-entry-card-summary-value {
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.app-entry-card .app-entry-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    width: fit-content;
    max-width: 100%;
    padding: 6px 10px;
    border-radius: 10px;
    border: 1px solid #f2b7b7;
    background: #fde8e8;
    color: #7a2525;
    line-height: 1.2;
    box-shadow: none;
}

.app-entry-card .app-entry-status--danger {
    border-color: #f2b7b7;
}

.app-entry-card .app-entry-status--warning {
    border-color: #f2b7b7;
    background: #fde8e8;
}

.app-entry-card .app-entry-status-label {
    font-size: .74rem;
    font-weight: 780;
    color: #7a2525;
    text-transform: uppercase;
    letter-spacing: .025em;
}

.app-entry-card .app-entry-status strong {
    font-size: .86rem;
    font-weight: 780;
}

.app-entry-card-status-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 6px;
    margin: 8px 0 0;
    color: var(--color-text-muted);
    font-size: .9rem;
    line-height: 1.35;
}

.app-entry-card-status-meta span {
    color: var(--color-text-muted);
    font-weight: 760;
}

.app-entry-card-status-meta strong {
    color: var(--color-text);
    font-size: .9rem;
    font-weight: 790;
}

.app-entry-meta-grid dt {
    font-size: .78rem;
    color: var(--color-text-muted);
    font-weight: 760;
    padding-top: .1rem;
}

.app-entry-meta-grid dd {
    margin: 0;
}

.app-entry-status-hint {
    margin: 0;
    padding: .78rem 1rem;
    background: #f8fbff;
    color: var(--color-text-muted);
    line-height: 1.45;
}

.app-entry-status {
    display: grid;
    gap: 4px;
    width: fit-content;
    max-width: 100%;
    padding: 10px 12px;
    border-radius: 14px;
    border: 1px solid #f2b7b7;
    background: #fde8e8;
    color: #7a2525;
}

.app-entry-status strong {
    font-weight: 820;
}

.app-entry-status span {
    color: #7a2525;
}

.app-entry-status-hint-text {
    color: #7a2525;
}

.app-entry-status--danger {
    border-color: #f2b7b7;
}

.app-entry-actions {
    margin: 0;
    padding: .78rem 1rem;
    border-top: 1px solid var(--color-border);
    align-items: center;
    justify-content: flex-end;
    background: #ffffff;
}

.app-entry-row.app-entry-row--danger td {
    box-shadow: none;
}

.app-entry-row.app-entry-row--danger td:first-child {
    box-shadow: inset 3px 0 0 0 var(--app-danger, #c22525);
}

.app-entry-row.app-entry-row--warning td {
    box-shadow: none;
}

.app-entry-row.app-entry-row--warning td:first-child {
    box-shadow: inset 3px 0 0 0 var(--app-warning, #c22525);
}

.entries-empty-state {
    padding: 1rem;
    border-radius: 14px;
    border: 1px solid var(--color-border);
    background: linear-gradient(180deg, #ffffff 0%, #f5f8ff 100%);
    display: grid;
    gap: .55rem;
    text-align: center;
}

.datagrid-toolbar {
    margin: .35rem 0 .45rem;
    padding-inline: .15rem;
}

.datagrid-toolbar p {
    margin: 0;
    font-size: .84rem;
}

/* Phase 16.3b: entries data grid icon actions and scanability polish. */
/* Phase 16.3b.1: fit entries grid width, column separators and larger icon actions. */
/* Phase 16.3b.2: refine entries row rhythm and stacked cell readability. */
.entries-data-grid-card {
    padding: 0;
    overflow: visible;
    border-radius: 12px;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.datagrid-scroll-hint {
    margin: .55rem .7rem .25rem;
    color: var(--color-text-muted);
    font-size: .74rem;
    font-weight: 720;
}

.app-table-scroll {
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    display: block;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
    scrollbar-gutter: stable;
}

.entries-datagrid {
    margin: 0;
    border: 0;
    border-radius: 0;
    max-width: 100%;
    overflow-x: auto;
    overflow-y: hidden;
}

.entries-datagrid table {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    table-layout: fixed;
    font-size: .86rem;
}

.entries-datagrid .app-entries-table {
    width: max-content;
    min-width: 1100px;
    max-width: none;
    table-layout: auto;
    border-collapse: separate;
    border-spacing: 0;
}

.app-entries-table th,
.app-entries-table td {
    border-left: 0;
    border-right: 0;
    vertical-align: top;
    word-break: normal;
    overflow-wrap: normal;
}

.app-entries-table th:last-child,
.app-entries-table td:last-child {
    border-right: 0;
}

.app-entries-table .app-table-nowrap,
.app-entries-table .app-actions,
.app-entries-table .app-money,
.app-entries-table .app-cost-value {
    white-space: nowrap;
}

.app-entries-table .app-table-nowrap {
    white-space: nowrap;
}

.app-entries-table .app-actions {
    white-space: nowrap;
}

.app-entries-table .app-money {
    white-space: nowrap;
}

.app-entries-table .app-cost-value {
    white-space: nowrap;
}

.app-entries-table .app-table-nowrap,
.app-entries-table .app-actions {
    overflow-wrap: normal;
}

.entries-datagrid .app-entries-table th,
.entries-datagrid .app-entries-table td {
    width: auto;
}

.entries-datagrid thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    padding: .58rem .66rem;
    border-bottom: 1px solid #CBD5E1;
    background: linear-gradient(180deg, #F8FAFC 0%, #F1F5F9 100%);
    color: var(--color-text-muted);
    font-size: .72rem;
    font-weight: 820;
    letter-spacing: .03em;
    white-space: nowrap;
}

.entries-datagrid tbody td {
    padding: .74rem .68rem;
    border-bottom: 1px solid #E5EAF1;
    vertical-align: top;
    line-height: 1.34;
}

.entries-datagrid thead th,
.entries-datagrid tbody td {
    border-left: 0;
    border-right: 1px solid rgba(226, 232, 240, .78);
}

.entries-datagrid thead th:last-child,
.entries-datagrid tbody td:last-child {
    border-right: 0;
}

.entries-datagrid tbody tr:last-child td {
    border-bottom: 0;
}

.entries-datagrid tbody tr:nth-child(even) td {
    background: rgba(248, 250, 252, .32);
}

.entries-datagrid tbody tr:hover td {
    background: #F3F8FF;
}

.entries-datagrid th:nth-child(1),
.datagrid-status-cell { width: 8%; }

.entries-datagrid th:nth-child(2),
.datagrid-contract-cell { width: 20%; }

.entries-datagrid th:nth-child(3),
.datagrid-provider-cell { width: 11%; }

.entries-datagrid th:nth-child(4),
.datagrid-category-cell { width: 11%; }

.entries-datagrid th:nth-child(5),
.datagrid-event-cell { width: 14%; }

.entries-datagrid th:nth-child(6),
.datagrid-cancel-cell { width: 10%; }

.entries-datagrid th:nth-child(7),
.datagrid-cost-cell { width: 10%; }

.entries-datagrid th:nth-child(8),
.datagrid-reminder-cell { width: 6%; }

.entries-datagrid th:nth-child(9),
.entry-actions-cell { width: 10%; }

.datagrid-status-cell,
.datagrid-category-cell,
.datagrid-event-cell,
.datagrid-cancel-cell,
.datagrid-cost-cell,
.datagrid-provider-cell {
    display: table-cell;
}

.datagrid-contract-cell {
    min-width: 0;
    max-width: none;
}

.datagrid-provider-cell {
    min-width: 0;
}

.datagrid-event-cell,
.datagrid-cancel-cell {
    min-width: 0;
    white-space: normal;
}

.datagrid-cost-cell {
    min-width: 0;
    white-space: nowrap;
}

.datagrid-reminder-cell {
    min-width: 0;
}

.entry-actions-cell,
.datagrid-reminder-cell {
    vertical-align: middle;
}

.datagrid-cell-stack {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: .22rem;
    min-width: 0;
}

.datagrid-status-stack {
    gap: .3rem;
}

.datagrid-category-stack,
.datagrid-event-stack,
.datagrid-cancel-stack,
.datagrid-cost-stack {
    gap: .2rem;
}

.entry-title-cell {
    gap: .22rem;
}

.entry-title-cell strong,
.datagrid-provider-cell strong,
.datagrid-event-cell strong,
.datagrid-cancel-cell strong,
.datagrid-cost-cell strong {
    display: block;
    color: var(--color-text);
    font-size: .93rem;
    font-weight: 800;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.datagrid-meta {
    display: block;
    color: var(--color-text-muted);
    font-size: .74rem;
    line-height: 1.36;
    overflow-wrap: anywhere;
}

.datagrid-provider-cell .datagrid-meta {
    margin-top: .12rem;
}

.datagrid-status-copy {
    font-size: .75rem;
    line-height: 1.4;
}

.datagrid-badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: .26rem;
    margin-top: .04rem;
    max-width: 100%;
}

.datagrid-note {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    color: var(--color-text-muted);
    font-size: .71rem;
    font-weight: 650;
    line-height: 1.26;
}

.entries-datagrid .badge,
.entries-datagrid .status-pill {
    padding: .13rem .38rem;
    font-size: .68rem;
    line-height: 1.25;
}

.entry-actions-cell {
    min-width: 172px;
    white-space: nowrap;
}

.table-actions {
    display: inline-flex;
    gap: .36rem;
    align-items: center;
    align-content: center;
    white-space: nowrap;
}

.table-action-links,
.row-action-links {
    display: flex;
    align-items: center;
    gap: .25rem;
    font-size: .76rem;
}

.table-action-icons {
    gap: .28rem;
}

.entry-actions-cell .btn {
    box-shadow: none;
}

.table-action-primary {
    min-width: 92px;
    gap: .32rem;
}

.entry-actions-cell .btn-sm {
    min-height: 32px;
    padding: .32rem .54rem;
    font-size: .78rem;
}

.icon-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 9px;
    background: #fff;
    color: var(--color-text-muted);
    text-decoration: none;
    transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}

.icon-action:hover,
.icon-action:focus-visible {
    border-color: var(--color-primary-soft);
    background: var(--color-primary-soft);
    color: var(--color-primary-dark);
    text-decoration: none;
}

.icon-action:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

.icon-action-danger {
    color: var(--color-danger);
}

.icon-action-danger:hover,
.icon-action-danger:focus-visible {
    border-color: var(--color-danger-soft);
    background: var(--color-danger-soft);
    color: var(--color-danger);
}

.action-icon {
    display: inline-block;
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

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

.mobile-action-icons {
    align-items: center;
    gap: .32rem;
}

.entries-page .pagination {
    margin-top: .55rem;
    font-size: .84rem;
}

/* Phase 16.3b: compact deadlines timeline for high scanability. */
/* Phase 16.3c: tabular deadlines list rhythm and priority scanability. */
.deadlines-page .deadlines-compact-hero {
    align-items: center;
    gap: .7rem;
    margin-bottom: .58rem;
    padding: .66rem .78rem;
}

.deadlines-page .deadlines-compact-hero h1 {
    margin-bottom: .2rem;
    font-size: clamp(1.34rem, 2.35vw, 1.82rem);
}

.deadlines-page .deadlines-compact-hero .hero-text {
    max-width: 70ch;
    margin: 0;
    font-size: .88rem;
    line-height: 1.42;
}

.deadline-actions {
    display: flex;
    justify-content: flex-end;
    gap: .38rem;
    flex-wrap: wrap;
}

.deadline-filter-panel {
    margin: .52rem 0 .62rem;
    padding: .56rem;
}

.deadline-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .8rem 1rem;
    align-items: end;
    width: 100%;
    max-width: 100%;
    overflow: visible;
}

.deadline-filter-grid label {
    display: grid;
    gap: .22rem;
    min-width: 0;
    color: var(--color-text-muted);
    font-size: .76rem;
    font-weight: 760;
}

.deadline-filter-grid label:first-child {
    min-width: 0;
}

.deadline-filter-priority {
    min-width: 150px;
}

.deadline-filter-grid input,
.deadline-filter-grid select {
    width: 100%;
    min-width: 0;
    min-height: 32px;
    border-radius: 8px;
    padding: .38rem .5rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
    font: inherit;
    font-size: .86rem;
}

.app-filter-submit,
.app-deadline-filter-submit,
.deadline-filter-grid button {
    min-width: 112px;
    width: auto;
    justify-self: start;
}

.app-deadline-filter-submit {
    grid-column: 1 / -1;
    min-width: 140px;
    max-width: 100%;
    justify-self: start;
    white-space: nowrap;
}

.deadline-list-view {
    gap: .58rem;
}

@media (max-width: 1180px) {
    .deadline-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .deadline-filter-grid .app-filter-submit,
    .deadline-filter-grid .app-deadline-filter-submit {
        grid-column: 1 / -1;
        min-width: 140px;
        justify-self: start;
    }
}

@media (max-width: 1320px) {
    .deadline-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    }

    .deadline-filter-grid .app-filter-submit,
    .deadline-filter-grid .app-deadline-filter-submit {
        grid-column: 1 / -1;
        min-width: 140px;
        justify-self: start;
    }
}

.deadline-group {
    padding: 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: var(--color-surface);
    box-shadow: none;
}

.deadline-group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .5rem .66rem;
    border-bottom: 1px solid var(--color-border);
    background: var(--color-surface-muted);
}

.deadline-group-header h2 {
    margin: 0;
    color: var(--color-text);
    font-size: .9rem;
    letter-spacing: -.01em;
}

.deadline-count {
    color: var(--color-text-muted);
    font-size: .74rem;
    font-weight: 720;
    white-space: nowrap;
}

.deadline-list-header {
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr) 164px;
    gap: .66rem;
    align-items: center;
    padding: .38rem .66rem;
    border-bottom: 1px solid var(--color-border);
    background: #F8FAFC;
    color: var(--color-text-muted);
    font-size: .68rem;
    font-weight: 820;
    letter-spacing: .035em;
    text-transform: uppercase;
}

.deadline-timeline {
    display: grid;
    gap: 0;
}

.deadline-row.deadline-event-row {
    display: grid !important;
    grid-template-columns: 124px minmax(0, 1fr) 164px;
    gap: .66rem;
    align-items: center;
    min-height: 58px;
    padding: .5rem .66rem;
    border: 0;
    border-bottom: 1px solid var(--color-border);
    border-radius: 0;
    background: var(--color-surface);
    box-shadow: none;
    font-size: .86rem;
}

.deadline-row.deadline-event-row:last-child {
    border-bottom: 0;
}

.deadline-row.deadline-event-row:hover {
    background: #EFF6FF;
}

.deadline-row.deadline-event-row::before {
    display: none;
}

.deadline-row.deadline-event-row.is-critical {
    background: linear-gradient(90deg, var(--color-danger-soft), var(--color-surface) 18%);
}

.deadline-cell {
    min-width: 0;
}

.deadline-date {
    display: grid;
    gap: .12rem;
}

.deadline-date strong {
    color: var(--color-text);
    font-size: .88rem;
    line-height: 1.2;
    white-space: nowrap;
}

.deadline-days {
    color: var(--color-text-muted);
    font-size: .74rem;
    font-weight: 720;
}

.deadline-event {
    display: flex;
    flex-direction: column;
    gap: .14rem;
    min-width: 0;
}

.deadline-event-top {
    display: flex;
    flex-wrap: wrap;
    gap: .22rem;
    align-items: center;
}

.deadline-event strong,
.deadline-title {
    color: var(--color-text);
    font-size: .92rem;
    line-height: 1.22;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deadline-meta {
    color: var(--color-text-muted);
    font-size: .76rem;
    line-height: 1.25;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.deadline-badge {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: .12rem .38rem;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    font-size: .7rem;
    font-weight: 760;
    line-height: 1.2;
}

.deadline-critical-badge {
    color: var(--color-danger);
    background: var(--color-danger-soft);
    border-color: #FECACA;
}

.deadline-badge.event-cancellation,
.deadline-badge.event-expiry {
    color: var(--color-accent-dark);
    background: var(--color-accent-soft);
    border-color: #FDE68A;
}

.deadline-badge.event-renewal {
    color: var(--color-primary-dark);
    background: var(--color-primary-soft);
    border-color: #BFDBFE;
}

.deadline-badge.event-payment {
    color: var(--color-primary-dark);
    background: #E0F2FE;
    border-color: #BAE6FD;
}

.deadline-badge.event-neutral {
    color: var(--color-text-muted);
    background: var(--color-surface-muted);
}

.deadline-action {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    justify-items: end;
    gap: .26rem;
}

.deadline-action .btn {
    min-height: 30px;
    padding-inline: .58rem;
}

.deadline-priority {
    color: var(--color-text-muted);
    font-size: .74rem;
    font-weight: 760;
    text-align: right;
}

.deadline-priority.priority-critical {
    color: var(--color-danger);
}

@media (max-width: 760px) {
    .checkout-legal-summary {
        grid-template-columns: 1fr;
    }

    .checkout-legal-summary div {
        grid-template-columns: 1fr;
        gap: .25rem;
    }
    .entries-page .filter-main {
        grid-template-columns: 1fr;
    }
    .entries-page .app-filter-grid {
        grid-template-columns: 1fr;
    }
    .datagrid-toolbar {
        align-items: flex-start;
    }
    .deadline-filter-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    .deadline-filter-grid button {
        grid-column: 1 / -1;
    }
    .deadline-actions {
        justify-content: flex-start;
    }
    .deadline-row.deadline-event-row {
        grid-template-columns: 1fr;
        gap: .42rem;
    }
    .deadline-list-header {
        display: none;
    }
    .deadline-action {
        align-items: flex-start;
        justify-items: start;
    }
    .deadline-group-header {
        align-items: flex-start;
        flex-direction: column;
        gap: .15rem;
    }
    .deadline-count {
        white-space: normal;
    }
}

@media (max-width: 620px) {
    .deadline-filter-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .app-container,
    .page-shell,
    .app-shell {
        width: min(100% - 1rem, 1280px);
        padding-top: .75rem;
    }
    .dashboard-hero-card,
    .costs-hero-card,
    .deadlines-hero-card,
    .filter-main,
    .app-filter-grid,
    .hero-action-stack,
    .settings-grid {
        grid-template-columns: 1fr;
    }
    .page-head,
    .page-header,
    .hero-panel,
    .summary-card,
    .detail-card,
    .filter-panel,
    .table-card {
        border-radius: 12px;
    }
    .entry-card-list {
        gap: .65rem;
    }
    .app-entry-card-grid,
    .entries-page .app-entry-card-grid {
        grid-template-columns: 1fr;
        gap: .65rem;
    }
    .entry-mobile-card.contract-list-card {
        padding: .75rem;
        border-radius: 12px;
    }
    .mobile-action-icons .icon-action {
        width: 40px;
        height: 40px;
    }
    .deadline-row {
        grid-template-columns: 1fr !important;
    }
}

/* Phase 19.2: wide premium public landingpage redesign */
.public-header-shell {
    width: min(1400px, calc(100% - 2.6rem));
}

.public-container {
    width: min(1280px, calc(100% - 2.6rem));
}

.public-container-wide {
    width: min(1420px, calc(100% - 2.6rem));
}

.site-header .brand-logo {
    display: block;
    width: auto;
    height: 54px;
}

.main-nav {
    gap: 1.25rem;
    font-size: 1.03rem;
}

.main-nav .button-small {
    min-height: 42px;
    padding-inline: 1rem;
    box-shadow: 0 8px 20px rgba(37, 99, 235, .18);
}

.hero-home {
    position: relative;
    overflow: clip;
    padding: clamp(5.6rem, 10vw, 8.6rem) 0 clamp(6rem, 9vw, 7.8rem);
    min-height: clamp(680px, 78vh, 760px);
}

.hero-home::before {
    content: "";
    position: absolute;
    inset: auto -8vw -26% 48%;
    aspect-ratio: 1.7 / 1;
    border-radius: 50%;
    background: radial-gradient(circle at 30% 36%, rgba(219, 234, 254, .95), rgba(248, 250, 252, .15) 68%);
    pointer-events: none;
}

.hero-home::after {
    content: "";
    position: absolute;
    right: 40%;
    top: 14%;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(191, 219, 254, .8);
    box-shadow: 0 58px 0 rgba(191, 219, 254, .52), 0 116px 0 rgba(191, 219, 254, .36);
    pointer-events: none;
}

.home-hero-grid {
    position: relative;
    z-index: 1;
    grid-template-columns: minmax(0, 50%) minmax(420px, 50%);
    align-items: center;
    gap: clamp(3rem, 5.4vw, 5.8rem);
}

.hero-home .eyebrow {
    color: #2563eb;
    margin-bottom: 1rem;
}

.home-hero-title {
    display: grid;
    gap: .08em;
    max-width: 9.8ch;
    margin-bottom: 1.45rem;
    font-size: clamp(4.45rem, 6.55vw, 6.35rem);
    letter-spacing: -.055em;
    line-height: .94;
}

.home-hero-title span {
    display: block;
}

.home-hero-accent {
    color: #2563eb;
}

.hero-home .hero-text {
    max-width: 34.5rem;
    font-size: clamp(1.3rem, 1.95vw, 1.62rem);
    line-height: 1.44;
    margin-bottom: 2rem;
}

.hero-home .hero-actions {
    gap: 1rem;
    flex-wrap: wrap;
}

.hero-home .hero-actions .button {
    min-height: 56px;
    padding: 1rem 1.6rem;
    font-size: 1.13rem;
    box-shadow: 0 10px 24px rgba(37, 99, 235, .22);
    white-space: nowrap;
}

.hero-home .hero-actions .button.button-secondary {
    box-shadow: 0 4px 13px rgba(15, 23, 42, .08);
}

.hero-home .home-trust-list {
    margin-top: 1.9rem;
    gap: .85rem;
    flex-wrap: nowrap;
}

.home-legal-note {
    margin-top: .85rem;
    color: var(--color-text-muted);
    font-size: .94rem;
}

.home-legal-note a {
    color: var(--teal);
    font-weight: 800;
}

.home-trust-list li {
    padding: .58rem 1rem;
    background: rgba(244, 248, 255, .96);
    border-color: #d4e2fb;
    color: #2a446d;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .04);
}

.home-hero-visual {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 0;
    margin: 0;
}

.home-hero-visual::before {
    content: "";
    position: absolute;
    inset: 12% -5% 7% 6%;
    border-radius: 48px;
    background:
        radial-gradient(circle at 78% 18%, rgba(219, 234, 254, .9), rgba(248, 250, 252, .18) 63%),
        radial-gradient(circle at 15% 82%, rgba(223, 245, 241, .78), rgba(255, 255, 255, 0) 54%);
    pointer-events: none;
}

.home-hero-artwork {
    position: relative;
    z-index: 1;
    display: block;
    width: min(100%, 720px);
    height: auto;
    filter: drop-shadow(0 28px 48px rgba(9, 33, 63, .13));
}

.home-followup-section {
    margin-top: -1.7rem;
    padding-top: clamp(5rem, 6.2vw, 6.5rem);
    border-top: 0;
    background: linear-gradient(180deg, rgba(255, 255, 255, .34), rgba(255, 255, 255, .66));
}

.home-followup-grid {
    grid-template-columns: minmax(0, 1.12fr) minmax(320px, .88fr);
    align-items: stretch;
    gap: clamp(1.6rem, 2.4vw, 2.5rem);
}

.home-followup-copy h2 {
    margin-bottom: 1.1rem;
}

.home-followup-copy p {
    margin-top: 0;
    max-width: 60ch;
    font-size: 1.11rem;
    line-height: 1.56;
    color: #334155;
}

.home-followup-note {
    margin: 0;
    padding: 1.65rem 1.7rem !important;
    border-radius: 24px;
    border: 1px solid #d6e4fb;
    background: linear-gradient(180deg, rgba(248, 252, 255, .95), rgba(236, 246, 255, .8));
    color: #1e3a5f;
    box-shadow: 0 14px 30px rgba(30, 58, 95, .08);
}

.home-followup-note-label {
    margin: 0 0 .6rem;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-size: .78rem;
    font-weight: 880;
}

.home-followup-note p {
    margin: 0;
    font-size: 1.03rem;
    line-height: 1.58;
    color: #244061;
}

.home-followup-section h2 {
    max-width: 14ch;
}

.feature-grid article {
    padding: 1.45rem;
    min-height: 190px;
}

.pricing-grid article {
    padding: 1.6rem;
}

.faq {
    width: min(980px, 100%);
}

@media (max-width: 1320px) {
    .public-header-shell,
    .public-container,
    .public-container-wide {
        width: min(1240px, calc(100% - 2rem));
    }
    .home-hero-title {
        font-size: clamp(3.95rem, 6vw, 5.45rem);
    }
}

@media (max-width: 1080px) {
    .hero-home {
        padding-top: 4.4rem;
        padding-bottom: 5rem;
        min-height: auto;
    }
    .home-hero-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, .95fr);
        gap: 1.85rem;
    }
    .home-hero-title {
        font-size: clamp(3.4rem, 6.8vw, 4.6rem);
    }
    .home-hero-artwork {
        width: min(100%, 600px);
    }
    .home-followup-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .public-header-shell,
    .public-container,
    .public-container-wide {
        width: min(100% - 1.1rem, 100%);
    }
    .site-header .brand-logo {
        height: 43px;
    }
    .main-nav {
        width: 100%;
        gap: .65rem;
        font-size: .94rem;
    }
    .hero-home {
        padding-top: 3.2rem;
        padding-bottom: 3.3rem;
    }
    .hero-home::before,
    .hero-home::after,
    .home-hero-visual::before {
        display: none;
    }
    .home-hero-grid {
        grid-template-columns: 1fr;
        gap: 1.7rem;
    }
    .home-hero-title {
        max-width: 100%;
        font-size: clamp(2.65rem, 12vw, 3.2rem);
        gap: .06rem;
    }
    .hero-home .hero-text {
        font-size: 1.08rem;
        margin-bottom: 1.35rem;
    }
    .hero-home .home-trust-list {
        flex-wrap: wrap;
    }
    .hero-home .hero-actions .button {
        min-height: 49px;
        padding: .82rem 1.15rem;
        font-size: .98rem;
    }
    .home-hero-visual {
        padding-top: .2rem;
    }
    .home-hero-artwork {
        width: min(100%, 560px);
    }
    .home-followup-section {
        margin-top: 0;
        padding-top: 4rem;
    }
}

/* Phase 21: Stitch-inspired authenticated dashboard overview refinement. */
.app-body {
    background: #f8f9ff;
}

.app-topbar.app-header {
    background: rgba(248, 249, 255, .94);
    border-bottom-color: #c3c6d5;
    box-shadow: 0 4px 14px rgba(11, 28, 48, .045);
}

.app-topnav a.is-active,
.app-topnav a:hover,
.app-topnav a:focus-visible,
.app-topnav .link-button:hover,
.app-topnav .link-button:focus-visible {
    color: #003c90;
    background: #e5eeff;
}

.phase21-dashboard-page {
    --dash-bg: #f8f9ff;
    --dash-card: #ffffff;
    --dash-soft: #eff4ff;
    --dash-border: #c3c6d5;
    --dash-text: #0b1c30;
    --dash-muted: #434653;
    --dash-primary: #003c90;
    --dash-success: #006c49;
    --dash-warning: #c22525;
    --dash-danger: #ba1a1a;
    gap: 1rem;
}

.phase21-dashboard-page .phase21-section-title {
    margin: 1.25rem 0 .55rem;
    padding-bottom: .5rem;
    border-bottom: 1px solid var(--dash-border);
    color: var(--dash-muted);
    font-size: .82rem;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.phase21-dashboard-page .phase21-section-title > span:first-child {
    color: var(--dash-text);
    font-weight: 900;
}

.phase21-dashboard-page .phase21-section-title a {
    color: var(--dash-primary);
}

.phase21-card,
.phase21-dashboard-page .metric-card,
.phase21-dashboard-page .period-card,
.phase21-action-card {
    border: 1px solid var(--dash-border);
    border-radius: 16px;
    background: var(--dash-card);
    box-shadow: 0 6px 16px rgba(11, 28, 48, .05);
}

.phase21-focus-grid,
.phase21-status-grid,
.phase21-cost-grid {
    grid-template-columns: minmax(0, 1fr) minmax(340px, .96fr);
    gap: 1rem;
}

.phase21-card {
    padding: 1.25rem;
}

.phase21-card-head {
    align-items: center;
    margin-bottom: 1rem;
}

.dashboard-card-kicker {
    display: block;
    margin-bottom: .15rem;
    color: var(--dash-muted);
    font-size: .74rem;
    font-weight: 850;
    letter-spacing: .055em;
    text-transform: uppercase;
}

.phase21-empty-state,
.phase21-soft-message {
    display: flex;
    align-items: center;
    gap: .8rem;
    min-height: 72px;
    padding: .9rem 1rem;
    border-radius: 12px;
    background: var(--dash-soft);
    color: var(--dash-muted);
}

.phase21-empty-state span,
.phase21-soft-message span {
    display: inline-grid;
    place-items: center;
    flex: 0 0 auto;
    width: 2.1rem;
    height: 2.1rem;
    border-radius: 999px;
    color: var(--dash-success);
    background: rgba(108, 248, 187, .22);
    font-weight: 900;
}

.phase21-empty-state p,
.phase21-soft-message p {
    margin: 0;
}

.phase21-payment-list li {
    border-left: 4px solid #ffb95f;
    border-radius: 0 12px 12px 0;
    background: #fffaf2;
}

.phase21-kpi-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
    margin: .75rem 0 .3rem;
}

.phase21-dashboard-page .metric-card {
    min-height: 118px;
    padding: 1.05rem 1.1rem 1rem 1.2rem;
}

.phase21-dashboard-page .metric-card span {
    color: var(--dash-muted);
    font-size: .76rem;
    font-weight: 850;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.phase21-dashboard-page .metric-card strong {
    color: var(--dash-text);
    font-size: clamp(1.6rem, 2.3vw, 2.15rem);
    letter-spacing: 0;
}

.phase21-dashboard-page .metric-card-primary strong,
.phase21-dashboard-page .metric-card-money strong {
    color: var(--dash-primary);
}

.phase21-dashboard-page .metric-card-payment strong {
    color: var(--dash-success);
}

.phase21-dashboard-page .metric-card-warning::before {
    background: #ffb95f;
}

.phase21-dashboard-page .metric-card-danger::before {
    background: var(--dash-danger);
}

.phase21-dashboard-page .metric-card-danger span,
.phase21-dashboard-page .metric-card-danger strong {
    color: var(--dash-danger);
}

.phase21-periods-card {
    padding: 0;
    overflow: hidden;
}

.phase21-period-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 0;
}

.phase21-period-card {
    min-height: 150px;
    padding: 1.15rem;
    border-width: 0 1px 0 0;
    border-radius: 0;
    box-shadow: none;
}

.phase21-period-card:last-child {
    border-right: 0;
}

.phase21-period-card h3 {
    color: var(--dash-text);
    font-size: 1.02rem;
    line-height: 1.25;
}

.phase21-period-card p {
    display: flex;
    justify-content: space-between;
    gap: .8rem;
    color: var(--dash-muted);
}

.phase21-period-card strong {
    color: var(--dash-primary);
    font-size: 1.25rem;
}

.phase21-action-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 1rem;
}

.phase21-action-card {
    display: grid;
    gap: .35rem;
    min-height: 132px;
    padding: 1.15rem;
    color: var(--dash-text);
    transition: border-color .16s ease, background .16s ease, transform .16s ease;
}

.phase21-action-icon {
    display: inline-grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 10px;
    color: var(--dash-primary);
    background: #e5eeff;
}

.phase21-action-icon svg {
    width: 1rem;
    height: 1rem;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.phase21-action-icon rect,
.phase21-action-icon circle,
.phase21-action-icon line,
.phase21-action-icon path {
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
    fill: none;
}

.phase21-action-card strong {
    margin-top: .55rem;
}

.phase21-action-card:hover,
.phase21-action-card:focus-visible {
    border-color: var(--dash-primary);
    background: #f8fbff;
    transform: translateY(-1px);
}

.phase21-action-card strong {
    font-size: 1.02rem;
}

.phase21-action-card span {
    color: var(--dash-muted);
}

.phase21-dashboard-page .notice-soft {
    border-color: var(--dash-border);
    background: #eff4ff;
}

@media (max-width: 1180px) {
    .phase21-kpi-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .phase21-period-grid,
    .phase21-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .phase21-period-card {
        border-width: 0 0 1px 0;
    }
}

@media (max-width: 860px) {
    .phase21-focus-grid,
    .phase21-status-grid,
    .phase21-cost-grid {
        grid-template-columns: 1fr;
    }
    .phase21-kpi-grid,
    .phase21-period-grid,
    .phase21-action-grid {
        grid-template-columns: 1fr;
    }
    .phase21-dashboard-page .phase21-section-title {
        align-items: flex-start;
        flex-direction: column;
        letter-spacing: .035em;
    }
    .phase21-period-card {
        min-height: auto;
        border-width: 0 0 1px 0;
    }
}

/* Phase 22.17A1: App shell and dashboard refresh for logged-in screens. */
:root {
    --app-bg: #f2f6ff;
    --app-surface: #ffffff;
    --app-border: #d3dded;
    --app-muted: #63748d;
    --app-text: #10243d;
    --app-primary: #2563eb;
    --app-primary-soft: #e5eeff;
    --app-success: #0f8a63;
    --app-success-soft: #ddf4ec;
    --app-warning: #c22525;
    --app-warning-soft: #fddada;
    --app-danger: #c22525;
    --app-danger-soft: #fddada;
    --app-number-font: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    --app-shell-max: 1120px;
    --app-shell-padding: clamp(.9rem, 2vw, 1rem);
    --app-section-gap: 0.95rem;
}

.app-body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    color: var(--app-text);
    background: linear-gradient(180deg, #f2f7ff 0%, #edf3ff 46%, #f8fbff 100%);
}

.app-topbar.app-header {
    min-height: 62px;
    padding-top: .65rem;
    padding-bottom: .65rem;
    padding-left: max(.9rem, calc((100vw - var(--app-shell-max)) / 2));
    padding-right: max(.9rem, calc((100vw - var(--app-shell-max)) / 2));
    background: #f8f9ff;
    border-bottom-color: #c6d2e4;
    box-shadow: 0 8px 24px rgba(15, 23, 42, .05);
}

.app-shell {
    position: relative;
    width: min(var(--app-shell-max), calc(100% - 2rem));
    margin-inline: auto;
    padding: .9rem 0 4.9rem;
}

.app-dashboard-screen {
    width: min(100%, var(--app-shell-max));
    max-width: none;
    margin-inline: auto;
    display: grid;
    grid-template-columns: repeat(12, minmax(0, 1fr));
    align-items: start;
    gap: 1.15rem;
    padding-inline: 0;
}

.app-dashboard-screen > * {
    grid-column: 1 / -1;
    min-width: 0;
}

.app-dashboard-screen .app-section-title {
    margin: .4rem 0 .25rem;
    font-size: 1rem;
}

.app-dashboard-screen .app-section-title h2 {
    margin-bottom: .1rem;
}

.app-section {
    display: grid;
    gap: var(--app-section-gap);
    padding-top: .4rem;
}

.app-section .app-hero-card h1,
.app-hero-card h1 {
    font-size: 2.7rem;
    letter-spacing: 0;
}

.app-section .app-hero-card .hero-text,
.app-hero-card .hero-text {
    color: #2f4b63;
    font-size: 1.08rem;
    line-height: 1.45;
    max-width: 68ch;
}

.app-dashboard-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 1rem;
}

.app-dashboard .dashboard-section-title {
    letter-spacing: .01em;
    text-transform: none;
    font-size: .98rem;
}

.app-dashboard .dashboard-section-title a {
    color: #1f4ecf;
    text-underline-offset: 2px;
}

.app-card {
    border: 1px solid var(--app-border);
    border-radius: 16px;
    background: var(--app-surface);
    box-shadow: 0 12px 34px rgba(15, 23, 42, .05);
    overflow: hidden;
    padding: clamp(1rem, 2vw, 1.7rem);
}

.app-hero-card {
    position: relative;
    padding: clamp(1.55rem, 2.8vw, 2rem);
    border-radius: 20px;
    border-color: #c3d2ea;
    background:
        radial-gradient(circle at 100% 0%, rgba(37, 99, 235, .12), transparent 40%),
        linear-gradient(138deg, #ffffff 0%, #eff6ff 100%);
    box-shadow: 0 26px 54px rgba(15, 23, 42, .08);
}

.app-dashboard-hero {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .9rem;
}

.app-dashboard-hero .hero-action-stack {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: .2rem;
    gap: .58rem;
    min-width: 0;
}

.app-dashboard-urgent {
    margin-top: .85rem;
    padding: .82rem .95rem;
}

.app-dashboard-urgent span {
    text-transform: uppercase;
    letter-spacing: .055em;
    font-size: .76rem;
}

.app-dashboard-urgent strong {
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.app-dashboard-ad-banner {
    padding-inline: 0;
}

.app-ad-card {
    border-radius: 16px;
    padding: .9rem;
}

.app-dashboard-events,
.app-dashboard-payments,
.app-quick-actions,
.app-dashboard-cost-overview,
.app-dashboard-notices {
    display: grid;
    gap: .72rem;
}

.app-dashboard-section {
    grid-template-columns: 1fr;
}

.app-dashboard-events,
.app-dashboard-payments,
.app-quick-actions,
.app-dashboard-kpis,
.app-dashboard-cost-overview,
.app-dashboard-notices {
    padding: 1.1rem;
}

.app-section-title-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .8rem;
}

.app-section-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .8rem;
}

.app-dashboard-event-list,
.app-dashboard-payment-list,
.app-dashboard-kpi-grid,
.app-dashboard-missing-list,
.app-dashboard-action-grid {
    display: grid;
    gap: .7rem;
}

.app-dashboard-event-card,
.app-dashboard-payment-item {
    display: grid;
    gap: .45rem;
    grid-template-columns: 1fr;
}

.app-dashboard-event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
    align-items: center;
}

.app-dashboard-payment-item {
    align-items: center;
    grid-template-columns: 1fr auto;
    padding: .95rem 1rem;
}

.app-dashboard-payment-item .app-number {
    text-align: right;
    font-size: clamp(1.22rem, 2.5vw, 1.55rem);
}

.app-dashboard-kpi-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.app-period-grid,
.app-notice-grid,
.app-cost-overview-grid,
.app-cost-grid {
    display: grid;
    width: 100%;
}

.app-dashboard-cost-card {
    grid-column: span 1;
}

.app-dashboard-cost-card .app-number {
    font-size: clamp(1.45rem, 2.7vw, 2rem);
}

.app-dashboard-kpi-grid .app-kpi-card {
    min-height: 128px;
}

.app-dashboard-kpi-grid .app-cost-card {
    grid-column: auto;
    box-shadow: 0 16px 40px rgba(37, 99, 235, .11);
}

.app-quick-actions .action-card-grid,
.app-dashboard-action-grid {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
}

.app-quick-actions .app-quick-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr) /* auto-fit(auto-fit, minmax(170px, 1fr)) */);
    width: 100%;
    gap: 16px;
}

.app-period-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr) /* auto-fit(auto-fit, minmax(170px, 1fr)) */);
    gap: .8rem;
}

.app-quick-actions .action-card {
    display: grid;
    gap: .4rem;
    min-width: 0;
    padding: 1rem;
    text-decoration: none;
    border: 1px solid var(--app-border);
    border-radius: 14px;
}

.app-quick-actions .action-card p {
    margin: 0;
    color: var(--app-muted);
    font-size: .94rem;
}

.app-dashboard-kpi-group {
    gap: .7rem;
}

.app-dashboard-period-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: .8rem;
}

.app-dashboard-split-grid,
.app-dashboard-cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: .85rem;
    min-width: 0;
}

.app-notice-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr) /* auto-fit(auto-fit, minmax(260px, 1fr)) */);
}

.app-cost-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr) /* auto-fit(auto-fit, minmax(280px, 1fr)) */);
    gap: .85rem;
}

.app-cost-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr) /* auto-fit(auto-fit, minmax(280px, 1fr)) */);
    gap: .85rem;
    width: 100%;
}

.app-dashboard-cost-cards {
    margin-top: .55rem;
}

.app-dashboard-cost-card {
    display: grid;
    align-content: start;
    gap: .28rem;
}

.app-dashboard-cost-label,
.app-dashboard-cost-subtitle {
    display: block;
    line-height: 1.25;
}

.app-dashboard-cost-value {
    display: block;
    margin-top: .42rem;
}

.app-dashboard-split-grid > *,
.app-dashboard-cost-grid > *,
.app-dashboard-period-list > *,
.app-period-grid > *,
.app-notice-grid > *,
.app-dashboard-action-grid > *,
.app-dashboard-kpi-grid > * {
    min-width: 0;
}

.app-dashboard-cost-overview {
    gap: .8rem;
}

.app-dashboard-business-costs {
    gap: 1.35rem;
    padding-block: 1.45rem 1.55rem;
}

.app-dashboard-business-grid,
.app-dashboard-business-detail {
    display: grid;
    gap: 1.15rem;
    min-width: 0;
}

.app-dashboard-business-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.app-dashboard-business-detail {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    margin-top: .35rem;
}

.app-dashboard-business-card {
    display: grid;
    gap: .32rem;
    min-width: 0;
    padding: .95rem 1rem;
    border: 1px solid var(--app-border);
    border-left: 5px solid #0f6c64;
    border-radius: 14px;
    background: #fff;
}

.app-dashboard-business-card--business {
    border-left-color: #1f4ecf;
}

.app-dashboard-business-card--total {
    border-left-color: #c22525;
}

.app-dashboard-business-card--unassigned {
    border-left-color: #6b7280;
}

.app-dashboard-business-card--locked {
    background: #f7fafe;
    border-left-color: #9aa8bd;
}

.app-dashboard-business-card span,
.app-dashboard-business-card small {
    color: var(--app-muted);
}

.app-dashboard-business-card strong {
    font-size: clamp(1.22rem, 2.3vw, 1.55rem);
    line-height: 1.1;
}

.app-dashboard-business-card a,
.app-dashboard-business-list-card .card-head a {
    color: #1f4ecf;
    text-underline-offset: 2px;
}

.app-dashboard-business-list-card {
    padding: 1.15rem;
}

.app-dashboard-business-list-card .card-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: .9rem;
    flex-wrap: wrap;
}

.app-dashboard-business-list {
    display: grid;
    gap: .55rem;
    margin: .65rem 0 0;
}

.app-dashboard-business-list li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .65rem;
    align-items: center;
    padding: .7rem 0;
    border-top: 1px solid #e6edf6;
}

.app-dashboard-business-list li:first-child {
    border-top: 0;
}

.app-dashboard-business-list span,
.app-dashboard-business-list small {
    min-width: 0;
}

.app-dashboard-business-list small {
    display: block;
    color: var(--app-muted);
    line-height: 1.35;
}

.app-dashboard-business-list b {
    white-space: nowrap;
    color: #102033;
}

.app-dashboard-business-note {
    margin: .3rem 0 .05rem;
    line-height: 1.45;
}

.app-dashboard-business-note--spaced {
    margin-top: .95rem;
}

.app-dashboard-business-export {
    justify-content: flex-end;
    margin-left: auto;
}

.app-dashboard-business-export .button {
    white-space: nowrap;
}

.app-card-grid {
    gap: .7rem;
}

@media (min-width: 900px) {
    .app-dashboard-screen {
        width: min(100%, 1120px);
    }

    .app-dashboard-events,
    .app-dashboard-payments {
        grid-column: span 6;
    }

    .app-dashboard-hero,
    .app-dashboard-ad-banner,
    .app-dashboard-kpis,
    .app-dashboard-periods,
    .app-dashboard-notices,
    .app-quick-actions,
    .app-dashboard-cost-summary,
    .app-dashboard-ad,
    .app-dashboard-screen > .notice {
        grid-column: 1 / -1;
    }
}

.status-critical { border-color: var(--app-danger-soft); color: #8a1b1b; background: #fff0f0; }
.status-upcoming { border-color: #f2b7b7; color: #7a2525; background: #fde8e8; }
.status-ok { border-color: #daf2e8; color: #0d6952; background: #ecfbf5; }

.app-chip--muted {
    border-color: #d6e2f0;
    background: #f6f8ff;
}

.app-quiet-empty {
    display: grid;
    gap: .3rem;
    border-radius: 14px;
    background: #f6f8fc;
    border: 1px dashed #cfdcef;
    padding: .8rem 1rem;
}

.app-dashboard-section .state-success {
    border-color: #bfefdc;
    background: #edfff7;
    color: #0f6c64;
}

.app-dashboard-section .state-neutral {
    border-color: #dfe8f6;
    background: #f7fafe;
}

.app-dashboard-hero .hero-action-stack .button {
    min-height: 44px;
    border-radius: 12px;
    font-size: .95rem;
    font-weight: 760;
}

.app-dashboard-hero .button-secondary {
    justify-self: start;
}

.app-kpi-card {
    border-width: 1px;
    min-height: 130px;
    border-left: 5px solid var(--app-primary);
}

.app-kpi-card.metric-card-money {
    border-left-color: #0f6c64;
}

.app-kpi-card.metric-card-payment,
.app-kpi-card.metric-card-warning {
    border-left-color: #c22525;
}

.app-kpi-card.metric-card-danger {
    border-left-color: #c22525;
}

.app-cost-card {
    background:
        linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.app-cost-card--monthly strong,
.app-cost-card--yearly strong,
.app-cost-card--payments strong {
    color: #0f3f90;
}

.app-cost-card.app-kpi-card {
    box-shadow: 0 16px 40px rgba(37, 99, 235, .08);
}

.app-cost-history-card {
    display: grid;
    gap: 1rem;
    overflow: visible;
}

.app-cost-history-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
    min-width: 0;
}

.app-cost-history-header h2 {
    margin-bottom: .35rem;
}

.app-cost-scope-switch {
    display: inline-grid;
    grid-template-columns: repeat(3, minmax(82px, 1fr));
    gap: 4px;
    margin-top: .85rem;
    padding: 4px;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    background: #f8fbff;
    max-width: 360px;
}

.app-cost-scope-option {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 38px;
    padding: .42rem .65rem;
    border-radius: 6px;
    color: var(--color-text);
    font-size: .86rem;
    font-weight: 820;
    text-decoration: none;
    white-space: nowrap;
}

.app-cost-scope-option:hover,
.app-cost-scope-option:focus-visible,
.app-cost-scope-option.is-active {
    background: #ffffff;
    color: var(--color-primary);
    box-shadow: 0 8px 20px rgba(37, 99, 235, .1);
    outline: 0;
}

.app-cost-scope-option.is-locked {
    color: #64748b;
    background: #eef3fb;
}

.app-cost-scope-option.is-locked:hover,
.app-cost-scope-option.is-locked:focus-visible {
    color: #1f4ecf;
}

.app-business-export-note {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: .42rem .65rem;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 8px;
    background: #f8fbff;
    color: var(--color-text-muted);
    font-size: .84rem;
    font-weight: 760;
}

.app-cost-scope-note {
    display: flex;
    width: min(100%, 720px);
    margin-top: .65rem;
    line-height: 1.35;
}

.app-cost-scope-locked {
    margin-top: .65rem;
}

.app-cost-business-callout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: .8rem;
    align-items: center;
    width: 100%;
    min-height: 0;
    margin-top: .15rem;
    padding: .9rem 1rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.app-cost-business-callout p {
    margin: 0;
}

.app-cost-business-callout .button {
    justify-self: start;
    white-space: normal;
}

@media (min-width: 840px) {
    .app-cost-business-callout {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .app-cost-business-callout .button {
        justify-self: end;
    }
}

.app-cost-history-summary,
.app-cost-history-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 14px;
    min-width: 0;
    width: 100%;
}

.app-cost-history-summary {
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.app-cost-history-summary-card,
.app-cost-history-stats span {
    display: grid;
    gap: .22rem;
    min-width: 0;
    padding: .82rem .9rem;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(255, 255, 255, .78);
    color: var(--color-text-muted);
    font-size: .78rem;
    font-weight: 760;
    overflow: visible;
}

.app-cost-history-summary-card {
    min-width: 0;
    overflow: visible;
}

.app-cost-history-summary-value,
.app-cost-history-stats strong {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    color: var(--color-text);
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.08;
    letter-spacing: 0;
    white-space: normal;
    max-width: 100%;
}

.app-cost-history-summary-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    line-height: 1.08;
    white-space: normal;
    max-width: 100%;
}

.app-cost-history-summary-value small {
    font-size: clamp(.78rem, 1.2vw, .95rem);
    font-weight: 780;
    color: var(--color-text-muted);
}

.app-chart-summary-amount,
.app-chart-summary-unit {
    display: inline-block;
    min-width: 0;
    max-width: 100%;
    word-break: normal;
    overflow-wrap: normal;
}

.app-chart-summary-unit {
    font-size: clamp(.78rem, 1.2vw, .95rem);
    font-weight: 780;
    color: var(--color-text-muted);
}

.app-cost-history-chart {
    width: 100%;
    overflow-x: auto;
    padding: .25rem 0 .1rem;
    -webkit-overflow-scrolling: touch;
}

.app-cost-chart-stage {
    position: relative;
    width: 100%;
    min-width: 760px;
}

.app-cost-history-svg {
    display: block;
    width: 100%;
    min-width: 760px;
    height: auto;
}

.app-cost-chart-grid {
    stroke: rgba(100, 116, 139, .3);
    stroke-width: 1;
}

.app-cost-chart-area {
    fill: url("#cost-history-area");
}

.app-cost-chart-line {
    fill: none;
    stroke: #6ba8cf;
    stroke-width: 4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.app-cost-chart-dot {
    fill: #8fc0dd;
    stroke: #ffffff;
    stroke-width: 3;
    filter: drop-shadow(0 5px 8px rgba(48, 94, 128, .18));
}

.app-cost-chart-points {
    position: absolute;
    inset: 0;
}

.app-cost-chart-point {
    position: absolute;
    width: 1rem;
    height: 1rem;
    margin: -.5rem 0 0 -.5rem;
    border: 2px solid #fff;
    border-radius: 999px;
    background: #245f8e;
    box-shadow: 0 5px 12px rgba(36, 95, 142, .25);
    cursor: pointer;
    transform: scale(.92);
}

.app-cost-chart-point:hover,
.app-cost-chart-point:focus-visible,
.app-cost-chart-point.is-active {
    background: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, .16), 0 7px 16px rgba(36, 95, 142, .28);
    outline: 0;
    transform: scale(1.22);
}

.app-cost-chart-y-label,
.app-cost-chart-x-label {
    fill: var(--color-text-muted);
    font-size: 13px;
    font-weight: 760;
}

.app-chart-empty {
    padding: 1rem;
    border: 1px dashed rgba(100, 116, 139, .42);
    border-radius: 12px;
    background: rgba(248, 251, 255, .82);
}

.app-cost-chart-detail {
    display: grid;
    gap: .72rem;
    margin-top: .85rem;
    padding: .9rem;
    border: 1px solid rgba(148, 163, 184, .34);
    border-radius: 12px;
    background: #f8fbff;
}

.app-cost-chart-detail h3,
.app-cost-chart-detail h4 {
    margin: 0;
    color: var(--navy);
    letter-spacing: 0;
}

.app-cost-chart-detail h3 {
    font-size: clamp(1.02rem, 1.5vw, 1.24rem);
}

.app-cost-chart-detail h4 {
    font-size: .9rem;
}

.app-cost-chart-detail-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: .55rem;
    margin: 0;
}

.app-cost-chart-detail-metrics div {
    padding: .65rem .75rem;
    border: 1px solid rgba(226, 232, 240, .9);
    border-radius: 10px;
    background: #fff;
}

.app-cost-chart-detail-metrics dt,
.app-cost-compact-row span,
.app-cost-mini-list small,
.app-cost-driver-list small {
    color: var(--muted);
    font-size: .76rem;
    font-weight: 820;
}

.app-cost-chart-detail-metrics dd {
    margin: .16rem 0 0;
    color: var(--navy);
    font-size: 1rem;
    font-weight: 850;
}

.app-cost-driver-list,
.app-cost-mini-list {
    display: grid;
    gap: .45rem;
    margin: .55rem 0 0;
    padding: 0;
    list-style: none;
}

.app-cost-driver-list li,
.app-cost-mini-list li,
.app-cost-compact-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: .5rem .8rem;
    align-items: center;
    padding: .62rem .72rem;
    border: 1px solid rgba(226, 232, 240, .88);
    border-radius: 10px;
    background: #fff;
}

.app-cost-driver-list li {
    grid-template-columns: minmax(0, 1fr) minmax(120px, auto);
}

.app-cost-driver-list span,
.app-cost-driver-list small,
.app-cost-mini-list span,
.app-cost-mini-list small {
    display: block;
    min-width: 0;
}

.app-cost-amount {
    display: inline-flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: flex-end;
    gap: .12rem .32rem;
    text-align: right;
}

.app-cost-amount-value,
.app-cost-amount-unit {
    display: inline-block;
}

.costs-overview .app-cost-amount-value {
    color: var(--navy);
    font-size: .92rem;
    font-weight: 850;
}

.costs-overview .app-cost-amount-unit {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 820;
}

.costs-overview .app-cost-driver-list strong,
.costs-overview .app-cost-mini-list strong,
.costs-overview .app-cost-mini-list b,
.costs-overview .app-cost-compact-row strong {
    color: var(--navy);
    font-size: .92rem;
    font-weight: 850;
    line-height: 1.2;
    letter-spacing: 0;
    white-space: normal;
}

.costs-overview .app-cost-mini-list b,
.costs-overview .app-cost-driver-list strong {
    justify-self: end;
    white-space: nowrap;
}

.app-cost-compact-list {
    display: grid;
    gap: .5rem;
    margin-top: .7rem;
}

.app-cost-compact-row {
    grid-template-columns: minmax(190px, 1.35fr) repeat(3, minmax(110px, .65fr));
}

.app-cost-payment-list .app-cost-compact-row {
    grid-template-columns: minmax(190px, 1.4fr) minmax(120px, .7fr) minmax(120px, .7fr);
}

.app-cost-compact-value {
    display: grid;
    justify-items: end;
    gap: .16rem;
    min-width: 0;
    text-align: right;
}

.app-cost-compact-label {
    display: block;
}

.app-cost-compact-title strong,
.app-cost-compact-title span {
    display: block;
    min-width: 0;
}

.costs-overview .app-cost-card h2 {
    font-size: clamp(1.04rem, 1.55vw, 1.26rem);
    letter-spacing: 0;
}

.costs-overview .metric-card:not(.metric-card-money):not(.metric-card-primary):not(.metric-card-payment) strong {
    font-size: clamp(1.08rem, 1.8vw, 1.45rem);
}

.costs-overview .app-cost-card p,
.costs-overview .app-cost-card li,
.costs-overview .app-cost-card td,
.costs-overview .app-cost-card dd {
    font-size: .92rem;
}

.app-cost-card strong {
    font-size: clamp(1.48rem, 2.1vw, 2.2rem);
    letter-spacing: -.01em;
}

.costs-overview .metric-card strong,
.costs-overview .app-cost-card strong,
.app-cost-value,
.app-chart-summary-value {
    font-size: clamp(1.45rem, 2.6vw, 2.15rem);
    line-height: 1.05;
    white-space: normal;
    overflow: visible;
    max-width: 100%;
}

.app-chart-summary-value {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 4px 8px;
}

.costs-overview .app-cost-card .app-cost-driver-list strong,
.costs-overview .app-cost-card .app-cost-mini-list strong,
.costs-overview .app-cost-card .app-cost-mini-list b,
.costs-overview .app-cost-card .app-cost-compact-row strong,
.costs-overview .app-cost-card .app-cost-chart-detail-metrics dd {
    font-size: .92rem;
    line-height: 1.2;
    letter-spacing: 0;
}

.costs-overview .app-cost-card .app-cost-chart-detail-metrics dd {
    font-size: 1rem;
}

.app-number {
    font-family: var(--app-number-font) !important;
    letter-spacing: .012em;
    white-space: nowrap;
}

.app-money {
    white-space: nowrap;
    overflow: visible;
    font-size: clamp(1.3rem, 2vw, 2.05rem);
}

.app-money,
.app-cost-value {
    white-space: nowrap;
    overflow: visible;
    font-size: clamp(1.3rem, 2vw, 2.05rem);
}

.app-chip {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .4rem .72rem;
    font-size: .83rem;
    font-weight: 800;
    border: 1px solid var(--app-border);
    background: #f5f8ff;
    color: var(--app-text);
}

.app-dashboard-urgent {
    margin-top: .85rem;
    padding: .82rem .95rem;
    border-radius: 13px;
    border-color: #bcd2ff;
    background: linear-gradient(180deg, rgba(229, 238, 255, .9), rgba(255, 255, 255, .95));
}

.app-dashboard-urgent span {
    letter-spacing: .055em;
}

.app-dashboard-urgent strong {
    font-size: clamp(1.15rem, 2.2vw, 1.45rem);
}

.app-chip--muted {
    border-color: #d6e2f0;
    background: #f6f8ff;
}

.app-chip--active {
    background: var(--app-success-soft);
    color: #0f6c64;
    border-color: #a8ddd5;
}

@media (max-width: 760px) {
    .app-cost-compact-row,
    .app-cost-payment-list .app-cost-compact-row,
    .app-cost-driver-list li,
    .app-cost-mini-list li {
        grid-template-columns: 1fr;
    }

    .costs-overview .app-cost-mini-list b,
    .costs-overview .app-cost-driver-list strong {
        justify-self: start;
    }

    .app-cost-amount,
    .app-cost-compact-value {
        justify-content: flex-start;
        justify-items: start;
        text-align: left;
    }
}

.app-ad-slot {
    position: relative;
    border: 1px solid var(--app-border);
    border-radius: 14px;
    padding: .75rem;
    background: linear-gradient(170deg, #ffffff, #f7fbff);
}

.app-ad-label {
    margin: 0 0 .45rem;
    color: #6f80a0;
    font-weight: 780;
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: .72rem;
}

.app-dashboard-notice-stack {
    display: grid;
    gap: .55rem;
    max-width: 720px;
    margin-top: 1rem;
}

.app-dashboard-notice {
    margin: 0;
    line-height: 1.45;
}

.app-dashboard-cron-notice {
    max-width: 680px;
}

.entry-ad-placement {
    display: grid;
    gap: .65rem;
    width: 100%;
    max-width: none;
    margin: 1.25rem 0;
    padding: 1rem clamp(1rem, 2vw, 1.25rem);
    justify-items: stretch;
}

.entry-ad-placement .ad-slot,
.entry-ad-placement .ad-placeholder {
    width: 100%;
    max-width: 100%;
    margin: 0;
    box-sizing: border-box;
}

.entry-ad-placement .ad-slot > a,
.entry-ad-placement .ad-slot > img,
.entry-ad-placement .ad-placeholder > img {
    display: block;
    max-width: 100%;
    margin-inline: auto;
}

.entry-ad-placement .ad-slot img,
.entry-ad-placement .ad-placeholder img {
    width: auto;
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

@media (max-width: 760px) {
    .app-dashboard-notice-stack {
        margin-top: .85rem;
    }

    .entry-ad-placement {
        margin: .9rem 0;
        padding: .85rem;
    }
}

@media print {
    .entry-ad-placement {
        display: none !important;
    }
}

.app-bottom-nav {
    position: fixed;
    z-index: 7;
    left: 0;
    right: 0;
    bottom: 0;
    display: none;
    border-top: 1px solid #d8e0f0;
    background: rgba(248, 250, 255, .96);
    backdrop-filter: blur(10px);
    padding: .55rem max(.8rem, env(safe-area-inset-left)) .55rem max(.8rem, env(safe-area-inset-right));
    gap: .45rem;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    box-shadow: 0 -10px 24px rgba(15, 23, 42, .12);
}

.app-bottom-nav a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 43px;
    border-radius: 12px;
    padding: .35rem .45rem;
    text-decoration: none;
    text-align: center;
    font-size: .76rem;
    line-height: 1.15;
    font-weight: 850;
    color: #43586d;
    border: 1px solid transparent;
    transition: background .18s ease, border-color .18s ease, color .18s ease, transform .18s ease;
}

.app-bottom-nav a.app-bottom-nav-item.is-active,
.app-bottom-nav a.app-bottom-nav-item:hover,
.app-bottom-nav a.app-bottom-nav-item:focus-visible {
    color: var(--app-primary);
    border-color: #c7dcff;
    background: var(--app-primary-soft);
    transform: translateY(-1px);
}

.app-fab {
    position: fixed;
    z-index: 8;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    width: 54px;
    height: 54px;
    display: none;
    justify-content: center;
    align-items: center;
    border-radius: 999px;
    text-decoration: none;
    background: var(--app-primary);
    color: #fff;
    font-size: 1.85rem;
    font-weight: 800;
    line-height: 1;
    border: 0;
    box-shadow: 0 14px 28px rgba(37, 99, 235, .34);
}

.app-fab:hover,
.app-fab:focus-visible {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.app-dashboard .detail-card,
.app-dashboard .insight-card,
.app-dashboard .timeline-card,
.app-dashboard .costs-overview {
    border-radius: 16px;
}

.app-dashboard .timeline-list,
.app-dashboard .clean-list {
    gap: .72rem;
}

.app-dashboard .timeline-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: start;
    gap: .8rem;
}

.app-dashboard .timeline-item .link-button {
    margin-top: .15rem;
}

.app-action-grid {
    gap: .85rem;
}

.app-action-grid .action-card,
.app-action-grid .action-card strong {
    font-size: clamp(.98rem, 1.9vw, 1.08rem);
}

@media (max-width: 1120px) {
    .app-shell {
        width: min(var(--app-shell-max), calc(100% - 2rem));
    }
}

@media (max-width: 860px) {
    .app-shell {
        width: calc(100% - 2rem);
        padding-bottom: 5.4rem;
    }

    .app-dashboard-screen {
        width: 100%;
        max-width: none;
        grid-template-columns: 1fr;
        gap: .78rem;
    }

    .app-hero-card h1,
    .app-section .app-hero-card h1 {
        font-size: 2rem;
    }

    .app-dashboard-kpi-grid,
    .app-dashboard-period-list,
    .app-period-grid,
    .app-notice-grid,
    .app-dashboard-cost-overview,
    .app-dashboard-split-grid,
    .app-dashboard-cost-grid,
    .app-quick-actions .action-card-grid,
    .app-dashboard-action-grid {
        grid-template-columns: 1fr;
    }

    .app-dashboard-kpi-grid .app-cost-card {
        grid-column: auto;
    }

    .app-dashboard-payment-item {
        grid-template-columns: 1fr;
    }

    .app-fab,
    .app-bottom-nav {
        display: grid;
    }

    .app-topbar.app-header,
    .app-topbar.app-header + .app-bottom-nav {
        padding-left: .9rem;
        padding-right: .9rem;
    }

    .app-shell .app-dashboard-hero .hero-action-stack {
        grid-template-columns: 1fr;
    }

    .app-section {
        gap: .82rem;
    }

    .metric-grid.dashboard-metrics.compact-kpi-grid,
    .app-dashboard .metric-grid,
    .phase21-dashboard-page .metric-grid {
        grid-template-columns: 1fr 1fr;
    }

    .phase21-focus-grid,
    .phase21-status-grid,
    .phase21-cost-grid,
    .phase21-kpi-grid {
        grid-template-columns: 1fr;
    }

    .app-dashboard .phase21-section-title {
        align-items: flex-start;
        flex-direction: column;
        letter-spacing: .035em;
    }

    .app-dashboard .dashboard-card-kicker,
    .dashboard-card-kicker {
        font-size: .7rem;
    }

    .app-kpi-card {
        min-height: 122px;
    }

    .app-dashboard .timeline-item {
        grid-template-columns: 1fr;
    }

    .app-topbar .nav-group.nav-secondary {
        padding-left: 0;
        border-left: 0;
    }

    .app-topbar .nav-group {
        gap: .4rem;
    }

    .admin-shell {
        width: calc(100% - 1.5rem);
        padding-top: .45rem;
    }

    .admin-sidebar {
        top: 59px;
        left: .65rem;
        right: .65rem;
        width: min(320px, calc(100vw - 1.3rem));
        max-height: calc(100vh - 3rem);
    }

    .admin-sidebar-close-mobile {
        display: inline-flex;
    }

    .admin-sidebar-toggle-btn {
        display: inline-flex;
    }

    .admin-sidebar-toggle-input:checked + .admin-topbar + .admin-shell .admin-sidebar {
        transform: translateX(0);
    }
}

.entries-page .entry-card-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 1rem 0;
}

.app-entry-card-grid,
.entries-page .app-entry-card-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
    margin: 1rem 0;
}

.entries-page .entry-card-list .entry-mobile-card {
    margin: 0;
}

.entries-page .entry-card-list .entry-mobile-card .app-entry-card__header {
    row-gap: .85rem;
}

.entry-business-cost-overview {
    display: grid;
    gap: .8rem;
    margin: .85rem 0 1rem;
    padding: .95rem;
    border-radius: 10px;
}

.entry-business-cost-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
}

.entry-business-cost-head h2 {
    margin: .1rem 0 0;
    color: var(--navy);
    font-size: 1.08rem;
    line-height: 1.2;
}

.entry-business-cost-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: .62rem;
}

.entry-cost-group-card {
    display: grid;
    gap: .2rem;
    min-width: 0;
    padding: .78rem .85rem;
    border: 1px solid rgba(211, 221, 237, .95);
    border-left: 4px solid var(--app-primary, #2563eb);
    border-radius: 8px;
    background: #fff;
}

.entry-cost-group-card--business {
    border-left-color: #7c3aed;
}

.entry-cost-group-card--unassigned {
    border-left-color: var(--app-muted, #63748d);
}

.entry-cost-group-card--total {
    border-left-color: var(--app-success, #0f8a63);
}

.entry-cost-group-card--locked {
    border-left-color: var(--app-warning, #c22525);
    background: var(--app-warning-soft, #fddada);
}

.entry-cost-group-card span {
    color: var(--muted);
    font-size: .75rem;
    font-weight: 900;
    text-transform: uppercase;
}

.entry-cost-group-card strong {
    color: var(--navy);
    font-size: 1.15rem;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.entry-cost-group-card small {
    color: var(--muted);
    font-size: .78rem;
    line-height: 1.32;
}

.entry-context-chip {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    max-width: 100%;
    padding: .2rem .48rem;
    border-radius: 999px;
    border: 1px solid #d3dded;
    background: #f6f8ff;
    color: var(--navy);
    font-size: .74rem;
    font-weight: 850;
    line-height: 1.2;
    overflow-wrap: anywhere;
    white-space: normal;
}

.entry-context-chip--business {
    border-color: #d8b4fe;
    background: #f3e8ff;
    color: #5b21b6;
}

.entry-context-chip--unassigned {
    border-color: #d7e0e7;
    background: #eef2f4;
    color: #596879;
}

.entry-detail-cards-toggle {
    margin: .85rem 0 1rem;
    padding: .8rem .95rem;
    border: 1px solid rgba(211, 221, 237, .95);
    border-radius: 10px;
    background: #fff;
}

.entry-detail-cards-toggle > summary {
    color: var(--navy);
    font-size: .95rem;
    font-weight: 900;
}

.entry-detail-cards-toggle[open] > summary {
    margin-bottom: .7rem;
}

.entry-quick-overview {
    display: grid;
    gap: .72rem;
    margin: .8rem 0 1rem;
    padding: .9rem;
    border-radius: 10px;
}

.entry-quick-overview-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: .75rem;
}

.entry-quick-overview-head h2 {
    margin: .1rem 0 0;
    color: var(--navy);
    font-size: 1.08rem;
    line-height: 1.2;
}

.entry-quick-list {
    display: grid;
    gap: .48rem;
}

.entry-quick-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.2fr) minmax(110px, .75fr) minmax(120px, .78fr) minmax(124px, .8fr) minmax(132px, .92fr) minmax(104px, .72fr) minmax(78px, .52fr) minmax(88px, auto);
    gap: .5rem .62rem;
    align-items: center;
    min-width: 0;
    padding: .64rem .72rem;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    background: #fff;
}

.entry-quick-row.app-entry-row--danger {
    border-left: 3px solid var(--app-danger, #c22525);
}

.entry-quick-row.app-entry-row--warning {
    border-left: 3px solid var(--app-warning, #c22525);
}

.entry-quick-row > *,
.entry-quick-main,
.entry-quick-cell,
.entry-quick-action {
    min-width: 0;
}

.entry-quick-main,
.entry-quick-cell {
    display: grid;
    gap: .2rem;
    color: var(--navy);
    font-size: .9rem;
    line-height: 1.28;
}

.entry-quick-main strong,
.entry-quick-cell strong {
    overflow-wrap: anywhere;
}

.entry-quick-label {
    color: var(--muted);
    font-size: .7rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.entry-quick-subline {
    color: var(--muted);
    font-size: .8rem;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.entry-quick-cost-cell {
    align-self: stretch;
}

.entry-quick-cost-block {
    display: grid;
    align-content: start;
    gap: .14rem;
    min-width: 0;
}

.entry-quick-cost-amount {
    display: block;
    color: var(--navy);
    font-size: .96rem;
    font-weight: 900;
    line-height: 1.16;
    overflow-wrap: anywhere;
}

.entry-quick-cost-interval {
    color: var(--muted);
    font-size: .76rem;
    line-height: 1.22;
    overflow-wrap: anywhere;
}

.entry-quick-cost-context {
    margin-top: .02rem;
}

.entry-quick-tax-note {
    color: var(--muted);
    font-size: .72rem;
    line-height: 1.24;
    overflow-wrap: anywhere;
}

.entry-quick-action {
    display: flex;
    justify-content: flex-end;
}

.entry-quick-action .btn {
    white-space: nowrap;
}

@media (max-width: 1180px) {
    .entry-quick-row {
        grid-template-columns: minmax(0, 1.3fr) minmax(0, .9fr) minmax(0, .9fr) minmax(112px, auto);
        align-items: start;
    }

    .entry-quick-action {
        justify-content: flex-start;
    }
}

@media (max-width: 840px) {
    .entry-business-cost-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .entry-business-cost-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .entry-quick-overview-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .entry-quick-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .entry-quick-main {
        grid-column: span 2;
    }
}

@media (max-width: 560px) {
    .entry-business-cost-overview {
        padding: .72rem;
    }

    .entry-business-cost-grid {
        grid-template-columns: 1fr;
    }

    .entry-quick-overview {
        padding: .72rem;
    }

    .entry-quick-row {
        grid-template-columns: 1fr;
    }

    .entry-quick-main,
    .entry-quick-action {
        grid-column: auto;
    }
}

/* Phase 22.22A: compact entries list */
.entry-view-switch-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .85rem;
    margin: .85rem 0 .75rem;
    padding: .8rem .95rem;
    border-color: rgba(36, 95, 142, .22);
    background: #f8fbff;
}

.entry-view-switch-copy {
    display: grid;
    gap: .16rem;
    min-width: 0;
}

.entry-view-switch-copy strong {
    color: var(--navy);
    font-size: 1rem;
    line-height: 1.2;
}

.entry-view-toggle {
    display: inline-flex;
    align-items: center;
    gap: .18rem;
    margin: .85rem 0 .25rem;
    padding: .22rem;
    border: 1px solid rgba(15, 23, 42, .14);
    border-radius: 8px;
    background: #fff;
}

.entry-view-switch-card .entry-view-toggle,
.entry-view-toggle--prominent {
    margin: 0;
    box-shadow: 0 8px 18px rgba(15, 23, 42, .06);
}

.entry-view-toggle a {
    display: inline-flex;
    align-items: center;
    min-height: 2.25rem;
    padding: .45rem .75rem;
    border-radius: 6px;
    color: var(--navy-2);
    font-size: .93rem;
    font-weight: 800;
    text-decoration: none;
}

.entry-view-toggle a:hover,
.entry-view-toggle a:focus-visible {
    background: rgba(15, 23, 42, .06);
}

.entry-view-toggle a.active {
    background: var(--navy);
    color: #fff;
}

.entry-compact-list {
    display: grid;
    gap: .72rem;
    margin: 1rem 0;
    padding: .75rem;
    overflow: hidden;
}

.entry-compact-row {
    display: grid;
    grid-template-columns: minmax(170px, 1.55fr) minmax(112px, .85fr) minmax(112px, .8fr) minmax(96px, .72fr) minmax(128px, 1fr) minmax(118px, .9fr) minmax(88px, .65fr) minmax(116px, auto);
    gap: .62rem .72rem;
    align-items: center;
    padding: .82rem;
    border: 1px solid rgba(226, 232, 240, .92);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 6px 16px rgba(15, 23, 42, .05);
}

.entry-compact-row > *,
.entry-compact-cell,
.entry-compact-main {
    min-width: 0;
}

.entry-compact-main h2 {
    margin: 0;
    color: var(--navy);
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
}

.entry-compact-main p,
.entry-compact-note {
    margin: .18rem 0 0;
    color: var(--navy-2);
    font-size: .88rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.entry-compact-cell {
    display: flex;
    flex-direction: column;
    gap: .22rem;
    color: var(--navy);
    font-size: .9rem;
    line-height: 1.32;
}

.entry-compact-label {
    color: var(--muted);
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: 0;
    text-transform: uppercase;
}

.entry-compact-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: .35rem;
    min-width: 0;
}

.entry-compact-actions .btn {
    white-space: nowrap;
}

.entry-compact-note {
    grid-column: 1 / -1;
    padding-top: .15rem;
}

@media (max-width: 1120px) {
    .entry-compact-row {
        grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(108px, auto);
    }

    .entry-compact-main {
        grid-column: span 2;
    }
}

@media (max-width: 720px) {
    .entry-view-switch-card {
        align-items: stretch;
        flex-direction: column;
    }

    .entry-view-toggle {
        display: flex;
        width: 100%;
    }

    .entry-view-toggle a {
        flex: 1;
        justify-content: center;
    }

    .entry-compact-list {
        padding: .55rem;
    }

    .entry-compact-row {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        align-items: start;
    }

    .entry-compact-main,
    .entry-compact-actions,
    .entry-compact-note {
        grid-column: 1 / -1;
    }

    .entry-compact-actions {
        justify-content: flex-start;
        flex-wrap: wrap;
    }
}

@media (max-width: 520px) {
    .entry-compact-row {
        grid-template-columns: 1fr;
    }

    .entry-compact-main,
    .entry-compact-actions,
    .entry-compact-note {
        grid-column: auto;
    }
}

@media (max-width: 900px) {
    .app-entry-card__header,
    .app-entry-card-top,
    .app-cost-history-header {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .app-entry-card__summary {
        width: 100%;
        justify-self: stretch;
    }

    .app-entry-meta--primary {
        text-align: left;
    }

    .app-cost-history-stats {
        width: 100%;
        min-width: 0;
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }
}

@media (max-width: 620px) {
    .app-entry-card-grid,
    .entries-page .app-entry-card-grid {
        grid-template-columns: 1fr;
    }

    .app-entry-card__details,
    .app-entry-card-details {
        grid-template-columns: 1fr;
    }

    .app-entry-detail-row:nth-child(2n),
    .app-entry-card-detail:nth-child(2n) {
        border-left: 0;
    }

    .app-entry-detail-row,
    .app-entry-card-detail {
        padding: .68rem .82rem;
        min-height: 0;
    }

    .app-entry-actions {
        justify-content: flex-start;
    }

    .app-cost-history-stats {
        grid-template-columns: 1fr;
    }
}

.deadline-row.app-deadline-card {
    border-radius: 12px;
    padding: .66rem .72rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
}

.deadline-row.app-deadline-card .deadline-priority {
    display: inline-flex;
    align-items: center;
    gap: .35rem;
    border-radius: 999px;
    padding: .24rem .6rem;
    font-weight: 820;
    font-size: .79rem;
}

.deadline-row.app-deadline-card .deadline-priority.is-critical {
    background: var(--app-danger-soft, #fde8e8);
    color: #7a2525;
    border: 1px solid #f2b7b7;
}

.deadline-row.app-deadline-card .deadline-priority.is-normal {
    background: #f1f5ff;
    color: var(--app-text);
    border: 1px solid #d4e1ff;
}

.checkout-layout {
    align-items: start;
}

.app-checkout-form {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 480px);
    gap: 20px;
    align-items: start;
}

.checkout-billing-card,
.checkout-mini-plan,
.checkout-confirm-card {
    grid-column: 1;
}

.app-checkout-order-summary {
    grid-column: 2;
    grid-row: 1 / span 4;
}

.app-checkout-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(420px, 480px);
    gap: 20px;
    align-items: start;
}

.checkout-plan-card,
.checkout-summary-card,
.checkout-confirm-card {
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.checkout-plan-prices {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .75rem;
    margin: 1rem 0;
}

.checkout-plan-prices div {
    display: grid;
    gap: .2rem;
    padding: .8rem .9rem;
    border: 1px solid #dbeafe;
    border-radius: 16px;
    background: #f8fbff;
}

.checkout-plan-prices span,
.checkout-summary-list dt,
.checkout-feature-list span {
    color: var(--muted);
    font-size: .86rem;
}

.checkout-plan-prices strong {
    color: #0f172a;
    font-size: 1.05rem;
}

.checkout-feature-list {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
    padding: 0;
    list-style: none;
}

.checkout-feature-list li {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: .62rem 0;
    border-bottom: 1px solid rgba(148, 163, 184, .28);
}

.checkout-feature-list strong,
.checkout-summary-list dd {
    margin: 0;
    color: #0f172a;
    text-align: right;
}

.checkout-summary-card {
    border-color: #bfdbfe;
    background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.checkout-summary-list {
    display: grid;
    gap: .55rem;
    margin: 1rem 0;
}

.checkout-summary-list div {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: .85rem;
    padding: .65rem .75rem;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    background: rgba(255, 255, 255, .82);
}

.checkout-summary-list .checkout-summary-total {
    border-color: #2563eb;
    background: #eff6ff;
}

.checkout-summary-list .checkout-summary-total dd {
    font-weight: 800;
}

.checkout-order-summary .checkout-order-list,
.app-checkout-summary-list {
    display: grid;
    gap: 0;
    grid-template-columns: 1fr;
    margin: 1rem 0;
    border: 1px solid var(--app-border, #dbe3ef);
    border-radius: 18px;
    overflow: hidden;
    background: #fff;
}

.checkout-order-summary .checkout-order-list > div {
    display: grid;
    grid-template-columns: minmax(150px, .75fr) minmax(0, 1.25fr);
    gap: 12px;
    align-items: baseline;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--app-border-soft, #e6edf7);
    border-radius: 0;
    background: #fff;
}

.checkout-order-summary .checkout-order-list > div:last-child {
    border-bottom: 0;
}

.checkout-order-summary .checkout-order-list dt {
    color: var(--app-muted, #64748b);
    font-weight: 800;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.checkout-order-summary .checkout-order-list dd {
    margin: 0;
    color: var(--app-text, #0f172a);
    font-weight: 800;
    text-align: right;
    word-break: normal;
    overflow-wrap: anywhere;
}

.checkout-order-summary .checkout-order-list .checkout-order-total {
    background: var(--app-blue-soft, #eff6ff);
}

.app-checkout-order-summary {
    min-width: 0;
}

.app-checkout-order-summary .app-checkout-summary-list {
    align-content: start;
}

.app-checkout-order-summary .app-checkout-summary-list > .app-checkout-summary-row {
    display: grid;
    grid-template-columns: minmax(150px, .8fr) minmax(0, 1.2fr);
    gap: 14px;
    align-items: start;
    min-height: 0;
    padding: 12px 14px;
    border: 0;
    border-bottom: 1px solid var(--app-border-soft, #e6edf7);
    border-radius: 0;
    background: #fff;
}

.app-checkout-order-summary .app-checkout-summary-list > .app-checkout-summary-row:last-child {
    border-bottom: 0;
}

.app-checkout-order-summary .app-checkout-summary-row dt {
    color: var(--app-muted, #64748b);
    font-weight: 800;
    line-height: 1.3;
    white-space: normal;
    word-break: normal;
    overflow-wrap: normal;
    hyphens: none;
}

.app-checkout-order-summary .app-checkout-summary-row dd {
    margin: 0;
    color: var(--app-text, #0f172a);
    font-weight: 800;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
    word-break: normal;
    overflow-wrap: break-word;
    hyphens: none;
}

.app-checkout-order-summary .app-checkout-summary-total {
    background: var(--app-blue-soft, #eff6ff);
}

.checkout-legal-links {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem .6rem;
    margin-top: 1rem;
}

.checkout-legal-links a {
    padding: .35rem .55rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #fff;
    color: #1d4ed8;
    font-weight: 700;
    font-size: .88rem;
    text-decoration: none;
}

.checkout-confirm-card {
    grid-column: 1;
}

.checkout-confirm-card .stacked-form {
    gap: 1rem;
}

.checkout-confirm-card .check-row {
    align-items: flex-start;
    gap: .7rem;
    padding: .62rem 0;
}

.checkout-billing-card,
.checkout-mini-plan {
    box-shadow: 0 18px 44px rgba(15, 23, 42, .08);
}

.checkout-billing-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .85rem;
    margin-top: 1rem;
}

.checkout-billing-grid input,
.checkout-billing-grid select,
.checkout-billing-grid textarea,
.checkout-confirm-fields input:not([type="checkbox"]):not([type="radio"]),
.checkout-confirm-fields select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    padding: .85rem 1rem;
    font: inherit;
    background: #fff;
    color: var(--ink);
}

.checkout-billing-type {
    display: flex;
    flex-wrap: wrap;
    gap: .7rem;
    margin-top: 1rem;
}

.checkout-billing-type label {
    display: inline-flex;
    align-items: center;
    gap: .45rem;
    padding: .62rem .85rem;
    border: 1px solid #bfdbfe;
    border-radius: 999px;
    background: #eff6ff;
    color: #1e3a8a;
    font-weight: 800;
}

.checkout-feature-list-compact {
    margin-bottom: 0;
}

.checkout-mini-price {
    display: flex;
    flex-wrap: wrap;
    gap: .55rem;
    margin: .85rem 0;
}

.checkout-mini-price span {
    padding: .45rem .65rem;
    border: 1px solid #dbeafe;
    border-radius: 999px;
    background: #f8fbff;
    color: #1e3a8a;
}

.checkout-error-box {
    grid-column: 1;
    border-color: #fecaca;
    background: #fff7f7;
    color: #7f1d1d;
}

.checkout-manual-notice {
    border-color: #f2b7b7;
    background: #fde8e8;
    color: #7a2525;
}

.checkout-order-warning {
    margin: -.15rem 0 0;
    padding: .75rem .85rem;
    border: 1px solid #bfdbfe;
    border-radius: 14px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: .93rem;
    line-height: 1.45;
}

.checkout-trust-box {
    grid-column: 1;
    margin-top: 1rem;
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1e3a8a;
}

.checkout-next-steps {
    margin-top: 1rem;
    padding: .9rem 1rem;
    border: 1px solid #dbeafe;
    border-radius: 18px;
    background: #f8fbff;
}

.checkout-next-steps h3 {
    margin: 0 0 .6rem;
}

.checkout-next-steps ol {
    display: grid;
    gap: .45rem;
    margin: 0;
    padding-left: 1.2rem;
}

.app-plan-status-callout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1.05rem 1.15rem;
    border: 1px solid #bfdbfe;
    border-radius: 22px;
    background: linear-gradient(135deg, #eff6ff 0%, #ffffff 100%);
    box-shadow: 0 18px 40px rgba(37, 99, 235, .09);
}

.app-plan-status-callout h2 {
    margin: .1rem 0 .35rem;
}

.app-plan-status-callout p {
    margin: 0;
    color: var(--app-text, #0f172a);
}

.app-plan-status-actions {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: .55rem;
}

@media (max-width: 1100px) {
    .app-checkout-grid,
    .app-checkout-form {
        grid-template-columns: 1fr;
    }

    .app-checkout-order-summary,
    .checkout-billing-card,
    .checkout-mini-plan,
    .checkout-confirm-card,
    .checkout-trust-box {
        grid-column: 1;
    }

    .app-checkout-order-summary {
        grid-row: auto;
    }

    .app-plan-status-callout {
        align-items: flex-start;
        flex-direction: column;
    }

    .app-plan-status-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 700px) {
    .checkout-plan-prices,
    .checkout-billing-grid,
    .checkout-page .checkout-legal-summary {
        grid-template-columns: 1fr;
    }

    .checkout-feature-list li,
    .checkout-summary-list div {
        align-items: flex-start;
        flex-direction: column;
    }

    .checkout-feature-list strong,
    .checkout-summary-list dd {
        text-align: left;
    }

    .checkout-order-summary .checkout-order-list > div,
    .app-checkout-order-summary .app-checkout-summary-list > .app-checkout-summary-row {
        grid-template-columns: 1fr;
    }

    .checkout-order-summary .checkout-order-list dd,
    .app-checkout-order-summary .app-checkout-summary-row dd {
        text-align: left;
    }
}

.app-system-managed-note {
    display: inline-flex;
    align-items: center;
    max-width: 100%;
    margin: 12px 0 0;
    padding: 8px 11px;
    border: 1px solid #bfdbfe;
    border-radius: 12px;
    background: #eff6ff;
    color: #1e3a8a;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.35;
}

.app-system-managed-note--compact {
    margin-top: 8px;
}

.app-system-managed-inline {
    color: #1e3a8a;
    font-weight: 700;
}

.admin-ads-report {
    display: grid;
    gap: 24px;
}

.admin-ads-filter {
    margin: 0;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
}

.admin-ads-filter .filter-bar-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 12px;
    align-items: end;
}

.admin-ads-filter-error {
    margin: 0 0 12px;
}

.admin-ads-filter input[readonly] {
    background: var(--color-surface-muted);
    color: var(--color-text-muted);
}

.admin-ads-filter label {
    display: grid;
    gap: 5px;
    margin: 0;
    font-size: .78rem;
    font-weight: 780;
    color: var(--color-text-muted);
}

.admin-ads-section {
    margin: 0;
}

.admin-ads-section h2,
.admin-ads-details h3 {
    margin-top: 0;
}

.admin-ads-kpis,
.admin-ads-technical-kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 12px 0 0;
}

.admin-ads-technical-kpis .metric-card {
    background: var(--color-surface-muted);
    box-shadow: none;
}

.admin-ads-key {
    display: block;
    margin-top: 3px;
    color: var(--color-text-muted);
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
    font-size: .74rem;
}

.admin-ads-details {
    padding: 14px 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface);
}

.admin-ads-details > summary {
    cursor: pointer;
    color: var(--color-primary-dark);
    font-weight: 780;
}

.admin-ads-details[open] > summary {
    margin-bottom: 14px;
}

.admin-ads-historical {
    background: var(--color-surface-muted);
}

.admin-ads-daily-table {
    min-width: 620px;
}

.admin-ad-creative-summary {
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    background: var(--color-surface-muted);
}

.admin-ad-creative-summary h2 {
    margin: 0 0 12px;
    font-size: 1rem;
}

.admin-ad-creative-summary dl {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px 16px;
    margin: 0 0 12px;
}

.admin-ad-creative-summary dl div {
    min-width: 0;
}

.admin-ad-creative-summary dt {
    color: var(--color-text-muted);
    font-size: .76rem;
    font-weight: 780;
}

.admin-ad-creative-summary dd {
    margin: 3px 0 0;
    overflow-wrap: anywhere;
    font-weight: 700;
}

@media (max-width: 900px) {
    .admin-ads-filter .filter-bar-fields,
    .admin-ads-kpis,
    .admin-ads-technical-kpis,
    .admin-ad-creative-summary dl {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 600px) {
    .admin-ads-filter .filter-bar-fields,
    .admin-ads-kpis,
    .admin-ads-technical-kpis,
    .admin-ad-creative-summary dl {
        grid-template-columns: 1fr;
    }
}

/* Phase 22.28A: native News-/Magazin-System */
.news-hero {
    padding: clamp(3.5rem, 7vw, 6rem) 0 2.5rem;
    background: linear-gradient(135deg, rgba(223, 245, 241, .86), rgba(231, 240, 255, .72));
    border-bottom: 1px solid var(--line);
}

.news-hero h1 {
    max-width: 14ch;
}

.news-hero p:last-child {
    max-width: 72ch;
    color: var(--muted);
    font-size: 1.08rem;
}

.news-overview-section,
.news-detail-section {
    padding: clamp(2.5rem, 6vw, 5rem) 0;
}

.news-category-filter {
    display: flex;
    flex-wrap: wrap;
    align-items: end;
    gap: .8rem;
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, .88);
}

.news-category-filter label {
    display: grid;
    gap: .35rem;
    color: var(--navy);
    font-weight: 800;
}

.news-category-filter select {
    min-width: 220px;
    padding: .65rem .8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font: inherit;
}

.news-card-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.25rem;
}

.news-card {
    display: flex;
    min-width: 0;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, .94);
    box-shadow: 0 16px 42px rgba(9, 33, 63, .08);
}

.news-card-image {
    display: block;
    width: 100%;
    height: 210px;
    object-fit: cover;
}

.news-card-body {
    display: flex;
    flex: 1;
    flex-direction: column;
    padding: 1.2rem;
}

.news-card time,
.news-article-date {
    color: var(--muted);
    font-size: .88rem;
    font-weight: 700;
}

.news-card h2,
.news-card h3 {
    margin: .6rem 0;
    font-size: 1.3rem;
    letter-spacing: -.02em;
}

.news-card h2 a,
.news-card h3 a,
.news-read-more {
    text-decoration: none;
}

.news-card h2 a:hover,
.news-card h2 a:focus-visible,
.news-card h3 a:hover,
.news-card h3 a:focus-visible,
.news-read-more:hover,
.news-read-more:focus-visible {
    color: var(--teal);
}

.news-card p {
    color: var(--muted);
}

.news-read-more {
    margin-top: auto;
    color: var(--teal);
    font-weight: 850;
}

.news-taxonomy-row,
.news-tags {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
}

.news-category-label,
.news-taxonomy-chip,
.news-tags span {
    display: inline-flex;
    width: fit-content;
    padding: .3rem .6rem;
    border-radius: 999px;
    background: var(--teal-soft);
    color: #0f5c55;
    font-size: .78rem;
    font-weight: 850;
    text-decoration: none;
}

.news-empty-state {
    text-align: center;
}

.news-article-shell {
    width: min(820px, calc(100% - 2rem));
}

.news-breadcrumb {
    display: flex;
    flex-wrap: wrap;
    gap: .45rem;
    margin-bottom: 1.5rem;
    color: var(--muted);
    font-size: .9rem;
}

.news-article {
    padding: clamp(1.25rem, 4vw, 3rem);
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(255, 255, 255, .96);
    box-shadow: var(--shadow);
}

.news-article-header h1 {
    margin-top: .85rem;
    font-size: clamp(2.2rem, 6vw, 4.4rem);
}

.news-article-excerpt {
    color: var(--muted);
    font-size: 1.15rem;
}

.news-article-image {
    display: block;
    width: 100%;
    height: auto;
    max-height: 620px;
    margin: 2rem 0;
    object-fit: contain;
    border-radius: 22px;
    background: var(--mist);
}

.news-article-content {
    font-size: 1.04rem;
    line-height: 1.78;
}

.news-article-content h2,
.news-article-content h3 {
    margin-top: 2.1rem;
}

.news-article-content blockquote {
    margin: 1.5rem 0;
    padding: .9rem 1.15rem;
    border-left: 4px solid var(--teal);
    background: var(--teal-soft);
}

.news-article-content hr {
    margin: 2rem 0;
    border: 0;
    border-top: 1px solid var(--line);
}

.news-editorial-note,
.news-sources {
    margin-top: 2rem;
    padding: 1rem 1.15rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--mist);
}

.news-editorial-note p,
.news-sources ul {
    margin-bottom: 0;
}

.news-tags {
    margin-top: 1.4rem;
}

.news-related {
    margin-top: 2.5rem;
}

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

.news-back-link {
    margin-top: 1.5rem;
    font-weight: 800;
}

.news-feed-link {
    margin: 0 0 1rem;
    text-align: right;
    font-weight: 800;
}

.news-category-hero .news-breadcrumb {
    margin-bottom: 1rem;
}

.home-news-head,
.section-heading-row,
.button-row,
.admin-news-actions,
.filter-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
}

.home-news-head > a {
    color: var(--teal);
    font-weight: 850;
}

.admin-news-page {
    display: grid;
    gap: 1.4rem;
}

.admin-news-filters {
    display: grid;
    grid-template-columns: repeat(4, minmax(150px, 1fr));
    gap: .8rem;
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: white;
}

.admin-news-filters label,
.admin-news-editor label,
.admin-news-editor fieldset {
    display: grid;
    gap: .35rem;
    min-width: 0;
    color: var(--navy);
    font-weight: 800;
}

.news-markdown-field,
.news-seo-editor {
    display: grid;
    gap: .65rem;
}

.form-label,
.news-markdown-field > span {
    color: var(--navy);
    font-weight: 800;
}

.news-format-badge {
    display: inline-flex;
    margin-left: .35rem;
    padding: .18rem .5rem;
    border-radius: 999px;
    background: var(--teal-soft);
    color: #0f5c55;
    font-size: .75rem;
    font-weight: 850;
}

.news-markdown-toolbar,
.news-source-grid {
    display: flex;
    flex-wrap: wrap;
    gap: .5rem;
}

.news-editor-body {
    width: 100%;
    min-height: 28rem;
    resize: vertical;
}

.news-sources-editor,
.news-source-block,
.news-seo-editor {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--mist);
}

.news-source-block {
    margin-bottom: .75rem !important;
    background: white;
}

.news-source-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.news-source-url {
    grid-column: 1 / -1;
}

.news-search-preview {
    padding: 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: white;
}

.news-search-preview p {
    margin: .2rem 0;
}

.news-search-preview-label,
.news-search-preview-domain,
.news-search-preview-url {
    color: var(--muted);
    font-size: .85rem;
}

.news-search-preview-title {
    color: #174ea6;
    font-size: 1.15rem;
}

.admin-news-filters input,
.admin-news-filters select {
    width: 100%;
    padding: .7rem .8rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: white;
    font: inherit;
}

.admin-news-actions {
    justify-content: flex-start;
    font-size: .88rem;
}

.admin-news-editor-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
    gap: 1.25rem;
    align-items: start;
}

.admin-news-editor-main,
.admin-news-editor-sidebar {
    display: grid;
    gap: 1rem;
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: white;
}

.admin-news-editor-sidebar {
    position: sticky;
    top: 1rem;
}

.admin-news-editor fieldset {
    margin: 0;
    padding: .9rem;
    border: 1px solid var(--line);
    border-radius: 14px;
}

.news-category-checks {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    gap: .25rem .75rem;
}

.news-tag-suggestions {
    display: grid;
    gap: .55rem;
    padding: .85rem 1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--mist);
}

.news-tag-suggestions .taxonomy-history-chips {
    max-height: 10rem;
    overflow-y: auto;
    align-content: flex-start;
}

button.news-taxonomy-chip {
    border: 0;
    cursor: pointer;
    font: inherit;
}

.news-publish-confirmation {
    padding: .75rem;
    border: 1px solid #d8c9a5;
    border-radius: 12px;
    background: #fffaf0;
}

.news-research-page {
    display: grid;
    gap: 1.25rem;
}

.research-metrics,
.research-source-actions {
    align-items: stretch;
}

.research-dry-run {
    align-items: center;
    gap: .75rem;
}

.research-filters {
    align-items: end;
}

.research-source-form {
    padding: 1.2rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: #fff;
}

.research-source-form .form-grid .wide {
    grid-column: 1 / -1;
}

.research-confirmation {
    padding: .85rem;
    border: 1px solid #d8c9a5;
    border-radius: 12px;
    background: #fffaf0;
}

.taxonomy-form-card {
    width: min(100%, 860px);
}

.taxonomy-actions,
.taxonomy-history-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .55rem;
}

.taxonomy-history-note {
    display: grid;
    gap: .55rem;
    padding: .85rem 1rem;
    border: 1px solid #d8c9a5;
    border-radius: 14px;
    background: #fffaf0;
}

.taxonomy-row-inactive {
    background: #f8fafb;
    color: var(--muted);
}

.taxonomy-cell-hint {
    display: block;
    margin-top: .2rem;
    color: var(--muted);
    font-size: .8rem;
}

.admin-news-current-image img {
    display: block;
    width: 100%;
    height: auto;
    max-height: 220px;
    object-fit: contain;
    border-radius: 14px;
    background: var(--mist);
}

.admin-news-category-layout {
    display: grid;
    grid-template-columns: minmax(280px, .7fr) minmax(0, 1.3fr);
    gap: 1.25rem;
    align-items: start;
}

.news-article--preview {
    max-width: 820px;
}

@media (max-width: 980px) {
    .news-card-grid,
    .news-card-grid--related,
    .admin-news-filters {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .admin-news-editor-grid,
    .admin-news-category-layout {
        grid-template-columns: 1fr;
    }

    .admin-news-editor-sidebar {
        position: static;
    }

    .news-source-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 640px) {
    .news-card-grid,
    .news-card-grid--related,
    .admin-news-filters {
        grid-template-columns: 1fr;
    }

    .news-card-image {
        height: 190px;
    }

    .news-category-filter {
        align-items: stretch;
        flex-direction: column;
    }

    .news-category-filter select {
        min-width: 0;
        width: 100%;
    }

    .news-feed-link {
        text-align: left;
    }
}
