/* Appearance: themes, accent colour, brightness (light / dim / dark / black), sidebar and background style, font,
   text contrast, size and weight, density, motion and link underlines — chosen by each user from the palette button
   in the top bar (appearance.js). Everything is driven by the tokens in app.css:
   - the accent family is derived from ONE colour (--primary) with color-mix, so any colour the user picks works;
   - data-tone="dark" swaps the neutral scale; data-mode="dim" is a softer, blue-grey dark;
   - data-contrast shifts text and border strength; --zoom scales the whole interface for bigger text. */

/* ---------------------------------------------------------------- accent family from one colour */
:root {
  --primary: #3B5BDB;
  --on-primary: #FFFFFF;
  --primary-hover: color-mix(in srgb, var(--primary) 86%, #000);
  --primary-700: color-mix(in srgb, var(--primary) 78%, #000);
  --primary-50: color-mix(in srgb, var(--primary) 7%, var(--surface));
  --primary-100: color-mix(in srgb, var(--primary) 13%, var(--surface));
  --primary-200: color-mix(in srgb, var(--primary) 24%, var(--surface));
  --zoom: 1;

  /* tokens for things that used fixed colours */
  --grid-line: #C3C9D3; --grid-line-strong: #8A94A6; --grid-head: #EDF0F5; --grid-alt: #F8F9FB;
  --grid-total: #F5F7FA; --grid-total-alt: #F0F3F7; --grid-hover: color-mix(in srgb, var(--primary) 9%, var(--surface));
  --paper: #FFFFFF;
  color-scheme: light;
}

/* ---------------------------------------------------------------- dark */
:root[data-tone="dark"] {
  --ink: #EDF1F7; --gray-700: #CBD3DF; --gray-600: #A8B3C4; --gray-500: #8592A7; --gray-400: #5F6C82; --gray-300: #3A465C;
  --gray-200: #2A3446; --gray-100: #1F2837; --gray-50: #19212F; --canvas: #0D131E; --surface: #141B28;
  --success: #2FCB80; --success-50: #0E2A1F; --success-100: #123827; --success-700: #5FD8A0; --success-900: #9BE9C3;
  --warning: #F5A524; --warning-50: #2B2111; --warning-100: #3A2B12; --warning-700: #F6B85C; --warning-900: #FAD592;
  --error: #F26B61; --error-50: #2D1517; --error-100: #3D1A1D; --error-700: #FF8F86; --error-300: #8F3833;
  --violet: #9B85FF; --violet-50: #211C3B; --violet-700: #BBA9FF;
  --primary-700: color-mix(in srgb, var(--primary) 55%, #fff);
  --primary-hover: color-mix(in srgb, var(--primary) 85%, #fff);
  --primary-50: color-mix(in srgb, var(--primary) 15%, var(--surface));
  --primary-100: color-mix(in srgb, var(--primary) 24%, var(--surface));
  --primary-200: color-mix(in srgb, var(--primary) 38%, var(--surface));
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35);
  --shadow-seg: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow-drawer: -12px 0 32px rgba(0, 0, 0, .5);
  --shadow-pop: 0 12px 28px rgba(0, 0, 0, .45);
  --grid-line: #313C50; --grid-line-strong: #56637A; --grid-head: #1C2534; --grid-alt: #172030;
  --grid-total: #1A2333; --grid-total-alt: #1D2738;
  --paper: #FFFFFF;
  color-scheme: dark;
}
/* dim: a softer dark for evening use */
:root[data-tone="dark"][data-mode="dim"] {
  --canvas: #1B2230; --surface: #232C3B; --gray-50: #28313F; --gray-100: #2D3747; --gray-200: #374253; --gray-300: #465267;
  --grid-head: #2A3445; --grid-alt: #26303F; --grid-total: #29323F; --grid-total-alt: #2C3646; --grid-line: #3F4A5D;
}

/* black: true black for OLED phones */
:root[data-tone="dark"][data-mode="black"] {
  --canvas: #000000; --surface: #0A0A0A; --gray-50: #111111; --gray-100: #161616; --gray-200: #222222; --gray-300: #333333;
  --grid-head: #121212; --grid-alt: #0E0E0E; --grid-total: #131313; --grid-total-alt: #161616; --grid-line: #2A2A2A; --grid-line-strong: #444444;
  --shadow-card: none;
}

/* ---------------------------------------------------------------- text contrast */
:root[data-contrast="high"]:not([data-tone="dark"]) {
  --ink: #000; --gray-700: #1D2939; --gray-600: #263244; --gray-500: #3D4859; --gray-400: #5E6878; --gray-300: #98A2B3; --gray-200: #C9CFD9;
  --grid-line: #9AA3B2; --grid-line-strong: #4F5A6B;
}
:root[data-contrast="high"][data-tone="dark"] {
  --ink: #FFF; --gray-700: #E6EBF2; --gray-600: #D0D8E3; --gray-500: #B3BECD; --gray-400: #8592A7; --gray-300: #56637A; --gray-200: #3F4B60;
  --grid-line: #55627A; --grid-line-strong: #8592A7;
}
:root[data-contrast="soft"]:not([data-tone="dark"]) { --ink: #2B3445; --gray-700: #475467; --gray-600: #5E6A7D; --gray-500: #7A8597; }
:root[data-contrast="soft"][data-tone="dark"] { --ink: #D3DAE5; --gray-700: #B7C0CE; --gray-600: #97A2B4; --gray-500: #78859A; }

/* ---------------------------------------------------------------- text size (whole interface): --zoom is set from the slider */
body { zoom: var(--zoom); }

/* ---------------------------------------------------------------- font and weight */
:root[data-font="inter"] { --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-font="lexend"] { --font: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-font="atkinson"] { --font: "Atkinson Hyperlegible", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-font="poppins"] { --font: "Poppins", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
:root[data-font="system"] { --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
:root[data-weight="bold"] body { font-weight: 500; }
:root[data-weight="bold"] :is(b, strong, h1, h2, h3, h4, th, .btn, .nav a, .fd-name, .fd-title, .stat .v) { font-weight: 800; }
:root[data-weight="bold"] :is(.small, .tiny, .muted, .faint, small, .sub) { font-weight: 500; }

/* ---------------------------------------------------------------- sidebar style (tokens re-scoped inside the menu) */
:root[data-sidebar="tinted"] :is(.sidebar, .ap-pv-side) { --surface: color-mix(in srgb, var(--primary) 7%, #FFFFFF); --gray-200: color-mix(in srgb, var(--primary) 14%, #EAECF0); --gray-100: color-mix(in srgb, var(--primary) 12%, #F2F4F7); }
:root[data-sidebar="tinted"][data-tone="dark"] :is(.sidebar, .ap-pv-side) { --surface: color-mix(in srgb, var(--primary) 12%, #141B28); --gray-200: color-mix(in srgb, var(--primary) 18%, #2A3446); --gray-100: color-mix(in srgb, var(--primary) 18%, #1F2837); }
:root[data-sidebar="dark"] :is(.sidebar, .ap-pv-side) {
  --surface: #0F1726; --ink: #F2F4F7; --gray-700: #D0D5DD; --gray-600: #B0B8C6; --gray-500: #98A2B3; --gray-400: #7A8597; --gray-300: #344054;
  --gray-200: #1E2A3D; --gray-100: #1A2436; --gray-50: #152033;
  --primary-50: color-mix(in srgb, var(--primary) 30%, #0F1726); --primary-700: color-mix(in srgb, var(--primary) 35%, #FFFFFF); color-scheme: dark;
}
:root[data-sidebar="dark"][data-mode="black"] :is(.sidebar, .ap-pv-side) { --surface: #000; --gray-200: #1A1A1A; --gray-100: #161616; --gray-50: #111; }

/* ---------------------------------------------------------------- page background */
:root[data-canvas="tint"] body { background: color-mix(in srgb, var(--primary) 6%, var(--canvas)); }
:root[data-canvas="gradient"] body {
  background: radial-gradient(1100px 620px at 100% -8%, color-mix(in srgb, var(--primary) 16%, transparent), transparent 62%),
    radial-gradient(900px 560px at -8% 108%, color-mix(in srgb, #DD2590 9%, transparent), transparent 60%), var(--canvas);
  background-attachment: fixed;
}
:root[data-tone="dark"][data-canvas="gradient"] body {
  background: radial-gradient(1100px 620px at 100% -8%, color-mix(in srgb, var(--primary) 22%, transparent), transparent 62%),
    radial-gradient(900px 560px at -8% 108%, color-mix(in srgb, #DD2590 10%, transparent), transparent 60%), var(--canvas);
  background-attachment: fixed;
}
:root[data-canvas="tint"] .topbar, :root[data-canvas="gradient"] .topbar {
  background: color-mix(in srgb, var(--surface) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); -webkit-backdrop-filter: saturate(1.4) blur(12px);
}

/* ---------------------------------------------------------------- density */
:root[data-density="compact"] .content { padding: 18px 22px; }
:root[data-density="compact"] .page-header { margin-bottom: 14px; }
:root[data-density="compact"] .table td { padding: 7px 10px; font-size: 13.5px; }
:root[data-density="compact"] .table th { padding: 7px 10px; }
:root[data-density="compact"] .card-b { padding: 12px 14px 14px; }
:root[data-density="compact"] .card-h { padding: 12px 14px 0; }
:root[data-density="compact"] .stat { padding: 13px; gap: 3px; }
:root[data-density="compact"] .stat .v { font-size: 24px; line-height: 30px; }
:root[data-density="compact"] .list-item { padding: 8px 0; }
:root[data-density="compact"] .nav a { height: 34px; }
:root[data-density="compact"] .btn { height: 36px; padding: 0 13px; }
:root[data-density="compact"] .btn.sm { height: 30px; }
:root[data-density="compact"] .input { height: 36px; }
:root[data-density="compact"] .grid { gap: 12px; }
:root[data-density="compact"] .fd-list { gap: 12px; }

/* ---------------------------------------------------------------- motion and links */
:root[data-motion="reduce"] *, :root[data-motion="reduce"] *::before, :root[data-motion="reduce"] *::after {
  animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important;
}
:root[data-links="underline"] :is(.content, .drawer, .modal) a:not(.btn):not(.list-item):not(.sh-story):not(.sh-pill):not(.fd-rail-ev):not(.fd-link) {
  text-decoration: underline; text-underline-offset: 2px;
}

/* ---------------------------------------------------------------- fixed colours that now follow the theme */
.integration, .alert.info { border-color: var(--primary-200); }
.chip.active, .btn.primary, .btn.success, .su-sem.sel, .su-sem.sel small, .mk-step i.ok, .tab.active .mk-step i:not(.ok), .mk-flow .st.done i, .mk-flow .st.now i, .su-step.done > i { color: var(--on-primary); }
.st-HALF_DAY { background: var(--warning-100); color: var(--warning-900); }
.tint-teal { background: color-mix(in srgb, #0E9384 12%, var(--surface)); color: color-mix(in srgb, #0E9384 80%, var(--ink)); }
.sp-calc.ok { background: var(--success-50); color: var(--success-900); } .sp-calc.bad { background: var(--error-50); color: var(--error-700); }
.sp-cal-d.abs { border-color: var(--error-300); }
.mk-gridwrap { border-top-color: var(--grid-line-strong); }
.mk-grid th, .mk-grid td { border-right-color: var(--grid-line); border-bottom-color: var(--grid-line); }
.mk-grid thead th, .table.grid-lines thead th { background: var(--grid-head); }
.mk-grid thead tr.mk-h1 th { border-bottom-color: var(--grid-line); }
.mk-grid thead tr.mk-h2 th, .mk-grid thead tr.mk-h1 th[rowspan], .table.grid-lines thead th { border-bottom-color: var(--grid-line-strong); }
.mk-grid .mk-ph, .mk-grid .mk-qh.first, .mk-grid td.mk-c.pstart, .mk-grid th.mk-ab, .mk-grid td.mk-ab { border-left-color: var(--grid-line-strong); }
.mk-grid th.mk-total, .mk-grid td.mk-total { border-left-color: var(--grid-line-strong); border-right-color: var(--grid-line-strong); background: var(--grid-total); }
.mk-grid tbody tr:nth-child(even) td { background: var(--grid-alt); }
.mk-grid tbody tr:nth-child(even) td.mk-total { background: var(--grid-total-alt); }
.mk-grid tbody tr:hover td, .mk-grid tbody tr:focus-within td { background: var(--grid-hover); }
.mk-in:focus { background: var(--surface); }
.table.grid-lines th, .table.grid-lines td { border-color: var(--grid-line); }
/* printed letters stay on white paper in every theme */
.letter { background: var(--paper); color: #000; }
:root[data-tone="dark"] img.logo-invert { filter: brightness(1.1); }
:root[data-tone="dark"] .input, :root[data-tone="dark"] select.input, :root[data-tone="dark"] textarea.input { background: var(--gray-50); }

/* ---------------------------------------------------------------- the Appearance panel */
.ap { display: flex; flex-direction: column; gap: 16px; }
.ap h4 { font-size: 12px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--gray-500); margin: 0 0 10px; }
.ap-body { display: flex; flex-direction: column; gap: 22px; min-height: 260px; }
.ap-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--success-700); }
.ap-status.saving { color: var(--gray-500); } .ap-status.offline { color: var(--warning-700); }
@media (max-width: 560px) { .ap-status .more { display: none; } }
.ap-status .spin { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--gray-300); border-top-color: var(--primary); animation: ap-spin .7s linear infinite; }
@keyframes ap-spin { to { transform: rotate(360deg); } }

/* live preview: a small copy of the app in the chosen look */
.ap-pv { display: grid; grid-template-columns: 74px 1fr; min-height: 150px; border-radius: 16px; overflow: hidden; border: 1px solid var(--gray-200); background: var(--canvas);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .08); flex: none; }
:root[data-canvas="tint"] .ap-pv { background: color-mix(in srgb, var(--primary) 6%, var(--canvas)); }
:root[data-canvas="gradient"] .ap-pv { background: radial-gradient(260px 160px at 100% 0, color-mix(in srgb, var(--primary) 22%, transparent), transparent 70%), var(--canvas); }
.ap-pv-side { background: var(--surface); border-right: 1px solid var(--gray-200); display: flex; flex-direction: column; gap: 7px; padding: 12px 10px; }
.ap-pv-logo { width: 22px; height: 22px; border-radius: 50%; background: url(/assets/img/logo.png) center / cover; margin-bottom: 4px; }
.ap-pv-side i { display: block; flex: none; width: 100%; height: 9px; border-radius: 5px; background: var(--gray-200); }
.ap-pv-side i.on { background: var(--primary-50); box-shadow: inset 3px 0 0 var(--primary); }
.ap-pv-main { padding: 12px 14px; display: flex; flex-direction: column; gap: 9px; min-width: 0; }
.ap-pv-top { display: flex; align-items: center; justify-content: space-between; font-weight: 700; font-size: 13px; color: var(--ink); }
.ap-pv-top em { width: 22px; height: 22px; border-radius: 50%; background: var(--primary-100); }
.ap-pv-card { background: var(--surface); border: 1px solid var(--gray-200); border-radius: 12px; padding: 9px 11px; display: flex; flex-direction: column; gap: 5px; }
.ap-pv-card b { font-size: 11.5px; color: var(--gray-500); }
.ap-pv-num { font-size: 18px; font-weight: 800; color: var(--ink); line-height: 20px; }
.ap-pv-bar { height: 5px; border-radius: 3px; background: var(--gray-100); }
.ap-pv-bar i { display: block; width: 72%; height: 100%; border-radius: 3px; background: var(--primary); }
.ap-pv-btn { font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 6px; background: var(--primary); color: var(--on-primary); }
.ap-pv-link { font-size: 11.5px; font-weight: 600; color: var(--primary); }
.ap-pv-chat { display: flex; gap: 6px; align-items: flex-end; font-size: 11px; }
.ap-pv-chat span { padding: 4px 9px; border-radius: 9px; box-shadow: 0 1px 1px rgba(0, 0, 0, .08); }
.ap-pv-chat .in { background: var(--surface); color: var(--ink); }
.ap-pv-chat .out { margin-left: auto; background: var(--wa-out, #D9FDD3); color: var(--wa-ink, #111B21); }

.ap-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--gray-100); }
.ap-tabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 0; background: none; border-radius: 9px; padding: 8px 6px;
  font: inherit; font-size: 13px; font-weight: 700; color: var(--gray-500); cursor: pointer; white-space: nowrap; }
.ap-tabs button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-seg); }

.ap-themes { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.ap-theme { position: relative; display: flex; flex-direction: column; gap: 8px; padding: 6px 6px 10px; border: 2px solid var(--gray-200); border-radius: 14px; background: var(--surface);
  cursor: pointer; font: inherit; color: var(--ink); text-align: left; transition: border-color .12s, transform .12s; }
.ap-theme:hover { border-color: var(--gray-300); transform: translateY(-1px); }
.ap-theme.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.ap-theme b { font-size: 13px; padding: 0 4px; }
.ap-theme-pv { display: grid; grid-template-columns: 26% 1fr; height: 74px; border-radius: 9px; overflow: hidden; border: 1px solid rgba(127, 127, 127, .2); }
.ap-theme-pv .s { display: flex; flex-direction: column; padding: 8px 5px; }
.ap-theme-pv .s em { height: 5px; border-radius: 3px; }
.ap-theme-pv .m { display: flex; flex-direction: column; gap: 5px; padding: 8px; }
.ap-theme-pv .m em { display: flex; flex-direction: column; gap: 4px; padding: 5px; border-radius: 5px; }
.ap-theme-pv u { display: block; height: 4px; border-radius: 2px; }
.ap-theme-pv .m em:first-child u:first-child { width: 60%; }
.ap-tick { position: absolute; top: 12px; right: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--primary); color: var(--on-primary); }
.ap-note { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 12px; background: var(--primary-50); color: var(--primary-700); font-size: 13px; font-weight: 600; margin-bottom: 12px; }

.ap-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.ap-mode { border: 2px solid var(--gray-200); border-radius: 12px; padding: 6px; background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; font: inherit; color: var(--ink); text-align: left; }
.ap-mode:hover { border-color: var(--gray-300); }
.ap-mode.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.ap-mode b { font-size: 12.5px; padding: 0 4px 2px; }
.ap-prev { height: 50px; border-radius: 8px; display: grid; grid-template-columns: 22% 1fr; overflow: hidden; border: 1px solid rgba(127, 127, 127, .25); }
.ap-prev i { display: block; }
.ap-prev span { display: flex; flex-direction: column; gap: 4px; padding: 7px; }
.ap-prev span em { display: block; height: 6px; border-radius: 3px; }
.ap-sched { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 12px; padding: 10px 12px; border-radius: 12px; background: var(--gray-50); border: 1px solid var(--gray-200); font-size: 13.5px; font-weight: 600; }
.ap-sched .input { width: 120px; height: 36px; }
.ap-swatches { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ap-sw { width: 36px; height: 36px; border-radius: 50%; border: 0; cursor: pointer; position: relative; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .12); color: #fff; display: grid; place-items: center; }
.ap-sw.on::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 2px solid var(--ink); }
.ap-custom { display: flex; align-items: center; gap: 10px; margin-top: 12px; font-size: 13.5px; font-weight: 600; color: var(--gray-700); }
.ap-wheel { width: 36px; height: 36px; border-radius: 50%; overflow: hidden; cursor: pointer; flex: none; position: relative;
  background: conic-gradient(#F04438, #F79009, #FDE047, #12B76A, #0E9384, #3B5BDB, #7A5AF8, #DD2590, #F04438); }
.ap-wheel input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.ap-hex { width: 110px; height: 36px; font-family: ui-monospace, Consolas, monospace; text-transform: uppercase; margin-left: auto; }
.ap-seg { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--gray-100); border-radius: 10px; padding: 3px; gap: 3px; }
.ap-seg button { border: 0; background: none; border-radius: 8px; padding: 8px 6px; font: inherit; font-size: 13px; font-weight: 600; color: var(--gray-600); cursor: pointer; }
.ap-seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-seg); }
.ap-scale { display: flex; align-items: center; gap: 12px; }
.ap-a { width: 36px; height: 36px; border-radius: 10px; border: 1px solid var(--gray-200); background: var(--surface); color: var(--ink); font: inherit; font-weight: 800; cursor: pointer; flex: none; }
.ap-a.sm { font-size: 12px; }
.ap-a.lg { font-size: 19px; }
.ap-range { flex: 1; accent-color: var(--primary); height: 28px; min-width: 0; }
.ap-scale-v { width: 48px; text-align: right; font-variant-numeric: tabular-nums; }
.ap-ticks { display: flex; justify-content: space-between; padding: 6px 48px 0; }
.ap-ticks button { border: 0; background: none; font: inherit; font-size: 12px; color: var(--gray-500); cursor: pointer; padding: 2px 4px; border-radius: 6px; }
.ap-ticks button:hover { color: var(--ink); background: var(--gray-100); }
.ap-fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.ap-font { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 12px; border: 2px solid var(--gray-200); border-radius: 12px; background: var(--surface); cursor: pointer; font: inherit; color: var(--ink); text-align: left; }
.ap-font:hover { border-color: var(--gray-300); }
.ap-font.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-100); }
.ap-font .aa { font-size: 26px; line-height: 32px; font-weight: 700; }
.ap-font b { font-size: 13px; }
.ap-font small { font-size: 11.5px; color: var(--gray-500); line-height: 15px; }
.ap-rows { display: flex; flex-direction: column; border: 1px solid var(--gray-200); border-radius: 14px; }
.ap-row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; }
.ap-row + .ap-row { border-top: 1px solid var(--gray-200); }
.ap-row .grow { display: flex; flex-direction: column; }
.ap-row b { font-size: 14px; }
.ap-row small { font-size: 12.5px; color: var(--gray-500); }
.ap-switch { position: relative; width: 44px; height: 26px; flex: none; cursor: pointer; }
.ap-switch input { position: absolute; opacity: 0; width: 100%; height: 100%; margin: 0; cursor: pointer; z-index: 1; }
.ap-switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--gray-300); transition: background .18s; }
.ap-switch i::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .25); transition: transform .18s; }
.ap-switch input:checked + i { background: var(--primary); }
.ap-switch input:checked + i::after { transform: translateX(18px); }
@media (max-width: 560px) {
  .ap-modes { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-tabs button span { display: none; }
  .ap-tabs button { padding: 9px 4px; }
  .ap-tabs button.on span { display: inline; }
  .ap-themes, .ap-fonts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ap-hex { margin-left: 0; }
  .ap-ticks { padding: 6px 0 0; }
}
