/* Fonts */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;700&display=swap&font-display=swap');

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Base Typography And Document */
html, body {
    margin: 0;
    padding: 0;
    width: 100%;
    height: auto;
    overflow-x: clip;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    scroll-behavior: smooth;
    font-family: 'Poppins', sans-serif;
    background-color: var(--page-bg, #111816);
    color: var(--text, #000);
}

/* Legacy Standalone Page Layout */
.container {
    margin: auto;
    text-align: center;
    width: min(90%, 1200px);
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    font-size: clamp(1rem, 1.2vw, 1.2rem);
}

/* Base Elements */
h1, h2 {
    color: inherit;
    transition: color 0.3s ease-in-out;
}

h1 {
    font-size: 3rem;
    font-weight: 700;
    margin-bottom: 20px;
}

a {
    color: inherit; /* Inherits the text color from <h1> */
}

h2 {
    font-size: 2rem;
    margin-bottom: 1px;
    line-height: 1;
}

.small-text {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.45;
}

.error-text {
    color: #c62828;
}

.miner-link {
    color: #007bff;
    text-decoration: none;
    overflow-wrap: anywhere;
    word-break: break-word;
}

p {
    font-size: 1.2rem;
    margin-bottom: 20px;
    line-height: 1.5;
    color: inherit;
    object-fit: contain;
}

img {
    width: 100%;
    max-width: 450px;
    height: auto;
}

/* Base Tables */
table {
    border-collapse: collapse;
    width: auto;
    background-color: inherit;
    font-size: 0.9rem;
    color: inherit;
    margin:0 auto;
}

th, td {
    border: none;
    padding: 8px 12px;
    text-align: left;
    background-color: inherit;
    color: inherit;
}

th {
    background-color: rgba(15, 118, 110, 0.08);
}

/* Stake modal */
.wallet-modal-content {
    width: min(100%, 360px);
    height: auto;
    max-height: calc(100vh - 48px);
    padding: 0;
    overflow: hidden;
    color: var(--text);
}

.governance-dialog .overlay-dialog-body.wallet-dialog-body {
    padding: 16px;
}

.wallet-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.stake-warning {
    display: grid;
    gap: 10px;
    margin-bottom: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
}

.stake-warning[hidden] {
    display: none;
}

.stake-warning strong {
    color: var(--accent-strong);
    font-size: 1rem;
}

.stake-warning p {
    margin: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.stake-continue-button {
    min-height: 42px;
    background: var(--accent);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font: inherit;
    font-weight: 800;
}

.stake-continue-button:hover {
    background: var(--accent-strong);
    transform: none;
}

.wallet-list button.wallet-option {
    position: static;
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    min-height: 52px;
    background: var(--control-surface);
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    justify-content: flex-start;
    text-align: left;
    font: inherit;
    font-weight: 700;
    box-shadow: none;
}

.wallet-list button.wallet-option:hover {
    background: var(--control-hover-surface);
    transform: none;
}

.wallet-option img {
    width: 28px;
    max-width: 28px;
    height: 28px;
    border-radius: 4px;
    flex: 0 0 auto;
}

.wallet-status {
    margin: 10px 0 0;
    font-size: 0.9rem;
    color: var(--muted);
}

.wallet-status a {
    color: var(--accent-strong);
    font-weight: 600;
}

/* Base Interactive Elements */
button {
    transition: all 0.3s ease;
    cursor:pointer;
    background-color: #0f766e;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
}

button:hover {
    background-color: #115e59;
    transform: scale(1.02);
}

button:focus {
    outline: 3px solid rgba(20, 184, 166, 0.55);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}

a:focus {
    outline: 2px solid rgba(20, 184, 166, 0.55);
    outline-offset: 2px;
}

/* Legacy Footer */
footer {
    font-size: 0.7rem;
    text-align: center;
    padding: 10px;
}

/* Legacy Standalone Responsive */
@media (max-width: 480px) {
    h1 {
        font-size: 2.0rem;
    }
    h2 {
        font-size: 1.7rem;
    }
    .small-text {
        font-size: 0.8rem;
    }
    footer {
        font-size: 0.7rem;
    }
    p {
        font-size: 0.9rem;
    }

    .links a img {
        width: 30px;
    }

    .container {
        font-size: 0.9rem;
    }
    table {
        font-size: 0.9rem;
        width: 100%;
        min-width: 0;
        table-layout: fixed;
        overflow-x: hidden;
    }
    th, td {
        border: none;
        padding: 5px 5px;
        text-align: left;
        background-color: inherit;
        color: inherit;
    }
}

/* Theme Tokens */
:root {
    --page-bg: #f7f9f7;
    --surface: #ffffff;
    --surface-muted: #e8f0ed;
    --text: #161616;
    --muted: #5d6470;
    --line: rgba(22, 22, 22, 0.12);
    --accent: #0f766e;
    --accent-strong: #115e59;
    --gold: #b7791f;
    --shadow: 0 18px 45px rgba(22, 22, 22, 0.08);
    --overlay-surface: #ffffff;
    --overlay-surface-muted: #f3f7f5;
    --overlay-surface-strong: #e8f0ed;
    --overlay-label-bg: rgba(255, 255, 255, 0.94);
    --overlay-shadow: 0 28px 80px rgba(22, 22, 22, 0.18);
    --governance-card-bg: rgba(255, 255, 255, 0.92);
    --governance-card-hover-bg: #eef6f3;
    --header-bg: rgba(247, 249, 247, 0.88);
    --control-surface: rgba(255, 255, 255, 0.48);
    --control-hover-surface: rgba(15, 118, 110, 0.12);
    --panel-surface: rgba(255, 255, 255, 0.78);
    --panel-surface-muted: rgba(255, 255, 255, 0.72);
    --button-surface: rgba(255, 255, 255, 0.64);
    --field-surface: #ffffff;
    --compact-ticker-font-size: 0.9rem;
}

/* App Shell */
html {
    --site-header-height: 72px;
    scroll-padding-top: calc(var(--site-header-height) + 6px);
}

html,
body,
/* Main Layout */
#main-content {
    height: auto;
}

body {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 34%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.10), transparent 28%),
        var(--page-bg);
    color: var(--text);
    padding-top: var(--site-header-height);
    padding-bottom: 0;
}

html {
    background:
        linear-gradient(135deg, rgba(15, 118, 110, 0.08), transparent 34%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.10), transparent 28%),
        var(--page-bg);
}

#main-content {
    overflow: visible;
    scroll-snap-type: none;
}

/* Header / Menu module */
.site-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--header-bg);
    border-bottom: 0;
    box-shadow: 0 10px 30px rgba(22, 22, 22, 0.05);
    backdrop-filter: blur(16px);
}

.header-inner {
    width: min(1920px, calc(100% - 32px));
    margin: 0 auto;
}

.menu-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 54px;
    padding: 0;
    gap: 8px;
}

.menu-bar__nav {
    display: flex;
    align-items: center;
    flex: 1 1 auto;
    justify-content: flex-start;
    gap: 4px;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    padding: 7px 9px;
    border-radius: 8px;
    font-size: 0.88rem;
    font-weight: 700;
}

.nav-button {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.tdspbot-nav-icon {
    display: block;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    animation: constitution-label-blink 1.6s ease-in-out infinite;
}

.nav-db-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--muted);
    padding: 7px 6px;
    font-size: 0.88rem;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
}

.nav-db-status__dot {
    width: 8px;
    height: 8px;
    flex: 0 0 8px;
    border-radius: 999px;
    background: var(--muted);
}

.nav-db-status.is-active .nav-db-status__dot {
    background: #34d399;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.40);
    animation: database-status-pulse 1.6s ease-in-out infinite;
}

.nav-db-status.is-loading .nav-db-status__dot {
    background: #f59e0b;
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.40);
    animation: database-status-pulse 1.2s ease-in-out infinite;
}

.nav-db-status.is-down .nav-db-status__dot {
    background: #ef4444;
}

@keyframes database-status-pulse {
    0%, 100% {
        box-shadow: 0 0 0 0 currentColor;
    }
    50% {
        box-shadow: 0 0 0 5px rgba(0, 0, 0, 0);
    }
}

.nav-home-link {
    flex: 0 0 auto;
}

.nav-row-break {
    display: none;
}

.menu-epoch {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 700;
    white-space: nowrap;
}

.nav-status {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    line-height: 1;
    cursor: default;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(15, 118, 110, 0.10);
    color: var(--accent-strong);
}

.menu-bar__side {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    margin-left: auto;
    gap: 8px;
}

.menu-bar__actions {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 0 0 auto;
    gap: 8px;
}

.site-alerts {
    position: relative;
}

.site-alerts-button {
    border: 0;
    background: transparent;
    font-family: inherit;
    cursor: pointer;
}

.site-alerts-button.is-enabled {
    color: #34d399;
}

.site-alerts-button.is-blocked {
    color: #fb7185;
}

.site-alerts-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    z-index: 1200;
    display: grid;
    width: min(260px, calc(100vw - 28px));
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface);
    color: var(--text);
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
}

.site-alerts-menu[hidden] {
    display: none;
}

.site-alerts-menu strong {
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 800;
}

.site-alerts-menu label {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 700;
}

.site-alerts-menu input {
    accent-color: var(--accent);
}

.site-alerts-menu button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control-surface);
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
}

.site-alerts-menu button:hover,
.site-alerts-menu button:focus-visible {
    background: var(--control-hover-surface);
    transform: none;
}

.site-alerts-menu span {
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 700;
}

.theme-toggle {
    display: grid;
    place-items: center;
    width: 26px;
    height: 26px;
    flex: 0 0 auto;
    border: 0;
    border-radius: 0;
    background: transparent;
    text-decoration: none;
    box-shadow: none;
}

.theme-toggle {
    padding: 0;
    color: var(--accent-strong);
    cursor: pointer;
}

.theme-toggle-icon {
    display: none;
    font-size: 1.12rem;
    line-height: 1;
}

.theme-toggle:not([data-next-theme]) .theme-toggle-icon--moon,
.theme-toggle[data-next-theme="dark"] .theme-toggle-icon--moon,
.theme-toggle[data-next-theme="light"] .theme-toggle-icon--sun {
    display: block;
}

html[data-theme="dark"] .theme-toggle:not([data-next-theme]) .theme-toggle-icon--moon {
    display: none;
}

html[data-theme="dark"] .theme-toggle:not([data-next-theme]) .theme-toggle-icon--sun {
    display: block;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
    background: transparent;
}

/* Section Layout */
.section {
    min-height: auto;
    padding: 96px 20px;
    scroll-snap-align: none;
}

.section-inner {
    width: min(1120px, 100%);
    margin: 0 auto;
    min-width: 0;
}

/* Hero */
.hero {
    min-height: calc(100vh - 72px);
    display: flex;
    align-items: center;
    background: transparent;
}

.hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    column-gap: 56px;
    row-gap: 28px;
    align-items: center;
}

.hero-copy,
.section-inner {
    text-align: left;
}

.reveal {
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 600ms ease, transform 600ms ease;
}

.reveal.visible {
    opacity: 1;
    transform: none;
}

.hero-copy,
.hero-media,
.hero-grid {
    min-width: 0;
}

.hero-brand {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 56px;
    align-items: center;
    margin: 28px 0;
    min-width: 0;
}

/* Shared Type Treatments */
.eyebrow {
    margin-bottom: 12px;
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

h1 {
    max-width: 760px;
    margin: 0 0 18px;
    color: var(--text);
    font-size: clamp(2.8rem, 8vw, 6rem);
    line-height: 0.95;
}

h2 {
    max-width: 740px;
    margin: 0 0 18px;
    color: var(--text);
    font-size: clamp(2rem, 4vw, 3.8rem);
    line-height: 1;
}

p {
    max-width: 760px;
    color: var(--muted);
}

.lead {
    width: 100%;
    max-width: 620px;
    font-size: clamp(1.1rem, 2vw, 1.35rem);
}

.hero-media {
    display: grid;
    gap: 18px;
    justify-items: center;
}

.hero-logo {
    width: min(100%, 420px);
    max-width: none;
    filter: drop-shadow(0 26px 28px rgba(22, 22, 22, 0.14));
}

.price-section {
    grid-column: 1 / -1;
    width: 100%;
}

.pool-summary,
.starch-summary,
.governance-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(calc((100% - 56px) / 5), 1fr));
    gap: 14px;
}

.pool-summary,
.starch-summary {
    margin: 18px 0;
}

.pool-summary > div,
.pool-summary > a,
.starch-summary > div {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
}

.pool-summary > div,
.pool-summary > a,
.starch-summary > div,
.governance-summary > div {
    padding: 18px;
    min-width: 0;
}

.pool-summary > a {
    color: inherit;
    text-decoration: none;
}

.pool-summary strong,
.starch-summary strong {
    display: block;
    color: var(--accent-strong);
    font-size: 1.45rem;
    font-weight: 700;
    line-height: 1.15;
}

.pool-summary span,
.starch-summary span {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
}

.pool-summary.price-panel {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 0;
}

.price-panel > div {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 72px;
    align-items: center;
    column-gap: 12px;
}

.price-panel > div > strong,
.price-panel > div > span {
    grid-column: 1;
    min-width: 0;
}

.price-panel > div > strong {
    max-width: 100%;
    overflow-wrap: anywhere;
    font-variant-numeric: tabular-nums;
}

.price-sparkline {
    grid-column: 2;
    grid-row: 1 / span 2;
    width: 72px;
    height: 36px;
    overflow: visible;
}

.price-sparkline polyline {
    fill: none;
    stroke: var(--accent-strong);
    stroke-width: 2;
    vector-effect: non-scaling-stroke;
}

.price-panel strong.is-price-up,
.price-history-current.is-price-up {
    color: #34d399;
}

.price-panel strong.is-price-down,
.price-history-current.is-price-down {
    color: #f87171;
}

.price-sparkline.is-price-up polyline {
    stroke: #34d399;
}

.price-sparkline.is-price-down polyline {
    stroke: #f87171;
}

.price-history-current {
    display: block;
    margin-bottom: 14px;
    color: var(--text);
    font-size: 1.45rem;
}

.price-history-intervals {
    display: inline-grid;
    grid-template-columns: repeat(4, minmax(64px, 1fr));
    gap: 4px;
    margin: 0 0 14px;
    padding: 4px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control-surface);
}

.price-history-interval {
    min-height: 36px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
    cursor: pointer;
}

.price-history-interval:is(:hover, :focus-visible),
.price-history-interval[aria-pressed="true"] {
    outline: 0;
    background: var(--surface);
    color: var(--text);
}

.price-history-chart-frame {
    position: relative;
    width: 100%;
    height: 360px;
    min-width: 0;
}

.price-history-chart-frame.is-tradingview {
    overflow: hidden;
    border-radius: 8px;
    background: var(--bg);
}

.tradingview-widget-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.tradingview-link-warning {
    margin: 0 0 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.45;
}

.youtube-video-panel,
.youtube-video-frame {
    width: 100%;
    min-width: 0;
}

.youtube-video-frame {
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #000;
    aspect-ratio: 16 / 9;
}

.youtube-video-frame iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.pool-summary-clickable {
    cursor: pointer;
}

.pool-status-value.is-active {
    color: #34d399;
}

.pool-status-value.is-warning {
    color: #f59e0b;
}

.pool-status-value.is-inactive {
    color: #f87171;
}

.starch-summary strong.is-online {
    color: #34d399;
}

.starch-summary span.is-offline {
    color: #f87171;
    font-weight: 700;
}

.starch-summary span.starch-miner-status-lines {
    color: var(--muted);
}

.starch-summary span.starch-miner-status-lines span {
    color: var(--muted);
    display: block;
    margin-top: 0;
}

.starch-summary span.starch-miner-status-lines .starch-miner-offline-count {
    color: #f87171;
    font-weight: 700;
    margin-top: 2px;
}

.pool-summary .pool-provider-label,
.starch-summary .pool-provider-label {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.pool-summary .pool-provider-label > .pool-provider-label-text,
.starch-summary .pool-provider-label > .pool-provider-label-text {
    display: inline;
    margin-top: 0;
    color: inherit;
    font-size: var(--compact-ticker-font-size);
}

.pool-provider-icon {
    width: 20px;
    height: 20px;
    flex: 0 0 auto;
    object-fit: contain;
}

.pool-summary .pool-provider-symbol {
    display: inline-grid;
    place-items: center;
    margin-top: 0;
    color: var(--accent-strong);
    font-size: 1.15rem;
    font-weight: 700;
    line-height: 1;
}

.pool-relay-icon {
    color: var(--muted);
}

html[data-theme="dark"] .pool-provider-icon--monochrome {
    filter: invert(1);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) .pool-provider-icon--monochrome {
        filter: invert(1);
    }
}

.pool-delegator-list {
    display: grid;
    gap: 12px;
}

.pool-delegator-row {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: start;
    gap: 14px;
    padding: 16px;
}

.pool-delegator-content {
    display: grid;
    min-width: 0;
    gap: 5px;
}

.pool-delegator-address-line {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 8px;
}

.pool-delegator-address {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-size: 0.95rem;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pool-delegator-handle {
    color: var(--accent-strong);
    font-size: 1.05rem;
    font-weight: 800;
}

.pool-delegator-copy-button {
    flex: 0 0 auto;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1;
}

.pool-delegator-copy-button:hover,
.pool-delegator-copy-button:focus-visible {
    background: var(--button-surface);
    color: var(--text);
    transform: none;
}

.starch-directory-id-line {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
}

.starch-directory-id-line > span {
    min-width: 0;
    overflow: hidden;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.starch-company-card,
.starch-miner-card,
.starch-pool-link-card {
    cursor: pointer;
}

.starch-company-detail {
    display: grid;
    gap: 16px;
}

.starch-company-detail-summary {
    margin: 0;
}

.starch-company-id-line .pool-delegator-copy-button {
    flex: 0 0 auto;
    margin-left: auto;
}

.pool-delegator-amount {
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 800;
}

.pool-delegator-wallet-address {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
    overflow-wrap: anywhere;
}

.pool-delegator-epoch {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.pool-id-line {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    margin: 0;
    padding: 10px 54px 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
    color: var(--muted);
    font-size: 0.9rem;
}

.pool-id-line > span {
    flex: 0 0 auto;
    font-weight: 700;
}

.pool-id-line > strong {
    min-width: 0;
    overflow: hidden;
    color: var(--text);
    font-weight: 800;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pool-copy-icon-button {
    position: absolute;
    right: 8px;
    width: 28px;
    height: 28px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: var(--button-surface);
    color: var(--text);
    font-size: 0.9rem;
    line-height: 1;
}

.pool-copy-icon-button:hover {
    background: var(--surface);
    transform: none;
}

.pool-id-copy-button {
    top: 50%;
    transform: translateY(-50%);
}

.pool-id-copy-button:hover {
    transform: translateY(-50%);
}

.pool-relays {
    display: grid;
    gap: 10px;
}

.pool-maintenance-notice {
    margin: 0;
    color: var(--gold);
    font-weight: 700;
}

.pool-notification-button {
    justify-self: start;
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--control-surface);
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.84rem;
    font-weight: 800;
}

.pool-notification-button:hover {
    background: var(--control-hover-surface);
    transform: none;
}

.table-shell {
    width: 100%;
    margin-top: 24px;
    min-width: 0;
    overflow-x: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel-surface-muted);
    box-shadow: 0 10px 24px rgba(22, 22, 22, 0.04);
}

.table-shell table {
    width: 100%;
    min-width: 0;
    table-layout: fixed;
    font-size: 0.9rem;
}

.table-shell th,
.table-shell td {
    padding: 12px 14px;
    border-bottom: 1px solid rgba(22, 22, 22, 0.08);
}

.table-shell th {
    background: rgba(15, 118, 110, 0.08);
    color: var(--text);
    font-weight: 700;
}

.starch-company-chart {
    width: 100% !important;
    max-height: 360px;
    margin: 8px 0;
}

.cardano-event-sources {
    margin: 28px 0 18px;
}

.cardano-event-source-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
}

.cardano-event-source-tile {
    position: relative;
    align-items: center;
    overflow: hidden;
}

.cardano-event-source-tile.has-image {
    isolation: isolate;
}

.cardano-event-source-copy {
    position: relative;
    z-index: 2;
    display: grid;
    min-width: 0;
    gap: 4px;
    text-align: left;
}

.cardano-event-source-tile.has-image .cardano-event-source-copy {
    width: 64%;
    margin-right: auto;
}

.cardano-event-source-image {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 1;
    width: 72%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    object-fit: contain;
    object-position: right center;
    background: var(--overlay-surface-muted);
    opacity: 0.62;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.5) 32%, #000 58%, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, rgba(0, 0, 0, 0.5) 32%, #000 58%, #000 100%);
}

.cardano-event-source-content {
    display: grid;
    gap: 18px;
}

.cardano-events-grid {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 14px;
    margin: 0;
}

.cardano-event-card {
    position: relative;
    display: grid;
    min-width: 0;
    min-height: 132px;
    align-content: start;
    gap: 8px;
    padding: 16px;
    overflow: hidden;
    width: 100%;
    color: var(--text);
    font: inherit;
    text-align: left;
    cursor: pointer;
    appearance: none;
}

.cardano-event-card.has-image {
    isolation: isolate;
}

.cardano-event-card > :not(.cardano-event-card-image) {
    position: relative;
    z-index: 2;
}

.cardano-event-card-image {
    position: absolute;
    inset: 0 0 0 auto;
    z-index: 1;
    width: 86%;
    height: 100%;
    border: 0;
    border-radius: inherit;
    object-fit: contain;
    object-position: right center;
    opacity: 0.5;
    pointer-events: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, transparent 28%, rgba(0, 0, 0, 0.4) 58%, #000 100%);
    mask-image: linear-gradient(to right, transparent 0%, transparent 28%, rgba(0, 0, 0, 0.4) 58%, #000 100%);
}

.cardano-event-card.has-image .cardano-event-date,
.cardano-event-card.has-image .cardano-event-title,
.cardano-event-card.has-image .cardano-event-meta {
    max-width: 78%;
}

.cardano-event-date {
    color: var(--accent-strong);
    font-size: 0.72rem;
    font-weight: 800;
    line-height: 1.3;
    text-transform: uppercase;
}

.cardano-event-title {
    display: block;
    margin: 0;
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 800;
    line-height: 1.3;
    overflow-wrap: anywhere;
}

.cardano-event-meta {
    margin: 0;
    color: var(--muted);
    font-size: 0.76rem;
    font-weight: 700;
    overflow: hidden;
    line-height: 1.4;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cardano-event-detail {
    display: grid;
    gap: 20px;
}

.cardano-event-detail-image {
    width: 100%;
    max-height: min(52vh, 520px);
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    background: var(--overlay-surface-muted);
}

.cardano-event-detail-facts {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.cardano-event-detail-fact {
    display: grid;
    min-width: 0;
    gap: 4px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
}

.cardano-event-detail-fact strong {
    color: var(--accent-strong);
    font-size: 0.78rem;
}

.cardano-event-detail-fact span,
.cardano-event-detail-description {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.cardano-event-detail-description {
    margin: 0;
    line-height: 1.6;
}

.cardano-event-link {
    justify-self: start;
    color: var(--accent-strong);
    font-size: 0.88rem;
    font-weight: 800;
}

.cardano-event-link:hover,
.cardano-event-link:focus-visible {
    color: var(--accent);
}

/* Governance Overview */
.governance-summary {
    margin: 28px 0 24px;
}

.governance-page {
    align-items: flex-start;
    padding-top: 96px;
}

.constitution-chat {
    display: grid;
    gap: 14px;
    width: 100%;
    margin: 22px 0 18px;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
}

.constitution-chat:hover,
.constitution-chat:focus-within {
    border-color: var(--line);
    background: var(--governance-card-bg);
    box-shadow: none;
    transform: none;
}

.constitution-chat-heading {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    justify-content: space-between;
}

.constitution-chat-heading-copy {
    display: grid;
    gap: 3px;
}

.constitution-chat-heading strong {
    color: var(--text);
    font-size: 1rem;
}

.constitution-chat-heading span,
.constitution-chat-heading button {
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.4;
}

.constitution-chat-heading button {
    flex: 0 0 auto;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--accent-strong);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 700;
    cursor: pointer;
}

.constitution-chat-heading button:hover,
.constitution-chat-heading button:focus-visible {
    color: var(--accent);
    outline: none;
}

.constitution-chat-heading button:disabled {
    cursor: wait;
    opacity: 0.55;
}

.governance-constitution-dialog {
    width: min(1040px, 100%);
    max-height: min(92vh, 1080px);
}

.governance-constitution-chat-dialog {
    width: min(920px, 100%);
    max-height: min(88vh, 960px);
}

.governance-constitution-chat-dialog .constitution-chat {
    margin: 0;
}

.constitution-document {
    min-width: 0;
}

.constitution-document-text {
    width: 100%;
    margin: 0;
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.65;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
}

.constitution-chat-messages {
    display: grid;
    gap: 10px;
    align-content: start;
    grid-auto-rows: max-content;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
}

.constitution-chat-empty,
.constitution-chat-message p,
.constitution-chat-status,
.constitution-chat-note {
    margin: 0;
    font-size: 0.88rem;
}

.constitution-chat-empty,
.constitution-chat-status,
.constitution-chat-note {
    color: var(--muted);
}

.constitution-chat-message {
    display: grid;
    gap: 4px;
    align-content: start;
    min-width: 0;
    max-width: 100%;
    padding: 11px 12px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface-muted);
}

.constitution-chat-message p {
    min-width: 0;
    max-width: 100%;
    color: var(--text);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.constitution-chat-message .constitution-chat-stake-prompt {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.88rem;
}

.constitution-chat-stake-prompt a {
    color: var(--accent);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.constitution-chat-stake-prompt a:hover,
.constitution-chat-stake-prompt a:focus-visible {
    color: var(--text);
}

.constitution-chat-feedback {
    display: grid;
    gap: 8px;
    margin-top: 8px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.88rem;
}

.constitution-chat-feedback-actions {
    display: flex;
    gap: 8px;
}

.constitution-chat-feedback-actions button {
    min-height: 38px;
    width: auto;
    margin: 0;
    padding: 0 16px;
    font-size: 0.85rem;
}

.constitution-chat-feedback-actions button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.constitution-chat-form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: end;
}

.constitution-chat-form textarea {
    width: 100%;
    min-width: 0;
    min-height: 44px;
    max-height: 128px;
    padding: 10px 12px;
    resize: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    outline: none;
    background: var(--surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    line-height: 1.45;
}

.constitution-chat-form textarea:focus {
    border-color: var(--accent);
}

.constitution-chat-form-actions {
    display: flex;
    align-items: stretch;
    gap: 10px;
}

.constitution-chat-form-actions .governance-vote-button,
.constitution-chat-form-actions .governance-vote-secondary {
    min-height: 44px;
    width: auto;
    margin: 0;
    padding: 0 18px;
    font-size: 0.88rem;
    cursor: pointer;
    white-space: nowrap;
}

.constitution-chat-form-actions .governance-vote-button {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: var(--surface);
}

.constitution-chat-form-actions button:disabled {
    cursor: wait;
    opacity: 0.6;
}

.constitution-chat-note {
    font-size: 0.76rem;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.governance-summary > div {
    display: grid;
    gap: 4px;
}

.governance-summary-clickable {
    cursor: pointer;
}

.governance-menu-card {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.governance-menu-card:hover,
.governance-menu-card:focus-visible {
    border-color: var(--accent);
    background: var(--governance-card-hover-bg);
    box-shadow: 0 14px 30px rgba(20, 184, 166, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.governance-summary strong {
    color: var(--accent-strong);
    font-size: 1.45rem;
    line-height: 1.15;
}

.governance-summary-inline-percent {
    color: var(--muted) !important;
    display: inline-block;
    font-size: 0.72rem !important;
    font-weight: 800;
    margin-left: 6px;
    vertical-align: baseline;
}

@keyframes constitution-label-blink {
    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.32;
    }
}

@media (prefers-reduced-motion: reduce) {
    .tdspbot-nav-icon {
        animation: none;
    }
}

.governance-summary span {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.governance-summary-subvalue {
    margin-top: 6px;
    font-size: 0.88rem !important;
    font-weight: 700;
    line-height: 1.15;
}

.drep-ncl-bar {
    display: grid;
    gap: 6px;
    margin-top: 8px;
    min-width: 0;
}

.drep-ncl-bar-track {
    display: flex;
    width: 100%;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.16);
}

.drep-ncl-bar-fill {
    display: block;
    min-width: 0;
    transition: flex-basis 0.25s ease;
}

.drep-ncl-bar-fill--spend {
    background: #34d399;
}

.drep-ncl-bar-fill--left {
    background: #fb7185;
}

.drep-ncl-bar-label {
    overflow-wrap: anywhere;
}

#gov-spo-scan-status[hidden] {
    display: none !important;
}

.funding-recipient-value-row,
.governance-card-amount-row {
    display: flex !important;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 4px 8px;
}

.governance-card-amount-row {
    margin-top: 6px;
}

.governance-card-amount-row .governance-card-detail {
    margin-top: 0;
}

.governance-card-amount-row .governance-treasury-withdrawal-amount {
    color: var(--accent-strong);
    font-size: 1rem;
    font-weight: 800;
}

.funding-recipient-ada-value {
    color: var(--muted) !important;
    font-size: 0.74rem !important;
    font-weight: 700;
}

.governance-funding-card-context {
    font-weight: 700;
}

.governance-action-buttons {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    width: 100%;
    margin-bottom: 12px;
}

.governance-action-buttons .governance-proposal-action-button {
    flex: 1 1 0;
    min-width: 0;
    width: auto;
    margin: 0;
}

.governance-card > .governance-action-buttons {
    margin: 14px 0 0;
}

.governance-proposal-summary {
    padding: 18px;
}

.governance-proposal-summary-text {
    margin: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.65;
    white-space: pre-line;
}

.governance-proposal-summary-sections {
    display: grid;
    gap: 16px;
}

.governance-proposal-summary-section h3 {
    margin: 0 0 5px;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.35;
}

.governance-proposal-summary-section p {
    margin: 0;
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.6;
}

.governance-proposal-summary-warning {
    margin: 14px 0 0;
    font-weight: 700;
}

.governance-list {
    display: grid;
    gap: 12px;
    max-height: 680px;
    overflow-y: auto;
    padding: 4px 8px 4px 6px;
}

.governance-card {
    position: relative;
    display: grid;
    align-content: start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    padding: 16px 16px 18px;
    overflow: visible;
    color: var(--text);
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.governance-card-open {
    display: grid;
    align-content: start;
    gap: 6px;
    width: 100%;
    min-width: 0;
    margin: 0;
    padding: 0 36px 0 0;
    background: transparent;
    border: 0;
    color: inherit;
    cursor: pointer;
    font: inherit;
    text-align: left;
    box-shadow: none;
}

.governance-card > :last-child,
.governance-card-open > :last-child {
    margin-bottom: 0;
}

.governance-card-open:hover {
    background: transparent;
    transform: none;
}

.governance-card-open.has-catalyst-milestones {
    position: relative;
    min-height: 52px;
    padding-right: 150px;
    overflow: visible;
}

.catalyst-milestone-indicator {
    position: absolute;
    top: 50%;
    right: 0;
    display: grid;
    grid-template-columns: minmax(64px, 112px) auto;
    gap: 8px;
    align-items: center;
    width: min(138px, 38%);
    pointer-events: none;
    transform: translateY(-50%);
}

.catalyst-milestone-bar {
    display: flex;
    gap: 2px;
    min-width: 0;
    height: 8px;
}

.catalyst-milestone-segment {
    min-width: 2px;
    flex: 1 1 0;
    border-radius: 2px;
}

.catalyst-milestone-segment.is-complete {
    background: #34d399;
}

.catalyst-milestone-segment.is-unfinished {
    background: #f87171;
}

.catalyst-milestone-count {
    color: var(--text);
    font-size: 0.78rem;
    line-height: 1;
    white-space: nowrap;
}

.governance-action-id-copy-button {
    top: 12px;
    right: 12px;
    transform: none;
}

@media (max-width: 600px) {
    .governance-card-open.has-catalyst-milestones {
        display: grid;
        gap: 8px;
        padding-right: 0;
    }

    .catalyst-milestone-indicator {
        position: static;
        justify-self: end;
        grid-template-columns: minmax(44px, 68px) auto;
        gap: 6px;
        width: min(108px, 100%);
        transform: none;
    }

    .catalyst-milestone-count {
        font-size: 0.7rem;
    }
}

.governance-action-id-copy-button:hover,
.governance-action-id-copy-button:focus-visible {
    transform: none;
}

.governance-card:hover {
    box-shadow: 0 14px 30px rgba(20, 184, 166, 0.12);
}

.governance-treasury-withdrawal-card {
    cursor: default;
}

.governance-treasury-withdrawal-card--clickable {
    cursor: pointer;
}

.governance-treasury-history-chart {
    margin-bottom: 6px;
}

.governance-treasury-history-frame {
    position: relative;
    width: 100%;
    height: 340px;
    min-width: 0;
}

@media (max-width: 600px) {
    .governance-treasury-history-frame {
        height: 280px;
    }
}

.governance-type {
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.governance-title,
.governance-dialog h2 {
    display: block;
    min-width: 0;
    color: var(--text);
    font-size: 1rem;
    line-height: 1.25;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.governance-expiration {
    display: block;
    margin-top: 8px;
    color: var(--accent-strong);
    font-size: 0.9rem;
    font-weight: 700;
}

.governance-card-detail {
    display: block;
    min-width: 0;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.governance-business-url {
    color: var(--accent-strong);
    text-decoration: none;
}

.governance-business-url-list {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 10px;
}

.governance-business-url:hover,
.governance-business-url:focus-visible {
    text-decoration: underline;
}

.governance-business-card.has-company-logo {
    position: relative;
    padding-right: 126px;
}

.governance-business-card.has-company-logo .governance-card-open {
    padding-right: 0;
}

.governance-business-logo-frame {
    position: absolute;
    top: 50%;
    right: 16px;
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface-muted);
    transform: translateY(-50%);
    pointer-events: none;
}

.governance-business-logo-frame--multi {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    width: 90px;
    height: 66px;
}

.governance-business-logo {
    display: block;
    width: 30px;
    height: 30px;
    object-fit: contain;
}

.governance-business-logo-frame--multi .governance-business-logo {
    width: 24px;
    height: 24px;
}

.governance-vote-button,
.governance-vote-choice,
.governance-vote-submit,
.governance-vote-secondary,
.governance-become-drep-button {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 9px 14px;
    background: var(--control-surface);
    color: var(--text);
    font: inherit;
    font-weight: 800;
    box-shadow: none;
}

.governance-become-drep-button {
    display: flex;
    width: 100%;
    margin-bottom: 14px;
    align-items: center;
    justify-content: center;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
    text-align: center;
    text-decoration: none;
}

.governance-become-drep-button:hover,
.governance-become-drep-button:focus-visible {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    color: #fff;
}

.governance-drep-registration-form,
.governance-drep-registration-field {
    display: grid;
    gap: 10px;
}

.governance-drep-registration-form {
    gap: 14px;
}

.governance-drep-registration-field input,
.governance-drep-registration-field textarea {
    width: 100%;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 10px 12px;
    background: var(--control-surface);
    color: var(--text);
    font: inherit;
}

.governance-drep-registration-field input {
    min-height: 44px;
}

.governance-drep-registration-field textarea {
    min-height: 104px;
    resize: vertical;
}

.governance-drep-registration-field input:focus,
.governance-drep-registration-field textarea:focus {
    border-color: var(--accent);
    outline: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
    outline-offset: 1px;
}

.governance-drep-registration-checkbox {
    display: flex;
    gap: 10px;
    align-items: center;
    color: var(--text);
    font-weight: 700;
}

.governance-drep-registration-checkbox input {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--accent);
}

.governance-drep-metadata-url-controls {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
}

.governance-create-metadata-button {
    white-space: nowrap;
}

.governance-create-metadata-button:disabled {
    cursor: wait;
    opacity: 0.65;
}

.governance-drep-registration-help {
    margin: 0;
}

.governance-drep-govtool-link {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 600px) {
    .governance-drep-metadata-url-controls {
        grid-template-columns: 1fr;
    }
}

.governance-vote-button {
    width: 100%;
    margin-top: 14px;
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.governance-vote-button:hover,
.governance-vote-submit:hover {
    background: var(--accent-strong);
    border-color: var(--accent-strong);
    transform: none;
}

.governance-vote-flow {
    display: grid;
    gap: 14px;
}

.governance-vote-warning,
.governance-vote-selection,
.governance-vote-review {
    padding: 16px;
}

.governance-vote-rationale {
    display: grid;
    gap: 12px;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
}

.governance-vote-review-links,
.governance-vote-rationale-actions {
    margin-top: 14px;
}

.governance-vote-rationale-output {
    display: grid;
    gap: 10px;
}

.governance-vote-rationale-status {
    margin: 0;
}

.governance-vote-warning p,
.governance-vote-review-warning,
.governance-vote-status {
    margin: 8px 0 0;
    color: var(--muted);
    line-height: 1.5;
}

.governance-vote-action-id-line {
    margin-top: 10px;
}

.governance-drep-id.governance-vote-action-id {
    display: block;
    padding: 7px 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.35;
    overflow-wrap: anywhere;
    white-space: normal;
}

.governance-vote-choices {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.governance-vote-choice:hover,
.governance-vote-secondary:hover {
    background: var(--control-hover-surface);
    transform: none;
}

.governance-vote-submit {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

.governance-vote-submit:disabled {
    cursor: wait;
    opacity: 0.65;
}

.governance-vote-wallet-list {
    display: grid;
    gap: 10px;
}

.governance-vote-review {
    display: grid;
    gap: 10px;
}

.governance-vote-review .governance-detail-row {
    margin: 0;
}

.governance-vote-status.is-error {
    color: #fb7185;
}

.governance-vote-success {
    color: #34d399;
}

@media (max-width: 520px) {
    .constitution-chat {
        padding: 14px;
    }

    .constitution-chat-heading,
    .constitution-chat-form {
        grid-template-columns: 1fr;
    }

    .constitution-chat-heading {
        display: grid;
    }

    .constitution-chat-heading button {
        justify-self: start;
    }

    .constitution-chat-form-actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .constitution-chat-form-actions .governance-vote-button,
    .constitution-chat-form-actions .governance-vote-secondary {
        width: 100%;
        min-width: 0;
        padding-inline: 10px;
    }

    .constitution-chat-form textarea {
        min-height: 68px;
    }

    .governance-vote-choices {
        grid-template-columns: 1fr;
    }
}

.governance-treasury-withdrawal-amount {
    color: var(--accent-strong);
    font-weight: 700;
}

.governance-votes {
    display: block;
    margin-top: 6px;
    font-size: 0.78rem;
    font-weight: 700;
}

.governance-votes.vote-green {
    color: #34d399;
}

.governance-votes.vote-orange {
    color: #f59e0b;
}

.governance-votes.vote-red {
    color: #f87171;
}

.governance-votes.vote-neutral {
    color: var(--muted);
}

/* Governance Overlay */
.governance-detail-content {
    display: grid;
    gap: 10px;
    margin-top: 12px;
    min-width: 0;
}

.governance-proposal-details {
    display: grid;
    gap: 10px;
    min-width: 0;
}

.governance-detail-row {
    display: grid;
    gap: 4px;
}

.governance-detail-row strong,
.governance-detail-content > strong {
    color: var(--text);
    font-size: 0.82rem;
}

.governance-detail-row span {
    color: var(--muted);
    font-size: 0.86rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.governance-detail-row--copyable {
    grid-template-columns: minmax(0, 1fr) auto;
}

.governance-detail-row--copyable > strong {
    grid-column: 1 / -1;
}

.governance-detail-copy-button {
    position: static;
    align-self: center;
    top: auto;
    right: auto;
    transform: none;
}

.governance-detail-copy-button:hover,
.governance-detail-copy-button:focus-visible {
    transform: none;
}

.governance-detail-row a {
    color: var(--accent-strong);
    overflow-wrap: anywhere;
}

.governance-markdown-section {
    display: grid;
    gap: 8px;
}

.governance-markdown {
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.55;
    min-width: 0;
}

.governance-markdown > * + * {
    margin-top: 12px;
}

.governance-markdown h2,
.governance-markdown h3,
.governance-markdown h4,
.governance-markdown h5,
.governance-markdown h6 {
    color: var(--text);
    line-height: 1.25;
}

.governance-markdown p {
    margin: 0;
}

.governance-markdown ul,
.governance-markdown ol {
    margin: 0;
    padding-left: 20px;
}

.governance-markdown li + li {
    margin-top: 6px;
}

.governance-markdown blockquote {
    margin: 0;
    padding-left: 14px;
    border-left: 2px solid var(--line);
    color: var(--text);
}

.governance-markdown a {
    color: var(--accent-strong);
    overflow-wrap: anywhere;
}

.governance-markdown code {
    padding: 0 4px;
    border: 1px solid var(--line);
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.18);
    color: var(--text);
    font-size: 0.85em;
}

.governance-markdown-code {
    margin: 0;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.2);
    color: var(--text);
    font-size: 0.82rem;
    line-height: 1.5;
    overflow-x: hidden;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.governance-markdown-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

.governance-markdown-table th,
.governance-markdown-table td {
    padding: 8px 10px;
    border: 1px solid var(--line);
    text-align: left;
    vertical-align: top;
}

.governance-markdown-table th {
    color: var(--text);
    background: rgba(255, 255, 255, 0.03);
}

.governance-vote-details {
    display: grid;
    gap: 12px;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface-muted);
}

.governance-vote-chart {
    display: grid;
    gap: 12px;
}

.governance-chart-panel {
    width: 100%;
    min-width: 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface-muted);
    box-sizing: border-box;
}

.spo-geographic-map {
    width: 100%;
    margin: 0;
}

.spo-geographic-map__canvas {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    overflow: hidden;
    margin-top: 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: rgba(94, 234, 212, 0.04);
    touch-action: none;
    cursor: zoom-in;
}

.spo-geographic-map__canvas.is-zoomed {
    cursor: grab;
}

.spo-geographic-map__canvas.is-zoomed:active {
    cursor: grabbing;
}

.spo-geographic-map__viewport {
    position: absolute;
    inset: 0;
    background-image: url('../world-map-cc0.svg');
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
    transform-origin: center;
    will-change: transform;
}

.spo-geographic-map__markers {
    position: absolute;
    z-index: 2;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.spo-geographic-map__controls {
    position: absolute;
    z-index: 4;
    top: 10px;
    right: 10px;
    display: flex;
    gap: 6px;
}

.spo-geographic-map__control {
    display: grid;
    width: 34px;
    height: 34px;
    padding: 0;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: var(--overlay-surface);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.spo-geographic-map__control:is(:hover, :focus-visible) {
    color: #5eead4;
    border-color: #5eead4;
}

.spo-geographic-map__marker {
    --marker-size: 12px;
    position: absolute;
    width: var(--marker-size);
    height: var(--marker-size);
    min-width: 8px;
    min-height: 8px;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #14b8a6;
    box-shadow: 0 0 0 3px rgba(20, 184, 166, 0.22);
    transform: translate(-50%, -50%);
    pointer-events: auto;
    cursor: pointer;
}

.spo-geographic-map__marker:is(:hover, :focus-visible) {
    z-index: 2;
    background: #5eead4;
    box-shadow: 0 0 0 5px rgba(94, 234, 212, 0.3);
}

.spo-geographic-map__marker--tdsp {
    z-index: 3;
    display: grid;
    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;
    place-items: center;
    border: 0;
    color: #f59e0b;
    background: transparent;
    box-shadow: none;
    font-size: 22px;
    line-height: 1;
}

.spo-geographic-map__marker--tdsp::before {
    content: "\2605";
}

.spo-geographic-map__marker--tdsp:is(:hover, :focus-visible) {
    color: #fbbf24;
    background: transparent;
    filter: drop-shadow(0 0 4px rgba(245, 158, 11, 0.8));
    box-shadow: none;
}

.spo-geographic-map figcaption {
    margin-top: 8px;
}

@media (max-width: 700px) {
    .spo-geographic-map__marker {
        width: calc(var(--marker-size) - 2px);
        height: calc(var(--marker-size) - 2px);
        border-width: 1px;
    }

    .spo-geographic-map__marker--tdsp {
        width: 20px;
        height: 20px;
        min-width: 20px;
        min-height: 20px;
        border-width: 0;
        font-size: 20px;
    }
}

.governance-vote-chart-layout {
    display: grid;
    gap: 16px;
    align-items: center;
    grid-template-columns: minmax(180px, 220px) minmax(0, 1fr);
}

.governance-pie-chart {
    position: relative;
    isolation: isolate;
    width: min(232px, 100%);
    aspect-ratio: 1;
    border-radius: 999px;
    border: 0;
    box-shadow: 0 18px 42px rgba(15, 118, 110, 0.12);
    overflow: visible;
}

.governance-pie-chart-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: visible;
}

.governance-pie-chart-track,
.governance-pie-chart-arc {
    fill: none;
    stroke-width: 6;
}

.governance-pie-chart-track {
    stroke: var(--line);
}

.governance-pie-chart-arc {
    pointer-events: none;
    transition: stroke-width 160ms ease, filter 160ms ease;
}

.governance-pie-chart-arc.is-active {
    stroke-width: 8;
    filter: drop-shadow(0 0 5px currentColor);
}

.governance-pie-chart-separator {
    stroke: var(--overlay-surface, var(--page-bg));
    stroke-width: 1.5;
    stroke-linecap: round;
    pointer-events: none;
}

.governance-pie-chart-sector {
    opacity: 0;
    outline: none;
    pointer-events: all;
    transition: opacity 160ms ease;
}

.governance-pie-chart-sector.is-clickable {
    cursor: pointer;
}

.governance-pie-chart-sector:is(:hover, :focus, .is-active) {
    opacity: 0.92;
}

.governance-pie-label {
    position: absolute;
    z-index: 1;
    padding: 4px 7px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: color-mix(in srgb, var(--overlay-label-bg) 92%, transparent);
    color: var(--text);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.1;
    white-space: nowrap;
    transform: translate(-50%, -50%);
    box-shadow: 0 5px 14px rgba(0, 0, 0, 0.16);
    backdrop-filter: blur(6px);
    pointer-events: none;
}

.governance-vote-legend {
    display: grid;
    gap: 10px;
}

.governance-vote-legend-item {
    display: grid;
    grid-template-columns: 12px minmax(0, 1fr);
    gap: 10px;
    align-items: start;
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface);
}

.governance-vote-legend-item.is-clickable {
    appearance: none;
    width: 100%;
    margin: 0;
    cursor: pointer;
    color: inherit;
    font: inherit;
    text-align: left;
}

.governance-vote-legend-item.is-clickable:hover {
    border-color: rgba(94, 234, 212, 0.42);
}

.governance-vote-swatch {
    display: block;
    width: 12px;
    height: 12px;
    margin-top: 4px;
    border-radius: 999px;
}

.governance-vote-legend-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.governance-vote-legend-copy strong {
    color: var(--text);
    font-size: 0.9rem;
}

.governance-stat-box .governance-vote-legend-copy strong {
    color: var(--text);
}

.governance-vote-legend-copy span {
    color: var(--muted);
    font-size: 0.9rem;
    overflow-wrap: anywhere;
}

.governance-vote-legend--inline,
.governance-vote-legend--stacked {
    display: grid;
    width: 100%;
    gap: 10px;
}

.governance-no-votes {
    display: grid;
    gap: 10px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface);
}

.governance-no-votes-list {
    display: grid;
    gap: 8px;
    max-height: 220px;
    overflow-y: auto;
}

.governance-no-votes-expanded {
    padding: 0;
    border: 0;
    background: transparent;
}

.governance-no-votes-expanded .governance-no-votes-list {
    max-height: min(70vh, 760px);
}

.governance-no-vote-row {
    padding: 10px 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface-muted);
}

.governance-no-vote-copy {
    display: grid;
    gap: 4px;
    min-width: 0;
}

.governance-no-vote-name-line {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 10px;
    align-items: baseline;
    min-width: 0;
}

.governance-no-vote-name {
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 700;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.governance-no-vote-id {
    color: var(--muted);
    font-size: 0.76rem;
    line-height: 1.4;
    word-break: break-word;
    overflow-wrap: anywhere;
}

.governance-no-vote-power {
    color: var(--accent-strong);
    font-size: 0.78rem;
    font-weight: 600;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.governance-no-vote-row.is-yes .governance-no-vote-power {
    color: #34d399;
}

.governance-no-vote-row.is-no .governance-no-vote-power {
    color: #f87171;
}

.governance-no-vote-row.is-abstain .governance-no-vote-power {
    color: #60a5fa;
}

.governance-detail-image {
    display: block;
    width: min(100%, 720px);
    max-height: 420px;
    margin-top: 8px;
    border: 1px solid var(--line);
    border-radius: 8px;
    object-fit: contain;
    background: var(--overlay-surface-muted);
}

.governance-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: grid;
    place-items: center;
    padding: 24px;
    background: rgba(0, 0, 0, 0.72);
}

.governance-dialog {
    position: relative;
    display: flex;
    flex-direction: column;
    width: min(980px, 100%);
    max-height: min(84vh, 900px);
    overflow: hidden;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface);
    box-shadow: var(--overlay-shadow);
}

.governance-list,
.governance-markdown-code,
.governance-markdown-table,
.governance-no-votes-list,
.governance-dialog {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.governance-list::-webkit-scrollbar,
.governance-markdown-code::-webkit-scrollbar,
.governance-markdown-table::-webkit-scrollbar,
.governance-no-votes-list::-webkit-scrollbar,
.governance-dialog::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.governance-drep-dialog {
    width: min(920px, 100%);
    max-height: min(88vh, 960px);
}

.governance-drep-title {
    margin: 8px 0 16px;
    color: var(--text);
    font-size: clamp(1.2rem, 3vw, 1.6rem);
    line-height: 1.2;
}

.governance-cc-members,
.governance-drep-directory-list {
    display: grid;
    gap: 10px;
}

.governance-spo-detail-stats,
.governance-spo-relay-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.governance-spo-detail-stats {
    margin: 12px 0;
}

.governance-spo-detail-stat,
.governance-spo-relay {
    padding: 14px;
}

.governance-spo-detail-stat span,
.governance-spo-relay span {
    display: block;
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
}

.governance-spo-relay-address-line {
    margin: 8px 0 6px;
}

.governance-spo-relay .governance-spo-relay-location {
    margin: 6px 0;
    overflow-wrap: anywhere;
}

.governance-spo-provider {
    display: inline-flex;
    gap: 8px;
    align-items: center;
}

.governance-spo-relay .governance-spo-provider {
    display: inline-flex;
}

.governance-cc-member.governance-spo-directory-card {
    position: relative;
    padding-right: 58px;
}

.governance-spo-hosting-icon {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
}

.governance-spo-hosting-icon.is-cloud {
    color: #f87171;
}

.governance-spo-hosting-icon.is-hardware {
    color: #34d399;
}

.governance-cc-member {
    display: block;
    padding: 14px;
}

.governance-cc-member-clickable {
    cursor: pointer;
}

.governance-cc-member-hash,
.governance-cc-member-meta {
    display: block;
}

.governance-cc-member-hash:not(.governance-title) {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 700;
    overflow-wrap: anywhere;
}

.governance-cc-member-meta:not(.governance-card-detail) {
    margin-top: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    line-height: 1.35;
}

.governance-cc-member-stats:not(.governance-card-detail) {
    display: block;
    margin-top: 6px;
    color: var(--accent-strong);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

.governance-cc-member-stats-missing {
    color: #fb7185;
}

.governance-cc-member-stats-not-applicable {
    color: var(--muted);
}

.governance-cc-member-stats-separator {
    color: var(--muted);
}

.governance-drep-directory-list .governance-cc-member-stats {
    color: var(--text);
}

.governance-drep-status-chart {
    margin-bottom: 6px;
}

.governance-drep-member-copy {
    min-width: 0;
}

.governance-drep-id-line {
    position: relative;
    min-width: 0;
    margin-top: 4px;
    padding-right: 36px;
}

.governance-drep-id {
    min-width: 0;
    margin-top: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.governance-drep-copy-button {
    top: 50%;
    right: 0;
    transform: translateY(-50%);
}

.governance-drep-copy-button:hover {
    transform: translateY(-50%);
}

.governance-drep-member--active .governance-drep-member-status {
    color: #14b8a6;
    font-weight: 700;
}

.governance-drep-member--inactive .governance-drep-member-status {
    color: #ef4444;
    font-weight: 700;
}

.governance-cc-actions {
    display: grid;
    gap: 10px;
}

.governance-cc-quorum-chart {
    margin-bottom: 16px;
}

.governance-dialog h2 {
    max-width: 820px;
    margin: 8px 0 8px;
    font-size: clamp(1.6rem, 4vw, 2.8rem);
}

@media (max-width: 720px) {
    .governance-overlay {
        padding: 8px;
    }

    .governance-dialog {
        width: 100%;
        max-height: calc(100dvh - 16px);
        padding: 0;
        border-radius: 16px;
        overscroll-behavior: contain;
    }

    .governance-dialog h2,
    .governance-dialog .small-text,
    .governance-vote-chart > strong {
        text-align: center;
    }

    .governance-dialog h2 {
        max-width: 100%;
        font-size: clamp(1.4rem, 7vw, 2rem);
        line-height: 1.1;
        overflow-wrap: anywhere;
    }

    .governance-dialog .small-text {
        margin: 0 0 4px;
        line-height: 1.45;
    }

    .governance-type {
        display: block;
        text-align: center;
        margin-top: 8px;
    }

    .governance-detail-content,
    .governance-proposal-details {
        gap: 12px;
    }

    .governance-vote-details {
        padding: 14px;
    }

    .governance-vote-chart-layout {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .governance-pie-chart {
        margin-inline: auto;
    }

    .governance-vote-legend {
        width: 100%;
        justify-items: center;
    }

    .governance-vote-legend-item {
        width: min(100%, 420px);
        text-align: left;
    }

    .governance-no-votes {
        justify-items: center;
        text-align: center;
    }

    .governance-no-votes-list {
        width: 100%;
    }

    .governance-no-votes-expanded .governance-no-votes-list {
        max-height: min(62vh, 560px);
    }

    .governance-no-vote-row {
        text-align: center;
    }

    .governance-detail-row,
    .governance-markdown-section {
        gap: 6px;
        padding: 12px;
        border: 1px solid var(--line);
        border-radius: 10px;
        background: var(--overlay-surface-muted);
    }

    .governance-markdown,
    .governance-detail-row span,
    .governance-detail-row a {
        font-size: 0.84rem;
        line-height: 1.5;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .governance-detail-image {
        width: 100%;
    }

}

.overlay-dialog-header {
    position: static;
    z-index: 5;
    display: flex;
    width: 100%;
    margin: 0;
    padding: 16px 18px;
    flex: 0 0 auto;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    border-bottom: 1px solid var(--line);
    background: var(--overlay-surface);
}

.overlay-dialog-body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 20px 28px 28px;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.governance-menu-overlay,
.governance-menu-overlay *,
.table-shell,
.table-shell * {
    box-sizing: border-box;
}

.governance-menu-overlay :is(
    .overlay-dialog-body,
    .overlay-dialog-body > *,
    .governance-list,
    .governance-menu-card,
    .governance-menu-card > *,
    .governance-card,
    .governance-card > *,
    .governance-card-open,
    .governance-card-open > *,
    .governance-cc-member,
    .governance-cc-member > *,
    .governance-drep-member-copy,
    .governance-markdown,
    .governance-markdown-section,
    .governance-markdown-code,
    .governance-markdown-table,
    .governance-detail-row,
    .governance-detail-row span,
    .governance-detail-row a
),
.table-shell,
.table-shell table {
    max-width: 100%;
    min-width: 0;
}

.governance-menu-overlay :is(
    .governance-title,
    .governance-card-detail,
    .governance-card *,
    .governance-card-open *,
    .governance-cc-member-hash,
    .governance-cc-member-meta,
    .governance-cc-member-stats,
    .governance-drep-id,
    .constitution-chat,
    .constitution-chat *,
    .governance-markdown,
    .governance-markdown-code,
    .governance-markdown-table,
    .governance-markdown-table th,
    .governance-markdown-table td,
    .governance-detail-row span,
    .governance-detail-row a
),
.table-shell th,
.table-shell td {
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.governance-menu-overlay .governance-markdown-code,
.governance-menu-overlay .governance-markdown-table,
.table-shell {
    overflow-x: hidden;
}

.governance-menu-overlay .governance-markdown-table,
.table-shell table {
    table-layout: fixed;
    width: 100%;
}

.governance-menu-overlay .governance-markdown-table {
    display: table;
    white-space: normal;
}

.overlay-dialog-body::-webkit-scrollbar {
    width: 0;
    height: 0;
}

.overlay-search-bar {
    position: static;
    z-index: auto;
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto auto;
    align-items: center;
    gap: 10px;
    width: 100%;
    margin: 0;
    padding: 8px 18px;
    border: 0;
    border-bottom: 1px solid var(--line);
    border-radius: 0;
    background: var(--overlay-surface);
}

.overlay-search-bar[hidden],
.overlay-search-empty[hidden],
.governance-menu-card[hidden] {
    display: none !important;
}

.overlay-search-input {
    min-width: 0;
    height: 38px;
    padding: 0 12px;
    border: 0;
    border-radius: 6px;
    outline: 0;
    background: var(--control-surface);
    color: var(--text);
    font: inherit;
    font-size: 0.9rem;
    font-weight: 700;
}

.overlay-sort-select {
    min-width: 116px;
    height: 38px;
    padding: 0 28px 0 10px;
    border: 0;
    border-radius: 6px;
    outline: 0;
    background: var(--control-surface);
    color: var(--text);
    font: inherit;
    font-size: 0.82rem;
    font-weight: 800;
}

.overlay-sort-select:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.overlay-search-input:focus {
    box-shadow: 0 0 0 2px var(--accent);
}

.overlay-search-input::placeholder {
    color: var(--muted);
    opacity: 1;
}

.overlay-search-count {
    flex: 0 0 auto;
    min-width: 58px;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-align: right;
}

.overlay-search-empty {
    margin: 12px 0;
    color: var(--muted);
    font-weight: 700;
    text-align: center;
}

.external-site-warning-dialog {
    width: min(440px, calc(100vw - 40px));
}

.external-site-warning-body {
    padding: 24px;
}

.external-site-warning-dialog p {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.92rem;
}

.external-site-warning-url {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--governance-card-bg);
}

.external-site-warning-host {
    display: block;
    min-width: 0;
    padding: 10px 12px;
    color: var(--accent-strong);
    overflow-wrap: anywhere;
    word-break: break-word;
    white-space: normal;
}

.external-site-warning-copy {
    align-self: stretch;
    min-width: 66px;
    padding: 0 10px;
    border: 0;
    border-left: 1px solid var(--line);
    background: var(--button-surface);
    color: var(--text);
    font: inherit;
    font-size: 0.78rem;
    font-weight: 800;
}

.external-site-warning-copy:hover,
.external-site-warning-copy:focus-visible {
    background: var(--surface);
    transform: none;
}

.external-site-warning-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.external-site-warning-actions button {
    min-height: 38px;
    padding: 0 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    font: inherit;
    font-size: 0.88rem;
    font-weight: 800;
}

.external-site-warning-cancel {
    background: var(--control-surface);
    color: var(--text);
}

.external-site-warning-continue {
    background: var(--accent);
    color: #ffffff;
}

.external-site-warning-actions button:hover {
    transform: none;
}

.overlay-dialog-header-copy {
    display: grid;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
}

.overlay-dialog-header-actions {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 8px;
}

.governance-action-header-context {
    display: flex;
    width: 100%;
    min-width: 0;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.governance-action-header-epoch {
    min-width: 0;
    margin: 0;
    color: var(--accent-strong);
    font-size: 0.75rem;
    font-weight: 700;
    line-height: 1.2;
    text-align: right;
    text-transform: uppercase;
}

.governance-menu-header-meta {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.2;
}

.governance-menu-header-meta:empty {
    display: none;
}

.overlay-dialog-header .governance-drep-title,
.overlay-dialog-header h2 {
    max-width: none;
    margin: 0;
    text-align: left;
    overflow-wrap: anywhere;
}

.overlay-dialog-header .governance-type {
    margin: 0;
    text-align: left;
}

.governance-close,
.governance-back-to-root,
.governance-overlay-bot-button {
    position: static;
    flex: 0 0 auto;
    min-height: 38px;
    padding: 0 12px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--overlay-surface-strong);
    color: var(--text);
}

.governance-close {
    display: grid;
    width: 38px;
    min-width: 38px;
    padding: 0;
    place-items: center;
}

.governance-close-icon {
    position: relative;
    display: block;
    width: 15px;
    height: 15px;
}

.governance-close-icon::before,
.governance-close-icon::after {
    position: absolute;
    top: 7px;
    left: 0;
    width: 15px;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    content: '';
}

.governance-close-icon::before {
    transform: rotate(45deg);
}

.governance-close-icon::after {
    transform: rotate(-45deg);
}

.governance-back-to-root {
    min-width: 42px;
    color: var(--accent-strong);
    font-weight: 700;
}

.governance-overlay-bot-button {
    color: var(--accent-strong);
    font-size: 0.82rem;
    font-weight: 800;
}

.governance-close:hover,
.governance-close:focus-visible,
.governance-back-to-root:hover,
.governance-back-to-root:focus-visible,
.governance-overlay-bot-button:hover,
.governance-overlay-bot-button:focus-visible {
    background: var(--control-hover-surface);
    transform: none;
}

@media (max-width: 720px) {
    .governance-dialog .overlay-dialog-header {
        width: 100%;
        margin: 0;
        padding: 12px 14px;
        gap: 10px;
    }

    .overlay-dialog-header-actions {
        align-self: flex-start;
    }

    .governance-back-to-root,
    .governance-overlay-bot-button {
        min-height: 34px;
        padding: 0 8px;
        font-size: 0.72rem;
        line-height: 1.15;
    }

    .governance-back-to-root {
        width: 42px;
    }

    .governance-overlay-bot-button {
        max-width: 86px;
    }

    .governance-dialog .overlay-dialog-body {
        padding: 16px 14px;
    }

    .overlay-search-bar {
        grid-template-columns: minmax(0, 1fr) auto;
        margin: 0;
        padding: 8px 14px;
    }

    .overlay-search-input {
        grid-column: 1 / -1;
        height: 36px;
        font-size: 0.82rem;
    }

    .overlay-sort-select {
        min-width: 0;
        width: 100%;
        height: 36px;
    }

    .external-site-warning-dialog {
        width: calc(100vw - 24px);
    }

    .external-site-warning-body {
        padding: 20px;
    }

    .external-site-warning-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .overlay-dialog-header .governance-drep-title,
    .overlay-dialog-header h2 {
        font-size: clamp(1.2rem, 6vw, 1.65rem);
        line-height: 1.15;
        text-align: left;
    }

    .governance-menu-overlay .overlay-dialog-header {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: flex-start;
    }

    .governance-menu-overlay .overlay-dialog-header-copy {
        display: contents;
    }

    .governance-menu-overlay .overlay-dialog-header-copy > :first-child:not(.governance-drep-title):not(h2):not(.governance-menu-header-meta) {
        grid-column: 1;
        grid-row: 1;
    }

    .governance-menu-overlay .overlay-dialog-header-actions {
        grid-column: 2;
        grid-row: 1;
        justify-self: end;
    }

    .governance-menu-overlay .overlay-dialog-header :is(.governance-drep-title, h2) {
        grid-column: 1 / -1;
        grid-row: 2;
        overflow-wrap: normal;
    }

    .governance-menu-overlay .governance-menu-header-meta {
        grid-column: 1 / -1;
        grid-row: 3;
    }

    .governance-action-header-context {
        align-items: flex-start;
        gap: 10px;
    }

}

select,
input {
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--field-surface);
    color: var(--text);
    padding: 0 12px;
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    line-height: 1.35;
}

select {
    font-weight: 700;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px 14px;
    background: var(--surface);
    color: var(--muted);
}

.site-footer .nav-db-status {
    padding: 0;
    font-size: inherit;
}

/* Cardano news tile */
.crypto-news-ticker {
    position: relative;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    width: 100%;
    min-height: 42px;
    margin: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--text);
    cursor: pointer;
}

.crypto-news-ticker:focus-visible {
    outline: 2px solid var(--accent-strong);
    outline-offset: -2px;
}

.crypto-news-viewport {
    display: flex;
    min-width: 0;
    overflow: hidden;
}

.crypto-news-track {
    display: flex;
    align-items: center;
    width: max-content;
    min-width: 100%;
    white-space: nowrap;
    will-change: transform;
}

.crypto-news-track.is-scrolling {
    animation: crypto-news-scroll-rtl var(--crypto-news-duration, 30s) linear infinite;
}

.crypto-news-ticker:hover .crypto-news-track,
.crypto-news-ticker:focus-within .crypto-news-track {
    animation-play-state: paused;
}

.crypto-news-group {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 36px;
    padding: 0 36px 0 0;
}

.crypto-news-item {
    color: var(--text);
    font-size: var(--compact-ticker-font-size);
    font-weight: 500;
    text-decoration: none;
}

.crypto-news-item strong {
    color: var(--accent-strong);
    font-weight: 700;
}

.crypto-news-item:hover,
.crypto-news-item:focus-visible {
    color: var(--accent-strong);
    outline: none;
}

.crypto-news-list-title {
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
}

.crypto-news-list .governance-menu-card {
    cursor: pointer;
}

.crypto-news-message {
    display: flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    color: var(--muted);
    font-size: var(--compact-ticker-font-size);
    font-weight: 700;
}

@keyframes crypto-news-scroll-rtl {
    from { transform: translateX(0); }
    to { transform: translateX(var(--crypto-news-distance, -50%)); }
}

@media (prefers-reduced-motion: reduce) {
    .crypto-news-viewport {
        overflow-x: auto;
        scrollbar-width: none;
    }

    .crypto-news-viewport::-webkit-scrollbar {
        display: none;
    }

    .crypto-news-track.is-scrolling {
        animation: none;
        transform: none;
    }

    .crypto-news-group[aria-hidden="true"] {
        display: none;
    }
}

@media (max-width: 700px) {
    :root {
        --compact-ticker-font-size: 0.8rem;
    }

    .crypto-news-ticker {
        min-height: 34px;
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }

    .crypto-news-message {
        min-height: 34px;
    }

    .crypto-news-group {
        gap: 28px;
        padding-right: 28px;
    }

}

/* Automatic Dark Theme */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --page-bg: #111816;
        --surface: #1d2422;
        --surface-muted: #17211f;
        --text: #f4f7f4;
        --muted: #c0cbc6;
        --line: rgba(255, 255, 255, 0.14);
        --accent: #14b8a6;
        --accent-strong: #5eead4;
        --shadow: 0 18px 45px rgba(0, 0, 0, 0.30);
        --overlay-surface: #111816;
        --overlay-surface-muted: rgba(255, 255, 255, 0.02);
        --overlay-surface-strong: rgba(29, 36, 34, 0.92);
        --overlay-label-bg: rgba(17, 24, 22, 0.9);
        --overlay-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
        --governance-card-bg: rgba(29, 36, 34, 0.78);
        --governance-card-hover-bg: rgba(29, 36, 34, 0.92);
        --header-bg: rgba(17, 24, 22, 0.88);
        --control-surface: rgba(29, 36, 34, 0.78);
        --control-hover-surface: rgba(20, 184, 166, 0.12);
        --panel-surface: rgba(29, 36, 34, 0.78);
        --panel-surface-muted: rgba(29, 36, 34, 0.78);
        --button-surface: rgba(29, 36, 34, 0.78);
        --field-surface: #111816;
    }

    html:not([data-theme="light"]) body {
        background:
            linear-gradient(135deg, rgba(20, 184, 166, 0.14), transparent 34%),
            linear-gradient(315deg, rgba(183, 121, 31, 0.16), transparent 28%),
            var(--page-bg);
        color: var(--text);
    }

    html:not([data-theme="light"]) {
        background:
            linear-gradient(135deg, rgba(20, 184, 166, 0.14), transparent 34%),
            linear-gradient(315deg, rgba(183, 121, 31, 0.16), transparent 28%),
            var(--page-bg);
    }

    html:not([data-theme="light"]) select,
    html:not([data-theme="light"]) input {
        background: var(--field-surface);
        color: var(--text);
    }
}

/* Manual Dark Theme Override */
:root[data-theme="dark"] {
    --page-bg: #111816;
    --surface: #1d2422;
    --surface-muted: #17211f;
    --text: #f4f7f4;
    --muted: #c0cbc6;
    --line: rgba(255, 255, 255, 0.14);
    --accent: #14b8a6;
    --accent-strong: #5eead4;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.30);
    --overlay-surface: #111816;
    --overlay-surface-muted: rgba(255, 255, 255, 0.02);
    --overlay-surface-strong: rgba(29, 36, 34, 0.92);
    --overlay-label-bg: rgba(17, 24, 22, 0.9);
    --overlay-shadow: 0 28px 80px rgba(0, 0, 0, 0.46);
    --governance-card-bg: rgba(29, 36, 34, 0.78);
    --governance-card-hover-bg: rgba(29, 36, 34, 0.92);
    --header-bg: rgba(17, 24, 22, 0.88);
    --control-surface: rgba(29, 36, 34, 0.78);
    --control-hover-surface: rgba(20, 184, 166, 0.12);
    --panel-surface: rgba(29, 36, 34, 0.78);
    --panel-surface-muted: rgba(29, 36, 34, 0.78);
    --button-surface: rgba(29, 36, 34, 0.78);
    --field-surface: #111816;
}

html[data-theme="dark"] body {
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.14), transparent 34%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.16), transparent 28%),
        var(--page-bg);
    color: var(--text);
}

html[data-theme="dark"] {
    background:
        linear-gradient(135deg, rgba(20, 184, 166, 0.14), transparent 34%),
        linear-gradient(315deg, rgba(183, 121, 31, 0.16), transparent 28%),
        var(--page-bg);
}

html[data-theme="dark"] select,
html[data-theme="dark"] input {
    background: var(--field-surface);
    color: var(--text);
}

/* Responsive Layout */
@media (max-width: 860px) {
    .header-inner {
        width: min(100% - 24px, 1120px);
    }

    .menu-bar {
        min-height: 58px;
        align-items: center;
        justify-content: center;
        flex-wrap: wrap;
        gap: 4px;
        padding: 0;
    }

    .menu-bar__nav {
        display: flex;
        width: 100%;
        flex-wrap: wrap;
        justify-content: center;
        overflow: visible;
    }

    .nav-row-break {
        display: block;
        flex: 0 0 100%;
        width: 100%;
        height: 0;
    }

    .nav-link {
        white-space: nowrap;
        padding: 6px 4px;
        font-size: 0.8rem;
    }

    .menu-bar__side {
        width: 100%;
        justify-content: center;
        max-width: 100%;
        align-items: center;
    }

    .menu-bar__actions {
        max-width: 100%;
        overflow: visible;
        justify-content: center;
        padding-bottom: 2px;
    }

    .site-alerts-menu {
        right: 50%;
        transform: translateX(50%);
    }

    .hero {
        min-height: auto;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-brand {
        grid-template-columns: 1fr;
        gap: 28px;
    }

    .hero-media {
        overflow: hidden;
    }

    .section {
        padding: 72px 16px;
    }

    .table-shell {
        overflow-x: hidden;
    }

    .table-shell table {
        table-layout: fixed;
        min-width: 0;
        font-size: 0.82rem;
    }

    .table-shell th,
    .table-shell td {
        padding: 8px 6px;
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .table-shell th:nth-child(1),
    .table-shell td:nth-child(1) {
        width: 8%;
    }

    .table-shell th:nth-child(2),
    .table-shell td:nth-child(2) {
        width: 38%;
    }

    .table-shell th:nth-child(3),
    .table-shell td:nth-child(3) {
        width: 15%;
    }

    .table-shell th:nth-child(4),
    .table-shell td:nth-child(4) {
        width: 18%;
    }

    .table-shell th:nth-child(5),
    .table-shell td:nth-child(5) {
        width: 21%;
    }

    .pool-summary,
    .starch-summary,
    .governance-summary {
        grid-template-columns: 1fr 1fr;
    }

    .cardano-events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .pool-summary.price-panel {
        grid-template-columns: 1fr 1fr;
    }

    .price-panel > div {
        grid-template-columns: minmax(0, 1fr) 54px;
        grid-template-rows: auto auto;
        column-gap: 8px;
        row-gap: 6px;
    }

    .price-panel > div > strong {
        grid-column: 1 / -1;
        grid-row: 1;
        font-size: 1rem;
        line-height: 1.2;
    }

    .price-panel > div > span {
        grid-column: 1;
        grid-row: 2;
        margin-top: 0;
    }

    .price-sparkline {
        grid-column: 2;
        grid-row: 2;
        width: 54px;
    }

    .price-history-chart-frame {
        height: 280px;
    }

    .price-history-intervals {
        display: grid;
        width: 100%;
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .governance-list {
        max-height: none;
    }
}

@media (max-width: 700px) {
    html {
        scroll-padding-top: calc(var(--site-header-height) + 6px);
    }

    .pool-delegator-row {
        gap: 10px;
        padding: 14px;
    }

    .pool-delegator-address {
        font-size: 0.82rem;
    }

    .menu-bar {
        gap: 4px;
        min-height: 62px;
    }

    .menu-bar__side {
        padding-top: 0;
        gap: 4px;
    }

    .nav-status {
        padding: 0;
    }

    .section {
        padding: 28px 16px 48px;
    }

    .hero {
        padding-top: 36px;
    }

    .hero-copy,
    .hero-media {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    h1 {
        max-width: 100%;
        overflow-wrap: break-word;
        font-size: 2.05rem;
    }

    .lead {
        max-width: 100%;
        font-size: 1rem;
    }

    .cardano-events-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
        margin-top: 20px;
    }

    .cardano-event-card {
        min-height: 122px;
        padding: 13px;
    }

    .cardano-event-detail-facts {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 480px) {
    h1 {
        max-width: 100%;
        overflow-wrap: break-word;
        font-size: 1.95rem;
    }

    h2 {
        font-size: 2.1rem;
    }

    .links a {
        width: 52px;
        height: 52px;
    }

    .table-shell table {
        display: table;
        width: 100%;
        font-size: 0.68rem;
    }

    .table-shell th,
    .table-shell td {
        padding: 7px 4px;
    }

    .governance-summary {
        grid-template-columns: 1fr 1fr;
    }
}

.governance-top-drep-vote-intro {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    line-height: 1.35;
}

.governance-top-drep-vote-card {
    cursor: pointer;
    gap: 12px;
}

.governance-top-drep-vote-action {
    text-align: left;
}

.governance-top-drep-same-line {
    color: var(--muted);
    font-size: 0.84rem;
    font-weight: 800;
    line-height: 1.3;
}

.governance-top-drep-vote-grid {
    display: grid;
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    width: 100%;
}

.governance-top-drep-vote-chip {
    align-items: flex-start;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
    padding: 8px 10px;
    text-align: left;
}

.governance-top-drep-vote-chip strong,
.governance-top-drep-vote-chip span {
    overflow-wrap: anywhere;
}

.governance-top-drep-vote-chip strong {
    font-size: 0.78rem;
    line-height: 1.2;
}

.governance-top-drep-vote-chip span {
    font-size: 0.74rem;
    font-weight: 800;
}

.governance-top-drep-vote-chip.is-yes span {
    color: #34d399;
}

.governance-top-drep-vote-chip.is-no span {
    color: #fb7185;
}

.governance-top-drep-vote-chip.is-abstain span {
    color: #60a5fa;
}

.governance-top-drep-vote-chip.is-pending span,
.governance-top-drep-vote-chip.is-muted span,
.governance-top-drep-vote-chip.is-unknown span {
    color: var(--muted);
}

.governance-top-drep-correlation-chart {
    gap: 14px;
}

.governance-top-drep-correlation-list {
    display: grid;
    gap: 10px;
}

.governance-top-drep-correlation-row {
    align-items: center;
    border-radius: 8px;
    cursor: pointer;
    padding: 6px;
    display: grid;
    gap: 10px;
    grid-template-columns: minmax(0, 1.4fr) minmax(90px, 1fr) 72px;
}

.governance-top-drep-correlation-label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.governance-top-drep-correlation-label strong,
.governance-top-drep-correlation-label span {
    overflow-wrap: anywhere;
}

.governance-top-drep-correlation-label strong {
    color: var(--text);
    font-size: 0.9rem;
}

.governance-top-drep-correlation-label span {
    color: var(--muted);
    font-size: 0.74rem;
    font-weight: 700;
    line-height: 1.25;
}

.governance-top-drep-correlation-meter {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--border);
    border-radius: 999px;
    height: 12px;
    overflow: hidden;
}

.governance-top-drep-correlation-meter span {
    background: linear-gradient(90deg, var(--accent), var(--accent-strong));
    display: block;
    height: 100%;
}

.governance-top-drep-correlation-value {
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-variant-numeric: tabular-nums;
    justify-self: end;
    text-align: right;
    white-space: nowrap;
}

@media (max-width: 620px) {
    .governance-top-drep-correlation-row {
        grid-template-columns: 1fr;
    }

    .governance-top-drep-correlation-value {
        justify-self: start;
    }
}

.governance-top-drep-correlation-row:hover,
.governance-top-drep-correlation-row:focus-visible {
    background: var(--governance-card-hover-bg);
    outline: none;
}
