/* Law viewer — extracted from law_xml_renderer.py inline styles. */

.law-section {
    font-size: 1.125rem;
    font-weight: 700;
    color: #111827;
    margin-top: 2rem;
    margin-bottom: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.law-article {
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    scroll-margin-top: 5rem;
}

.law-article-num {
    color: #1d4ed8;
    font-weight: 600;
}

.law-article-title {
    color: #4b5563;
    margin-left: 0.25rem;
}

.law-paragraph,
.law-ho,
.law-mok {
    line-height: 1.75;
    margin-bottom: 0.25rem;
}

.law-paragraph {
    color: #1f2937;
    margin-left: 1rem;
}

.law-ho {
    color: #374151;
    margin-left: 2.5rem;
}

.law-mok {
    color: #374151;
    margin-left: 4rem;
}

.law-box,
.law-formula,
.law-fallback {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 0.375rem;
    padding: 0.75rem 1rem;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #1f2937;
    white-space: pre-wrap;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
}

.law-formula {
    line-height: 1.8;
}

.law-table {
    width: 100%;
    border-collapse: collapse;
    margin: 0.5rem 0;
    font-size: 0.875rem;
    color: #1f2937;
}

.law-table th {
    background: #f3f4f6;
    text-align: left;
    padding: 0.5rem 0.75rem;
    font-weight: 600;
    border: 1px solid #d1d5db;
}

.law-table td {
    padding: 0.5rem 0.75rem;
    border: 1px solid #d1d5db;
}

/* Citation badge + expandable panel */
.law-cite-badge {
    display: inline-flex;
    align-items: center;
    margin-left: 0.75rem;
    padding: 0.125rem 0.625rem;
    font-size: 0.75rem;
    /* 5.2:1 contrast on #fafaf9 (stone-700 vs stone-50) meets WCAG AA. */
    color: #57534e;
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 9999px;
    cursor: pointer;
    vertical-align: middle;
    font-weight: 500;
    line-height: 1.5;
}

.law-cite-badge:hover {
    background: #f5f5f4;
}

.law-cite-panel {
    background: #fafaf9;
    border: 1px solid #e7e5e4;
    border-radius: 0.5rem;
    padding: 0.5rem 0.75rem;
    margin: 0.25rem 0 0.5rem 0;
}

.law-cite-panel[hidden] {
    display: none;
}

.law-cite-item {
    display: block;
    font-size: 0.8125rem;
    padding: 0.1875rem 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.law-cite-item[href] {
    color: #b45309;
    text-decoration: none;
}

.law-cite-item:not([href]) {
    color: #78716c;
}

.law-cite-item-name {
    color: #78716c;
    font-size: 0.75rem;
    margin-left: 0.25rem;
}

.law-cite-type {
    display: inline-block;
    padding: 0.0625rem 0.375rem;
    font-size: 0.75rem;
    font-weight: 500;
    border-radius: 0.25rem;
    margin-right: 0.375rem;
}

.law-cite-type-prec {
    color: #0f766e;
    background: #ccfbf1;
}

.law-cite-type-detc {
    color: #be123c;
    background: #ffe4e6;
}

.law-cite-type-expc {
    color: #c2410c;
    background: #ffedd5;
}

.law-cite-count-prec {
    color: #0f766e;
}

.law-cite-count-detc {
    color: #be123c;
}

.law-cite-count-expc {
    color: #c2410c;
}

/* Degraded rendering */
.law-fallback {
    line-height: 1.75;
    color: #374151;
}

/* Narrow viewports: default indent margins overflow on <=640px. */
@media (max-width: 640px) {
    .law-paragraph { margin-left: 0.5rem; }
    .law-ho { margin-left: 1.25rem; }
    .law-mok { margin-left: 2rem; }
}
