/*
 * SignalHop components and app layout (ADR 0012). Colours come from tokens.css.
 *
 * Layout tiers (one sidebar, three sizes):
 *   >= 1024px  full sidebar
 *   641-1023px icon rail
 *   <= 640px   top bar + bottom tab bar
 */

/* --- App shell ------------------------------------------------------------------- */

.shell {
    display: flex;
    min-height: 100vh;
}

.side {
    flex: 0 0 var(--sidebar-width);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    padding: 20px 14px;
    background: var(--surface);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 6px;
    color: var(--text);
    font-weight: 600;
    font-size: 15px;
}

.brand:hover {
    text-decoration: none;
}

.brand-mark {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent);
    color: var(--accent-fg);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: none;
}

.nav-group {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-label {
    padding: 0 10px 6px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.nav {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0 10px;
    border-radius: var(--radius-control);
    color: var(--text-2);
    font-weight: 500;
}

.nav:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.nav[aria-current="page"] {
    background: var(--surface-2);
    color: var(--text);
}

.nav[aria-current="page"] .i {
    color: var(--accent);
}

.nav .i {
    width: 18px;
    height: 18px;
}

.side-foot {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 6px;
}

.avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--surface-2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 13px;
    flex: none;
    text-transform: uppercase;
}

.user-chip-text {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 13px;
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-status {
    font-size: 11px;
    color: var(--text-3);
}

.main {
    flex: 1 1 auto;
    min-width: 0;
    padding: 28px 32px 48px;
}

.page {
    max-width: 1120px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.page-wide {
    max-width: 1600px;
}

.page-head {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.page-sub {
    margin-top: 4px;
    color: var(--text-2);
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.legal-foot {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    padding-top: 8px;
    font-size: 12px;
    color: var(--text-3);
}

.topbar,
.tabbar {
    display: none;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 16px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
}

.tabbar {
    position: sticky;
    bottom: 0;
    z-index: 20;
    padding: 4px 6px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
}

.tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 52px;
    padding: 0;
    border: 0;
    background: none;
    font: 500 11px var(--font-sans);
    color: var(--text-3);
    cursor: pointer;
}

.tab:hover {
    text-decoration: none;
}

.tab[aria-current="page"] {
    color: var(--accent-text);
}

.tab .i {
    width: 20px;
    height: 20px;
}

/* Tablet: icon rail */
@media (max-width: 1023px) {
    .side {
        flex-basis: var(--rail-width);
        padding: 16px 10px;
        align-items: stretch;
    }

    .side .brand {
        justify-content: center;
        padding: 0;
    }

    .side .brand-text,
    .user-chip-text,
    .side .seg {
        display: none;
    }

    .nav {
        justify-content: center;
        padding: 0;
    }

    .nav-text {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }

    .nav-label {
        font-size: 0;
        height: 1px;
        padding: 0;
        margin: 4px 6px 10px;
        background: var(--border);
    }

    .user-chip {
        flex-direction: column;
        padding: 0;
    }

    .main {
        padding: 24px 24px 40px;
    }
}

/* Phone: top bar + bottom tabs */
@media (max-width: 640px) {
    .shell {
        flex-direction: column;
    }

    .side {
        display: none;
    }

    .topbar,
    .tabbar {
        display: flex;
    }

    .main {
        flex: 1 0 auto;
        padding: 16px 16px 28px;
    }

    .page-title {
        font-size: 22px;
    }

    .btn {
        min-height: 40px;
    }

    .btn-sm {
        min-height: 36px;
    }

    .icon-btn {
        width: 36px;
    }

    .hide-sm {
        display: none !important;
    }
}

@media (min-width: 641px) and (max-width: 1023px) {
    .hide-md {
        display: none !important;
    }
}

/* --- Public layout (logged out) ------------------------------------------------- */

.public-head {
    border-bottom: 1px solid var(--border);
    background: var(--surface);
}

.public-head-inner,
.public-main,
.public-foot-inner {
    max-width: 1120px;
    margin: 0 auto;
    padding-left: 24px;
    padding-right: 24px;
}

.public-head-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding-top: 14px;
    padding-bottom: 14px;
}

.public-main {
    padding-top: 32px;
    padding-bottom: 48px;
}

.public-foot {
    border-top: 1px solid var(--border);
}

.public-foot-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    padding-top: 24px;
    padding-bottom: 24px;
    font-size: 13px;
    color: var(--text-3);
}

@media (max-width: 640px) {
    .public-head-inner,
    .public-main,
    .public-foot-inner {
        padding-left: 16px;
        padding-right: 16px;
    }
}

/* --- Icons ------------------------------------------------------------------------ */

.i {
    width: 16px;
    height: 16px;
    flex: none;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.75;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* --- Buttons ---------------------------------------------------------------------- */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 36px;
    padding: 0 14px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: 500 14px/1 var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
    text-decoration: none;
}

.btn:hover {
    background: var(--surface-2);
    text-decoration: none;
}

.btn:disabled,
.btn[aria-disabled="true"] {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--accent);
    border-color: var(--accent);
    color: var(--accent-fg);
}

.btn-primary:hover {
    background: var(--accent);
    filter: brightness(1.08);
}

.btn-ghost {
    background: transparent;
    border-color: transparent;
    color: var(--text-2);
}

.btn-danger {
    color: var(--neg);
}

.btn[data-copied] {
    color: var(--pos);
}

.btn-sm {
    min-height: 30px;
    padding: 0 10px;
    font-size: 13px;
}

.icon-btn {
    width: 30px;
    padding: 0;
}

.btn-link {
    padding: 0;
    border: 0;
    background: none;
    color: var(--accent-text);
    font: inherit;
    cursor: pointer;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Segmented control (theme switch, filters, buy/sell) */
.seg {
    display: flex;
    gap: 2px;
    padding: 3px;
    border-radius: var(--radius-control);
    background: var(--surface-2);
}

.seg-btn {
    flex: 1;
    min-height: 28px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--text-2);
    font: 500 12px var(--font-sans);
    cursor: pointer;
    white-space: nowrap;
}

.seg-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 14px;
    font-size: 13px;
}

.seg-link:hover {
    text-decoration: none;
    color: var(--text);
}

.seg-link[aria-current="page"],
.seg-btn[aria-pressed="true"] {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 0 0 1px var(--border);
}

/* --- Badges ----------------------------------------------------------------------- */

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 22px;
    padding: 0 8px;
    border-radius: 999px;
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 12px;
    font-weight: 500;
    white-space: nowrap;
}

.badge::before {
    content: "";
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.badge-plain::before {
    display: none;
}

.badge-pos {
    background: var(--pos-soft);
    color: var(--pos);
}

.badge-neg {
    background: var(--neg-soft);
    color: var(--neg);
}

.badge-warn {
    background: var(--warn-soft);
    color: var(--warn);
}

.badge-accent {
    background: var(--accent-soft);
    color: var(--accent-text);
}

.buy {
    color: var(--pos);
    font-weight: 600;
}

.sell {
    color: var(--neg);
    font-weight: 600;
}

/* --- Cards, banners, tiles -------------------------------------------------------- */

.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
}

.card-pad {
    padding: 20px;
}

.card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 16px 12px;
}

.card-title {
    font-size: 16px;
    font-weight: 600;
}

.label {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.muted {
    color: var(--text-3);
}

.small {
    font-size: 13px;
}

.banner {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius-card);
    border: 1px solid var(--border);
    background: var(--surface);
}

.banner-text {
    flex: 1 1 280px;
}

.banner-info {
    background: var(--accent-soft);
}

.banner-success {
    background: var(--pos-soft);
}

.banner-error {
    background: var(--neg-soft);
}

.banner-warn {
    background: var(--warn-soft);
}

.banner-info > .i {
    color: var(--accent-text);
}

.banner-success > .i {
    color: var(--pos);
}

.banner-error > .i {
    color: var(--neg);
}

.banner-warn > .i {
    color: var(--warn);
}

.tiles {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
}

.tile {
    padding: 18px 20px;
}

.tile-label {
    font-size: 13px;
    color: var(--text-2);
}

.tile-value {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

@media (max-width: 640px) {
    .tiles {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }
}

/* Two columns that stack on narrow screens: main content + side summaries */
.split {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    align-items: flex-start;
}

.split-main {
    flex: 2 1 560px;
    min-width: 0;
}

.split-side {
    flex: 1 1 300px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Rows inside a card (accounts, webhooks) */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 56px;
    padding: 10px 16px;
    border-top: 1px solid var(--border);
}

.list-row-text {
    flex: 1;
    min-width: 0;
}

.list-row-title {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-row-sub {
    font-size: 12px;
    color: var(--text-3);
}

/* Broker letter mark (no brand colours, ADR 0012) */
.mark {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 15px;
    color: var(--text-2);
    flex: none;
    text-transform: uppercase;
}

/* Clickable tile (connect a broker) */
.tile-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.tile-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 68px;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    width: 100%;
}

.tile-link:hover {
    border-color: var(--accent);
    text-decoration: none;
}

.tile-link .i {
    color: var(--text-3);
}

.account-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 12px 14px;
    padding: 16px 18px;
    border-top: 1px solid var(--border);
}

.account-row:first-child {
    border-top: 0;
}

.account-row[data-needs-reconnect] {
    background: var(--warn-soft);
}

.account-row-text {
    flex: 1 1 240px;
    min-width: 0;
}

@media (max-width: 640px) {
    .account-row {
        padding: 14px;
    }

    .account-row .actions {
        width: 100%;
        gap: 2px;
    }

    .account-row .btn-sm {
        padding: 0 8px;
    }
}

/* Multi-step dialog: only the current step shows */
.dlg-step[hidden],
.banner[hidden] {
    display: none !important;
}

/* Long-form documents (legal pages, generated by scripts/build_legal_pages.py) */
.legal-doc {
    max-width: 820px;
    font-size: 15px;
    line-height: 1.65;
}

.legal-doc > * + * {
    margin-top: 12px;
}

.legal-doc h2 {
    margin-top: 28px;
    font-size: 18px;
    font-weight: 600;
}

.legal-doc h3 {
    margin-top: 20px;
    font-size: 16px;
    font-weight: 600;
}

.legal-doc ul,
.legal-doc ol {
    padding-left: 22px;
    margin-bottom: 0;
}

.legal-doc li + li {
    margin-top: 6px;
}

.legal-doc hr {
    border: 0;
    border-top: 1px solid var(--border);
    margin: 24px 0;
}

.callout {
    padding: 12px 16px;
    border-radius: var(--radius-control);
    background: var(--warn-soft);
}

.doc-table td,
.doc-table th {
    white-space: normal;
    vertical-align: top;
    border: 1px solid var(--border);
}

/* Settings: label column + content column, stacks on narrow screens */
.settings-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px 32px;
    padding: 24px;
    border-top: 1px solid var(--border);
}

.settings-row:first-child {
    border-top: 0;
}

.settings-head {
    flex: 1 1 220px;
    max-width: 300px;
}

.settings-head h2 {
    font-size: 15px;
    font-weight: 600;
}

.settings-head p {
    margin-top: 4px;
    font-size: 13px;
    color: var(--text-2);
}

.settings-body {
    flex: 999 1 360px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.theme-choices {
    display: flex;
    gap: 12px;
}

.theme-choice {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 10px;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
    font: 500 13px var(--font-sans);
    text-align: left;
    cursor: pointer;
}

.theme-choice[aria-pressed="true"] {
    border-color: var(--accent);
    box-shadow: 0 0 0 1px var(--accent);
}

.theme-swatch {
    height: 56px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
}

.theme-swatch-light {
    background: linear-gradient(90deg, #FFFFFF 0 30%, #F7F7F8 30%);
}

.theme-swatch-dark {
    background: linear-gradient(90deg, #141418 0 30%, #0C0C0F 30%);
}

.theme-swatch-system {
    background: linear-gradient(90deg, #F7F7F8 0 50%, #0C0C0F 50%);
}

@media (max-width: 640px) {
    .settings-row {
        padding: 18px 16px;
    }

    .settings-head {
        max-width: none;
    }
}

/* Landing page */
.hero {
    display: flex;
    flex-wrap: wrap;
    gap: 48px;
    align-items: center;
    padding: 32px 0 16px;
}

.hero-text {
    flex: 1 1 440px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.hero-title {
    font-size: 48px;
    line-height: 1.08;
    font-weight: 700;
    letter-spacing: -0.03em;
}

.hero-lead {
    font-size: 18px;
    color: var(--text-2);
    max-width: 540px;
}

.hero-visual {
    flex: 1 1 380px;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
}

.btn-lg {
    min-height: 44px;
    padding: 0 18px;
    font-size: 15px;
}

.google-mark {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--accent-fg);
    color: var(--accent);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
}

.check > .i {
    margin-top: 3px;
    color: var(--accent);
}

@media (max-width: 640px) {
    .hero {
        gap: 32px;
        padding-top: 8px;
    }

    .hero-title {
        font-size: 34px;
    }

    .hero-lead {
        font-size: 16px;
    }
}

/* Narrow centred page (sign-up, accept, log out) */
.narrow {
    max-width: 560px;
    width: 100%;
    margin: 0 auto;
}

.form-stack {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* Numbered getting-started steps */
.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
}

.step-num {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-soft);
    color: var(--accent-text);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
}

@media (max-width: 1023px) {
    .steps {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
    }
}

/* Empty state */
.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 40px 20px;
    text-align: center;
    color: var(--text-2);
}

.empty .i {
    width: 28px;
    height: 28px;
    color: var(--text-3);
}

/* Loading */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .spinner {
        animation-duration: 2s;
    }
}

/* --- Tables ----------------------------------------------------------------------- */

.table-wrap {
    position: relative;
    overflow-x: auto;
}

.tbl tr[data-click] {
    cursor: pointer;
}

.tbl {
    width: 100%;
    border-collapse: collapse;
}

.tbl th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-3);
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tbl td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    white-space: nowrap;
}

.tbl tr:last-child td {
    border-bottom: 0;
}

.tbl tr[aria-selected="true"] td {
    background: var(--accent-soft);
}

@media (max-width: 1023px) {
    .tbl th,
    .tbl td {
        padding-left: 10px;
        padding-right: 10px;
    }
}

@media (max-width: 640px) {
    .tbl th,
    .tbl td {
        padding-left: 8px;
        padding-right: 8px;
    }

    .tbl th:first-child,
    .tbl td:first-child {
        padding-left: 14px;
    }
}

/* --- Forms ------------------------------------------------------------------------ */

.field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.field > label {
    font-size: 13px;
    font-weight: 500;
}

.hint {
    font-size: 12px;
    color: var(--text-3);
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
}

details > summary {
    color: var(--accent-text);
}

.input {
    width: 100%;
    min-height: 36px;
    padding: 0 12px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text);
    font: 400 14px var(--font-sans);
}

.input:disabled {
    background: var(--surface-2);
    color: var(--text-3);
}

.input[aria-invalid="true"] {
    border-color: var(--neg);
}

.code-block {
    margin: 0;
    padding: 14px 16px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    background: var(--surface-2);
    color: var(--text);
    line-height: 1.6;
    white-space: pre;
    overflow-x: auto;
}

.code-inline {
    padding: 9px 12px;
    border-radius: var(--radius-control);
    border: 1px solid var(--border);
    background: var(--surface-2);
    overflow-wrap: anywhere;
}

.check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.check input {
    margin-top: 3px;
    accent-color: var(--accent);
}

/* --- Dialogs (native <dialog>) --------------------------------------------------- */

dialog.dlg {
    width: min(480px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    padding: 0;
    border: 1px solid var(--border);
    border-radius: var(--radius-card);
    background: var(--surface);
    color: var(--text);
}

dialog.dlg::backdrop {
    background: rgba(12, 12, 15, 0.55);
}

.dlg-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 20px 0;
}

.dlg-title {
    font-size: 17px;
    font-weight: 600;
}

.dlg-body {
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.dlg-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 20px 18px;
}

/* Phone: dialogs become bottom sheets */
@media (max-width: 640px) {
    dialog.dlg {
        width: 100vw;
        max-width: 100vw;
        margin: auto 0 0;
        border-radius: 16px 16px 0 0;
        border-bottom: 0;
    }
}

@media (min-width: 641px) {
    dialog.dlg-wide {
        width: min(640px, calc(100vw - 32px));
    }
}

/* Label / value pairs in a details dialog */
.facts {
    display: grid;
    grid-template-columns: max-content minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
}

.facts dt {
    color: var(--text-3);
    font-size: 13px;
}

.facts dd {
    margin: 0;
    overflow-wrap: anywhere;
}

/* Filter bar */
.filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sheet-list {
    display: flex;
    flex-direction: column;
}

.sheet-item {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 48px;
    padding: 0 4px;
    border: 0;
    border-bottom: 1px solid var(--border);
    background: none;
    color: var(--text);
    font: 500 15px var(--font-sans);
    text-align: left;
    width: 100%;
    cursor: pointer;
}

.sheet-item:last-child {
    border-bottom: 0;
}

.sheet-item:hover {
    text-decoration: none;
}

/* Fixed-position session warning */
.toast-top {
    position: fixed;
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    width: min(520px, calc(100vw - 24px));
}
