:root {
    --ink: #1a1d24;
    --muted: #8b929e;
    --muted-2: #6b7280;
    --line: #e4e7eb;
    --sidebar: #f3f4f6;
    --panel: #ffffff;
    --accent: #2f6bff;
    --accent-soft: #e8efff;
    --warn: #f59a1a;
    --warn-text: #c2410c;
    --error: #e11d48;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    height: 100%;
}

body {
    font-family: "Anek Bangla", "Noto Sans Bengali", system-ui, sans-serif;
    font-size: 1rem;
    line-height: 1.45;
    color: var(--ink);
    background: var(--panel);
}

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

.app-layout {
    height: 100%;
    min-height: 100vh;
    display: grid;
    grid-template-columns: 240px 1fr;
    background: var(--panel);
}

/* —— Sidebar —— */
.sidebar {
    background: var(--sidebar);
    border-right: 1px solid var(--line);
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.sidebar-title {
    margin: 1.15rem 1.1rem 0.75rem;
    font-size: 0.92rem;
    font-weight: 500;
    color: var(--muted);
    letter-spacing: 0.01em;
}

.issue-list {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0 0.55rem 1rem;
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.issue-empty {
    margin: 0.5rem 0.5rem;
    color: var(--muted);
    font-size: 0.9rem;
}

.issue-item {
    appearance: none;
    border: 0;
    background: transparent;
    display: grid;
    grid-template-columns: 18px 1fr auto;
    align-items: center;
    gap: 0.55rem;
    width: 100%;
    padding: 0.55rem 0.6rem;
    border-radius: 9px;
    font: inherit;
    color: var(--ink);
    text-align: left;
    cursor: pointer;
}

.issue-item:hover {
    background: rgba(255, 255, 255, 0.7);
}

.issue-item.is-active {
    background: var(--accent);
    color: #fff;
}

.issue-item.is-active .issue-count {
    color: rgba(255, 255, 255, 0.85);
}

.issue-item.is-active .issue-icon {
    background: #fff;
    box-shadow: inset 2px 0 0 var(--warn);
}

.issue-icon {
    width: 14px;
    height: 14px;
    border-radius: 2px;
    background: #fff;
    box-shadow: inset 2px 0 0 var(--warn);
    position: relative;
    /* Clicks must hit the <button>, not child nodes — otherwise
       Event.value() falls back to the span (no value) and selection no-ops. */
    pointer-events: none;
}

.issue-icon::after {
    content: "AI";
    position: absolute;
    left: 3px;
    top: 1px;
    font-size: 7px;
    font-weight: 700;
    font-family: system-ui, sans-serif;
    color: var(--warn);
    letter-spacing: -0.04em;
    pointer-events: none;
}

.issue-item.is-active .issue-icon::after {
    color: var(--accent);
}

.issue-word {
    font-size: 0.98rem;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    pointer-events: none;
}

.issue-count {
    font-size: 0.85rem;
    color: var(--muted);
    font-variant-numeric: tabular-nums;
    pointer-events: none;
}

.tool-btn .icon-wand,
.tool-btn .icon-trash,
.tool-btn .icon-gear {
    pointer-events: none;
}
.main-pane {
    background: var(--panel);
    display: flex;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
}

.main-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.15rem 1.35rem 0.75rem;
}

.brand {
    margin: 0;
    font-family: Syne, system-ui, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.brand-meta {
    margin: 0.2rem 0 0;
    font-size: 0.88rem;
    color: var(--muted);
}

.toolbar {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    padding: 0.2rem;
    background: #eef0f3;
    border-radius: 10px;
}

.tool-btn {
    appearance: none;
    border: 0;
    background: transparent;
    width: 34px;
    height: 30px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: #5b6573;
}

.tool-toggle {
    width: auto;
    min-width: 34px;
    padding: 0 0.55rem;
    font-size: 1rem;
    font-weight: 600;
}

.tool-toggle.is-on {
    background: var(--accent-soft);
    color: var(--accent);
}

.tool-btn:hover {
    background: #fff;
    color: var(--ink);
}

.icon-wand,
.icon-trash,
.icon-gear,
.icon-list,
.icon-char,
.icon-warn {
    display: block;
    width: 16px;
    height: 16px;
    background: currentColor;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
}

.icon-wand {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M15 4V2m0 14v-2M8 9H6m12 0h-2M5.6 5.6 4.2 4.2m12.2 12.2 1.4 1.4M5.6 12.4 4.2 13.8m12.2-12.2 1.4-1.4'/%3E%3Cpath d='m9 15 8-8 2 2-8 8-3 1 1-3z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M15 4V2m0 14v-2M8 9H6m12 0h-2M5.6 5.6 4.2 4.2m12.2 12.2 1.4 1.4M5.6 12.4 4.2 13.8m12.2-12.2 1.4-1.4'/%3E%3Cpath d='m9 15 8-8 2 2-8 8-3 1 1-3z'/%3E%3C/svg%3E");
}

.icon-trash {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M10 11v6m4-6v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 7h16M10 11v6m4-6v6M6 7l1 12a2 2 0 0 0 2 2h6a2 2 0 0 0 2-2l1-12M9 7V5a1 1 0 0 1 1-1h4a1 1 0 0 1 1 1v2'/%3E%3C/svg%3E");
}

.icon-gear {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M19.4 15a1.7 1.7 0 0 0 .3 1.8l.1.1a2 2 0 1 1-2.8 2.8l-.1-.1a1.7 1.7 0 0 0-1.8-.3 1.7 1.7 0 0 0-1 1.5V21a2 2 0 1 1-4 0v-.1a1.7 1.7 0 0 0-1.1-1.5 1.7 1.7 0 0 0-1.8.3l-.1.1a2 2 0 1 1-2.8-2.8l.1-.1a1.7 1.7 0 0 0 .3-1.8 1.7 1.7 0 0 0-1.5-1H3a2 2 0 1 1 0-4h.1a1.7 1.7 0 0 0 1.5-1.1 1.7 1.7 0 0 0-.3-1.8l-.1-.1a2 2 0 1 1 2.8-2.8l.1.1a1.7 1.7 0 0 0 1.8.3H9a1.7 1.7 0 0 0 1-1.5V3a2 2 0 1 1 4 0v.1a1.7 1.7 0 0 0 1 1.5 1.7 1.7 0 0 0 1.8-.3l.1-.1a2 2 0 1 1 2.8 2.8l-.1.1a1.7 1.7 0 0 0-.3 1.8V9a1.7 1.7 0 0 0 1.5 1H21a2 2 0 1 1 0 4h-.1a1.7 1.7 0 0 0-1.5 1z'/%3E%3C/svg%3E");
}

.icon-list {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M8 6h13M8 12h13M8 18h13M3 6h.01M3 12h.01M3 18h.01'/%3E%3C/svg%3E");
}

.icon-char {
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 20 10 4h2l6 16M6.5 14h9'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' stroke='black' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Cpath d='M4 20 10 4h2l6 16M6.5 14h9'/%3E%3C/svg%3E");
}

.icon-warn {
    background: var(--warn);
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 21h20L12 3zm0 6v5m0 3h.01'/%3E%3C/svg%3E");
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='black' viewBox='0 0 24 24'%3E%3Cpath d='M12 3 2 21h20L12 3zm0 6v5m0 3h.01'/%3E%3C/svg%3E");
}

/* —— Editor —— */
.editor {
    position: relative;
    flex: 1;
    min-height: 0;
    margin: 0 0.35rem;
}

.editor-backdrop,
.editor-input {
    position: absolute;
    inset: 0;
    padding: 0.35rem 1rem 1rem;
    font: inherit;
    font-size: 1.2rem;
    line-height: 1.85;
    letter-spacing: 0.01em;
    white-space: pre-wrap;
    word-wrap: break-word;
    overflow: auto;
}

.editor-backdrop {
    color: transparent;
    pointer-events: none;
    z-index: 0;
}

.editor-backdrop .tok {
    color: transparent;
}

.editor-backdrop .tok-bad {
    text-decoration: underline wavy var(--error);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 3px;
}

.editor-backdrop .tok+.tok::before {
    content: " ";
}

.editor-input {
    z-index: 1;
    resize: none;
    border: 0;
    background: transparent;
    color: var(--ink);
    caret-color: var(--ink);
    outline: none;
    width: 100%;
    height: 100%;
}

.editor-input::placeholder {
    color: #a0a7b4;
}

/* —— Spell-check activity: fades in place, never shifts the layout —— */
.check-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-left: 0.4rem;
    vertical-align: middle;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0;
    transition: opacity 0.2s;
}

.check-dot.is-busy {
    opacity: 0.8;
    transition-delay: 0.25s;
}

/* —— Completion menu (anchored at the caret via --caret-x / --caret-y) —— */
.suggest-menu {
    position: absolute;
    z-index: 5;
    left: min(var(--caret-x, 1rem), calc(100% - 12rem));
    top: var(--caret-y, 2.5rem);
    min-width: 9rem;
    max-width: 18rem;
    margin: 0.15rem 0 0;
    padding: 0.25rem;
    list-style: none;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(26, 29, 36, 0.12);
}

.suggest-item {
    padding: 0.2rem 0.6rem;
    border-radius: 7px;
    font-size: 1.1rem;
    line-height: 1.6;
    cursor: pointer;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.suggest-item:hover {
    background: var(--sidebar);
}

.suggest-num {
    display: inline-block;
    min-width: 1.1rem;
    margin-right: 0.35rem;
    font-size: 0.75rem;
    color: var(--muted);
}

.suggest-item.is-active .suggest-num {
    color: rgba(255, 255, 255, 0.75);
}

.suggest-page {
    padding: 0.1rem 0.6rem 0;
    font-size: 0.75rem;
    color: var(--muted);
    text-align: right;
}

.suggest-menu.is-horizontal {
    display: flex;
    flex-wrap: wrap;
    gap: 0.15rem;
    width: max-content;
    max-width: calc(100% - 1rem);
    left: max(0.5rem, min(var(--caret-x, 1rem), calc(100% - 40rem)));
}

.suggest-menu.is-horizontal .suggest-item {
    flex: none;
}

.suggest-menu.is-horizontal .suggest-page {
    align-self: center;
}

.suggest-item.is-active {
    background: var(--accent);
    color: #fff;
}

/* —— Fix bar —— */
.fix-bar {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    margin: 0 1rem 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 12px;
    background: #f3f4f6;
    border: 1px solid var(--line);
}

.fix-bar-ok {
    grid-template-columns: 1fr auto;
}

/* Holds the fix bar's place whether it shows an issue, the all-clear, or
   nothing, so the editor above never changes height. */
.fix-slot {
    min-height: calc(4.25rem + 0.65rem);
}

.fix-slot .fix-bar {
    min-height: 4.25rem;
}

/* Until the browser-saved draft is restored (see `restored` in page.zx), keep
   what it would change invisible but in place. The animation reveals the page
   anyway if the client never starts. */
.is-restoring .editor,
.is-restoring .issue-list,
.is-restoring .brand-meta,
.is-restoring .fix-slot,
.is-restoring .status-bar > div {
    visibility: hidden;
    animation: reveal 0s 3s forwards;
}

@keyframes reveal {
    to {
        visibility: visible;
    }
}

.fix-target {
    display: flex;
    flex-direction: column;
    gap: 0.05rem;
    min-width: 4.5rem;
}

.fix-word {
    font-weight: 700;
    font-size: 1.05rem;
}

.fix-label {
    font-size: 0.78rem;
    color: var(--muted);
}

.fix-chips {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.4rem;
    overflow-x: auto;
    padding-bottom: 0.1rem;
    min-width: 0;
}

.fix-chip {
    appearance: none;
    border: 0;
    flex: 0 0 auto;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: #fff;
    border: 1px solid #dde1e7;
    font: inherit;
    font-size: 0.95rem;
    color: var(--ink);
    cursor: pointer;
    white-space: nowrap;
}

.fix-chip:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.fix-none,
.fix-ok {
    color: var(--muted-2);
    font-size: 0.95rem;
}

.fix-ignore {
    appearance: none;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 0.92rem;
    font-weight: 600;
    color: var(--muted-2);
    cursor: pointer;
    padding: 0.35rem 0.5rem;
    border-radius: 8px;
    white-space: nowrap;
}

.fix-ignore:hover {
    background: #fff;
    color: var(--ink);
}

/* —— Status —— */
.status-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.status-left,
.status-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
}

.stat .icon-list,
.stat .icon-char {
    opacity: 0.7;
}

.stat-warn {
    color: var(--warn-text);
    font-weight: 600;
}

@media (max-width: 720px) {
    .app-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto 1fr;
    }

    .sidebar {
        border-right: 0;
        border-bottom: 1px solid var(--line);
        max-height: 36vh;
    }

    .fix-bar {
        grid-template-columns: 1fr;
        gap: 0.55rem;
    }
}
/* —— Keyboard settings (the settings every Byakaron keyboard shares) —— */
.settings-panel {
    margin: 0 1rem 0.65rem;
    padding: 0.9rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--panel);
    max-height: 55vh;
    overflow: auto;
}

.settings-title {
    margin: 0.2rem 0 0.4rem;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--muted);
}

.setting-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--line);
}

.setting-text {
    display: flex;
    flex-direction: column;
    gap: 0.1rem;
    min-width: 0;
}

.setting-label {
    font-weight: 600;
}

.setting-hint {
    font-size: 0.82rem;
    color: var(--muted-2);
}

.switch {
    flex: none;
    position: relative;
    width: 38px;
    height: 22px;
    border: 0;
    border-radius: 11px;
    background: var(--line);
    cursor: pointer;
    transition: background 0.15s;
}

.switch.is-on {
    background: var(--accent);
}

.switch-knob {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #fff;
    transition: transform 0.15s;
    pointer-events: none;
}

.switch.is-on .switch-knob {
    transform: translateX(16px);
}

.segmented,
.stepper,
.userdict-add {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.seg {
    appearance: none;
    border: 1px solid var(--line);
    background: var(--panel);
    border-radius: 8px;
    padding: 0.25rem 0.65rem;
    font: inherit;
    cursor: pointer;
}

.seg.is-on {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.stepper-value {
    min-width: 1.5rem;
    text-align: center;
    font-weight: 600;
}

.userdict-add {
    margin-bottom: 0.4rem;
}

.userdict-input {
    flex: 1;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 0.3rem 0.6rem;
    font: inherit;
}

.userdict-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
}

.userdict-item {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.15rem 0.3rem 0.15rem 0.6rem;
    border: 1px solid var(--line);
    border-radius: 999px;
}

.userdict-remove {
    border: 0;
    background: transparent;
    cursor: pointer;
    color: var(--muted-2);
    font-size: 1rem;
    line-height: 1;
}

.userdict-empty {
    color: var(--muted);
    font-size: 0.9rem;
}

/* —— Download page —— */
.dl-shell {
    min-height: 100vh;
    max-width: 42rem;
    margin: 0 auto;
    padding: 3.5rem 1.25rem 4rem;
    background:
        radial-gradient(ellipse 80% 50% at 50% -10%, #e8efff 0%, transparent 55%),
        var(--panel);
}

.dl-hero {
    margin-bottom: 2.25rem;
}

.dl-brand {
    margin: 0 0 0.35rem;
    font-family: Syne, "Anek Bangla", sans-serif;
    font-size: clamp(2.4rem, 8vw, 3.4rem);
    font-weight: 700;
    letter-spacing: -0.04em;
    line-height: 1;
    color: var(--ink);
}

.dl-title {
    margin: 0 0 0.65rem;
    font-size: 1.15rem;
    font-weight: 600;
    color: var(--muted-2);
}

.dl-lead {
    margin: 0 0 1rem;
    max-width: 28rem;
    color: var(--muted);
    font-size: 1rem;
}

.dl-nav {
    margin: 0;
    display: flex;
    gap: 0.5rem;
    align-items: center;
    font-size: 0.92rem;
}

.dl-nav a {
    color: var(--accent);
    text-decoration: none;
}

.dl-nav a:hover {
    text-decoration: underline;
}

.dl-section-title {
    margin: 0 0 0.5rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--ink);
}

.dl-guide {
    margin: 0 0 2.5rem;
}

.dl-guide-lead {
    margin: 0 0 1rem;
    color: var(--muted);
    font-size: 0.95rem;
}

.dl-guide-note {
    margin: 0.85rem 0 0;
    color: var(--muted-2);
    font-size: 0.85rem;
}

.dl-cmd-block {
    margin: 0 0 0.75rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: var(--sidebar);
    overflow: hidden;
}

.dl-cmd-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.55rem 0.9rem 0;
}

.dl-cmd-os {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--muted-2);
}

.dl-cmd-link {
    font-size: 0.82rem;
    color: var(--accent);
    text-decoration: none;
}

.dl-cmd-link:hover {
    text-decoration: underline;
}

.dl-cmd {
    margin: 0.35rem 0 0;
    padding: 0.7rem 0.9rem 0.85rem;
    overflow-x: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.84rem;
    line-height: 1.4;
    color: var(--ink);
    background: transparent;
}

.dl-cmd code {
    font-family: inherit;
}

.dl-manual {
    margin: 0;
}

.dl-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
}

.dl-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.1rem;
    border: 1px solid var(--line);
    border-radius: 0.65rem;
    background: var(--panel);
}

.dl-meta {
    min-width: 0;
}

.dl-label {
    margin: 0 0 0.15rem;
    font-size: 1.05rem;
    font-weight: 600;
}

.dl-detail {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.dl-hash {
    margin: 0.35rem 0 0;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.68rem;
    color: var(--muted-2);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dl-btn {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.55rem 1rem;
    border-radius: 0.45rem;
    background: var(--ink);
    color: #fff;
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
}

.dl-btn:hover {
    background: #000;
}

@media (max-width: 560px) {
    .dl-item {
        flex-direction: column;
        align-items: stretch;
    }

    .dl-btn {
        width: 100%;
    }
}

/* —— Landing page —— */
.ic-apple { --ic: url(/icons/apple.svg); }
.ic-android { --ic: url(/icons/android.svg); }
.ic-linux { --ic: url(/icons/linux.svg); }
.ic-windows { --ic: url(/icons/windows.svg); }
.ic-googleplay { --ic: url(/icons/googleplay.svg); }
.ic-appstore { --ic: url(/icons/appstore.svg); }
.ic-download { --ic: url(/icons/download.svg); }
.ic-globe { --ic: url(/icons/globe.svg); }
.ic-arrow { --ic: url(/icons/arrow.svg); }
.ic-more { --ic: url(/icons/more.svg); }
.ic-check { --ic: url(/icons/check.svg); }
.ic-spark { --ic: url(/icons/spark.svg); }
.ic-offline { --ic: url(/icons/offline.svg); }
.ic-devices { --ic: url(/icons/devices.svg); }

[class^="ic-"],
[class*=" ic-"] {
    display: inline-block;
    flex-shrink: 0;
    width: 1.1em;
    height: 1.1em;
    background: currentColor;
    -webkit-mask: var(--ic) center / contain no-repeat;
    mask: var(--ic) center / contain no-repeat;
}

.lp {
    max-width: 64rem;
    margin: 0 auto;
    padding: 0 1.25rem 2rem;
}

body:has(.lp) {
    background:
        radial-gradient(ellipse 60rem 28rem at 50% -6rem, var(--accent-soft) 0%, transparent 70%),
        var(--panel);
}

.lp a {
    color: inherit;
}

/* nav */
.lp-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 0;
}

.lp-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    font-family: Syne, "Anek Bangla", sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    letter-spacing: -0.02em;
    text-decoration: none;
}

.lp-logo img {
    border-radius: 22%;
}

.lp-nav-links,
.lp-footer-links {
    display: flex;
    gap: 1.25rem;
    font-size: 0.92rem;
}

.lp-nav-links a,
.lp-footer-links a {
    color: var(--muted-2);
    text-decoration: none;
}

.lp-nav-links a:hover,
.lp-footer-links a:hover {
    color: var(--ink);
}

/* hero */
.lp-hero {
    display: grid;
    grid-template-columns: 1.15fr 1fr;
    align-items: center;
    gap: 3rem;
    padding: 4rem 0 4.5rem;
}

.lp-eyebrow {
    display: inline-block;
    margin: 0 0 1.1rem;
    padding: 0.2rem 0.75rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: var(--panel);
    color: var(--muted-2);
    font-size: 0.85rem;
    font-weight: 600;
}

.lp-title {
    margin: 0 0 1rem;
    font-size: clamp(2.2rem, 5.5vw, 3.5rem);
    font-weight: 700;
    line-height: 1.12;
}

.lp-lead {
    margin: 0 0 2rem;
    max-width: 30rem;
    color: var(--muted-2);
    font-size: 1.1rem;
}

.lp-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.4rem;
}

.lp-cta {
    display: none;
    align-items: center;
    gap: 0.6rem;
    padding: 0.8rem 1.35rem;
    border-radius: 0.65rem;
    background: var(--ink);
    color: #fff !important;
    font-weight: 600;
    text-decoration: none;
    box-shadow: 0 6px 18px -8px rgb(26 29 36 / 0.55);
}

.lp-cta:hover {
    background: #000;
}

.lp-secondary {
    color: var(--accent) !important;
    font-weight: 600;
    text-decoration: none;
}

.lp-secondary:hover {
    text-decoration: underline;
}

.lp-logo-sep {
    margin: 0 0.45em;
    color: var(--line);
    font-weight: 400;
}

.lp-logo-name [lang="bn"] {
    font-family: "Anek Bangla", sans-serif;
    font-weight: 600;
    letter-spacing: 0;
}

/* scattered letters behind the demo */
.lp-hero {
    position: relative;
}

.lp-glyphs {
    position: absolute;
    top: 0;
    right: -1rem;
    bottom: 0;
    width: 56%;
    z-index: 0;
    pointer-events: none;
    user-select: none;
    -webkit-mask: radial-gradient(ellipse at 55% 50%, #000 50%, transparent 85%);
    mask: radial-gradient(ellipse at 55% 50%, #000 50%, transparent 85%);
}

.lp-glyphs span {
    position: absolute;
    font-weight: 700;
    line-height: 1;
    color: var(--accent);
    opacity: 0.22;
}

.lp-glyphs span:nth-child(3n) {
    color: var(--ink);
    opacity: 0.12;
}

.lp-hero-copy {
    position: relative;
    z-index: 1;
}

/* demo */
.lp-demo {
    z-index: 1;
    position: relative;
    padding: 0 0 4.5rem;
    border: 1px solid var(--line);
    border-radius: 1rem;
    background: var(--panel);
    box-shadow: 0 24px 48px -28px rgb(26 29 36 / 0.35);
}

.lp-demo-bar {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.7rem 0.9rem;
    border-bottom: 1px solid var(--line);
}

.lp-demo-bar i {
    width: 0.65rem;
    height: 0.65rem;
    border-radius: 50%;
    background: var(--line);
}

.lp-demo-bar img {
    margin-left: auto;
    border-radius: 22%;
}

.lp-demo-text {
    margin: 0;
    padding: 1.4rem 1.4rem 0;
    font-size: 1.35rem;
}

.lp-demo-text mark {
    position: relative;
    margin-left: 0.25em;
    background: none;
    color: inherit;
    text-decoration: underline wavy var(--error);
    text-decoration-thickness: 1.5px;
    text-underline-offset: 0.3em;
}

.lp-demo-pop {
    position: absolute;
    left: -0.4rem;
    top: calc(100% + 0.5rem);
    display: flex;
    flex-direction: column;
    min-width: 9rem;
    padding: 0.35rem;
    border: 1px solid var(--line);
    border-radius: 0.6rem;
    background: var(--panel);
    box-shadow: 0 12px 28px -12px rgb(26 29 36 / 0.35);
    font-size: 1rem;
    text-decoration: none;
}

.lp-demo-pop span {
    padding: 0.25rem 0.6rem;
    border-radius: 0.4rem;
}

.lp-demo-pop .lp-demo-label {
    color: var(--muted);
    font-size: 0.78rem;
}

.lp-demo-pop .lp-demo-pick {
    background: var(--accent-soft);
    color: var(--accent);
    font-weight: 600;
}

/* features */
.lp-features {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
    padding: 2.25rem 0 4rem;
    border-top: 1px solid var(--line);
}

.lp-feature > [class^="ic-"] {
    width: 2.1rem;
    height: 2.1rem;
    padding: 0.45rem;
    border-radius: 0.55rem;
    background: var(--accent);
    -webkit-mask: none;
    mask: none;
    position: relative;
}

.lp-feature > [class^="ic-"]::after {
    content: "";
    position: absolute;
    inset: 0.45rem;
    background: #fff;
    -webkit-mask: var(--ic) center / contain no-repeat;
    mask: var(--ic) center / contain no-repeat;
}

.lp-feature h3 {
    margin: 0.8rem 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
}

.lp-feature p {
    margin: 0;
    color: var(--muted-2);
    font-size: 0.9rem;
}

/* platforms */
.lp-section-title {
    margin: 0 0 0.3rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.lp-section-lead {
    margin: 0 0 1.4rem;
    color: var(--muted-2);
}

.lp-platforms {
    padding-bottom: 4rem;
}

.lp-grid {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.75rem;
}

.lp-card {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 0.8rem;
    background: var(--panel);
    transition: border-color 0.15s, box-shadow 0.15s;
}

.lp-card:hover {
    border-color: #cfd4da;
}

.lp-card > [class^="ic-"] {
    width: 2.4rem;
    height: 2.4rem;
    border-radius: 0.6rem;
    background: var(--sidebar);
    -webkit-mask: none;
    mask: none;
    position: relative;
}

.lp-card > [class^="ic-"]::after {
    content: "";
    position: absolute;
    inset: 0.55rem;
    background: var(--ink);
    -webkit-mask: var(--ic) center / contain no-repeat;
    mask: var(--ic) center / contain no-repeat;
}

.lp-card-body {
    min-width: 0;
}

.lp-card-name {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    margin: 0;
    font-size: 0.98rem;
    font-weight: 600;
    white-space: nowrap;
}

.lp-card-detail {
    margin: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.lp-badge {
    display: none;
    padding: 0.05rem 0.45rem;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.68rem;
    font-weight: 600;
}

.lp-card-actions {
    display: flex;
    gap: 0.35rem;
}

.lp-tip {
    position: relative;
    display: inline-flex;
}

.lp-tip::after {
    content: attr(data-tip);
    position: absolute;
    right: 0;
    bottom: calc(100% + 0.45rem);
    z-index: 2;
    padding: 0.3rem 0.55rem;
    border-radius: 0.4rem;
    background: var(--ink);
    color: #fff;
    font-size: 0.76rem;
    font-weight: 500;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    transform: translateY(3px);
    transition: opacity 0.12s, transform 0.12s;
}

.lp-tip:hover::after,
.lp-tip:focus-within::after {
    opacity: 1;
    transform: none;
}

.lp-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2.2rem;
    height: 2.2rem;
    border: 1px solid var(--line);
    border-radius: 0.55rem;
    background: var(--panel);
    color: var(--ink) !important;
    font-size: 1rem;
    text-decoration: none;
}

.lp-icon-btn:hover {
    border-color: var(--muted);
}

.lp-tip.is-primary .lp-icon-btn {
    border-color: var(--ink);
    background: var(--ink);
    color: #fff !important;
}

.lp-tip.is-primary .lp-icon-btn:hover {
    background: #000;
}

.lp-tip .lp-icon-btn.is-soon {
    border-color: var(--line);
    background: var(--sidebar);
    color: var(--muted) !important;
    cursor: default;
}

/* install */
.lp-install {
    padding-bottom: 4rem;
}

.lp-install-grid {
    display: grid;
    gap: 0.75rem;
}

.lp-install-grid .dl-cmd-block {
    margin: 0;
}

.lp-install-grid .dl-cmd-link {
    color: var(--accent);
}

/* footer */
.lp-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 0 0.5rem;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}

.lp-footer .lp-logo {
    font-size: 0.95rem;
}

/* The visitor's platform (set by /landing.js; web when unknown or no JS). */
:root:not([data-os]) .lp-cta[data-for="web"],
[data-os="web"] .lp-cta[data-for="web"],

[data-os="macos"] .lp-cta[data-for="macos"],
[data-os="windows"] .lp-cta[data-for="windows"],
[data-os="linux"] .lp-cta[data-for="linux"],
[data-os="android"] .lp-cta[data-for="android"],
[data-os="ios"] .lp-cta[data-for="ios"] {
    display: inline-flex;
}

[data-os="macos"] .lp-card[data-for="macos"],
[data-os="windows"] .lp-card[data-for="windows"],
[data-os="linux"] .lp-card[data-for="linux"],
[data-os="android"] .lp-card[data-for="android"],
[data-os="ios"] .lp-card[data-for="ios"] {
    order: -1;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}

[data-os="macos"] .lp-card[data-for="macos"] .lp-badge,
[data-os="windows"] .lp-card[data-for="windows"] .lp-badge,
[data-os="linux"] .lp-card[data-for="linux"] .lp-badge,
[data-os="android"] .lp-card[data-for="android"] .lp-badge,
[data-os="ios"] .lp-card[data-for="ios"] .lp-badge {
    display: inline-block;
}

@media (max-width: 900px) {
    .lp-glyphs {
        top: auto;
        height: 22rem;
        width: 100%;
        right: 0;
    }

    .lp-hero {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        padding: 2.5rem 0 3.5rem;
    }

    .lp-features,
    .lp-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .lp-grid {
        grid-template-columns: 1fr;
    }

    .lp-features {
        gap: 1.25rem 1rem;
    }

    .lp-cta {
        width: 100%;
        justify-content: center;
    }
}
