:root {
    --color-brand: #e4022c;
    --color-brand-dark: #c4021f;
    --color-text: #333333;
    --color-bg: #f5f5f5;
    --color-surface: #ffffff;
    --color-border: #e0e0e0;
    --color-error: #dc2626;
    --color-warning: #d97706;
    --color-success: #16a34a;
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

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

body {
    font-family: var(--font-family);
    background-color: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
    font-size: 14px;
}

/* Header — matches uniformat.ca website */
.site-header {
    border-bottom: 1px solid #e2e8f0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 100;
    padding: 0 1.25rem;
}

.site-header-inner {
    max-width: 960px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 56px;
    gap: 1rem;
}

.site-logo {
    font-weight: 700;
    font-size: 1.15rem;
    color: #2c4ecb;
    text-decoration: none;
    letter-spacing: -0.01em;
    flex-shrink: 0;
}

.site-logo:hover {
    color: #1a3399;
}

.site-nav {
    display: flex;
    gap: 0.25rem;
    align-items: center;
}

.site-nav a {
    color: #5a6478;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.35rem 0.65rem;
    border-radius: 6px;
    transition: color 0.15s, background 0.15s;
}

.site-nav a:hover {
    color: #2c4ecb;
    background: #e8eeff;
}

.nav-cta {
    background: #2c4ecb !important;
    color: #fff !important;
    font-weight: 600;
    padding: 0.4rem 0.9rem !important;
    border-radius: 6px !important;
}

.nav-cta:hover {
    background: #1a3399 !important;
}

/* Main Layout */
main {
    max-width: 960px;
    margin: 2rem auto;
    padding: 0 1rem;
}

.intro {
    margin-bottom: 1.5rem;
}

.intro h2 {
    font-size: 1.5rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: #111;
}

.intro p {
    color: #666;
    font-size: 0.95rem;
}

.guide-link {
    color: var(--color-brand);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-brand);
    transition: border-color 0.2s;
}

.guide-link:hover {
    border-bottom-style: solid;
}

.guide-link:focus {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

/* Upload Zone */
.dropzone {
    background: var(--color-surface);
    border: 2px dashed var(--color-border);
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    cursor: pointer;
    margin-bottom: 2rem;
    min-height: 180px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.dropzone:hover, .dropzone.dz-drag-hover {
    border-color: var(--color-brand);
    background-color: #fffafa;
}

.dropzone:focus-within {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.dropzone .dz-message {
    margin: 0;
}

.dropzone .dz-message .title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #444;
    margin-bottom: 0.5rem;
    display: block;
}

.dropzone .dz-message .subtitle {
    font-size: 0.9rem;
    color: #888;
}

/* File Preview Container */
#file-preview:not(:empty) {
    padding: 1rem 0;
    margin-bottom: 1rem;
}

#file-preview:not(:empty)::before {
    content: 'Document téléversé';
    display: block;
    font-size: 1.1rem;
    font-weight: 500;
    color: #111;
    margin-bottom: 0.75rem;
}

#file-preview .dz-preview {
    width: 100%;
    max-width: 100%;
    margin: 0 !important;
    padding: 0.75rem 1rem !important;
    background: #fafafa !important;
    border: 1px solid var(--color-border) !important;
    border-radius: 4px !important;
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    gap: 0.75rem;
    position: relative !important;
    min-height: auto !important;
}

#file-preview .dz-preview.dz-success {
    border-left: 3px solid var(--color-success) !important;
}

#file-preview .dz-preview.dz-error {
    border-left: 3px solid var(--color-error) !important;
}

#file-preview .dz-preview .dz-image { display: none; }

#file-preview .dz-preview .dz-details {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;
    flex: 1;
    min-width: 0;
    margin: 0 !important;
    opacity: 1 !important;
    position: relative !important;
    padding: 0 !important;
}

#file-preview .dz-preview .dz-filename {
    font-weight: 500 !important;
    color: var(--color-text) !important;
    font-size: 0.875rem !important;
    margin-bottom: 0.125rem !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 100%;
}

#file-preview .dz-preview .dz-size {
    font-size: 0.75rem !important;
    color: #999 !important;
    margin-bottom: 0 !important;
}

/* Progress bar */
#file-preview .dz-preview .dz-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: transparent;
    border-radius: 0 0 4px 4px;
    overflow: hidden;
}

#file-preview .dz-preview .dz-progress .dz-upload {
    height: 100%;
    background: var(--color-brand);
    transition: width 0.2s ease;
}

#file-preview .dz-preview.dz-success .dz-progress,
#file-preview .dz-preview.dz-error .dz-progress {
    display: none;
}

#file-preview .dz-preview .dz-status {
    font-size: 0.75rem;
    color: var(--color-success);
    display: none;
}

#file-preview .dz-preview.dz-success .dz-status {
    display: block;
}

#file-preview .dz-preview .dz-error-message {
    font-size: 0.75rem !important;
    color: var(--color-error) !important;
    display: none;
}

#file-preview .dz-preview.dz-error .dz-error-message {
    display: block;
}

#file-preview .dz-preview .dz-remove {
    padding: 0;
    font-size: 0.75rem;
    color: #999;
    background: none;
    border: none;
    cursor: pointer;
    font-family: inherit;
}

#file-preview .dz-preview .dz-remove:hover {
    color: var(--color-error);
}

/* Results Section - State Management */
#results-section .processing,
#results-section .results-content,
#results-section .empty-results,
#results-section .empty-filter {
    display: none;
}

#results-section.is-loading .processing { display: block; }
#results-section.has-results .results-content { display: block; }
#results-section.is-empty .empty-results { display: block; }
#results-section.has-results .empty-filter.visible { display: block; }
#results-section.has-results .table-container.hidden { display: none; }
#results-section .error-state { display: none; }
#results-section.is-error .error-state { display: block; }

/* Processing */
.processing {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 1rem;
}

.spinner {
    display: inline-block;
    width: 24px;
    height: 24px;
    border: 3px solid var(--color-border);
    border-top-color: var(--color-brand);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 0.75rem;
    vertical-align: middle;
}

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

.processing-text {
    color: #555;
    font-size: 1rem;
    vertical-align: middle;
    transition: opacity 0.15s ease;
}

.processing-text.fade-out {
    opacity: 0;
}

/* Error State */
.error-state {
    background: var(--color-surface);
    border: 1px solid var(--color-error);
    border-left: 4px solid var(--color-error);
    border-radius: 6px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.error-state-header {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.error-state-icon {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    background: #fee2e2;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-error);
    font-size: 1.25rem;
}

.error-state-content {
    flex: 1;
}

.error-state-title {
    font-weight: 600;
    color: var(--color-error);
    font-size: 1rem;
    margin-bottom: 0.25rem;
}

.error-state-message {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

.error-state-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    font-family: inherit;
    text-decoration: none;
}

.btn-primary {
    background: var(--color-brand);
    color: white;
    border: 1px solid var(--color-brand);
}

.btn-primary:hover {
    background: var(--color-brand-dark, #c4021f);
    border-color: var(--color-brand-dark, #c4021f);
}

.btn-secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn-secondary:hover {
    background: #f5f5f5;
    border-color: #ccc;
}

/* Results Header */
.results-header {
    margin-bottom: 1rem;
}

.results-title {
    font-size: 1.1rem;
    font-weight: 500;
    color: #111;
    margin: 0;
}

/* Summary Tabs */
.summary-bar {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 0;
}

.summary-stat {
    flex: 0 1 auto;
    min-width: 100px;
    padding: 0.875rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.15s ease;
    position: relative;
    background: transparent;
    border: none;
    border-radius: 6px 6px 0 0;
    font-family: inherit;
    margin-bottom: -1px;
}

.summary-stat:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.summary-stat:focus {
    outline: none;
    box-shadow: inset 0 0 0 2px var(--color-brand);
}

.summary-stat:focus:not(:focus-visible) {
    box-shadow: none;
}

.summary-stat:focus-visible {
    box-shadow: inset 0 0 0 2px var(--color-brand);
}

.summary-stat.active {
    background-color: var(--color-surface);
    border: 1px solid var(--color-border);
    border-bottom-color: var(--color-surface);
}

.summary-stat.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40%;
    height: 3px;
    border-radius: 3px 3px 0 0;
    background-color: #666;
}

.summary-stat.active.stat-error::after { background-color: var(--color-error); }
.summary-stat.active.stat-warning::after { background-color: var(--color-warning); }
.summary-stat.active.stat-success::after { background-color: var(--color-success); }

.stat-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #888;
    font-weight: 600;
    margin-bottom: 0.375rem;
}

.summary-stat.active .stat-label {
    color: #555;
}

.stat-value {
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    color: #444;
}

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

/* Results Table */
.results-table {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
    border-collapse: collapse;
    width: 100%;
}

.results-table thead {
    background-color: #fafafa;
    border-bottom: 1px solid var(--color-border);
}

.results-table th {
    text-align: left;
    padding: 0.75rem 1rem;
    font-size: 0.8rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
}

.results-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-border);
    vertical-align: top;
}

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

.results-table tr:hover {
    background-color: #fafafa;
}

.col-rule { flex: 1; }
.col-status { width: 150px; text-align: right; }

.rule-name {
    font-weight: 500;
    color: #333;
}

.rule-placeholder {
    color: #aaa;
    font-style: italic;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1;
}

.status-indicator.error { color: var(--color-error); }
.status-indicator.warning { color: var(--color-warning); }
.status-indicator.success { color: var(--color-success); }

.status-indicators {
    display: flex;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: flex-end;
    align-items: center;
}

.msg-text {
    color: #222;
    word-break: break-word;
}

/* Expandable Rows */
.rule-row {
    cursor: pointer;
    transition: all 0.15s ease;
}

.rule-row:hover {
    background-color: #f8f9fa;
}

.rule-row.expanded {
    background-color: #f8f9fa;
    box-shadow: inset 0 1px 0 rgba(0,0,0,0.04);
}

.rule-row.expanded td {
    border-bottom-color: transparent;
}

.rule-row .expand-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 4px;
    color: #aaa;
    background-color: transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-top: 0.1rem;
}

.rule-row:hover .expand-icon {
    background-color: rgba(0,0,0,0.05);
    color: #666;
}

.rule-row .expand-icon svg {
    display: block;
}

.rule-row.expanded .expand-icon {
    transform: rotate(90deg);
    color: var(--color-brand);
    background-color: rgba(228, 2, 44, 0.08);
}

.rule-row .rule-info {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0.5rem;
}

.rule-row .rule-text {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.rule-row .rule-name {
    font-weight: 600;
    color: #222;
    display: flex;
    align-items: center;
    font-size: 0.925rem;
}

.rule-row .rule-description {
    font-size: 0.8rem;
    color: #888;
    line-height: 1.4;
}

.details-row {
    display: none;
    background-color: #f8f9fa;
}

.details-row.visible {
    display: table-row;
    animation: slideDown 0.2s ease-out;
}

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

.details-row td {
    padding: 0 1rem 1rem 1rem;
    border-bottom: 1px solid var(--color-border);
}

.details-content {
    background: var(--color-surface);
    border-radius: 8px;
    padding: 0.75rem;
    margin-left: calc(24px + 0.5rem);
    margin-top: 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    border: 1px solid var(--color-border);
    border-left: 3px solid var(--color-border);
}

.rule-row.expanded[data-type="error"] + .details-row .details-content {
    border-left-color: var(--color-error);
    background: linear-gradient(to right, rgba(220, 38, 38, 0.02), transparent 20%);
}
.rule-row.expanded[data-type="warning"] + .details-row .details-content {
    border-left-color: var(--color-warning);
    background: linear-gradient(to right, rgba(217, 119, 6, 0.02), transparent 20%);
}
.rule-row.expanded[data-type="success"] + .details-row .details-content {
    border-left-color: var(--color-success);
    background: linear-gradient(to right, rgba(22, 163, 74, 0.02), transparent 20%);
}

.details-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.details-list li {
    padding: 0.625rem 0.75rem;
    font-size: 0.85rem;
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    border-radius: 6px;
    transition: background-color 0.15s ease;
    margin: 0.25rem 0;
    line-height: 1.5;
    color: #444;
}

.details-list li:hover {
    background-color: rgba(0, 0, 0, 0.03);
}

.details-list li:first-child {
    margin-top: 0;
}

.details-list li:last-child {
    margin-bottom: 0;
}

.details-list .detail-icon {
    flex-shrink: 0;
    font-size: 0.7rem;
    margin-top: 0.35rem;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.details-list .detail-icon.error {
    color: var(--color-error);
    background-color: rgba(220, 38, 38, 0.1);
}
.details-list .detail-icon.warning {
    color: var(--color-warning);
    background-color: rgba(217, 119, 6, 0.1);
}
.details-list .detail-icon.info {
    color: var(--color-success);
    background-color: rgba(22, 163, 74, 0.1);
    margin-top: 0.15rem;
}

/* Nested Validated Section */
.validated-section {
    border-top: 1px solid var(--color-border);
    margin-top: 0.5rem;
    padding-top: 0.5rem;
}

.validated-section:first-child {
    border-top: none;
    margin-top: 0;
    padding-top: 0;
}

.validated-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    background: none;
    border: none;
    font-family: inherit;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--color-success);
    cursor: pointer;
    padding: 0.375rem 0.5rem;
    border-radius: 4px;
    transition: background-color 0.15s ease;
}

.validated-toggle:hover {
    background-color: rgba(22, 163, 74, 0.08);
}

.validated-toggle:focus-visible {
    outline: 2px solid var(--color-success);
    outline-offset: 2px;
}

.validated-toggle-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

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

.validated-list {
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

.validated-section.open .validated-list {
    max-height: 2000px;
    opacity: 1;
}

/* Category Headers */
.category-row td {
    background-color: #f0f0f0;
    padding: 0.5rem 1rem;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    color: #555;
    border-bottom: 1px solid var(--color-border);
}

.category-row:hover {
    background-color: #f0f0f0;
}

.empty-state {
    padding: 3rem;
    text-align: center;
    color: #888;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
}

/* Footer */
footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    font-size: 0.8rem;
}

.footer-link {
    color: #888;
    text-decoration: none;
}

.footer-link:hover {
    color: var(--color-brand);
}

/* =============================================
   Norms Page Styles
   ============================================= */

.norms-note {
    color: #888;
    font-size: 0.85rem;
    margin-top: 0.5rem;
}

/* Callout Box */
.norms-callout {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-left: 4px solid var(--color-brand);
    border-radius: 6px;
    padding: 1rem 1.25rem;
    margin-bottom: 1.5rem;
}

.norms-callout-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #111;
    margin-bottom: 0.25rem;
}

.norms-callout p {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
    margin: 0;
}

.norms-callout a {
    color: var(--color-brand);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-brand);
}

.norms-callout a:hover {
    border-bottom-style: solid;
}

/* Group Sections */
.norms-group {
    margin-bottom: 2.5rem;
}

.norms-group-heading {
    font-size: 1.15rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.75rem;
    padding-bottom: 0;
}

.norms-subheading {
    font-size: 0.95rem;
    font-weight: 600;
    color: #555;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
}

/* Card container */
.norms-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    overflow: hidden;
}

/* Norm accordion items */
.norm-item {
    border-bottom: 1px solid var(--color-border);
}

.norm-item:last-child {
    border-bottom: none;
}

.norm-item summary {
    padding: 0.75rem 1rem;
    font-weight: 600;
    font-size: 0.9rem;
    color: #222;
    cursor: pointer;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease;
    user-select: none;
}

.norm-item summary::-webkit-details-marker {
    display: none;
}

.norm-item summary::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-right: 1.5px solid #999;
    border-bottom: 1.5px solid #999;
    transform: rotate(-45deg);
    transition: transform 0.2s ease;
    flex-shrink: 0;
}

.norm-item[open] summary::before {
    transform: rotate(45deg);
}

.norm-item summary:hover {
    background-color: #fafafa;
}

.norm-item summary:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: -2px;
}

.norm-title {
    flex: 1;
}

/* Badges */
.norm-badge {
    display: inline-flex;
    align-items: center;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0.15rem 0.5rem;
    border-radius: 3px;
    line-height: 1.4;
    flex-shrink: 0;
}

.badge-done {
    background: #dcfce7;
    color: #15803d;
}

.badge-partial {
    background: #fef3c7;
    color: #92400e;
}

/* Norm body */
.norm-body {
    padding: 0.5rem 1rem 0.875rem 1.75rem;
    font-size: 0.875rem;
    color: #444;
    line-height: 1.6;
}

.norm-body > p {
    margin-bottom: 0.375rem;
}

.norm-body > p:last-child {
    margin-bottom: 0;
}

/* Rule rows (label/value) */
.norm-rule {
    display: grid;
    grid-template-columns: 200px 1fr;
    gap: 0.75rem;
    padding: 0.625rem 0;
    border-bottom: 1px solid #f0f0f0;
}

.norm-rule:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.norm-rule:first-child {
    padding-top: 0;
}

.norm-rule-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: #555;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    line-height: 1.6;
    display: flex;
    align-items: baseline;
    gap: 0.375rem;
}

.norm-rule-label .norm-badge {
    font-size: 0.55rem;
    padding: 0.1rem 0.3rem;
}

.norm-rule-text {
    font-size: 0.875rem;
    color: #444;
    line-height: 1.6;
}

.norm-rule-text p {
    margin-bottom: 0.375rem;
}

.norm-rule-text p:last-child {
    margin-bottom: 0;
}

.norm-rule-text ul {
    margin: 0.375rem 0 0.375rem 1.25rem;
    padding: 0;
}

.norm-rule-text ul li {
    margin-bottom: 0.2rem;
}

.norm-rule-text ul ul {
    margin-top: 0.2rem;
}

.norm-rule-text a,
.norm-body a {
    color: var(--color-brand);
    text-decoration: none;
    border-bottom: 1px dotted var(--color-brand);
}

.norm-rule-text a:hover,
.norm-body a:hover {
    border-bottom-style: solid;
}

/* Divider between norms and secondary content */
.norms-divider {
    border: none;
    border-top: 1px solid var(--color-border);
    margin: 1rem 0 2.5rem;
}

/* Secondary section (internal notes, not part of the norms summary) */
.norms-secondary {
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.norms-secondary:hover {
    opacity: 1;
}

.norms-secondary-desc {
    font-size: 0.85rem;
    color: #888;
    margin-bottom: 0.75rem;
    line-height: 1.5;
}

/* Link cards */
.norms-links {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.norms-link-card {
    display: flex;
    flex-direction: column;
    padding: 1rem 1.25rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    text-decoration: none;
    transition: all 0.15s ease;
    flex: 1;
    min-width: 200px;
}

.norms-link-card:hover {
    border-color: var(--color-brand);
    box-shadow: 0 2px 8px rgba(228, 2, 44, 0.08);
}

.norms-link-card:focus-visible {
    outline: 2px solid var(--color-brand);
    outline-offset: 2px;
}

.norms-link-card-title {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--color-text);
}

.norms-link-card:hover .norms-link-card-title {
    color: var(--color-brand);
}

.norms-link-card-desc {
    font-size: 0.8rem;
    color: #888;
    margin-top: 0.125rem;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .site-nav { display: none; }

    main {
        padding: 0 0.75rem;
        margin: 1rem auto;
    }

    .intro h2 {
        font-size: 1.25rem;
    }

    .summary-bar {
        gap: 0.25rem;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        margin-bottom: 1rem;
    }

    .summary-bar::-webkit-scrollbar {
        display: none;
    }

    .summary-stat {
        min-width: 70px;
        padding: 0.625rem 0.75rem;
    }

    .stat-label {
        font-size: 0.6rem;
    }

    .stat-value {
        font-size: 1rem;
    }

    /* Card layout for table on mobile */
    .results-table {
        border: none;
        background: transparent;
    }

    .results-table thead {
        display: none;
    }

    .results-table tbody {
        display: flex;
        flex-direction: column;
        gap: 0.5rem;
    }

    /* Category rows on mobile */
    .category-row {
        display: block;
        margin-top: 1rem;
        margin-bottom: 0.25rem;
    }

    .category-row:first-child {
        margin-top: 0;
    }

    .category-row td {
        background: transparent;
        padding: 0.5rem 0;
        border-bottom: none;
        font-size: 0.75rem;
    }

    /* Rule rows as cards on mobile */
    .rule-row {
        display: flex;
        flex-direction: column;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 8px;
        padding: 0.875rem;
        gap: 0.75rem;
    }

    .rule-row td {
        display: block;
        padding: 0;
        border: none;
    }

    .rule-row td:last-child {
        order: -1;
    }

    .rule-row .rule-info {
        gap: 0.375rem;
    }

    .rule-row .expand-icon {
        width: 20px;
        height: 20px;
    }

    .rule-row .rule-name {
        font-size: 0.875rem;
    }

    .rule-row .rule-description {
        font-size: 0.75rem;
    }

    .status-indicator {
        font-size: 0.75rem;
    }

    .status-indicators {
        gap: 0.75rem;
    }

    /* Details row on mobile */
    .details-row {
        display: none;
        background: transparent;
    }

    .details-row.visible {
        display: block;
        margin-top: -0.5rem;
        margin-bottom: 0.5rem;
    }

    .details-row td {
        display: block;
        padding: 0;
    }

    .details-content {
        margin-left: 0;
        border-radius: 0 0 8px 8px;
        border-top: none;
        margin-top: 0;
    }

    .details-list li {
        padding: 0.5rem;
        font-size: 0.8rem;
    }

    .details-list .detail-icon {
        width: 14px;
        height: 14px;
        font-size: 0.6rem;
    }

    .validated-toggle {
        font-size: 0.75rem;
        padding: 0.25rem 0.375rem;
    }

    .col-status, .col-rule { width: auto; }

    /* Norms page mobile adjustments */
    .norms-group-heading {
        font-size: 1rem;
    }

    .norm-rule {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .norm-rule-label {
        font-size: 0.7rem;
    }

    .norm-item summary {
        font-size: 0.85rem;
        padding: 0.625rem 0.75rem;
    }

    .norm-body {
        padding: 0 0.75rem 0.75rem 1.25rem;
        font-size: 0.825rem;
    }

    .norms-links {
        flex-direction: column;
    }

    .norms-link-card {
        min-width: 0;
    }
}

/* ==============================
   Header back button
   ============================== */

.brand-back {
    color: rgba(255,255,255,0.85);
    text-decoration: none;
    font-size: 1.2rem;
    margin-right: 0.75rem;
    line-height: 1;
    flex-shrink: 0;
}

.brand-back:hover {
    color: #ffffff;
}

/* ==============================
   Landing Page
   ============================== */

body.landing-page {
    background-color: #f0f2f5;
}

.landing-header {
    background-color: #1a1a2e;
    color: #ffffff;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.landing-brand {
    font-size: 1.4rem;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}

.landing-tagline {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.65);
    margin: 0;
}

.landing-main {
    max-width: 1100px;
    margin: 2.5rem auto;
    padding: 0 1.5rem;
}

.landing-intro {
    margin-bottom: 2rem;
    text-align: center;
}

.landing-intro h1 {
    font-size: 1.75rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.5rem;
}

.landing-intro p {
    color: #666;
    font-size: 1rem;
}

.university-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.university-card {
    background: var(--color-surface);
    border-radius: 10px;
    border: 1px solid var(--color-border);
    padding: 1.5rem 1rem 1.25rem;
    text-decoration: none;
    color: var(--color-text);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.875rem;
    transition: box-shadow 0.15s ease, transform 0.15s ease, border-color 0.15s ease;
    cursor: pointer;
}

.university-card:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    transform: translateY(-2px);
    border-color: var(--uni-color);
}

.university-card:focus {
    outline: 2px solid var(--uni-color);
    outline-offset: 2px;
}

.university-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background-color: var(--uni-color);
    color: var(--uni-text);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    flex-shrink: 0;
    text-align: center;
    line-height: 1.2;
    padding: 0 6px;
}

.university-name {
    font-size: 0.8rem;
    color: #444;
    text-align: center;
    line-height: 1.4;
}

.landing-footer {
    text-align: center;
    color: #999;
    font-size: 0.8rem;
    padding: 2rem 1rem;
}

/* ==============================
   Results gate (obfuscation CTA)
   ============================== */

.table-wrapper {
    position: relative;
}

.results-gate {
    display: none;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 220px;
    background: linear-gradient(to bottom, transparent 0%, rgba(255,255,255,0.92) 35%, rgba(255,255,255,0.98) 60%, #ffffff 100%);
    z-index: 10;
    align-items: flex-end;
    justify-content: center;
    padding-bottom: 1.5rem;
}

.results-gate.visible {
    display: flex;
}

.results-gate-content {
    text-align: center;
    max-width: 420px;
    padding: 0 1rem;
}

.results-gate-icon {
    font-size: 1.75rem;
    margin-bottom: 0.5rem;
}

.results-gate-content h4 {
    font-size: 1rem;
    font-weight: 600;
    color: #111;
    margin-bottom: 0.4rem;
}

.results-gate-content p {
    font-size: 0.875rem;
    color: #555;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.btn-cta {
    font-size: 0.9rem;
    padding: 0.625rem 1.25rem;
}

/* Rows that are blurred in the obfuscated tail */
.rule-row.obfuscated,
.details-row.obfuscated {
    filter: blur(4px);
    user-select: none;
    pointer-events: none;
}

/* ==============================
   Footer separator
   ============================== */

.footer-sep {
    color: rgba(255,255,255,0.4);
}

.footer-link {
    color: rgba(255,255,255,0.8);
    text-decoration: none;
}

.footer-link:hover {
    color: #ffffff;
}

/* ==============================
   Landing page responsive
   ============================== */

@media (max-width: 600px) {
    .landing-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.25rem;
        padding: 1rem 1.25rem;
    }

    .university-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 0.75rem;
    }

    .university-logo {
        width: 60px;
        height: 60px;
        font-size: 0.85rem;
    }
}
