/* Horizontal page gutter shared by the fixed top nav and the content
   container so their left/right edges always line up. */
:root {
    --page-gutter: 16px;          /* desktop */
    --page-gutter-mobile: 8px;    /* phones and tablets, both sides of the content */

    /* Layout sizes to tune. */
    /* Fixed top bar height. */
    --nav-height: 42px;          /* desktop menu */
    --nav-height-mobile: 52px;   /* bar on phones and tablets */
    /* Corner rounding: --radius on cards, tables, inputs, buttons and other
       containers; --radius-sm on the badges, tiles and chips inside them. */
    --radius: 6px;
    --radius-sm: 4px;
    /* The six summary cards under the top bar (home, Blocks, Payments, Your
       Stats). The scale sizes their text and icon (1 = default, 0.8 = 20%
       smaller, 1.2 = 20% bigger); the card keeps its width, and its padding
       is set separately. Phones show the same cards, two per row. */
    --summary-card-scale: 1;
    --summary-card-padding: 6px;
    --summary-card-icon-size: 20px;  /* before the scale */
    /* Space above the card row (the gap under the top bar, on every page)
       and between the row and whatever follows it. */
    --summary-card-spacing: 6px;

    /* Derived from the sizes above. */
    --nav-offset: calc(var(--nav-height) + var(--summary-card-spacing));
    --nav-offset-mobile: calc(var(--nav-height-mobile) + var(--summary-card-spacing));

    /* Colors the same in both themes (dark.css / light.css hold the rest). */
    --on-accent: #fff;  /* text and icons on an accent fill */
    /* How to Mine's step seals: a gradient, see-through inside a thin
       border of it. */
    --step-seal-from: #a26cff;
    --step-seal-to: #3cc8ff;
    --step-seal-fill-opacity: .6;
    --discord: #5865f2;
    --code-block-background: #20232a;  /* command blocks, dark in both themes */
    --code-block-text: #fff;
    --code-block-highlight: #f39c12;  /* a value to fill in, on a command block */
    --font-mono: Consolas, Monaco, 'Lucida Console', monospace;
}

/* Once a grid stacks on mobile there is no neighbouring column to gutter
   against, so semantic.css drops the columns' side padding. Basic segments are
   panels too (.ui.segment gives every segment the panel background), so they
   keep a slim side padding: text must not touch the panel edge. */
@media only screen and (max-width: 767px) {
    .ui.basic.segment {
        padding-left: 10px;
        padding-right: 10px;
    }
}

/* The theme switch fades. The page scrolls as the document, not inside a box
   of its own: that is the scroll Chrome's pull-to-refresh and URL bar follow,
   from the fixed bar as much as from the content. The vertical scrollbar is
   always there, so pages of different heights don't shift sideways. */
body {
    transition: background-color 0.3s ease, color 0.3s ease;
    overflow-y: scroll;
}

/* ...and its gutter stays while a modal or the sidebar locks the scroll. */
html {
    scrollbar-gutter: stable;
}

/* The top bar's dropdowns sit on the bar unboxed. */
.ui.dropdown.no-border {
    border: none;
}

#root {
    padding-bottom: 38px;
}

.desktop {
    width: 100%;
    max-width: 1268px;
    /* Maximum width for large screens */
    margin: 0 auto;
    /* Center the container */
    padding: var(--nav-offset) var(--page-gutter) 0 var(--page-gutter);
    /* Top offset clears the fixed menu; sides keep content off the viewport edges */
}

.primary-text {
    color: var(--primary-text-color);
}

.blue-text {
    color: var(--stat-blue);
}

.green-text {
    color: var(--stat-green);
}

.error-text {
    color: var(--effort-critical-color);
}

.pink-text {
    color: var(--stat-pink);
}

/* A page that is only a message, centred under the menu: 404, or pool stats
   that won't load (StatsLoading, whose spinner takes the theme's colours). */
.page-message {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 88vh;
    text-align: center;
}

.page-message .error-text {
    font-size: 18px;
}

.page-message .ui.button {
    margin-top: 1rem;
}

.page-message .ui.loader {
    margin-bottom: 1rem;
}

.page-message .ui.loader:before {
    border-color: var(--border-color);
}

.page-message .ui.loader:after {
    border-top-color: var(--stat-blue);
}

/* Data tables, a touch smaller than Semantic's text (outranking its
   .ui.table size). */
.ui.table.data-table {
    font-size: 98%;
}

/* Flex container */
.flex {
    display: flex;
}

/* Flex direction */
.flex-row {
    flex-direction: row;
}

.flex-col {
    flex-direction: column;
}

.items-center {
    align-items: center;
}

.gap-3 {
    gap: 0.75rem;
}

/* Spacing */
.pb-8 {
    padding-bottom: 8px;
}

.mt-12 {
    margin-top: 12px;
}

.ml-8 {
    margin-left: 8px;
}

.my-16 {
    margin-top: 16px;
    margin-bottom: 16px;
}

/* Support's text, a touch larger (outranking Semantic's .ui.segment size). */
.ui.segment.help {
    font-size: 105%;
}

.help h4 {
    margin-bottom: 6px;
}

/* A first heading keeps Semantic's flush top. */
.help h4:not(:first-child) {
    margin-top: 18px;
}

/* Command blocks, How to Mine's (CopyableCode) and a guide's: dark in both
   themes, copied on click. */
.code-block,
.guide pre {
    background: var(--code-block-background);
    color: var(--code-block-text);
    padding: 8px;
    border-radius: var(--radius);
    overflow-x: auto;
    cursor: pointer;
}

/* A pool guide (src/utils/guides.js): Markdown prose across the page's
   full-width card, like the FAQ's. */
.guide {
    font-size: 105%;
    margin: 0.5em 0;
}

.guide p,
.guide li {
    line-height: 1.6;
}

.guide li + li {
    margin-top: 4px;
}

.guide h1 {
    font-size: 1.71428571rem;
    line-height: 1.28571429em;
    margin: 0 0 4px;
}

/* The line under the title: who it is for and when it was checked. */
.guide h1 + p {
    color: var(--secondary-text-color);
}

/* Highlighted as on How to Mine: section titles blue; what the reader types
   or must not miss in the attention color; on a command block, the values
   to fill in. */
.guide h2 {
    color: var(--stat-blue);
    font-size: 1.28571429rem;
    margin-top: 2em;
}

.guide strong,
.guide :not(pre) > code {
    color: var(--attention-text-color);
}

.guide :not(pre) > code {
    font-family: var(--font-mono);
    font-size: 0.92em;
    overflow-wrap: anywhere;
}

.guide var {
    font-style: normal;
}

.guide pre var {
    color: var(--code-block-highlight);
}

.stats-container {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    margin-bottom: var(--summary-card-spacing);
    cursor: auto;
}

/* Whatever follows the card row (notice banner, pool info, a segment or a
   table) drops its own top margin so --summary-card-spacing alone sets the
   gap; the banner's margin is inline and Semantic's components outrank a bare
   element selector, hence !important. */
.stats-container + * {
    margin-top: 0 !important;
}

/* Your Stats' wallet lookup: the title with the solo hint as a small note on
   its line (under it where it doesn't fit), an error under the input when
   there is one, then the recent lookups. */
.wallet-title {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 2px 14px;
    margin-bottom: 1rem;
}

.wallet-title h2 {
    margin: 0;
}

.wallet-solo-hint {
    color: var(--hint-text-color);
    font-size: 0.92em;
}

.wallet-lookup-error {
    margin: 6px 2px 0;
}

.wallet-recent {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5em;
    margin: 6px 2px 0;
    font-size: 0.92em;
}

.wallet-recent a {
    cursor: pointer;
}

.custom-stat {
    border-radius: var(--radius);
    --stat-icon-size: calc(var(--summary-card-icon-size) * var(--summary-card-scale));
    text-align: start;
    min-width: 168px;
    padding: var(--summary-card-padding);
    /* Text stays clear of the icon: its 8px inset, its width, an 8px gap. */
    padding-inline-end: calc(var(--stat-icon-size) + 16px);
    line-height: calc(20px * var(--summary-card-scale));
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    box-shadow: var(--summary-card-shadow);
    position: relative;
    background-color: var(--custom-stat-bg);
}

.stat-label {
    margin-bottom: 4px;
    color: var(--stat-label-color);
}

.stat-value {
    font-weight: bold;
    color: var(--stat-value-color);
}

/* --stat-accent (set per card by SummaryCard) colors the value and icon. */
.custom-stat .stat-value {
    color: var(--stat-accent, var(--stat-value-color));
    font-size: calc(16px * var(--summary-card-scale));
}

/* Separators inside a value ("1 / 0 / 1", "98% | 147%") stay neutral. */
.custom-stat .stat-divider {
    color: var(--secondary-text-color);
}

/* A coin amount's worth in the viewer's currency, beside the amount. */
.coin-worth {
    color: var(--muted-text-color);
    font-size: 11px;
}

/* A coin value's worth in the viewer's currency, after it: quieter than the
   value, so the coin amount is what the card says. */
.custom-stat .stat-fiat {
    margin-inline-start: 6px;
    color: var(--muted-text-color);
    font-size: 0.7em;
    font-weight: normal;
}

.custom-stat .stat-label {
    font-size: calc(15px * var(--summary-card-scale));
    margin-bottom: calc(4px * var(--summary-card-scale));
    /* In a narrow card, long single words (German compounds) wrap too
       instead of running under the icon. */
    hyphens: auto;
    overflow-wrap: anywhere;
}

.stat-icon {
    position: absolute;
    top: 50%;
    inset-inline-end: 8px;
    transform: translateY(-50%);
    color: var(--stat-accent);
    font-size: var(--stat-icon-size);
}

/* Code, wallet addresses and hashes are left-to-right even on right-to-left
   pages; isolating them keeps "solo:" from rendering as ":solo". */
[dir="rtl"] code,
[dir="rtl"] .hash {
    direction: ltr;
    unicode-bidi: isolate;
}

/* Values take the direction of their own text, so on right-to-left pages
   "77.5 EH/s" stays "77.5 EH/s" while translated values stay right-to-left. */
[dir="rtl"] .stat-value,
[dir="rtl"] strong,
[dir="rtl"] .ui.table td {
    unicode-bidi: plaintext;
}

.custom-stat:hover {
    box-shadow: var(--summary-card-hover-shadow);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .stats-container {
        flex-wrap: wrap;
    }

    .custom-stat {
        flex: 1 1 calc(33% - 30px);
        /* 3 per row */
    }
}

@media (max-width: 768px) {
    .custom-stat {
        flex: 1 1 calc(50% - 8px);
        /* 2 per row */
    }
}

@media (max-width: 480px) {
    .stats-container {
        gap: 6px;
    }

    .custom-stat {
        flex: 1 1 calc(50% - 6px);
        /* 2 per row compact grid */
        min-width: unset;
        box-shadow: var(--summary-card-shadow-phone);
    }
}

.reward-percent {
    color: var(--stat-green);
}

.secondary-text {
    color: var(--secondary-text-color);
}

/* Orphan blocks: a normal network event — neutral gray and dimmed so it reads
   as "superseded", never as a pool error; under the pointer too. */
.ui.table tr.orphan-row,
.ui.table tr.orphan-row:hover {
    background: rgba(127, 127, 127, 0.10);
    color: var(--secondary-text-color);
    opacity: 0.8;
}

.hash {
    font-size: 98%;
    font-family: var(--font-mono);
}

/* A payment's first kernel after its transaction hash (PaymentHash), and the
   » that opens them all. */
.payment-kernels {
    margin-inline-start: 0.75em;
    font-size: 0.85em;
    color: var(--secondary-text-color);
}

.payment-kernels-all {
    background: none;
    border: 0;
    padding: 0 0.2em;
    margin-inline-start: 0.2em;
    color: var(--stat-blue);
    cursor: pointer;
    line-height: 0;
    vertical-align: middle;
}

[dir="rtl"] .payment-kernels-all svg {
    transform: scaleX(-1);
}

/* The kernels dialog: one full kernel per line. */
.kernel-list {
    list-style: none;
    margin: 0;
    padding: 0;
    word-break: break-all;
}

.kernel-list li + li {
    margin-top: 0.5em;
}

/* How to Mine: its steps, one card under another, each titled with its
   number in a marker. */
.mine-steps {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
}

.mine-steps > .ui.segment {
    margin: 0;
}

.mine-step-title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ui.segment > .mine-step-title {
    margin-bottom: 0.6rem;
}

/* The marker: a seal in a gradient, see-through inside a thin border of
   the same gradient, the number in the strongest ink on it. */
.mine-step-number {
    flex: none;
    width: 30px;
    height: 30px;
}

.mine-step-number path {
    fill-opacity: var(--step-seal-fill-opacity);
    stroke-width: 1.1;
    stroke-linejoin: round;
}

.mine-step-number .from {
    stop-color: var(--step-seal-from);
}

.mine-step-number .to {
    stop-color: var(--step-seal-to);
}

.mine-step-number text {
    fill: var(--hover-text-color);
    font-size: 13px;
    font-weight: 700;
    text-anchor: middle;
    dominant-baseline: central;
}

/* A step's own headings (a note on merge mining, a fixed difficulty). */
.mine-step h4 {
    margin: 1.2rem 0 0.5rem;
}

/* Step 1: the wallet and the worker side by side, the wallet wider; one
   under the other on phones. */
.mine-wallet-fields {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: 1em 14px;
    margin-bottom: 1em;
}

.ui.form .mine-wallet-fields > .field {
    margin: 0;
}

@media (max-width: 767px) {
    .mine-wallet-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.mine-optional {
    color: var(--secondary-text-color);
    font-weight: 400;
}

/* The solo toggle and what it does. */
.mine-solo {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 14px;
}

/* A field that takes a short value. */
.mine-short-field {
    max-width: 260px;
}

/* Step 2's port: the choice where there are several, then its facts. */
/* The port: a choice where the pool has several, then its facts. */
/* The port picker and the chosen port's facts on one line, the facts after
   the picker, or on two when the picker takes the width. */
.mine-port {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 16px;
    margin-top: 0.9rem;
}

.mine-port-choice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
}

.mine-port-label {
    font-weight: 700;
}

/* Ports that don't fit one row wrap to the next. */
.mine-port .segmented {
    flex-wrap: wrap;
    max-width: 100%;
}

/* The facts in a strip of cells, as wide as they are; on a narrow screen they
   wrap and fill their rows. Each cell draws the divider above and before it,
   a pixel over its neighbour's edge, so the dividers hold however the cells
   wrap; the strip clips the outermost under its own border. */
.mine-port-facts {
    display: flex;
    flex-wrap: wrap;
    overflow: hidden;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
}

/* Each cell in the colour of its kind: a tint behind it, its value in it. */
.mine-port-fact {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    margin: -1px 0 0 -1px;
    padding: 7px 14px;
    border-top: 1px solid var(--border-color);
    border-left: 1px solid var(--border-color);
    background: color-mix(in srgb, var(--fact-color) 8%, transparent);
}

.mine-port-fact.port {
    --fact-color: var(--accent-text);
}

.mine-port-fact.difficulty {
    --fact-color: var(--accent-purple);
}

.mine-port-fact.on {
    --fact-color: var(--green);
}

.mine-port-fact.off {
    --fact-color: var(--red);
}

.mine-port-fact > span {
    color: var(--secondary-text-color);
    font-size: 13px;
}

.mine-port-fact > b {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--fact-color);
    font-size: 15px;
}

/* The port's number, what the miner's settings take, largest. */
.mine-port-fact.port > b {
    font-family: var(--font-mono);
    font-size: 17px;
}

.mine-port-note {
    color: var(--secondary-text-color);
    font-size: 12px;
    font-weight: 400;
}

/* Step 3: a miner's systems, one at a time. */
.miner-systems {
    margin: 0.25rem 0 0.9rem;
}

.miner-systems button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

/* How to Mine miner tabs: the logo before a heading, in a bordered tile. */
.mine-heading-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    margin-inline-end: 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    background: var(--segment-background);
    flex-shrink: 0;
}

/* A region's hue (--region-* in each theme) on its badge and labels. */
.server-region-badge {
    --region-accent: var(--region-unknown);
    align-items: center;
    border: 1px solid var(--region-accent);
    border-radius: var(--radius-sm);
    color: var(--region-accent);
    display: inline-flex;
    font-size: 0.88em;
    font-weight: 700;
    height: 21px;
    justify-content: center;
    line-height: 1;
    min-width: 34px;
    padding: 0 5px;
    width: max-content;
}

.region-eu { --region-accent: var(--region-eu); }
.region-ru { --region-accent: var(--region-ru); }
.region-us, .region-us-e, .region-us-w, .region-us-east, .region-us-west, .region-us-central, .region-us-ord { --region-accent: var(--region-us); }
.region-au { --region-accent: var(--region-au); }
.region-pl { --region-accent: var(--region-pl); }
.region-br { --region-accent: var(--region-br); }
.region-ca { --region-accent: var(--region-ca); }
.region-sg { --region-accent: var(--region-sg); }
.region-id { --region-accent: var(--region-id); }
.region-hk { --region-accent: var(--region-hk); }
.region-tr { --region-accent: var(--region-tr); }
.region-jp { --region-accent: var(--region-jp); }
.region-in { --region-accent: var(--region-in); }

/* The LPRoute hint: an info banner, in an info message's colors, above the
   server table (desktop) or under the list of countries (mobile). */
.mine-note {
    align-items: flex-start;
    background: var(--info-message-background);
    border: 1px solid var(--info-message-border);
    border-radius: var(--radius);
    color: var(--primary-text-color);
    display: flex;
    gap: 10px;
    line-height: 1.4;
    margin: 10px 0 0;
    padding: 10px 14px;
}

.mine-note > svg {
    color: var(--accent);
    flex: 0 0 auto;
    font-size: 18px;
    margin-top: 1px;
}

.mine-note code {
    font-family: inherit;
    font-size: 1em;
}

.mine-note .pool-domain {
    color: var(--accent);
}

.mine-note .route-domain {
    color: var(--success);
}

/* The picking note under the servers step's title, before the picks: louder
   than an info note, in the theme's green with a bar at its start. */
.mine-pick-note {
    margin: 0 0 12px;
    background: color-mix(in srgb, var(--green) 14%, transparent);
    border-color: color-mix(in srgb, var(--green) 60%, transparent);
    border-inline-start: 4px solid var(--green);
}

.mine-pick-note > svg {
    color: var(--green);
}

/* A key to hold, drawn as its key cap. */
.mine-note kbd {
    display: inline-block;
    padding: 0 6px;
    border: 1px solid var(--border-color-hover);
    border-bottom-width: 2px;
    border-radius: var(--radius-sm);
    background: var(--segment-background);
    font: inherit;
    font-size: 0.9em;
    font-weight: 700;
    line-height: 1.4;
}

/* How to Mine server finder: search and continent chips over a table of
   servers (desktop) or, in a modal, a list of countries that open to their
   servers (mobile). */
/* A server's place among those picked, 1 for the main one, in a disc; an
   empty disc for one not picked. */
.server-pick {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: 1.5px solid var(--border-color-hover);
    border-radius: 50%;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
}

.server-pick.picked {
    border-color: var(--accent-blue);
    background: var(--accent-blue);
    color: var(--on-accent);
}

/* The servers picked, as labels in their order. */
.picked-servers {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 0.75rem;
}

.ui.label.picked-server {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 5px 10px 5px 5px;
    background: var(--dropdown-hover-background);
    color: var(--primary-text-color);
    font-weight: 400;
    box-shadow: 0 0 0 1px var(--border-color) inset;
}

.picked-server .flag-emoji {
    font-size: 16px;
}

.picked-server-country {
    font-weight: 700;
}

/* Phones: the button that opens the list to pick from. */
.ui.button.picked-servers-change {
    width: 100%;
    margin: 0;
}

/* One row of chips that scrolls sideways when the names don't fit. */
.server-chips {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
    overflow-x: auto;
    scrollbar-width: none;
}

.server-chip {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 999px;
    color: var(--primary-text-color);
    cursor: pointer;
    flex: 0 0 auto;
    font: inherit;
    padding: 4px 12px;
}

.server-chip.active {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--on-accent);
}

.server-finder-label {
    color: var(--secondary-text-color);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
    text-transform: uppercase;
}

/* A continent's title under the list before it (phones list by continent). */
.server-locations + .server-finder-label {
    margin-top: 14px;
}

.server-locations {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow: hidden;
}

.server-location + .server-location {
    border-top: 1px solid var(--border-color);
}

/* The open country is outlined; an outline draws over its content. */
.server-location.open {
    outline: 1px solid var(--accent);
    outline-offset: -1px;
}

.server-location-head {
    align-items: center;
    background: transparent;
    border: 0;
    color: var(--primary-text-color);
    cursor: pointer;
    display: grid;
    font: inherit;
    gap: 10px;
    grid-auto-columns: auto;
    grid-auto-flow: column;
    grid-template-columns: auto minmax(0, 1fr);
    padding: 9px 14px;
    text-align: start;
    width: 100%;
}

.server-location-flag {
    font-size: 20px;
    line-height: 1;
}

/* One line: the country, then its server count at the far end. */
.server-location-name {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
    line-height: 1.3;
}

.server-location-name > span {
    color: var(--secondary-text-color);
    font-size: 0.9em;
}

.server-location-name > .server-location-country {
    color: var(--primary-text-color);
    font-size: 1em;
    font-weight: 700;
}

.server-location-head > svg {
    color: var(--secondary-text-color);
    font-size: 18px;
}

.server-location.open .server-location-head > svg {
    color: var(--accent);
}

.server-location-body {
    container-type: inline-size;
    padding: 0 14px 12px;
}

.server-entry + .server-entry {
    border-top: 1px solid var(--border-color);
    margin-top: 10px;
    padding-top: 10px;
}

/* A server's row: the button that picks it, then the one that adds it as a
   backup or takes it out. */
.server-entry-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.server-entry-pick {
    display: flex;
    flex: 1 1 auto;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 4px 0;
    border: 0;
    background: none;
    color: var(--primary-text-color);
    font: inherit;
    font-weight: 700;
    text-align: start;
    cursor: pointer;
}

.server-entry-backup {
    flex: none;
    padding: 3px 8px;
    border: 1px solid var(--border-color-hover);
    border-radius: var(--radius-sm);
    background: none;
    color: var(--accent-text);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
}

.server-code {
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
    border-radius: var(--radius-sm);
    color: var(--accent-text);
    font-size: 0.8em;
    padding: 1px 6px;
}

.server-address {
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
}

.server-address + .server-address {
    margin-top: 6px;
}

/* A long address wraps (after a hyphen when it can) rather than being cut:
   it has to be readable in full. */
.server-address code {
    background: var(--background-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-family: var(--font-mono);
    font-size: 13px;
    overflow-wrap: anywhere;
    padding: 6px 10px;
}

.server-copy-button {
    align-items: center;
    background: color-mix(in srgb, var(--accent) 8%, transparent);
    border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
    border-radius: var(--radius);
    color: var(--accent-text);
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    gap: 6px;
    padding: 0 12px;
}

.server-copy-button.copied {
    background: color-mix(in srgb, var(--success) 10%, transparent);
    border-color: var(--success);
    color: var(--success-text);
}

/* "Copy" and "Copied" share one grid cell, so the button keeps the width of
   the longer label and nothing moves when it flips. */
.server-copy-label {
    display: grid;
}

.server-copy-label > span {
    grid-area: 1 / 1;
}

.server-copy-label > [aria-hidden="true"] {
    visibility: hidden;
}

/* Desktop: a slim toolbar over a dense table, about 27px per row. */
.server-finder-toolbar {
    align-items: center;
    display: flex;
    gap: 12px;
    margin-bottom: 8px;
}

.server-finder-toolbar .search-input {
    flex: 0 1 420px;
    margin: 0;
}

.server-finder-toolbar .search-input input {
    padding-block: 5px;
}

.server-finder-toolbar .server-chips {
    margin: 0;
}

.server-finder-toolbar .server-chip {
    padding: 2px 12px;
}

.server-finder-count {
    color: var(--secondary-text-color);
    margin-inline-start: auto;
    white-space: nowrap;
}

/* Where the finder is wide enough, the list in two tables side by side
   (server-finder.jsx measures, with this gap). */
.server-tables {
    column-gap: 16px;
}

.server-tables.split {
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: start;
}

/* Scrolls sideways rather than squeezing addresses on narrower desktops. */
.server-table-wrap {
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    overflow-x: auto;
}

.server-table {
    background: var(--segment-background);
    border-collapse: collapse;
    width: 100%;
}

.server-table th {
    background: var(--table-header-background);
    color: var(--primary-text-color);
    font-weight: 700;
    padding: 6px 4px;
    text-align: start;
}

.server-table td {
    border-top: 1px solid var(--border-color);
    color: var(--primary-text-color);
    padding: 2px 4px;
    white-space: nowrap;
}

.server-table tbody tr:hover td {
    background: var(--table-hover-background);
}

.server-table-pick {
    width: 1px;
}

/* A flex box, not an inline one: an empty disc and a numbered one line up
   alike, so picking doesn't change the row's height. */
.server-table-pick > button {
    display: flex;
    padding: 2px;
    border: 0;
    background: none;
    cursor: pointer;
}

.server-table tbody tr {
    cursor: pointer;
}

.server-table tbody tr.picked td {
    background: color-mix(in srgb, var(--accent-blue) 12%, transparent);
}

.server-table tr.copied td {
    background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.server-table-location {
    align-items: center;
    display: inline-flex;
    gap: 8px;
}

.server-table-location .flag {
    margin: 0;
}

.server-table .server-code {
    font-size: 0.75em;
}

.server-table code {
    font-family: var(--font-mono);
    font-size: 13px;
}

/* Copy cells hug their button. */
.server-table-copy {
    width: 1%;
}

.server-table .server-copy-button {
    font-size: 12px;
    gap: 4px;
    padding: 3px 7px;
}

/* The table's buttons are their icon alone (their tooltip names the
   address), so its halves fit side by side with each row's pick. */
.server-table .server-copy-label {
    display: none;
}

/* Where the longest address (port included, ~290px) and the longest "Copy"
   label (Russian, ~130px) can't share a line, the buttons keep only their
   icon and addresses drop to 12px, so they stay on one line from 390px
   phones up. */
@container (max-width: 422px) {
    .server-copy-button > span {
        display: none;
    }

    .server-address code {
        font-size: 12px;
    }
}

.my-fieldset {
    border: none;
    padding: 0;
}

.cursor-pointer {
    cursor: pointer;
}

.ui.segment.active.tab.bottom.attached {
    padding: 16px 0;
    overflow-x: auto;
}

/* A miner's pane on How to Mine: inset from the panel's sides, its top
   left to the panel's padding. */
.miner-pane {
    padding: 0 12px;
}

/* The tab menu on a narrow screen (Your Stats, How to Mine's miners): every
   tab in view. Tabs that don't fit wrap onto another row instead of
   scrolling, and grow to fill their row; on phones a row holds at most three,
   so five split 3 + 2. The lines between tabs are the 1px gaps over the
   menu's background, in the border color, so Semantic's dividers are
   cleared. */
.ui.wrapped.menu {
    flex-wrap: wrap;
    gap: 1px;
    background-color: var(--border-color);
    border-radius: var(--radius);
}

/* The transparent border matches the active tab's, so every row is as tall
   and a label doesn't move when its tab becomes active. */
.ui.wrapped.menu .item {
    flex: 1 1 auto;
    justify-content: center;
    text-align: center;
    line-height: 1.2;
    padding: 10px 8px;
    font-size: 0.95em;
    border: 1px solid transparent;
}

.ui.wrapped.menu .item::before {
    background: transparent;
}

/* Semantic's clearfix would take a slot, and a gap, at the end of the last row. */
.ui.wrapped.menu::after {
    content: none;
}

/* Not the -1px that sinks a tab into a tabular menu's bottom border: here it
   would push the active tab past its row. */
.ui.wrapped.menu .item.active {
    margin-bottom: 0;
}

/* Its panel stands apart from it (the menu's bottom margin), so unlike the
   panel under attached tabs it is round all round, and as wide as the menu
   rather than a pixel past each side. */
.ui.wrapped.menu + .ui.segment.active.tab {
    border-radius: var(--radius);
    margin-inline: 0;
    width: 100%;
}

@media (max-width: 600px) {
    .ui.wrapped.menu .item {
        flex-basis: 30%;
    }
}

.content {
    color: var(--primary-text-color);
}

.fixed-top-menu {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    max-width: 1268px;
    /* Set the maximum width you want for the menu */
    margin: 0 auto;
    /* Center the menu */
    padding: 0 var(--page-gutter);
    /* Match the content container gutter so the bar lines up with the content */
    z-index: 1000;
    /* Ensure the menu stays on top of other elements */
}

/* The menu is --nav-height tall; items have no vertical padding because
   Semantic already centres their content. The items are fitted to the bar's
   one row by MainMenuLayout, which sets data-fit to the first step at which
   they don't overflow it: the padding tighter, then the icons gone, the
   padding tighter still, the brand's name gone, and last the text smaller,
   as a pool with more pages or a language with longer labels needs. Flush
   with the top of the viewport, so its corners are square. */
.fixed-top-menu .ui.menu {
    --nav-item-padding: 12px;
    min-height: var(--nav-height);
    border-radius: 0;
}

.fixed-top-menu .ui.menu .item {
    padding: 0 var(--nav-item-padding);
}

.fixed-top-menu .ui.menu[data-fit="1"],
.fixed-top-menu .ui.menu[data-fit="2"] {
    --nav-item-padding: 8px;
}

.fixed-top-menu .ui.menu[data-fit="2"] > .item > svg,
.fixed-top-menu .ui.menu[data-fit="3"] > .item > svg,
.fixed-top-menu .ui.menu[data-fit="4"] > .item > svg,
.fixed-top-menu .ui.menu[data-fit="5"] > .item > svg {
    display: none;
}

.fixed-top-menu .ui.menu[data-fit="3"],
.fixed-top-menu .ui.menu[data-fit="4"] {
    --nav-item-padding: 5px;
}

.fixed-top-menu .ui.menu[data-fit="4"] .brand-name,
.fixed-top-menu .ui.menu[data-fit="5"] .brand-name {
    display: none;
}

.fixed-top-menu .ui.menu[data-fit="5"],
.fixed-top-menu .ui.menu[data-fit="5"] .item {
    --nav-item-padding: 4px;
    font-size: 13px;
}


/* No dividers between items. Semantic draws them as a translucent dark line
   that only shows on a light menu. The line is made transparent rather than
   removed: with display: none, Chrome renders the menu text with greyscale
   instead of subpixel anti-aliasing. */
.fixed-top-menu .ui.menu .item:before {
    background: transparent;
}

/* An active item is no wider than the rest: a border, or a bold label, would
   push the items after it whenever the page changes or a dropdown opens. */
.fixed-top-menu .ui.menu .active.item {
    border-width: 0;
}

/* The current page's item is shaped like the active tab of a tabular menu
   (the Your Stats tabs), its outline drawn inside it, open at the bottom.
   Semantic marks an open dropdown active too; it gets none, so it doesn't
   read as the current page. */
.fixed-top-menu .ui.menu .item.active:not(.dropdown) {
    box-shadow: inset 0 1px 0 var(--border-color), inset 1px 0 0 var(--border-color), inset -1px 0 0 var(--border-color);
}

/* The sun/moon theme button in both top bars: just the icon, no button chrome. */
.theme-toggle {
    background: none;
    border: 0;
    color: inherit;
    cursor: pointer;
    display: inline-flex;
    line-height: 0;
    padding: 0;
}

/* A text button on the phone's blue bar (the language), bare like the theme
   switch beside it. */
.bar-button {
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.fixed-top-menu-mobile {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    width: 100vw;
    z-index: 1000;
    /* width: 100vw keeps the bar pinned edge-to-edge regardless of horizontal
       overflow in the document below. */
}

/* The language and currency pickers (components/picker.jsx): in the desktop
   bar an icon and the current code opening a dropdown, in the phone's sidebar
   a row opening a modal. Either shows a search field over the choices,
   grouped by continent. */
.picker-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* The dropdown opens from a fixed bar, so it can't be scrolled into view: it
   is capped to the viewport and scrolls instead. The currency one is wider. */
.ui.dropdown .menu.picker-menu {
    width: 480px;
    max-height: 80vh;
    overflow-y: auto;
}

.ui.dropdown .menu.currency-menu {
    width: 690px;
}

.ui.dropdown .menu.picker-menu > .header {
    letter-spacing: 0.08em;
}

/* The choices, three to a row; two in the phone's modal. */
.picker-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.picker-modal .picker-choices {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* A choice: its flag (components/flag.jsx), then the language's name, or the
   currency's code and its name, cut short with an ellipsis where the cell is
   too narrow (the cell's title has it whole). The gap stands in for the
   sprite flag's own margin, which only knows left-to-right. No border, not
   even on hover, where it would grow the cell and shift the rows below: hover
   fills the cell instead. Its class is its own, not Semantic's `item`, whose
   rules for a menu's items would reach it in the desktop bar. */
.picker-choice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.78571429rem 1.14285714rem;
    color: var(--hover-text-color);
    line-height: 1em;
    white-space: nowrap;
    cursor: pointer;
}

.picker-choice:hover {
    background: var(--dropdown-hover-background);
    color: var(--dropdown-item-hover-text-color);
}

.picker-choice.active {
    border-inline-start: 3px solid var(--stat-blue);
    background: var(--dropdown-hover-background);
    font-weight: 700;
}

.picker-choice > .flag {
    flex-shrink: 0;
    margin: 0;
}

.picker-choice > .flag-emoji {
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

.picker-choice > .secondary-text {
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The search field, kept at the top as the choices scroll under it. */
.picker-search {
    position: sticky;
    top: 0;
    z-index: 1;
    grid-column: 1 / -1;
    padding: 0 1.14285714rem 6px;
}

.picker-menu .picker-search {
    background: var(--dropdown-menu-background);
}

.picker-modal .picker-search {
    background: var(--modal-content-background);
}

.picker-search .search-input {
    margin: 0;
}

/* A continent's title over its choices, smaller than the heading and in the
   accent color, like a card's group titles. */
.picker-group {
    grid-column: 1 / -1;
    padding: 10px 1.14285714rem 2px;
    color: var(--accent-text);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.picker-empty {
    grid-column: 1 / -1;
    padding: 0.78571429rem 1.14285714rem;
    color: var(--secondary-text-color);
}

/* The phone's sidebar (components/side-menu.jsx): a row's current choice at
   its end (a language or currency with its flag, or Discord's new-tab mark). */
.side-menu-value {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    margin-inline-start: auto;
    overflow: hidden;
    color: var(--secondary-text-color);
    white-space: nowrap;
}

/* On/off switches (components/toggle.jsx): a track that turns green with its
   thumb at the end when on, and the label after it. The checkbox is hidden
   but still takes the keyboard, and its focus rings the track. */
.toggle-switch {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    white-space: nowrap;
}

.toggle-switch input {
    position: absolute;
    width: 1px;
    height: 1px;
    opacity: 0;
}

.toggle-switch input:focus-visible~.toggle-switch-track {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.toggle-switch-track {
    position: relative;
    width: 36px;
    height: 20px;
    background: var(--toggle-off-background);
    border-radius: 10px;
    transition: background 0.2s;
}

.toggle-switch-thumb {
    position: absolute;
    top: 2px;
    inset-inline-start: 2px;
    width: 16px;
    height: 16px;
    background: var(--on-accent);
    border-radius: 50%;
    transition: inset-inline-start 0.2s;
}

.toggle-switch input:checked~.toggle-switch-track {
    background: var(--green);
}

.toggle-switch input:checked~.toggle-switch-track .toggle-switch-thumb {
    inset-inline-start: 18px;
}

.toggle-switch-label {
    font-size: 14px;
    color: var(--primary-text-color);
}

/* The worker table's toolbar: its view and column controls, and the search
   at the end. */
.worker-toolbar {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
    margin: 0 0 8px;
}

/* Its view switch has square corners, as the note under it does. */
.worker-toolbar .segmented button:is(:first-child, :last-child) {
    border-radius: 0;
}

.worker-toolbar .search-input {
    flex: 0 1 360px;
    margin: 0;
    margin-inline-start: auto;
}

.worker-toolbar .search-input input {
    padding-block: 4px;
}

/* The remove-workers note under it: an info message cut to a slim,
   square-cornered line. */
.ui.message.worker-note {
    border-radius: 0;
    margin: 0 0 8px;
    padding: 6px 12px;
}

/* The row under a paged table, flush with its edges: the pagination at the
   end and, when the table has one, its page-size dropdown at the start, on a
   line of its own where both don't fit. */
.table-paging {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
    margin-top: 12px;
}

.table-paging .dropdown {
    margin-inline-end: auto;
}

/* A search field (components/search-input.jsx), and the line in place of a
   list it leaves empty. */
.search-input {
    display: block;
    margin-bottom: 8px;
    position: relative;
}

.search-input svg {
    color: var(--secondary-text-color);
    font-size: 18px;
    inset-inline-start: 12px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
}

.search-input input {
    background: var(--input-background);
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    color: var(--primary-text-color);
    font: inherit;
    padding: 8px 12px;
    padding-inline-start: 40px;
    width: 100%;
}

.search-input input:focus {
    border-color: var(--input-focus-border);
    outline: none;
}

.search-empty {
    color: var(--secondary-text-color);
}

/* Segmented controls (components/segmented.jsx): a choice among a few options
   as one control, a button group like Bootstrap's: outlined buttons joined
   side by side, the chosen one in the colors of the menus' active item (its
   background, blue text, the gradient band along its bottom edge, in place
   of its bottom border). */
.segmented {
    display: inline-flex;
    flex: 0 0 auto;
}

.segmented button {
    position: relative;
    min-width: 4.5em;
    padding: 4px 14px;
    border: 0;
    border-radius: 0;
    background: var(--segment-background);
    box-shadow: inset 0 0 0 1px var(--border-color-hover);
    color: var(--primary-text-color);
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

/* Neighbours share one border line; the group's outer corners are rounded,
   on whichever side a right-to-left page puts them. */
.segmented button + button {
    margin-inline-start: -1px;
}

.segmented button:first-child {
    border-start-start-radius: var(--radius);
    border-end-start-radius: var(--radius);
}

.segmented button:last-child {
    border-start-end-radius: var(--radius);
    border-end-end-radius: var(--radius);
}

.segmented button:focus-visible {
    z-index: 2;
    outline: 2px solid var(--accent);
    outline-offset: 1px;
}

.segmented button[aria-pressed="true"] {
    background-color: var(--active-tab-background);
    background-image: var(--menu-active-underline);
    background-size: var(--menu-underline-width) 2px;
    background-position: bottom;
    background-repeat: no-repeat;
    box-shadow: inset 0 1px 0 var(--border-color-hover), inset 1px 0 0 var(--border-color-hover), inset -1px 0 0 var(--border-color-hover);
    color: var(--stat-blue);
    animation: menu-underline-grow 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Under the pointer, chosen or not, as a menu's items are. */
.segmented button:hover {
    background-color: var(--menu-hover-background);
    color: var(--hover-text-color);
}

@media (prefers-reduced-motion: reduce) {
    .segmented button[aria-pressed="true"] {
        animation: none;
    }
}

/* The Details cards under the summary (overview-stats.jsx): the Miner Signals
   card beside the two chart cards, in one column on narrower screens. The
   chart cards share their column's height, and their charts grow to fill
   them, so both columns end level. */
.miner-overview {
    display: grid;
    grid-template-columns: minmax(0, 4fr) minmax(0, 6fr);
    gap: 12px;
    align-items: stretch;
}

.miner-chart-stack {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0;
}

.miner-overview-section {
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--segment-background);
}

.miner-chart-stack > .miner-overview-section {
    flex: 1;
}

.miner-chart-stack .chart {
    display: flex;
    flex: 1;
    flex-direction: column;
    min-height: 0;
}

.miner-chart-stack .chart-plot {
    flex: 1;
}

.miner-section-header {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 6px 12px;
    margin-bottom: 4px;
}

.miner-section-header h4 {
    margin: 0;
    color: var(--primary-text-color);
    font-size: 15px;
}

/* A switch has no text baseline of its own: it sits mid-line. */
.miner-section-header .toggle-switch {
    align-self: center;
}

/* The hint, at the end however many controls start the line. */
.miner-section-header span {
    margin-inline-start: auto;
    color: var(--secondary-text-color);
    font-size: 12px;
    text-align: end;
}

.miner-hash-windows,
.miner-share-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
}

.miner-hash-window {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6px;
    min-width: 0;
    padding: 5px 8px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.miner-hash-window span {
    color: var(--secondary-text-color);
    font-size: 11px;
}

.miner-hash-window strong {
    color: var(--stat-blue);
    font-size: 13px;
    white-space: nowrap;
}

.miner-detail-row {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 0 14px;
    padding: 3px 0;
    border-top: 1px solid var(--border-color);
}

/* A group whose title starts its row of tiles (hashrate) or badges (shares):
   the titles share one column width, so both rows' tiles line up. */
.miner-tile-row {
    display: grid;
    grid-template-columns: 76px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    margin: 8px 0 3px;
}

.miner-tile-row > .miner-inline-subtitle {
    margin: 0;
}

/* The row right under a group's tiles or badges: those already close the
   group above, so no second line. */
.miner-tile-row + .miner-detail-row {
    border-top: 0;
}

/* A group's title, in the accent color so it stands out from the labels. */
.miner-inline-subtitle {
    margin: 8px 0 3px;
    color: var(--accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.miner-section-header + .miner-inline-subtitle,
.miner-section-header + .miner-tile-row {
    margin-top: 0;
}

.miner-detail-label {
    color: var(--secondary-text-color);
}

/* A hint moves to the next line whole rather than breaking. */
.miner-detail-hint {
    font-size: 12px;
    white-space: nowrap;
}

.miner-detail-value {
    min-width: 0;
    margin-inline-start: auto;
    color: var(--primary-text-color);
    font-weight: 700;
    text-align: end;
    overflow-wrap: anywhere;
}

.miner-detail-value.positive {
    color: var(--stat-green);
}

.miner-detail-value.negative {
    color: var(--effort-critical-color);
}

.miner-reward-blocks {
    color: var(--accent-purple);
}

/* How to Mine: a note under a field of the miner's settings. */
.mine-field-note {
    margin: 0.4em 0 0;
}

/* A miner's note that it mines on the first of the servers picked, as it
   takes no backups. */
.miner-failover-note {
    color: var(--attention-text-color);
}

/* A miner login format shown as code, on How to Mine. */
.mine-login {
    margin: 0.5em 0;
    font-family: monospace;
    word-break: break-all;
}

/* A short note about a group, in the attention color. */
.miner-group-note {
    color: var(--attention-text-color);
    font-size: 12px;
    font-style: italic;
}

/* A group's title with its note at the end of the line (Earnings, and when
   its rewards unlock); where both don't fit, the note drops under the title
   and wraps there. */
.miner-subtitle-row {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    justify-content: space-between;
    gap: 3px 12px;
    margin: 8px 0 3px;
}

.miner-subtitle-row > .miner-inline-subtitle {
    margin: 0;
}

.miner-subtitle-row > .miner-group-note {
    min-width: 0;
}

/* The earnings grid: a label, then the amount in coin and in the viewer's
   currency, each in its own column so the rows line up. */
.miner-money-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
}

.miner-money-row {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: subgrid;
    align-items: baseline;
    column-gap: 12px;
    padding: 3px 0;
    border-top: 1px solid var(--border-color);
}

/* A group of rows has no line above it: the grid's first row, right under
   the Earnings title, and the rows after the divider, which sets what the
   wallet earned and was paid apart from what it holds. */
.miner-money-row:first-child,
.miner-money-divider + .miner-money-row {
    border-top: 0;
}

/* That divider: a rule in the middle of the card fading out toward both
   sides, with a small diamond at its center. It lies where a row's top border
   would, with 2px more room above and below; the diamond overlaps the rows'
   padding. */
.miner-money-divider {
    display: flex;
    grid-column: 1 / -1;
    align-items: center;
    justify-content: center;
    gap: 9px;
    height: 1px;
    margin: 2px 0;
}

.miner-money-divider::before,
.miner-money-divider::after {
    content: '';
    width: 120px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--border-color-hover) 70%);
}

.miner-money-divider::after {
    background: linear-gradient(to left, transparent, var(--border-color-hover) 70%);
}

.miner-money-divider > span {
    width: 6px;
    height: 6px;
    border: 1px solid var(--border-color-hover);
    border-radius: 1px;
    transform: rotate(45deg);
}

/* Amounts in the text color at normal weight, their digits one width so the
   column reads down, the unit small and quiet. */
.miner-money-row .miner-detail-value {
    color: var(--primary-text-color);
    font-weight: 400;
    font-variant-numeric: tabular-nums;
}

.miner-money-row .coin-unit {
    color: var(--muted-text-color);
    font-size: 0.75em;
}

/* Each row's icon, in the color of its kind; a state's amount too: payable
   green, locked amber. */
.miner-money-icon {
    margin-inline-end: 8px;
    color: var(--muted-text-color);
    font-size: 15px;
    vertical-align: -2px;
}

.miner-money-payable .miner-money-icon,
.miner-money-payable .miner-detail-value {
    color: var(--accent-green);
}

.miner-money-locked .miner-money-icon,
.miner-money-locked .miner-detail-value {
    color: var(--orange);
}

.miner-money-earned .miner-money-icon {
    color: var(--accent-purple);
}

.miner-money-paid .miner-money-icon {
    color: var(--accent-blue);
}

/* A group's sum: bold, under a firmer rule. */
.miner-money-row.miner-money-total {
    border-top-color: var(--border-color-hover);
}

.miner-money-total .miner-detail-label,
.miner-money-total .miner-detail-value,
.miner-money-total .miner-money-sub {
    font-weight: 700;
}

.miner-money-total .miner-detail-label {
    color: var(--primary-text-color);
}

/* The unlocked balance on its way to the payout threshold: a bar under its
   row, then how far along it is (left) and both amounts (right). */
.miner-payout {
    grid-column: 1 / -1;
    padding: 1px 0 6px;
}

.miner-payout-track {
    height: 6px;
    overflow: hidden;
    border-radius: 99px;
    background: color-mix(in srgb, var(--border-color) 70%, transparent);
}

.miner-payout-fill {
    height: 100%;
    border-radius: 99px;
    background: var(--accent-green);
}

.miner-payout-text {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
    color: var(--muted-text-color);
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.miner-payout-text b {
    color: var(--primary-text-color);
}

.miner-money-sub {
    color: var(--muted-text-color);
    font-size: 12px;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
    text-align: end;
    white-space: nowrap;
}

/* An amount's worth stands twice the columns' gap off the coin amount; with
   no price, the empty column adds nothing. */
.miner-money-sub:not(:empty) {
    padding-inline-start: 12px;
}

.miner-share-badge {
    display: inline-flex;
    min-width: 0;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 5px 6px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--primary-text-color);
}

.miner-share-kind {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.miner-share-valid strong {
    color: var(--stat-green);
}

.miner-share-stale strong {
    color: var(--effort-high-color);
}

.miner-share-invalid strong {
    color: var(--effort-critical-color);
}

/* An editable value lays out as flex so the pen centres on its text; the pen
   takes the action accent so it reads as a control, not as punctuation. */
.miner-detail-value.editable {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.miner-detail-edit {
    display: flex;
    margin-inline-start: 6px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--stat-green);
    cursor: pointer;
    line-height: 1;
}

.miner-detail-edit:hover {
    color: var(--hover-text-color);
}

@media (max-width: 1024px) {
    .miner-overview {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 620px) {
    /* A phone has no room for a title beside three tiles: it goes back above. */
    .miner-tile-row {
        grid-template-columns: minmax(0, 1fr);
        gap: 3px;
    }

    /* The three badges keep their row; each stacks its kind under the count. */
    .miner-share-badge {
        flex-direction: column;
        gap: 2px;
        padding: 6px 4px;
    }

    .miner-share-kind {
        font-size: 12px;
    }

    .miner-section-header {
        row-gap: 3px;
    }

    .miner-section-header span {
        flex-basis: 100%;
        text-align: start;
    }
}


/* The Your Stats sections under the overview. In the full view the Full/Tabs
   switch shares the first heading's row; in the tabs view it ends the tab
   bar, or sits above the tabs where they wrap. */
.stats-sections {
    margin-top: 12px;
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 26px 0 14px; /* Semantic's h3 margins, carried by the row */
}

.section-head h3 {
    margin: 0;
}

.view-switch-row {
    display: flex;
    justify-content: flex-end;
}

.ui.menu .tabs-aside {
    display: flex;
    align-items: center;
    margin-inline-start: auto;
    padding: 0 6px;
}

/* Co-bonds (pages/bonds, and the Bonds tab of Your Stats): the tab's cards
   share their row, fewer than the summary's six, and the notes under a
   table are set apart from it in the secondary color. */
@media (min-width: 1025px) {
    .bond-cards .custom-stat {
        flex: 1 1 0;
    }
}

.bond-note {
    margin: 12px 0 0;
    color: var(--secondary-text-color);
}

.bond-note + .bond-note {
    margin-top: 4px;
}

/* The Bonds table groups each payout address's bonds under a row of its own,
   in the header's tint, with their totals and how many they are; the bond IDs
   below are set in from the address. */
.ui.table tbody .bond-group {
    background: var(--table-header-background);
    font-weight: 700;
}

.bond-group-count {
    margin-inline-start: 10px;
    color: var(--secondary-text-color);
    font-size: 12px;
    font-weight: 400;
}

.ui.table .bond-row td:first-child {
    padding-inline-start: 2em;
}

/* --- PoolInfoBar (ported from c3eadac) --- */
.pool-info-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 18px;
    align-items: center;
    justify-content: space-between;
    margin-top: 10px;
    margin-bottom: 8px;
    line-height: 1.25;
}

.pool-info-compact {
    margin-top: 8px;
    margin-bottom: 8px;
    padding: 8px 10px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--segment-background);
}

.pool-info-title {
    display: inline-flex;
    min-width: 0;
    flex-wrap: wrap;
    gap: 5px 8px;
    align-items: center;
    color: var(--primary-text-color);
    font-size: 18px;
    font-weight: 700;
}

.pool-info-compact .pool-info-title {
    font-size: 14px;
}

.pool-info-logo,
.pool-info-logo-fallback {
    width: 25px;
    height: 25px;
    flex: 0 0 auto;
    border-radius: 50%;
}

.pool-info-logo {
    object-fit: cover;
}

.pool-info-logo-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--stat-blue);
    color: var(--on-accent);
    font-size: 12px;
    font-weight: 700;
}

.pool-info-mode {
    color: var(--secondary-text-color);
    font-weight: 700;
}

.pool-info-algo {
    color: var(--stat-green);
    font-size: 0.9em;
    font-weight: 700;
}

.pool-info-links {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 12px;
    align-items: center;
    justify-content: flex-end;
    margin-left: auto;
}

.pool-info-link {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
}

.pool-info-link-website svg {
    color: var(--accent);
}

.pool-info-link-wallet svg {
    color: var(--accent-gold);
}

.pool-info-link-explorer svg {
    color: #13c2c2;
}

.pool-info-link-source svg {
    color: #8b949e;
}

.pool-info-link-discord svg {
    color: var(--discord);
}

.pool-info-link-telegram svg {
    color: #26a5e4;
}

.pool-info-link-x svg {
    color: #1d9bf0;
}

.pool-info-link-p2p svg {
    color: #13a10e;
}

.pool-info-link-resource svg {
    color: var(--accent);
}

.pool-info-divider {
    color: var(--secondary-text-color);
    opacity: 0.8;
}

.pool-info-link svg {
    margin-right: 0;
}

/* The fold of the other exchanges: a button that reads like the links ("+3"). */
.pool-info-more {
    background: none;
    border: 0;
    padding: 0;
    font-family: inherit;
    line-height: inherit;
    color: var(--stat-blue);
    cursor: pointer;
}

@media (max-width: 600px) {
    .pool-info-bar { gap: 7px 12px; justify-content: flex-start; }
    .pool-info-title { font-size: 15px; }
    .pool-info-logo, .pool-info-logo-fallback { width: 21px; height: 21px; }
    .pool-info-links { gap: 10px 16px; justify-content: flex-start; margin-left: 0; width: 100%; }
    /* Icon-only on mobile to save space; bump the icon a touch for tap targets. */
    .pool-info-link { font-size: 12px; }
    .pool-info-link svg { font-size: 1.3em; }
    .pool-info-link > span { display: none; }
    /* Exchanges keep their full name so users can read where to trade. */
    .pool-info-link-exchange > span { display: inline; }
}

/* --- Notice dialog (components/notice-dialog.jsx) --- */
.notice-dialog {
    position: relative; max-width: 560px; width: 100%; margin: 0 auto;
    padding: 30px 30px 22px; border-radius: calc(var(--radius) * 2); color: #fff; text-align: left; overflow: hidden;
    background:
        radial-gradient(90% 120% at 88% 0%, var(--nd-glow) 0%, transparent 55%),
        linear-gradient(105deg, var(--nd-bg-from) 0%, var(--nd-bg-mid) 52%, var(--nd-bg-to) 100%);
    border: 1px solid var(--nd-border);
    box-shadow: 0 34px 90px rgba(0,0,0,0.6), inset 0 1px 0 rgba(255,255,255,0.08);
}
/* One palette per level; the accent colours the eyebrow, stat, button and focus ring. */
.notice-dialog--success {
    --nd-glow: rgba(89, 153, 102, 0.32); --nd-border: rgba(113, 204, 139, 0.3);
    --nd-bg-from: #08120c; --nd-bg-mid: #1e3626; --nd-bg-to: #2d4e37;
    --nd-accent: #71cc8b; --nd-on-accent: #052e16; --nd-body: rgba(224, 240, 229, 0.78);
    --nd-bar: var(--nd-accent);
}
.notice-dialog--warn {
    --nd-glow: rgba(217, 119, 6, 0.42); --nd-border: rgba(251, 191, 36, 0.4);
    --nd-bg-from: #1c1203; --nd-bg-mid: #3f2a06; --nd-bg-to: #5e3d08;
    --nd-accent: #fbbf24; --nd-on-accent: #2a1a03; --nd-body: rgba(254, 243, 199, 0.8);
    --nd-bar: repeating-linear-gradient(-45deg, #f59e0b 0 14px, #1c1203 14px 28px);
}
.notice-dialog--error {
    --nd-glow: rgba(180, 30, 45, 0.45); --nd-border: rgba(244, 90, 100, 0.4);
    --nd-bg-from: #240711; --nd-bg-mid: #470f1b; --nd-bg-to: #6a1522;
    --nd-accent: #fbbf24; --nd-on-accent: #2a0810; --nd-body: rgba(255, 228, 228, 0.78);
    --nd-bar: repeating-linear-gradient(-45deg, #f59e0b 0 14px, #170509 14px 28px);
}
.notice-dialog::before {
    content: ''; position: absolute; top: 0; left: 0; right: 0; height: 6px;
    background: var(--nd-bar); opacity: 0.92;
}
.notice-dialog__close {
    position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.16);
    color: rgba(255,255,255,0.7); cursor: pointer; font-size: 0.82rem; line-height: 1;
    transition: background 0.15s ease, color 0.15s ease;
}
.notice-dialog__close:hover { background: rgba(255,255,255,0.18); color: #fff; }
.notice-dialog__eyebrow {
    display: inline-flex; align-items: center; gap: 9px; margin: 6px 0 14px;
    color: var(--nd-accent); font-weight: 800; font-size: 0.72rem; letter-spacing: 0.18em; text-transform: uppercase;
}
.notice-dialog__dot {
    width: 9px; height: 9px; border-radius: 50%; background: var(--nd-accent);
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--nd-accent) 55%, transparent); animation: noticeDialogPulse 1.7s 3; /* a few pulses, then still: an endless box-shadow animation repaints every frame */
}
@keyframes noticeDialogPulse {
    0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--nd-accent) 55%, transparent); }
    70%  { box-shadow: 0 0 0 11px transparent; }
    100% { box-shadow: 0 0 0 0 transparent; }
}
.notice-dialog__title { margin: 0 0 8px; font-size: clamp(1.55rem, 4.2vw, 2.2rem); font-weight: 800; letter-spacing: -0.02em; line-height: 1.05; color: #fff; }
.notice-dialog__body { margin: 0 0 20px; max-width: 50ch; color: var(--nd-body); font-size: 0.97rem; line-height: 1.5; }
.notice-dialog__hero {
    display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 18px;
    padding: 16px 0; border-top: 1px solid rgba(255,255,255,0.09); border-bottom: 1px solid rgba(255,255,255,0.09);
}
.notice-dialog__pct {
    font-size: clamp(2.5rem, 8.5vw, 3.5rem); font-weight: 800; line-height: 1; color: var(--nd-accent);
    letter-spacing: -0.03em; font-variant-numeric: tabular-nums; text-shadow: 0 0 26px color-mix(in srgb, var(--nd-accent) 35%, transparent);
}
.notice-dialog__statlabel { margin-top: 6px; text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.66rem; font-weight: 700; color: rgba(255,255,255,0.55); }
.notice-dialog__ctacol { display: flex; flex-direction: column; gap: 10px; }
.notice-dialog__cta {
    display: inline-block; text-align: center; text-decoration: none;
    padding: 11px 20px; border-radius: var(--radius); font-weight: 800; font-size: 0.95rem;
    background: var(--nd-accent); color: var(--nd-on-accent); cursor: pointer; border: none;
    box-shadow: 0 6px 20px color-mix(in srgb, var(--nd-accent) 28%, transparent);
    transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
.notice-dialog__cta:hover {
    background: color-mix(in srgb, var(--nd-accent) 80%, white); transform: translateY(-1px);
    box-shadow: 0 10px 26px color-mix(in srgb, var(--nd-accent) 42%, transparent);
}
.notice-dialog__cta--ghost { background: transparent; color: #fff; box-shadow: none; font-weight: 700; border: 1px solid rgba(255,255,255,0.3); }
.notice-dialog__cta--ghost:hover { background: rgba(255,255,255,0.08); border-color: #fff; }
.notice-dialog__foot { display: flex; justify-content: flex-end; gap: 20px; margin-top: 18px; }
.notice-dialog__link { background: none; border: none; cursor: pointer; padding: 6px 2px; color: rgba(255,255,255,0.7); font-size: 0.88rem; font-weight: 600; transition: color 0.15s ease; }
.notice-dialog__link:hover { color: #fff; text-decoration: underline; }
.notice-dialog__link--mut { color: rgba(255,255,255,0.42); }
.notice-dialog__link--mut:hover { color: rgba(255,255,255,0.85); }
.notice-dialog a:focus-visible, .notice-dialog button:focus-visible { outline: 2px solid var(--nd-accent); outline-offset: 2px; border-radius: var(--radius); }
@media (max-width: 480px) {
    .notice-dialog { padding: 24px 20px 18px; }
    .notice-dialog__hero { flex-direction: column; align-items: flex-start; }
    .notice-dialog__ctacol, .notice-dialog__cta { width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .notice-dialog__dot { animation: none; } }

/* --- Toasts (components/toast.jsx): short messages at the bottom of the page --- */
.toasts {
    position: fixed;
    inset-inline: 0;
    bottom: 24px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    pointer-events: none;
}

.toast {
    display: flex;
    align-items: center;
    gap: 6px;
    max-width: min(90vw, 480px);
    padding: 8px 14px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    background: var(--segment-background);
    box-shadow: var(--summary-card-shadow);
    color: var(--primary-text-color);
    font-size: 14px;
}

/* --- Charts (components/svg-chart.jsx and the charts built on it) --- */
/* Inline SVG colored by the theme's --chart-* tokens. The title, the legend
   and the hover tooltip are HTML around and over the drawing. */
.chart {
    background: var(--chart-background);
    border-radius: var(--radius);
    font-size: 10px;
    touch-action: pan-y;
}

/* Geometry is left-to-right whatever the page's direction; the HTML parts follow the page. */
.chart svg {
    display: block;
    direction: ltr;
}

.chart text {
    fill: var(--chart-text-color);
}

.chart-title {
    padding: 8px 10px 2px;
    text-align: center;
    font-size: 13px;
    font-weight: 700;
    color: var(--chart-subtitle-color);
}

/* The plot is as tall as its chart's minimum, or as tall as a container that
   stretches it; the drawing lies over it at the measured size, so growing the
   drawing never grows the plot. */
.chart-plot {
    position: relative;
}

.chart-plot > svg {
    position: absolute;
    inset: 0;
}

.chart-grid {
    stroke: var(--chart-gridline-color);
}

.chart-axis {
    stroke: var(--chart-axis-line-color);
}

.chart-fill-start {
    stop-color: var(--chart-area-fill-start);
}

.chart-fill-end {
    stop-color: var(--chart-area-fill-end);
}

.chart-line {
    fill: none;
    stroke: var(--chart-line-color);
    stroke-width: 1.5;
}

.chart-marker {
    fill: var(--chart-line-color);
    stroke: var(--chart-background);
    stroke-width: 1.5;
}

.chart-bar {
    fill: var(--chart-bar-color);
}

.chart-bar.hover {
    fill-opacity: 0.75;
}

.chart-tooltip {
    position: absolute;
    z-index: 1;
    padding: 6px 10px;
    border: 1px solid var(--chart-tooltip-border);
    border-radius: var(--radius-sm);
    background: var(--chart-tooltip-background);
    color: var(--chart-text-color);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
}

.chart-tooltip small {
    font-size: 11px;
}

/* The Blocks chart sits on its segment unboxed. Each series has one class that
   sets `color`, so the same class paints its columns or line, its legend
   swatch and its tooltip dot. */
.blocks-chart {
    background: none;
    border-radius: 0;
    font-size: 11px;
}

/* The Blocks chart's title: the effort averages, the label then a tile per
   period with its value in the effort's color, like Your Stats' hashrate
   windows; on one line where they fit. */
.blocks-chart .chart-title {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px 8px;
    font-size: 12px;
    font-weight: 400;
    color: var(--secondary-text-color);
}

.effort-averages > span:first-child {
    margin-inline-end: 4px;
    color: var(--chart-subtitle-color);
    font-size: 13px;
    font-weight: 700;
}

.effort-average {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 4px 12px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
}

.effort-average > b {
    font-size: 15px;
}

/* On phones the label takes a line of its own and the tiles share the next,
   all six on it, each its period over its value. */
@media (max-width: 767px) {
    .blocks-chart .chart-title {
        gap: 3px;
        padding-top: 6px;
    }

    .effort-averages > span:first-child {
        flex: 0 0 100%;
        margin: 0;
    }

    .effort-average {
        flex: 1 1 0;
        flex-direction: column;
        align-items: center;
        gap: 0;
        min-width: 0;
        padding: 1px 2px 2px;
        font-size: 10px;
        line-height: 1.25;
        white-space: nowrap;
    }

    .effort-average > b {
        font-size: 12px;
    }
}

/* The narrowest phones: the tiles tighter still. */
@media (max-width: 359px) {
    .blocks-chart .chart-title {
        gap: 3px;
    }

    .effort-average {
        padding: 1px 1px 2px;
    }

    .effort-average > b {
        font-size: 11px;
    }
}

.chart-subtitle {
    text-align: center;
    font-size: 12px;
    color: var(--chart-note-color);
}

.series-effort {
    color: var(--chart-effort-color);
}

.series-blocks {
    color: var(--chart-blocks-color);
}

.series-solo {
    color: var(--chart-solo-color);
}

.series-orphans {
    color: var(--chart-orphans-color);
}

.chart-column {
    fill: currentColor;
}

.chart-stack-outline {
    fill: none;
    stroke: var(--chart-outline-color);
    stroke-width: 1;
}

.blocks-chart .chart-line {
    stroke: currentColor;
    stroke-width: 2;
}

.blocks-chart .chart-marker {
    fill: currentColor;
    stroke: none;
}

.chart-crosshair {
    fill: var(--chart-gridline-color);
    fill-opacity: 0.5;
}

.chart-legend {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 2px 18px;
    padding-top: 6px;
    font-size: 12px;
}

.chart-legend button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 0;
    border: 0;
    background: none;
    color: var(--chart-text-color);
    font: inherit;
    cursor: pointer;
}

.chart-legend button[aria-pressed="false"] {
    opacity: 0.45;
}

.chart-swatch {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 2px;
    background: currentColor;
}

/* Exact wallet-signing text stays readable in either theme and at phone width. */
.nock-address-binding textarea {
    box-sizing: border-box;
    display: block;
    width: 100%;
    max-width: 100%;
    padding: .7em 1em;
    border: 1px solid var(--input-border);
    border-radius: var(--radius);
    background: var(--input-background);
    color: var(--primary-text-color);
    font-family: var(--font-mono);
    font-size: inherit;
    line-height: 1.5;
    text-align: left;
    resize: vertical;
}

.nock-address-binding textarea:focus-visible {
    outline: 2px solid var(--accent-text);
    outline-offset: 1px;
}

.nock-binding-actions {
    display: flex;
    flex-wrap: wrap;
    gap: .5em;
}
