:root {
    --primary: #267b60;
    --primary-dark: #185d49;
    --primary-soft: #e8f4ef;
    --primary-rgb: 38, 123, 96;
    --accent-text: #267b60;
    --brand-deep: #0b2b26;
    --brand-surface: #123d35;
    --brand-border: #285649;
    --brand-mint: #70e3b0;
    --brand-text: #c7d9d2;
    --brand-muted: #9bb4ab;
    --brand-active: #194c41;
    --success: #15803d;
    --success-button: #15803d;
    --success-button-hover: #166534;
    --warning: #b45309;
    --danger: #b91c1c;
    --danger-button: #b91c1c;
    --danger-button-hover: #991b1b;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --surface: #ffffff;
    --surface-soft: #f9fafb;
    --border: #e5e7eb;
    --text: #1f2937;
    --text-muted: #4b5563;
    --employee-bg: #071f1b;
    --employee-surface: #123d35;
    --employee-surface-raised: #153f36;
    --employee-border: #285649;
    --employee-text: #f5fbf8;
    --employee-muted: #a8beb6;
    --focus-ring: rgba(38, 123, 96, .18);
    --sidebar-width: 240px;
    color-scheme: light;
}

html[data-skin="ocean"] {
    --primary: #176b96;
    --primary-dark: #0f5276;
    --primary-soft: #e7f3f9;
    --primary-rgb: 23, 107, 150;
    --accent-text: #176b96;
    --brand-deep: #082d40;
    --brand-surface: #0d4059;
    --brand-border: #28647c;
    --brand-mint: #75d8ff;
    --brand-text: #d4edf7;
    --brand-muted: #a8cbd9;
    --brand-active: #15536d;
    --employee-bg: #061f2c;
    --employee-surface: #0d4059;
    --employee-surface-raised: #15536d;
    --employee-border: #28647c;
    --employee-text: #f4fbfe;
    --employee-muted: #b6d7e3;
    --focus-ring: rgba(23, 107, 150, .2);
}

html[data-skin="plum"] {
    --primary: #7552a3;
    --primary-dark: #5b3c84;
    --primary-soft: #f1ebf8;
    --primary-rgb: 117, 82, 163;
    --accent-text: #7552a3;
    --brand-deep: #2b1d3a;
    --brand-surface: #3a2850;
    --brand-border: #604a76;
    --brand-mint: #ddb7ff;
    --brand-text: #eadff2;
    --brand-muted: #c9b7d5;
    --brand-active: #4b3563;
    --employee-bg: #21162d;
    --employee-surface: #3a2850;
    --employee-surface-raised: #4b3563;
    --employee-border: #604a76;
    --employee-text: #fbf8fd;
    --employee-muted: #d7c9df;
    --focus-ring: rgba(117, 82, 163, .2);
}

html[data-skin="contrast"] {
    --primary: #005fcc;
    --primary-dark: #004da8;
    --primary-soft: #e5f0ff;
    --primary-rgb: 0, 95, 204;
    --accent-text: #005fcc;
    --brand-deep: #000000;
    --brand-surface: #151515;
    --brand-border: #ffffff;
    --brand-mint: #ffeb3b;
    --brand-text: #ffffff;
    --brand-muted: #ffffff;
    --brand-active: #303030;
    --gray-400: #64748b;
    --gray-500: #475569;
    --gray-600: #334155;
    --gray-700: #1e293b;
    --gray-800: #0f172a;
    --border: #64748b;
    --employee-bg: #000000;
    --employee-surface: #151515;
    --employee-surface-raised: #252525;
    --employee-border: #ffffff;
    --employee-text: #ffffff;
    --employee-muted: #ffffff;
    --focus-ring: rgba(0, 95, 204, .28);
}

html[data-skin="slate"] {
    --primary: #475569;
    --primary-dark: #334155;
    --primary-soft: #e2e8f0;
    --primary-rgb: 71, 85, 105;
    --accent-text: #475569;
    --brand-deep: #111827;
    --brand-surface: #1f2937;
    --brand-border: #475569;
    --brand-mint: #e2e8f0;
    --brand-text: #f1f5f9;
    --brand-muted: #cbd5e1;
    --brand-active: #374151;
    --employee-bg: #0f172a;
    --employee-surface: #1f2937;
    --employee-surface-raised: #334155;
    --employee-border: #64748b;
    --employee-text: #f8fafc;
    --employee-muted: #cbd5e1;
    --focus-ring: rgba(71, 85, 105, .25);
}

html[data-skin="warm"] {
    --primary: #8a4b22;
    --primary-dark: #6b3517;
    --primary-soft: #f8eadc;
    --primary-rgb: 138, 75, 34;
    --accent-text: #8a4b22;
    --brand-deep: #38271d;
    --brand-surface: #4b3426;
    --brand-border: #795b47;
    --brand-mint: #ffd08a;
    --brand-text: #fff4e6;
    --brand-muted: #e7cdb8;
    --brand-active: #624631;
    --surface: #fffaf2;
    --surface-soft: #f7efe3;
    --border: #d9c6ae;
    --text: #352a22;
    --text-muted: #5f5146;
    --gray-50: #f7efe3;
    --gray-100: #f1e5d6;
    --gray-200: #d9c6ae;
    --gray-400: #88776a;
    --gray-500: #6f5f53;
    --gray-600: #5f5146;
    --gray-700: #473a31;
    --gray-800: #352a22;
    --employee-bg: #281b14;
    --employee-surface: #4b3426;
    --employee-surface-raised: #624631;
    --employee-border: #795b47;
    --employee-text: #fff8ef;
    --employee-muted: #e7cdb8;
    --focus-ring: rgba(138, 75, 34, .23);
}

html[data-skin="color-safe"] {
    --primary: #00689d;
    --primary-dark: #004d76;
    --primary-soft: #e2f2fa;
    --primary-rgb: 0, 104, 157;
    --accent-text: #00689d;
    --brand-deep: #17202a;
    --brand-surface: #243442;
    --brand-border: #526779;
    --brand-mint: #f5c04a;
    --brand-text: #f7fafc;
    --brand-muted: #cad5df;
    --brand-active: #34495a;
    --success: #00689d;
    --success-button: #00689d;
    --success-button-hover: #004d76;
    --warning: #9a6700;
    --danger: #9d3d00;
    --danger-button: #9d3d00;
    --danger-button-hover: #7a2f00;
    --employee-bg: #101820;
    --employee-surface: #243442;
    --employee-surface-raised: #34495a;
    --employee-border: #526779;
    --employee-text: #f8fafc;
    --employee-muted: #d5dee6;
    --focus-ring: rgba(0, 104, 157, .24);
}

html[data-skin="midnight"] {
    --primary: #0e7490;
    --primary-dark: #155e75;
    --primary-soft: #164e63;
    --primary-rgb: 14, 116, 144;
    --accent-text: #67e8f9;
    --success: #4ade80;
    --warning: #fbbf24;
    --danger: #f87171;
    --brand-deep: #020617;
    --brand-surface: #0f172a;
    --brand-border: #475569;
    --brand-mint: #67e8f9;
    --brand-text: #f1f5f9;
    --brand-muted: #cbd5e1;
    --brand-active: #1e293b;
    --surface: #111827;
    --surface-soft: #080f1d;
    --border: #475569;
    --text: #f8fafc;
    --text-muted: #cbd5e1;
    --gray-50: #0b1220;
    --gray-100: #1e293b;
    --gray-200: #475569;
    --gray-400: #94a3b8;
    --gray-500: #cbd5e1;
    --gray-600: #cbd5e1;
    --gray-700: #e2e8f0;
    --gray-800: #f8fafc;
    --employee-bg: #020617;
    --employee-surface: #0f172a;
    --employee-surface-raised: #1e293b;
    --employee-border: #475569;
    --employee-text: #f8fafc;
    --employee-muted: #cbd5e1;
    --focus-ring: rgba(103, 232, 249, .3);
    color-scheme: dark;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--surface-soft);
}

/* Give ordinary content links the active theme instead of browser blue/purple.
   Component and inline styles continue to define navigation, cards and buttons. */
a { color: var(--accent-text); }

a:where(:not([class])) {
    text-decoration: underline;
    text-underline-offset: 3px;
}

a:where(:not([class])):hover { text-decoration-thickness: 2px; }

.app-shell { display: flex; min-height: 100vh; }

.sidebar {
    width: var(--sidebar-width);
    background: var(--brand-deep);
    color: var(--brand-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    overflow-y: auto;
    z-index: 100;
}

.sidebar-brand {
    padding: 20px 16px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    border-bottom: 1px solid var(--brand-border);
    text-decoration: none;
    display: block;
}

.sidebar-brand span { color: var(--brand-mint); }

.sidebar-section {
    padding: 8px 12px 4px;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--brand-muted);
    margin-top: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 16px;
    color: var(--brand-muted);
    text-decoration: none;
    border-radius: 6px;
    margin: 1px 8px;
    font-size: 13.5px;
    transition: background 0.15s, color 0.15s;
}

.sidebar-nav a:hover, .sidebar-nav a.active {
    background: var(--brand-active);
    color: #f1f5f9;
}

.sidebar-footer {
    margin-top: auto;
    padding: 12px 8px;
    border-top: 1px solid var(--brand-border);
}

.sidebar-footer a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    color: var(--brand-muted);
    text-decoration: none;
    border-radius: 6px;
    font-size: 13px;
}

.sidebar-footer a:hover { background: var(--brand-active); color: #f1f5f9; }

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    padding: 0 24px;
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 50;
}

.topbar-title { font-size: 16px; font-weight: 600; color: var(--text); }
.topbar-actions { display: flex; align-items: center; gap: 12px; }

.page-body { padding: 24px; flex: 1; }

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    overflow: hidden;
}

.card-header {
    padding: 16px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h2 { margin: 0; font-size: 15px; font-weight: 600; }
.card-body { padding: 20px; }

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 16px;
}

.stat-label { font-size: 12px; color: var(--gray-600); margin-bottom: 6px; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--text); }
.stat-value.text-green { color: var(--success); }
.stat-value.text-amber { color: var(--warning); }
.stat-value.text-red { color: var(--danger); }
.stat-value.text-blue { color: var(--accent-text); }

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13.5px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.15s, opacity 0.15s;
    white-space: nowrap;
}

.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success-button); color: #fff; }
.btn-success:hover { background: var(--success-button-hover); color: #fff; }
.btn-danger { background: var(--danger-button); color: #fff; }
.btn-danger:hover { background: var(--danger-button-hover); color: #fff; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { background: var(--gray-100); }
.btn-sm { padding: 5px 10px; font-size: 12px; }
.btn-xs { padding: 3px 8px; font-size: 11.5px; }

.table-wrap { overflow-x: auto; }

table.data-table { width: 100%; border-collapse: collapse; }

.data-table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--gray-600);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.data-table td {
    padding: 12px 14px;
    border-bottom: 1px solid var(--gray-100);
    vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: var(--gray-50); }

.badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge-blue { background: #dbeafe; color: #1d4ed8; }
.badge-green { background: #dcfce7; color: #15803d; }
.badge-amber { background: #fef3c7; color: #b45309; }
.badge-red { background: #fee2e2; color: #b91c1c; }
.badge-gray { background: var(--gray-200); color: var(--gray-600); }
.badge-purple { background: #dff4ea; color: #176b52; }

.form-group { margin-bottom: 16px; }

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text);
    margin-bottom: 6px;
}

.form-control, .form-select, textarea.form-control {
    display: block;
    width: 100%;
    padding: 9px 12px;
    font-size: 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    outline: none;
    font-family: inherit;
}

.form-control:focus, .form-select:focus, textarea.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--focus-ring);
}

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

.text-danger { color: var(--danger); font-size: 12px; margin-top: 4px; }

.form-actions {
    display: flex;
    gap: 12px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--gray-200);
}

.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; }
.alert-success { background: #dcfce7; color: #15803d; border: 1px solid #bbf7d0; }
.alert-danger { background: #fee2e2; color: #b91c1c; border: 1px solid #fecaca; }
.alert-info { background: #dbeafe; color: #1d4ed8; border: 1px solid #bfdbfe; }
.alert-warning { background: #fef3c7; color: #b45309; border: 1px solid #fde68a; }

.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-header h1 { margin: 0; font-size: 20px; font-weight: 700; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-bottom: 24px; }

.invoice-detail-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; align-items: start; max-width: 960px; }
.invoice-meta-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 20px; }
.invoice-items-scroll { overflow-x: auto; }
.invoice-notes { background: var(--gray-50); border-radius: 8px; padding: 12px; font-size: 13px; color: var(--text-muted); }
.invoice-notes strong { color: var(--text); }

.dl dt { font-size: 11.5px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.05em; color: var(--gray-600); margin-bottom: 2px; }
.dl dd { margin: 0 0 14px; font-size: 14px; }

.empty-state { text-align: center; padding: 48px 24px; color: var(--gray-600); }
.empty-state p { margin: 0 0 16px; font-size: 15px; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; padding: 4px; color: var(--text); }

@media (max-width: 768px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s ease; }
    .sidebar.open { transform: translateX(0); }
    .main-content { margin-left: 0; }
    .menu-toggle { display: block; }
    .form-row, .form-row-3 { grid-template-columns: 1fr; }
    .detail-grid { grid-template-columns: 1fr; }
    .invoice-detail-layout { grid-template-columns: 1fr; }
    .invoice-meta-grid { grid-template-columns: 1fr; gap: 10px; }
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .page-header { flex-direction: column; align-items: flex-start; gap: 10px; }
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.4); z-index: 99; }
.sidebar-overlay.open { display: block; }

.text-muted { color: var(--gray-600); }
.text-sm { font-size: 12px; }
.message-thread { max-width: 760px; margin-bottom: 16px; }
.message-row { padding: 12px 0; border-bottom: 1px solid var(--border); }
.message-row:last-child { border-bottom: 0; }
.message-row > div { display: flex; gap: 10px; align-items: baseline; }
.message-row p { margin: 7px 0 9px; white-space: pre-wrap; overflow-wrap: anywhere; }
.message-unread { border-left: 3px solid var(--accent-text); padding-left: 10px; }
.message-composer { display: flex; gap: 8px; align-items: flex-end; padding-top: 14px; }
.message-composer textarea { flex: 1; min-width: 0; resize: vertical; }
.mt-0 { margin-top: 0; }
.mb-4 { margin-bottom: 16px; }
.flex { display: flex; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: 8px; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }

/* User-selectable appearance skins */
.skin-picker { position: relative; }
.skin-picker-trigger {
    display: inline-flex;
    min-height: 34px;
    align-items: center;
    gap: 7px;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--surface);
    color: var(--text-muted);
    font: inherit;
    font-size: 12px;
    font-weight: 650;
    cursor: pointer;
}
.skin-picker-trigger:hover,
.skin-picker-trigger[aria-expanded="true"] { border-color: var(--primary); color: var(--primary); }
.skin-picker-trigger svg { width: 16px; height: 16px; }
.skin-picker-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    z-index: 500;
    width: 272px;
    max-height: min(680px, calc(100vh - 82px));
    overflow-y: auto;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--surface);
    box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
}
.skin-picker-menu[hidden] { display: none; }
.skin-picker-heading { padding: 5px 7px 9px; color: var(--text); font-size: 13px; font-weight: 750; }
.skin-option {
    display: grid;
    grid-template-columns: 32px 1fr 18px;
    gap: 10px;
    width: 100%;
    align-items: center;
    padding: 9px 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.skin-option:hover { background: var(--surface-soft); }
.skin-option[aria-pressed="true"] { background: var(--primary-soft); }
.skin-option-copy { display: grid; gap: 2px; }
.skin-option-copy strong { font-size: 12px; }
.skin-option-copy small { color: var(--text-muted); font-size: 10px; }
.skin-option-check { color: var(--primary); font-weight: 900; opacity: 0; }
.skin-option[aria-pressed="true"] .skin-option-check { opacity: 1; }
.skin-swatches { display: flex; overflow: hidden; width: 32px; height: 22px; border: 1px solid rgba(15,23,42,.16); border-radius: 6px; }
.skin-swatches i { flex: 1; }
.skin-swatches-evergreen i:first-child { background: #0b2b26; }
.skin-swatches-evergreen i:last-child { background: #267b60; }
.skin-swatches-ocean i:first-child { background: #082d40; }
.skin-swatches-ocean i:last-child { background: #176b96; }
.skin-swatches-plum i:first-child { background: #2b1d3a; }
.skin-swatches-plum i:last-child { background: #7552a3; }
.skin-swatches-contrast i:first-child { background: #000; }
.skin-swatches-contrast i:last-child { background: #ffeb3b; }
.skin-swatches-slate i:first-child { background: #111827; }
.skin-swatches-slate i:last-child { background: #94a3b8; }
.skin-swatches-warm i:first-child { background: #38271d; }
.skin-swatches-warm i:last-child { background: #d59a5c; }
.skin-swatches-color-safe i:first-child { background: #00689d; }
.skin-swatches-color-safe i:last-child { background: #f5c04a; }
.skin-swatches-midnight i:first-child { background: #020617; }
.skin-swatches-midnight i:last-child { background: #67e8f9; }

.skin-picker-divider { height: 1px; margin: 9px 7px 5px; background: var(--border); }
.a11y-option {
    display: flex;
    width: 100%;
    min-height: 48px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px;
    border: 0;
    border-radius: 9px;
    background: transparent;
    color: var(--text);
    text-align: left;
    cursor: pointer;
}
.a11y-option:hover { background: var(--surface-soft); }
.a11y-option > span { display: grid; gap: 2px; }
.a11y-option strong { font-size: 12px; }
.a11y-option small { color: var(--text-muted); font-size: 10px; }
.a11y-option > i {
    position: relative;
    width: 34px;
    height: 20px;
    flex: 0 0 auto;
    border: 1px solid var(--border);
    border-radius: 999px;
    background: var(--gray-200);
}
.a11y-option > i::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--surface);
    box-shadow: 0 1px 3px rgba(0,0,0,.28);
    transition: transform .16s ease;
}
.a11y-option[aria-checked="true"] > i { border-color: var(--primary); background: var(--primary); }
.a11y-option[aria-checked="true"] > i::after { transform: translateX(14px); }

.btn { min-height: 32px; }
.btn-xs { min-height: 26px; }
.menu-toggle { min-width: 28px; min-height: 28px; }

html[data-large-text="true"] body { font-size: 16px; }
html[data-large-text="true"] .sidebar-nav a { min-height: 42px; font-size: 15px; }
html[data-large-text="true"] .topbar-title { font-size: 18px; }
html[data-large-text="true"] .btn { min-height: 40px; font-size: 15px; }
html[data-large-text="true"] .btn-xs,
html[data-large-text="true"] .btn-sm { min-height: 36px; font-size: 14px; }
html[data-large-text="true"] .form-control,
html[data-large-text="true"] .form-select,
html[data-large-text="true"] textarea.form-control { min-height: 44px; font-size: 16px; }
html[data-large-text="true"] .data-table td { font-size: 15px; }
html[data-large-text="true"] .data-table th,
html[data-large-text="true"] .form-label,
html[data-large-text="true"] .text-sm { font-size: 13px; }
html[data-large-text="true"] .help-card p,
html[data-large-text="true"] .help-article-section p,
html[data-large-text="true"] .help-article-section li { font-size: 16px; }
html[data-large-text="true"] .bottom-nav-item { min-height: 54px; font-size: 12px; }

html[data-reduced-motion="true"] { scroll-behavior: auto !important; }
html[data-reduced-motion="true"] *,
html[data-reduced-motion="true"] *::before,
html[data-reduced-motion="true"] *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
}

html[data-link-emphasis="true"] .page-body a:not(.btn),
html[data-link-emphasis="true"] .mobile-body-pad a:not(.btn):not(.bottom-nav-item):not(.status-btn),
html[data-link-emphasis="true"] .help-article a:not(.btn) {
    text-decoration: underline !important;
    text-decoration-thickness: .09em;
    text-underline-offset: .18em;
}

:focus-visible { outline: 2px solid #fff; outline-offset: 2px; box-shadow: 0 0 0 4px var(--primary); }

/* Normalize legacy inline brand colors while screens migrate to tokens. */
[style*="background:#123d35"], [style*="background: #123d35"] { background: var(--brand-surface) !important; }
[style*="background:#071f1b"], [style*="background: #071f1b"] { background: var(--employee-bg) !important; }
[style*="background:#153f36"], [style*="background: #153f36"] { background: var(--employee-surface-raised) !important; }
[style*="background:#267b60"], [style*="background: #267b60"] { background: var(--primary) !important; }
[style*="border:1px solid #285649"], [style*="border: 1px solid #285649"] { border-color: var(--brand-border) !important; }
[style*="border-color:#285649"], [style*="border-color: #285649"] { border-color: var(--brand-border) !important; }
[style*="border-color:#267b60"], [style*="border-color: #267b60"] { border-color: var(--primary) !important; }
[style*="color:#267b60"], [style*="color: #267b60"] { color: var(--accent-text) !important; }
[style*="color:#64748b"], [style*="color: #64748b"] { color: var(--text-muted) !important; }
[style*="color:#1f2937"], [style*="color: #1f2937"] { color: var(--text) !important; }
[style*="color:#70e3b0"], [style*="color: #70e3b0"] { color: var(--brand-mint) !important; }
[style*="color:#f5fbf8"], [style*="color: #f5fbf8"] { color: var(--employee-text) !important; }
[style*="color:#dce9e4"], [style*="color: #dce9e4"] { color: var(--employee-text) !important; }
[style*="color:#a8beb6"], [style*="color: #a8beb6"] { color: var(--employee-muted) !important; }
[style*="color:#78938b"], [style*="color: #78938b"] { color: var(--employee-muted) !important; }
[stroke="#267b60"] { stroke: var(--primary); }
.employee-body [style*="color:#267b60"],
.employee-body [style*="color: #267b60"] { color: var(--brand-mint) !important; }
.employee-body [style*="color:#285649"],
.employee-body [style*="color: #285649"] { color: var(--employee-muted) !important; }
.employee-body [stroke="#267b60"] { stroke: var(--brand-mint); }
html[data-skin="midnight"] [style*="color:#475569"],
html[data-skin="midnight"] [style*="color: #475569"],
html[data-skin="midnight"] [style*="color:#668279"],
html[data-skin="midnight"] [style*="color: #668279"],
html[data-skin="midnight"] [style*="color:#9bb4ab"],
html[data-skin="midnight"] [style*="color: #9bb4ab"] { color: var(--text-muted) !important; }

@media (max-width: 520px) {
    .skin-picker-label { display: none; }
    .skin-picker-menu { position: fixed; top: 62px; right: 12px; left: 12px; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

@media (prefers-contrast: more) {
    :root { --border: #64748b; }
    .card, .stat-card, .form-control, .form-select, .btn-outline { border-width: 2px; }
}

@media (forced-colors: active) {
    .skin-swatches { forced-color-adjust: none; }
    :focus-visible { outline: 3px solid Highlight; box-shadow: none; }
}

/* Subscription choices use native radios inside responsive comparison cards. */
.billing-plan-fieldset { border: 0; padding: 0; margin: 20px 0; min-width: 0; }
.billing-plan-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.billing-plan-card { display: flex; flex-direction: column; padding: 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); cursor: pointer; }
.billing-plan-card:has(input:disabled) { cursor: default; }
.billing-plan-card:has(input:checked) { border: 2px solid var(--primary); padding: 19px; background: var(--surface-soft); }
.billing-plan-card:has(input:focus-visible) { outline: 2px solid var(--primary); outline-offset: 3px; }
.billing-plan-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.billing-plan-name { font-size: 18px; font-weight: 700; }
.billing-plan-card input, .billing-texting-addon input { width: 18px; height: 18px; flex: none; accent-color: var(--primary); }
.billing-plan-audience { color: var(--gray-500); min-height: 40px; line-height: 1.5; }
.billing-plan-price { display: flex; align-items: baseline; gap: 4px; margin: 8px 0 18px; }
.billing-plan-price strong { font-size: 36px; letter-spacing: -1px; }
.billing-plan-price span, .billing-addon-price span { color: var(--gray-500); font-size: 13px; font-weight: 400; }
.billing-plan-features { padding-left: 18px; margin: 0 0 20px; line-height: 1.8; }
.billing-plan-selection { margin-top: auto; color: var(--accent-text); font-weight: 700; visibility: hidden; }
.billing-plan-card:has(input:checked) .billing-plan-selection { visibility: visible; }
.billing-texting-addon { display: flex; align-items: flex-start; gap: 12px; padding: 18px; margin-bottom: 20px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; }
.billing-texting-addon .form-hint { display: block; margin-top: 5px; }
.billing-addon-price { margin-left: auto; white-space: nowrap; }
.billing-addon-price span { display: block; text-align: right; }
@media (max-width: 900px) { .billing-plan-grid { grid-template-columns: 1fr; } .billing-plan-audience { min-height: 0; } }
@media (max-width: 480px) { .billing-texting-addon { flex-wrap: wrap; } .billing-texting-addon > span { flex: 1; } .billing-addon-price { margin-left: 30px; } }
