/* ============================================
   WEB CHAT (/chat)
   Phone first; list and conversation side by side from 900px.
   ============================================ */

@font-face {
    font-family: 'RF Emoji';
    src: url(/chat/emoji.ttf) format('truetype');
    font-display: swap;
    unicode-range: U+200D, U+20D0-20FF, U+2300-23FF, U+2600-27BF, U+2B50-2B55, U+FE00-FE0F, U+1F000-1FAFF;
}

.wc-app,
.wc-shell,
.modal .wc-field {
    --font-body: 'Outfit', 'RF Emoji', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-sans: var(--font-body);
}

.wc-app *,
.wc-shell * {
    min-width: 0;
}

.wc-i {
    width: 18px;
    height: 18px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex: 0 0 auto;
}

/* ---------- Device-only shell ---------- */

.wc-shell {
    margin: 0;
    background: var(--bg-page);
    color: var(--text-primary);
    font-family: var(--font-body);
}

.wc-brandbar {
    position: sticky;
    top: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: var(--space-2);
    height: var(--nav-height);
    padding: 0 var(--space-3);
    background: var(--tb-bg, var(--bg-surface));
    border-bottom: 1px solid var(--tb-border, var(--border-subtle));
}

.wc-brand {
    flex: 1;
    font: 600 var(--text-xs)/1 var(--font-display);
    color: var(--text-primary);
}

.wc-brand em {
    font-style: normal;
    color: var(--gold);
}

.wc-shell-main {
    outline: none;
}

/* ---------- App frame ---------- */

.wc-app {
    position: relative;
    display: flex;
    flex-direction: column;
    font-family: var(--font-body);
    color: var(--text-primary);
}

/* --wc-vvh is the visual viewport height (chat.js), which shrinks under the iOS keyboard. */
.wc-app--device {
    height: calc(var(--wc-vvh, 100dvh) - var(--nav-height));
}

.wc-app--site {
    height: calc(100dvh - var(--nav-height) - var(--space-6) - var(--space-8));
    min-height: 480px;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-page);
    overflow: hidden;
}

.wc-pane {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.wc-pane--list {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
    gap: var(--space-3);
}

.wc-pane--list > * {
    flex-shrink: 0;
}

.wc-pane--main {
    position: relative;
    flex: 1;
    background: var(--bg-page);
}

@media (max-width: 899px) {
    .wc-app[data-screen="list"] .wc-pane--main,
    .wc-app:not([data-screen="list"]) .wc-pane--list {
        display: none;
    }
}

.wc-view {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* The display rules below would otherwise beat the UA [hidden] rule. */
.wc-app [hidden],
.wc-shell [hidden] {
    display: none !important;
}

.wc-view--empty {
    display: none;
}

.wc-body {
    flex: 1;
    overflow-y: auto;
    padding: var(--space-4) var(--space-3);
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.wc-body > * {
    flex-shrink: 0;
}

@media (min-width: 900px) {
    .wc-app {
        display: grid;
        grid-template-columns: 340px 1fr;
    }

    .wc-pane--list {
        border-right: 1px solid var(--border-subtle);
        padding: var(--space-4);
    }

    .wc-view--empty {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .wc-back {
        display: none;
    }

    .wc-chead {
        padding: var(--space-2) var(--space-5);
    }

    .wc-thread {
        padding: var(--space-4) var(--space-5);
    }

    .wc-composer {
        padding: var(--space-3) var(--space-5);
    }

    .wc-picker {
        left: auto;
        right: var(--space-5);
        width: 420px;
        bottom: 76px;
    }

    .wc-unlinked {
        grid-column: 1 / -1;
    }
}

/* ---------- Shared bits ---------- */

.wc-ibtn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border: 0;
    border-radius: var(--radius);
    background: var(--tb-btn-bg, var(--bg-muted));
    color: var(--tb-text, var(--text-secondary));
    cursor: pointer;
}

.wc-ibtn:hover {
    color: var(--text-primary);
}

.wc-ibtn:focus-visible,
.wc-sendb:focus-visible,
.wc-emob:focus-visible,
.wc-row--btn:focus-visible,
.wc-lnk:focus-visible,
.wc-retry:focus-visible,
.wc-inbanner:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

.wc-avatar {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    border: 2px solid var(--gold);
    overflow: hidden;
    color: var(--text-secondary);
    font: 600 var(--text-xs) var(--font-body);
}

.wc-avatar img {
    width: 30px;
    height: 30px;
    margin-top: 3px;
    object-fit: contain;
    image-rendering: pixelated;
}

.wc-avatar--off {
    border-color: var(--border-strong);
}

.wc-avatar--off img {
    filter: grayscale(1);
    opacity: .6;
}

.wc-listhead {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.wc-ptitle {
    flex: 1;
    margin: 0;
    font: 600 var(--text-lg)/1.2 var(--font-display);
    color: var(--text-primary);
}

.wc-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    align-self: flex-start;
    padding: var(--space-1) 10px;
    border: 1px solid;
    border-radius: var(--radius-full);
    font-size: var(--text-sm);
    font-weight: 500;
}

.wc-status::before {
    content: "";
    width: 8px;
    height: 8px;
    border-radius: var(--radius-full);
    background: currentColor;
}

.wc-status--ok {
    background: var(--success-bg);
    border-color: var(--success-border);
    color: var(--success-text);
}

.wc-status--off {
    background: var(--bg-muted);
    border-color: var(--border);
    color: var(--text-muted);
}

.wc-status--warn {
    background: var(--warning-bg);
    border-color: var(--warning-border);
    color: var(--warning-text);
}

.wc-help {
    margin: calc(-1 * var(--space-1)) 0 0;
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.wc-help--flush {
    margin: 0;
}

.wc-alert {
    margin: 0;
    padding: 10px var(--space-3);
    border: 1px solid var(--warning-border);
    border-radius: var(--radius-md);
    background: var(--warning-bg);
    color: var(--warning-text);
    font-size: var(--text-sm);
}

.wc-section-l {
    margin: var(--space-1) 2px -6px;
    font-size: var(--text-xs);
    font-weight: 500;
    color: var(--text-muted);
}

.wc-label {
    display: block;
    margin-bottom: var(--space-1);
    font-size: var(--text-base);
    font-weight: 500;
}

.wc-field,
input.wc-field {
    width: 100%;
    height: auto;
    min-height: 44px;
    padding: 10px var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg-surface);
    color: var(--text-primary);
    font: 16px var(--font-body);
}

.wc-field:disabled {
    color: var(--text-muted);
    background: var(--bg-surface-alt);
    cursor: not-allowed;
}

.wc-field:focus {
    outline: 0;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-pale);
}

.wc-lnk {
    padding: 0;
    border: 0;
    background: none;
    font: inherit;
    font-weight: 600;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

/* ---------- Alerts and install prompts ---------- */

#wc-install-prompt:empty,
#wc-push-prompt:empty {
    display: none;
}

.wc-prompt {
    display: grid;
    gap: 10px;
    padding: 14px;
    background: var(--bg-surface);
    border: 1px solid var(--gold);
    border-radius: var(--radius-lg);
}

.wc-prompt p {
    margin: 0;
    font-size: var(--text-base);
}

.wc-prompt--blocked {
    border-color: var(--border);
}

.wc-prompt--blocked p,
.wc-prompt .wc-prompt-hint {
    color: var(--text-secondary);
}

.wc-prompt .wc-prompt-hint {
    font-size: var(--text-sm);
}

.wc-prompt-actions {
    display: flex;
    gap: var(--space-2);
}

.wc-prompt-actions .btn {
    flex: 1;
}

/* ---------- Link page ---------- */

.wc-link {
    display: flex;
    justify-content: center;
    padding: var(--space-6) var(--space-3);
}

.wc-link-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
    width: 100%;
    max-width: 420px;
}

.wc-link-card .wc-help {
    margin: 0;
}

.wc-kv {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 6px 14px;
    margin: var(--space-1) 0 6px;
    font-size: var(--text-base);
}

.wc-kv dt {
    color: var(--text-muted);
}

.wc-kv dd {
    margin: 0;
    font-weight: 500;
    overflow-wrap: anywhere;
}

.wc-hint {
    margin: 0;
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-align: center;
}

/* ---------- Conversation list ---------- */

.wc-list {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.wc-row {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    width: 100%;
    min-height: 44px;
    padding: var(--space-3) 14px;
    border: 0;
    border-top: 1px solid var(--border-subtle);
    background: none;
    color: inherit;
    font: inherit;
    text-align: left;
}

.wc-row:first-child {
    border-top: 0;
}

.wc-row--btn {
    cursor: pointer;
}

.wc-row--btn:hover {
    background: var(--bg-muted);
}

.wc-row--unread {
    background: var(--gold-pale);
}

.wc-row--sel {
    background: var(--bg-muted);
    box-shadow: inset 3px 0 var(--gold);
}

.wc-ricon {
    position: relative;
    display: grid;
    place-items: center;
    flex: 0 0 36px;
    height: 36px;
    border-radius: var(--radius);
    background: var(--bg-muted);
    color: var(--text-secondary);
    font-size: var(--text-base);
    font-weight: 600;
}

.wc-ricon img {
    width: 36px;
    height: 36px;
    object-fit: contain;
    image-rendering: pixelated;
}

.wc-dot {
    position: absolute;
    right: -2px;
    bottom: -2px;
    width: 10px;
    height: 10px;
    border: 2px solid var(--bg-surface);
    border-radius: var(--radius-full);
    background: var(--success);
}

.wc-dot--off {
    background: var(--color-offline);
}

.wc-rmain {
    flex: 1;
    display: grid;
    gap: 1px;
}

.wc-rtop {
    display: flex;
    align-items: baseline;
    gap: var(--space-2);
}

.wc-rtop b {
    flex: 1;
    font-size: var(--text-base);
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-rtop time {
    font-size: var(--text-xs);
    color: var(--text-muted);
    white-space: nowrap;
}

.wc-rprev {
    display: flex;
    gap: var(--space-2);
    font-size: var(--text-sm);
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
}

.wc-rprev span:first-child {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-count {
    flex: 0 0 auto;
    display: grid;
    place-items: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: var(--radius-full);
    background: var(--gold);
    color: var(--text-on-gold);
    font-size: var(--text-xs);
    font-weight: 600;
}

.wc-where {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    padding: var(--space-10) var(--space-4);
    text-align: center;
    color: var(--text-muted);
}

.wc-empty--compact {
    padding: var(--space-5);
}

.wc-empty b,
.wc-empty-title {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.wc-empty p {
    max-width: 300px;
    margin: 0;
    font-size: var(--text-base);
}

.wc-empty-icon {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: var(--radius-lg);
    background: var(--bg-muted);
    color: var(--text-secondary);
}

.wc-empty-icon--lg {
    width: 56px;
    height: 56px;
    border-radius: 14px;
}

.wc-empty-icon--lg .wc-i {
    width: 28px;
    height: 28px;
}

.wc-unlinked {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-4) var(--space-3);
}

/* ---------- Conversation ---------- */

.wc-conv {
    position: relative;
}

.wc-chead {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: var(--space-2) var(--space-3);
    background: var(--bg-surface);
    border-bottom: 1px solid var(--border-subtle);
}

.wc-who {
    flex: 1;
    display: grid;
}

.wc-who b {
    font-size: var(--text-md);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.wc-who small {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-cmenu {
    position: absolute;
    right: var(--space-4);
    top: 56px;
    z-index: 4;
    display: grid;
    min-width: 180px;
    padding: 6px;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.wc-cmenu button {
    min-height: 44px;
    padding: 0 var(--space-3);
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text-primary);
    font: var(--text-base) var(--font-body);
    text-align: left;
    cursor: pointer;
}

.wc-cmenu button:hover,
.wc-cmenu button:focus-visible {
    background: var(--bg-muted);
    outline: 0;
}

.wc-banner {
    flex: 0 0 auto;
    margin: 0;
    padding: 10px var(--space-3);
    font-size: var(--text-sm);
    background: var(--warning-bg);
    color: var(--warning-text);
    border-bottom: 1px solid var(--warning-border);
}

.wc-inbanner {
    position: absolute;
    left: var(--space-2);
    right: var(--space-2);
    top: 60px;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 2 * var(--space-2));
    margin: 0;
    padding: 10px var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    box-shadow: var(--shadow-xl);
    color: var(--text-primary);
    font: var(--text-sm) var(--font-body);
    text-align: left;
    cursor: pointer;
}

.wc-inbanner .wc-ricon img {
    width: 34px;
    height: 34px;
}

.wc-inbanner-text {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wc-inbanner-text b {
    display: block;
}

.wc-thread {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 14px var(--space-3);
    list-style: none;
}

.wc-msg {
    max-width: 82%;
    padding: var(--space-2) var(--space-3);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    font-size: var(--text-base);
    line-height: 1.45;
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.wc-msg--in {
    align-self: flex-start;
    background: var(--bg-surface);
    border-bottom-left-radius: var(--radius-sm);
}

.wc-msg--out {
    align-self: flex-end;
    background: var(--gold-pale);
    border-bottom-right-radius: var(--radius-sm);
}

.wc-msg--me {
    background: var(--warning-bg);
    border-color: var(--warning-border);
}

.wc-from {
    display: block;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gold);
    white-space: normal;
}

.wc-mention {
    padding: 0 3px;
    border-radius: var(--radius-sm);
    background: var(--warning-bg);
    color: var(--warning-text);
    font-weight: 600;
}

.wc-mav {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    align-self: flex-start;
    max-width: 90%;
}

.wc-mav > img {
    flex: 0 0 30px;
    width: 30px;
    height: 30px;
    margin-bottom: 2px;
    object-fit: contain;
    image-rendering: pixelated;
}

.wc-mav .wc-msg {
    max-width: none;
}

.wc-meta {
    align-self: flex-end;
    margin: -2px var(--space-1) var(--space-1);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-meta--in {
    align-self: flex-start;
}

.wc-meta--av {
    margin-left: 40px;
}

.wc-meta--fail {
    color: var(--error-text);
}

.wc-retry {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 var(--space-1);
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    text-decoration: underline;
    cursor: pointer;
}

.wc-day {
    align-self: center;
    margin: var(--space-2) 0 var(--space-1);
    padding: 2px var(--space-2);
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--text-secondary);
}

.wc-sys {
    align-self: center;
    margin: 6px 0;
    font-size: var(--text-sm);
    color: var(--text-muted);
    text-align: center;
}

.wc-emoteline {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    margin: 2px 0 6px;
    font-size: var(--text-sm);
    color: var(--text-muted);
}

.wc-emoteline--in {
    align-self: flex-start;
}

.wc-emoteline--out {
    align-self: flex-end;
}

.wc-emoteline img {
    max-height: 40px;
    image-rendering: pixelated;
}

.wc-emoteline .wc-emote-head {
    width: 28px;
    height: 28px;
    object-fit: contain;
}

/* ---------- Composer ---------- */

.wc-composer {
    position: relative;
    flex: 0 0 auto;
    display: flex;
    align-items: flex-end;
    gap: var(--space-2);
    padding: 10px var(--space-3);
    padding-bottom: max(10px, env(safe-area-inset-bottom));
    background: var(--bg-surface);
    border-top: 1px solid var(--border-subtle);
}

.wc-composer textarea {
    flex: 1;
    height: auto;
    min-height: 44px;
    max-height: 120px;
    padding: 11px var(--space-3);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: var(--bg-surface);
    color: var(--text-primary);
    font: 16px/1.3 var(--font-body);
    resize: none;
}

.wc-composer textarea:focus {
    outline: 0;
    border-color: var(--gold);
    box-shadow: 0 0 0 2px var(--gold-pale);
}

.wc-composer textarea:disabled {
    background: var(--bg-muted);
    color: var(--text-muted);
}

.wc-sendb,
.wc-emob {
    display: grid;
    place-items: center;
    flex: 0 0 44px;
    height: 44px;
    border-radius: var(--radius-md);
    cursor: pointer;
}

.wc-sendb {
    border: 0;
    background: var(--gold);
    color: var(--gold-fg);
}

.wc-emob {
    border: 1px solid var(--border);
    background: var(--bg-surface);
    color: var(--text-secondary);
}

.wc-emob[aria-expanded="true"] {
    border-color: var(--gold);
    background: var(--gold-pale);
    color: var(--gold);
}

.wc-sendb:disabled,
.wc-emob:disabled {
    opacity: .5;
    cursor: default;
}

.wc-bcount {
    position: absolute;
    right: 68px;
    top: -22px;
    padding: 1px var(--space-2);
    border: 1px solid var(--border);
    border-radius: var(--radius-full);
    background: var(--bg-surface);
    color: var(--text-muted);
    font-size: var(--text-xs);
}

.wc-bcount:empty {
    display: none;
}

.wc-bcount--over {
    border-color: var(--error-border);
    background: var(--error-bg);
    color: var(--error-text);
}

/* ---------- Emoji and emote picker ---------- */

.wc-picker {
    position: absolute;
    left: var(--space-2);
    right: var(--space-2);
    bottom: 72px;
    z-index: 3;
    display: flex;
    flex-direction: column;
    height: 290px;
    overflow: hidden;
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.wc-ptabs {
    display: flex;
    border-bottom: 1px solid var(--border);
}

.wc-ptabs button {
    flex: 1;
    min-height: 44px;
    border: 0;
    border-bottom: 2px solid transparent;
    background: none;
    color: var(--text-secondary);
    font: 500 var(--text-base) var(--font-body);
    cursor: pointer;
}

.wc-ptabs button[aria-selected="true"] {
    border-bottom-color: var(--gold);
    color: var(--text-primary);
}

.wc-ptabs button:focus-visible {
    outline: 2px solid var(--ring);
    outline-offset: -2px;
}

.wc-picker-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

.wc-pgrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(44px, 1fr));
    align-content: start;
    gap: 2px;
    padding: var(--space-2);
}

.wc-pgrid button {
    min-height: 44px;
    border: 0;
    border-radius: var(--radius);
    background: none;
    color: var(--text-primary);
    font: 26px/1 var(--font-body);
    cursor: pointer;
}

.wc-pgrid button:hover,
.wc-pgrid button:focus-visible {
    background: var(--bg-muted);
    outline: 0;
}

.wc-pgrid--em {
    grid-template-columns: repeat(auto-fill, minmax(66px, 1fr));
}

.wc-pgrid--em button {
    display: grid;
    justify-items: center;
    align-content: center;
    gap: 3px;
    min-height: 70px;
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-pgrid--em img {
    max-width: 44px;
    max-height: 44px;
    object-fit: contain;
    image-rendering: pixelated;
}

.wc-pnote {
    padding: 22px var(--space-4);
    font-size: var(--text-base);
    color: var(--text-secondary);
    text-align: center;
}

.wc-phint {
    padding: var(--space-2) var(--space-3);
    border-top: 1px solid var(--border-subtle);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-phint:empty {
    display: none;
}

/* ---------- Settings ---------- */

.wc-setgroup {
    background: var(--bg-surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.wc-setrow {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    min-height: 52px;
    padding: 10px 14px;
    border-top: 1px solid var(--border-subtle);
}

.wc-setrow:first-child {
    border-top: 0;
}

.wc-quiet {
    flex-wrap: wrap;
}

.wc-quiet-field {
    flex: 1 1 120px;
    display: grid;
    gap: var(--space-1);
    font-size: var(--text-sm);
    color: var(--text-secondary);
}

.wc-quiet-hint {
    flex-basis: 100%;
    font-size: var(--text-xs);
    color: var(--error-text);
}

.wc-t {
    flex: 1;
    display: grid;
}

.wc-t b {
    font-size: var(--text-base);
    font-weight: 500;
    overflow-wrap: anywhere;
}

.wc-t small {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.wc-tgl {
    position: relative;
    flex: 0 0 40px;
    height: 24px;
    margin: 0;
}

.wc-tgl input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    opacity: 0;
    cursor: pointer;
}

.wc-tgl span {
    position: absolute;
    inset: 0;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-full);
    background: var(--bg-muted);
    pointer-events: none;
    transition: background .12s;
}

.wc-tgl span::after {
    content: "";
    position: absolute;
    left: 3px;
    top: 3px;
    width: 16px;
    height: 16px;
    border-radius: var(--radius-full);
    background: var(--text-muted);
    transition: transform .12s;
}

.wc-tgl input:checked + span {
    border-color: var(--gold);
    background: var(--gold-pale);
}

.wc-tgl input:checked + span::after {
    background: var(--gold);
    transform: translateX(16px);
}

.wc-tgl input:disabled {
    cursor: default;
}

.wc-tgl input:disabled + span {
    opacity: .45;
}

.wc-tgl input:focus-visible + span {
    outline: 2px solid var(--ring);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    .wc-tgl span,
    .wc-tgl span::after {
        transition: none;
    }
}
