/* Day theme. Dark is the original stylesheet and remains the default.
   The application chooses the theme explicitly; OS preferences do not override it. */

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  flex: 0 0 auto;
  min-width: 42px;
  min-height: 42px;
  padding: 8px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--panel);
  color: var(--text);
  font-size: .875rem;
  font-weight: 600;
  line-height: 1;
}
.theme-toggle:hover { background: var(--panel-hover); }
.theme-toggle .icon { width: 19px; height: 19px; }
.theme-toggle:focus-visible { outline: 2px solid var(--mint); outline-offset: 4px; }

html[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f6fa;
  --sidebar: #ffffff;
  --panel: #ffffff;
  --panel-hover: #f1f6fa;
  --border: #d4e0ea;
  --muted: #52667d;
  --text: #172b40;
  --mint: #08765e;
  --mint-dark: #e6f5ee;
  --purple: #62489b;
  --orange: #956019;
  --red: #b13953;
  --blue: #315d99;
}

html[data-theme="light"] body { background: var(--bg); color: var(--text); }
html[data-theme="light"] ::selection { background: #c9ecdf; color: #133d32; }
html[data-theme="light"] .sidebar { border-color: #d8e3ed; background: #ffffff; }
html[data-theme="light"] .brand-name { color: #142b41; }
html[data-theme="light"] .brand-name span { color: #08765e; }
html[data-theme="light"] .brand img {
  background: #132437;
  border-radius: 11px;
  padding: 4px;
}
html[data-theme="light"] .brand-caption,
html[data-theme="light"] .nav-label,
html[data-theme="light"] .sidebar-coin small,
html[data-theme="light"] .sidebar-footer { color: #536b81; }
html[data-theme="light"] .nav-link { color: #476078; }
html[data-theme="light"] .nav-link:hover { background: #f0f5f9; color: #183b54; }
html[data-theme="light"] .nav-link.active { background: #e6f5ee; color: #086b55; }
html[data-theme="light"] .nav-link .nav-count {
  background: #f4fcf8;
  border-color: #b2d6c7;
  color: #11664f;
}
html[data-theme="light"] .sidebar-divider { background: #dbe5ed; }
html[data-theme="light"] .sidebar-coin { color: #334c65; }
html[data-theme="light"] .sidebar-coin:hover { color: #08765e; }
html[data-theme="light"] .status-box {
  background: linear-gradient(130deg, #f2faf6, #edf5f8);
  border-color: #c9dfd8;
}
html[data-theme="light"] .status-box .status-title { color: #244c43; }
html[data-theme="light"] .status-box p { color: #4f6876; }
html[data-theme="light"] .status-dot.live { background: #138465; box-shadow: 0 0 0 4px #1384650c; }
html[data-theme="light"] .status-dot.warning { background: #ab721e; }

/* The official Alephium and Avian marks use white artwork. Give them a
   dark backing without changing, recoloring, or recreating the logo. */
html[data-theme="light"] img[src*="/coins/alph.svg"],
html[data-theme="light"] img[src*="/coins/avn.svg"] {
  border-radius: 50%;
  background: #142a40;
  padding: 3px;
}

html[data-theme="light"] .topbar { background: #ffffff; border-color: #d9e4ed; }
html[data-theme="light"] .breadcrumb { color: #5b7085; }
html[data-theme="light"] .breadcrumb span:last-child { color: #253e56; }
html[data-theme="light"] .breadcrumb b { color: #7b8ea0; }
html[data-theme="light"] .global-search .icon { color: #60788e; }
html[data-theme="light"] .global-search input { background: #f5f8fb; border-color: #d1dee9; }
html[data-theme="light"] .key-hint { background: #ffffff; border-color: #cfdae5; color: #5e7489; }
html[data-theme="light"] input,
html[data-theme="light"] select { color: #213c55; background-color: #ffffff; border-color: #c5d5e2; }
html[data-theme="light"] input::placeholder { color: #637a90; opacity: 1; }
html[data-theme="light"] input:focus,
html[data-theme="light"] select:focus { border-color: #0c7d65; }
html[data-theme="light"] select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23475f77' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}
html[data-theme="light"] .btn { background: #edf3f8; border-color: #c8d8e5; color: #29455e; }
html[data-theme="light"] .btn:hover { background: #e4edf4; border-color: #b9ccdc; }
html[data-theme="light"] .btn-primary { background: #08765e; border-color: #08765e; color: #ffffff; }
html[data-theme="light"] .btn-primary:hover { background: #065e4b; border-color: #065e4b; color: #ffffff; }
html[data-theme="light"] .btn-ghost { background: transparent; color: #35566f; }
html[data-theme="light"] .btn-ghost:hover { background: #edf3f8; }
html[data-theme="light"] .icon-button { color: #536c83; }
html[data-theme="light"] .icon-button:hover { background: #eaf2f7; border-color: #ccdae6; color: #204961; }
html[data-theme="light"] .heading-status { color: #526a81; }
html[data-theme="light"] .heading-status .icon-button { border-color: #c9d8e4; }
html[data-theme="light"] .theme-toggle { background: #f5f8fb; border-color: #cad9e5; color: #31516b; }
html[data-theme="light"] .theme-toggle:hover { background: #eaf2f7; color: #173e55; }
html[data-theme="light"] .skip-link { background: #08765e; color: #ffffff; }

html[data-theme="light"] .live-tag { background: #eaf7f0; border-color: #b9ddca; color: #17664f; }
html[data-theme="light"] .badge { background: #edf3f8; border-color: #c9d7e3; color: #425e75; }
html[data-theme="light"] .badge.prop { background: #f0edfb; border-color: #d6cdef; color: #5d4895; }
html[data-theme="light"] .badge.pplns { background: #e9f4fa; border-color: #bbdbe9; color: #285c75; }
html[data-theme="light"] .badge.solo { background: #fff4e0; border-color: #e5d0a6; color: #805b17; }
html[data-theme="light"] .badge.confirmed { background: #e8f7ee; border-color: #b8dfc8; color: #19643e; }
html[data-theme="light"] .badge.pending { background: #fff4df; border-color: #e7d09a; color: #805713; }
html[data-theme="light"] .badge.orphaned,
html[data-theme="light"] .badge.rejected { background: #fceef1; border-color: #e8bbc7; color: #9d3652; }
html[data-theme="light"] .badge-api { color: #4f6c84; }

html[data-theme="light"] .quotes { background: #ffffff; border-color: #d5e1eb; box-shadow: 0 1px 3px #172b4003; }
html[data-theme="light"] .quote .ticker { color: #38526b; }
html[data-theme="light"] .quote-price { color: #20384f; }
html[data-theme="light"] .quote-meta { color: #566e84; }
html[data-theme="light"] .positive { color: #08765e; }
html[data-theme="light"] .negative { color: #ac354d; }
html[data-theme="light"] .metric {
  background: linear-gradient(115deg, #ffffff, #f9fbfd);
  border-color: #d3dfeb;
  box-shadow: 0 2px 7px #162d4604;
}
html[data-theme="light"] .metric-label { color: #4a647d; }
html[data-theme="light"] .metric-label .icon { color: #637e96; }
html[data-theme="light"] .metric-value { color: #152f48; }
html[data-theme="light"] .metric-value small { color: #506b83; }
html[data-theme="light"] .metric-note { color: #566e85; }
html[data-theme="light"] .metric-note .positive { color: #08765e; }
html[data-theme="light"] .metric .tiny-pill { background: #e8f6ed; border-color: #badfca; color: #1b6949; }
html[data-theme="light"] .panel { background: #ffffff; border-color: #d4e0eb; box-shadow: 0 2px 7px #162d4604; }
html[data-theme="light"] .header-left > .icon { color: #53728a; }

html[data-theme="light"] .range-tabs { background: #f0f5f9; border-color: #d4e0e9; }
html[data-theme="light"] .range-tab { color: #546f86; }
html[data-theme="light"] .range-tab:hover { color: #1d4b60; }
html[data-theme="light"] .range-tab.active { background: #ffffff; color: #17634f; box-shadow: 0 1px 4px #213e5214; }
html[data-theme="light"] .chart-pool-select { background-color: #f4f8fb; border-color: #cddce8; }
html[data-theme="light"] .hash-chart text { fill: #526c84; }
html[data-theme="light"] .chart-grid { stroke: #dbe5ee; }
html[data-theme="light"] .chart-line { stroke: #087e67; }
html[data-theme="light"] .chart-crosshair { stroke: #608697; }
html[data-theme="light"] .hash-chart circle { fill: #087e67; }
html[data-theme="light"] .hash-chart .chart-focus { stroke: #ffffff; }
html[data-theme="light"] .hash-chart stop:first-child { stop-color: #11836c; stop-opacity: .18; }
html[data-theme="light"] .hash-chart stop:last-child { stop-color: #11836c; stop-opacity: 0; }
html[data-theme="light"] .chart-footnote { color: #526c83; }
html[data-theme="light"] .chart-tooltip {
  background: #ffffff;
  border-color: #b6cfdc;
  color: #183c51;
  box-shadow: 0 5px 19px #203a561c;
}
html[data-theme="light"] .chart-tooltip span { color: #506f86; }
html[data-theme="light"] .chart-empty { color: #566e85; }
html[data-theme="light"] .chart-empty strong { color: #354f69; }
html[data-theme="light"] .empty-chart-icon { color: #5d8b94; }
html[data-theme="light"] .network-coin span,
html[data-theme="light"] .network-row span { color: #536d85; }
html[data-theme="light"] .network-row strong { color: #223f58; }
html[data-theme="light"] .ttf-inner { background: #edf8f3; border-color: #bfdbd1; }
html[data-theme="light"] .ttf-inner .ttf-label { color: #386b5c; }
html[data-theme="light"] .ttf-inner strong { color: #0d674f; }
html[data-theme="light"] .ttf-caption { color: #556f82; }

html[data-theme="light"] .table-toolbar,
html[data-theme="light"] .table-footer { border-color: #dce5ee; }
html[data-theme="light"] th { color: #4b6680; background: #f4f8fb; border-color: #d6e2ec; }
html[data-theme="light"] td { color: #344e68; border-color: #e0e8ef; }
html[data-theme="light"] tbody tr:hover { background: #f4f9fc; }
html[data-theme="light"] .coin-cell strong { color: #203b53; }
html[data-theme="light"] .coin-cell small,
html[data-theme="light"] .coin-cell .ticker-mini,
html[data-theme="light"] .table-secondary { color: #597087; }
html[data-theme="light"] .coin-placeholder { background: #e5edf5; color: #3b607e; }
html[data-theme="light"] .table-hash { color: #244159; }
html[data-theme="light"] .inline-link { color: #0c715b; }
html[data-theme="light"] .pool-action { background: #eef5f9; border-color: #c5d8e5; color: #365e78; }
html[data-theme="light"] .pool-action:hover { background: #e8f6ef; border-color: #8dc4af; color: #0d6b53; }
html[data-theme="light"] .table-footer,
html[data-theme="light"] .table-description { color: #557088; }
html[data-theme="light"] .mini-tab { color: #516b83; }
html[data-theme="light"] .mini-tab:hover { color: #204d65; }
html[data-theme="light"] .mini-tab.active { background: #e9f3ef; border-color: #bbd9cd; color: #23654f; }
html[data-theme="light"] .finder-name,
html[data-theme="light"] .worker-name { color: #24435b; }
html[data-theme="light"] .finder-wallet { color: #466b85; }
html[data-theme="light"] .finder-unknown { color: #5b7187; }
html[data-theme="light"] .block-height { color: #275474; }
html[data-theme="light"] .block-height:hover { color: #08765e; }
html[data-theme="light"] .pager button { background: #f3f7fa; border-color: #c7d8e5; color: #365870; }
html[data-theme="light"] .pager button:hover:not(:disabled) { background: #ecf7f1; border-color: #8fc4af; color: #0e6b54; }
html[data-theme="light"] .empty-cell { color: #566e84; }
html[data-theme="light"] .empty-cell strong { color: #36556e; }
html[data-theme="light"] .empty-cell .icon { color: #66869a; }

html[data-theme="light"] .energy-track {
  background: #eaf0f5;
  border-color: #aebfcd;
  box-shadow: inset 0 1px 3px #1b3c501a;
}
html[data-theme="light"] .energy-track.complete {
  border-color: #59b67c;
  box-shadow: 0 0 6px #38ad5e30, inset 0 1px 3px #174b2c12;
}
html[data-theme="light"] .energy-fill { box-shadow: inset 0 0 0 1px #ffffff8c, 0 0 5px #168e5840; }
html[data-theme="light"] .energy-percent { background: #123e34f2; color: #ffffff; }
html[data-theme="light"] .energy-track.unknown .energy-percent { background: transparent; color: #4f687e; }
html[data-theme="light"] .energy-track.orphaned { background: #faedf1; border-color: #d3a7b3; }
html[data-theme="light"] .energy-track.orphaned .energy-percent { background: transparent; color: #9b3651; }
html[data-theme="light"] .energy-note { color: #536d85; }

html[data-theme="light"] .start-panel { background: radial-gradient(ellipse at 85% 5%, #daf0e580, transparent 75%), #ffffff; }
html[data-theme="light"] .start-panel > .icon { color: #08765e; }
html[data-theme="light"] .start-panel p,
html[data-theme="light"] .start-panel small { color: #526c82; }
html[data-theme="light"] .main-footer { color: #566e83; }
html[data-theme="light"] .main-footer a:hover { color: #1a5e59; }
html[data-theme="light"] .loading-skeleton { background-image: linear-gradient(110deg, #e7eef5 25%, #f5f9fc 45%, #e7eef5 65%); }
html[data-theme="light"] .loading-row { color: #556e86; }
html[data-theme="light"] .loading-spinner { border-color: #bedbcf; border-top-color: #187c5e; }
html[data-theme="light"] .notice { background: #fff8e9; border-color: #e4cc96; color: #765710; }
html[data-theme="light"] .notice.info { background: #edf5ff; border-color: #bfd6ee; color: #315e87; }
html[data-theme="light"] .error-panel p { color: #536d85; }
html[data-theme="light"] .error-panel > .icon { color: #607e96; }
html[data-theme="light"] .currency-note { color: #536f85; }
html[data-theme="light"] .form-error { color: #a83751; }

html[data-theme="light"] .wallet-icon { background: #e6f5ed; border-color: #b6dbc8; color: #08765e; }
html[data-theme="light"] .wallet-panel > p { color: #526c83; }
html[data-theme="light"] .field label { color: #354e67; }
html[data-theme="light"] .field-help,
html[data-theme="light"] .privacy-note { color: #536e84; }
html[data-theme="light"] .feature-row > .icon { color: #3f7685; }
html[data-theme="light"] .feature-row p { color: #526d84; }
html[data-theme="light"] .saved-wallet { background: #f4f8fb; border-color: #cfdee9; color: #2d4e68; }
html[data-theme="light"] .saved-wallet:hover { background: #edf7f2; border-color: #b7d8c9; }
html[data-theme="light"] .saved-wallet .small { color: #526f87; }
html[data-theme="light"] .wallet-bar { background: #f5f9fc; border-color: #cddde9; }
html[data-theme="light"] .wallet-bar small { color: #526f86; }
html[data-theme="light"] .wallet-address { color: #24445d; }
html[data-theme="light"] .dashboard-info { color: #526e86; }
html[data-theme="light"] .dashboard-info strong { color: #284a63; }
html[data-theme="light"] .connection-output { background: #eff8f5; border-color: #bfd9ce; }
html[data-theme="light"] .output-label { color: #3f6c60; }
html[data-theme="light"] .output-line code { color: #1b5e51; }
html[data-theme="light"] .connection-step .icon { color: #1c7a64; }
html[data-theme="light"] .connection-step p { color: #526d84; }
html[data-theme="light"] .pending-panel h2 { color: #354f67; }
html[data-theme="light"] .pending-panel p { color: #567087; }
html[data-theme="light"] .pending-coin strong { color: #24435c; }
html[data-theme="light"] .pending-coin strong span,
html[data-theme="light"] .pending-coin small { color: #526e85; }
html[data-theme="light"] .pending-coin small span { color: #866014; }

html[data-theme="light"] #toast {
  background: #edf8f2;
  border-color: #a7d4bd;
  color: #195d43;
  box-shadow: 0 7px 27px #1a38441c;
}
/* Optional block-notification components inherit a legible surface as well. */
html[data-theme="light"] :is(.block-toast, .block-notification, .win-toast, .winning-toast, .notification-toast) {
  background: #ffffff;
  border-color: #afd5c5;
  color: #204736;
  box-shadow: 0 10px 35px #183d3326;
}
html[data-theme="light"] :is(.block-toast, .block-notification, .win-toast, .winning-toast, .notification-toast) :is(p, small, .muted) { color: #496c5d; }

/* Community and support keep Discord's violet identity on the day surfaces. */
html[data-theme="light"] .discord-hero {
  background: radial-gradient(ellipse at 8% 8%, #e5e7ff80, transparent 60%), #ffffff;
  border-color: #d4deec;
}
html[data-theme="light"] .discord-intro .eyebrow { color: #525ab1; }
html[data-theme="light"] .discord-intro h2 { color: #1d3450; }
html[data-theme="light"] .discord-intro > p,
html[data-theme="light"] .discord-intro .discord-browser-note { color: #526780; }
html[data-theme="light"] .discord-icon { background: #5865f2; border-color: #707af0; color: #ffffff; }
html[data-theme="light"] .discord-primary { background: #5865f2; border-color: #5865f2; color: #ffffff; }
html[data-theme="light"] .discord-primary:hover { background: #4752c4; border-color: #4752c4; color: #ffffff; }
html[data-theme="light"] .discord-community { background: #ffffff; border-color: #ccd8e7; }
html[data-theme="light"] .discord-community-head { background: #f7f8fd; border-color: #d8e1ed; color: #2a405c; }
html[data-theme="light"] .discord-empty { background: #ffffff; color: #304960; }
html[data-theme="light"] .discord-empty > .icon { color: #555fc5; }
html[data-theme="light"] .discord-empty p { color: #526a82; }
html[data-theme="light"] .discord-topic { background: #ffffff; border-color: #d4e0eb; }
html[data-theme="light"] .discord-topic > .icon { color: #535fb7; }
html[data-theme="light"] .discord-topic h3 { color: #263f59; }
html[data-theme="light"] .discord-topic p { color: #526b83; }
html[data-theme="light"] .discord-members { background: #f5f8fc; border-color: #d9e3ee; color: #526b82; }
html[data-theme="light"] .discord-widget-note { color: #526b82; }

/* The celebratory layer never obscures data; only the brief message has a surface. */
html[data-theme="light"] .block-celebration-layer { background: transparent; }
html[data-theme="light"] .block-celebration-toast {
  background: #ffffff;
  border-color: #a8d5c2;
  color: #244a39;
  box-shadow: 0 10px 35px #183d3326;
}
html[data-theme="light"] .block-celebration-kicker { color: #08765e; }
html[data-theme="light"] .block-celebration-title { color: #203e35; }
html[data-theme="light"] .block-celebration-detail { color: #4f6b5f; }

@media (max-width: 760px) {
  .theme-toggle { min-width: 38px; min-height: 38px; padding: 8px; }
  .theme-toggle :is(.theme-label, .theme-toggle-label) { display: none; }
  html[data-theme="light"] .sidebar { box-shadow: 18px 0 50px #20395124; }
  html[data-theme="light"] .overlay.open { background: #162d4775; }
}
