/*
 * Domain Bot
 *
 * The site shell (driver-shell.css) owns the header, the footer and the page chrome; nothing here restyles them.
 * This sheet is built on the shell's own tokens (ink, paper, line, orange, lime) and adds one colour of its own: the
 * blue-green of a web link, used wherever a domain name or an extension is shown. App containers are deliberately
 * not <section> elements: the shell pads and borders every <section> that is a direct child of .driver-page.
 */

body.domain-bot {
    --dm-ink: var(--driver-ink, #17231e);
    --dm-ink-soft: var(--driver-road, #253832);
    --dm-muted: #58675e;
    --dm-paper: var(--driver-paper, #fffdf8);
    --dm-band: #ebe7dc;
    --dm-line: var(--driver-line, #d8d8cb);
    --dm-orange: var(--driver-orange, #ef6b3c);
    /* The brand orange is too light for small text on paper; this shade keeps it at 4.5:1 or better. */
    --dm-orange-text: #b8400f;
    --dm-lime: var(--driver-lime, #c8f34c);
    --dm-web: #0b5a6f;
    --dm-web-deep: #0a3f4e;
    --dm-web-soft: #e2f0f3;
    --dm-web-line: #a8cdd6;
    --dm-ok: #1b5a25;
    --dm-ok-soft: #e3f3e4;
    --dm-ok-line: #a9d2ad;
    --dm-warn: #5c4300;
    --dm-warn-soft: #fbf1cf;
    --dm-warn-line: #e2c97a;
    --dm-sale: #17357f;
    --dm-sale-soft: #e4ebff;
    --dm-sale-line: #a9bdf2;
    --dm-danger: #8c1d18;
    --dm-danger-soft: #fbe6e3;
    --dm-danger-line: #eab3ad;
    --dm-console: #10211c;
    --dm-control-h: 46px;
    --dm-radius: 4px;
    --dm-gutter: 24px;
    --dm-row: 30px;
    --dm-shadow: 0 10px 22px rgba(23, 35, 30, .08);
    --dm-display: "Barlow Condensed", "Arial Narrow", sans-serif;
    --dm-mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

/* The page wrapper carries the band colour so a short page never shows a seam above the footer. */
body.domain-bot .driver-page {
    flex: 1 0 auto;
    background: var(--dm-band);
}

/* ===================== Hero (closeable, same pattern as the other bot pages) ===================== */
#dmHero {
    position: relative;
    background:
        radial-gradient(circle at 86% 18%, rgba(200, 243, 76, .16) 0%, rgba(200, 243, 76, 0) 40%),
        linear-gradient(135deg, #0c1f1a 0%, #0f3a44 55%, #0e6b80 100%);
}

/* A faint dot grid, like the meridians of a globe. */
#dmHero::before {
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255, 255, 255, .1) 1px, transparent 1.4px);
    background-size: 22px 22px;
    content: "";
    pointer-events: none;
}

#dmHero p {
    color: #fff;
    font-size: 1.25rem;
    font-weight: 400;
    line-height: 1.5;
}

/* A long translation of a badge takes a second line on a phone instead of pushing the page sideways. */
#dmHero .hero-eyebrow,
#dmHero .hero-trust-item {
    display: inline-block;
    max-width: 100%;
    padding: 7px 14px;
    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 50rem;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.2;
    white-space: normal;
}

.dm-steps {
    display: grid;
    gap: 12px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
}

.dm-step {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 20px;
    border: 1px solid rgba(255, 255, 255, .24);
    border-radius: var(--dm-radius);
    background: rgba(255, 255, 255, .1);
}

.dm-step__num {
    display: grid;
    flex: 0 0 44px;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--dm-lime);
    color: var(--dm-ink);
    font-family: var(--dm-display);
    font-size: 24px;
    font-weight: 800;
    line-height: 1;
}

.dm-step__copy {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.dm-step__copy strong {
    color: #fff;
    font-size: 18px;
    line-height: 1.25;
}

.dm-step__copy span {
    color: rgba(255, 255, 255, .88);
    font-size: 16px;
    line-height: 1.4;
}

/* The three steps stand under the intro and the video: one under the other on a phone, side by side from 992px. */
.dm-steps--row {
    margin-top: 28px;
}

@media (min-width: 992px) {
    .dm-steps--row {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .dm-steps--row .dm-step {
        align-items: flex-start;
    }
}

/* ---- The tutorial video. Nothing of it loads until it is played. ---- */
/* One column that is never wider than its place: without the minmax() the longest name in the list of parts (a
   <select> is as wide as its longest option) widened the whole block, and with it the page, on a phone. */
.dm-video {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
    min-width: 0;
    text-align: center;
}

.dm-video__frame {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 12px;
    background: #07231c;
    box-shadow: 0 18px 44px rgba(0, 0, 0, .35);
}

.dm-video__player {
    display: block;
    width: 100%;
    height: 100%;
    background: #07231c;
    object-fit: contain;
}

/* Until the video plays, the whole picture is the button; after that the browser's own controls are there. */
.dm-video__play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    width: 100%;
    margin: 0;
    padding: 0 12px 6%;
    border: 0;
    border-radius: 0;
    background: linear-gradient(180deg, rgba(7, 35, 28, 0) 50%, rgba(7, 35, 28, .5) 100%);
    color: #fff;
    font: inherit;
    cursor: pointer;
}

.dm-video__play[hidden] {
    display: none;
}

.dm-video__pill {
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    gap: 8px;
    max-width: 100%;
    min-height: var(--dm-control-h);
    padding: 6px 22px 6px 14px;
    border-radius: 999px;
    background: var(--dm-orange);
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    line-height: 1.2;
    transition: transform .15s, background-color .15s;
}

.dm-video__pill .bi {
    font-size: 26px;
    line-height: 1;
}

.dm-video__pill-time {
    padding-inline-start: 10px;
    border-inline-start: 1px solid rgba(255, 255, 255, .55);
    font-size: 16px;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.dm-video__pill-time[hidden] {
    display: none;
}

.dm-video__play:hover .dm-video__pill {
    background: #f47d52;
    transform: scale(1.04);
}

.dm-video__play:focus-visible {
    outline: 3px solid var(--dm-lime);
    outline-offset: -5px;
}

/* The captions: two lines are always kept free for them, so the page stands still as they come and go. */
#dmHero .dm-video__caption {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 3.1em;
    margin: 0;
    padding: 0 6px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.5;
    text-wrap: balance;
    unicode-bidi: plaintext;
}

.dm-video__bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 22px;
}

/* The shell gives every label of a page its own line and spacing; inside the intro this one is a switch. */
#dmHero .dm-video__switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: var(--dm-control-h);
    margin: 0;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    cursor: pointer;
}

#dmHero .dm-video__switch input:checked + .dm-switch__track {
    background: var(--dm-lime);
}

#dmHero .dm-video__switch input:checked + .dm-switch__track::after {
    background: var(--dm-ink);
}

.dm-video__chapters {
    min-width: 0;
    max-width: 100%;
    text-overflow: ellipsis;
}

.dm-video__chapters[hidden] {
    display: none;
}

@media (prefers-reduced-motion: reduce) {
    .dm-video__pill {
        transition: none;
    }

    .dm-video__play:hover .dm-video__pill {
        transform: none;
    }
}

.dm-hero-close {
    position: absolute;
    top: 12px;
    right: 16px;
    z-index: 5;
    width: 36px;
    height: 36px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, .15);
    color: #fff;
    font-size: 24px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    transition: background .15s;
}

.dm-hero-close:hover {
    background: rgba(255, 255, 255, .32);
}

.dm-hero-restore {
    position: relative;
    display: none;
    width: 100%;
    padding: 8px 16px;
    border: none;
    background: transparent;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: .02em;
    text-align: center;
    cursor: pointer;
}

.dm-hero-restore::after {
    content: ' \25BE';
    opacity: .85;
}

.dm-hero-restore:hover {
    background: rgba(255, 255, 255, .1);
}

.dm-hero-close:focus-visible,
.dm-hero-restore:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

#dmHero.dm-hero-collapsed {
    padding: 0 !important;
}

#dmHero.dm-hero-collapsed .container,
#dmHero.dm-hero-collapsed .dm-hero-close {
    display: none;
}

#dmHero.dm-hero-collapsed .dm-hero-restore {
    display: block;
}

/* ===================== App shell ===================== */
.dm-app {
    padding-bottom: 36px;
    color: var(--dm-ink);
    font-size: 16px;
    line-height: 1.5;
    text-align: center;
}

/* Short interface copy reads better whole than hyphenated at a line end. */
.dm-app :is(p, span, label, button, a, h2),
#dmHero :is(h1, p, span, a, strong) {
    hyphens: manual;
}


/* ---- Buttons and controls: one height, one radius, one type size ---- */
.dm-btn {
    display: inline-flex;
    box-sizing: border-box;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--dm-control-h);
    margin: 0;
    padding: 0 20px;
    border: 1px solid transparent;
    border-radius: var(--dm-radius);
    font: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color .15s, border-color .15s, color .15s;
}

.dm-btn[hidden] {
    display: none;
}

.dm-btn--primary {
    border-color: var(--dm-orange);
    background: var(--dm-orange);
    color: #fff;
}

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

.dm-btn--outline {
    border-color: var(--dm-ink);
    background: var(--dm-paper);
    color: var(--dm-ink);
}

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

.dm-btn--light {
    border-color: rgba(255, 255, 255, .7);
    background: transparent;
    color: #fff;
}

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

.dm-btn--lime {
    border-color: var(--dm-lime);
    background: var(--dm-lime);
    color: var(--dm-ink);
}

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

.dm-btn--danger:hover {
    border-color: var(--dm-danger);
    background: var(--dm-danger);
    color: #fff;
}

.dm-btn--block {
    width: 100%;
}

.dm-btn--small {
    padding: 0 12px;
}

.dm-btn--icon {
    flex: 0 0 var(--dm-control-h);
    width: var(--dm-control-h);
    padding: 0;
}

.dm-btn--compact {
    height: 40px;
    padding: 0 14px;
    font-size: 15px;
}

.dm-btn:active:not(:disabled) {
    transform: translateY(1px);
}

.dm-btn:disabled {
    opacity: .55;
    cursor: default;
}

.dm-btn:focus-visible,
.dm-control:focus-visible,
.dm-log__view:focus-visible {
    outline: 3px solid var(--dm-orange);
    outline-offset: 2px;
}

.dm-control {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    height: var(--dm-control-h);
    margin: 0;
    padding: 0 14px;
    border: 1px solid var(--dm-line);
    border-radius: var(--dm-radius);
    background-color: #fff;
    color: var(--dm-ink);
    font: inherit;
    font-size: 16px;
    line-height: 1.25;
    text-align: center;
    -webkit-appearance: none;
    appearance: none;
}

.dm-control::placeholder {
    color: #66736b;
    opacity: 1;
}

.dm-control:focus {
    border-color: var(--dm-orange);
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 107, 60, .16);
}

.dm-control[hidden] {
    display: none;
}

.dm-textarea {
    height: auto;
    min-height: 118px;
    padding: 12px 14px;
    font-family: var(--dm-mono);
    line-height: 1.5;
    resize: vertical;
}

.dm-select {
    width: auto;
    padding: 0 40px 0 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='%2317231e' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m3 6 5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 14px;
    font-weight: 600;
    text-align-last: center;
    cursor: pointer;
}

/* ---- Notice: who may use the bot. The bot itself is on the page for everyone. ---- */
.dm-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 18px;
    padding: 12px var(--dm-gutter);
    border-bottom: 1px solid var(--dm-warn-line);
    background: var(--dm-warn-soft);
    color: var(--dm-ink);
}

.dm-notice[hidden] {
    display: none;
}

.dm-notice {
    animation: dmNotice .35s ease both;
}

@keyframes dmNotice {
    from { opacity: 0; transform: translateY(-8px); }
}

.dm-notice__icon {
    display: grid;
    flex: 0 0 auto;
    place-items: center;
    width: var(--dm-control-h);
    height: var(--dm-control-h);
    border-radius: 50%;
    background: var(--dm-paper);
    color: var(--dm-web);
    font-size: 20px;
    line-height: 1;
}

.dm-notice__copy {
    display: grid;
    flex: 0 1 780px;
    gap: 2px;
    min-width: 0;
    margin: 0;
    font-size: 16px;
    line-height: 1.4;
}

.dm-notice__copy strong {
    font-size: 18px;
}

.dm-notice__copy [hidden] {
    display: none;
}

/* ---- Status: what the bot is doing, drawn like a browser's address bar ---- */
.dm-status {
    position: relative;
    /* Keep the shared header's Bots menu above this bar. */
    z-index: 999;
    background: var(--dm-ink);
    color: #fff;
}

@media (min-width: 992px) {
    .dm-status {
        position: sticky;
        top: 0;
    }
}

.dm-status__inner {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 10px 16px;
    padding: 12px var(--dm-gutter);
}

.dm-status__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

/* With no search to pause, resume or cancel the holder takes no room. */
.dm-status__actions:not(:has(> .dm-btn:not([hidden]))) {
    display: none;
}

/*
 * The state of the search ("Searching", "Paused", "Cancelled"): a word, so it is set as a word. It was first drawn as
 * a filled pill, which read as a button to press.
 */
.dm-state {
    color: #fff;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.dm-status[data-state="running"] .dm-state,
.dm-status[data-state="completed"] .dm-state {
    color: var(--dm-lime);
}

.dm-status[data-state="queued"] .dm-state,
.dm-status[data-state="paused"] .dm-state {
    color: #ffd978;
}

.dm-status[data-state="failed"] .dm-state {
    color: #ffb4a8;
}

/*
 * What the bot is doing right now: one line of text in the middle of the bar. It is information, not a field, so it
 * is not drawn like one: no box, no border, no cursor. The dot in front of it beats while a search is being worked on.
 */
.dm-activity {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-width: 0;
    margin: 0;
    padding: 0 8px;
    color: #fff;
    font-size: 17px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
}

.dm-activity__dot {
    flex: 0 0 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .35);
}

.dm-status[data-state="running"] .dm-activity__dot,
.dm-status[data-state="queued"] .dm-activity__dot {
    background: var(--dm-lime);
    animation: dmPulse 1.2s ease-in-out infinite;
}

.dm-status[data-state="completed"] .dm-activity__dot { background: var(--dm-lime); }
.dm-status[data-state="paused"] .dm-activity__dot { background: #ffd978; }
.dm-status[data-state="failed"] .dm-activity__dot { background: #f0aaa2; }

.dm-activity__text {
    min-width: 0;
    overflow-wrap: anywhere;
}

/* A name being checked is set in the type names are set in everywhere on the page, on one line. */
.dm-activity__text[data-literal] {
    overflow: hidden;
    font-family: var(--dm-mono);
    font-weight: 400;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* A domain name reads left to right in every language, also on a page that is laid out right to left. So does an
   extension: without this an Arabic page shows ".com" as "com." */
.dm-activity__text[data-literal],
.dm-chips--tlds .dm-chip span,
.dm-card__name,
.dm-line:not(.dm-line--I) .dm-line__text,
.dm-watch__domain,
#dmEditDomain {
    direction: ltr;
    unicode-bidi: isolate;
}

.dm-counts {
    display: flex;
    align-items: center;
    gap: 18px;
}

.dm-count {
    display: grid;
    justify-items: center;
    gap: 2px;
    line-height: 1.1;
    white-space: nowrap;
}

.dm-count[hidden] {
    display: none;
}

.dm-count strong {
    font-size: 21px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
}

.dm-count span {
    color: rgba(255, 255, 255, .82);
    font-size: 14px;
    font-weight: 600;
}

.dm-count--found strong {
    color: var(--dm-lime);
}

.dm-progress {
    height: 6px;
    background: rgba(255, 255, 255, .14);
    overflow: hidden;
}

.dm-progress__bar {
    display: block;
    width: 0;
    height: 100%;
    background: var(--dm-lime);
    transition: width .6s ease;
}

.dm-status[data-state="running"] .dm-progress__bar,
.dm-status[data-state="queued"] .dm-progress__bar {
    background-image: linear-gradient(90deg, var(--dm-lime) 0%, #efffb0 50%, var(--dm-lime) 100%);
    background-size: 200% 100%;
    animation: dmFlow 1.6s linear infinite;
}

/* Before the first name is checked there is nothing to measure yet: the bar sweeps instead. */
.dm-status[data-state="queued"] .dm-progress__bar,
.dm-status[data-phase="keywords"][data-state="running"] .dm-progress__bar {
    width: 30% !important;
    animation: dmSweep 1.4s ease-in-out infinite;
}

@keyframes dmFlow {
    from { background-position: 200% 0; }
    to { background-position: 0 0; }
}

@keyframes dmSweep {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(340%); }
}

/* ---- Layout: setup, results and log side by side when there is room ---- */
.dm-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
    width: calc(100% - 2 * var(--dm-gutter));
    margin: 16px auto 0;
}

.dm-panel {
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-paper);
    box-shadow: var(--dm-shadow);
    overflow: hidden;
}

.dm-panel__head {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 16px;
    background: var(--dm-web-deep);
}

.dm-app .dm-panel__title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    color: #fff;
    font-size: 24px;
    letter-spacing: .02em;
    line-height: 1;
    text-transform: uppercase;
}

.dm-panel__title i {
    color: var(--dm-lime);
    font-size: 18px;
}

.dm-badge {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 26px;
    padding: 0 9px;
    border-radius: 999px;
    background: var(--dm-lime);
    color: var(--dm-ink);
    font-size: 15px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
}

.dm-panel__body {
    flex: 1 1 auto;
    min-height: 0;
    padding: 16px;
}

.dm-results {
    min-height: 420px;
    max-height: 78vh;
}

.dm-log {
    height: 420px;
}

/*
 * Where there is room, the setup lies across the top with its groups side by side, and the names and the log share
 * the row under it. That row is as tall as the window allows, so a running search can be watched without scrolling:
 * both panels scroll inside.
 */
@media (min-width: 1040px) {
    .dm-layout {
        grid-template-columns: minmax(0, 1fr) minmax(340px, 34%);
        grid-template-rows: auto clamp(520px, calc(100vh - 150px), 860px) auto auto;
        grid-template-areas:
            "setup setup"
            "results log"
            "history history"
            "watch watch";
    }

    .dm-setup { grid-area: setup; }
    .dm-results { grid-area: results; }
    .dm-log { grid-area: log; }
    .dm-history { grid-area: history; }
    .dm-watch { grid-area: watch; }

    .dm-results,
    .dm-log {
        height: auto;
        min-height: 0;
        max-height: none;
    }
}

/* A panel the script has just filled in again (a search opened from the history) glows once. */
.dm-panel.is-restored {
    animation: dmRestored 1.2s ease both;
}

@keyframes dmRestored {
    0%, 35% { box-shadow: 0 0 0 4px var(--dm-lime), var(--dm-shadow); }
    100% { box-shadow: 0 0 0 0 rgba(200, 243, 76, 0), var(--dm-shadow); }
}

/* The page stops under the bar that stays at the top of the window, not behind it. */
.dm-setup,
.dm-results {
    scroll-margin-top: 12px;
}

@media (min-width: 992px) {
    .dm-setup,
    .dm-results {
        scroll-margin-top: 96px;
    }
}

/* ---- Search setup ---- */
.dm-form {
    display: grid;
    align-content: start;
    gap: 16px;
}

.dm-form__cols {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 16px 24px;
}

.dm-form__col {
    display: flex;
    flex-direction: column;
    gap: 16px;
    min-width: 0;
}

@media (min-width: 700px) {
    .dm-form__cols {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        grid-template-areas:
            "ideas sources"
            "rules tlds";
    }

    .dm-form__col--ideas { grid-area: ideas; }
    .dm-form__col--sources { grid-area: sources; }
    .dm-form__col--rules { grid-area: rules; }
    .dm-form__col--tlds { grid-area: tlds; }

    /* Side by side, the boxes for long text and for lists take the height their column has left over. */
    .dm-form__col > .dm-field--fill {
        display: flex;
        flex: 1 1 auto;
        flex-direction: column;
    }

    .dm-app .dm-form__col > .dm-field--fill > .dm-textarea {
        flex: 1 1 auto;
    }

    /* A list counts as its smallest height when the row is measured, and is then given what is left; it scrolls inside. */
    .dm-form__col > .dm-field--fill > .dm-chips {
        flex: 1 1 auto;
        height: 0;
        min-height: 132px;
        max-height: none;
    }

    .dm-form__col--rules {
        justify-content: space-between;
    }
}

@media (min-width: 1040px) {
    .dm-form__cols {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-template-areas:
            "ideas sources tlds"
            "rules sources tlds";
    }
}

@media (min-width: 1360px) {
    .dm-form__cols {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        grid-template-areas: "ideas sources rules tlds";
    }
}

/* The size of the search and the button that starts it, under all the groups. */
.dm-form__foot {
    display: grid;
    justify-items: center;
    gap: 10px;
    padding-top: 16px;
    border-top: 1px solid var(--dm-line);
}

.dm-form__foot > * {
    width: min(100%, 460px);
}

.dm-form__foot > .dm-form-msg {
    width: min(100%, 720px);
}

.dm-field {
    display: grid;
    gap: 6px;
    min-width: 0;
}

.dm-app .dm-label {
    display: block;
    margin: 0;
    color: var(--dm-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
    text-align: center;
}

.dm-label-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: center;
    gap: 4px 10px;
}

.dm-tally {
    color: var(--dm-web);
    font-size: 14px;
    font-weight: 700;
}

.dm-hint {
    margin: 0;
    color: var(--dm-muted);
    font-size: 14px;
    line-height: 1.45;
}

/* Three buttons in a row; a language whose words are longer gets a second row. */
.dm-trio {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.dm-trio > .dm-btn {
    flex: 1 1 auto;
    min-width: max-content;
}

.dm-app .dm-textarea--short {
    min-height: 84px;
}

/* Length rules: what is measured, and under it the fewest and the most. Two of them fit side by side in a wide column. */
.dm-lengths {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(164px, 1fr));
    gap: 12px;
}

.dm-length {
    display: grid;
    justify-items: center;
    gap: 6px;
    min-width: 0;
}

.dm-range {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.dm-app .dm-number {
    width: 72px;
    padding: 0 6px;
    font-family: var(--dm-mono);
    text-align: center;
    -moz-appearance: textfield;
    appearance: textfield;
}

.dm-number::-webkit-outer-spin-button,
.dm-number::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.dm-range__to {
    color: var(--dm-muted);
    font-size: 15px;
}

/* Switches stand under each other with their tracks in line, as one block in the middle; side by side where both fit. */
.dm-switches {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 236px), max-content));
    justify-content: center;
    gap: 2px 28px;
}

.dm-app .dm-switch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    min-height: var(--dm-control-h);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    text-align: start;
    cursor: pointer;
}

.dm-switch input,
.dm-segment input,
.dm-chip input {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: 0;
    opacity: 0;
    pointer-events: none;
}

.dm-switch__track {
    position: relative;
    flex: 0 0 46px;
    width: 46px;
    height: 26px;
    border-radius: 999px;
    background: #aab2a8;
    transition: background-color .15s;
}

.dm-switch__track::after {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 3px rgba(23, 35, 30, .35);
    content: "";
    transition: transform .15s;
}

.dm-switch input:checked + .dm-switch__track {
    background: var(--dm-web);
}

.dm-switch input:checked + .dm-switch__track::after {
    transform: translateX(20px);
}

.dm-switch input:focus-visible + .dm-switch__track,
.dm-segment input:focus-visible + span,
.dm-chip input:focus-visible + span {
    outline: 3px solid var(--dm-orange);
    outline-offset: 2px;
}

.dm-switch input:disabled + .dm-switch__track {
    opacity: .5;
}

/* The examples a switch gives for what it is about, "(é, ö, ñ)": one piece, never broken over two lines (on a narrow
   phone it was, in six languages), the same in every language, and read left to right on a page laid out right to left. */
.dm-switch__eg {
    direction: ltr;
    unicode-bidi: isolate;
    white-space: nowrap;
}

.dm-switch__count {
    display: inline-grid;
    place-items: center;
    min-width: 28px;
    height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--dm-band);
    color: var(--dm-ink);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 800;
    line-height: 1;
}

.dm-segments {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--dm-line);
    border-radius: var(--dm-radius);
    background: #fff;
    overflow: hidden;
}

.dm-app .dm-segment {
    position: relative;
    display: block;
    margin: 0;
    cursor: pointer;
}

.dm-segment + .dm-segment {
    border-left: 1px solid var(--dm-line);
}

.dm-segment span {
    display: grid;
    place-items: center;
    height: calc(var(--dm-control-h) - 2px);
    font-size: 17px;
    font-weight: 700;
    transition: background-color .15s, color .15s;
}

.dm-segment input:checked + span {
    background: var(--dm-ink);
    color: #fff;
}

/* Extensions and languages: pills that are checked like boxes. */
.dm-chips {
    display: flex;
    flex-wrap: wrap;
    align-content: flex-start;
    justify-content: center;
    gap: 6px;
    max-height: 204px;
    padding: 8px;
    border: 1px solid var(--dm-line);
    border-radius: var(--dm-radius);
    background: #fff;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dm-chips--languages {
    max-height: 170px;
}

.dm-chips__group {
    flex: 1 0 100%;
    margin: 4px 0 0;
    color: var(--dm-muted);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .06em;
    line-height: 1.3;
    text-transform: uppercase;
}

.dm-chips__group[hidden],
.dm-chip[hidden] {
    display: none;
}

.dm-app .dm-chip {
    position: relative;
    display: inline-flex;
    margin: 0;
    cursor: pointer;
}

.dm-chip span {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--dm-line);
    border-radius: 999px;
    background: var(--dm-paper);
    color: var(--dm-ink);
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    transition: background-color .12s, border-color .12s, color .12s;
}

.dm-chips--tlds .dm-chip span {
    font-family: var(--dm-mono);
}

.dm-chip:hover span {
    border-color: var(--dm-web);
}

.dm-chip input:checked + span {
    border-color: var(--dm-web);
    background: var(--dm-web);
    color: #fff;
}

.dm-estimate {
    min-height: 21px;
    margin: 0;
    color: var(--dm-web-deep);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.45;
}

.dm-estimate:empty {
    display: none;
}

.dm-form-msg {
    margin: 0;
    padding: 10px 12px;
    border: 1px solid var(--dm-danger-line);
    border-radius: var(--dm-radius);
    background: var(--dm-danger-soft);
    color: var(--dm-danger);
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.dm-form-msg[hidden] {
    display: none;
}

.dm-form-msg--ok {
    border-color: var(--dm-ok-line);
    background: var(--dm-ok-soft);
    color: var(--dm-ok);
}

/* ---- Results ---- */
.dm-toolbar {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 16px 0;
}

.dm-toolbar__filter {
    flex: 1 1 170px;
    width: auto;
}

.dm-toggles {
    display: flex;
    flex: 0 0 auto;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0 22px;
    padding: 4px 16px 0;
}

/* ---- Recent searches ---- */
.dm-history__body {
    text-align: center;
}

/* What the list is, and the button that empties it. */
.dm-history__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 10px 20px;
    margin-bottom: 12px;
}

.dm-history__intro {
    flex: 0 1 72ch;
    margin: 0;
}

.dm-history__intro:empty {
    display: none;
}

.dm-history__list {
    display: grid;
    gap: 8px;
    max-height: 432px;
    padding: 2px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.dm-history__list:empty {
    display: none;
}

.dm-history .dm-history__empty {
    margin: 0 auto;
}

.dm-history__empty[hidden] {
    display: none;
}

/* One search: the line opens it again, the button at its end deletes it. */
.dm-history-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: stretch;
    border: 1px solid var(--dm-line);
    border-radius: var(--dm-radius);
    background: #fff;
    overflow: hidden;
    transition: border-color .15s, box-shadow .15s, background-color .15s;
}

.dm-history-row:hover,
.dm-history-row:focus-within {
    border-color: var(--dm-web);
    box-shadow: 0 6px 16px rgba(11, 90, 111, .14);
}

.dm-history-row.is-new {
    animation: dmFound .9s ease both;
}

/* The search that is on screen. */
.dm-history-row.is-current {
    border-color: var(--dm-web);
    background: var(--dm-web-soft);
    box-shadow: inset 5px 0 0 var(--dm-lime);
}

.dm-history-row__open {
    display: grid;
    grid-template-columns: minmax(140px, max-content) minmax(0, 1fr) max-content minmax(104px, max-content);
    align-items: center;
    gap: 6px 20px;
    min-width: 0;
    min-height: var(--dm-control-h);
    margin: 0;
    padding: 9px 16px;
    border: 0;
    background: transparent;
    color: var(--dm-ink);
    font: inherit;
    font-size: 15px;
    line-height: 1.35;
    text-align: start;
    cursor: pointer;
}

.dm-history-row__open:focus-visible {
    outline: 3px solid var(--dm-orange);
    outline-offset: -3px;
}

/* A search that is being worked on has no delete button: its line takes the whole row, and keeps the room the
   button has in the other rows so that every row's columns line up. */
.dm-history-row__open:only-child {
    grid-column: 1 / -1;
}

@media (min-width: 576px) {
    .dm-history-row__open:only-child {
        padding-inline-end: calc(16px + var(--dm-control-h) + 16px);
    }
}

.dm-app .dm-history-row__delete {
    align-self: center;
    width: var(--dm-control-h);
    margin: 0 8px;
    padding: 0;
    border-color: transparent;
    background: transparent;
    color: var(--dm-muted);
}

.dm-app .dm-history-row__delete:hover,
.dm-app .dm-history-row__delete:focus-visible {
    border-color: var(--dm-danger);
    background: var(--dm-danger);
    color: #fff;
}

.dm-history-row__when {
    color: var(--dm-muted);
    font-variant-numeric: tabular-nums;
}

.dm-history-row__main {
    display: grid;
    gap: 1px;
    min-width: 0;
}

.dm-history-row__what {
    overflow: hidden;
    font-size: 16px;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-history-row__facts {
    overflow: hidden;
    color: var(--dm-muted);
    font-size: 14px;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.dm-history-row__numbers {
    color: var(--dm-muted);
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.dm-history-row__numbers strong {
    color: var(--dm-ink);
}

.dm-history-row__open .dm-tag {
    justify-self: end;
}

/* A narrower panel: what and how it went on the first line, when and the numbers on the second. */
@media (min-width: 576px) and (max-width: 899.98px) {
    .dm-history-row__open {
        grid-template-columns: minmax(0, 1fr) max-content;
        grid-template-areas:
            "main tag"
            "when numbers";
    }

    .dm-history-row__main { grid-area: main; }
    .dm-history-row__open .dm-tag { grid-area: tag; }
    .dm-history-row__when { grid-area: when; }
    .dm-history-row__numbers { grid-area: numbers; justify-self: end; }
}

/* A phone: one thing per line, in the middle, and the delete button under them. */
@media (max-width: 575.98px) {
    .dm-history-row {
        grid-template-columns: minmax(0, 1fr);
    }

    .dm-history-row__open {
        grid-template-columns: minmax(0, 1fr);
        justify-items: center;
        gap: 4px;
        padding: 12px;
        text-align: center;
    }

    .dm-history-row__open > *,
    .dm-history-row__open .dm-tag {
        justify-self: center;
        max-width: 100%;
    }

    .dm-history-row__what,
    .dm-history-row__facts,
    .dm-history-row__numbers {
        white-space: normal;
    }

    .dm-app .dm-history-row__delete {
        justify-self: center;
        margin: 0 0 10px;
    }
}

/* The page keeps the reader's place in this list itself (readingPlace and returnTo in domain-bot.js), the same way in
   every browser: Safari has no scroll anchoring of its own, and two that both correct would correct twice. */
.dm-results__body {
    /* The cards' places are counted from this box (offsetTop), so it is their reference. */
    position: relative;
    padding-top: 12px;
    overflow-y: auto;
    overflow-anchor: none;
    overscroll-behavior: contain;
}

/*
 * Name cards (results and the watch list) follow the homepage's "Pick Your Bot" grid: every card in a list has the
 * same width, rows are as full as the panel allows, and a last row that is not full sits in the middle. The number
 * of cards per row follows the width of the panel they are in, not of the window.
 */
.dm-results__body,
.dm-watch__body {
    container-type: inline-size;
}

.dm-cards,
.dm-watch__list {
    --dm-per-row: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.dm-cards:empty,
.dm-watch__list:empty {
    display: none;
}

.dm-card,
.dm-watch-card {
    display: flex;
    flex: 0 0 calc((100% - (var(--dm-per-row) - 1) * 10px) / var(--dm-per-row));
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 14px 12px;
    border: 1px solid var(--dm-line);
    border-radius: var(--dm-radius);
    background: #fff;
}

/* Cards in a row are the same height; their buttons line up along the bottom whatever is written above. */
.dm-card .dm-card__actions,
.dm-watch-card .dm-card__actions {
    margin-top: auto;
    padding-top: 4px;
}

@container (min-width: 520px) { .dm-cards { --dm-per-row: 2; } }
@container (min-width: 800px) { .dm-cards { --dm-per-row: 3; } }
@container (min-width: 1100px) { .dm-cards { --dm-per-row: 4; } }
@container (min-width: 1400px) { .dm-cards { --dm-per-row: 5; } }

@container (min-width: 700px) { .dm-watch__list { --dm-per-row: 2; } }
@container (min-width: 1050px) { .dm-watch__list { --dm-per-row: 3; } }
@container (min-width: 1400px) { .dm-watch__list { --dm-per-row: 4; } }
@container (min-width: 1750px) { .dm-watch__list { --dm-per-row: 5; } }

.dm-card {
    transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.dm-card:hover,
.dm-card:focus-within {
    border-color: var(--dm-web);
    box-shadow: 0 10px 24px rgba(23, 35, 30, .12);
    transform: translateY(-2px);
}

/* A name that has just been found arrives with a short flash, so new finds catch the eye without moving the rest. */
.dm-card.is-new {
    animation: dmFound .9s ease both;
}

@keyframes dmFound {
    0% { opacity: 0; transform: translateY(10px); box-shadow: 0 0 0 4px var(--dm-lime); }
    45% { opacity: 1; transform: none; box-shadow: 0 0 0 4px var(--dm-lime); }
    100% { box-shadow: 0 0 0 0 rgba(200, 243, 76, 0); }
}

/* A card knows its own width, so the name on it can be set as large as fits. */
.dm-card,
.dm-watch-card {
    container-type: inline-size;
}

/* The name is as large as lets it stand on one line of its card (the extension may take the next line): 18px, and
   for a long name less, down to 14px. The script says how many characters the name has (--dm-chars); a character of
   this typeface is about .62 of the type size wide, and the card keeps 14px free on each side. Until 2026-11-28 every
   name was 18px, and one of 23 to 25 characters, which is what a search finds by default, was broken one letter
   before its end ("containergardeningintexa", then "s.com"). A name too long even at 14px breaks in its middle,
   where the script marks it, and not wherever the line happens to end. */
.dm-card__name {
    max-width: 100%;
    font-family: var(--dm-mono);
    font-size: 18px;
    font-size: clamp(14px, calc((100cqi - 28px) / (var(--dm-chars, 16) * .62)), 18px);
    font-weight: 700;
    line-height: 1.25;
    overflow-wrap: break-word;
}

/* The extension stays in one piece: a name too long for its card breaks before the dot, never inside ".com". */
.dm-card__tld {
    display: inline-block;
    max-width: 100%;
    color: var(--dm-web);
}

.dm-tag {
    display: inline-block;
    max-width: 100%;
    padding: 4px 10px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
}

.dm-tag--available { border-color: var(--dm-ok-line); background: var(--dm-ok-soft); color: var(--dm-ok); }
.dm-tag--premium { border-color: var(--dm-warn-line); background: var(--dm-warn-soft); color: var(--dm-warn); }
.dm-tag--forsale { border-color: var(--dm-sale-line); background: var(--dm-sale-soft); color: var(--dm-sale); }
.dm-tag--neutral { border-color: var(--dm-line); background: var(--dm-band); color: var(--dm-ink); }
.dm-tag--alert { border-color: var(--dm-danger-line); background: var(--dm-danger-soft); color: var(--dm-danger); }

.dm-card__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 6px;
}

.dm-empty {
    display: grid;
    justify-items: center;
    gap: 6px;
    padding: 36px 12px;
}

.dm-empty[hidden] {
    display: none;
}

.dm-empty__icon {
    color: var(--dm-web);
    font-size: 46px;
    line-height: 1;
}

.dm-empty__title {
    margin: 0;
    font-size: 21px;
    font-weight: 700;
    line-height: 1.25;
}

.dm-empty__text {
    max-width: 52ch;
    margin: 0;
    color: var(--dm-muted);
    font-size: 16px;
    line-height: 1.5;
}

#dmResultMore {
    margin-top: 12px;
}

/* ---- Activity log: a console ---- */
.dm-live {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--dm-lime);
    font-size: 14px;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.dm-live[hidden] {
    display: none;
}

.dm-live__dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--dm-lime);
    animation: dmPulse 1.2s ease-in-out infinite;
}

@keyframes dmPulse {
    50% { opacity: .25; transform: scale(.7); }
}

.dm-find {
    padding-bottom: 12px;
}

.dm-find__count {
    min-width: 62px;
    color: var(--dm-muted);
    font-size: 14px;
    font-variant-numeric: tabular-nums;
    font-weight: 700;
    white-space: nowrap;
}

.dm-find__count:empty {
    display: none;
}

.dm-log__body {
    position: relative;
    display: flex;
    padding: 0;
    background: var(--dm-console);
}

.dm-log__view {
    flex: 1 1 auto;
    min-height: 0;
    color: #e8efe6;
    font-family: var(--dm-mono);
    font-size: 14px;
    line-height: var(--dm-row);
    text-align: left;
    /* Down through the lines, and sideways along a line that is longer than the panel: no line is cut off. */
    overflow: auto;
    overscroll-behavior: contain;
    scrollbar-color: rgba(200, 243, 76, .7) rgba(255, 255, 255, .08);
}

/* The bar that moves the log sideways is always drawn when a line is longer than the panel (a browser's own bar
   hides until it is used), so a line that runs past the edge is seen to go on. */
.dm-log__view::-webkit-scrollbar {
    width: 12px;
    height: 12px;
}

.dm-log__view::-webkit-scrollbar-track,
.dm-log__view::-webkit-scrollbar-corner {
    background: rgba(255, 255, 255, .08);
}

.dm-log__view::-webkit-scrollbar-thumb {
    border: 2px solid transparent;
    border-radius: 999px;
    background: rgba(200, 243, 76, .7);
    background-clip: content-box;
}

.dm-log__view:focus-visible {
    outline-offset: -3px;
}

.dm-log__space {
    position: relative;
    min-height: 100%;
}

.dm-log__rows {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
}

.dm-line {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    width: max-content;
    min-width: 100%;
    height: var(--dm-row);
    padding: 0 14px;
    white-space: nowrap;
}

.dm-line__mark {
    flex: 0 0 16px;
    text-align: center;
}

.dm-line__text {
    flex: 0 0 auto;
}

.dm-line__tag {
    flex: 0 0 auto;
    opacity: .92;
}

.dm-line--T { color: #9fb2a7; }
.dm-line--A { color: var(--dm-lime); font-weight: 700; }
.dm-line--P { color: #ffd978; font-weight: 700; }
.dm-line--S { color: #b4c9ff; }
.dm-line--R,
.dm-line--U { color: #f0aaa2; }
.dm-line--W,
.dm-line--X { color: #c9a98f; }
.dm-line--I { color: #fff; font-weight: 700; }
.dm-line--K { color: #8fdcf0; }
.dm-line--wait { color: #6f8279; }

.dm-line.is-new {
    animation: dmLine .35s ease both;
}

@keyframes dmLine {
    from { opacity: 0; transform: translateX(-8px); }
    to { opacity: 1; transform: none; }
}

.dm-line.is-match {
    background: rgba(239, 107, 60, .34);
}

.dm-line mark {
    padding: 0 1px;
    border-radius: 2px;
    background: var(--dm-lime);
    color: var(--dm-ink);
}

.dm-empty--log {
    position: absolute;
    inset: 0;
    align-content: center;
    pointer-events: none;
}

.dm-empty--log .dm-empty__text {
    color: #b9c7be;
}

/* The newest line is at the top; this takes a reader who has scrolled down back up to it. */
.dm-log__latest {
    position: absolute;
    top: 14px;
    right: 16px;
    height: 40px;
    padding: 0 14px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, .4);
}

/* ---- Watch list ---- */
.dm-watch__intro {
    max-width: 78ch;
    margin: 0 auto 12px;
    font-size: 16px;
}

.dm-watch__form {
    display: grid;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr) auto;
    gap: 8px;
    max-width: 980px;
    margin: 0 auto;
}

.dm-watch__domain,
#dmEditDomain {
    font-family: var(--dm-mono);
}

#dmWatchMsg {
    max-width: 980px;
    margin: 10px auto 0;
}

.dm-watch__list {
    margin-top: 14px;
}

.dm-watch__empty {
    max-width: none;
    margin-top: 14px;
}

.dm-watch__empty[hidden] {
    display: none;
}

.dm-watch-card.is-available {
    border-color: var(--dm-ok);
    background: var(--dm-ok-soft);
    box-shadow: 0 0 0 3px var(--dm-lime);
}

.dm-watch-card.is-off {
    background: var(--dm-paper);
    opacity: .78;
}

.dm-watch-card__facts {
    margin: 0;
    color: var(--dm-muted);
    font-size: 14px;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.dm-watch-card__note {
    margin: 0;
    color: var(--dm-ink);
    font-size: 15px;
    font-style: italic;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

/* ===================== Dialog ===================== */
.dm-modal .modal-content {
    border: 1px solid var(--dm-line);
    border-radius: 6px;
    background: var(--dm-paper);
    color: var(--dm-ink);
    font-size: 16px;
    text-align: center;
}

.dm-modal .modal-header {
    gap: 12px;
    padding: 16px 20px;
    border-bottom: 1px solid var(--dm-line);
}

.dm-modal .modal-title {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
    /* Balance the close button so the title sits on the dialog's centre line. */
    padding-left: 32px;
    font-size: 28px;
    line-height: 1.1;
    overflow-wrap: anywhere;
}

.dm-modal .modal-body {
    padding: 20px;
}

.dm-modal form {
    display: grid;
    gap: 14px;
}

.dm-modal .dm-label,
.dm-modal .dm-switch {
    color: var(--dm-ink);
}

.dm-modal .dm-label {
    display: block;
    margin: 0;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
}

.dm-modal .dm-switch {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: var(--dm-control-h);
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
}

/* ===================== Smaller screens ===================== */
@media (max-width: 991.98px) {
    .dm-status__inner {
        grid-template-columns: auto minmax(0, 1fr);
        grid-template-areas:
            "state counts"
            "address address"
            "actions actions";
    }

    .dm-state { grid-area: state; justify-self: start; }
    /* The counts never leave their own cell: when a language's words are long they take a second line there. Without
       the wrap they ran out of the cell to the left, under the state. */
    .dm-counts { grid-area: counts; flex-wrap: wrap; justify-content: flex-end; min-width: 0; }
    .dm-activity { grid-area: address; }
    .dm-status__actions { grid-area: actions; }
    /* Side by side while both fit; a language with longer words gets a row for each. */
    .dm-status__actions .dm-btn { flex: 1 1 140px; min-width: max-content; }
}

@media (max-width: 767.98px) {
    body.domain-bot {
        --dm-gutter: 16px;
    }

    .dm-watch__form {
        grid-template-columns: minmax(0, 1fr);
    }

    .dm-results {
        max-height: none;
    }

    .dm-results__body {
        max-height: 70vh;
    }
}

@media (max-width: 575.98px) {
    /* A phone has no room for the state beside three counts (a running search shows "1,466 / 28,830" and the time
       left), so each has a row of its own, in every state: the bar does not change shape while a search runs. */
    .dm-status__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "state"
            "counts"
            "address"
            "actions";
    }

    .dm-state {
        justify-self: center;
    }

    .dm-counts {
        justify-content: center;
        gap: 8px 12px;
    }

    .dm-count strong {
        font-size: 18px;
    }

    .dm-toolbar .dm-select,
    .dm-toolbar .dm-btn:not(.dm-btn--icon) {
        flex: 1 1 100%;
        width: 100%;
    }

    .dm-app .dm-panel__title {
        font-size: 22px;
    }

    .dm-modal .modal-title {
        font-size: 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .dm-card,
    .dm-history-row,
    .dm-progress__bar,
    .dm-switch__track,
    .dm-switch__track::after {
        transition: none;
    }

    .dm-card:hover,
    .dm-card:focus-within,
    .dm-history-row:active,
    .dm-btn:active:not(:disabled) {
        transform: none;
    }

    .dm-card.is-new,
    .dm-line.is-new,
    .dm-panel.is-restored,
    .dm-history-row.is-new,
    .dm-notice,
    .dm-live__dot,
    .dm-activity__dot,
    .dm-status[data-state="running"] .dm-progress__bar,
    .dm-status[data-state="queued"] .dm-progress__bar,
    .dm-status[data-phase="keywords"][data-state="running"] .dm-progress__bar {
        animation: none;
    }
}
