/* AutoFlow theme palettes. The picker previews use the same colors as the pages. */

body.af-w005[data-af-theme="light"],
.af-theme-sample[data-af-theme="light"] {
    --bg: #f4f4f1;
    --surface: #ffffff;
    --raised: #eeefea;
    --dialog: #fbfbf8;
    --line: #cccec7;
    --t1: #20221e;
    --t2: #444840;
    --t3: #5d6258;
    --accent: #805000;
    --tint: #fff1cf;
    --af-header: #151518;
    --af-action: #ffab05;
}

body.af-w005[data-af-theme="sand"],
.af-theme-sample[data-af-theme="sand"] {
    --bg: #f6e8cf;
    --surface: #fff7e8;
    --raised: #efdfc1;
    --dialog: #fff5e2;
    --line: #cdb690;
    --t1: #382919;
    --t2: #5b4730;
    --t3: #6c553b;
    --accent: #874500;
    --tint: #f4debb;
    --af-header: #33281e;
    --af-action: #e7a855;
}

body.af-w005[data-af-theme="mint"],
.af-theme-sample[data-af-theme="mint"] {
    --bg: #e0f3e9;
    --surface: #f3fff8;
    --raised: #cde9dc;
    --dialog: #effcf5;
    --line: #a5c9b6;
    --t1: #19392e;
    --t2: #345748;
    --t3: #466556;
    --accent: #14664c;
    --tint: #d0eddf;
    --af-header: #17372d;
    --af-action: #78d8af;
}

body.af-w005[data-af-theme="sky"],
.af-theme-sample[data-af-theme="sky"] {
    --bg: #e1effc;
    --surface: #f5faff;
    --raised: #cddff2;
    --dialog: #f0f7ff;
    --line: #a3bfd9;
    --t1: #1c344d;
    --t2: #3a526b;
    --t3: #4b6178;
    --accent: #235e9a;
    --tint: #d7e8fb;
    --af-header: #1b3047;
    --af-action: #82bfff;
}

body.af-w005[data-af-theme="lavender"],
.af-theme-sample[data-af-theme="lavender"] {
    --bg: #eee5fa;
    --surface: #fbf8ff;
    --raised: #e4d8f0;
    --dialog: #f8f3ff;
    --line: #c4b2d7;
    --t1: #382844;
    --t2: #564267;
    --t3: #675474;
    --accent: #72448e;
    --tint: #ebdcf4;
    --af-header: #35273e;
    --af-action: #cba3eb;
}

body.af-w005[data-af-theme="dark"],
.af-theme-sample[data-af-theme="dark"] {
    --bg: #19191c;
    --surface: #232326;
    --raised: #2c2c30;
    --dialog: #242427;
    --line: #404044;
    --t1: #f6f5f3;
    --t2: #cfcecc;
    --t3: #aeadaa;
    --accent: #ffab05;
    --tint: #3c3223;
    --af-header: #151518;
    --af-action: #ffab05;
}

body.af-w005[data-af-theme="navy"],
.af-theme-sample[data-af-theme="navy"] {
    --bg: #101d33;
    --surface: #192b47;
    --raised: #233957;
    --dialog: #1c304d;
    --line: #415779;
    --t1: #eff5ff;
    --t2: #cedbee;
    --t3: #a7bcd6;
    --accent: #8cbfff;
    --tint: #263e5c;
    --af-header: #0b1728;
    --af-action: #8cbfff;
}

body.af-w005[data-af-theme="forest"],
.af-theme-sample[data-af-theme="forest"] {
    --bg: #10271e;
    --surface: #19372a;
    --raised: #244735;
    --dialog: #1d3b2e;
    --line: #426550;
    --t1: #effbf1;
    --t2: #c9e4d2;
    --t3: #a7c7b4;
    --accent: #83dda0;
    --tint: #284a36;
    --af-header: #0c1e16;
    --af-action: #83dda0;
}

body.af-w005[data-af-theme="plum"],
.af-theme-sample[data-af-theme="plum"] {
    --bg: #2c1b32;
    --surface: #3b2643;
    --raised: #4a3153;
    --dialog: #402a48;
    --line: #72527b;
    --t1: #fcf1ff;
    --t2: #e7cfea;
    --t3: #c9abcd;
    --accent: #e3a3ee;
    --tint: #553459;
    --af-header: #231429;
    --af-action: #e3a3ee;
}

body.af-w005[data-af-theme="mocha"],
.af-theme-sample[data-af-theme="mocha"] {
    --bg: #30211c;
    --surface: #412e25;
    --raised: #50382d;
    --dialog: #453025;
    --line: #735647;
    --t1: #fbf1e8;
    --t2: #e8d4c2;
    --t3: #cab39f;
    --accent: #edb17e;
    --tint: #583c2a;
    --af-header: #251913;
    --af-action: #edb17e;
}

body.af-w005 .af-theme-dialog {
    position: fixed;
    inset: 0;
    width: min(480px, calc(100% - 24px));
    max-height: calc(100dvh - 24px);
    margin: auto;
    padding: 20px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--dialog);
    color: var(--t1);
    box-shadow: 0 20px 70px #0005;
}
.af-theme-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.af-theme-heading h2 { font-size: 1.22rem; line-height: 1.3; letter-spacing: -.02em; }
.af-theme-heading button {
    width: 32px; height: 32px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--t2); font-size: 21px; line-height: 1; cursor: pointer;
}
.af-theme-groups { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.af-theme-groups h3 { font-size: .83rem; color: var(--t2); margin-bottom: 8px; }
.af-theme-choice {
    width: 100%; min-height: 44px; margin: 0 0 5px; padding: 7px 9px;
    display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 8px;
    background: var(--surface); color: var(--t1); font: inherit; font-size: .88rem; text-align: left; cursor: pointer;
}
.af-theme-choice:hover, .af-theme-heading button:hover { background: var(--raised); }
.af-theme-choice[aria-pressed="true"] { border-color: var(--accent); background: var(--tint); }
.af-theme-check { margin-left: auto; color: var(--accent); font-weight: 700; visibility: hidden; }
.af-theme-choice[aria-pressed="true"] .af-theme-check { visibility: visible; }
.af-theme-sample {
    position: relative; width: 32px; height: 25px; flex: none; border: 1px solid var(--line); border-radius: 4px;
    background: linear-gradient(to bottom, var(--af-header) 0 5px, var(--bg) 5px);
}
.af-theme-sample::after {
    content: ''; position: absolute; inset: 9px 4px 4px;
    background: var(--surface); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 2px;
}
@media (max-width: 420px) {
    body.af-w005 .af-theme-dialog { padding: 14px; }
    .af-theme-groups { gap: 9px; }
    .af-theme-choice { gap: 6px; padding: 6px; }
    .af-theme-sample { width: 23px; }
}

/* W005 uses the dark brand header for the original illuminated wordmarks. */
body.af-w005[data-af-theme] {
    --bg-body: var(--bg); --glass-bg: var(--surface); --glass-border: var(--line);
    --text-main: var(--t1); --text-muted: var(--t3); --accent-color: var(--accent);
    --af-dialog: var(--dialog); --af-border: var(--line);
    background: var(--bg); color: var(--t1); color-scheme: dark;
}
body.af-w005.af-light { color-scheme: light; --danger: #a6273e; --success: #11663f; --warning: #865800; }
.af-w005[data-af-theme] .sidebar { background: var(--af-header); }
.af-w005[data-af-theme] .sidebar-profile { background: color-mix(in srgb,var(--af-header) 90%,white); }
.af-w005[data-af-theme] #af-theme-trigger {
    display: inline-flex; align-items: center; align-self: flex-start; gap: 5px;
    padding: 3px 7px; margin-top: 4px; border: 1px solid #716e74; border-radius: 6px;
    color: #f6f5f3; background: transparent; font-size: 12px; cursor: pointer; min-height: 28px;
}
#af-theme-trigger svg { width: 14px; height: 14px; }
.af-w005 .profile-avatar { padding: 0; cursor: pointer; }
.af-w005[data-af-theme] main>header { border-color: var(--line); }
.af-w005[data-af-theme] :is(main>header h1,.v-title,.modal-card h2,.lock-title) { color: var(--t1); }
.af-w005[data-af-theme] main>header .af-eyebrow { color: var(--accent); }
.af-w005[data-af-theme] :is(.vehicle-card,.v-footer,.history-item,.caretaker-pill,.modal-card,.lock-container) {
    background: var(--surface); border-color: var(--line);
}
.af-w005[data-af-theme] :is(.modal-card,.lock-container) { background: var(--dialog); color: var(--t1); }
.af-w005[data-af-theme] .vehicle-card.vehicle-wide .caretaker-pill { background: var(--raised); border-color: var(--line); }
.af-w005[data-af-theme] :is(.v-meta,.caretaker,.progress-label,.date-secondary,.lock-subtitle,.lock-footer-text,.form-group label,.modal-card h3) {
    color: var(--t2); border-color: var(--line);
}
.af-w005[data-af-theme] .v-progress .progress-bg { background: var(--line); }
.af-w005[data-af-theme] :is(.history-btn,.btn-cancel,.modal-card input::file-selector-button) {
    background: var(--raised); border-color: var(--line); color: var(--t1);
}
.af-w005[data-af-theme] .history-btn:hover { background: var(--tint); color: var(--accent); }
.af-w005[data-af-theme] :is(.avatar-circle,.lock-icon-wrapper) { background: var(--tint); color: var(--accent); }
.af-w005[data-af-theme] :is(.btn-save,.fab,.lock-unlock-btn,.profile-avatar) { background: var(--af-action); color: #211a0c; }
.af-w005[data-af-theme] :is(input:not([type=checkbox]):not([type=radio]),select,textarea) {
    background: var(--surface)!important; color: var(--t1)!important; border-color: var(--t3)!important; color-scheme: inherit;
}
.af-w005[data-af-theme] :is(input,textarea)::placeholder { color: var(--t3); }
.af-w005[data-af-theme] :is(button,input,textarea,select,a):focus-visible { outline-color: var(--accent); }
.af-w005[data-af-theme] .sidebar :focus-visible { outline-color: #ffca62; }
.af-w005[data-af-theme] .modal-card :is([style*="background:#0f172a"],[style*="background: #0f172a"],[style*="background:#1e293b"],[style*="background: #1e293b"]) { background: var(--raised)!important; }
.af-w005[data-af-theme] :is(#drvCategories,#edrvCategories) label {
    background: var(--raised)!important; color: var(--t1)!important; border-color: var(--line)!important;
}
.af-w005[data-af-theme] :is(#drvCategories,#edrvCategories) label:has(input:checked) {
    background: var(--tint)!important; color: var(--accent)!important; border-color: var(--accent)!important;
}
.af-w005.af-light .history-btn.danger { background: #ffedf0; color: #902035!important; border-color: #bd6271; }
.af-w005.af-light :is(.modal-card,main) :is([style*="color:#aaa"],[style*="color:#94a3b8"],[style*="color:#64748b"],[style*="color:#cbd5e1"],[style*="color:#e2e8f0"],[style*="color: #94a3b8"]) { color: var(--t2)!important; }
.af-w005.af-light :is(.modal-card, main) :is([style*="color:#f87171"],[style*="color:#ef4444"]) { color: var(--danger)!important; }
.af-w005.af-light [style*="background:var(--accent-color)"] { background: var(--af-action)!important; }
.af-w005.af-light .modal-card [style*="color:white"]:not(button):not(input):not(select) { color: var(--t1)!important; }
.af-w005 .af-theme-dialog::backdrop { background: #11131c99; }
.af-w005[data-af-theme] .v-header-img { color: #fff; }
.af-w005[data-af-theme] input::file-selector-button { color: var(--t1); background: var(--raised); border-color: var(--line); }
.af-w005.af-light .lock-pin-error { color: var(--danger); }
.af-w005.af-light :is(.modal-card, main) :is([style*="color:#f59e0b"],[style*="color: #f59e0b"]) { color: var(--accent)!important; }
