/* =========================================================== SNPD — KALKULATOR MASA TAHANAN & DENDA Responsive, dependency-free stylesheet =========================================================== */

:root {
    color-scheme: dark;
    --bg: #081321;
    --bg-deep: #06101c;
    --surface: #101f30;
    --surface-raised: #14263a;
    --surface-hover: #192e45;
    --line: #26384c;
    --line-subtle: #1e3044;
    --text: #f0f6fc;
    --muted: #9baec3;
    --dim: #70869f;
    --blue: #58baf1;
    --blue-soft: #123b59;
    --teal: #62dbc8;
    --gold: #f4bd75;
    --red: #f29797;
    --radius-lg: 17px;
    --radius-md: 12px;
    --shadow: 0 18px 52px rgba(0, 0, 0, .14);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
}

*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    position: relative;
    min-width: 320px;
    margin: 0;
    background:
        linear-gradient(180deg, rgba(3, 10, 18, .88) 0%, rgba(6, 16, 28, .90) 52%, rgba(4, 10, 18, .94) 100%),
        radial-gradient(ellipse 60% 20% at 84% 2%, rgba(28, 85, 132, .20), transparent 85%),
        url("assets/bg.png?v=2.1.0") center top / cover fixed no-repeat;
    color: var(--text);
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, .14), rgba(0, 0, 0, .24));
    pointer-events: none;
    z-index: -1;
}

button, input, select {
    font: inherit;
}

button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: .45;
}

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

a {
    color: inherit;
    text-decoration: none;
}

svg {
    display: block;
}

[hidden] {
    display: none !important;
}

:focus-visible {
    outline: 2px solid var(--blue);
    outline-offset: 3px;
}

.shell {
    width: min(1180px, calc(100% - 48px));
    margin-inline: auto;
}

.visually-hidden {
    position: absolute !important;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    z-index: 999;
    top: -100px;
    left: 12px;
    padding: 10px 14px;
    border-radius: 8px;
    background: white;
    color: #081321;
}

.skip-link:focus {
    top: 10px;
}

/* Header */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    border-bottom: 1px solid rgba(125, 162, 198, .13);
    background: rgba(7, 18, 31, .84);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.header-inner {
    min-height: 81px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
}

.brand {
    display: inline-flex;
    align-items: center;
    gap: 13px;
    min-width: 0;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    flex: 0 0 52px;
}

.brand-mark img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 10px 18px rgba(0, 0, 0, .28));
}

.brand-copy {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-copy strong {
    font-size: 24px;
    line-height: 1.1;
    letter-spacing: .14em;
}

.brand-short {
    display: none;
}

.brand-copy small {
    font-size: 9px;
    letter-spacing: .15em;
    font-weight: 700;
    color: var(--muted);
    margin-top: 4px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0;
}

.database-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    white-space: nowrap;
}

.status-dot {
    width: 7px;
    height: 7px;
    flex: 0 0 7px;
    border-radius: 50%;
    background: var(--gold);
    box-shadow: 0 0 0 4px rgba(244, 189, 117, .10);
}

.database-status.ready .status-dot {
    background: var(--teal);
    box-shadow: 0 0 0 4px rgba(98, 219, 200, .09);
}

.database-status.failed .status-dot {
    background: var(--red);
    box-shadow: 0 0 0 4px rgba(242, 151, 151, .09);
}


/* Intro */

.hero {
    position: relative;
    display: flex;
    align-items: center;
    min-height: 335px;
    overflow: hidden;
    padding: 52px 0 44px;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 18px 0 0;
    border-radius: 28px;
    background: linear-gradient(90deg, rgba(4, 17, 30, .72) 0%, rgba(4, 17, 30, .44) 48%, rgba(4, 17, 30, .18) 100%);
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    max-width: 780px;
}

.eyebrow, .section-overline {
    margin: 0;
    color: var(--blue);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: .18em;
}

.eyebrow {
    display: flex;
    align-items: center;
    gap: 11px;
    margin-bottom: 17px;
}

.eyebrow-line {
    width: 25px;
    height: 2px;
    background: var(--blue);
}

h1, h2, h3, p {
    overflow-wrap: break-word;
}

h1 {
    margin: 0;
    font-size: clamp(34px, 4.1vw, 53px);
    letter-spacing: -.045em;
    line-height: 1.14;
    font-weight: 810;
}

h1 span {
    color: var(--blue);
}

.hero-description {
    margin: 18px 0 21px;
    max-width: 680px;
    color: #acbed0;
    font-size: 14px;
    line-height: 1.8;
}

.hero-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 13px;
    color: var(--muted);
    font-size: 12px;
}

.hero-meta strong {
    color: #e7f3ff;
    font-size: 14px;
}

.meta-separator {
    background: var(--line);
    height: 14px;
    width: 1px;
}

.version-tag {
    border: 1px solid #31536b;
    color: #8cc7e8;
    font-size: 9px;
    letter-spacing: .1em;
    padding: 5px 9px;
    border-radius: 5px;
    font-weight: 800;
}

.hero-art {
    position: absolute;
    display: grid;
    place-items: center;
    width: 370px;
    height: 370px;
    top: -21px;
    right: -85px;
    pointer-events: none;
    opacity: .42;
}

.orbit {
    position: absolute;
    border: 1px solid rgba(82, 176, 226, .22);
    border-radius: 50%;
}

.orbit-outer {
    width: 330px;
    height: 330px;
    box-shadow: 0 0 0 27px rgba(30, 91, 133, .08), 0 0 0 70px rgba(31, 100, 151, .045);
}

.orbit-inner {
    width: 225px;
    height: 225px;
    border-style: dashed;
}

.hero-art-center {
    width: 185px;
    height: 185px;
    filter: drop-shadow(0 24px 40px rgba(0, 0, 0, .35));
}

.hero-art-center img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Information strip */

.rule-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--line);
    margin-bottom: 28px;
}

.rule-item {
    display: flex;
    align-items: center;
    gap: 15px;
    background: #112137;
    padding: 21px 20px;
}

.rule-icon {
    display: grid;
    place-items: center;
    flex: 0 0 37px;
    height: 37px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 800;
}

.rule-icon.blue {
    background: #183d5b;
    color: var(--blue);
}

.rule-icon.teal {
    background: #173f43;
    color: var(--teal);
}

.rule-icon.gold {
    background: #433629;
    color: var(--gold);
}

.rule-item strong {
    display: block;
    font-size: 13px;
    font-weight: 800;
}

.rule-item p {
    margin: 3px 0 0;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.6;
}

/* Main columns */

.workspace {
    display: grid;
    grid-template-columns: minmax(0, 1.26fr) minmax(340px, .9fr);
    align-items: start;
    gap: 23px;
    margin-bottom: 70px;
}

.panel {
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow);
}

.panel-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding: 26px 26px 23px;
}

.panel-heading h2 {
    margin: 7px 0 0;
    font-size: 21px;
    letter-spacing: -.03em;
    line-height: 1.25;
}

.section-description {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 12px;
}

.count-pill, .selected-pill {
    flex: 0 0 auto;
    background: #1b344c;
    border: 1px solid #29506c;
    border-radius: 999px;
    padding: 7px 12px;
    font-size: 11px;
    font-weight: 700;
    color: #abd9f3;
}

.selected-pill {
    background: #153d40;
    border-color: #27615f;
    color: var(--teal);
}

/* Catalog filters */

.search-section {
    padding: 0 26px 21px;
    border-bottom: 1px solid var(--line-subtle);
}

.field-label {
    display: block;
    margin-bottom: 9px;
    color: #cbd8e4;
    font-size: 11px;
    font-weight: 700;
}

.search-box {
    position: relative;
}

.search-box svg {
    position: absolute;
    top: 50%;
    left: 15px;
    width: 18px;
    height: 18px;
    color: #7d9cb6;
    transform: translateY(-50%);
    pointer-events: none;
}

.search-box input {
    width: 100%;
    height: 48px;
    background: #0c192a;
    border: 1px solid #30445a;
    color: var(--text);
    border-radius: 10px;
    outline: none;
    padding: 0 14px 0 44px;
    font-size: 13px;
    transition: border-color .15s, box-shadow .15s;
}

.search-box input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 3px rgba(88, 186, 241, .12);
}

.search-box input::placeholder {
    color: #6e8297;
}

.search-box input::-webkit-search-cancel-button {
    cursor: pointer;
}

.filter-row {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
}

.filter-row select {
    min-height: 39px;
    min-width: 155px;
    max-width: 100%;
    padding: 0 30px 0 12px;
    border-radius: 8px;
    border: 1px solid #30445a;
    background: #13263a;
    color: #d7e5f1;
    font-size: 12px;
}

.clear-filter-button, .text-button {
    border: 0;
    background: none;
    padding: 8px 0;
    color: var(--blue);
    font-size: 11px;
    font-weight: 750;
}

.clear-filter-button:hover, .text-button:hover:not(:disabled) {
    color: #d2efff;
}

/* Law cards */

.catalog-list {
    padding: 9px 17px 14px;
}

.law-card {
    margin: 8px 0;
    padding: 19px 19px 17px;
    border: 1px solid var(--line-subtle);
    border-radius: 12px;
    background: #13253a;
    transition: border-color .15s, background-color .15s;
}

.law-card:hover {
    border-color: #3b5c78;
    background: #172a40;
}

.law-card.is-selected {
    border-color: #387b86;
    background: #132c3d;
}

.law-topline {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.law-category {
    display: inline-flex;
    align-items: center;
    padding: 4px 8px;
    border-radius: 5px;
    background: #203b55;
    color: #93cdef;
    font-size: 9px;
    font-weight: 850;
    letter-spacing: .09em;
}

.law-category.cat-ringan {
    background: #1d4146;
    color: #83ded1;
}

.law-category.cat-sedang {
    background: #473b27;
    color: #f7ca85;
}

.law-category.cat-berat {
    background: #4a3139;
    color: #f6a6b1;
}

.law-category.cat-rekomendasi {
    background: #463249;
    color: #e1afe9;
}

.law-code {
    color: #9eb5cc;
    font-size: 11px;
    font-weight: 600;
}

.law-title {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    font-weight: 750;
}

.law-bottom {
    display: flex;
    justify-content: space-between;
    align-items: end;
    gap: 14px;
    margin-top: 16px;
}

.law-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 11px 20px;
}

.law-fact span {
    display: block;
    color: #7f95ae;
    font-size: 10px;
    margin-bottom: 1px;
}

.law-fact strong {
    font-size: 13px;
    font-weight: 800;
    color: #dceafa;
}

.law-fact .fine {
    color: var(--gold);
}

.law-action {
    margin: 9px 0 0;
    color: #a9b9cd;
    font-size: 10px;
}

.add-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    gap: 6px;
    min-height: 37px;
    min-width: 109px;
    padding: 8px 11px;
    flex: 0 0 auto;
    border: 1px solid #3785b5;
    border-radius: 8px;
    background: #1d557a;
    color: #d4f2ff;
    font-size: 11px;
    font-weight: 800;
}

.add-button:hover {
    background: #27739f;
}

.add-button span {
    font-size: 17px;
    font-weight: 400;
    line-height: 0;
}

.law-card.is-selected .add-button {
    background: #245c55;
    border-color: #377d73;
    color: #c4fff2;
}

.law-card.is-selected .add-button:hover {
    background: #327768;
}

.show-more-area {
    padding: 0 26px 25px;
}

/* Calculation */

.summary-column {
    min-width: 0;
    position: sticky;
    top: 22px;
}

.summary-heading {
    padding-bottom: 22px;
}

.summary {
    overflow: hidden;
}

.results-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 0 19px;
}

.result-tile {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 139px;
    padding: 17px 16px;
    border-radius: 11px;
}

.detention-tile {
    background: linear-gradient(145deg, #154268, #12334f);
    border: 1px solid #275b83;
}

.fine-tile {
    background: linear-gradient(145deg, #3a3326, #29291f);
    border: 1px solid #615137;
}

.tile-label {
    color: #b8d8ee;
    font-size: 10px;
    font-weight: 700;
}

.fine-tile .tile-label {
    color: #dcc7a1;
}

.tile-value {
    display: block;
    margin: 10px 0 6px;
    font-size: clamp(20px, 2.2vw, 28px);
    font-variant-numeric: tabular-nums;
    font-weight: 850;
    letter-spacing: -.035em;
    line-height: 1.2;
    overflow-wrap: anywhere;
}

.detention-tile .tile-value {
    color: #9bdafa;
}

.fine-tile .tile-value {
    color: #ffd394;
}

.result-tile small {
    color: #aac2d6;
    font-size: 10px;
}

.fine-tile small {
    color: #c5b59d;
}

.formula-note {
    display: flex;
    align-items: flex-start;
    gap: 9px;
    margin: 16px 19px 0;
    padding: 10px 12px;
    border: 1px solid #234456;
    border-radius: 8px;
    background: #142b3a;
}

.formula-note > span {
    color: #8fcbe8;
    font-size: 14px;
    line-height: 1.25;
}

.formula-note p {
    margin: 0;
    color: #b3cbdc;
    font-size: 10px;
    line-height: 1.6;
}

.formula-note strong {
    color: #d5ecfa;
}

.special-notice {
    margin: 16px 19px 0;
    padding: 12px 13px;
    border-radius: 9px;
    border: 1px solid #75593a;
    background: #332c25;
    color: #f6d8b4;
}

.notice-title {
    display: flex;
    gap: 9px;
    align-items: center;
    font-size: 12px;
}

.special-notice p, .special-notice li {
    font-size: 11px;
    line-height: 1.6;
}

.special-notice p {
    margin: 8px 0;
}

.special-notice ul {
    padding-left: 19px;
    margin: 8px 0 0;
}

.selected-section {
    padding: 21px 19px 0;
}

.selected-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-bottom: 11px;
}

.selected-section-header h3 {
    margin: 0;
    font-size: 13px;
}

.selected-list {
    display: grid;
    gap: 9px;
    max-height: 525px;
    overflow-y: auto;
    scrollbar-color: #476581 transparent;
    scrollbar-width: thin;
}

.selected-empty {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    min-height: 194px;
    padding: 23px;
    border: 1px dashed #314b62;
    border-radius: 11px;
    background: #102034;
}

.empty-illustration {
    display: grid;
    place-items: center;
    width: 41px;
    height: 41px;
    margin-bottom: 13px;
    border: 1px solid #315877;
    background: #173a55;
    color: var(--blue);
    border-radius: 50%;
    font-size: 24px;
    line-height: 1;
}

.selected-empty strong {
    font-size: 12px;
}

.selected-empty p {
    max-width: 245px;
    margin: 6px 0 0;
    color: var(--dim);
    font-size: 11px;
}

.selected-card {
    border: 1px solid #294258;
    background: #15293e;
    border-radius: 9px;
    padding: 12px;
}

.selected-card-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 9px;
}

.selected-card-code {
    font-size: 10px;
    font-weight: 800;
    color: var(--blue);
}

.remove-button {
    flex: 0 0 auto;
    width: 25px;
    height: 25px;
    display: grid;
    place-items: center;
    background: transparent;
    color: #9dafc0;
    border: 1px solid #40556a;
    border-radius: 6px;
    line-height: 1;
    font-size: 18px;
}

.remove-button:hover {
    color: white;
    background: #623f48;
    border-color: #93606b;
}

.selected-card-title {
    margin: 5px 0 8px;
    font-size: 11px;
    font-weight: 750;
    line-height: 1.55;
}

.selected-card-facts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 11px;
    color: #a7bed0;
    font-size: 10px;
}

.selected-card-facts strong {
    color: #e1edf9;
}

.quantity-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #2a4056;
}

.quantity-label {
    color: #90a9bf;
    font-size: 10px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    gap: 9px;
}

.quantity-control button {
    width: 28px;
    height: 28px;
    display: grid;
    place-items: center;
    border: 1px solid #47647a;
    color: #d5eaf9;
    background: #1b3a53;
    border-radius: 6px;
    font-weight: 700;
}

.quantity-control button:hover:not(:disabled) {
    background: #285578;
}

.quantity-control output {
    min-width: 20px;
    text-align: center;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

.summary-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, .8fr);
    gap: 10px;
    padding: 22px 19px 11px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 10px 12px;
    font-size: 11px;
    font-weight: 800;
    border: 1px solid transparent;
    border-radius: 9px;
    transition: background-color .15s, border-color .15s;
}

.button svg {
    width: 15px;
    height: 15px;
}

.button-primary {
    background: #3994c9;
    border-color: #3994c9;
    color: #061626;
}

.button-primary:hover:not(:disabled) {
    background: #65b7e4;
}

.button-outline {
    background: #162d43;
    border-color: #375773;
    color: #d6eafb;
}

.button-outline:hover:not(:disabled) {
    background: #23415c;
}

.button-full {
    width: 100%;
}

.persistence-note {
    padding: 0 15px 17px;
    margin: 0;
    color: var(--dim);
    font-size: 10px;
    text-align: center;
}

/* Empty states, footer, feedback */

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 170px;
    gap: 12px;
    padding: 20px;
}

.empty-state strong {
    font-size: 14px;
}

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

.loading-spinner {
    height: 26px;
    width: 26px;
    border-radius: 50%;
    border: 3px solid #314c64;
    border-top-color: var(--blue);
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.site-footer {
    border-top: 1px solid #223246;
    color: var(--dim);
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 4px 16px;
    padding: 22px 0;
}

.footer-inner p {
    margin: 0;
    font-size: 11px;
}

.toast {
    position: fixed;
    z-index: 30;
    bottom: 25px;
    left: 50%;
    transform: translateX(-50%);
    max-width: calc(100vw - 24px);
    padding: 12px 20px;
    border: 1px solid #366e6b;
    border-radius: 10px;
    color: #d9fff6;
    font-size: 12px;
    font-weight: 700;
    background: #173b39;
    box-shadow: 0 8px 30px rgba(0,0,0,.35);
    text-align: center;
}

.mobile-dock {
    display: none;
}

/* Tablet & small desktop */

@media (max-width: 1050px) {
    .workspace {
        grid-template-columns: minmax(0, 1.08fr) minmax(330px, 1fr);
        gap: 16px;
    }
    .panel-heading {
        padding: 22px 18px 18px;
    }
    .search-section {
        padding: 0 18px 18px;
    }
    .results-grid {
        padding: 0 13px;
        gap: 8px;
    }
    .result-tile {
        padding: 14px 11px;
    }
    .tile-value {
        font-size: 23px;
    }
    .rule-item {
        padding: 17px 13px;
        gap: 10px;
    }
    .rule-icon {
        flex-basis: 31px;
        height: 31px;
    }
}

/* One-column layout */

@media (max-width: 800px) {
    .hero-art {
        right: -172px;
        opacity: .22;
    }
    .workspace {
        grid-template-columns: 1fr;
        gap: 21px;
    }
    .summary-column {
        position: static;
    }
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        padding: 0 19px;
        gap: 11px;
    }
    .rule-strip {
        grid-template-columns: 1fr;
    }
    .rule-item {
        padding: 14px 18px;
    }
    .selected-list {
        max-height: none;
    }
    .mobile-dock:not([hidden]) {
        display: flex;
    }
    .mobile-dock {
        position: fixed;
        z-index: 20;
        left: 0;
        right: 0;
        bottom: 0;
        align-items: center;
        justify-content: space-between;
        gap: 14px;
        padding: 11px max(18px, env(safe-area-inset-right)) calc(11px + env(safe-area-inset-bottom)) max(18px, env(safe-area-inset-left));
        background: #0d2335;
        border-top: 1px solid #416078;
        box-shadow: 0 -8px 35px rgba(0,0,0,.35);
    }
    .mobile-dock-info {
        display: flex;
        flex-direction: column;
        gap: 3px;
        min-width: 0;
    }
    .mobile-dock-info > span {
        color: #8cb9d3;
        font-size: 10px;
        font-weight: 800;
    }
    .mobile-dock-info strong {
        overflow-wrap: anywhere;
        line-height: 1.3;
        font-size: 14px;
    }
    .dock-separator {
        color: var(--dim);
    }
    #dockFine {
        color: var(--gold);
    }
    .dock-link {
        flex: 0 0 auto;
        border-radius: 9px;
        padding: 11px 13px;
        background: #378dbb;
        font-size: 12px;
        font-weight: 800;
        color: #071524;
    }
    .site-footer {
        padding-bottom: 80px;
    }
    .toast {
        bottom: 85px;
    }
}

/* A compact header on smaller screens keeps the status visible. */
@media (min-width: 531px) and (max-width: 710px) {
    .brand-copy strong {
        font-size: 18px;
        letter-spacing: .08em;
    }
    .brand-copy small {
        font-size: 8px;
        letter-spacing: .08em;
    }
}

/* Phones */

@media (max-width: 530px) {
    .shell {
        width: min(100% - 28px, 1180px);
    }
    .header-inner {
        min-height: 71px;
        gap: 12px;
    }
    .brand-mark {
        height: 42px;
        width: 42px;
        flex-basis: 42px;
    }
    .brand {
        gap: 8px;
    }
    .brand-copy strong {
        font-size: 21px;
    }
    .brand-full {
        display: none;
    }
    .brand-short {
        display: inline;
    }
    .brand-copy small {
        max-width: 134px;
        font-size: 7px;
        line-height: 1.4;
        letter-spacing: .09em;
    }
    .header-actions {
        gap: 0;
    }
    .database-status {
        font-size: 10px;
    }
    .hero {
        min-height: auto;
        padding: 41px 0 30px;
    }
    .eyebrow {
        font-size: 9px;
    }
    h1 {
        font-size: clamp(30px, 8.3vw, 42px);
    }
    .hero-description {
        margin: 17px 0;
        font-size: 12px;
        line-height: 1.75;
    }
    .hero-meta {
        gap: 9px;
        font-size: 10px;
    }
    .hero-meta strong {
        font-size: 12px;
    }
    .version-tag {
        font-size: 8px;
    }
    .rule-strip {
        margin-bottom: 16px;
    }
    .rule-item {
        padding: 12px 14px;
    }
    .rule-item strong {
        font-size: 12px;
    }
    .rule-item p {
        font-size: 10px;
    }
    .workspace {
        gap: 15px;
        margin-bottom: 40px;
    }
    .panel-heading {
        padding: 20px 15px 18px;
    }
    .panel-heading h2 {
        font-size: 18px;
    }
    .section-description {
        font-size: 11px;
    }
    .count-pill, .selected-pill {
        font-size: 10px;
        padding: 6px 9px;
    }
    .search-section {
        padding: 0 15px 16px;
    }
    .search-box input {
        font-size: 12px;
    }
    .catalog-list {
        padding: 6px 10px 10px;
    }
    .law-card {
        margin: 8px 0;
        padding: 14px 12px;
    }
    .law-title {
        font-size: 13px;
    }
    .law-bottom {
        align-items: flex-end;
        gap: 8px;
    }
    .law-facts {
        gap: 8px 14px;
    }
    .law-fact strong {
        font-size: 12px;
    }
    .add-button {
        min-width: 89px;
        min-height: 35px;
        font-size: 10px;
        padding: 7px;
    }
    .show-more-area {
        padding: 0 14px 17px;
    }
    .result-tile {
        min-height: 121px;
    }
    .tile-value {
        font-size: clamp(17px, 5vw, 23px);
    }
    .result-tile small {
        font-size: 9px;
    }
    .selected-section {
        padding: 20px 14px 0;
    }
    .summary-actions {
        padding: 20px 14px 11px;
    }
    .formula-note {
        margin: 14px 14px 0;
    }
    .special-notice {
        margin: 14px 14px 0;
    }
    .footer-inner p {
        font-size: 10px;
    }
}

@media (max-width: 365px) {
    .database-status {
        font-size: 0;
        gap: 0;
    }
    .status-dot {
        width: 9px;
        height: 9px;
    }
    .law-bottom {
        flex-direction: column;
        align-items: flex-start;
    }
    .add-button {
        width: 100%;
    }
    .mobile-dock-info strong {
        font-size: 12px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        transition-duration: .01ms !important;
    }
}

/* Print a clean and readable case report only. */

@media print {
    :root {
        color-scheme: light;
    }
    body {
        background: white !important;
        color: #111;
        font-family: Arial, sans-serif;
    }
    .shell {
        width: 100%;
    }
    .site-header {
        border-color: #ccc;
        background: transparent;
    }
    .brand-copy strong, .brand-copy small {
        color: #111;
    }
    .brand-mark {
        color: #234;
    }
    .brand-mark img {
        filter: none;
    }
    .header-actions, .hero, .rule-strip, .catalog, .summary-actions, .persistence-note, .mobile-dock, .site-footer, .toast, .clear-filter-button, .text-button, .quantity-control button, .remove-button {
        display: none !important;
    }
    .workspace {
        display: block;
        margin: 14px 0;
    }
    .panel {
        box-shadow: none;
        background: white;
        border-color: #bbb;
    }
    .summary-column {
        position: static;
    }
    .panel-heading {
        padding: 17px;
    }
    .panel-heading h2, .selected-section-header h3 {
        color: #111;
    }
    .section-overline, .selected-pill, .tile-label, .tile-value, .result-tile small, .formula-note, .selected-card-code, .selected-card-title, .selected-card-facts, .quantity-label, .quantity-control output {
        color: #222 !important;
    }
    .result-tile, .formula-note, .selected-card {
        background: #f4f4f4 !important;
        border: 1px solid #ccc;
    }
    .selected-card, .result-tile, .special-notice {
        break-inside: avoid;
    }
    .results-grid {
        gap: 12px;
    }
    .special-notice {
        background: #fff8ea;
        color: #333;
        border-color: #777;
    }
    .selected-list {
        max-height: none;
        overflow: visible;
    }
    .quantity-control {
        gap: 0;
    }
    .selected-section, .panel-heading {
        padding-inline: 19px;
    }
}
