/* lIl1? — Lookalike Spotter */

*, *::before, *::after { box-sizing: border-box; }

:root {
    --bg: #09090b;
    --bg-2: #18181b;
    --bg-3: #27272a;
    --border: #3f3f46;
    --text: #fafafa;
    --text-dim: #a1a1aa;
    --text-mute: #71717a;
    --accent: #10b981;
    --accent-hov: #34d399;
    --unicode: #ff3344;
    --mono: 'JetBrains Mono', ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

html, body {
    margin: 0;
    padding: 0;
    background: var(--bg);
    color: var(--text);
    font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

code {
    font-family: var(--mono);
    background: var(--bg-3);
    padding: 1px 5px;
    border-radius: 4px;
    font-size: 0.9em;
}

.topbar {
    padding: 24px 24px 8px;
    max-width: 1100px;
    margin: 0 auto;
}
.back {
    color: var(--text-mute);
    font-family: var(--mono);
    font-size: 12px;
    letter-spacing: 0.02em;
}
.back:hover { color: var(--text); text-decoration: none; }

.topbar h1 {
    margin: 12px 0 4px;
    font-family: var(--mono);
    font-size: clamp(40px, 6vw, 64px);
    font-weight: 700;
    letter-spacing: -0.01em;
    line-height: 1;
}
.topbar h1 .qmark { color: var(--accent); }
.topbar .sub {
    margin: 8px 0 0;
    color: var(--text-dim);
    font-size: 15px;
    max-width: 720px;
    line-height: 1.55;
}
.topbar .sub em {
    font-family: var(--mono);
    font-style: normal;
    color: var(--text);
}
.topbar .why {
    margin-left: 6px;
    font-size: 12px;
    color: var(--text-mute);
    border-bottom: 1px dotted currentColor;
}
.topbar .why:hover { color: var(--text); text-decoration: none; }

.app {
    max-width: 1100px;
    margin: 0 auto;
    padding: 16px 24px 40px;
}

.lbl {
    font-family: var(--mono);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 10px;
    color: var(--text-mute);
    margin-bottom: 8px;
    display: block;
}

/* input */
.input-block textarea {
    width: 100%;
    min-height: 140px;
    resize: vertical;
    padding: 14px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: var(--mono);
    font-size: 14px;
    line-height: 1.5;
    transition: border-color 0.15s;
}
.input-block textarea:focus {
    outline: none;
    border-color: var(--accent);
}
.input-block textarea::placeholder { color: var(--text-mute); }

/* controls */
.controls {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 20px;
    align-items: center;
    padding: 12px 16px;
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    margin: 16px 0;
    font-size: 13px;
}
.chk {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-dim);
    user-select: none;
}
.chk:hover { color: var(--text); }
.chk input { accent-color: var(--accent); width: 16px; height: 16px; }
.chk .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    display: inline-block;
}
.slider {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--text-dim);
    font-size: 12px;
    font-family: var(--mono);
}
.slider input[type=range] {
    accent-color: var(--accent);
    width: 120px;
}

/* workspace */
.workspace {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 16px;
    align-items: start;
}
@media (max-width: 900px) {
    .workspace { grid-template-columns: 1fr; }
}

/* rendered pane */
.rendered-wrap {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    min-height: 240px;
}
.rendered {
    margin: 0;
    font-family: var(--mono);
    font-size: 18px;
    line-height: 1.55;
    color: var(--text);
    white-space: pre-wrap;
    word-break: break-word;
    overflow-wrap: anywhere;
    min-height: 200px;
}
.rendered:empty::before {
    content: "rendered text will show up here";
    color: var(--text-mute);
    font-style: italic;
}

/* the highlights themselves */
.hl {
    position: relative;
    padding: 1px 2px;
    margin: 0 -1px;
    border-radius: 3px;
    background: color-mix(in srgb, var(--c, #fff) 18%, transparent);
    border-bottom: 2px solid var(--c, #fff);
    cursor: help;
    transition: background 0.1s;
}
.hl:hover {
    background: color-mix(in srgb, var(--c, #fff) 32%, transparent);
}
.hl .lbl-inline {
    font-size: 0.6em;
    vertical-align: super;
    margin-left: 1px;
    color: var(--c, #fff);
    font-weight: 700;
    letter-spacing: 0;
}

/* counts */
.counts {
    background: var(--bg-2);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
    position: sticky;
    top: 16px;
}
.count-list {
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.count-list li {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-dim);
    font-family: var(--mono);
}
.count-list li.empty {
    color: var(--text-mute);
    font-style: italic;
    font-family: inherit;
}
.count-list .dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    flex-shrink: 0;
}
.count-list .num {
    margin-left: auto;
    color: var(--text);
    font-weight: 700;
}

.actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}
.btn {
    appearance: none;
    border: 1px solid var(--border);
    background: var(--bg-3);
    color: var(--text);
    font-family: inherit;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
}
.btn:hover { background: var(--border); }
.copy-status {
    font-size: 11px;
    color: var(--text-mute);
    font-family: var(--mono);
    text-align: center;
    min-height: 14px;
}
.copy-status.is-ok { color: var(--accent); }

/* why */
.why-block {
    margin-top: 40px;
    padding-top: 24px;
    border-top: 1px solid var(--border);
}
.why-block h2 {
    margin: 0 0 8px;
    font-family: var(--mono);
    font-size: 14px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}
.why-block p {
    margin: 0;
    color: var(--text-dim);
    line-height: 1.65;
    max-width: 720px;
}

/* foot */
.foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 24px;
    max-width: 1100px;
    margin: 0 auto;
    color: var(--text-mute);
    font-family: var(--mono);
    font-size: 11px;
    letter-spacing: 0.04em;
}
.bmc-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-mute);
    text-decoration: none;
    transition: color 0.15s;
}
.bmc-link:hover { color: #FFDD00; }
