    :root {
        color-scheme: light;
        --brand: #25D366;
        --brand-dark: #128C7E;
        --ink: #1a1a1a;
        --muted: #6b7280;
        --border: #e5e7eb;
        --panel: #f9fafb;
        --code-bg: #0d1117;
        --code-fg: #c9d1d9;
        --radius: 10px;
    }
    * , *::before, *::after { box-sizing: border-box; }
    html, body { background: #fff; }
    body {
        font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
        margin: 0;
        color: var(--ink);
        line-height: 1.6;
    }
    .page {
        max-width: 1400px;
        margin: 0 auto;
        padding: 32px 24px 100px;
    }
    .prose { max-width: 760px; }
    h1, h2, h3 { color: var(--ink); }
    h1 { font-size: 1.7rem; margin-bottom: 6px; }
    h2 { font-size: 1.3rem; }
    a { color: var(--brand-dark); }
    code, pre {
        background: var(--panel);
        color: var(--ink);
        border-radius: 6px;
        padding: 2px 6px;
        font-size: 0.9em;
    }
    pre { padding: 16px; overflow-x: auto; }

    #docs-content table {
        width: 100%;
        border-collapse: collapse;
        margin: 12px 0 20px;
        font-size: 0.85rem;
    }
    #docs-content th, #docs-content td {
        text-align: left;
        padding: 8px 10px;
        border-bottom: 1px solid var(--border);
        vertical-align: top;
    }
    #docs-content th { color: var(--muted); font-weight: 600; font-size: 0.78rem; text-transform: uppercase; }
    #docs-content h3 { margin-top: 32px; }
    #docs-content h4 { color: var(--ink); margin-top: 20px; font-size: 1rem; }
    #docs-content pre {
        background: var(--code-bg);
        color: var(--code-fg);
        font-family: ui-monospace, monospace;
        font-size: 0.8rem;
        overflow-x: auto;
    }

    .site-header {
        padding-bottom: 20px;
        margin-bottom: 8px;
        border-bottom: 1px solid var(--border);
    }
    .top-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
        flex-wrap: wrap;
        margin-bottom: 16px;
    }
    .brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }
    .brand-mark {
        width: 28px;
        height: 28px;
        flex: none;
    }
    .brand-name {
        font-size: 1.05rem;
        font-weight: 700;
        color: var(--ink);
        letter-spacing: -0.01em;
        white-space: nowrap;
    }
    .badge {
        display: inline-block;
        background: var(--brand);
        color: #fff;
        border-radius: 999px;
        padding: 2px 10px;
        font-size: 0.72rem;
        font-weight: 600;
        letter-spacing: 0.02em;
    }
    .sr-only {
        position: absolute;
        width: 1px; height: 1px;
        padding: 0; margin: -1px;
        overflow: hidden;
        clip: rect(0,0,0,0);
        white-space: nowrap;
        border: 0;
    }
    .country-combobox {
        position: relative;
        width: 260px;
        max-width: 60vw;
    }
    .country-combo-control {
        display: flex;
        align-items: center;
        gap: 8px;
        border: 1px solid var(--border);
        border-radius: 999px;
        background: #fff;
        padding: 6px 14px;
    }
    .country-combo-control:focus-within { border-color: var(--brand); outline: 2px solid var(--brand); outline-offset: 1px; }
    .country-combo-flag { flex: none; font-size: 1rem; line-height: 1; }
    #country-combo-input {
        flex: 1;
        min-width: 0;
        border: 0;
        outline: 0;
        background: transparent;
        color: var(--ink);
        font-size: 0.85rem;
        font-family: inherit;
        padding: 0;
    }
    .country-combo-list {
        position: absolute;
        z-index: 30;
        top: calc(100% + 4px);
        left: 0;
        right: 0;
        max-height: 320px;
        overflow-y: auto;
        margin: 0;
        padding: 6px 0;
        list-style: none;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 10px;
        box-shadow: 0 8px 24px rgba(0,0,0,0.14);
    }
    .country-combo-group-label {
        padding: 6px 14px 4px;
        font-size: 0.7rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.04em;
        color: var(--muted);
    }
    .country-combo-option {
        padding: 7px 14px;
        font-size: 0.85rem;
        cursor: pointer;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    .country-combo-option.active,
    .country-combo-option:hover { background: var(--panel); }
    .country-combo-option.selected { font-weight: 600; color: var(--brand-dark); }
    .country-combo-empty {
        padding: 10px 14px;
        font-size: 0.85rem;
        color: var(--muted);
        font-style: italic;
    }

    /* ---- RTL (Arabic) ---- */
    html[dir="rtl"] .country-combo-list { left: 0; right: 0; }
    html[dir="rtl"] #docs-content th,
    html[dir="rtl"] #docs-content td,
    html[dir="rtl"] .field .hint {
        text-align: right;
    }
    html[dir="rtl"] .footer-bottom,
    html[dir="rtl"] .message-toolbar,
    html[dir="rtl"] .footer-links a {
        direction: rtl;
    }

    button {
        cursor: pointer;
        border: 1px solid #ccc;
        background: #fff;
        color: var(--ink);
        border-radius: 6px;
        padding: 8px 14px;
        font-family: inherit;
    }

    /* ---- Tabs ---- */
    .tabs {
        display: flex;
        gap: 4px;
        border-bottom: 2px solid var(--border);
        margin: 28px 0 20px;
    }
    .tab-btn {
        border: 0;
        background: transparent;
        padding: 10px 18px;
        font-size: 0.95rem;
        font-weight: 600;
        color: var(--muted);
        border-radius: 8px 8px 0 0;
        margin-bottom: -2px;
        border-bottom: 2px solid transparent;
    }
    .tab-btn.active {
        color: var(--brand-dark);
        border-bottom: 2px solid var(--brand);
        background: var(--panel);
    }
    .tab-panel { display: none; }
    .tab-panel.active { display: block; }

    .subtabs {
        display: flex;
        gap: 4px;
        margin: 14px 0 -1px;
    }
    .subtab-btn {
        border: 1px solid var(--border);
        border-bottom: 0;
        background: #fff;
        padding: 6px 12px;
        font-size: 0.78rem;
        font-weight: 600;
        color: var(--muted);
        border-radius: 6px 6px 0 0;
    }
    .subtab-btn.active {
        color: var(--brand-dark);
        background: var(--code-bg);
        border-color: var(--code-bg);
    }

    /* ---- Generator layout ---- */
    .generator {
        display: grid;
        grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
        gap: 24px;
        align-items: start;
    }
    @media (max-width: 900px) {
        .generator { grid-template-columns: 1fr; }
    }
    .panel {
        background: var(--panel);
        border: 1px solid var(--border);
        border-radius: var(--radius);
        padding: 20px;
    }
    .panel + .panel { margin-top: 20px; }
    .panel h3 {
        margin: 0 0 4px;
        font-size: 1rem;
    }
    .panel .panel-desc {
        font-size: 0.82rem;
        color: var(--muted);
        margin: 0 0 16px;
    }
    .generator-output {
        position: sticky;
        top: 20px;
    }
    @media (max-width: 900px) {
        .generator-output { position: static; }
    }

    .field {
        display: flex;
        flex-direction: column;
        /* Push the input/select to the bottom of the field, so two fields
           side by side in a grid row stay aligned even when only one of
           them has a .hint line (otherwise the shorter field's input sits
           higher than its neighbor's). */
        justify-content: flex-end;
        gap: 4px;
        margin-bottom: 14px;
    }
    .field label { font-size: 0.85rem; font-weight: 600; }
    .field .hint,
    .schedule-toggle-body .hint {
        display: block;
        font-size: 0.78rem;
        color: var(--muted);
        font-weight: 400;
        margin: 4px 0;
    }
    .field .hint.warning {
        color: #b45309;
        background: #fffbeb;
        border: 1px solid #fde68a;
        border-radius: 6px;
        padding: 6px 8px;
        font-weight: 600;
    }
    .message-toolbar {
        display: flex;
        gap: 4px;
        margin-bottom: 4px;
    }
    .message-toolbar button {
        min-width: 28px;
        padding: 3px 8px;
        border: 1px solid var(--border);
        background: #fff;
        border-radius: 6px;
        cursor: pointer;
        font-size: 0.85rem;
        line-height: 1.4;
        color: var(--ink);
    }
    .message-toolbar button:hover { background: var(--panel); border-color: var(--brand); }
    .message-preview {
        margin-top: 6px;
        padding: 8px 10px;
        border-radius: 8px;
        background: var(--panel);
        border: 1px solid var(--border);
        font-size: 0.88rem;
        white-space: pre-wrap;
        word-break: break-word;
        min-height: 1.4em;
    }
    .message-preview .mp-mono {
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
        background: rgba(0,0,0,0.06);
        padding: 0 3px;
        border-radius: 3px;
    }
    .placeholder-suggest {
        position: absolute;
        z-index: 20;
        left: 0;
        right: 0;
        top: 100%;
        margin-top: 2px;
        background: #fff;
        border: 1px solid var(--border);
        border-radius: 8px;
        box-shadow: 0 6px 16px rgba(0,0,0,0.12);
        overflow: hidden;
    }
    .placeholder-suggest button {
        display: flex;
        justify-content: space-between;
        gap: 8px;
        width: 100%;
        text-align: left;
        padding: 7px 10px;
        border: none;
        background: none;
        cursor: pointer;
        font-size: 0.85rem;
        font-family: inherit;
        color: var(--ink);
    }
    .placeholder-suggest button code { color: var(--brand-dark); font-weight: 600; }
    .placeholder-suggest button small { color: var(--muted); font-weight: 400; }
    .placeholder-suggest button:hover,
    .placeholder-suggest button.active { background: var(--panel); }

    .field input[type="text"],
    .field input[type="tel"],
    .field input[type="url"],
    .field input[type="number"],
    .field select,
    .field textarea,
    .schedule-toggle-body textarea {
        width: 100%;
        font-family: inherit;
        font-size: 0.9rem;
        padding: 8px 10px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background: #fff;
        color: var(--ink);
    }
    .color-input-wrap {
        display: flex;
        align-items: stretch;
        gap: 6px;
    }
    .color-input-wrap input[type="color"] {
        flex: none;
        width: 38px;
        padding: 2px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background: #fff;
        cursor: pointer;
    }
    .color-input-wrap .color-hex-input {
        flex: 1;
        min-width: 0;
        font-family: ui-monospace, monospace;
        text-transform: uppercase;
    }
    .color-input-wrap .color-hex-input.invalid {
        border-color: #dc2626;
        outline-color: #dc2626;
    }

    .grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
    .grid-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px; }
    .grid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; }

    .checkbox-row {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 0.85rem;
        font-weight: 600;
        margin-bottom: 14px;
    }
    .checkbox-row input { width: auto; }

    /* Tag input for cities */
    .tag-input {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        border: 1px solid #ccc;
        border-radius: 6px;
        padding: 6px;
        background: #fff;
    }
    .tag-input input {
        border: 0;
        outline: none;
        flex: 1;
        min-width: 100px;
        padding: 4px;
        font-size: 0.88rem;
    }
    .tag {
        display: inline-flex;
        align-items: center;
        gap: 5px;
        background: var(--brand);
        color: #fff;
        border-radius: 999px;
        padding: 3px 6px 3px 10px;
        font-size: 0.8rem;
    }
    .tag button {
        border: 0;
        background: rgba(255,255,255,0.25);
        color: #fff;
        border-radius: 50%;
        width: 16px;
        height: 16px;
        padding: 0;
        line-height: 1;
        font-size: 0.7rem;
        cursor: pointer;
    }

    /* Dynamic rule cards */
    .rule-list { display: flex; flex-direction: column; gap: 14px; margin-bottom: 12px; }
    .rule-card {
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 14px;
        background: #fff;
    }
    .rule-card-head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 10px;
    }
    .rule-card-head strong { font-size: 0.85rem; }
    .rule-remove {
        border: 0;
        background: #fee2e2;
        color: #b91c1c;
        font-size: 0.78rem;
        font-weight: 600;
        padding: 4px 10px;
        border-radius: 6px;
    }
    .numbers-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 8px; }
    .number-row { display: grid; grid-template-columns: 2fr 1fr auto; gap: 8px; align-items: center; }
    .number-row input { width: 100%; }
    .add-btn {
        background: #fff;
        border: 1px dashed #999;
        color: var(--ink);
        font-size: 0.82rem;
        font-weight: 600;
        padding: 6px 12px;
    }
    .add-btn.primary {
        border-style: solid;
        border-color: var(--brand);
        color: var(--brand-dark);
    }
    .schedule-toggle-body {
        margin-top: 10px;
        padding-top: 10px;
        border-top: 1px dashed var(--border);
    }
    .side-toggle {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    .side-toggle .checkbox-row {
        margin-bottom: 0;
        font-size: 0.8rem;
    }
    .side-toggle input[type="text"] {
        width: 100%;
        font-family: inherit;
        font-size: 0.85rem;
        padding: 6px 8px;
        border: 1px solid #ccc;
        border-radius: 6px;
        background: #fff;
        color: var(--ink);
    }
    .side-toggle input[type="text"]:disabled {
        background: var(--panel);
        color: var(--muted);
    }
    .icon-gallery {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
        gap: 10px;
    }
    .icon-swatch {
        border: 2px solid var(--border);
        background: #fff;
        border-radius: 12px;
        padding: 10px 8px;
        cursor: pointer;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 6px;
        min-height: 80px;
        box-sizing: border-box;
        transition: border-color .15s, background .15s, transform .1s;
    }
    .icon-swatch:hover { transform: scale(1.04); border-color: var(--brand); }
    .icon-swatch .icon-img {
        width: 48px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: center;
        flex-shrink: 0;
    }
    .icon-swatch .icon-img svg {
        width: 48px !important;
        height: 48px !important;
        display: block;
        flex-shrink: 0;
    }
    .icon-swatch span { font-size: 0.65rem; color: var(--muted); text-align: center; line-height: 1.2; }
    .icon-swatch.active { border-color: var(--brand); background: #f0fdf4; }
    /* Hide pulse ring/halo fields in pill mode — belt-and-suspenders over the JS visibility toggle */
    body[data-image-mode="pill"] #pulse-ring-field,
    body[data-image-mode="pill"] #pulse-color-field { display: none !important; }
    /* Per-rule pill text override only makes sense once the global "Button
       image" mode is Pill — hidden otherwise. Always present in the DOM
       (see buildPillTextField() in app.js) so switching modes doesn't
       require re-rendering every rule card. */
    .rule-pill-text-field { display: none; }
    body[data-image-mode="pill"] .rule-pill-text-field { display: block; }
    /* Pill icon gallery: green background, stripped icon bg so glyph floats on green */
    #pill-icon-gallery .icon-swatch { background: #25D366; border-color: #1aad55; }
    #pill-icon-gallery .icon-swatch:hover { background: #20c05a; }
    #pill-icon-gallery .icon-swatch.active { background: #128C7E; border-color: #0e6b5e; }
    #pill-icon-gallery .icon-swatch span { color: rgba(255,255,255,.85); }
    .weekday-picker {
        display: flex;
        flex-wrap: wrap;
        gap: 6px;
        margin-top: 4px;
    }
    .weekday-chip {
        border: 1px solid #ccc;
        background: #fff;
        border-radius: 6px;
        padding: 5px 9px;
        font-size: 0.78rem;
    }
    .weekday-chip.active { background: var(--brand); color: #fff; border-color: var(--brand); }
    .empty-hint {
        font-size: 0.82rem;
        color: var(--muted);
        font-style: italic;
        margin: 0 0 12px;
    }

    .copy-btn {
        background: var(--brand);
        color: #fff;
        border: 0;
        font-weight: 600;
        width: 100%;
        padding: 10px 14px;
    }
    .copy-btn.copied { background: var(--brand-dark); }
    #generated-code {
        background: var(--code-bg);
        color: var(--code-fg);
        padding: 16px;
        border-radius: 8px;
        font-family: ui-monospace, monospace;
        font-size: 0.8rem;
        white-space: pre-wrap;
        word-break: break-word;
        margin-top: 12px;
        max-height: 70vh;
        overflow-y: auto;
    }
    #generated-code .tok-tag { color: #7ee787; }
    #generated-code .tok-string { color: #a5d6ff; }
    #generated-code .tok-key { color: #79c0ff; }
    #generated-code .tok-keyword { color: #ff7b72; }
    #generated-code .tok-number { color: #d2a8ff; }
    #log {
        background: var(--code-bg);
        color: var(--code-fg);
        padding: 16px;
        border-radius: 8px;
        font-family: ui-monospace, monospace;
        font-size: 0.85rem;
        white-space: pre-wrap;
        max-height: 260px;
        overflow-y: auto;
    }
    footer {
        margin-top: 48px;
        padding-top: 24px;
        border-top: 1px solid var(--border);
        font-size: 0.85rem;
        color: var(--muted);
    }
    .footer-top {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(120px, max-content));
        gap: 24px;
        margin-bottom: 20px;
    }
    .footer-col { min-width: 0; }
    .footer-heading {
        font-size: 0.75rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.03em;
        color: var(--muted);
        margin: 0 0 8px;
    }
    .footer-links {
        display: flex;
        flex-direction: column;
        gap: 8px;
    }
    .footer-links a {
        color: var(--ink);
        display: inline-flex;
        align-items: center;
        gap: 6px;
        text-decoration: none;
        transition: color .15s ease;
    }
    .footer-links a svg { width: 16px; height: 16px; flex: none; }
    .footer-links a:hover {
        color: var(--brand-dark);
        text-decoration: underline;
    }
    .footer-bottom {
        padding-top: 16px;
        border-top: 1px solid var(--border);
        text-align: center;
    }
    @media (min-width: 480px) {
        .footer-bottom { text-align: left; }
    }
