/* Welcome Screen */
.welcome-screen {
    position: fixed;
    top: -50px;
    left: 0;
    right: 0;
    bottom: 0;
    padding-top: 50px;
    z-index: 10000;
    background: linear-gradient(160deg, #0f172a 0%, #1a2744 50%, #0f172a 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
}

.welcome-screen.hidden {
    display: none;
}

.welcome-content {
    text-align: center;
    padding: 2rem;
    max-width: 420px;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    width: 100%;
}

.welcome-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.welcome-logo {
    width: 138px;
    height: auto;
    margin-bottom: 0.35rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.welcome-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: none;
    border-radius: 100px;
    padding: 0.35rem 0;
    margin-bottom: 2rem;
    color: #8bbd78;
    font-size: 1.15rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.welcome-title {
    font-family: 'Clash Display', 'Inter', sans-serif;
    font-size: 2.75rem;
    font-weight: 600;
    color: #ffffff;
    line-height: 1.15;
    margin-bottom: 1.25rem;
    letter-spacing: -0.02em;
}

.welcome-accent-line {
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #8bbd78, #5ea758);
    border-radius: 3px;
    margin: 0 auto 1.25rem;
}

.welcome-start-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    background: linear-gradient(135deg, #8bbd78, #5ea758);
    color: #ffffff;
    border: none;
    border-radius: 14px;
    padding: 1rem 2.25rem;
    font-family: 'Inter', sans-serif;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 20px rgba(139, 189, 120, 0.3);
}

.welcome-start-btn:active {
    transform: translateY(0);
}

.welcome-footer {
    margin-top: auto;
    padding-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.welcome-developed {
    color: rgba(255, 255, 255, 0.35);
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.03em;
}

.welcome-disclaimer {
    color: rgba(255, 255, 255, 0.25);
    font-size: 0.7rem;
    font-style: italic;
    margin-bottom: 1.25rem;
}

/* Platform-specific visibility */
.native-only { display: none !important; }
html.is-native .native-only { display: revert !important; }
html.is-native .web-only { display: none !important; }

:root {
    --slate-950: #020617;
    --slate-900: #0f172a;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;

    --coral-600: #0284c7;
    --coral-500: #0ea5e9;
    --coral-400: #38bdf8;
    --coral-300: #7dd3fc;
    --coral-100: #e0f2fe;

    --rose-500: #f43f5e;
    --rose-100: #ffe4e6;

    --emerald-500: #10b981;
    --emerald-100: #d1fae5;

    --amber-500: #f59e0b;
    --amber-100: #fef3c7;

    --sky-500: #0ea5e9;
    --sky-100: #e0f2fe;

    --bg: #f0f9ff;
    --card: #ffffff;
    --text: #0f172a;
    --text-muted: var(--slate-500);
    --border: var(--slate-200);

    /* Semantic text colors */
    --text-primary: var(--slate-800);
    --text-secondary: var(--slate-600);

    /* Focus ring */
    --focus-ring: 0 0 0 4px rgba(14, 165, 233, 0.1);

    /* Purple palette for mental health */
    --purple-900: #4c1d95;
    --purple-500: #8b5cf6;
    --purple-100: #f5f3ff;
}

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

/* Global focus-visible styles for accessibility */
*:focus-visible {
    outline: 2px solid var(--coral-500);
    outline-offset: 2px;
}

/* Remove default outline - we're using focus-visible */
*:focus:not(:focus-visible) {
    outline: none;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Noise texture overlay */
body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 400 400' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.015;
    pointer-events: none;
    z-index: 0;
}

.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
}

/* Sidebar Navigation */
.sidebar {
    width: 329px;
    background: #0c1929;
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.sidebar-header {
    padding: 2rem 1.5rem;
    border-bottom: 1px solid var(--slate-700);
}

.logo-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-align: center;
}

.logo-mark {
    width: 106px;
    height: 106px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-mark img {
    width: 106px;
    height: 106px;
    object-fit: contain;
}

.logo-text {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.logo-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
}

.logo-subtitle {
    font-size: 0.75rem;
    color: var(--slate-400);
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Sidebar Settings Toggle (desktop hamburger) */
.sidebar-settings-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: calc(100% - 2rem);
    margin: 1rem auto 0;
    padding: 0.6rem 0.75rem;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--slate-300);
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.sidebar-settings-toggle:hover {
    background: var(--slate-700);
    color: white;
}

.sidebar-settings-toggle i {
    font-size: 0.95rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Hide on mobile — mobile uses its own settings toggle */
@media (max-width: 900px) {
    .sidebar-settings-toggle {
        display: none;
    }
}

/* Collapsed sidebar: icon only */
.sidebar.collapsed .sidebar-settings-toggle {
    width: auto;
    margin: 0.75rem auto 0;
    padding: 0.6rem;
    justify-content: center;
    border: none;
}

.sidebar.collapsed .sidebar-settings-toggle span {
    display: none;
}

.nav-section {
    padding: 1.5rem 1rem;
    flex: 1;
}

.nav-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    padding: 0 0.75rem;
    margin-bottom: 0.75rem;
}

.nav-list {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    position: relative;
}

.nav-indicator {
    position: absolute;
    left: 0;
    top: 0;
    width: 3px;
    height: 24px;
    background: var(--coral-500);
    border-radius: 0 3px 3px 0;
    pointer-events: none;
    z-index: 10;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    background: transparent;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--slate-300);
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    position: relative;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
}

.nav-item:hover {
    color: var(--slate-200);
    background: var(--slate-800);
}

.nav-item.active {
    color: white;
    background: linear-gradient(135deg, var(--slate-800), var(--slate-700));
}

.nav-item:focus-visible {
    outline: 2px solid var(--coral-400);
    outline-offset: -2px;
}

.nav-icon {
    width: 20px;
    text-align: center;
    font-size: 1rem;
    opacity: 0.8;
    perspective: 100px;
}

.nav-icon i {
    display: inline-block;
    transform-style: preserve-3d;
}

.nav-item.active .nav-icon {
    opacity: 1;
    color: var(--coral-400);
}

.sidebar-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--slate-700);
}

.sidebar-footer p {
    font-size: 0.7rem;
    color: var(--slate-500);
    text-align: center;
    line-height: 1.5;
}

/* Main Content Area */
.main-content {
    flex: 1;
    margin-left: 329px;
    display: flex;
    flex-direction: column;
}

.content-header {
    padding: 2.25rem 3rem;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.page-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--slate-900);
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

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

.content-body {
    flex: 1;
    padding: 2.5rem 3rem;
    animation: fadeUp 0.5s ease-out;
}

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

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeUp 0.4s ease-out;
}

/* Cards */
.card {
    background: var(--card);
    border-radius: 16px;
    border: 1px solid var(--border);
    box-shadow: 0 6px 20px rgba(0,0,0,0.05);
    overflow: hidden;
}

.card-body {
    padding: 2.25rem;
}

/* Form Elements */
.form-group {
    margin-bottom: 2rem;
}

.form-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--slate-700);
    margin-bottom: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.form-label i {
    color: var(--slate-400);
    font-size: 0.875rem;
}

.required-indicator {
    color: var(--rose-500);
    font-weight: 600;
    margin-left: 0.25rem;
}

/* BP Input Section */
.bp-input-group {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--slate-50), var(--bg));
    border-radius: 16px;
    border: 2px solid var(--border);
    transition: all 0.3s ease;
}

.bp-input-group:focus-within {
    border-color: var(--coral-400);
    background: white;
    box-shadow: var(--focus-ring);
}

.bp-field {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.bp-field-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--slate-500);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

input[type="number"] {
    width: 100px;
    padding: 1rem;
    border: 2px solid #bae6fd;
    border-radius: 10px;
    font-size: 1.75rem;
    font-weight: 600;
    text-align: center;
    color: var(--slate-800);
    font-family: 'Clash Display', sans-serif;
    background: white;
    transition: all 0.2s ease;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--coral-500);
    box-shadow: var(--focus-ring);
}

input[type="number"]::placeholder {
    color: var(--slate-300);
}

/* Validation states */
input[type="number"].is-valid {
    border-color: var(--emerald-500);
    background: var(--emerald-100);
}

input[type="number"].is-valid:focus {
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

input[type="number"].is-invalid {
    border-color: var(--rose-500);
    background: var(--rose-100);
}

input[type="number"].is-invalid:focus {
    box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.1);
}

.field-error {
    display: none;
    color: var(--rose-500);
    font-size: 0.8rem;
    font-weight: 500;
    margin-top: 0.5rem;
    text-align: center;
}

.field-error.visible {
    display: block;
    animation: fadeUp 0.2s ease-out;
}

/* Inline validation messages */
.inline-error {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--rose-500);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 0.5rem;
    padding: 0.5rem 0.75rem;
    background: var(--rose-100);
    border-radius: 8px;
    animation: fadeUp 0.2s ease-out;
}

.inline-error i {
    font-size: 0.8rem;
}

.inline-error.hidden {
    display: none;
}

/* Success state for validated fields */
.form-group.validated .bp-input-group,
.form-group.validated .option-item:has(input:checked) {
    border-color: var(--emerald-500);
}

.form-group.has-error .bp-input-group {
    border-color: var(--rose-500);
    background: var(--rose-100);
}

.bp-divider {
    font-family: 'Clash Display', sans-serif;
    font-size: 2.5rem;
    font-weight: 300;
    color: var(--slate-300);
    margin-top: 1.1rem;
}

.bp-unit {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--slate-500);
    padding: 0.5rem 1rem;
    background: var(--slate-100);
    border-radius: 8px;
    margin-top: 1.1rem;
}

/* Checkbox & Radio Groups */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background: white;
    border: 2px solid var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.option-item:hover {
    border-color: var(--slate-300);
    background: var(--slate-50);
}

.option-item:has(input:checked) {
    border-color: var(--coral-500);
    background: var(--coral-100);
}

.option-item:focus-within {
    outline: 2px solid var(--coral-500);
    outline-offset: 2px;
}

.option-item input[type="checkbox"],
.option-item input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--coral-500);
    cursor: pointer;
}

.option-item label {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--slate-700);
    cursor: pointer;
    flex: 1;
}

.option-item i {
    color: var(--slate-400);
}

.option-item:has(input:checked) i {
    color: var(--coral-500);
}

.radio-inline-group {
    display: flex;
    gap: 2rem;
    align-items: center;
}

.radio-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--slate-700);
}

.radio-inline input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--coral-500);
    cursor: pointer;
}

.single-option {
    max-width: 320px;
}

/* Dual Column Layout */
.dual-column {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 768px) {
    .dual-column {
        grid-template-columns: 1fr;
    }
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 1.25rem 2rem;
    background: var(--slate-900);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, var(--coral-500), var(--coral-400));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-submit span {
    position: relative;
    z-index: 1;
}

.btn-submit i {
    position: relative;
    z-index: 1;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.2);
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:focus-visible {
    outline: 2px solid var(--coral-500);
    outline-offset: 3px;
}

/* Loading state for submit buttons */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.8;
}

.btn-submit.loading span {
    opacity: 0;
}

.btn-submit.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    z-index: 2;
}

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

/* Results */
.result-section {
    display: none;
    margin-top: 2rem;
    animation: slideUp 0.4s ease-out;
}

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

.result-card {
    padding: 2rem;
    border-radius: 16px;
    border: 2px solid;
    position: relative;
    overflow: hidden;
}

.result-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
}

.result-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.result-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.result-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
}

.result-message {
    font-size: 1rem;
    line-height: 1.7;
}

.result-message strong {
    font-weight: 600;
}

/* Result variants */
.result-urgent {
    background: var(--rose-100);
    border-color: var(--rose-500);
    color: #881337;
}

.result-urgent::before {
    background: var(--rose-500);
}

.result-urgent .result-icon {
    background: var(--rose-500);
    color: white;
}

.result-warning {
    background: var(--amber-100);
    border-color: var(--amber-500);
    color: #78350f;
}

.result-warning::before {
    background: var(--amber-500);
}

.result-warning .result-icon {
    background: var(--amber-500);
    color: white;
}

.result-success {
    background: var(--emerald-100);
    border-color: var(--emerald-500);
    color: #064e3b;
}

.result-success::before {
    background: var(--emerald-500);
}

.result-success .result-icon {
    background: var(--emerald-500);
    color: white;
}

.result-info {
    background: var(--sky-100);
    border-color: var(--sky-500);
    color: #0c4a6e;
}

.result-info::before {
    background: var(--sky-500);
}

.result-info .result-icon {
    background: var(--sky-500);
    color: white;
}

.result-neutral {
    background: var(--slate-100);
    border-color: var(--slate-400);
    color: var(--slate-700);
}

.result-neutral::before {
    background: var(--slate-400);
}

.result-neutral .result-icon {
    background: var(--slate-500);
    color: white;
}

.btn-reset {
    margin-top: 1.5rem;
    padding: 0.875rem 1.5rem;
    background: transparent;
    border: 2px solid currentColor;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: inherit;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    margin-left: auto;
    margin-right: auto;
    font-family: 'Inter', sans-serif;
}

.btn-reset:hover {
    background: rgba(0,0,0,0.05);
}

.btn-reset:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Info boxes - unified base styles */
.info-box {
    margin-top: 1rem;
    padding: 1rem 1.25rem;
    border-radius: 8px;
    font-size: 0.95rem;
    line-height: 1.5;
}

/* Border-left variant (used in lipid tool) */
.info-box-left {
    border-left: 4px solid;
    border-radius: 0 8px 8px 0;
}

.info-box-blue {
    background: var(--sky-100);
    border-color: var(--sky-500);
    color: #0c4a6e;
}

.info-box-warning {
    background: var(--amber-100);
    border-color: var(--amber-500);
    color: #78350f;
}

/* Error message */
.error-message {
    padding: 1rem 1.25rem;
    background: var(--rose-100);
    border: 2px solid var(--rose-500);
    border-radius: 12px;
    color: var(--rose-500);
    font-weight: 600;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: shake 0.4s ease;
}

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

.hidden {
    display: none !important;
}

/* Screen reader only - visually hidden but accessible */
.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 to content link */
.skip-link {
    position: absolute;
    top: -50px;
    left: 0;
    background: var(--slate-900);
    color: white;
    padding: 0.75rem 1.5rem;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0 0 12px 0;
    z-index: 1000;
    transition: top 0.2s ease;
}

.skip-link:focus {
    top: 0;
    outline: 2px solid var(--coral-500);
    outline-offset: -2px;
}

/* Footer credit */
.footer-credit {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border);
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Paediatric Referral */
.hotline-number {
    font-size: 1.15em;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
}
.hotline-number:hover {
    text-decoration: underline;
}
.hotline-hours {
    font-size: 0.9em;
    color: var(--text-secondary);
}
.option-highlight-urgent label {
    color: var(--danger, #dc3545);
    font-weight: 600;
}

/* ARRS Resources */
.search-input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid var(--border);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Inter', sans-serif;
    background: white;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--coral-500);
    box-shadow: var(--focus-ring);
}

.search-wrapper {
    position: relative;
    margin-bottom: 2rem;
}

.search-wrapper i {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--slate-400);
}

.role-category {
    margin-bottom: 1rem;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
}

.role-category.hidden {
    display: none;
}

.role-header {
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s ease;
    border-bottom: 2px solid transparent;
}

.role-header:hover {
    background: var(--slate-100);
}

.role-category.active .role-header {
    border-bottom-color: var(--border);
}

.role-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    color: var(--slate-800);
}

.role-icon {
    color: var(--coral-500);
    display: inline-block;
    transform-style: preserve-3d;
    transition: color 0.2s ease;
}

.role-header {
    perspective: 100px;
}

.role-count {
    background: var(--coral-100);
    color: var(--coral-500);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
}

.expand-icon {
    color: var(--slate-400);
    transition: transform 0.3s ease;
}

.role-category.active .expand-icon {
    transform: rotate(180deg);
}

.role-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.role-category.active .role-content {
    max-height: 2000px;
}

.role-links {
    padding: 1.5rem;
}

.resource-link {
    display: flex;
    gap: 1rem;
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    background: var(--slate-50);
    border-radius: 12px;
    border-left: 3px solid var(--coral-400);
    transition: all 0.2s ease;
    text-decoration: none;
    color: var(--text);
}

.resource-link:hover {
    background: var(--coral-100);
    transform: translateX(4px);
}

.resource-link-icon {
    color: var(--coral-500);
    margin-top: 0.15rem;
    display: inline-block;
}

.resource-link-content {
    flex: 1;
}

.resource-link-title {
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 0.25rem;
}

.resource-link-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
}

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

.no-results i {
    font-size: 3rem;
    color: var(--slate-300);
    margin-bottom: 1rem;
}

/* Urine Guide */
.guide-section {
    background: white;
    border: 2px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: all 0.2s ease;
}

.guide-section:hover {
    border-color: var(--slate-300);
    box-shadow: 0 4px 12px rgba(0,0,0,0.04);
}

.guide-section.urgent-section {
    border-color: var(--rose-500);
    background: linear-gradient(to bottom, var(--rose-100), white);
}

.guide-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.25rem 1.5rem;
    background: var(--slate-50);
    border-bottom: 1px solid var(--border);
}

.guide-section.urgent-section .guide-header {
    background: var(--rose-100);
    border-bottom-color: rgba(244, 63, 94, 0.2);
}

.guide-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--slate-800);
    color: white;
    border-radius: 10px;
}

.guide-section.urgent-section .guide-icon {
    background: var(--rose-500);
}

.guide-header h3 {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--slate-800);
}

.guide-content {
    padding: 1.5rem;
}

.guide-content p {
    margin-bottom: 1rem;
    color: var(--text-muted);
}

.guide-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.guide-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    background: var(--slate-50);
    border-radius: 10px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.guide-list li i {
    color: var(--emerald-500);
    margin-top: 0.15rem;
    flex-shrink: 0;
}

.guide-list li i.warning-icon {
    color: var(--amber-500);
}

/* Collapsible guide */
.guide-collapsible .guide-content {
    max-height: 0;
    overflow: hidden;
    padding: 0 1.5rem;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
}

.guide-collapsible.guide-open .guide-content {
    max-height: 2000px;
    padding: 1.5rem;
}

.guide-header-toggle {
    cursor: pointer;
}

.guide-chevron {
    margin-left: auto;
    font-size: 0.8rem;
    color: var(--slate-400);
    transition: transform 0.3s ease;
}

.guide-collapsible.guide-open .guide-chevron {
    transform: rotate(180deg);
}

.guide-list li i.num-icon {
    color: var(--coral-500);
    font-weight: 700;
}

.significance-list li {
    background: linear-gradient(135deg, var(--slate-100), var(--slate-50));
}

.highlight-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    border-radius: 12px;
    margin-top: 1rem;
    font-size: 0.95rem;
    line-height: 1.5;
}

.highlight-box i {
    flex-shrink: 0;
    margin-top: 0.15rem;
    font-size: 1.1rem;
}

.highlight-urgent {
    background: var(--rose-100);
    border: 2px solid var(--rose-500);
    color: #881337;
}

.highlight-urgent i {
    color: var(--rose-500);
}

.symptoms-list-guide {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.symptoms-list-guide li {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem;
    background: var(--amber-100);
    border-radius: 10px;
    font-size: 0.9rem;
    border-left: 3px solid var(--amber-500);
}

.symptoms-list-guide li i {
    color: var(--amber-500);
}

.action-list li {
    background: var(--emerald-100);
    border-left: 3px solid var(--emerald-500);
}

.alert-box {
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.alert-box:last-child {
    margin-bottom: 0;
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
    font-weight: 600;
}

.alert-box ul {
    margin: 0;
    padding-left: 1.75rem;
}

.alert-box ul li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.alert-urgent {
    background: var(--rose-100);
    border: 2px solid var(--rose-500);
    color: #881337;
}

.alert-warning {
    background: var(--amber-100);
    border: 2px solid var(--amber-500);
    color: #78350f;
}

@media (max-width: 640px) {
    .symptoms-list-guide {
        grid-template-columns: 1fr;
    }
}

/* Mental Health Referral Styles */
.mh-step {
    animation: fadeUp 0.3s ease-out;
}

.mh-step.hidden {
    display: none;
}

.form-hint {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 1rem;
    line-height: 1.5;
}

/* Hide urine tab form hints in Steps 1 & 2 (matches iOS) */
#urineStep1 .form-hint,
#urineStep2 > .form-group > .form-hint {
    display: none;
}

.mh-symptoms-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.mh-complex-grid {
    grid-template-columns: 1fr;
}

.mh-complex-grid .option-item {
    padding: 1.25rem 1.5rem;
}

.mh-complex-grid .option-item:has(#complexCrisis) {
    border-color: var(--rose-500);
    background: var(--rose-100);
}

.mh-complex-grid .option-item:has(#complexCrisis):has(input:checked) {
    background: var(--rose-100);
    border-color: var(--rose-500);
}

.mh-services-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 0.5rem;
}

.mh-services-list li {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mh-services-list li:hover {
    background: var(--coral-100);
}

.mh-services-list li a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: inherit;
    text-decoration: none;
    width: 100%;
}

.mh-services-list li a:hover {
    color: var(--coral-600);
}

.mh-services-list li i {
    color: var(--coral-500);
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

/* Purple result variant for MH referrals */
.result-purple {
    background: var(--purple-100);
    border-color: var(--purple-500);
    color: var(--purple-900);
}

.result-purple::before {
    background: var(--purple-500);
}

.result-purple .result-icon {
    background: var(--purple-500);
    color: white;
}

/* Progress indicator for multi-step forms (hidden — matches iOS) */
.form-progress {
    display: none;
    justify-content: space-between;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: var(--slate-50);
    border-radius: 16px;
    position: relative;
}

.form-progress::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 3rem;
    right: 3rem;
    height: 2px;
    background: var(--slate-200);
    transform: translateY(-50%);
    z-index: 0;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    position: relative;
    z-index: 1;
    flex: 1;
}

.progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--slate-300);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--slate-400);
}

.progress-step.active .progress-dot {
    border-color: var(--coral-500);
    background: var(--coral-500);
    color: white;
}

.progress-step.completed .progress-dot {
    border-color: var(--emerald-500);
    background: var(--emerald-500);
    color: white;
}

.progress-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--slate-500);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.progress-step.active .progress-label {
    color: var(--coral-600);
}

.progress-step.completed .progress-label {
    color: var(--emerald-600);
}

@media (max-width: 640px) {
    .progress-label {
        display: none;
    }

    .form-progress {
        padding: 1rem;
    }

    .form-progress::before {
        left: 2rem;
        right: 2rem;
    }

    .progress-dot {
        width: 28px;
        height: 28px;
    }
}

/* Back button for multi-step forms */
.btn-back {
    padding: 0.75rem 1.25rem;
    background: transparent;
    border: 1px solid var(--slate-300);
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    font-family: 'Inter', sans-serif;
}

.btn-back:hover {
    background: var(--slate-100);
    border-color: var(--slate-400);
    color: var(--slate-800);
}

.btn-back:focus-visible {
    outline: 2px solid var(--coral-500);
    outline-offset: 2px;
}

/* Draft recovery banner */
.draft-banner {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 1.5rem;
    background: var(--sky-100);
    border: 2px solid var(--sky-500);
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: var(--slate-800);
}

.draft-banner > i {
    color: var(--sky-500);
    font-size: 1.25rem;
}

.draft-banner > span {
    flex: 1;
    font-weight: 500;
}

.draft-banner-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-draft-restore,
.btn-draft-dismiss {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
}

.btn-draft-restore {
    background: var(--sky-500);
    color: white;
    border: none;
}

.btn-draft-restore:hover {
    background: var(--sky-600);
}

.btn-draft-dismiss {
    background: transparent;
    border: 1px solid var(--slate-300);
    color: var(--slate-600);
}

.btn-draft-dismiss:hover {
    background: var(--slate-100);
    border-color: var(--slate-400);
}

.btn-draft-restore:focus-visible,
.btn-draft-dismiss:focus-visible {
    outline: 2px solid var(--coral-500);
    outline-offset: 2px;
}

/* Legacy dot progress (kept for compatibility) */
.mh-progress {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.mh-progress-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--slate-200);
    transition: all 0.3s ease;
}

.mh-progress-dot.active {
    background: var(--coral-500);
    transform: scale(1.2);
}

.mh-progress-dot.completed {
    background: var(--emerald-500);
}

/* Urine Dipstick Assessment Styles */
.urine-step {
    animation: fadeUp 0.3s ease-out;
}

.urine-step.hidden {
    display: none;
}

.dipstick-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 0.5rem;
}

.dipstick-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 1.25rem;
}

.dipstick-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    font-size: 0.95rem;
}

.dipstick-options {
    display: flex;
    gap: 0.75rem;
}

.option-item-small {
    flex: 1;
    padding: 0.75rem 1rem;
}

.option-item-small label {
    font-size: 0.9rem;
}

.urine-symptoms-grid {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.urine-redflags-grid {
    grid-template-columns: 1fr;
}

.urine-redflags-grid .option-item {
    padding: 1rem 1.25rem;
}

.option-item-warning {
    border-color: var(--amber-300);
    background: var(--amber-50);
}

.option-item-warning:hover {
    border-color: var(--amber-400);
    background: var(--amber-100);
}

.option-item-warning:has(input:checked) {
    background: var(--rose-100);
    border-color: var(--rose-500);
}

/* Compact inline dipstick styles */
.option-grid.native-inline {
    grid-template-columns: 1fr 1fr;
}

.dipstick-item.native-compact {
    padding: 0.75rem 1rem;
}

.dipstick-item.native-compact .dipstick-label {
    margin-bottom: 0.5rem;
}

.dipstick-item.native-dipstick-inline {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.dipstick-item.native-dipstick-inline .dipstick-label {
    margin-bottom: 0;
    min-width: 5.5rem;
    flex-shrink: 0;
}

.label-urgent {
    color: var(--rose-600);
}

.label-urgent i {
    color: var(--rose-500);
}

.form-hint-child {
    margin-top: 1.5rem;
    padding-top: 1rem;
    border-top: 1px dashed var(--slate-300);
    color: var(--sky-600);
}

.form-hint-child i {
    margin-right: 0.5rem;
}

/* Quick Reference Guide */
.urine-guide-section {
    margin-top: 2rem;
}

.quick-ref-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.quick-ref-item {
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    padding: 1.25rem;
}

.quick-ref-item h4 {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quick-ref-item h4 i {
    color: var(--coral-500);
}

.quick-ref-item ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.quick-ref-item li {
    font-size: 0.9rem;
    color: var(--text-secondary);
    padding: 0.35rem 0;
    padding-left: 1rem;
    position: relative;
}

.quick-ref-item li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--coral-400);
}

/* Additional info-box variants (for results) */
.info-box-urgent {
    background: var(--rose-100);
    border: 1px solid var(--rose-300);
    color: #881337;
}

.info-box-amber {
    background: var(--amber-100);
    border: 1px solid var(--amber-300);
    color: #78350f;
}

.info-box-success {
    background: var(--emerald-100);
    border: 1px solid var(--emerald-300);
    color: #065f46;
}

.info-box-neutral {
    background: var(--slate-100);
    border: 1px solid var(--slate-300);
    color: var(--text-secondary);
}

.info-box i {
    margin-right: 0.5rem;
}

/* Collapsible Sidebar (Desktop Only) */
.sidebar-collapse-toggle {
    display: none;
    position: absolute;
    top: 2.5rem;
    right: -22px;
    width: 44px;
    height: 44px;
    background: var(--slate-800);
    border: 2px solid var(--slate-600);
    border-radius: 50%;
    color: var(--slate-300);
    cursor: pointer;
    z-index: 110;
    transition: all 0.2s ease;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.sidebar-collapse-toggle:hover {
    background: var(--coral-500);
    border-color: var(--coral-400);
    color: white;
    transform: scale(1.1);
}

.sidebar-collapse-toggle i {
    transition: transform 0.3s ease;
}

/* Show toggle only on desktop */
@media (min-width: 901px) {
    .sidebar-collapse-toggle {
        display: flex;
    }
}

/* Collapsed sidebar state */
.sidebar.collapsed {
    width: 72px;
}

.sidebar.collapsed .sidebar-collapse-toggle i {
    transform: rotate(180deg);
}

.sidebar.collapsed .logo-mark {
    width: 48px;
    height: 48px;
}

.sidebar.collapsed .logo-mark img {
    width: 48px;
    height: 48px;
}

.sidebar.collapsed .logo-text {
    opacity: 0;
    width: 0;
    height: 0;
    overflow: hidden;
    position: absolute;
}

.sidebar.collapsed .sidebar-header {
    padding: 1.5rem 0.75rem;
}

.sidebar.collapsed .nav-section {
    padding: 1.5rem 0.5rem;
}

.sidebar.collapsed .nav-label {
    opacity: 0;
    height: 0;
    margin: 0;
    padding: 0;
    overflow: hidden;
}

.sidebar.collapsed .nav-item {
    position: relative;
    height: 48px;
    padding: 0;
}

.sidebar.collapsed .nav-item > span:last-child {
    display: none !important;
}

.sidebar.collapsed .nav-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin: 0;
}

.sidebar.collapsed .sidebar-footer {
    opacity: 0;
    height: 0;
    padding: 0;
    overflow: hidden;
}

/* Tooltip for collapsed state */
.sidebar.collapsed .nav-item {
    position: relative;
}

.sidebar.collapsed .nav-item::after {
    content: attr(aria-label);
    position: absolute;
    left: calc(100% + 12px);
    top: 50%;
    transform: translateY(-50%);
    background: var(--slate-900);
    color: white;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    z-index: 1000;
}

.sidebar.collapsed .nav-item::before {
    content: '';
    position: absolute;
    left: calc(100% + 4px);
    top: 50%;
    transform: translateY(-50%);
    border: 6px solid transparent;
    border-right-color: var(--slate-900);
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 1000;
}

.sidebar.collapsed .nav-item:hover::after,
.sidebar.collapsed .nav-item:hover::before {
    opacity: 1;
    visibility: visible;
}

/* Adjust main content when sidebar is collapsed */
.app-container:has(.sidebar.collapsed) .main-content {
    margin-left: 72px;
}

/* Mobile Menu Toggle */
/* Tab Strip (hidden by default, shown on native mobile) */
.tab-strip { display: none; }

.mobile-menu-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    left: 1rem;
    z-index: 200;
    width: 48px;
    height: 48px;
    background: var(--slate-900);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1.25rem;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 90;
}

/* Responsive */
@media (max-width: 900px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .mobile-menu-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .content-header {
        padding: 5rem 1.5rem 1.5rem;
    }

    .content-body {
        padding: 1.5rem;
    }

    .bp-input-group {
        flex-wrap: wrap;
    }

    input[type="number"] {
        width: 80px;
        font-size: 1.5rem;
    }
}

/* Native app mobile overrides */
@media (max-width: 900px) {
    html.is-native .mobile-menu-toggle { display: none !important; }
    html.is-native .mobile-overlay { display: none !important; }

    html.is-native .content-header {
        padding: 0.5rem 1rem;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        z-index: 101;
        background: var(--card);
        border-bottom: 1px solid var(--border);
    }

    html.is-native .page-title { font-size: 1.1rem; }
    html.is-native .page-description { font-size: 0.75rem; margin-top: 0.1rem; }
    html.is-native .content-body { padding: 0.75rem; }
    html.is-native .card { border-radius: 12px; }
    html.is-native .card-body { padding: 1rem; }
    html.is-native .form-group { margin-bottom: 1rem; }
    html.is-native .option-item { padding: 0.7rem 0.9rem; }
    html.is-native .option-grid { gap: 0.5rem; }

    html.is-native .bp-input-group { padding: 1rem; gap: 0.75rem; }
    html.is-native input[type="number"] { width: 72px; padding: 0.6rem; font-size: 1.4rem; }
    html.is-native .btn-submit { padding: 0.9rem; }
    html.is-native .result-card { padding: 1rem; }

    /* Urine tab: hide progress indicator and form hints */
    .form-progress { display: none !important; }
    #urineStep1 .form-hint { display: none !important; }
    #urineStep2 > .form-group > .form-hint { display: none !important; }

    html.is-native .tab-strip {
        display: flex;
        justify-content: space-around;
        background: white;
        border-bottom: 1px solid var(--slate-200);
        padding: 0;
        gap: 0;
        scrollbar-width: none;
        position: fixed;
        left: 0;
        right: 0;
        z-index: 100;
    }

    html.is-native .tab-strip::-webkit-scrollbar { display: none; }

    html.is-native .tab-strip-item {
        display: flex;
        align-items: center;
        justify-content: center;
        flex: 1;
        min-height: 44px;
        padding: 0.5rem 0;
        border: none;
        background: none;
        color: var(--slate-400);
        font-size: 1.5625rem;
        cursor: pointer;
        position: relative;
        transition: color 0.2s ease;
    }

    html.is-native .tab-strip-item i { font-size: 1.5625rem; }
    html.is-native .tab-strip-item.active { color: var(--sky-600); }

    html.is-native .tab-strip-item.active::after {
        content: '';
        position: absolute;
        bottom: 0;
        left: 1rem;
        right: 1rem;
        height: 2px;
        background: var(--sky-500);
        border-radius: 2px 2px 0 0;
    }

    html.is-native .tab-strip-item:focus-visible {
        outline: 2px solid var(--sky-500);
        outline-offset: -2px;
        border-radius: 4px;
    }

    /* Tab reorder drag states */
    html.is-native .tab-strip-reordering {
        position: relative;
        -webkit-user-select: none;
        user-select: none;
    }

    html.is-native .tab-strip-item.tab-dragging {
        position: absolute;
        top: 0;
        z-index: 10;
        opacity: 0.9;
        transform: scale(1.15);
        background: white;
        border-radius: 8px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
        transition: none;
    }

    /* ARRS compact on native */
    html.is-native .role-category { margin-bottom: 0.5rem; border-radius: 10px; }
    html.is-native .role-header { padding: 0.75rem 1rem; }
    html.is-native .role-title { gap: 0.5rem; font-size: 0.85rem; white-space: nowrap; }
    html.is-native .role-icon { font-size: 0.85rem; flex-shrink: 0; }
    html.is-native .role-links { padding: 0.75rem; }
}

/* Settings Toggle Button */
.settings-toggle {
    display: none;
}

@media (max-width: 900px) {
    .settings-toggle {
        display: flex;
        align-items: center;
        justify-content: center;
        position: absolute;
        right: 1rem;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        border: none;
        background: none;
        color: var(--slate-600);
        font-size: 1rem;
        cursor: pointer;
        transition: color 0.2s ease;
        -webkit-tap-highlight-color: transparent;
    }

    .settings-toggle:active {
        color: var(--slate-800);
    }
}

html.is-native .settings-toggle { display: flex; }
html.is-native .sidebar-settings-toggle { display: none !important; }

/* Settings Overlay */
.settings-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 500;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.settings-overlay.active {
    display: block;
    opacity: 1;
}

/* Settings Drawer */
.settings-drawer {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 75%;
    max-width: 320px;
    background: var(--card);
    z-index: 501;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    display: flex;
    overflow: hidden;
}

.settings-drawer.open {
    transform: translateX(0);
}

/* Settings Views (slide between main and sub-views) */
.settings-view {
    min-width: 100%;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    transform: translateX(0);
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.settings-drawer.show-resources .settings-view {
    transform: translateX(-100%);
}

/* Settings Header */
.settings-header {
    display: flex;
    align-items: center;
    padding: 1rem;
    padding-top: calc(1rem + env(safe-area-inset-top, 0px));
    border-bottom: 1px solid var(--border);
    min-height: 56px;
    gap: 0.75rem;
}

.settings-title {
    font-family: 'Clash Display', sans-serif;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--slate-900);
    flex: 1;
}

.settings-close,
.settings-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border: none;
    background: var(--slate-100);
    border-radius: 8px;
    color: var(--slate-600);
    font-size: 0.9rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.settings-close:active,
.settings-back:active {
    background: var(--slate-200);
}

/* Settings Menu Items */
.settings-menu {
    padding: 0.5rem;
}

.settings-menu-item {
    display: flex;
    align-items: center;
    width: 100%;
    padding: 0.85rem 0.75rem;
    border: none;
    background: none;
    border-radius: 10px;
    color: var(--slate-800);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    gap: 0.75rem;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s ease;
}

.settings-menu-item:active {
    background: var(--slate-100);
}

.settings-menu-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--sky-50);
    color: var(--sky-600);
    border-radius: 8px;
    font-size: 0.85rem;
}

.settings-menu-label {
    flex: 1;
    text-align: left;
    font-weight: 500;
}

.settings-menu-arrow {
    color: var(--slate-400);
    font-size: 0.75rem;
}

/* Tab Toggle List */
.settings-tab-list {
    padding: 0.5rem;
}

.settings-tab-toggle {
    display: flex;
    align-items: center;
    padding: 0.75rem;
    gap: 0.75rem;
    border-bottom: 1px solid var(--slate-100);
}

.settings-tab-toggle:last-child {
    border-bottom: none;
}

.settings-tab-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 0.85rem;
    color: var(--sky-600);
    background: var(--sky-50);
}

.settings-tab-label {
    flex: 1;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--slate-800);
}

/* iOS-style toggle switch */
.settings-switch {
    position: relative;
    width: 48px;
    height: 28px;
    flex-shrink: 0;
}

.settings-switch input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.settings-switch-track {
    position: absolute;
    inset: 0;
    background: var(--slate-300);
    border-radius: 14px;
    transition: background 0.2s ease;
    cursor: pointer;
}

.settings-switch-track::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 2px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.settings-switch input:checked + .settings-switch-track {
    background: var(--sky-500);
}

.settings-switch input:checked + .settings-switch-track::after {
    transform: translateX(20px);
}

/* iOS Safe Area Insets (notch, Dynamic Island, home indicator) */
@supports (padding-top: env(safe-area-inset-top)) {
    .sidebar {
        padding-top: env(safe-area-inset-top);
        padding-bottom: env(safe-area-inset-bottom);
        padding-left: env(safe-area-inset-left);
    }

    .mobile-menu-toggle {
        top: calc(1rem + env(safe-area-inset-top));
        left: calc(1rem + env(safe-area-inset-left));
    }

    .content-header {
        padding-left: calc(3rem + env(safe-area-inset-left));
        padding-right: calc(3rem + env(safe-area-inset-right));
    }

    .content-body {
        padding-left: calc(2rem + env(safe-area-inset-left));
        padding-right: calc(2rem + env(safe-area-inset-right));
        padding-bottom: calc(2rem + env(safe-area-inset-bottom));
    }

    @media (max-width: 900px) {
        .content-header {
            padding-top: calc(0.5rem + env(safe-area-inset-top));
            padding-left: calc(1rem + env(safe-area-inset-left));
            padding-right: calc(1rem + env(safe-area-inset-right));
        }

        .tab-strip {
            padding-left: env(safe-area-inset-left);
            padding-right: env(safe-area-inset-right);
        }

        .content-body {
            padding-left: calc(0.75rem + env(safe-area-inset-left));
            padding-right: calc(0.75rem + env(safe-area-inset-right));
            padding-bottom: calc(1rem + env(safe-area-inset-bottom));
        }

        .settings-toggle {
            right: calc(1rem + env(safe-area-inset-right));
        }
    }
}

/* Dark mode for native app only */
@media (prefers-color-scheme: dark) {
    html.is-native {
        --bg: #0f172a;
        --card: #1e293b;
        --text: #e2e8f0;
        --text-muted: #94a3b8;
        --border: #334155;
        --text-primary: #cbd5e1;
        --text-secondary: #94a3b8;
        --focus-ring: 0 0 0 4px rgba(14, 165, 233, 0.25);
    }

    /* Welcome screen - already dark, just tweak */
    html.is-native .welcome-screen {
        background: linear-gradient(160deg, #080e1a 0%, #111d33 50%, #080e1a 100%);
    }

    /* Noise texture */
    html.is-native body::before { opacity: 0.03; }

    /* Sidebar */
    html.is-native .sidebar {
        background: #080e1a;
        border-right: 1px solid var(--slate-800);
    }

    /* Page title */
    html.is-native .page-title { color: var(--slate-100); }

    /* Cards */
    html.is-native .card { box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3); }

    /* Form labels */
    html.is-native .form-label { color: var(--slate-300); }

    /* BP input group */
    html.is-native .bp-input-group {
        background: linear-gradient(135deg, var(--slate-800), #0f172a);
        border-color: var(--slate-600);
    }
    html.is-native .bp-input-group:focus-within { background: var(--slate-800); }

    /* Number inputs */
    html.is-native input[type="number"] {
        border-color: var(--slate-600);
        background: var(--slate-800);
        color: var(--slate-100);
    }

    /* BP unit badge */
    html.is-native .bp-unit { background: transparent; }

    /* Option items */
    html.is-native .option-item { background: var(--slate-800); }
    html.is-native .option-item:hover {
        background: var(--slate-700);
        border-color: var(--slate-500);
    }
    html.is-native .option-item:has(input:checked) {
        background: rgba(14, 165, 233, 0.15);
        border-color: var(--coral-400);
    }
    html.is-native .option-item label { color: var(--slate-300); }

    /* Inline radio buttons */
    html.is-native .radio-inline { color: var(--slate-300); }

    /* Role count badge */
    html.is-native .role-count {
        background: rgba(14, 165, 233, 0.15);
        color: var(--coral-400);
    }

    /* Submit button */
    html.is-native .btn-submit {
        background: var(--slate-700);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }
    html.is-native .btn-submit:hover { box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4); }

    /* Reset button */
    html.is-native .btn-reset:hover { background: rgba(255, 255, 255, 0.05); }

    /* Result card variants */
    html.is-native .result-urgent { background: rgba(244, 63, 94, 0.15); color: #fecdd3; }
    html.is-native .result-warning { background: rgba(245, 158, 11, 0.15); color: #fde68a; }
    html.is-native .result-success { background: rgba(16, 185, 129, 0.15); color: #a7f3d0; }
    html.is-native .result-info { background: rgba(14, 165, 233, 0.15); color: #bae6fd; }
    html.is-native .result-neutral { background: rgba(100, 116, 139, 0.15); color: var(--slate-300); }
    html.is-native .result-purple { background: rgba(139, 92, 246, 0.15); color: #ddd6fe; }

    /* Info boxes */
    html.is-native .info-box-blue { background: rgba(14, 165, 233, 0.12); color: #bae6fd; }
    html.is-native .info-box-warning { background: rgba(245, 158, 11, 0.12); color: #fde68a; }
    html.is-native .info-box-urgent { background: rgba(244, 63, 94, 0.12); border-color: rgba(244, 63, 94, 0.3); color: #fecdd3; }
    html.is-native .info-box-amber { background: rgba(245, 158, 11, 0.12); border-color: rgba(245, 158, 11, 0.3); color: #fde68a; }
    html.is-native .info-box-success { background: rgba(16, 185, 129, 0.12); border-color: rgba(16, 185, 129, 0.3); color: #a7f3d0; }
    html.is-native .info-box-neutral { background: rgba(100, 116, 139, 0.12); border-color: rgba(100, 116, 139, 0.3); color: var(--slate-300); }

    /* Alert boxes */
    html.is-native .alert-urgent { background: rgba(244, 63, 94, 0.15); color: #fecdd3; }
    html.is-native .alert-warning { background: rgba(245, 158, 11, 0.15); color: #fde68a; }

    /* Highlight boxes */
    html.is-native .highlight-urgent { background: rgba(244, 63, 94, 0.15); color: #fecdd3; }

    /* Inline/error messages */
    html.is-native .inline-error { background: rgba(244, 63, 94, 0.15); }
    html.is-native .error-message { background: rgba(244, 63, 94, 0.15); }

    /* Search input */
    html.is-native .search-input { background: var(--slate-800); color: var(--slate-100); }

    /* ARRS Role categories */
    html.is-native .role-category { background: var(--card); }
    html.is-native .role-header { background: var(--slate-800); }
    html.is-native .role-header:hover { background: var(--slate-700); }
    html.is-native .role-title { color: var(--slate-200); }

    /* Resource links */
    html.is-native .resource-link { background: var(--slate-800); }
    html.is-native .resource-link:hover { background: rgba(14, 165, 233, 0.12); }

    /* Urine guide sections */
    html.is-native .guide-section { background: var(--card); }
    html.is-native .guide-section:hover { box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); }
    html.is-native .guide-section.urgent-section { background: linear-gradient(to bottom, rgba(244, 63, 94, 0.12), var(--card)); }
    html.is-native .guide-header { background: var(--slate-800); }
    html.is-native .guide-header h3 { color: var(--slate-100); }
    html.is-native .guide-section.urgent-section .guide-header { background: rgba(244, 63, 94, 0.15); }
    html.is-native .guide-icon { background: var(--slate-700); }
    html.is-native .guide-list li { background: var(--slate-800); }
    html.is-native .significance-list li { background: linear-gradient(135deg, var(--slate-700), var(--slate-800)); }

    /* Symptoms & action lists */
    html.is-native .symptoms-list-guide li { background: rgba(245, 158, 11, 0.12); }
    html.is-native .action-list li { background: rgba(16, 185, 129, 0.12); }

    /* Dipstick items */
    html.is-native .dipstick-item { background: var(--slate-800); border-color: var(--slate-700); }

    /* Quick reference */
    html.is-native .quick-ref-item { background: var(--slate-800); border-color: var(--slate-700); }

    /* Progress indicator */
    html.is-native .form-progress { background: var(--slate-800); }
    html.is-native .form-progress::before { background: var(--slate-600); }
    html.is-native .progress-dot { background: var(--card); }

    /* Back button */
    html.is-native .btn-back { border-color: var(--slate-600); color: var(--slate-400); }
    html.is-native .btn-back:hover { background: var(--slate-700); border-color: var(--slate-500); color: var(--slate-200); }

    /* Draft banner */
    html.is-native .draft-banner { background: rgba(14, 165, 233, 0.12); color: var(--slate-200); }
    html.is-native .btn-draft-dismiss { border-color: var(--slate-600); color: var(--slate-400); }
    html.is-native .btn-draft-dismiss:hover { background: var(--slate-700); border-color: var(--slate-500); }

    /* Mental health crisis option */
    html.is-native .mh-complex-grid .option-item:has(#complexCrisis) { background: rgba(244, 63, 94, 0.12); }
    html.is-native .mh-complex-grid .option-item:has(#complexCrisis):has(input:checked) { background: rgba(244, 63, 94, 0.2); }
    html.is-native .mh-services-list li:hover { background: rgba(14, 165, 233, 0.12); }
    html.is-native .mh-progress-dot { background: var(--slate-600); }

    /* Option warning variant */
    html.is-native .option-item-warning { border-color: rgba(245, 158, 11, 0.3); background: rgba(245, 158, 11, 0.08); }
    html.is-native .option-item-warning:hover { border-color: rgba(245, 158, 11, 0.4); background: rgba(245, 158, 11, 0.12); }
    html.is-native .option-item-warning:has(input:checked) { background: rgba(244, 63, 94, 0.15); }

    /* Mobile menu toggle */
    html.is-native .mobile-menu-toggle { background: var(--slate-800); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
    html.is-native .mobile-overlay { background: rgba(0, 0, 0, 0.7); }

    /* Skip link */
    html.is-native .skip-link { background: var(--slate-800); }

    /* Settings drawer */
    html.is-native .settings-title { color: var(--slate-100); }
    html.is-native .settings-close, html.is-native .settings-back { background: var(--slate-700); color: var(--slate-300); }
    html.is-native .settings-close:active, html.is-native .settings-back:active { background: var(--slate-600); }
    html.is-native .settings-menu-item { color: var(--slate-200); }
    html.is-native .settings-menu-item:active { background: var(--slate-700); }
    html.is-native .settings-menu-icon { background: var(--slate-700); color: var(--coral-400); }
    html.is-native .settings-tab-label { color: var(--slate-200); }
    html.is-native .settings-tab-icon { color: var(--coral-400); background: var(--slate-700); }
    html.is-native .settings-tab-toggle { border-bottom-color: var(--slate-700); }
    html.is-native .settings-switch-track { background: var(--slate-600); }
    html.is-native .settings-toggle:active { color: var(--slate-300); }

    /* Sidebar collapse toggle */
    html.is-native .sidebar-collapse-toggle { background: var(--slate-700); border-color: var(--slate-600); }
    html.is-native .sidebar.collapsed .nav-item::after { background: var(--slate-700); box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3); }
    html.is-native .sidebar.collapsed .nav-item::before { border-right-color: var(--slate-700); }

    /* Validation states */
    html.is-native input[type="number"].is-valid { background: rgba(16, 185, 129, 0.15); }
    html.is-native input[type="number"].is-invalid { background: rgba(244, 63, 94, 0.15); }
    html.is-native .form-group.has-error .bp-input-group { background: rgba(244, 63, 94, 0.1); }

    /* Settings overlay */
    html.is-native .settings-overlay { background: rgba(0, 0, 0, 0.6); }

    /* Child hint */
    html.is-native .form-hint-child { border-top-color: var(--slate-600); }

    /* Mobile tab strip */
    @media (max-width: 900px) {
        html.is-native .tab-strip { background: var(--card); border-bottom-color: var(--border); }
        html.is-native .tab-strip-item.tab-dragging { background: var(--card); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3); }
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
