/* =========================================== */
/* UUStreak - WCAG AAA Compliant Styles */
/* =========================================== */
/* Colour palette - WCAG AAA compliant in both modes.
 * light-dark(light, dark) follows the user's OS setting (prefers-color-scheme)
 * unless the theme toggle sets data-theme="light" or data-theme="dark" on <html>. */
:root {
    color-scheme: light dark;
    --color-bg: light-dark(#ffffff, #121212);
    --color-bg-alt: light-dark(#f5f5f5, #1e1e1e);
    --color-bg-alt2: light-dark(#f8f9fa, #252526);
    --color-bg-alt3: light-dark(#f2f2f2, #2d2d2d);
    --color-bg-primary: light-dark(#000000, #ffffff);
    --color-bg-primary-hover: light-dark(#333333, #e0e0e0);
    --color-bg-secondary: light-dark(#ffffff, #1e1e1e);
    --color-bg-secondary-hover: light-dark(#f2f2f2, #2d2d2d);
    --color-text: light-dark(#000000, #ffffff);
    --color-text-secondary: light-dark(#333333, #e0e0e0);
    --color-text-tertiary: light-dark(#666666, #aaaaaa);
    --color-text-inverse: light-dark(#ffffff, #000000);
    --color-border: light-dark(#d1d5db, #404040);
    --color-border-alt: light-dark(#e5e7eb, #505050);
    --color-border-secondary: light-dark(#666666, #aaaaaa);
    --color-border-secondary-hover: light-dark(#444444, #cccccc);
    --color-accent: light-dark(#0b5cad, #66b2ff);
    --color-accent-hover: light-dark(#08468c, #99c9ff);
    --color-success: light-dark(#1c7c36, #4ade80);
    --color-warning: light-dark(#723f12, #fbbf24);
    --color-error: light-dark(#dc2626, #f87171);
    --color-info: light-dark(#0b5cad, #66b2ff);
    --color-invalid-link: light-dark(#dc2626, #f87171);
    --color-invalid-bg: light-dark(#fee2e2, #4a1a1a);
    --color-link: light-dark(#0b5cad, #66b2ff);
    --color-link-visited: light-dark(#5a2d91, #99c9ff);
    --color-focus: light-dark(#0066cc, #66ccff);
    --color-scroll-track: light-dark(#f1f1f1, #333333);
    --color-scroll-thumb: light-dark(#888888, #aaaaaa);
    --color-scroll-thumb-hover: light-dark(#666666, #cccccc);
}

:root[data-theme="light"] {
    color-scheme: light;
}

:root[data-theme="dark"] {
    color-scheme: dark;
}

/* =========================================== */
/* Base Styles */
/* =========================================== */

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

.skip-link {
    position: absolute;
    left: -9999px;
    top: auto;
    width: 1px;
    height: 1px;
    overflow: hidden;
}
.skip-link:focus {
    position: fixed;
    left: 1rem;
    top: 1rem;
    width: auto;
    height: auto;
    background: var(--color-bg-primary);
    color: var(--color-text-inverse);
    padding: 0.75rem 1rem;
    z-index: 10000;
    border-radius: 4px;
}

body {
    font-family: system-ui, -apple-system, sans-serif;
    line-height: 1.5;
    padding: 1rem;
    max-width: 100vw;
    overflow-x: hidden;
    background-color: var(--color-bg);
    color: var(--color-text);
}

/* Theme-aware default link colors */
a {
    color: var(--color-link);
    text-decoration: underline;
}

a:visited {
    color: var(--color-link-visited);
}

a:hover,
a:focus {
    color: var(--color-accent-hover);
}

main {
    max-width: 1200px;
    margin: 0 auto;
}

h1 {
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    margin-bottom: 1rem;
    color: var(--color-text);
}

.page-hero {
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.project-menu {
    position: relative;
}

.project-menu[open] > .project-navigation {
    display: flex;
}

.project-navigation {
    display: none;
    position: absolute;
    inset-inline-end: 0;
    top: calc(100% + 0.5rem);
    z-index: 110;
    flex-direction: column;
    width: min(22rem, calc(100vw - 2rem));
    max-height: 60vh;
    overflow-y: auto;
    padding: 0.5rem;
    border: 2px solid var(--color-border-secondary);
    border-radius: 4px;
    background: var(--color-bg-secondary);
}

.project-navigation a {
    padding: 0.75rem;
    overflow-wrap: anywhere;
}

.project-navigation a:hover,
.project-navigation a:focus-visible {
    background: var(--color-bg-secondary-hover);
}

@media (max-width: 600px) {
    .project-navigation {
        position: static;
        margin-top: 0.5rem;
        max-width: 100%;
    }
}

.project-information {
    margin-block: 2rem;
    line-height: 1.6;
}

.project-information section {
    margin-block: 1.5rem;
    scroll-margin-top: 1rem;
}

.project-information p {
    margin-block: 0.75rem;
}

.hero-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem 1.5rem;
}

.hero-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.hero-actions button,
.project-menu > summary {
    padding: 0.75rem 1.25rem;
    font-size: 1rem;
    border-radius: 4px;
    border: 2px solid var(--color-bg-primary);
    background: var(--color-bg-primary);
    color: var(--color-text-inverse);
    cursor: pointer;
}

.project-menu > summary,
.hero-actions .theme-toggle {
    border-color: var(--color-border-secondary);
    color: var(--color-text);
    background: var(--color-bg-secondary);
}

.hero-actions .theme-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.hero-actions button:hover {
    background-color: var(--color-bg-primary-hover);
    border-color: var(--color-bg-primary-hover);
}

.project-menu > summary:hover,
.hero-actions .theme-toggle:hover {
    background-color: var(--color-bg-secondary-hover);
    border-color: var(--color-border-secondary-hover);
}

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

/* Toolbar above the table: date navigation | view options | summaries */
.toolbar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 1rem 1.5rem;
    margin-bottom: 1.5rem;
    padding: 0.75rem 1rem;
    background-color: var(--color-bg-alt2);
    border: 1px solid var(--color-border);
    border-radius: 8px;
}

.toolbar .view-controls {
    justify-content: center;
}

.report-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.75rem;
}

.view-selector-group {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.view-selector-group[hidden],
.detail-columns-toggle[hidden] {
    display: none;
}

/* Per violation type / WCAG tag columns are collapsed until expanded */
table.details-collapsed th.detail-col,
table.details-collapsed td.detail-col {
    display: none;
}

.detail-columns-toggle[aria-expanded="false"]::before {
    content: "▸ ";
}

.detail-columns-toggle[aria-expanded="true"]::before {
    content: "▾ ";
}

@media (max-width: 1100px) {
    .toolbar {
        grid-template-columns: 1fr 1fr;
    }
    .toolbar .navigation-controls {
        justify-content: flex-start;
    }
    .toolbar .view-controls {
        grid-column: 1 / -1;
        grid-row: 2;
        justify-content: flex-start;
    }
}

/* =========================================== */
/* Table Styles - WCAG AAA Compliant */
/* =========================================== */

/* Enhanced table wrapper with visible scrollbar */
.table-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin-bottom: 1rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    border: 1px solid var(--color-border);
    scrollbar-width: thin;
    scrollbar-color: var(--color-scroll-thumb) var(--color-scroll-track);
}

/* WebKit scrollbar styles for better visibility */
.table-wrapper::-webkit-scrollbar {
    height: 12px;
}

.table-wrapper::-webkit-scrollbar-track {
    background: var(--color-scroll-track);
    border-radius: 0 0 8px 8px;
}

.table-wrapper::-webkit-scrollbar-thumb {
    background: var(--color-scroll-thumb);
    border-radius: 6px;
    border: 3px solid var(--color-scroll-track);
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
    background: var(--color-scroll-thumb-hover);
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 600px;
    background-color: var(--color-bg);
}

/* Responsive table: card view on narrow screens */
.mobile-sort-controls {
    display: none;
}

.mobile-column-label {
    display: none;
}

@media (max-width: 768px) {
    table > caption {
        display: block;
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
        margin-bottom: 0.75rem;
        padding: 0 0.75rem;
        text-align: left;
    }
    table {
        min-width: 0;
    }
    .table-wrapper {
        overflow-x: visible;
        border: none;
        box-shadow: none;
    }
    table, thead, tbody, th, td, tr {
        display: block;
    }
    thead {
        position: absolute;
        width: 1px;
        height: 1px;
        padding: 0;
        margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border: 0;
    }
    .mobile-column-label {
        display: block;
    }
    table.sortable thead th.sortable button {
        display: none;
    }
    .toolbar {
        grid-template-columns: 1fr;
        padding: 0.75rem;
    }
    .toolbar .view-controls {
        grid-row: auto;
    }
    .toolbar .navigation-controls {
        justify-content: space-between;
    }
    .report-actions {
        justify-content: stretch;
    }
    .report-actions button {
        flex: 1 1 auto;
    }
    .mobile-sort-controls {
        display: flex;
        align-items: center;
        gap: 0.5rem;
        width: 100%;
        flex-wrap: wrap;
        margin-top: 0.75rem;
    }
    .mobile-sort-controls label {
        flex-basis: 100%;
    }
    .mobile-sort-controls select {
        flex: 1;
        min-width: 0;
    }
    tr {
        border: 1px solid var(--color-border);
        border-radius: 8px;
        margin-bottom: 1rem;
        padding: 0.75rem;
        background: var(--color-bg);
        box-shadow: 0 1px 3px rgba(0,0,0,0.08);
    }
    td {
        border: none;
        padding: 0.5rem 0.75rem;
        position: relative;
        text-align: left;
        font-size: 0.95rem;
    }
    td[data-label] {
        padding-left: 0.75rem;
    }
    td::before {
        content: attr(data-label) ": ";
        position: static;
        display: block;
        font-weight: 600;
        color: var(--color-text-secondary);
        text-align: left;
        white-space: normal;
        overflow-wrap: anywhere;
    }
    td.rank-cell::before {
        content: "Rang: ";
    }
}

th,
td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
    font-size: clamp(0.875rem, 2vw, 1rem);
}

th {
    background-color: var(--color-bg-alt);
    color: var(--color-text);
    font-weight: 600;
}

tr:nth-child(even) td {
    background-color: var(--color-bg-alt2);
}

tr:hover td {
    background-color: var(--color-bg-alt);
}

/* Sort icon styles - WCAG AAA compliant */
th.sortable {
    padding: 0;
    position: relative;
}

th.sortable button {
    width: 100%;
    height: 100%;
    padding: 0.75rem;
    background: none;
    border: none;
    text-align: left;
    font-size: inherit;
    font-family: inherit;
    cursor: pointer;
    color: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 44px;
}

th.sortable button:hover {
    background-color: var(--color-bg-alt);
}

th.sortable button:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
    background-color: var(--color-bg-alt);
}

.sort-icon {
    display: inline-block;
    margin-left: 0.5rem;
    font-size: 0.8em;
    flex-shrink: 0;
    color: var(--color-text);
}

.sort-icon::before {
    opacity: 1;
    color: var(--color-text);
}

th.sort-asc .sort-icon::before {
    content: "▲";
}

th.sort-desc .sort-icon::before {
    content: "▼";
}

th:not(.sort-asc):not(.sort-desc) .sort-icon::before {
    content: "⇅";
    opacity: 0.6;
}

/* Enhanced focus styles for WCAG 2.2 SC 2.4.13 Focus Appearance (AAA). */
*:focus-visible {
    outline: 3px solid var(--color-focus) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px var(--color-bg) !important;
}
th:focus-visible,
td:focus-visible,
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible {
    outline: 3px solid var(--color-focus) !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 1px var(--color-bg) !important;
}

/* Override existing specific focus rules */
th.sortable button:focus,
th.sortable button:focus-visible,
.navigation-controls button:focus,
.view-controls button:focus,
.report-actions button:focus,
.dialog-close:focus,
.achievements-button:focus,
.trends-button:focus,
.view-report-btn:focus {
    outline: 3px solid var(--color-focus) !important;
    outline-offset: 2px !important;
    background-color: transparent !important;
}

/* Pointer target 44x44 */
button, input, select {
    min-height: 44px;
    min-width: 44px;
}
a {
    display: inline-block;
    min-height: 44px;
    min-width: 44px;
}
@media (pointer: coarse) {
    button, a, input, select {
        min-height: 44px;
        min-width: 44px;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

.hero-actions button:focus {
    outline-offset: 2px;
}

/* =========================================== */
/* Dialog Styles - WCAG AAA Compliant */
/* =========================================== */

.details-dialog {
    padding: 1.5rem;
    max-width: min(90vw, 600px);
    width: 90vw;
    border: none;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    max-height: 90vh;
    overflow-y: auto;
}

.details-dialog::backdrop {
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(2px);
}

/* Scrollable content keeps the close button in reach in both large dialogs */
#trends-dialog,
#readme-dialog {
    width: 90vw;
    max-width: 90vw;
    max-height: 90vh;
    overflow: hidden;
}

#trends-dialog {
    height: 90vh;
}

#readme-dialog {
    width: min(90vw, 900px);
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-shrink: 0;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--color-border);
}

.modal-header h2 {
    min-width: 0;
    overflow-wrap: anywhere;
    color: var(--color-text);
}

.modal-header .dialog-close {
    position: static;
    flex-shrink: 0;
}

#trends-dialog-content,
#readme-content {
    min-height: 0;
    min-width: 0;
    overflow-y: auto;
    padding-top: 1rem;
}

#readme-content {
    overflow-wrap: anywhere;
}

#readme-content > a {
    display: inline-block;
    margin-bottom: 1rem;
}

#readme-content h1,
#readme-content h2,
#readme-content h3,
#readme-content p {
    margin-bottom: 1rem;
    color: var(--color-text);
}

#readme-content pre,
#readme-content table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
}

/* Image styling for readme content */
#readme-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1rem 0;
    border-radius: 4px;
}

/* List styling for readme content */
#readme-content ul,
#readme-content ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

#readme-content li {
    margin-bottom: 0.75rem;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.details-dialog[open] {
    display: flex;
    flex-direction: column;
}

/* =========================================== */
/* Violation Node Styles - WCAG AAA Compliant */
/* =========================================== */

.violation-nodes {
    margin-top: 1rem;
    padding-left: 1rem;
    border-left: 3px solid var(--color-border-alt);
}

.violation-node {
    margin-bottom: 1rem;
}

.node-details {
    background: var(--color-bg-alt);
    padding: 1rem;
    border-radius: 4px;
    margin-top: 0.5rem;
}

.node-details pre {
    white-space: pre-wrap;
    word-wrap: break-word;
    background: var(--color-bg);
    padding: 0.5rem;
    border-radius: 3px;
    margin: 0.5rem 0;
    color: var(--color-text);
}

details summary {
    cursor: pointer;
    color: var(--color-accent);
    padding: 0.5rem 0;
}

details summary:hover {
    color: var(--color-accent-hover);
}

/* =========================================== */
/* Invalid URLs Dialog Styles - WCAG AAA Compliant */
/* =========================================== */

.invalid-urls-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
    padding-top: 10px;
}

.invalid-urls-summary {
    font-weight: bold;
    color: var(--color-text-secondary);
}

.invalid-urls-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.invalid-urls-source {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.invalid-urls-source h3 {
    margin-bottom: 0.5rem;
    color: var(--color-text);
}

.invalid-urls-source details {
    margin-left: 1rem;
}

.invalid-urls-source summary {
    cursor: pointer;
    color: var(--color-text-tertiary);
    padding: 0.5rem 0;
    font-weight: 500;
}

.invalid-urls-source summary:hover {
    color: var(--color-accent);
}

.invalid-urls-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.invalid-url-item {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--color-invalid-bg);
    border-left: 3px solid var(--color-error);
    border-radius: 0 4px 4px 0;
}

.invalid-url-item div {
    margin-bottom: 0.25rem;
}

.invalid-link {
    color: var(--color-invalid-link);
    word-break: break-all;
}

/* Special styling for failed accessibility testing projects */
.invalid-url-item:has(div:contains("Accessibility Testing (FAILED)")) {
    background-color: #fff3cd;
    border-left-color: #ffc107;
}

/* Fallback styling for failed projects when :has() is not supported */
.invalid-url-item.failed-project {
    background-color: var(--color-bg-alt2);
    border-left-color: var(--color-warning);
}

.invalid-url-item.failed-project .invalid-link {
    color: var(--color-warning);
}

/* =========================================== */
/* Button Styles - WCAG AAA Compliant */
/* =========================================== */

.navigation-controls button,
.view-controls button,
.report-actions button {
    padding: 0.5rem 1rem;
    background-color: var(--color-bg-alt2);
    border: 2px solid var(--color-text-tertiary);
    border-radius: 4px;
    cursor: pointer;
    font-size: clamp(0.875rem, 2vw, 1rem);
    color: var(--color-text);
    min-height: 44px;
}

.navigation-controls button:hover,
.view-controls button:hover,
.report-actions button:hover {
    background-color: var(--color-bg-alt);
}

.navigation-controls button:focus,
.view-controls button:focus,
.report-actions button:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.navigation-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.navigation-controls #current-date {
    padding: 0 0.5rem;
    font-weight: bold;
    white-space: nowrap;
}

.view-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.view-controls select {
    padding: 0.5rem;
    border: 2px solid var(--color-text-tertiary);
    border-radius: 4px;
    font-size: clamp(0.875rem, 2vw, 1rem);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 44px;
}

.view-controls select:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.view-controls label {
    font-weight: bold;
    color: var(--color-text);
}

/* Dialog close button enhancement */
.dialog-close {
    padding: 0.5rem;
    min-width: 44px;
    min-height: 44px;
    background: none;
    border: 2px solid var(--color-text-tertiary);
    border-radius: 4px;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--color-text);
    position: absolute;
    top: 1rem;
    right: 1rem;
}

.dialog-close:hover {
    background-color: var(--color-bg-alt);
}

.error-message {
    background-color: var(--color-invalid-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
    padding: 15px;
    margin: 10px 0;
    border-radius: 4px;
}

.data-warning {
    background-color: var(--color-warning-bg, #fff3cd);
    color: var(--color-warning-text, #856404);
    border: 1px solid var(--color-warning);
    padding: 15px;
    margin: 10px 0 20px 0;
    border-radius: 4px;
    border-left: 4px solid var(--color-warning);
}

.data-warning details {
    margin-top: 10px;
}

.data-warning summary {
    cursor: pointer;
    color: #6c5400;
    font-weight: 500;
}

.data-warning summary:hover {
    color: #4a3a00;
}

.data-warning ul {
    margin: 10px 0 0 20px;
    padding: 0;
}

.data-warning li {
    margin-bottom: 5px;
    font-family: monospace;
    font-size: 0.9em;
}

:root[data-theme="dark"] .data-warning {
    background-color: var(--color-invalid-bg);
    color: var(--color-warning);
}

:root[data-theme="dark"] .data-warning summary {
    color: var(--color-warning);
}

:root[data-theme="dark"] .data-warning summary:hover {
    color: var(--color-text);
}

/* =========================================== */
/* Tag Summary Dialog Styles - WCAG AAA Compliant */
/* =========================================== */

.tag-summary-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-top: 10px;
}

.tag-summary-date {
    font-weight: bold;
    color: var(--color-text-secondary);
}

.tag-summary-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.expand-all-button,
.download-button,
.view-toggle-button {
    background-color: var(--color-bg-alt2);
    border: 2px solid var(--color-text-tertiary);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 36px;
    color: var(--color-text);
}

.expand-all-button:hover,
.download-button:hover,
.view-toggle-button:hover {
    background-color: var(--color-bg-alt);
}

.expand-all-button:focus,
.download-button:focus,
.view-toggle-button:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

/* Rule description styling */
.rule-description {
    font-size: 0.9rem;
    color: var(--color-text-secondary);
    margin-bottom: 0.5rem;
}

.rule-help {
    font-size: 0.85rem;
    color: var(--color-text-tertiary);
    font-style: italic;
    margin-bottom: 1rem;
}

.tag-summary-item {
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--color-border);
    padding-bottom: 1rem;
}

.tag-summary-item h3 {
    margin-bottom: 0.5rem;
    color: var(--color-accent);
}

.tag-summary-item details {
    margin-left: 1rem;
}

.tag-summary-item summary {
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 0.5rem 0;
    font-weight: 500;
}

.tag-summary-item summary:hover {
    color: var(--color-accent);
}

.tag-urls-list {
    margin-left: 1.5rem;
    margin-top: 0.5rem;
}

.tag-urls-list li {
    margin-bottom: 0.25rem;
}

/* =========================================== */
/* Achievements Button and Dialog Styles - WCAG AAA Compliant */
/* =========================================== */

.achievements-button {
    background-color: var(--color-bg-alt2);
    border: 2px solid var(--color-text-tertiary);
    border-radius: 4px;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 36px;
    transition: all 0.2s ease;
    color: var(--color-text);
    display: inline-flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.15rem;
    line-height: 1.3;
    text-align: left;
}

.achievements-count {
    display: block;
    white-space: nowrap;
}

.achievements-icons {
    display: block;
    font-size: 1.1rem;
    letter-spacing: 0.1em;
    white-space: normal;
    overflow-wrap: anywhere;
    min-height: 1.3em;
}

.achievements-button:hover {
    background-color: var(--color-bg-alt);
    transform: scale(1.05);
}

.achievements-button:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

.trends-button {
    background-color: var(--color-bg-alt);
    border: 2px solid var(--color-accent);
    border-radius: 4px;
    color: var(--color-accent);
    cursor: pointer;
    font-size: 0.9rem;
    min-height: 36px;
    padding: 0.5rem 1rem;
    white-space: nowrap;
}

.trends-button:hover {
    background-color: var(--color-bg-alt2);
}

.trends-button:focus {
    outline: 2px solid var(--color-focus);
    outline-offset: 2px;
}

#achievements-dialog {
    max-width: min(90vw, 700px);
    max-height: 95vh;
}

#trends-dialog {
    padding: clamp(1rem, 2vw, 1.5rem);
}

.trend-summary {
    color: var(--color-text);
    margin: 0 3rem 1rem 0;
}

.project-trend-chart {
    overflow-x: auto;
    width: 100%;
}

.project-trend-chart svg {
    display: block;
    min-width: 650px;
    width: 100%;
}

.project-trend-line {
    fill: none;
    stroke: var(--color-accent);
    stroke-width: 3;
}

.project-trend-point {
    fill: var(--color-bg);
    stroke: var(--color-accent);
    stroke-width: 2;
}

.trend-grid .domain {
    display: none;
}

.trend-grid line {
    stroke: var(--color-border);
}

.trend-axis text,
.trend-axis-label {
    fill: var(--color-text);
    font-size: 13px;
}

.trend-empty {
    color: var(--color-text-secondary);
    padding: 2rem 1rem;
    text-align: center;
}

.trend-loading {
    color: var(--color-text-secondary);
    padding: 2rem 1rem;
    text-align: center;
}

.achievements-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.achievement-item {
    background: linear-gradient(135deg, var(--color-bg-alt2) 0%, var(--color-bg) 100%);
    border-left: 4px solid var(--color-warning);
    padding: 1rem;
    border-radius: 4px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.achievement-header {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    flex: 1;
}

.achievement-icon {
    font-size: 2rem;
    flex-shrink: 0;
}

.achievement-text h3 {
    margin: 0 0 0.5rem 0;
    color: var(--color-success);
    font-size: 1rem;
}

.achievement-text p {
    margin: 0;
    color: var(--color-text-secondary);
    font-size: 0.9rem;
}

.achievement-dates {
    color: var(--color-text-tertiary);
    font-size: 0.85rem;
}

.achievement-text p.achievement-reason {
    color: var(--color-text-secondary);
    font-size: 0.85rem;
    margin-top: 0.25rem;
}

.achievement-duration {
    font-weight: bold;
    color: var(--color-warning);
    white-space: nowrap;
    padding-left: 1rem;
    text-align: right;
}

.achievements-empty {
    text-align: center;
    padding: 2rem 1rem;
    color: var(--color-text-secondary);
}

.achievements-empty p {
    margin: 0.5rem 0;
}

/* =========================================== */
/* Responsive Design */
/* =========================================== */

@media (max-width: 768px) {
    .achievement-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .achievement-duration {
        padding-left: 0;
        padding-top: 0.5rem;
        text-align: left;
    }

    body {
        padding: 0.5rem;
    }

    .details-dialog {
        width: calc(100% - 2rem);
        margin: 1rem;
        padding: 1rem;
    }

    #trends-dialog,
    #readme-dialog {
        width: 90vw;
        margin: 0;
    }

    .dialog-content {
        padding-right: 0;
        padding-top: 2rem;
    }

    th,
    td {
        padding: 0.5rem;
    }

    .view-controls {
        flex-direction: column;
        align-items: flex-start;
    }
}