@font-face {
    font-family: 'DM Sans';
    font-style: normal;
    font-weight: 400 700;
    font-display: swap;
    src: url('/static/fonts/dm-sans-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'DM Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/dm-sans-italic-latin.woff') format('woff');
}

@font-face {
    font-family: 'Lora';
    font-style: normal;
    font-weight: 500 700;
    font-display: swap;
    src: url('/static/fonts/lora-latin.woff2') format('woff2');
}

@font-face {
    font-family: 'Droid Serif';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/droid-serif-regular.woff2') format('woff2');
}

@font-face {
    font-family: 'Droid Serif';
    font-style: normal;
    font-weight: 700;
    font-display: swap;
    src: url('/static/fonts/droid-serif-bold.woff2') format('woff2');
}

@font-face {
    font-family: 'Droid Serif';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/droid-serif-italic.woff2') format('woff2');
}

:root {
    color-scheme: light dark;
    --color-primary: #1e3a5f;
    --color-primary-light: #2d5a8e;
    --color-accent: #c9a84c;
    --color-win: #A68400;  /* winner text — warm gold, 3.55:1 on white; bold weight provides non-color cue */
    --color-success: #197a35;  /* vivid grass-green — pushed away from HR teal (#2f7361) so Sigur never reads as a court color */
    --color-error: #cc2222;  /* pure vivid red — pushed away from the dark-wine Landsréttur brand token #8E2F44 so Tap never reads as LR */
    --color-warning: #d4930d;
    --color-neutral: #a0998e;
    --color-bg: #ffffff;
    --color-bg-subtle: #f0f1f3;
    --color-surface: #ffffff;
    --color-text: #1a1a1a;
    --color-text-light: #6b6b6b;
    --color-border: #e0e0e0;
    --color-muted: #8a8580;
    --color-text-muted: #9a9790;
    --color-bg-muted: #f5f5f5;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.08), 0 2px 4px rgba(0,0,0,0.06);
    --shadow-lg: 0 8px 30px rgba(0,0,0,0.1), 0 4px 8px rgba(0,0,0,0.06);
    --radius: 6px;
    --radius-lg: 10px;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-heading: 'Lora', Georgia, 'Times New Roman', serif;
    --font-verdict: 'Times New Roman', Times, serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scrollbar-gutter: stable;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

/* Accessibility: focus-visible ring for keyboard navigation */
:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}
/* Remove the old outline:none on inputs — let focus-visible handle it */
input:focus, select:focus, textarea:focus {
    outline: none;
}
input:focus-visible, select:focus-visible, textarea:focus-visible {
    outline: 2px solid var(--color-primary-light);
    outline-offset: 1px;
}

/* Skip to content link — visible only on keyboard focus */
.skip-to-content {
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) translateY(-100%);
    background: var(--color-primary);
    color: #fff;
    padding: 0.5rem 1.5rem;
    border-radius: 0 0 var(--radius) var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    z-index: 1000;
    text-decoration: none;
    transition: transform 0.2s;
}
.skip-to-content:focus {
    transform: translateX(-50%) translateY(0);
}

/* The skip-link target <main tabindex="-1"> receives programmatic focus —
   a focus ring around the entire page body is noise, the scroll jump is
   the feedback. Keyboard focus then continues from inside main as normal. */
main:focus {
    outline: none;
}

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

/* Header */
header {
    background: linear-gradient(160deg, #14253d 0%, #1e3a5f 50%, #264b72 100%);
    padding: 1.75rem 1.5rem 0.75rem;
    text-align: center;
    border-bottom: none;
    position: relative;
}

header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent 5%, var(--color-accent) 50%, transparent 95%);
}

header h1 {
    font-family: var(--font-heading);
    font-size: 1.8rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.01em;
    position: relative;
}

header h1 a {
    color: inherit;
    text-decoration: none;
}
header h1 a:focus-visible {
    outline: 2px solid rgba(255,255,255,0.6);
    outline-offset: 4px;
    border-radius: 2px;
}

header .subtitle {
    color: rgba(255,255,255,0.72);
    font-size: 0.72rem;
    margin-top: 0.25rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    position: relative;
}

/* Main content */
main {
    flex: 1;
    max-width: 941px;
    margin: 0 auto;
    padding: 2.5rem 1.25rem;
    width: 100%;
}

/* Footer */
footer {
    background: var(--color-surface);
    padding: 1.25rem 1.5rem;
    text-align: center;
    border-top: none;
    font-size: 0.8rem;
    color: var(--color-text-light);
    position: relative;
}

footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent 10%, var(--color-border) 50%, transparent 90%);
}

footer a {
    color: var(--color-primary);
    text-decoration: none;
}

footer a:hover {
    text-decoration: underline;
}

/* Help page */
.help-page {
    max-width: 720px;
    margin: 0 auto;
    padding: 0 1rem 2rem;
}

.help-page h2 {
    margin-bottom: 1.5rem;
}

.help-section {
    margin-bottom: 2rem;
}

.help-section p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.help-section p:last-child {
    margin-bottom: 0;
}

.help-section h3 {
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.help-syntax {
    font-family: monospace;
    color: var(--color-text-light);
    font-weight: normal;
    font-size: 0.9em;
}

.help-example {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.75rem;
    margin: 0.5rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
    font-size: 0.9rem;
}

.help-example code {
    font-weight: 600;
    white-space: nowrap;
}

.help-arrow {
    color: var(--color-text-light);
}

.help-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.75rem 0;
    font-size: 0.9rem;
}

.help-table th,
.help-table td {
    padding: 0.5rem 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.help-table th {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.help-table code {
    font-weight: 600;
}

.help-note {
    font-size: 0.85rem;
    color: var(--color-text-light);
    font-style: italic;
}

/* Search container */
.search-container {
    background: var(--color-surface);
    padding: 1.5rem 1.75rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 1px solid var(--color-border);
}


.sort-buttons {
    display: flex;
    gap: 0;
    flex: 0 0 auto;
}
.sort-btn {
    padding: 0.35rem 0.6rem;
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text-light);
    font-size: 0.82rem;
    font-family: var(--font-body);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}
.sort-btn:first-child {
    border-radius: 6px 0 0 6px;
}
.sort-btn:last-child {
    border-radius: 0 6px 6px 0;
    border-left: none;
}
.sort-btn.active {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.sort-btn:hover:not(.active) {
    background: var(--color-bg-subtle);
}
.sort-btn:active {
    transform: translateY(1px);
}

.hd-court-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.35rem;
}

.hd-court-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.55rem;
    font-size: 0.72rem;
    font-weight: 600;
    font-family: var(--font-body);
    border: 1px solid #b8cce4;
    border-radius: 999px;
    background: #eaf0f8;
    color: #29589A;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

.hd-court-chip:hover {
    background: #d4e2f4;
    border-color: #8baed4;
}

.hd-court-chip.active {
    background: #29589A;
    color: #fff;
    border-color: #29589A;
}

/* Court filter pills — override court-tag shape, match logmenn profile pills.
   Use label element prefix for higher specificity than .court-tag alone. */
label.court-filter-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    cursor: pointer;
    user-select: none;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    transition: opacity 0.15s, box-shadow 0.15s;
}

label.court-filter-pill input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    pointer-events: none;
}

label.court-filter-pill:hover {
    opacity: 0.8;
}
label.court-filter-pill:active {
    transform: scale(0.97);
}

label.court-filter-pill:has(input:checked) {
    box-shadow: 0 0 0 2px currentColor;
    opacity: 1;
}

label.court-filter-pill:focus-within {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

/* Court filter pills inline with secondary filters */
.court-filter-bar {
    display: inline-flex;
    gap: 0.35rem;
    flex-wrap: nowrap;
    align-items: center;
    margin-right: auto;
}

/* Date text inputs */

/* Loading indicator */
.htmx-indicator {
    display: none;
    text-align: center;
    padding: 2.5rem;
}

.htmx-indicator.htmx-request {
    display: block;
}

html::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--color-accent);
    z-index: 9999;
    pointer-events: none;
    transform-origin: left;
    transform: scaleX(0);
    opacity: 0;
    transition: none;
}

html.page-loading::before {
    transform: scaleX(0.85);
    opacity: 1;
    transition: transform 8s cubic-bezier(0.1, 0.4, 0.2, 1), opacity 0s;
}

html.page-load-done::before {
    transform: scaleX(1);
    opacity: 0;
    transition: transform 0.2s ease, opacity 0.3s ease 0.15s;
}

.htmx-indicator p {
    color: var(--color-text-light);
    font-size: 0.9rem;
}

.spinner {
    width: 32px;
    height: 32px;
    border: 2.5px solid var(--color-border);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin: 0 auto 0.75rem;
}

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

/* Results */
.results-container {
    animation: fadeIn 0.35s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.results-summary {
    margin-bottom: 1.25rem;
}

.results-summary h2 {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--color-text);
}

.result-count {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-top: 0.15rem;
}

/* Court status badges */

.error-message {
    background: #f8e8e8;
    color: var(--color-error);
    padding: 0.65rem 0.9rem;
    border-radius: var(--radius);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    border-left: 3px solid var(--color-error);
}

.error-message .btn-external {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    text-decoration: none;
    font-size: 0.85rem;
}

.error-message .btn-external:hover {
    opacity: 0.85;
}

/* Search facets */
.facets {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}
.facet-group {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.35rem;
    max-height: 2rem;
    overflow: hidden;
    transition: max-height 0.3s ease;
}
.facet-group.expanded,
.facet-group-active {
    max-height: none;
    overflow: visible;
}
.facet-expand {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 0.7rem;
    cursor: pointer;
    padding: 0.1rem 0.3rem;
    font-family: var(--font-body);
    white-space: nowrap;
}
.facet-expand:hover {
    color: var(--color-primary);
}
.facet-expand .chevron {
    display: inline-block;
    transition: transform 0.3s ease;
    font-size: 0.55rem;
}
.facet-expand.open .chevron {
    transform: rotate(180deg);
}
.facet-title {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-right: 0.15rem;
}
.facet-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.2rem 0.5rem;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    font-size: 0.72rem;
    color: var(--color-text);
    text-decoration: none;
    white-space: nowrap;
}

a.facet-chip {
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
a.facet-chip:hover {
    border-color: var(--color-primary-light);
    background: #e8eef6;
}
a.facet-chip.active {
    border-color: var(--color-primary);
    background: #e0e8f2;
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--color-primary);
}
a.facet-chip.active .facet-count {
    color: var(--color-primary-light);
}
.facet-count {
    font-size: 0.65rem;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

/* Case cards */
.cases-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

/* Infinite-scroll sentinel — sits at the bottom of .cases-list and auto-fetches
   the next page when it scrolls into view (hx-trigger="revealed"). */
.load-more-sentinel {
    display: flex;
    justify-content: center;
    padding: 1.75rem 0 0.5rem;
    min-height: 2.5rem;
}

.load-more-indicator {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
}

.load-more-indicator .spinner {
    width: 18px;
    height: 18px;
    border-width: 2px;
    margin: 0;
}

.case-card {
    background: var(--color-surface);
    padding: 1.15rem 1.3rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    content-visibility: auto;
    contain-intrinsic-size: auto 180px;
}

.case-card.haestirettur { border-left-color: #2f7361; }
.case-card.landsrettur { border-left-color: #8E2F44; }
.case-card.heradsdomstolar { border-left-color: #29589A; }

.case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.35rem;
}

.court-tag {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    white-space: nowrap;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
}

.court-tag.haestirettur { background: #e8f5f4; color: #2f7361; }  /* 4.54:1 — passes WCAG AA */
.court-tag.landsrettur { background: #fbeef1; color: #8E2F44; }
.court-tag.heradsdomstolar { background: #eaf0f8; color: #29589A; }

.case-header-right {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-left: auto;
}

.cases-list .case-header {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-rows: auto auto;
    gap: 0 0.5rem;
    align-items: center;
}

.cases-list .case-header .court-tag {
    justify-self: start;
}

.cases-list .case-header h3 {
    grid-column: 1;
    margin: 0.35rem 0 0;
    line-height: 1;
}

.cases-list .case-header > time {
    grid-column: 2 / -1;
    text-align: right;
    align-self: start;
    margin-top: 0.15rem;
}

.case-header time {
    font-size: 0.8rem;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

.imported-date {
    font-size: 0.8rem;
    color: var(--color-text-light);
    opacity: 0.7;
    font-variant-numeric: tabular-nums;
}


.case-card h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.4;
    text-wrap: balance;
}

.case-card h3 a {
    color: var(--color-text);
    text-decoration: none;
}

.case-card h3 a:hover {
    color: var(--color-primary);
}

.case-parties {
    margin-top: 0.2rem;
    font-size: 0.92rem;
    color: var(--color-text-light);
    font-weight: bold;
}

.case-parties .gegn {
    font-weight: normal;
    margin: 0 0.1rem;
}
.case-parties .case-lawyer-inline {
    font-weight: normal;
}
.case-lawyer-inline a {
    color: var(--color-primary-light);
    text-decoration: none;
}

.case-lawyer-inline a:hover {
    text-decoration: underline;
}

/* Winner highlight in cards */
.case-lawyer-inline .lawyer-won {
    color: var(--color-win);
    font-weight: 600;
}
.party-inline.party-win {
    color: var(--color-win);
    font-weight: 600;
}

/* Winner in verdict preamble */
a.lawyer-ref.lawyer-won {
    color: var(--color-win);
    font-weight: 600;
}

.case-keywords {
    margin-top: 0.4rem;
    font-size: 0.92rem;
    color: var(--color-text-light);
}

.case-summary {
    margin-top: 0.6rem;
    color: var(--color-text);
    font-size: 0.85rem;
    line-height: 1.6;
    padding: 0.6rem 0.9rem;
    background: var(--color-bg);
    border-radius: 4px;
    border-left: 2px solid var(--color-accent);
}

.case-snippets {
    margin-top: 0.6rem;
}

.case-snippets .snippet {
    color: var(--color-text-light);
    font-size: 0.82rem;
    font-style: italic;
    margin: 0.2rem 0;
    line-height: 1.55;
    padding: 0.4rem 0.7rem;
    background: #fdf8ec;
    border-radius: 3px;
    border: 1px solid #ece4c8;
}

.case-snippets .snippet strong {
    color: var(--color-text);
    font-weight: 700;
    font-style: normal;
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--color-text-light);
}

.no-results p:first-child {
    font-size: 1rem;
    margin-bottom: 0.35rem;
}

/* FTS5 match highlighting */
.snippet mark {
    background: #fce68a;
    padding: 0.05rem 0.15rem;
    border-radius: 2px;
    font-style: normal;
    font-weight: 700;
    color: var(--color-text);
}

.back-link {
    display: inline-block;
    color: var(--color-primary);
    text-decoration: none;
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    font-weight: 500;
}

.back-link:hover {
    text-decoration: underline;
}

.back-link::before {
    content: "\2190 ";
}

/* 404 / Not Found page */
.not-found {
    text-align: center;
    padding: 4rem 1rem 3rem;
    max-width: 480px;
    margin: 0 auto;
}
.not-found-icon {
    font-size: 3.5rem;
    line-height: 1;
    margin-bottom: 1.25rem;
    opacity: 0.25;
    font-family: var(--font-heading);
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.04em;
}
.not-found h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
    text-wrap: balance;
}
.not-found p {
    color: var(--color-text-light);
    margin-bottom: 1.5rem;
    line-height: 1.6;
}
.not-found-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}
.not-found-actions a {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.55rem 1.25rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s;
}
.not-found-actions a:active {
    transform: translateY(1px);
}
.not-found-actions .nf-primary {
    background: var(--color-primary);
    color: #fff;
}
.not-found-actions .nf-primary:hover {
    background: var(--color-primary-light);
}
.not-found-actions .nf-secondary {
    background: var(--color-surface);
    color: var(--color-primary);
    border: 1px solid var(--color-border);
}
.not-found-actions .nf-secondary:hover {
    border-color: var(--color-primary-light);
    background: var(--color-bg);
}

/* Nav links */
nav.main-nav {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 0.85rem;
    position: relative;
}

nav.main-nav a {
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 0.82rem;
    font-weight: 500;
    padding: 0.4rem 0;
    position: relative;
    transition: color 0.25s;
    letter-spacing: 0.02em;
}

nav.main-nav a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--color-accent);
    transform: scaleX(0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

nav.main-nav a:hover,
nav.main-nav a:focus-visible {
    color: #fff;
    outline: none;
}

nav.main-nav a:hover::after,
nav.main-nav a:focus-visible::after,
nav.main-nav a.active::after {
    transform: scaleX(1);
}

nav.main-nav a.active {
    color: #fff;
}

/* Page heading */

.page-description {
    color: var(--color-text-light);
    font-size: 0.85rem;
    margin-bottom: 0;
}

/* Compact filter layout */
.compact-filters {
    padding: 0.9rem 1.25rem;
}

.filters-top-row {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    flex-wrap: wrap;
}

.filters-left {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    flex: 1;
    min-width: 0;
}

.filters-left input[type="text"] {
    flex: 1;
    max-width: 220px;
    padding: 0.4rem 0.7rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.82rem;
    font-family: var(--font-body);
}

.filters-left input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(30,58,95,0.06);
}

.filters-bottom-row {
    display: flex;
    align-items: flex-start;
    gap: 0.8rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}
.filters-bottom-row .category-groups {
    flex: 1 1 100%;
    margin-bottom: 0;
}

/* Leaderboard filters */

/* Filter buttons */
.filter-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.filter-btn {
    padding: 0.3rem 0.6rem;
    min-height: 24px;
    min-width: 24px;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    font-size: 0.8rem;
    font-family: var(--font-body);
    cursor: pointer;
    color: var(--color-text);
    transition: background 0.12s, border-color 0.12s;
}

.filter-btn:hover {
    background: var(--color-bg);
    border-color: var(--color-primary-light);
}

.filter-btn:active {
    transform: translateY(1px);
}
.filter-btn.active {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

.filter-btn.disabled,
.filter-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
}

.filter-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin-right: 0.2rem;
}

#observed-category {
    flex: 1 1 auto;
    min-width: 16rem;
    max-width: 100%;
    padding: 0.3rem 0.5rem;
    border: 1.5px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.8rem;
    font-family: var(--font-body);
    background: var(--color-surface);
}

#observed-category:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(30,58,95,0.06);
}

/* Checkbox filter */
.checkbox-filter {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 400;
    user-select: none;
}

.checkbox-filter input[type="checkbox"] {
    width: 0.9rem;
    height: 0.9rem;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.visibility-filter-group {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    flex-wrap: wrap;
    margin-left: auto;
}

.visibility-filter-group .filter-label {
    margin-right: 0;
    white-space: nowrap;
}

.checkbox-filter span {
    white-space: nowrap;
}
.checkbox-filter.disabled {
    opacity: 0.35;
    pointer-events: none;
}

@media (max-width: 980px) {

    .visibility-filter-group {
        margin-left: 0;
        width: 100%;
    }
}

/* Leaderboard table */
.leaderboard-table-wrapper {
    margin-top: 1.25rem;
    overflow-x: auto;
}

.leaderboard-table-wrapper.htmx-loading {
    opacity: 0.4;
    pointer-events: none;
    transition: opacity 0.15s ease;
}

.load-more-cell {
    text-align: center;
    padding: 1.5rem;
}

.load-more-cell .spinner {
    width: 22px;
    height: 22px;
    border-width: 2px;
    margin: 0 auto;
}

.leaderboard-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.leaderboard-table thead {
    background: var(--color-bg);
}

.leaderboard-table th {
    text-align: left;
    padding: 0.65rem 0.5rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.6px;
    color: var(--color-text-light);
    border-bottom: 2px solid var(--color-border);
}

th.sortable {
    cursor: pointer;
    user-select: none;
    transition: color 0.12s;
}

th.sortable:hover {
    color: var(--color-primary);
}

/* Keyboard focus ring for the now-focusable sortable column headers. */
th.sortable:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: -2px;
    color: var(--color-primary);
}

th.sortable.sorted {
    color: var(--color-primary);
}

.sort-arrow {
    font-size: 0.6rem;
    margin-left: 0.2rem;
    vertical-align: middle;
}

.leaderboard-table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    border-bottom: 1px solid var(--color-border);
    line-height: 1.5;
}

.leaderboard-table tbody tr {
    transition: background 0.1s;
}

.leaderboard-table tbody tr:hover {
    background: #f8f7f4;
}

.col-rank {
    width: 2.5rem;
    text-align: center;
    color: var(--color-text-light);
    font-size: 0.8rem;
    font-variant-numeric: tabular-nums;
}

.col-name a {
    color: var(--color-text);
    text-decoration: none;
    font-weight: 500;
}

.col-name a:hover {
    color: var(--color-primary);
}

.icon-corporate {
    width: 14px;
    height: 14px;
    fill: #8b5c2a;
    vertical-align: -2px;
    margin-left: 3px;
    opacity: 0.7;
}

.lmfi-link {
    display: inline-block;
    font-family: var(--font-body);
    margin-left: 0.3rem;
    padding: 0 0.25rem;
    font-size: 0.55rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-primary);
    border-radius: 2px;
    text-decoration: none;
    vertical-align: middle;
    line-height: 1.4;
    opacity: 0.6;
    transition: opacity 0.12s;
}

.lmfi-link:hover {
    opacity: 1;
    text-decoration: none;
}

.col-cases,
 .col-wins,
 .col-losses {
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.col-cases { width: 5.5rem; white-space: nowrap; }
.col-wins, .col-losses { width: 3.5rem; }

.col-wins { color: var(--color-success); }
.col-losses { color: var(--color-error); }

.col-winrate { text-align: center; }
.col-winrate-num { text-align: right; width: 2.5rem; padding-right: 0.25rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.col-winrate-bar { width: 8rem; padding-left: 0.25rem; }

.no-results-cell {
    text-align: center;
    padding: 2rem;
    color: var(--color-text-light);
}

/* Win rate bar */
.win-bar {
    height: 5px;
    background: #eee;
    border-radius: 3px;
    overflow: hidden;
}

.win-bar-fill {
    height: 100%;
    background: var(--color-success);
    border-radius: 3px;
    transition: width 0.3s ease;
}

.win-bar-large {
    height: 6px;
    margin-top: 0.6rem;
    border-radius: 3px;
}

.win-bar-large .win-bar-fill {
    border-radius: 4px;
}

.win-bar-small {
    height: 3px;
    margin-top: 0.4rem;
}

/* Lawyer profile */
.lawyer-profile {
    animation: fadeIn 0.25s ease;
}

.lawyer-header {
    background: var(--color-surface);
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    border: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
}

.lawyer-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1.5rem;
}

.lawyer-header-name {
    flex: 1;
    min-width: 0;
    /* Single source of vertical rhythm: name → subscribe → meta are evenly spaced. */
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
}

.lawyer-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0;
}

.lawyer-header .lmfi-link {
    display: inline-block;
    font-size: 0.85rem;
    font-weight: 700;
    color: #fff;
    background: var(--color-primary);
    padding: 0.22rem 0.55rem;
    border-radius: 999px;
    text-decoration: none;
    vertical-align: middle;
    margin-left: 0.45rem;
    opacity: 0.95;
    line-height: 1.1;
    letter-spacing: 0.02em;
}
.lawyer-header .lmfi-link:hover { opacity: 1; text-decoration: none; background: var(--color-primary-light); }

.subscribe-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-primary);
    background: transparent;
    border: 1.5px solid var(--color-primary);
    border-radius: 999px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    text-decoration: none;
    line-height: 1.2;
}
.subscribe-btn:hover {
    background: var(--color-primary);
    color: #fff;
}
.subscribe-btn.subscribed {
    background: var(--color-primary);
    color: #fff;
}
.subscribe-btn.subscribed:hover {
    background: var(--color-error);
    border-color: var(--color-error);
}
.subscribe-btn.subscribe-login {
    opacity: 0.7;
}
.subscribe-btn.subscribe-login:hover {
    opacity: 1;
}
.subscribe-btn svg {
    flex-shrink: 0;
}

/* MÁL / SIGRAR / TAP — one segmented cluster (joined segments with hairline
   dividers) instead of three floating outlined boxes. */
.lawyer-stats-row {
    display: flex;
    flex-wrap: nowrap;
    flex-shrink: 0;
    align-items: stretch;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.stat-box {
    text-align: center;
    padding: 0.5rem 1.1rem 0.55rem;
    min-width: 4.5rem;
}
.stat-box + .stat-box {
    border-left: 1px solid var(--color-border);
}

.stat-value {
    display: block;
    font-family: var(--font-heading);
    font-size: 1.35rem;
    line-height: 1.2;
    font-weight: 700;
    color: var(--color-text);
    font-variant-numeric: tabular-nums;
}

.stat-win .stat-value { color: var(--color-success); }
.stat-loss .stat-value { color: var(--color-error); }

.stat-clickable {
    cursor: pointer;
    transition: background 0.15s, box-shadow 0.15s;
}

.stat-clickable:hover {
    background: rgba(30, 58, 95, 0.05);
}
.stat-clickable.stat-active {
    background: rgba(30, 58, 95, 0.08);
    box-shadow: inset 0 0 0 2px var(--color-primary);
}

.stat-label {
    display: block;
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-text-light);
    margin-top: 0.05rem;
    font-weight: 600;
}

/* Lawyer details grid (roles, courts, career) */
.lawyer-details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
    gap: 0.6rem;
    margin-bottom: 0.75rem;
    align-items: start;
}

.lawyer-detail-card {
    background: var(--color-surface);
    padding: 0.65rem 0.85rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
}

.lawyer-detail-card-categories {
    grid-column: 1 / -1;
    text-align: center;
}
.lawyer-detail-card-categories h3 {
    text-align: left;
}

.role-tag-clickable {
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.15s, box-shadow 0.15s;
}

.role-tag-clickable:hover {
    opacity: 0.8;
}

.role-tag-clickable.active {
    box-shadow: 0 0 0 2px currentColor;
    opacity: 1;
}

/* Court pills in lawyer profile (bigger than default court-tag) */
#court-filters {
    flex-direction: column;
}
#court-filters .court-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: none;
    letter-spacing: normal;
    align-self: flex-start;
}

.lawyer-detail-card h3 {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-bottom: 0.4rem;
}

/* Lawyer sections (case list) */
.lawyer-section {
    background: var(--color-surface);
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
}

.lawyer-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.5rem;
    padding-bottom: 0.3rem;
    border-bottom: 1px solid var(--color-border);
}

/* Role tags */
.role-tags {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.role-tags-secondary {
    margin-top: 0.5rem;
}

.role-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.3rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: #e8eef6;
    color: var(--color-primary);
}

.role-tag-small {
    padding: 0.15rem 0.4rem;
    font-size: 0.65rem;
}

/* Role pills — same categorical hues as the HLUTVERK breakdown bars (tint bg + role-color
   text), so a role reads identically as pill and as bar. prosecutor/profmal stay neutral. */
.role-tag.role-defense_lawyer { background: #f3edf9; color: #7B4FA6; }
.role-tag.role-defendant_lawyer { background: #ececf8; color: #5158B5; }
.role-tag.role-plaintiff_lawyer { background: #faf0e6; color: #C2702D; }
.role-tag.role-victim_lawyer { background: #f9ecf3; color: #B0487E; }
.role-tag.role-guardian { background: #e7f3f8; color: #2E7E9E; }
.role-tag.role-rettargaeslu_lawyer { background: #eef1f5; color: #607089; }
.role-tag.role-prosecutor,
.role-tag.role-profmal { background: #eef0f3; color: #5c6b7a; }

.role-count {
    background: rgba(0,0,0,0.06);
    padding: 0.05rem 0.35rem;
    border-radius: 999px;
    font-size: 0.65rem;
}

/* Outcome badges */
.outcome-badge {
    display: inline-block;
    padding: 0.1rem 0.36rem;
    border-radius: 3px;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Win/loss = SOLID vivid pills (white text) — a different KIND of badge than the light-tint
   court pills, so SIGUR can't blur into HR-teal nor TAP into LR-wine. Same in light + dark. */
.outcome-win { background: #197a35; color: #fff; }
.outcome-loss { background: #cc2222; color: #fff; }
.outcome-unknown { background: #f0eeea; color: var(--color-text-light); }
.outcome-guardian { background: #eef0f3; color: #5c6b7a; }
.outcome-profmal { background: #eef0f3; color: #5c6b7a; }

/* Profile case list */
.lawyer-profile .case-card {
    padding: 0.75rem 1rem;
}

.lawyer-profile .case-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* License badges */
.license-badge {
    display: inline-block;
    font-family: var(--font-body);
    padding: 0.12rem 0.4rem;
    border-radius: 3px;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    vertical-align: middle;
}

.license-active { background: #e8f2ec; color: var(--color-success); }
.license-hdl { background: #dbe6f5; color: #29589A; }
.license-lrl { background: #f5dde5; color: #8E2F44; }
.license-hrl { background: #d8efed; color: #2f7361; }
.license-inactive { background: #fef3c7; color: #7c6316; }
.license-revoked { background: #f8e8e8; color: var(--color-error); }
.license-retired { background: #f0eeea; color: #888; }
.license-none { background: #e8eef6; color: var(--color-primary); }
.license-corporate { background: #fdf0e0; color: #8b5c2a; }

/* Inactive/retired row styling */
.row-inactive {
    opacity: 0.45;
}

/* Leaderboard extra columns */
.col-info, .col-exp {
    text-align: center;
    width: 3.5rem;
    font-size: 0.8rem;
}

.col-info .license-badge {
    font-size: 0.6rem;
    padding: 0.08rem 0.3rem;
}

/* Lawyer profile meta line */
.lawyer-meta {
    display: flex;
    gap: 0.9rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    font-size: 0.8rem;
    color: var(--color-text-light);
}

.meta-item {
    display: inline-flex;
    align-items: center;
}
.meta-corporate {
    color: #8b5c2a;
}

/* Profile header badge */
.lawyer-header h2 .license-badge {
    font-size: 0.6rem;
    margin-left: 0.4rem;
}

/* Event timeline */
.event-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.event-item {
    display: flex;
    gap: 0.3rem;
    align-items: center;
    padding: 0.2rem 0.4rem;
    background: var(--color-bg);
    border-radius: var(--radius);
    font-size: 0.72rem;
    white-space: nowrap;
}
.event-item.court-hdl { background: #dbe6f5; }
.event-item.court-lrl { background: #f5dde5; }
.event-item.court-hrl { background: #d8efed; }

.event-date {
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
}

.event-type {
    font-weight: 600;
}

.event-license {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    margin-left: auto;
    white-space: nowrap;
}
.court-hdl .event-license { color: #29589A; }
.court-lrl .event-license { color: #8E2F44; }
.court-hrl .event-license { color: #2f7361; }

/* Cases header with filter */
.cases-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.75rem;
}

.cases-header h3 {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.case-filters-panel {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.filter-hint {
    font-size: 0.74rem;
    color: var(--color-text-light);
    font-style: italic;
}

.clear-filters-btn {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.7rem;
    border: none;
    border-radius: var(--radius);
    background: var(--color-error);
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.12s, opacity 0.12s;
}
.clear-filters-btn:hover {
    opacity: 0.85;
}

/* Responsive */
@media (max-width: 768px) {
    .category-tile.category-mobile-hidden {
        display: none;
    }
    .category-tiles.expanded .category-mobile-hidden {
        display: inline-flex;
    }

    .search-container {
        padding: 1rem;
    }

    
    .sort-buttons {
        margin-left: auto;
    }
    .sort-btn {
        flex: 1;
    }

    .case-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.35rem;
    }

    .cases-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .case-filters-panel {
        width: 100%;
        flex-wrap: wrap;
    }

    .filters-bottom-row {
        align-items: flex-start;
    }

    #observed-category {
        min-width: 0;
        width: 100%;
    }

    .visibility-filter-group {
        width: 100%;
        margin-left: 0;
    }

    .lawyer-header-top {
        flex-direction: column;
        gap: 0.75rem;
    }

    .lawyer-stats-row {
        flex-wrap: wrap;
        width: 100%;
    }

    .stat-box {
        flex: 1;
        min-width: calc(25% - 0.375rem);
    }

    .col-winrate-bar, .col-info, .col-exp {
        display: none;
    }

    .leaderboard-table {
        min-width: 340px;
    }

    header h1 {
        font-size: 1.45rem;
    }

    nav.main-nav {
        flex-wrap: wrap;
        gap: 0.15rem 1rem;
        padding: 0 0.25rem;
    }
    .admin-nav-sep {
        display: none;
    }

    /* Mobile: nav tap targets — increase to 44px minimum */
    nav.main-nav a {
        padding: 0.65rem 0.25rem;
    }

    /* Mobile: appeal chain */
    .appeal-chain {
        justify-content: flex-start;
        max-width: 100%;
        overflow-x: auto;
    }
    .appeal-chain__step {
        padding: 0.35rem 0.6rem;
    }
    .appeal-chain__case {
        font-size: 0.9rem;
    }
}

/* ================================================================
   VERDICT PAGE — fonts, layout, preamble, and per-court rendering
   ================================================================ */

/* ── CATEGORY TILES ─────────────────────────────────────────────────
   Pill-shaped buttons on the homepage for browsing by case category
   (e.g. "Sakamál", "Fjármál"). Each group has a label + row of tiles. */

.category-groups {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}
/* The flex row of pill buttons */
.category-tiles {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    justify-content: center;
    max-height: 3.5rem;
    overflow: hidden;
    transition: max-height 0.35s ease;
}
.category-tiles.expanded {
    max-height: 60rem;
}
.category-toggle {
    background: none;
    border: none;
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.15rem 0.5rem;
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    transition: color 0.2s;
}
.category-toggle:hover {
    color: var(--color-primary);
}
.category-toggle .chevron {
    display: inline-block;
    transition: transform 0.35s ease;
    font-size: 0.65rem;
}
.category-toggle.open .chevron {
    transform: rotate(180deg);
}
/* Individual category pill */
.category-tile {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.25rem 0.55rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    font-size: 0.72rem;
    font-family: inherit;
    color: var(--color-text);
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
}
/* Win-rate micro-meter inside the pill: fixed-width track + solid green fill.
   (Replaces the old full-height tint fill, which read as a rendering artifact —
   a visible track makes even a 2% criminal-defence win rate legible as "low".) */
.category-tile-meter {
    display: inline-block;
    width: 26px;
    height: 4px;
    border-radius: 2px;
    background: rgba(0, 0, 0, 0.1);
    overflow: hidden;
    flex-shrink: 0;
}
.category-tile-meter > span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: var(--color-success);
}
.category-tile:hover {
    border-color: var(--color-accent);
    box-shadow: 0 2px 8px rgba(200,155,60,0.15);
    background: #fffdf5;
    transform: translateY(-1px);
}
.category-tile:active {
    transform: translateY(0);
    box-shadow: none;
}
/* Currently selected category */
.category-tile.active {
    border-color: var(--color-primary);
    background: #e0e8f2;
    color: var(--color-primary);
    font-weight: 600;
    box-shadow: 0 0 0 1px var(--color-primary);
}
.category-tile.active .category-tile-count {
    color: var(--color-primary-light);
    background: rgba(30, 58, 95, 0.1);
}
/* Small number badge inside tile showing verdict count */
.category-tile-count {
    font-size: 0.62rem;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
    background: var(--color-bg);
    padding: 0.05rem 0.3rem;
    border-radius: 10px;
}

/* ── LANDING PAGE — newest verdicts list ────────────────────────────
   Shows recent verdicts on the homepage, grouped by court. */

/* ── LANDING PAGE — sidebar + content layout ──────────────────────
   Search/filters in a sticky sidebar, verdicts in the main content area.
   On mobile (≤900px) the sidebar stacks above content. */

main:has(.landing-layout) {
    max-width: 1200px;
}

/* Search bar at top of page, above the sidebar + content layout */
.search-bar-top {
    display: flex;
    gap: 0;
    border: 2px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.25s, box-shadow 0.25s;
    margin-bottom: 1rem;
}

.search-bar-top:focus-within {
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 4px rgba(30,58,95,0.08);
}

.search-bar-top input[type="text"] {
    flex: 1;
    border: none;
    padding: 0.85rem 1rem;
    font-size: 1.05rem;
    font-family: var(--font-body);
    background: var(--color-surface);
    color: var(--color-text);
    outline: none;
}

.search-bar-top input[type="text"]::placeholder {
    color: #b0b0b0;
}

.court-filter-below-search {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.4rem;
    margin-bottom: 1rem;
}

.landing-layout {
    display: flex;
    gap: 1.5rem;
    align-items: flex-start;
}

.search-sidebar {
    width: 300px;
    flex-shrink: 0;
    align-self: flex-start;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
}

.landing-main {
    flex: 1;
    min-width: 0;
}

/* Sidebar filter sections — stacked vertically with dividers */
.sidebar-filters {
    display: flex;
    flex-direction: column;
}

.sidebar-section {
    padding: 0.55rem 0;
}

.sidebar-filters .sidebar-section:not(:last-child) {
    border-bottom: 1px solid var(--color-border);
}

.sidebar-label {
    display: block;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--color-text-light);
    margin-bottom: 0.35rem;
}

.sidebar-input {
    width: 100%;
    padding: 0.4rem 0.6rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-family: var(--font-body);
    font-size: 0.82rem;
    background: var(--color-surface);
    color: var(--color-text);
}

.sidebar-input:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(30,58,95,0.08);
}

.sidebar-input::placeholder {
    color: var(--color-text-light);
    opacity: 0.65;
}

/* Court pills in sidebar — allow wrapping */
.search-sidebar .court-filter-bar {
    flex-wrap: wrap;
    margin-right: 0;
}

/* HD court chips in sidebar — wrap naturally */
.search-sidebar .hd-court-chips {
    margin-top: 0.35rem;
}

/* Date inputs — always visible side by side */
.sidebar-date-row {
    display: flex;
    gap: 0.5rem;
}

.sidebar-date-row .sidebar-input {
    flex: 1;
    min-width: 0;
}

/* Sort buttons in sidebar — stretch full width */
.sidebar-sort {
    width: 100%;
}

.sidebar-sort .sort-btn {
    flex: 1;
}

/* Lagagrein autocomplete wrapper in sidebar */
.lg-autocomplete-wrap {
    position: relative;
    width: 100%;
}

/* Keyword select in sidebar */
.search-sidebar .kw-select {
    width: 100%;
}

/* Keyword select dropdown arrow indicator */
.kw-select-arrow {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--color-text-light);
    pointer-events: none;
}

/* Sidebar section head — label + clear button inline */
.sidebar-section-head {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

/* Sidebar clear filter buttons */
.sidebar-clear {
    background: none;
    border: none;
    color: var(--color-primary-light);
    font-size: 0.65rem;
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    min-height: 24px;
    min-width: 24px;
    font-family: var(--font-body);
    opacity: 0.6;
    transition: opacity 0.15s;
}
.sidebar-clear:hover {
    opacity: 1;
}

/* Clear all button at top of sidebar */
.sidebar-clear-all-row {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 0.3rem;
}
.sidebar-clear-all {
    background: none;
    border: none;
    color: var(--color-primary-light);
    font-size: 0.7rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.15rem 0;
    font-family: var(--font-body);
    opacity: 0.7;
    transition: opacity 0.15s;
}
.sidebar-clear-all:hover {
    opacity: 1;
    text-decoration: underline;
}

/* Category checklist — replaces pill tiles in sidebar */
.category-checklist {
    display: flex;
    flex-direction: column;
    gap: 0;
    max-height: none;
}
.category-check-item {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.25rem 0;
    cursor: pointer;
    font-size: 0.78rem;
    border-bottom: 1px solid rgba(128, 128, 128, 0.08);
    transition: background 0.1s;
}
.category-check-item:last-child {
    border-bottom: none;
}
.category-check-item:hover {
    background: rgba(30, 58, 95, 0.04);
}
.category-check-item input[type="checkbox"] {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
    accent-color: var(--color-primary);
    cursor: pointer;
}
.category-check-label {
    flex: 1;
    min-width: 0;
}
.category-check-count {
    font-size: 0.65rem;
    color: var(--color-text-light);
    font-variant-numeric: tabular-nums;
    flex-shrink: 0;
}

/* Flatpickr overrides — match sidebar styling */
.sidebar-date-row .flatpickr-wrapper {
    flex: 1;
    min-width: 0;
}
.sidebar-date-row .flatpickr-input {
    width: 100%;
}
.flatpickr-calendar {
    font-family: var(--font-body);
    font-size: 0.82rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    background: var(--color-surface);
    width: 280px;
}
.flatpickr-calendar.animate.open {
    -webkit-animation: none;
    animation: none;
}
.flatpickr-days,
.dayContainer {
    width: 280px;
    min-width: 280px;
    max-width: 280px;
}
.flatpickr-months {
    background: var(--color-bg-subtle);
    border-radius: var(--radius) var(--radius) 0 0;
}
.flatpickr-months .flatpickr-month,
.flatpickr-current-month .flatpickr-monthDropdown-months,
.flatpickr-current-month input.cur-year {
    color: var(--color-text);
    font-family: var(--font-body);
    font-weight: 600;
}
.flatpickr-current-month .flatpickr-monthDropdown-months {
    background: transparent;
}
.flatpickr-current-month .flatpickr-monthDropdown-months option {
    background: var(--color-surface);
    color: var(--color-text);
}
.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
    color: var(--color-text-light);
    fill: var(--color-text-light);
}
.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
    color: var(--color-primary);
    fill: var(--color-primary);
}
span.flatpickr-weekday {
    color: var(--color-text-light);
    font-family: var(--font-body);
    font-weight: 500;
    font-size: 0.75rem;
}
.flatpickr-day {
    color: var(--color-text);
    border-radius: var(--radius);
    max-width: 40px;
    height: 36px;
    line-height: 36px;
}
.flatpickr-day:hover,
.flatpickr-day:focus {
    background: var(--color-bg-subtle);
    border-color: var(--color-border);
}
.flatpickr-day.selected,
.flatpickr-day.selected:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}
.flatpickr-day.today {
    border-color: var(--color-primary-light);
}
.flatpickr-day.today:hover {
    background: var(--color-primary-light);
    border-color: var(--color-primary-light);
    color: #fff;
}
.flatpickr-day.flatpickr-disabled,
.flatpickr-day.flatpickr-disabled:hover,
.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
    color: var(--color-text-light);
    opacity: 0.4;
}

/* ── Sidebar categories — vertical list ────────────────────────────
   Each category on its own line with count aligned right. */

.sidebar-categories-section {
    padding-top: 0.55rem;
}

.sidebar-filters .sidebar-categories-section {
    border-bottom: none;
}

.sidebar-categories-section .sidebar-label {
    margin-bottom: 0.25rem;
}


.sidebar-help-link {
    padding-top: 0.55rem;
    text-align: center;
}

.sidebar-help-link a {
    font-size: 0.75rem;
    color: var(--color-muted);
    text-decoration: none;
}

.sidebar-help-link a:hover {
    color: var(--color-primary-light);
}

/* ── Sidebar mobile — collapse to stacked layout ──────────────── */

@media (max-width: 900px) {
    .landing-layout {
        flex-direction: column;
    }

    .search-sidebar {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }

}

/* Makes entire case card clickable (JS adds data-href) */
.case-card[data-href] {
    cursor: pointer;
}

/* Keyword links inside case cards */
.case-keywords a {
    color: var(--color-text-light);
    text-decoration: none;
    transition: color 0.15s;
}
.case-keywords a:hover {
    color: var(--color-primary);
}

/* ── PAGE WIDTH OVERRIDES ───────────────────────────────────────────
   Verdict and law pages need more horizontal space than default 860px. */

/* Verdict page: 1104px matches HR's original haestirettur.is layout */
main:has(.verdict-page) {
    max-width: 1104px;
}

/* Law page: wider to accommodate althingi.is-style law text */
main:has(.law-page) {
    max-width: 1200px;
}

/* Law page with chapter sidebar needs even more room */
main:has(.law-page.has-chapters) {
    max-width: 1400px;
}

/* Fade-in animation when verdict page loads */
.verdict-page {
    animation: fadeIn 0.25s ease;
}

/* Top bar with back button + actions */
.verdict-top-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1rem;
}

/* ── APPEAL CHAIN ───────────────────────────────────────────────────
   Shows the appeal path: "HD → LR → HR" with links to each verdict.
   Displayed inside the verdict card on the verdict page. */

/* ── Appeal chain: court-level progression ── */
.appeal-chain {
    display: flex;
    justify-content: center;
    margin: 0.75rem 0 1.5rem;
    font-family: var(--font-body);
    font-size: 1rem;
    text-align: left;
    -webkit-text-stroke: 0;
}
.appeal-chain__steps {
    display: flex;
    align-items: stretch;
    gap: 0;
}
.appeal-chain__step {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.15rem 1.3rem;
    background: var(--color-surface);
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-primary);
    white-space: nowrap;
    transition: box-shadow 0.15s;
}
.appeal-chain__step:hover,
.appeal-chain__step:focus-visible {
    box-shadow: var(--shadow-md);
    outline: none;
}
.appeal-chain__step.current {
    box-shadow: var(--shadow-md);
    border: 2px solid var(--color-primary);
    border-left: 4px solid var(--color-primary);
    background: #f5f7fa;
}
.appeal-chain__step.current.haestirettur { border-color: #2f7361; border-left-color: #2f7361; }
.appeal-chain__step.current.landsrettur { border-color: #8E2F44; border-left-color: #8E2F44; }
.appeal-chain__step.current.heradsdomstolar { border-color: #29589A; border-left-color: #29589A; }
.appeal-chain__step.haestirettur { border-left-color: #2f7361; }
.appeal-chain__step.landsrettur { border-left-color: #8E2F44; }
.appeal-chain__step.heradsdomstolar { border-left-color: #29589A; }
.appeal-chain__case {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1;
}
.appeal-chain__step.current .appeal-chain__case {
    font-weight: 700;
}
a.appeal-chain__step {
    text-decoration: none;
    cursor: pointer;
}
a.appeal-chain__step .appeal-chain__case {
    color: var(--color-primary);
}
a.appeal-chain__step:hover .appeal-chain__case,
a.appeal-chain__step:focus-visible .appeal-chain__case {
    color: var(--color-primary-light);
}
.appeal-chain__arrow {
    display: flex;
    align-items: center;
    padding: 0 0.5rem;
    color: var(--color-text-muted);
    opacity: 0.3;
    font-size: 0.85rem;
}
.appeal-chain__arrow::before {
    content: '\203A';
    font-size: 1.2rem;
    line-height: 1;
}
.appeal-chain__arrow::after {
    display: none;
}
.appeal-chain__slash {
    display: flex;
    align-items: center;
    padding: 0 0.15rem;
    color: var(--color-text-muted);
    opacity: 0.4;
    font-size: 0.8rem;
}

/* ── Appeal chain: mobile ─────────────────────────────────────── */
@media (max-width: 768px) {
    .appeal-chain {
        justify-content: flex-start;
        overflow-x: auto;
    }
}

/* ================================================================
   VERDICT PREAMBLE — shared by all courts (HR, LR, HD)
   ================================================================
   The structured header above the verdict text: court name, case number,
   date, parties, lawyers, keywords, and summary. Rendered from parsed
   metadata, not from the raw verdict text. Used on both /domur/{id}
   metadata, not from the raw verdict text. */

/* Outer container — left-aligned with padding to match body text indent */
.verdict-preamble {
    max-width: 657px;
    margin-left: auto;
    margin-right: auto;
    padding: 40px 0 20px;
    line-height: 1.38;
    text-align: left;
}

.verdict-preamble .hr-crest {
    display: block;
    width: 192px;
    height: auto;
    margin: 0 auto 12px;
}

.verdict-preamble .court-cover-logo {
    display: block;
    max-width: 240px;
    max-height: 160px;
    width: auto;
    height: auto;
    margin: 0 auto 16px;
    opacity: 0.85;
}

.verdict-preamble.has-cover-logo {
    padding-top: 48px;
}

.verdict-preamble p {
    margin: 0;
    padding: 0;
}

/* "Landsréttur" / "Héraðsdómur Reykjavíkur" centered title */
.verdict-preamble .court-title {
    text-align: center;
    font-weight: 700;
    font-size: 1.3em;
    letter-spacing: 0.05em;
    margin: 0;
    padding-bottom: 28px;
}
.verdict-preamble .court-title.court-landsrettur {
    font-size: 1.15em;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.verdict-preamble .rettargaesla-block {
    padding-top: 14px;
}

/* "Föstudaginn 14. mars 2026" */
.verdict-preamble .date-line {
    padding-bottom: 12px;
}

/* Block containing plaintiff + gegn + defendant */
.verdict-preamble .parties-block {
    padding-bottom: 20px;
}

/* Bold party name like "Íslandsbanki hf." */
.verdict-preamble .party-name {
    font-weight: bold;
}
.verdict-preamble .party-name.party-win {
    color: var(--color-win);
}

/* Italic lawyer attribution under party name */
.verdict-preamble .party-lawyers {
    font-style: italic;
}
.verdict-preamble .party-lawyers .lawyer-won {
    color: var(--color-win);
    font-weight: 600;
    font-style: normal;
}

/* Lawyer name links to /logmenn/{id} profile */
.verdict-preamble .party-lawyers a {
    color: var(--color-primary);
    text-decoration: none;
}

.verdict-preamble .party-lawyers a:hover {
    text-decoration: underline;
}

/* "gegn" (versus) between plaintiff and defendant */
.verdict-preamble .gegn {
    font-weight: bold;
}

/* Section labels like "Lykilorð:" or "Útdráttur:" */
.verdict-preamble .section-label {
    font-weight: bold;
    font-style: italic;
    padding-top: 0;
}

/* Section body text (the summary or keyword list text) */
.verdict-preamble .section-text {
    font-style: italic;
    padding-bottom: 16px;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Links inside section text (e.g. law references in summary) */
.verdict-preamble .section-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-style: italic;
}

.verdict-preamble .section-text a:hover {
    text-decoration: underline;
}

/* Court badge pill in the preamble */
.verdict-preamble .court-tag {
    margin-bottom: 0.75rem;
}

/* Case number heading like "Mál nr. 47/2024" */
.preamble-case {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--color-text);
    margin-top: 0.75rem;
    margin-bottom: 0.25rem;
}

/* Date below case number */
.preamble-date {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-light);
    margin-bottom: 1.25rem;
}

/* Parties container */
.preamble-parties {
    margin: 1rem 0;
}

/* One party row */
.preamble-party {
    margin-bottom: 0.2rem;
}

/* Party name */
.preamble-party strong {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-text);
}

/* Lawyer name under party */
.preamble-lawyer {
    display: block;
    font-size: 0.82rem;
    color: var(--color-text-light);
    margin-top: 0.1rem;
}

/* "gegn" separator between parties */
.preamble-gegn {
    font-size: 0.85rem;
    font-style: italic;
    color: var(--color-text-light);
    margin: 0.6rem 0;
}

/* Horizontal rule dividing preamble sections */
.preamble-hr {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1rem 0;
}

/* Keyword / summary sections */
.preamble-section {
    text-align: left;
}

/* Section heading like "LYKILORÐ" */
.preamble-section h3 {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Bullet list of keywords */
.preamble-keywords {
    list-style: disc;
    padding-left: 1.25rem;
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.6;
}

.preamble-keywords li {
    margin-bottom: 0.15rem;
}

.preamble-keywords a {
    color: var(--color-primary);
    text-decoration: none;
}

.preamble-keywords a:hover {
    text-decoration: underline;
}

/* Italic summary / reifun text */
.preamble-summary {
    font-size: 0.85rem;
    color: var(--color-text);
    line-height: 1.75;
    font-style: italic;
}

/* "Skoða á vef dómstólsins" link button */
.verdict-external-link {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    font-size: 0.78rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    background: white;
    transition: all 0.15s;
}
.verdict-external-link svg {
    flex-shrink: 0;
}

.verdict-external-link:hover,
.verdict-external-link:focus-visible {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.verdict-external-link:active {
    transform: translateY(1px);
}
.verdict-pdf-link {
    margin-left: 0.5rem;
}
.save-verdict-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    margin-left: auto;
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 500;
    line-height: inherit;
    color: var(--color-primary);
    background: white;
    border: 1px solid var(--color-border);
    padding: 0.3rem 0.75rem;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.15s;
}
.save-verdict-btn:hover,
.save-verdict-btn:focus-visible {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.save-verdict-btn.saved {
    background: var(--color-primary);
    color: white;
    border-color: var(--color-primary);
}
.save-verdict-btn.saved:hover {
    background: var(--color-error);
    border-color: var(--color-error);
}
.save-verdict-btn svg {
    flex-shrink: 0;
}

/* ================================================================
   LR / HD — PDF-sourced verdicts ("golden format")
   ================================================================
   Landsréttur and Héraðsdómstólar verdicts come from PDFs converted
   to structured HTML. Font: Times New Roman 20.5px. The ".verdict-body"
   container holds everything. Structure:
   .verdict-body > .verdict-head + .verdict__keywords + .verdict__reifun + .verdict__body

   When an LR verdict includes the original HD verdict below it,
   a <p class="heradsdomar-title"> marks the start, and everything after
   gets smaller font (15px ≈ HD's 10pt PDF) and tighter line-height (1.45). */

/* Main container — white box, centered, TNR matching landsrettur.is PDF */
.verdict-body {
    background: #fff;
    text-align: justify;
    font-family: var(--font-verdict);
    font-size: 19.5px;
    padding: 0;
    max-width: 941px;
    margin: 0 auto;
    -webkit-text-stroke: 0.3px currentColor;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* HD typographic profile — CSS custom properties driven by real PDF measurements.
   Values are RATIOS derived from the profile, NOT raw PDF pt values.
   The base font-size (20.5px) stays as-is for screen reading. */
.verdict-body.court-heradsdomstolar {
    --hd-indent: 2.95em;          /* 35.4pt / 12pt — measured from 2023+ PDFs */
    --hd-heading-scale: 1.42;     /* 16.98pt / 12pt body size */
}

/* ── LR/HD: Header (case info above the verdict text) ───────────── */

/* Contains case number subtitle + date + parties */
.verdict-body .verdict-head {
    max-width: 657px;
    margin-left: auto;
    margin-right: auto;
    text-align: left;
    padding: 28px 0 0;
    line-height: 1.38;
}

/* Bold case description like "Mál nr. 171/2026" */
.verdict-body .verdict-head__subtitle {
    font-weight: bold;
    line-height: 1.38;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 0 0 4px;
}

/* Date line like "Fimmtudaginn 6. mars 2026" */
.verdict-body .verdict-head__time {
    display: block;
    line-height: 1.38;
    color: rgb(0, 0, 0);
    margin: 0;
    padding-bottom: 12px;
}

/* ── LR/HD: Parties (plaintiff vs defendant) ────────────────────── */

/* Plaintiff/defendant name block — bold, left-aligned */
.verdict-body .plaintiffs {
    line-height: 1.38;
    color: rgb(0, 0, 0);
    text-align: left;
    margin: 0;
    padding: 0;
    font-weight: bold;
}

/* "gegn" (versus) between parties */
.verdict-body .gegn {
    display: block;
    text-align: left;
    font-weight: bold;
    line-height: 1.38;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 0;
}

/* Lawyer attribution under party names — italic, normal weight */
.party-lawyers {
    display: block;
    font-weight: normal;
    font-style: italic;
    color: rgb(0, 0, 0);
    margin: 0;
}
/* Lawyer title like "hrl." or "lögmaður" */
.lawyer-title {
    font-style: normal;
}
/* "í eigin nafni" — when someone represents themselves */
.sjalfur-inline {
    color: var(--color-text-light);
    font-style: italic;
}

/* ── LR/HD: Separators ──────────────────────────────────────────── */

/* Thin gray line between preamble sections */
.verdict-body > hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 16px 0;
}

/* ── LR/HD: Keywords section ────────────────────────────────────── */
/* "Lykilorð:" followed by inline keyword list */

.verdict-body .verdict__keywords {
    max-width: 657px;
    margin: 10px auto 0;
    padding: 0;
}

/* "Lykilorð:" / "Útdráttur:" heading — bold italic */
.verdict-body .verdict__keywords h3,
.verdict-body .verdict__reifun h3 {
    font-weight: bold;
    font-style: italic;
    line-height: 1.38;
    color: rgb(0, 0, 0);
    margin: 0;
    padding-bottom: 2px;
}

/* Keyword list — no bullets, displayed inline */
.verdict-body .verdict__keywords ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Each keyword — inline with period separators added via ::after */
.verdict-body .verdict__keywords li {
    display: inline;
    font-style: italic;
    line-height: 1.38;
    color: rgb(0, 0, 0);
}

/* Period + space after each keyword */
.verdict-body .verdict__keywords li::after {
    content: ". ";
}

/* Last keyword just gets a period, no trailing space */
.verdict-body .verdict__keywords li:last-child::after {
    content: ".";
}

/* Keyword links — inherit color by default */
.verdict-body .verdict__keywords a {
    color: inherit;
    text-decoration: none;
}

.verdict-body .verdict__keywords a:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

/* ── LR/HD: Reifun / Útdráttur (summary) ───────────────────────── */
/* Italic paragraph summarizing the case, shown above the body text */

.verdict-body .verdict__reifun {
    max-width: 657px;
    margin: 10px auto 0;
    padding: 0;
}

/* Generic italic text class used in reifun/summary blocks */
.verdict-body .text-italic {
    line-height: 1.38;
    font-style: italic;
    color: rgb(0, 0, 0);
    text-align: justify;
    margin: 0;
    padding: 0;
}

/* ── LR/HD: Main verdict body text ──────────────────────────────── */
/* The actual verdict content. Left padding (3.5em) makes room for
   paragraph numbers positioned in the margin via CSS counters.
   line-height set here once — all children (p, li, h1, h2, etc.) inherit it. */

.verdict-body .verdict__body {
    max-width: 657px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 0 22px;
    line-height: 1.5;
    word-spacing: -0.5px;
}

/* "D Ó M U R" or "Ú R S K U R Ð U R" — centered main heading */
.verdict-body .verdict__body h1 {
    font-size: inherit;
    font-weight: bold;
    font-style: normal;
    text-align: center;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 12px 0 10px;
}

/* Section headings like "Málavextir" or "Niðurstaða" */
.verdict-body .verdict__body h2 {
    font-size: inherit;
    font-weight: bold;
    font-style: normal;
    text-align: left;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 16px 0 6px;
}

/* Regular paragraph text — justified with auto-hyphens */
.verdict-body .verdict__body p {
    color: rgb(0, 0, 0);
    text-align: justify;
    margin: 0;
    padding: 0 0 0.5em;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* Smaller-than-body text (e.g. 10pt M: case reference numbers in 12pt body) */
.verdict-body .verdict__body .small-text {
    font-size: 0.833em;
}

/* Judge name at end of verdict — centered */
.verdict-body .verdict__body .judge-name {
    text-align: center;
    padding-top: 12px;
}

/* Numbered paragraph (older format using inline spans instead of ol/li) */
.verdict-body .verdict__body p.numbered {
    margin: 0;
    padding: 0 0 12px 0;
}

/* The paragraph number itself — positioned in the left margin */
.verdict-body .verdict__body .para-num {
    display: inline-block;
    width: 4em;
    margin-left: -4em;
    text-align: right;
    padding-right: 0.9em;
    white-space: nowrap;
    color: rgb(96, 96, 96);
    font-size: 0.833em;
    vertical-align: baseline;
}

/* ── LR/HD: Tables inside verdict text ──────────────────────────── */
/* Occasionally verdicts contain financial tables */

.verdict-body .verdict__body .verdict-table {
    border-collapse: collapse;
    margin: 12px 0 12px 4em;
    max-width: calc(100% - 4em);
    font-size: 0.95em;
}

.verdict-body .verdict__body .verdict-table th,
.verdict-body .verdict__body .verdict-table td {
    padding: 3px 16px 3px 0;
    text-align: left;
    vertical-align: top;
}

.verdict-body .verdict__body .verdict-table th {
    font-weight: 600;
    border-bottom: 1px solid #ccc;
    padding-bottom: 4px;
}

/* Right-align last column (usually amounts) */
.verdict-body .verdict__body .verdict-table td:last-child,
.verdict-body .verdict__body .verdict-table th:last-child {
    text-align: right;
    padding-right: 0;
}

/* ── LR/HD: Headings — alignment variants ───────────────────────── */

.verdict-body .verdict__body h2:not(.centered) {
    padding-left: 0;
}

/* Centered h2 (rare, used in some conclusions) */
.verdict-body .verdict__body h2.centered {
    text-align: center;
}

/* Centered h2 AFTER HD title = HD section heading */
.verdict-body .verdict__body .heradsdomar-title ~ h2.centered {
    text-align: center;
    font-weight: bold;
    font-style: normal;
}

/* Roman numeral sub-headings like "I.", "II." — centered.
   font-weight: normal — bold comes from <strong> tag when the PDF has it. */
.verdict-body .verdict__body h3.roman-numeral {
    font-size: inherit;
    font-weight: normal;
    line-height: 1.38;
    text-align: center;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 12px 0 0;
}

/* First-line indented paragraphs (HD style, no bottom gap) */
.verdict-body .verdict__body p.first-indent {
    text-indent: 2.5em;
    padding-bottom: 0;
}
.verdict-body .verdict__body p.para-break {
    margin-top: 1.4em;
}
/* First body paragraph (judge intro) is never indented */
.verdict-body .verdict__body > p.first-indent:first-child {
    text-indent: 0;
}
/* Verdict conclusion lines after Úrskurðarorð/Dómsorð: no indent, restore spacing */
.verdict-body .verdict__body .urskardarord + p,
.verdict-body .verdict__body .urskardarord-spaced + p,
.verdict-body .verdict__body .urskardarord + p + p,
.verdict-body .verdict__body .urskardarord-spaced + p + p,
.verdict-body .verdict__body .urskardarord + p + p + p,
.verdict-body .verdict__body .urskardarord-spaced + p + p + p {
    text-indent: 0;
    padding-bottom: 12px;
}
.verdict-body.court-heradsdomstolar .verdict__body p.first-indent {
    text-indent: var(--hd-indent);
}

/* Sub-items like i), ii) — hanging indent matching PDF layout */
.verdict-body .verdict__body p.sub-item {
    padding-left: 5em;
    text-indent: -5em;
    padding-bottom: 0;
}

/* ── LR: HD section title and content ──────────────────────────── */
/* The heradsdomar-title marks the start of the appended HD verdict.
   Same font-size and line-height as the LR text above — no visual distinction. */

/* ── LR/HD: Blockquotes (citations from other verdicts/laws) ────── */

.verdict-body .verdict__body blockquote {
    margin: 0;
    padding: 0 40px 12px;
    border: none;
    line-height: 1.5;
    text-align: justify;
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* ── LR/HD: Section headings (bold paragraph variant) ───────────── */
/* Used when the PDF has bold section titles that aren't true headings */

.verdict-body .verdict__body .section-heading {
    font-weight: bold;
    font-size: inherit;
    text-align: left;
    color: rgb(0, 0, 0);
    margin: 0;
    padding: 0.6em 0 0;
}

/* Numbered heading tab-stop: "1     Ákæra dagsett..." — matches Word tab formatting */
.verdict-body .verdict__body .section-heading .heading-num {
    display: inline-block;
    min-width: 2em;
}

/* Italic section headings — preserve italic from PDF instead of forcing bold */
.verdict-body .verdict__body .section-heading.italic {
    font-weight: normal;
    font-style: italic;
}

/* Underlined italic headings (e.g. "Ákæruliðir", "Brotaþoli") */
.verdict-body .verdict__body .section-heading.italic.underline {
    text-decoration: underline;
}

/* Italic section headings ("Skýrslur fyrir dómi", "Ákvörðun refsingar", etc.)
   — same top spacing as bold headings, italic preserved from <em> tags */
.verdict-body .verdict__body .italic-heading {
    margin: 0;
    padding: 0.6em 0 0;
}

/* ── LR/HD: Numbered paragraphs (CSS counter method) ───────────── */
/* Modern golden format: <ol> with counter-reset in HTML, <li> items
   auto-numbered via CSS counters. Numbers sit in the left margin. */

/* Remove default ol numbering — we use CSS counters instead */
.verdict-body .verdict__body ol {
    padding-left: 0;
    margin: 0.2em 0 0;
    list-style: none;
}

/* Each paragraph — counter auto-increments */
.verdict-body .verdict__body li {
    margin-bottom: 0.5em;
    text-align: justify;
    position: relative;
    counter-increment: item;
    color: rgb(0, 0, 0);
    hyphens: auto;
    -webkit-hyphens: auto;
}

/* The paragraph number — positioned in the left margin */
.verdict-body .verdict__body li::before {
    content: counter(item);
    position: absolute;
    left: -2.5em;
    top: 0;
    width: 1.5em;
    text-align: right;
    color: rgb(96, 96, 96);
    font-size: inherit;
}
/* HD: some verdicts indent numbered charges as a block — applied via class */
.verdict-body .verdict__body ol.indented-charges {
    padding-left: var(--hd-indent, 2.95em);
}
/* LR: numbers always in the page margin, never indented */
.verdict-body.court-landsrettur .verdict__body ol.indented-charges {
    padding-left: 0;
}
.verdict-body.court-heradsdomstolar .verdict__body li::before {
    content: counter(item) ".";
}

/* Continuation paragraphs inside <li> — match the numbered text flow */
.verdict-body .verdict__body li > p {
    margin-top: 0.15em;
    padding-bottom: 0;
}
.verdict-body .verdict__body li > p.para-break {
    margin-top: 0.8em;
}

/* ── LR/HD: Verdict conclusion ("Úrskurðarorð" / "Dómsorð") ────── */
/* Centered bold heading above the final ruling */

.verdict-body .verdict__body .urskardarord {
    text-align: center;
    font-weight: bold;
    font-size: inherit;
    letter-spacing: 0.08em;
    color: rgb(0, 0, 0);
    margin: 1em 0 0;
    padding: 0 0 4px;
}

/* Spaced-letter variant: "D Ó M S O R Ð" */
.verdict-body .verdict__body .urskardarord-spaced {
    text-align: center;
    font-weight: bold;
    letter-spacing: 0.2em;
    font-size: inherit;
    color: rgb(0, 0, 0);
    margin: 1em 0 0;
    padding: 0 0 4px;
}

/* ── LR/HD: Appended lower court title ──────────────────────────── */
/* When LR includes the original HD verdict, this heading separates them */

.verdict-body .verdict__body .heradsdomar-title {
    text-align: center;
    font-weight: bold;
    font-size: inherit;
    color: rgb(0, 0, 0);
    margin: 2em 0 1em;
    padding: 0;
}

/* Centered text (judge intro paragraphs, etc.) */
.verdict-body .verdict__body p.centered {
    text-align: center;
}

/* ── LR/HD: Links in verdict text ───────────────────────────────── */
/* Law references and case number cross-links */

.verdict-body .verdict__body a {
    color: var(--color-primary);
    text-decoration: none;
}

.verdict-body .verdict__body a:hover {
    text-decoration: underline;
}

/* ── LR/HD: Generic tables ──────────────────────────────────────── */

.verdict-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 0 0 12px;
}

.verdict-body th, .verdict-body td {
    padding: 4px 8px;
    border: 1px solid #ddd;
    text-align: left;
    font-size: 14px;
}

/* Footer link to original court website */

/* ── HD section within LR verdicts ──────────────────────────────────
   Styled via .heradsdomar-title ~ * rules above (18px, line-height 1.45).
   Section headings after the HD title are italic. */

.verdict-body .verdict__body .heradsdomar-title ~ h2 {
    font-weight: normal;
    font-style: italic;
}

/* ── LR/HD: Mobile ──────────────────────────────────────────────── */

@media (max-width: 600px) {
    .verdict-body {
        font-size: 18px;
    }
    .verdict-body .verdict-head {
        padding: 24px 20px 0;
    }
    .verdict-preamble {
        padding: 40px 20px 20px;
    }
    .verdict-body .verdict__keywords,
    .verdict-body .verdict__reifun {
        padding: 0 20px;
    }
    .verdict-body .verdict__body {
        padding: 12px 20px 22px 3em;
    }
    
}

/* ================================================================
   HR — Native HTML from haestirettur.is (island.is style)
   ================================================================
   Hæstiréttur verdicts are scraped as HTML directly from the court
   website. Font: IBM Plex Sans (matching island.is /dómar), via
   --hr-font var. Body text is 18px weight 300, headings 600 weight
   at 24–42px. Color rgb(0,0,60) dark navy. 876px text column. */

/* Container — sets CSS custom property for the HR font family */
.verdict-native {
    --hr-font: 'IBM Plex Sans', 'San Francisco', 'Segoe UI', sans-serif;
    margin: 0 auto;
}

/* Inner verdict box */
.verdict-native .verdict {
    font-family: var(--hr-font);
    font-size: 18px;
    font-weight: 300;
    color: rgb(0, 0, 60);
    padding: 0;
    max-width: 876px;
    margin: 0 auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── HR: Header (centered) ─────────────────────────────────────── */

.verdict-native .verdict-head {
    text-align: center;
    max-width: 774px;
    margin-left: auto;
    margin-right: auto;
    padding: 42px 0 0;
}

/* Court crest image */
.verdict-native .verdict-head__image {
    width: 180px;
    height: auto;
    display: block;
    margin: 0 auto 12px;
}

/* "Hæstiréttur" title matching island.is typography */
.verdict-native .verdict-head__title {
    font-family: var(--hr-font);
    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;
    text-transform: none;
    color: rgb(0, 0, 60);
    margin: 0;
    padding-bottom: 8px;
}

/* Case description like "Mál nr. 48/2025" matching island.is 24px/semibold */
.verdict-native .verdict-head__subtitle {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    margin: 0;
    padding: 20px 0;
}

/* Date matching island.is 18px/light */
.verdict-native .verdict-head__time {
    display: block;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    margin: 0;
    padding-bottom: 20px;
}

/* ── HR: Parties ───────────────────────────────────────────────── */

.verdict-native .appelants,
.verdict-native .plaintiffs {
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    text-align: center;
    margin: 0 0 20px;
    padding: 0;
}

.verdict-native .plaintiffs:last-child {
    margin-bottom: 0;
}

/* "gegn" matching island.is 18px/light/lowercase */
.verdict-native .gegn {
    display: block;
    text-align: center;
    font-size: 18px;
    font-weight: 300;
    line-height: 1.5;
    text-transform: none;
    color: rgb(0, 0, 60);
    margin: 0 0 20px;
    padding: 0;
}

/* ── HR: Separators ────────────────────────────────────────────── */

.verdict-native hr {
    border: 0;
    border-top: 1px solid #ddd;
    margin: 22px 0;
}

/* ── HR: Keywords section ──────────────────────────────────────── */

.verdict-native .verdict__keywords {
    max-width: 684px;
    margin: 32px auto 0;
    padding: 0;
}

/* Section headings — semibold, matching island.is 20px */
.verdict-native .verdict__keywords h3,
.verdict-native .verdict__reifun h3 {
    font-size: 20px;
    font-weight: 600;
    line-height: 30px;
    color: rgb(0, 0, 60);
    margin: 0;
    padding-bottom: 0;
}

.verdict-native .verdict__keywords ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Keywords displayed inline with period separators (matching island.is) */
.verdict-native .verdict__keywords li {
    display: inline;
    font-size: 18px;
    line-height: 1.5;
    color: rgb(0, 0, 60);
}

.verdict-native .verdict__keywords li::after {
    content: ". ";
}

.verdict-native .verdict__keywords li:last-child::after {
    content: none;
}

.verdict-native .verdict__keywords a {
    color: inherit;
    text-decoration: none;
}

.verdict-native .verdict__keywords a:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

/* ── HR: Reifun (summary) ──────────────────────────────────────── */

.verdict-native .verdict__reifun {
    max-width: 684px;
    margin: 10px auto 0;
    padding: 0;
}

/* Summary text (island.is no longer renders reifun in italic) */
.verdict-native .text-italic {
    font-size: 18px;
    line-height: 1.5;
    font-style: normal;
    color: rgb(0, 0, 60);
    text-align: justify;
    margin: 0;
    padding: 0;
}

/* ── HR: Main verdict body text ────────────────────────────────── */

.verdict-native .verdict__body {
    max-width: 876px;
    margin-left: auto;
    margin-right: auto;
    padding: 12px 0 22px;
    line-height: 1.5;
}

/* "Dómur Hæstaréttar." — large centered heading */
.verdict-native .verdict__body h1 {
    font-size: 42px;
    font-weight: 600;
    line-height: 1.25;
    text-align: center;
    color: rgb(0, 0, 60);
    margin: 0 0 16px;
    padding: 0;
}

/* Section headings like "Málavextir" */
.verdict-native .verdict__body h2 {
    font-size: 34px;
    font-weight: 600;
    line-height: 1.25;
    text-align: start;
    color: rgb(0, 0, 60);
    margin: 48px 0 16px;
    padding: 0;
}

/* Centered h2 variant */
.verdict-native .verdict__body .h2--center {
    text-align: center;
}

/* Subsection headings */
.verdict-native .verdict__body h3 {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    margin: 8px 0 16px;
    padding: 0;
}

/* Regular body paragraph */
.verdict-native .verdict__body p {
    font-size: inherit;
    font-weight: 300;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    text-align: justify;
    margin: 14px 0;
    padding: 0;
}

/* ── HR: Blockquotes (indented citations from laws/other verdicts) ── */

.verdict-native .verdict__body blockquote {
    font-size: inherit;
    font-weight: 300;
    line-height: 1.5;
    color: rgb(0, 0, 60);
    text-align: justify;
    margin: 14px 0;
    padding: 0 40px;
}

/* ── HR: Links ─────────────────────────────────────────────────── */

.verdict-native .verdict__body a {
    color: var(--color-primary);
    text-decoration: none;
}

.verdict-native .verdict__body a:hover {
    text-decoration: underline;
}

/* Footer link to haestirettur.is under the verdict */

/* ── HR: Mobile ────────────────────────────────────────────────── */

@media (max-width: 768px) {
    .verdict-native .verdict {
        padding: 10px;
    }
    .verdict-native .verdict-head {
        padding: 24px 0 0;
    }
    .verdict-native .verdict__body {
        padding: 12px 0 22px;
    }
    .verdict-native .verdict-head__title {
        font-size: 26px;
    }
    .verdict-native .verdict-head__subtitle {
        font-size: 20px;
    }
    .verdict-native .verdict-head__time {
        font-size: 16px;
    }
    .verdict-native .appelants,
    .verdict-native .plaintiffs {
        font-size: 16px;
        line-height: 1.5;
    }
    .verdict-native .gegn {
        font-size: 16px;
    }
    .verdict-native .verdict__body h1 {
        font-size: 28px;
    }
    .verdict-native .verdict__body h2 {
        font-size: 24px;
        margin-top: 32px;
    }
    .verdict-native .verdict__body h3 {
        font-size: 20px;
    }
    .verdict-native .verdict__body blockquote {
        padding: 0 20px;
    }
}

/* ── Legal reference tooltips ─────────────────────────────── */

.law-ref {
    color: inherit;
    border-bottom: 1px dotted #6c8ebf;
    cursor: pointer;
}

.law-ref:hover,
.law-ref:focus-visible {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    border-bottom-style: solid;
    outline: none;
}

.reg-ref {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #6c8ebf;
    cursor: pointer;
}

.reg-ref:hover,
.reg-ref:focus-visible {
    color: #1a73e8;
    border-bottom-color: #1a73e8;
    border-bottom-style: solid;
    outline: none;
}

.lawyer-ref {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #7a9a6e;
}

.lawyer-ref:hover {
    color: #2e7d32;
    border-bottom-color: #2e7d32;
    border-bottom-style: solid;
}

.verdict-ref {
    color: inherit;
    text-decoration: none;
    border-bottom: 1px dotted #5c7cba;
}

.verdict-ref:hover {
    color: #1565c0;
    border-bottom-color: #1565c0;
    border-bottom-style: solid;
}

.law-tooltip {
    position: fixed;
    max-width: 480px;
    min-width: 280px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px 20px;
    box-shadow: var(--shadow-md);
    font-size: 14px;
    line-height: 1.55;
    z-index: 1000;
    pointer-events: auto;
}

@media (max-width: 600px) {
    .law-tooltip {
        max-width: calc(100vw - 24px);
        min-width: 0;
        padding: 14px 16px;
    }
}

.law-tooltip .tooltip-header {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 13px;
    color: var(--color-primary);
    font-family: var(--font-heading);
}

.law-tooltip .tooltip-gr {
    color: var(--color-primary);
}

.law-tooltip .tooltip-law-title {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 8px;
}

.law-tooltip .tooltip-text {
    color: var(--color-text);
    margin-bottom: 10px;
    white-space: pre-wrap;
    max-height: 50vh;
    overflow-y: auto;
    font-family: 'Droid Serif', Georgia, serif;
}

.law-tooltip .tooltip-truncated {
    font-size: 12px;
    color: var(--color-text-light);
    font-style: italic;
    margin-bottom: 8px;
}

.law-tooltip .tooltip-error {
    color: var(--color-text-light);
    font-style: italic;
}

/* ── Verdict reference tooltip ── */

.verdict-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.verdict-tooltip-date {
    font-size: 12px;
    color: var(--color-text-light);
}

.verdict-tooltip-case {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-primary);
    margin-bottom: 6px;
    font-family: var(--font-heading);
}

.verdict-tooltip-parties {
    font-size: 13px;
    color: var(--color-text);
    margin-bottom: 6px;
    line-height: 1.4;
}

.verdict-tooltip-parties .gegn {
    font-style: italic;
    color: var(--color-text-light);
}

.verdict-tooltip-keywords {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 6px;
}

.verdict-tooltip-summary {
    font-size: 13px;
    color: var(--color-text);
    line-height: 1.5;
    border-top: 1px solid var(--color-border);
    padding-top: 8px;
    margin-top: 4px;
}

/* ── Lawyer tooltip ─────────────────────────────────────── */

.lawyer-tooltip-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lawyer-tooltip-name {
    font-weight: 700;
    font-size: 14px;
    color: var(--color-primary);
    font-family: var(--font-heading);
}

.lawyer-tooltip-license {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    padding: 1px 6px;
}

.lawyer-tooltip-active {
    color: #2e7d32;
    font-size: 10px;
    line-height: 1;
}

.lawyer-tooltip-stats {
    font-size: 13px;
    color: var(--color-text);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.lawyer-tooltip-sep {
    color: var(--color-text-light);
}

.lawyer-tooltip-wins {
    color: #2e7d32;
}

.lawyer-tooltip-losses {
    color: #c62828;
}

.lawyer-tooltip-bar-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.lawyer-tooltip-bar {
    flex: 1;
    height: 6px;
    background: #e8e8e8;
    border-radius: 3px;
    overflow: hidden;
}

.lawyer-tooltip-bar-fill {
    height: 100%;
    background: #2e7d32;
    border-radius: 3px;
    transition: width 0.2s;
}

.lawyer-tooltip-pct {
    font-size: 12px;
    font-weight: 600;
    color: var(--color-text);
    min-width: 32px;
    text-align: right;
}

.lawyer-tooltip-meta {
    font-size: 12px;
    color: var(--color-text-light);
    margin-bottom: 4px;
}

.lawyer-tooltip-cats {
    font-size: 12px;
    color: var(--color-text-light);
    border-top: 1px solid var(--color-border);
    padding-top: 6px;
    margin-top: 4px;
}

/* ── Heimildarskrá (bibliography) ─────────────────────────── */

/* ── Heimildaskrá (bibliography) ──────────────────────────── */

.heimildaskra {
    max-width: 860px;
    margin: 2.5rem auto 1rem;
    padding-top: 1.5rem;
    border-top: 2px solid color-mix(in srgb, var(--color-border) 60%, transparent);
    font-family: var(--font-body);
    font-size: 0.875rem;
    color: var(--color-text);
    line-height: 1.5;
}

.heimildaskra-title {
    font-family: var(--font-heading);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin: 0 0 1.25rem;
}

.heimildaskra-group {
    margin-bottom: 1.25rem;
}

.heimildaskra-group h4 {
    font-family: var(--font-heading);
    font-size: 0.6875rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 0 0 0.5rem;
    padding-bottom: 0.25rem;
    border-bottom: 1px solid color-mix(in srgb, var(--color-border) 40%, transparent);
}

.heimildaskra-entry {
    padding: 0.35rem 0;
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.125rem 0.5rem;
}

.heimildaskra-entry-title {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.8125rem;
    white-space: nowrap;
}

.heimildaskra-entry-title:hover {
    text-decoration: underline;
}

.heimildaskra-refs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 0.25rem;
    align-items: baseline;
}

.heimildaskra-ref {
    font-size: 0.75rem;
    color: var(--color-text-light);
    background: color-mix(in srgb, var(--color-border) 25%, transparent);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
    white-space: nowrap;
}

.heimildaskra-ref:hover,
.heimildaskra-ref:focus-visible {
    background: color-mix(in srgb, var(--color-primary) 15%, transparent);
    color: var(--color-primary);
    outline: none;
}

.heimildaskra-verdicts {
    display: flex;
    flex-wrap: wrap;
    gap: 0.25rem 0.5rem;
}

.heimildaskra-verdict {
    font-size: 0.8125rem;
    color: var(--color-primary);
    text-decoration: none;
    padding: 0.15rem 0;
    white-space: nowrap;
}

.heimildaskra-verdict:hover {
    text-decoration: underline;
}

.heimildaskra-verdict:not(:last-child)::after {
    content: "·";
    color: var(--color-text-light);
    margin-left: 0.5rem;
    pointer-events: none;
}

@media (prefers-color-scheme: dark) {
    .heimildaskra-ref {
        background: color-mix(in srgb, var(--color-border) 20%, transparent);
    }
    .heimildaskra-ref:hover,
    .heimildaskra-ref:focus-visible {
        background: color-mix(in srgb, var(--color-primary) 20%, transparent);
    }
    .heimildaskra-group h4 {
        border-bottom-color: color-mix(in srgb, var(--color-border) 30%, transparent);
    }
}

/* ── Margin notes (spássíuglósur) ────────────────────────── */

.margin-note-toggle {
    display: none;
    align-items: center;
    gap: 0.35rem;
    padding: 0.35rem 0.75rem;
    font-size: 0.8125rem;
    font-family: var(--font-body);
    color: var(--color-text-light);
    background: transparent;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
}

@media (min-width: 1200px) {
    .margin-note-toggle { display: inline-flex; }
}

.margin-note-toggle:hover {
    background: color-mix(in srgb, var(--color-primary) 8%, transparent);
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.margin-note-toggle.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

.margin-note-toggle--warn {
    border-color: #c44 !important;
    color: #c44 !important;
    animation: shake 0.3s ease;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-3px); }
    75% { transform: translateX(3px); }
}

.margin-note-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.2em;
    height: 1.2em;
    font-size: 0.6875rem;
    font-weight: 700;
    background: rgba(255,255,255,0.25);
    border-radius: 50%;
    margin-left: 0.15rem;
}

.margin-note-toggle:not(.active) .margin-note-count {
    background: var(--color-primary);
    color: #fff;
}

/* Highlight pinned ref in text */
.margin-pinned {
    background: color-mix(in srgb, var(--color-primary) 10%, transparent) !important;
    border-radius: 3px;
    box-decoration-break: clone;
    -webkit-box-decoration-break: clone;
    transition: background 0.15s;
}

/* SVG overlay for connecting lines */
.margin-note-svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 5;
    overflow: visible;
}

.margin-note-svg path {
    stroke: color-mix(in srgb, var(--color-primary) 22%, transparent);
    stroke-width: 1;
    fill: none;
}

/* Note card */
.margin-note {
    position: absolute;
    z-index: 6;
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 0.5rem 0.6rem;
    font-family: var(--font-body);
    font-size: 0.6875rem;
    line-height: 1.4;
    color: var(--color-text);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: opacity 0.2s;
    animation: noteIn 0.2s ease;
}

@keyframes noteIn {
    from { opacity: 0; transform: translateY(-4px); }
    to { opacity: 1; transform: translateY(0); }
}

.margin-note--left {
    border-left: 3px solid var(--color-primary);
}

.margin-note--right {
    border-right: 3px solid var(--color-primary);
}

.margin-note-head {
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 0.25rem;
    padding-right: 1rem;
}

.margin-note-body {
    color: var(--color-text-light);
    word-break: break-word;
}

.margin-note-close {
    position: absolute;
    top: 0.2rem;
    right: 0.3rem;
    background: none;
    border: none;
    font-size: 0.875rem;
    color: var(--color-text-light);
    cursor: pointer;
    line-height: 1;
    padding: 0.1rem 0.25rem;
    border-radius: 3px;
}

.margin-note-close:hover {
    background: color-mix(in srgb, var(--color-primary) 12%, transparent);
    color: var(--color-primary);
}

.margin-note-loading {
    color: var(--color-text-light);
    font-style: italic;
}

.margin-note-error {
    color: #c44;
    padding-right: 1rem;
}

@media (prefers-color-scheme: dark) {
    .margin-note {
        box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    }
    .margin-note-svg path {
        stroke: color-mix(in srgb, var(--color-primary) 30%, transparent);
    }
    .margin-pinned {
        background: color-mix(in srgb, var(--color-primary) 15%, transparent) !important;
    }
    .margin-note-error {
        color: #ff9b9b;
    }
}

/* ── Law page ─────────────────────────────────────────────── */

/* ── Sticky law title bar ── */
.law-sticky-title {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 1.5rem;
    background: linear-gradient(160deg, #14253d 0%, #1e3a5f 50%, #264b72 100%);
    color: #fff;
    transform: translateY(-100%);
    opacity: 0;
    transition: transform 0.25s ease, opacity 0.25s ease;
    box-shadow: var(--shadow-md);
}

.law-sticky-title.visible {
    transform: translateY(0);
    opacity: 1;
}

.law-sticky-name {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-right: 1rem;
}

.law-sticky-nr {
    font-family: var(--font-body);
    font-size: 0.75rem;
    opacity: 0.7;
    white-space: nowrap;
    flex-shrink: 0;
}

.law-page {
    max-width: 1140px;
    margin: 0 auto;
    padding: 1rem 2rem 3rem;
    background: #fff;
}

.law-page.has-chapters {
    max-width: 100%;
}

.law-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.law-header-links {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.law-external-link {
    font-size: 0.85rem;
    color: var(--color-primary);
    text-decoration: none;
}

.law-external-link:hover {
    text-decoration: underline;
}

.law-search-refs-link {
    font-size: 0.78rem;
    color: var(--color-primary);
    text-decoration: none;
    white-space: nowrap;
}

.law-search-refs-link:hover {
    text-decoration: underline;
}

.law-total-refs-badge {
    display: inline-block;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    color: #5a5a5a;
    background: #e8e6e2;
    border-radius: 12px;
    padding: 1px 8px;
    text-decoration: none;
    line-height: 1.6;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
}

.law-total-refs-badge:hover {
    color: #fff;
    background: var(--color-primary);
}

.law-repealed-banner {
    background: #fef3cd;
    border: 1px solid #e6c87e;
    color: #664d03;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.law-amendment-banner {
    background: #e8f0fe;
    border: 1px solid #a8c7fa;
    color: #1a4785;
    padding: 0.6rem 1rem;
    border-radius: 6px;
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.law-amendment-banner a {
    color: #1a4785;
    font-weight: 600;
    margin-left: 0.5rem;
}

/* Collapsible amendment preamble */
.law-amendments {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: var(--color-text-light);
}
.law-amendments summary {
    cursor: pointer;
    font-weight: 600;
    color: var(--color-text);
    padding: 0.4rem 0;
}
.law-amendments summary:hover {
    color: var(--color-primary);
}
.law-amendments small {
    display: block;
    margin-top: 0.5rem;
    line-height: 1.6;
}

.law-minister-text {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px solid var(--color-border);
    line-height: 1.5;
}

/* Two-column layout: TOC sidebar + content */
.law-layout {
    display: flex;
    gap: 2rem;
}

/* ── TOC Sidebar ── */
.law-toc {
    width: 260px;
    min-width: 260px;
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    display: flex;
    flex-direction: column;
    border-right: 1px solid var(--color-border);
    padding-right: 1.5rem;
}

/* Law info section at top of TOC (non-scrolling) */
.law-toc-info {
    padding-bottom: 0.75rem;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

.toc-back-link {
    display: inline-block;
    font-size: 0.78rem;
    color: var(--color-text-light);
    text-decoration: none;
    margin-bottom: 0.5rem;
}

.toc-back-link:hover {
    color: var(--color-primary);
}

.law-toc-law-title {
    font-family: var(--font-heading);
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--color-text);
    line-height: 1.3;
    margin-bottom: 0.25rem;
}

.law-toc-law-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.78rem;
    color: var(--color-text-light);
}

.toc-external-link {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.75rem;
    white-space: nowrap;
}

.toc-external-link:hover {
    text-decoration: underline;
}

.law-toc-header {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--color-accent);
    margin-bottom: 0.5rem;
}

.law-toc-nav {
    overflow-y: auto;
    flex: 1;
    padding-bottom: 2rem;
    scrollbar-width: thin;
    scrollbar-color: var(--color-border) transparent;
}

.toc-chapter {
    margin-bottom: 0.5rem;
}

.toc-chapter-link {
    display: block;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-text);
    text-decoration: none;
    padding: 0.3rem 0.5rem;
    border-radius: var(--radius);
    line-height: 1.3;
    transition: background 0.15s, color 0.15s;
}

.toc-chapter-link:hover {
    background: rgba(30, 58, 95, 0.06);
    color: var(--color-primary);
}

.toc-chapter.active > .toc-chapter-link {
    background: rgba(30, 58, 95, 0.1);
    color: var(--color-primary);
    font-weight: 600;
}

.toc-articles {
    display: flex;
    flex-wrap: wrap;
    gap: 3px;
    padding: 0.25rem 0 0.25rem 0.5rem;
}

.toc-article-btn {
    display: inline-block;
    font-size: 0.7rem;
    font-weight: 500;
    color: var(--color-text-light);
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: 10px;
    padding: 1px 7px;
    text-decoration: none;
    line-height: 1.5;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}

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

/* ── Law content ── */
.law-content {
    font-family: 'Droid Serif', Georgia, serif;
    font-size: 16px;
    line-height: 1.5;
    color: #242424;
    padding: 2rem 0.5rem 0 3.5rem;
    flex: 1;
    min-width: 0;
}

.law-content b {
    color: var(--color-primary);
}

.law-content em {
    font-style: italic;
}

.law-content a {
    color: var(--color-primary);
}

.law-content sup {
    font-size: 60%;
}

.law-content hr {
    border: none;
    border-top: 1px solid #ccc;
    margin: 20px 0;
}

/* ── Chapter headings and article anchors (scroll targets) ── */
/* Chapter pages: no fixed header, so minimal clearance */
.law-chapter-heading {
    scroll-margin-top: 0.25rem;
}

.law-content [id^="G"] {
    scroll-margin-top: 0.25rem;
}

/* Non-chapter pages have a fixed sticky title bar (~38px) */
.law-page:not(.has-chapters) .law-content [id^="G"] {
    scroll-margin-top: 2.5rem;
}

/* ── Reference count badges ── */
.ref-count-badge {
    float: left;
    margin-left: -3.5rem;
    margin-top: 0.15em;
    width: 3rem;
    text-align: center;
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    color: #5a5a5a;
    background: #e8e6e2;
    border-radius: 12px;
    padding: 1px 0;
    text-decoration: none;
    line-height: 1.6;
    transition: background 0.15s, color 0.15s;
}

.ref-count-badge::before {
    content: "↗ ";
    font-size: 0.65rem;
}

.ref-count-badge:hover {
    color: #fff;
    background: var(--color-primary);
}

.mgr-badge {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--color-text-light);
    background: #f0eee9;
    margin-left: -3rem;
    width: 2.5rem;
}

.mgr-badge::before {
    content: "↗ ";
    font-size: 0.6rem;
}

.mgr-badge:hover {
    color: #fff;
    background: var(--color-primary);
}

/* ── Responsive: stack on mobile ── */
@media (max-width: 900px) {
    .law-content {
        padding-left: 0.5rem;
    }

    .ref-count-badge {
        float: right;
        margin-left: 6px;
        width: auto;
    }

    .mgr-badge {
        margin-left: 4px;
        width: auto;
    }

    .law-layout {
        flex-direction: column;
    }

    .law-toc {
        position: static;
        width: 100%;
        min-width: 0;
        max-height: none;
        border-right: none;
        border-bottom: 1px solid var(--color-border);
        padding-right: 0;
        padding-bottom: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .law-toc-header {
        cursor: pointer;
        user-select: none;
    }

    .law-toc-header::after {
        content: ' ▾';
        font-size: 0.8rem;
    }

    .law-toc.collapsed .law-toc-nav {
        display: none;
    }

    .law-toc.collapsed .law-toc-header::after {
        content: ' ▸';
    }

    .law-toc-nav {
        max-height: 50vh;
    }
}

/* ── Lagasafn index page ─────────────────────────────────── */

.lagasafn-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.lagasafn-header h2 {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 0.25rem;
}

.lagasafn-subtitle {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

#law-search {
    width: 100%;
    max-width: 500px;
    padding: 0.6rem 1rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    font-size: 0.95rem;
    color: var(--color-text);
    background: var(--color-surface);
}

#law-search:focus {
    outline: none;
    border-color: var(--color-primary-light);
    box-shadow: 0 0 0 2px rgba(30,58,95,0.08);
}

.chapter-section {
    margin-bottom: 1.5rem;
}

.chapter-heading {
    display: flex;
    width: 100%;
    align-items: baseline;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem 0;
    border: none;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 0.5rem;
    user-select: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    color: inherit;
    text-align: left;
}

.chapter-heading:hover {
    color: var(--color-primary);
}

.chapter-number {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    min-width: 2rem;
}

.chapter-name {
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-text);
}

.chapter-heading:hover .chapter-name {
    color: var(--color-primary);
}

.chapter-count {
    font-size: 0.72rem;
    font-weight: 600;
    color: #555;
    background: #e6e3dd;
    border: 1px solid #dbd7d0;
    padding: 0.15rem 0.6rem;
    border-radius: 10px;
    margin-left: auto;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.01em;
}

.chapter-heading:hover .chapter-count {
    color: var(--color-primary);
    border-color: rgba(30, 58, 95, 0.15);
    background: #e0ddd6;
}

.chapter-toggle {
    font-size: 0.7rem;
    color: var(--color-text-light);
    transition: transform 0.2s;
}

.chapter-section.open .chapter-toggle {
    transform: rotate(90deg);
}

.chapter-body {
    display: none;
    padding-left: 0.5rem;
}

.chapter-section.open .chapter-body {
    display: block;
}

.subcat-heading {
    font-family: var(--font-heading);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-text-light);
    margin: 0.75rem 0 0.25rem;
    padding-left: 0.25rem;
}

/* ── Regulation page (island.is HTML classes) ── */

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 300;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-sans-300.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-sans-400.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: italic;
    font-weight: 400;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-sans-400-italic.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 500;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-sans-500.woff2') format('woff2');
}

@font-face {
    font-family: 'IBM Plex Sans';
    font-style: normal;
    font-weight: 600;
    font-display: swap;
    src: url('/static/fonts/ibm-plex-sans-600.woff2') format('woff2');
}

.regulation-content {
    font-family: 'IBM Plex Sans', sans-serif;
    font-size: 18px;
    line-height: 1.5em;
    font-weight: 400;
    color: rgb(0, 0, 60);
    -webkit-font-smoothing: antialiased;
    max-width: 870px;
}

.regulation-content * {
    position: relative;
    font-family: inherit;
}

.regulation-content .regulation__title {
    font-size: 24px;
    font-weight: 600;
    text-align: left;
    margin: 0 0 32px;
    line-height: 1.5;
}

.regulation-content .section__title {
    margin-top: 2em;
    text-align: center;
    font-size: 1em;
    font-weight: 400;
    text-transform: uppercase;
    line-height: 2em;
}

.regulation-content .section__name {
    display: block;
    font-style: inherit;
}

.regulation-content .chapter__title {
    margin-top: 2em;
    text-align: center;
    font-size: 1em;
    font-weight: 400;
    line-height: 2em;
}

.regulation-content .chapter__name {
    display: block;
    font-style: inherit;
    font-weight: 600;
}

.regulation-content .subchapter__title {
    margin-top: 2em;
    text-align: center;
    font-size: 1em;
    font-weight: 400;
    line-height: 2em;
}

.regulation-content .article__title {
    margin-top: 2em;
    text-align: center;
    font-size: 1em;
    font-weight: 400;
    margin-bottom: 1.5em;
    line-height: 2em;
}

.regulation-content .article__title:first-child,
.regulation-content .chapter__title + .article__title,
.regulation-content .section__title + .article__title,
.regulation-content .subchapter__title + .article__title {
    margin-top: 0;
}

.regulation-content .article__name {
    display: block;
    font-style: italic;
}

.regulation-content .appendix__title {
    margin-top: 2em;
    text-align: center;
    font-size: 1em;
    font-weight: 400;
    line-height: 2em;
}

.regulation-content p {
    margin-bottom: 1.5em;
}

.regulation-content ol,
.regulation-content ul {
    margin-left: 2em;
    margin-bottom: 1.5em;
}

.regulation-content li {
    margin-bottom: 0.5em;
}

.regulation-content p:last-child,
.regulation-content ol:last-child,
.regulation-content ul:last-child,
.regulation-content table:last-child {
    margin-bottom: 0;
}

.regulation-content b,
.regulation-content strong {
    font-weight: 600;
}

.regulation-content h1,
.regulation-content h2,
.regulation-content h3,
.regulation-content h4,
.regulation-content h5,
.regulation-content h6 {
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.regulation-content table {
    border-collapse: collapse;
    margin: 1rem 0;
    font-size: 0.85rem;
    width: 100%;
}

.regulation-content th,
.regulation-content td {
    border: 1px solid #ccc;
    padding: 0.3rem 0.5rem;
    text-align: left;
}

.regulation-content th {
    background: #f5f5f5;
    font-weight: 600;
}

.law-reg-list {
    list-style: none;
    padding: 0;
    margin: 0.15rem 0 0.25rem 1.25rem;
    border-left: 2px solid var(--color-border);
}

.law-reg-list li {
    padding: 0.15rem 0.25rem 0.15rem 0.5rem;
    border-bottom: none;
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.75rem;
}

.law-reg-list a {
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.82rem;
}

.law-reg-list a:hover {
    text-decoration: underline;
    color: var(--color-primary);
}

.law-reg-list .law-nr {
    font-size: 0.72rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.law-list {
    list-style: none;
    padding: 0;
    margin: 0 0 0.5rem;
}

.law-list > li {
    padding: 0.25rem 0.25rem;
    border-bottom: 1px solid #f0f0f0;
}

.law-list > li > a,
.law-list > li > span {
    display: inline;
}

.law-list > li > a {
    margin-right: 0.5rem;
}

.law-list li:last-child {
    border-bottom: none;
}

.law-list a {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.88rem;
}

.law-list a:hover {
    text-decoration: underline;
}

.law-list .law-nr {
    font-size: 0.78rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

/* Controls row: search + toggle */
.lagasafn-controls {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
}

.lagasafn-toggle {
    display: flex;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    flex-shrink: 0;
}

.toggle-btn {
    padding: 0.5rem 0.75rem;
    font-size: 0.85rem;
    font-family: var(--font-body);
    border: none;
    background: var(--color-surface);
    color: var(--color-text-light);
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.toggle-btn:not(:last-child) {
    border-right: 1px solid var(--color-border);
}

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

.toggle-btn:hover:not(.active) {
    background: rgba(30, 58, 95, 0.08);
}

/* View mode tabs (subtle text links below search) */
.lagasafn-view-tabs {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    align-items: center;
    margin-top: 0.25rem;
}

.view-tab {
    background: none;
    border: none;
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-text-light);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius);
    transition: color 0.15s;
}

.view-tab.active {
    color: var(--color-primary);
    font-weight: 600;
}

.view-tab:hover:not(.active) {
    color: var(--color-text);
}

.view-tab-sep {
    color: var(--color-border);
    font-size: 0.8rem;
}

/* Flat table fallback (search results) */
.lagasafn-table {
    width: 100%;
    border-collapse: collapse;
}

.lagasafn-table th {
    text-align: left;
    font-size: 0.78rem;
    color: var(--color-text-light);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.5rem 0.75rem;
    border-bottom: 2px solid var(--color-border);
}

.lagasafn-table td {
    padding: 0.4rem 0.75rem;
    border-bottom: 1px solid #f0f0f0;
    font-size: 0.88rem;
}

.lagasafn-table td a {
    color: var(--color-primary);
    text-decoration: none;
}

.lagasafn-table td a:hover {
    text-decoration: underline;
}

.col-law-nr {
    width: 6rem;
}

.law-chapter-cell {
    font-size: 0.78rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.law-nr-cell {
    font-size: 0.78rem;
    color: var(--color-text-light);
    white-space: nowrap;
}

.col-law-refs {
    width: 6rem;
    text-align: right;
}

.law-refs-cell {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--color-text-light);
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.law-search-snippet {
    font-size: 0.78rem;
    color: var(--color-text-light);
    margin-top: 0.15rem;
    line-height: 1.4;
}

.law-search-snippet mark {
    background: #fef3cd;
    padding: 0 1px;
    border-radius: 2px;
}

/* ═══════════════════════════════════════════════
   Donut chart (lawyer profile win rate)
   ═══════════════════════════════════════════════ */
.donut-wrap {
    flex-shrink: 0;
    position: relative;
    width: 110px;
    height: 110px;
}
.donut-label {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}
.donut-pct {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-primary);
}
.donut-sub {
    font-size: 0.6rem;
    color: var(--color-text-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: 500;
}
/* Win-rate by case type — contextualizes the blended Sigur% (criminal defence has a
   ~9% peer median, so a 17% blend reads as failure unless split out). */
.winrate-split {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.55rem;
    margin-top: 0.85rem;
    padding-top: 0.85rem;
    border-top: 1px solid var(--color-border);
}
.ws-title {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    color: var(--color-text-light);
}
.ws-items {
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
}
/* Each case type is a mini stat tile (same outlined-box family as .stat-box):
   type label, big %, then the sigrar/töp + peer-benchmark line. */
.ws-item {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    padding: 0.45rem 0.8rem;
    background: var(--color-bg-subtle);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
}
.ws-type {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--color-text-light);
}
.ws-pct {
    font-family: var(--font-heading);
    font-size: 1.3rem;
    font-weight: 700;
    line-height: 1.15;
    color: var(--color-primary);
}
.ws-meta {
    font-size: 0.68rem;
    color: var(--color-text-light);
}
.ws-hint {
    font-weight: 400;
    text-transform: none;
    letter-spacing: 0;
    color: var(--color-text-light);
}
/* Win-rate tiles double as the case-type filter when the lawyer has both types. */
.ws-clickable {
    cursor: pointer;
    transition: background 0.12s, border-color 0.12s, opacity 0.12s, box-shadow 0.12s;
}
.ws-clickable:hover {
    background: rgba(30, 58, 95, 0.04);
    border-color: var(--color-primary);
}
.ws-item.ct-active {
    background: rgba(30, 58, 95, 0.08);
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px var(--color-primary);
}
.ws-item.ct-dim {
    opacity: 0.4;
}

/* ═══════════════════════════════════════════════
   Breakdown bars (roles + courts in lawyer profile)
   ═══════════════════════════════════════════════ */
.breakdown-bars {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.breakdown-row {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.1rem 0;
    border-radius: 4px;
    transition: background 0.12s;
    text-decoration: none;
}
.breakdown-row:hover {
    background: rgba(30, 58, 95, 0.03);
    text-decoration: none;
}
.breakdown-row.active {
    background: rgba(30, 58, 95, 0.08);
    border-left: 3px solid var(--color-primary);
    padding-left: 0.35rem;
}
.breakdown-row.active .breakdown-label {
    color: var(--color-primary);
}
.breakdown-label {
    font-size: 0.72rem;
    font-weight: 600;
    min-width: 8.5rem;
    white-space: nowrap;
}
.breakdown-track {
    flex: 1;
    position: relative;
    height: 16px;
    background: var(--color-bg-subtle);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: inset 0 1px 2px rgba(15, 30, 50, 0.06);
    transition: border-color 0.15s;
}
.breakdown-row:hover .breakdown-track {
    border-color: rgba(30, 58, 95, 0.25);
}
/* Fill width is the honest proportion — no fake floor. The 3px min-width only
   keeps a hairline visible for tiny counts; the number lives outside the fill. */
.breakdown-fill {
    height: 100%;
    border-radius: 3px;
    min-width: 3px;
}
/* Count pinned to the track's right edge, independent of fill width,
   so all numbers form a scannable column. */
.breakdown-num {
    position: absolute;
    right: 0.4rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.6rem;
    color: #5c6b7a;  /* default: neutral dark — used by the decolorized role bars */
    font-weight: 700;
}

/* Role bars — categorical hues, SAME pale-tint + hue-ring treatment as the court bars.
   Hues deliberately avoid the court tokens (HD #29589A navy, LR #8E2F44 wine,
   HR #2f7361 teal) and the outcome colors (green/red/gold) so roles never read
   as a court or an outcome. profmal + prosecutor stay neutral (excluded from stats /
   not lawyers). */
.bl-defense_lawyer { color: #7B4FA6; }
.bf-defense_lawyer { background: #f3edf9; box-shadow: inset 0 0 0 1px rgba(123, 79, 166, 0.3); }
.bf-defense_lawyer + .breakdown-num { color: #7B4FA6; }
.bl-defendant_lawyer { color: #5158B5; }
.bf-defendant_lawyer { background: #ececf8; box-shadow: inset 0 0 0 1px rgba(81, 88, 181, 0.3); }
.bf-defendant_lawyer + .breakdown-num { color: #5158B5; }
.bl-plaintiff_lawyer { color: #C2702D; }
.bf-plaintiff_lawyer { background: #faf0e6; box-shadow: inset 0 0 0 1px rgba(194, 112, 45, 0.3); }
.bf-plaintiff_lawyer + .breakdown-num { color: #C2702D; }
.bl-victim_lawyer { color: #B0487E; }
.bf-victim_lawyer { background: #f9ecf3; box-shadow: inset 0 0 0 1px rgba(176, 72, 126, 0.3); }
.bf-victim_lawyer + .breakdown-num { color: #B0487E; }
.bl-guardian { color: #2E7E9E; }
.bf-guardian { background: #e7f3f8; box-shadow: inset 0 0 0 1px rgba(46, 126, 158, 0.3); }
.bf-guardian + .breakdown-num { color: #2E7E9E; }
.bl-rettargaeslu_lawyer { color: #607089; }
.bf-rettargaeslu_lawyer { background: #eef1f5; box-shadow: inset 0 0 0 1px rgba(96, 112, 137, 0.3); }
.bf-rettargaeslu_lawyer + .breakdown-num { color: #607089; }
.bl-profmal,
.bl-prosecutor { color: var(--color-text); }
.bf-profmal,
.bf-prosecutor { background: #eef0f3; box-shadow: inset 0 0 0 1px rgba(92, 107, 122, 0.25); }

/* Court bars — SAME treatment as the court badge: light tint fill + dark court-color number.
   bar == badge, so a court reads identically in both. */
.bl-heradsdomstolar { color: #29589A; }
.bf-heradsdomstolar { background: #eaf0f8; box-shadow: inset 0 0 0 1px rgba(41, 88, 154, 0.3); }
.bf-heradsdomstolar + .breakdown-num { color: #29589A; }
.bl-landsrettur { color: #8E2F44; }
.bf-landsrettur { background: #fbeef1; box-shadow: inset 0 0 0 1px rgba(142, 47, 68, 0.3); }
.bf-landsrettur + .breakdown-num { color: #8E2F44; }
.bl-haestirettur { color: #2f7361; }
.bf-haestirettur { background: #e8f5f4; box-shadow: inset 0 0 0 1px rgba(47, 115, 97, 0.3); }
.bf-haestirettur + .breakdown-num { color: #2f7361; }

/* ═══════════════════════════════════════════════
   Admin mode
   ═══════════════════════════════════════════════ */

/* ── Reading progress bar ── */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    width: 0%;
    background: var(--progress-color, linear-gradient(90deg, #c9a84c, #e8c75a, #c9a84c));
    z-index: 900;
    transition: width 80ms linear;
    pointer-events: none;
}

/* Admin nav separator and link */
.admin-nav-sep {
    color: rgba(255,255,255,0.2);
    margin: 0 0.25rem;
    font-weight: 300;
}

.admin-nav-link {
    color: var(--color-accent, #c9a84c) !important;
    font-size: 0.78rem !important;
}

.admin-nav-link:hover {
    color: #e8c75a !important;
}

/* ── Admin shell (tabs + panel) ──────────────── */
.admin-shell {
    max-width: 1000px;
    margin: 0 auto;
    padding: 1rem 1rem 2rem;
}
.admin-tabs {
    display: flex;
    gap: 0.25rem;
    border-bottom: 2px solid var(--color-border, #ddd);
    margin-bottom: 1.5rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}
.admin-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--color-text-light, #888);
    text-decoration: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    white-space: nowrap;
    transition: color 0.15s, border-color 0.15s;
}
.admin-tab:hover {
    color: var(--color-text, #333);
}
.admin-tab.active {
    color: var(--color-primary, #4a6fa5);
    border-bottom-color: var(--color-primary, #4a6fa5);
    font-weight: 600;
}
.admin-tab-icon {
    font-size: 0.9rem;
}
.admin-panel {
    min-height: 400px;
}

/* ── Admin search form ──────────────────────── */
.admin-search-form {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}
.admin-search-form input[type="text"] {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid var(--color-border, #ddd);
    border-radius: var(--radius, 6px);
    background: var(--color-bg, #fff);
    color: var(--color-text, #333);
    font-size: 0.9rem;
}
.admin-search-form button {
    padding: 0.5rem 1.25rem;
    background: var(--color-primary, #4a6fa5);
    color: #fff;
    border: none;
    border-radius: var(--radius, 6px);
    cursor: pointer;
    font-size: 0.9rem;
}
.admin-search-form button:hover { opacity: 0.85; }

/* ── Dashboard layout ────────────────────────── */

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.admin-header h2 {
    font-family: var(--font-heading);
    font-size: 1.4rem;
    margin: 0;
}

/* ── Stat cards ──────────────────────────────── */
/* ── Issues ──────────────────────────────────── */
.admin-issues {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.admin-issue {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #fef3f2;
    border-left: 3px solid #b42318;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
}

/* ── View Transitions ── */
@view-transition { navigation: auto; }
::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.15s;
}

/* ── Static pages (privacy policy, etc.) ── */
.static-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 1.5rem 0;
}
.static-page h2 {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
}
.static-page h3 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}
.static-page p, .static-page li {
    font-size: 0.92rem;
    line-height: 1.7;
    color: var(--color-text-light);
}
.static-page ul {
    padding-left: 1.3rem;
    margin: 0.5rem 0;
}
.static-updated {
    font-size: 0.82rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
}

@media (prefers-color-scheme: dark) {
    .admin-issue {
        background: #2c1810;
        border-left-color: #f04438;
    }
}

.admin-issue:hover { opacity: 0.8; }

.admin-issue-count {
    font-weight: 700;
    color: #b42318;
}

@media (prefers-color-scheme: dark) {
    .admin-issue-count { color: #f04438; }
}

/* ── Sections ────────────────────────────────── */
.admin-section {
    margin-bottom: 2rem;
}

.admin-section h3 {
    font-family: var(--font-heading);
    font-size: 1rem;
    margin-bottom: 0.75rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid var(--color-border);
}

/* ── Quality bars ────────────────────────────── */
/* ── Table ───────────────────────────────────── */
.admin-table {
    width: 100%;
    font-size: 0.85rem;
}

.admin-table th {
    text-align: left;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--color-text-light);
}

.admin-table td, .admin-table th {
    padding: 0.5rem 0.75rem;
}

.admin-empty {
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Filter tabs ────────────────────────────── */
.admin-filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.admin-filter-tab {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.4rem 0.85rem;
    font-size: 0.82rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
    background: transparent;
    cursor: pointer;
    transition: background 0.15s;
}

.admin-filter-tab:hover {
    background: var(--color-bg-muted, #f5f5f5);
}

.admin-filter-tab.active {
    background: var(--color-text);
    color: var(--color-bg, #fff);
    border-color: var(--color-text);
}

.admin-filter-count {
    font-size: 0.72rem;
    opacity: 0.7;
}

/* ── Tool links ─────────────────────────────── */
.admin-tool-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 1rem;
    background: #f0f4ff;
    border-left: 3px solid #4a6fa5;
    border-radius: var(--radius);
    text-decoration: none;
    color: var(--color-text);
}

.admin-tool-link:hover { opacity: 0.8; }

.admin-tool-arrow {
    font-weight: 700;
    color: #4a6fa5;
}

@media (prefers-color-scheme: dark) {
    .admin-tool-link {
        background: #1a2540;
        border-left-color: #6a9fd5;
    }
    .admin-tool-arrow { color: #6a9fd5; }
    .admin-filter-tab:hover {
        background: var(--color-bg-muted, #2a2a2a);
    }
}

/* ── Activity log ───────────────────────────── */
.admin-log {
    display: flex;
    flex-direction: column;
    max-height: 32rem;
    overflow-y: auto;
}

.admin-log-entry {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.82rem;
    line-height: 1.4;
}

.admin-log-entry:last-child {
    border-bottom: none;
}

a.admin-log-entry {
    cursor: pointer;
    transition: background 0.15s;
    padding: 0.4rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius, 6px);
    color: inherit;
}

a.admin-log-entry:hover {
    background: var(--bg-muted, #e8e6e1);
}

.admin-log-date {
    color: var(--color-text-light);
    font-size: 0.75rem;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    min-width: 5.5rem;
}

.admin-log-weekday {
    color: var(--color-text-light);
    font-size: 0.7rem;
    min-width: 2rem;
    text-align: center;
}

.admin-log-time {
    color: var(--color-text-light);
    font-size: 0.7rem;
    font-variant-numeric: tabular-nums;
    min-width: 2.5rem;
}

.admin-log-badge {
    display: inline-block;
    font-size: 0.62rem;
    padding: 0.1rem 0.35rem;
    border-radius: 3px;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    white-space: nowrap;
    line-height: 1.4;
}

.admin-log-badge.verdict_import { background: #e3edf8; color: #29589A; }
.admin-log-badge.lawyer_change  { background: #fef3e2; color: #a85c00; }
.admin-log-badge.lawyer_scrape  { background: #f0f0f0; color: #666; }
.admin-log-badge.gazette        { background: #f0e8ff; color: #6b3fa0; }
.admin-log-badge.gazette_event  { background: #f0e8ff; color: #6b3fa0; }
.admin-log-badge.keyword_update { background: #e8f8e8; color: #2d7a2d; }
.admin-log-badge.pipeline_run   { background: #f0f0f0; color: #666; }

.admin-log-title {
    flex: 1;
    min-width: 0;
}

.admin-log-title.positive { color: var(--color-success, #27ae60); }
.admin-log-title.warning  { color: #b38600; }
.admin-log-title.negative { color: var(--color-error, #c0392b); }

.admin-log-count {
    font-weight: 600;
    color: var(--color-text-light);
    font-size: 0.78rem;
    white-space: nowrap;
}

.admin-log-group {
    border-bottom: 1px solid var(--color-border);
}

.admin-log-group:last-child {
    border-bottom: none;
}

.admin-log-group .admin-log-entry {
    border-bottom: none;
}

.admin-log-entry.has-details {
    cursor: pointer;
    transition: background 0.15s;
    padding: 0.4rem 0.5rem;
    margin: 0 -0.5rem;
    border-radius: var(--radius, 6px);
}

.admin-log-entry.has-details:hover {
    background: var(--bg-muted, #e8e6e1);
}

.admin-log-chevron {
    color: var(--color-text-light);
    font-size: 0.7rem;
    transition: transform 0.2s;
    margin-left: 0.25rem;
}

.admin-log-entry.expanded .admin-log-chevron {
    transform: rotate(90deg);
}

.admin-log-detail {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.3s ease;
}

.admin-log-entry.expanded + .admin-log-detail {
    max-height: 40rem;
    overflow-y: auto;
}

.activity-detail-table {
    width: 100%;
    font-size: 0.78rem;
    border-collapse: collapse;
    margin: 0.25rem 0 0.5rem;
}

.activity-detail-table th {
    text-align: left;
    font-weight: 600;
    color: var(--color-text-light);
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.activity-detail-table td {
    padding: 0.3rem 0.5rem;
    border-bottom: 1px solid var(--color-border-light, #eee);
    vertical-align: top;
}

.activity-detail-table tr:last-child td {
    border-bottom: none;
}

.activity-detail-case {
    white-space: nowrap;
    font-weight: 500;
    min-width: 8rem;
}

.activity-detail-old {
    color: var(--color-text-light);
}

.activity-detail-new {
    color: var(--color-text);
}

.activity-detail-simple {
    padding: 0.25rem 0.5rem 0.5rem;
    font-size: 0.78rem;
    color: var(--color-text-light);
    line-height: 1.5;
}

.activity-detail-simple pre {
    font-size: 0.72rem;
    white-space: pre-wrap;
    word-break: break-word;
}

.activity-detail-note {
    font-style: italic;
    font-size: 0.72rem;
    color: var(--color-text-light);
    margin-top: 0.25rem;
}

.activity-detail-failures {
    margin: 0.25rem 0 0;
    padding-left: 1.2rem;
    font-size: 0.75rem;
    line-height: 1.5;
}

/* Back link in detail pages */

/* Quality detail table */
.admin-quality-table {
    font-size: 0.82rem;
}

.admin-quality-table td {
    vertical-align: middle;
}

.admin-filename {
    font-family: monospace;
    font-size: 0.75rem;
    color: var(--color-text-light);
}

/* ── Login page ─────────────────────────────── */
.login-page {
    max-width: 400px;
    margin: 4rem auto;
    text-align: center;
}

.login-heading {
    font-family: var(--font-heading);
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 0.5rem;
}

.login-subtitle {
    color: var(--color-text-light);
    font-size: 0.9rem;
    margin-bottom: 2rem;
}

.login-error {
    background: #fef3f2;
    border: 1px solid #fecdca;
    color: #b42318;
    padding: 0.6rem 1rem;
    border-radius: var(--radius);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
}

.login-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    transition: box-shadow 0.2s, background 0.2s;
    cursor: pointer;
}

.auth-btn svg {
    flex-shrink: 0;
}

.auth-btn-google {
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
}

.auth-btn-google:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow-sm);
}

.auth-btn-microsoft {
    background: #fff;
    color: #5e5e5e;
    border: 1px solid #d6d6d6;
}

.auth-btn-microsoft:hover {
    background: #f3f3f3;
    box-shadow: var(--shadow-sm);
}

.login-disabled {
    color: var(--color-text-light);
    font-size: 0.85rem;
    font-style: italic;
}

/* ── Nav auth link ─────────────────────────── */
.nav-auth-link {
    position: absolute;
    right: 0;
    bottom: 0;
    padding: 0.4rem 0;
    font-size: 0.78rem !important;
    opacity: 0.65;
}

.nav-auth-link:hover {
    opacity: 1;
}

.nav-user-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    vertical-align: middle;
}

.nav-user-initials {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.8);
    font-size: 0.72rem;
    font-weight: 600;
}

/* ═══════════════════════════════════════════════
   Dark mode — follows system preference
   ═══════════════════════════════════════════════ */
@media (prefers-color-scheme: dark) {
    :root {
        --color-primary: #4a8bc2;
        --color-primary-light: #5a9ad4;
        --color-accent: #d4b55a;
        --color-win: #d4b55a;  /* bright gold already passes AA on the dark background */
        --color-success: #3fb05f;  /* vivid grass-green (dark) — away from HR teal */
        --color-error: #f15555;  /* pure vivid red (dark) — away from LR wine */
        --color-warning: #e0a82e;
        --color-neutral: #7a746a;
        --color-bg: #1a1a1e;
        --color-surface: #242428;
        --color-text: #e0ddd8;
        --color-text-light: #9a9790;
        --color-border: #3a3a3e;
        --color-bg-subtle: #242428;
        --color-muted: #6a6560;
        --color-text-muted: #6a6560;
        --color-bg-muted: #2a2a2e;
        --shadow-sm: 0 1px 2px rgba(5,5,15,0.25);
        --shadow: 0 1px 3px rgba(5,5,15,0.35), 0 1px 2px rgba(5,5,15,0.2);
        --shadow-md: 0 4px 12px rgba(5,5,15,0.35), 0 1px 3px rgba(5,5,15,0.2);
        --shadow-lg: 0 8px 30px rgba(5,5,15,0.45), 0 4px 8px rgba(5,5,15,0.3);
    }

    /* Header — dark gradient */
    header {
        background: linear-gradient(160deg, #0a1420 0%, #141e2e 50%, #1a2840 100%);
    }

    /* Footer */
    footer {
        background: var(--color-surface);
    }

    /* Search bar */
    .search-bar-top input[type="text"] {
        background: var(--color-bg);
        color: var(--color-text);
    }
    .search-bar-top input[type="text"]::placeholder {
        color: #666;
    }

    /* Selects and inputs */
    select, input[type="text"], input[type="number"] {
        background: var(--color-bg);
        color: var(--color-text);
        border-color: var(--color-border);
    }

    /* Flatpickr dark mode */
    .flatpickr-calendar {
        background: var(--color-surface);
        border-color: var(--color-border);
    }
    .flatpickr-calendar.arrowTop::before { border-bottom-color: var(--color-border); }
    .flatpickr-calendar.arrowTop::after { border-bottom-color: var(--color-surface); }
    .flatpickr-months { background: var(--color-bg-muted); }
    .flatpickr-innerContainer { background: var(--color-surface); }
    .flatpickr-rContainer { background: var(--color-surface); }

    /* Case cards */
    .case-card {
        background: var(--color-surface);
    }
    .case-card.haestirettur { border-left-color: #2ab8ad; }
    .case-card.landsrettur { border-left-color: #bc5c6f; }
    .case-card.heradsdomstolar { border-left-color: #5a8fd6; }

    /* Court tags — dark tints */
    .court-tag.haestirettur { background: #1a2e2c; color: #52c4a4; }
    .court-tag.landsrettur { background: #2e1a22; color: #c46e7f; }
    .court-tag.heradsdomstolar { background: #1a2435; color: #6aa0de; }

    /* Court filter pill focus */
    label.court-filter-pill:focus-within {
        outline-color: var(--color-primary);
    }

    /* Event timeline court colors */
    .event-item.court-hdl { background: #1e2a40; }
    .event-item.court-lrl { background: #351e28; }
    .event-item.court-hrl { background: #1e3532; }
    .court-hdl .event-license { color: #6aa0de; }
    .court-lrl .event-license { color: #c46e7f; }
    .court-hrl .event-license { color: #52c4a4; }

    /* License badge court colors */
    .license-hdl { background: #1e2a40; color: #6aa0de; }
    .license-lrl { background: #351e28; color: #c46e7f; }
    .license-hrl { background: #1e3532; color: #52c4a4; }

    /* Appeal chain court-colored left borders */
    .appeal-chain__step.haestirettur { border-left-color: #52c4a4; }
    .appeal-chain__step.landsrettur { border-left-color: #c46e7f; }
    .appeal-chain__step.heradsdomstolar { border-left-color: #6aa0de; }


    /* Keyword highlights */
    mark, .highlight { background: #4a4020; color: var(--color-text); }

    /* Role tags — same categorical hues as the dark HLUTVERK bars; prosecutor/profmal neutral */
    .role-tag.role-defense_lawyer { background: #2a2138; color: #b794e0; }
    .role-tag.role-defendant_lawyer { background: #232548; color: #9ba1ec; }
    .role-tag.role-plaintiff_lawyer { background: #2f2114; color: #d99a5e; }
    .role-tag.role-victim_lawyer { background: #311f29; color: #d886ae; }
    .role-tag.role-guardian { background: #1a2b33; color: #67b1cf; }
    .role-tag.role-rettargaeslu_lawyer { background: #242a33; color: #9aabc3; }
    .role-tag.role-prosecutor,
    .role-tag.role-profmal { background: #23282e; color: #9aa4b0; }
    .outcome-guardian { background: #23282e; color: #9aa4b0; }
    .outcome-profmal { background: #23282e; color: #9aa4b0; }
    .outcome-win { background: #197a35; color: #fff; }
    .outcome-loss { background: #cc2222; color: #fff; }
    .case-lawyer-inline .lawyer-won,
    a.lawyer-ref.lawyer-won { color: var(--color-win); }
    .party-inline.party-win,
    .verdict-preamble .party-name.party-win { color: var(--color-win); }

    /* Lawyer tooltip dark mode */
    .lawyer-tooltip-active { color: #4caf50; }
    .lawyer-tooltip-wins { color: #66bb6a; }
    .lawyer-tooltip-losses { color: #ef5350; }
    .lawyer-tooltip-bar { background: #333; }
    .lawyer-tooltip-bar-fill { background: #4caf50; }
    .lawyer-ref { border-bottom-color: #5a8a5e; }
    .lawyer-ref:hover { color: #66bb6a; border-bottom-color: #66bb6a; }

    /* Cover page logo — invert for dark backgrounds */
    .verdict-preamble .court-cover-logo {
        filter: invert(0.85) contrast(1.2);
        opacity: 0.75;
    }

    /* ── LR/HD verdict dark mode ────────────────────────────────
       The LR/HD CSS uses hardcoded rgb(0,0,0) for light mode (to
       match the original PDF). In dark mode we override all of those
       to use the theme text color instead. */
    .verdict-body {
        background: var(--color-surface);
        color: var(--color-text);
    }
    /* Preamble elements: subtitle, date, parties, lawyers, keywords */
    .verdict-body .verdict-head__subtitle,
    .verdict-body .verdict-head__time,
    .verdict-body .plaintiffs,
    .verdict-body .gegn,
    .verdict-body .party-lawyers,
    .verdict-body .text-italic,
    .verdict-body .verdict__keywords h3,
    .verdict-body .verdict__reifun h3,
    .verdict-body .verdict__keywords li {
        color: var(--color-text);
    }
    /* Body text: paragraphs, list items, and headings */
    .verdict-body .verdict__body p,
    .verdict-body .verdict__body li,
    .verdict-body .verdict__body h1,
    .verdict-body .verdict__body h2,
    .verdict-body .verdict__body h3 {
        color: var(--color-text);
    }
    /* Paragraph numbers — slightly brighter gray in dark mode */
    .verdict-body .verdict__body .para-num {
        color: #888;
    }
    /* Separators — use theme border color */
    .verdict-body > hr {
        border-top-color: var(--color-border);
    }

    /* Tables */
    table th {
        background: #2a2a2e;
    }
    table td {
        border-color: var(--color-border);
    }
    table tr:nth-child(even) td {
        background: rgba(255,255,255,0.02);
    }

    /* Buttons */
    .btn, button {
        color: var(--color-text);
    }
    .subscribe-btn {
        color: var(--color-primary);
        border-color: var(--color-primary);
    }
    .subscribe-btn:hover {
        background: var(--color-primary);
        color: #1a1a1e;
    }
    .subscribe-btn.subscribed {
        background: var(--color-primary);
        color: #1a1a1e;
    }
    .subscribe-btn.subscribed:hover {
        background: var(--color-error);
        border-color: var(--color-error);
        color: #1a1a1e;
    }
    .verdict-external-link {
        color: var(--color-primary);
        background: var(--color-surface);
        border-color: var(--color-border);
    }
    .verdict-external-link:hover,
    .verdict-external-link:focus-visible {
        background: var(--color-primary);
        color: #1a1a1e;
    }
    .save-verdict-btn {
        color: var(--color-primary);
        background: var(--color-surface);
        border-color: var(--color-border);
    }
    .save-verdict-btn:hover,
    .save-verdict-btn:focus-visible {
        background: var(--color-primary);
        color: #1a1a1e;
    }
    .save-verdict-btn.saved {
        background: var(--color-primary);
        color: #1a1a1e;
    }
    .save-verdict-btn.saved:hover {
        background: var(--color-error);
        border-color: var(--color-error);
        color: #1a1a1e;
    }

    /* Links */
    a {
        color: var(--color-primary);
    }

    /* Law tooltip */
    .law-tooltip {
        background: #2a2a2e;
        border-color: var(--color-border);
        color: var(--color-text);
    }

    /* LR/HD body text color (catches li, ol, etc. not covered above) */
    .verdict-body .verdict__body {
        color: var(--color-text);
    }
    /* Elements with higher-specificity hardcoded rgb(0,0,0) in light mode */
    .verdict-body .verdict__body h3.roman-numeral,
    .verdict-body .verdict__body .section-heading,
    .verdict-body .verdict__body .urskardarord,
    .verdict-body .verdict__body .urskardarord-spaced,
    .verdict-body .verdict__body .heradsdomar-title {
        color: var(--color-text);
    }
    .verdict-body .verdict__body li::before {
        color: #888;
    }
    .verdict-body .verdict__body .verdict-table th {
        border-bottom-color: var(--color-border);
    }
    .verdict-body th, .verdict-body td {
        border-color: var(--color-border);
    }

    /* ── HR verdict dark mode ──────────────────────────────────────
       verdict-native uses hardcoded rgb(0,0,60) to match island.is
       in light mode. Override to CSS variable colors here. */
    .verdict-native .verdict {
        color: var(--color-text);
    }
    .verdict-native .verdict-head__title,
    .verdict-native .verdict-head__subtitle,
    .verdict-native .verdict-head__time,
    .verdict-native .appelants,
    .verdict-native .plaintiffs,
    .verdict-native .gegn,
    .verdict-native .verdict__keywords h3,
    .verdict-native .verdict__reifun h3,
    .verdict-native .verdict__keywords li,
    .verdict-native .text-italic {
        color: var(--color-text);
    }
    .verdict-native .verdict__body p,
    .verdict-native .verdict__body blockquote,
    .verdict-native .verdict__body h1,
    .verdict-native .verdict__body h2,
    .verdict-native .verdict__body h3 {
        color: var(--color-text);
    }
    .verdict-native hr {
        border-top-color: var(--color-border);
    }

    .verdict-native .verdict-head__image,
    .verdict-preamble .hr-crest {
        filter: invert(0.85) hue-rotate(180deg);
    }

    /* ── Law / regulation page container ──────────────────────────── */
    .law-page {
        background: var(--color-surface);
    }

    /* ── Law content dark mode ─────────────────────────────────────── */
    .law-content {
        color: var(--color-text);
    }
    .law-content hr {
        border-top-color: var(--color-border);
    }

    /* ── Regulation content dark mode ──────────────────────────────── */
    .regulation-content {
        color: var(--color-text);
    }
    .regulation-content th,
    .regulation-content td {
        border-color: var(--color-border);
    }
    .regulation-content th {
        background: #2a2a2e;
    }

    /* Sidebar */
    .sidebar-input {
        background: var(--color-bg);
        color: var(--color-text);
        border-color: var(--color-border);
    }
    .sidebar-input:focus {
        box-shadow: 0 0 0 2px rgba(74, 139, 194, 0.15);
    }
    .hd-court-chip {
        background: #1e2d42;
        color: #8bb8e8;
        border-color: #2d4a6a;
    }
    .hd-court-chip:hover {
        background: #263d58;
        border-color: #3d6a9a;
    }
    .hd-court-chip.active {
        background: #3d7cc9;
        color: #fff;
        border-color: #3d7cc9;
    }
    .kw-select {
        background: var(--color-bg);
        border-color: var(--color-border);
    }
    .kw-select:focus-within {
        box-shadow: 0 0 0 2px rgba(74, 139, 194, 0.15);
    }
    .sort-btn {
        background: var(--color-bg);
        border-color: var(--color-border);
    }
    .sort-btn.active {
        background: var(--color-primary);
        color: #1a1a1e;
        border-color: var(--color-primary);
    }
    .sort-btn:hover:not(.active) {
        background: rgba(255, 255, 255, 0.06);
    }
    .category-check-item {
        border-bottom-color: rgba(255, 255, 255, 0.05);
    }
    /* Category tiles */
    .category-tile {
        background: var(--color-surface);
        border-color: var(--color-border);
        color: var(--color-text);
    }
    .category-tile-meter {
        background: rgba(255, 255, 255, 0.14);
    }
    .category-tile:hover {
        background: #2a2a30;
        border-color: var(--color-primary-light);
    }
    .category-tile.active {
        background: #1a2a3e;
        border-color: var(--color-primary);
        color: var(--color-primary);
        box-shadow: 0 0 0 1px var(--color-primary);
    }
    .category-tile.active .category-tile-count {
        color: var(--color-primary-light);
        background: rgba(74, 139, 194, 0.15);
    }

    /* Keyword links */
    .case-keywords a {
        color: var(--color-text-light);
    }
    .case-keywords a:hover {
        color: var(--color-primary-light);
    }

    /* Search facets */
    .facet-chip {
        background: var(--color-surface);
        border-color: var(--color-border);
        color: var(--color-text);
    }

    
    a.facet-chip.active {
        border-color: #6b9fd4;
        background: #1a2e45;
        color: #a8ccee;
        box-shadow: 0 0 0 1px #6b9fd4;
    }
    a.facet-chip.active .facet-count { color: #7baed4; }

    /* Category checklist + date inputs */
    .category-check-item:hover {
        background: rgba(74, 139, 194, 0.08);
    }

    /* Snippets */
    .case-snippets .snippet {
        background: #2a2618;
        border-color: #3a3420;
    }

    /* Scrollbar */
    ::-webkit-scrollbar-track { background: var(--color-bg); }
    ::-webkit-scrollbar-thumb { background: #444; }

    /* Donut chart */
    .donut-wrap circle[stroke="#eee"] { stroke: #3a3a3e; }

    /* Breakdown bars */
    .breakdown-row:hover {
        background: rgba(74, 139, 194, 0.06);
    }
    .breakdown-row:hover .breakdown-track {
        border-color: rgba(74, 139, 194, 0.25);
    }
    .breakdown-row.active {
        background: rgba(74, 139, 194, 0.12);
        border-left-color: var(--color-primary);
    }
    .breakdown-row.active .breakdown-label {
        color: var(--color-primary);
    }

    /* Case-type win-rate filter tiles + clickable stat boxes (dark).
       --color-bg-subtle == --color-surface in dark, so the tile needs the darker bg. */
    .ws-item {
        background: var(--color-bg);
    }
    .ws-clickable:hover {
        background: rgba(74, 139, 194, 0.10);
        border-color: var(--color-primary);
    }
    .ws-item.ct-active {
        background: rgba(74, 139, 194, 0.16);
        border-color: var(--color-primary);
    }
    .stat-clickable:hover {
        border-color: var(--color-primary);
        background: rgba(74, 139, 194, 0.08);
    }
    .stat-clickable.stat-active {
        border-color: var(--color-primary);
        background: rgba(74, 139, 194, 0.14);
    }

    /* Breakdown bars — dark tint fills mirroring the dark court badges (role labels follow --color-text).
       --color-bg-subtle == --color-surface in dark, so the track needs the darker bg. */
    .breakdown-track {
        background: var(--color-bg);
        box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
    }
    .breakdown-num { color: #9aa4b0; }  /* default neutral (profmal/prosecutor bars) */
    .bl-defense_lawyer { color: #b794e0; }
    .bf-defense_lawyer { background: #2a2138; box-shadow: inset 0 0 0 1px rgba(183, 148, 224, 0.32); }
    .bf-defense_lawyer + .breakdown-num { color: #b794e0; }
    .bl-defendant_lawyer { color: #9ba1ec; }
    .bf-defendant_lawyer { background: #232548; box-shadow: inset 0 0 0 1px rgba(155, 161, 236, 0.32); }
    .bf-defendant_lawyer + .breakdown-num { color: #9ba1ec; }
    .bl-plaintiff_lawyer { color: #d99a5e; }
    .bf-plaintiff_lawyer { background: #2f2114; box-shadow: inset 0 0 0 1px rgba(217, 154, 94, 0.32); }
    .bf-plaintiff_lawyer + .breakdown-num { color: #d99a5e; }
    .bl-victim_lawyer { color: #d886ae; }
    .bf-victim_lawyer { background: #311f29; box-shadow: inset 0 0 0 1px rgba(216, 134, 174, 0.32); }
    .bf-victim_lawyer + .breakdown-num { color: #d886ae; }
    .bl-guardian { color: #67b1cf; }
    .bf-guardian { background: #1a2b33; box-shadow: inset 0 0 0 1px rgba(103, 177, 207, 0.32); }
    .bf-guardian + .breakdown-num { color: #67b1cf; }
    .bl-rettargaeslu_lawyer { color: #9aabc3; }
    .bf-rettargaeslu_lawyer { background: #242a33; box-shadow: inset 0 0 0 1px rgba(154, 171, 195, 0.3); }
    .bf-rettargaeslu_lawyer + .breakdown-num { color: #9aabc3; }
    .bf-profmal,
    .bf-prosecutor { background: #2a2f36; box-shadow: inset 0 0 0 1px rgba(154, 164, 176, 0.22); }
    .bl-heradsdomstolar { color: #6aa0de; }
    .bf-heradsdomstolar { background: #1a2435; box-shadow: inset 0 0 0 1px rgba(106, 160, 222, 0.32); }
    .bf-heradsdomstolar + .breakdown-num { color: #6aa0de; }
    .bl-landsrettur { color: #c46e7f; }
    .bf-landsrettur { background: #2e1a22; box-shadow: inset 0 0 0 1px rgba(196, 110, 127, 0.32); }
    .bf-landsrettur + .breakdown-num { color: #c46e7f; }
    .bl-haestirettur { color: #52c4a4; }
    .bf-haestirettur { background: #1a2e2c; box-shadow: inset 0 0 0 1px rgba(82, 196, 164, 0.32); }
    .bf-haestirettur + .breakdown-num { color: #52c4a4; }

    .ref-count-badge {
        color: var(--color-text-light);
        background: #3a3a3e;
        box-shadow: none;
    }
    .ref-count-badge:hover {
        color: #fff;
        background: var(--color-primary);
        box-shadow: none;
    }
    .law-total-refs-badge {
        color: var(--color-text-light);
        background: #3a3a3e;
    }
    .law-total-refs-badge:hover {
        color: #fff;
        background: var(--color-primary);
    }
    .mgr-badge {
        color: var(--color-text-light);
        background: #2e2e32;
    }
    .mgr-badge:hover {
        color: #fff;
        background: var(--color-primary);
    }
    .chapter-count {
        color: var(--color-text-light);
        background: #2e2e32;
        border-color: #3a3a3e;
    }
    .chapter-heading:hover .chapter-count {
        color: var(--color-primary);
        border-color: rgba(74, 139, 194, 0.2);
        background: #333338;
    }
    .law-refs-cell {
        color: var(--color-text-light);
    }

    .admin-log-badge.verdict_import { background: #1a2d4d; color: #7aacf0; }
    .admin-log-badge.lawyer_change  { background: #3d2a00; color: #e0a82e; }
    .admin-log-badge.lawyer_scrape  { background: #2a2a2a; color: #999; }
    .admin-log-badge.gazette,
    .admin-log-badge.gazette_event  { background: #2a1d4d; color: #b99cf0; }
    .admin-log-badge.keyword_update { background: #1a3d1a; color: #7ac07a; }
    .admin-log-badge.pipeline_run   { background: #2a2a2a; color: #999; }

    .admin-log-title.positive { color: #4caf50; }
    .admin-log-title.warning  { color: #e0a82e; }
    .admin-log-title.negative { color: #ef5350; }

    .admin-log-entry.has-details:hover {
        background: var(--bg-muted, #2a2a2e);
    }

    .activity-detail-table td {
        border-bottom-color: #3a3a3e;
    }

    .activity-detail-table th {
        border-bottom-color: #4a4a4e;
    }

    /* Admin tabs */
    .admin-tabs { border-bottom-color: var(--color-border, #3a3a3e); }
    .admin-tab:hover { color: var(--color-text); }
    .admin-tab.active { color: #6a9fd5; border-bottom-color: #6a9fd5; }

    /* Login page */
    .login-error {
        background: #2c1810;
        border-color: #5a2015;
        color: #f04438;
    }
    .auth-btn-google {
        background: #2a2a2e;
        color: var(--color-text);
        border-color: var(--color-border);
    }
    .auth-btn-google:hover {
        background: #333338;
    }
    .auth-btn-microsoft {
        background: #2a2a2e;
        color: var(--color-text);
        border-color: var(--color-border);
    }
    .auth-btn-microsoft:hover {
        background: #333338;
    }
}

/* ---------------------------------------------------------------------------
   Print — drop site chrome so a printed / PDF-saved verdict is just the ruling.
   Lawyers routinely print rulings; the header, nav, action bar, progress bar and
   footer have no place on a printed legal document. Verdict typography (the serif
   font and text width) is intentionally left untouched.
   --------------------------------------------------------------------------- */
@media print {
    header,
    footer,
    .main-nav,
    .skip-to-content,
    .reading-progress,
    .verdict-top-bar {
        display: none !important;
    }

    body {
        background: #fff;
    }
}

/* ---------------------------------------------------------------------------
   Reduced motion — honour the OS "reduce motion" setting for users with
   vestibular sensitivity. Disables smooth-scroll jumps and near-instantly
   completes transitions/animations (iteration-count:1 so the infinite spinner
   finishes one cycle instead of freezing mid-spin).
   --------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
