:root {
    /* Default: Dark Mode (HandleKit standard) */
    --bg-light: #0c0a0a;
    --panel-bg: #161212;
    --text-main: #e6e6e6;
    --text-muted: #a0a0a0;
    --accent-blue: #8ab4f8;
    --accent-blue-hover: #aecbfa;
    --warning-amber: #f9ab00;
    --danger-red: #f28b82;
    --border-color: rgba(255, 255, 255, 0.1);
    --focus-ring: rgba(11, 87, 208, 0.4);
    
    --tag-fix-bg: rgba(242, 139, 130, 0.15);
    --tag-review-bg: rgba(249, 171, 0, 0.15);
    --tag-possible-bg: rgba(138, 180, 248, 0.15);
    --disclaimer-bg: rgba(249, 171, 0, 0.1);
    --disclaimer-text: #fdd663;
}

/* Light Mode Overrides */
html[data-theme='light'] {
    --bg-light: #f7f9fa;
    --panel-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #5e6368;
    --accent-blue: #0b57d0;
    --accent-blue-hover: #0842a0;
    --warning-amber: #b06000;
    --danger-red: #c5221f;
    --border-color: #dadce0;
    
    --tag-fix-bg: #fce8e6;
    --tag-review-bg: #fef7e0;
    --tag-possible-bg: #e8f0fe;
    --disclaimer-bg: #fff3e0;
    --disclaimer-text: #8a4b00;
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-light);
    color: var(--text-main);
    line-height: 1.6;
    margin: 0;
    padding: 0;
}

/* Visibility for screen readers only where needed */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--accent-blue);
    color: white;
    padding: 8px;
    z-index: 100;
    transition: top 0.2s;
}

.skip-link:focus {
    top: 0;
}

a {
    color: var(--accent-blue);
    text-decoration: underline;
}

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

a:focus, button:focus, input:focus {
    outline: 3px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Layout */
.site-header {
    background: var(--panel-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 2rem;
}

.site-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
}

.site-header nav ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 0.5rem;
}

.site-header nav a {
    text-decoration: none;
    color: var(--text-main);
    font-size: 0.9rem;
}

.site-header nav a:hover {
    text-decoration: underline;
}

.site-footer {
    text-align: center;
    padding: 2rem;
    color: var(--text-muted);
    font-size: 0.85rem;
    border-top: 1px solid var(--border-color);
    margin-top: 4rem;
}

main {
    max-width: 800px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* Typography */
h1 {
    margin-bottom: 1.5rem;
    line-height: 1.3;
}

h2, h3 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

/* Specific heading sizes for hierarchy */
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }

/* Remove top margin if the heading is the first element in its container (like a .panel) */
.panel > :first-child,
.hero > :first-child,
.results-section > :first-child {
    margin-top: 0;
}

/* Also remove top margin if it follows an h2 (standard subtitle pattern) */
h2 + h3 {
    margin-top: 0.5rem;
}

p {
    margin-bottom: 1rem;
}

/* List indentation & spacing — ensure breathing room and clear alignment */
main ul, main ol {
    padding-left: 2.5rem;
    margin-bottom: 1.25rem;
}

main li {
    margin-bottom: 0.5rem;
}

/* Nav ul overrides — keep nav horizontal and unindented */
.site-header nav ul {
    padding-left: 0;
    margin-bottom: 0;
}

.site-header nav li {
    margin-bottom: 0;
}

.hero {
    margin-bottom: 2rem;
}

.hero h2 {
    font-size: 2rem;
}

.hero p {
    font-size: 1.1rem;
    color: var(--text-muted);
}

/* Panels & Cards */
.panel {
    background: var(--panel-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.card {
    background: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.border-red {
    border-left: 4px solid var(--danger-red);
    border-radius: 8px;
}

.border-amber {
    border-left: 4px solid var(--warning-amber);
    border-radius: 8px;
}

/* Forms */
fieldset {
    border: none;
    margin-bottom: 1.5rem;
    padding: 0;
}

legend {
    font-weight: 600;
    margin-bottom: 0.5rem;
    font-size: 1.05rem;
}

.radio-group, .checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

input[type="radio"], input[type="checkbox"] {
    width: 1.2rem;
    height: 1.2rem;
    accent-color: var(--accent-blue);
}

button[type="submit"] {
    background: var(--accent-blue);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    width: 100%;
    margin-top: 1rem;
}

button[type="submit"]:hover {
    background: var(--accent-blue-hover);
}

/* Triage Results */
#results-area {
    margin-top: 2rem;
}

.results-panel {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    animation: fadeIn 0.3s ease-in;
}

.disclaimer-alert {
    background: var(--disclaimer-bg);
    border-left: 4px solid var(--warning-amber);
    padding: 1rem;
    color: var(--disclaimer-text);
    border-radius: 8px;
}

.results-section h2 {
    font-size: 1.3rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-bottom: 0.5rem;
}

.section-intro {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.severity-tag {
    font-size: 0.8rem;
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
    vertical-align: middle;
    margin-left: 0.5rem;
    font-weight: 500;
}

.tag-fix-now {
    background: var(--tag-fix-bg);
    color: var(--danger-red);
}

.tag-review {
    background: var(--tag-review-bg);
    color: var(--warning-amber);
}

.tag-possible-issue {
    background: var(--tag-possible-bg);
    color: var(--accent-blue);
}

.format-tag {
    font-size: 0.75rem;
    background: var(--border-color);
    padding: 0.1rem 0.4rem;
    border-radius: 3px;
    margin-right: 0.5rem;
    font-weight: 600;
}

.action-list, .warning-list, .evidence-list {
    /* Use the same indentation and spacing as global main lists */
    padding-left: 2.5rem;
    margin-bottom: 1.25rem;
}

.action-list li, .warning-list li, .evidence-list li {
    margin-bottom: 0.5rem;
}

.text-red {
    color: var(--danger-red);
}

.safe-reasoning {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
}

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