:root {
  --brand-bg: #2E3D2A;
  --text: #ffffff;
  --accent-green: #32D24D;
  --accent-blue: #00A6FB;
  --card-bg: #2E3D2A;
  --card-hover-green: #355033;
  --card-hover-blue: rgba(0, 166, 251, 0.12);
  --panel-bg: rgba(0, 0, 0, 0.12);
  --danger: #e85d5d;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 2rem;
  display: flex;
  justify-content: center;
  align-items: center;
  font-family: Arial, sans-serif;
  color: var(--text);
  background: var(--brand-bg);
}

.container { width: min(960px, 100%); }

h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.8rem, 3vw, 2.4rem);
}

p {
  margin: 0 0 1.25rem;
  opacity: 0.9;
}

.section-title {
  margin: 0 0 1rem;
  font-size: 1.25rem;
  font-weight: 700;
}

.service-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
}

.service-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 12px;
  border: 1px solid var(--accent-green);
  text-align: left;
  cursor: pointer;
  color: var(--text);
  text-decoration: none;
  background: var(--card-bg);
  transition: transform 0.15s ease, background-color 0.15s ease, box-shadow 0.15s ease;
}

.service-card:hover,
.service-card:focus-visible {
  transform: translateY(-2px);
  background: var(--card-hover-green);
  box-shadow: 0 0 0 2px var(--accent-green);
  outline: none;
}

.service-card--arr { border-color: var(--accent-blue); }

.service-card--arr:hover,
.service-card--arr:focus-visible {
  background: var(--card-hover-blue);
  box-shadow: 0 0 0 2px var(--accent-blue);
}

.service-name {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
}

.service-desc {
  display: block;
  font-size: 0.82rem;
  opacity: 0.75;
  line-height: 1.3;
}

.service-port {
  display: block;
  font-size: 0.78rem;
  font-family: monospace;
  opacity: 0.55;
  margin-top: 0.1rem;
  word-break: break-all;
}

.boxed-section {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border-radius: 12px;
  background: var(--brand-bg);
}

.boxed-section--blue { border: 2px solid var(--accent-blue); }

.health-panel {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  background: var(--panel-bg);
}

.health-subtitle {
  margin: 0 0 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
}

.health-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.health-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 0.45rem 0;
  font-size: 0.92rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.health-row:last-child { border-bottom: none; }

.health-label {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.health-dot {
  width: 10px;
  height: 10px;
  flex-shrink: 0;
  border-radius: 50%;
  background: #888;
}

.health-dot--ok { background: var(--accent-green); }
.health-dot--down { background: var(--danger); }

.health-dot--pending {
  animation: health-pulse 1.1s ease-in-out infinite;
  opacity: 0.65;
}

@keyframes health-pulse { 50% { opacity: 0.35; } }

.health-core { margin-bottom: 1.35rem; }

.health-gluetun {
  margin-top: 0.25rem;
  padding: 1rem 1.1rem 1.15rem;
  border: 2px solid var(--accent-blue);
  border-radius: 12px;
  background: var(--brand-bg);
}

.health-gluetun-note {
  margin: 0 0 0.75rem;
  font-size: 0.82rem;
  line-height: 1.45;
  opacity: 0.88;
}

.health-vpn-banner {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  margin-bottom: 0.75rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
  font-size: 0.86rem;
  line-height: 1.4;
}

.health-vpn-banner .health-dot { margin-top: 0.2rem; }
.health-vpn-banner--pending { background: rgba(0, 166, 251, 0.08); border: 1px solid rgba(0, 166, 251, 0.3); }
.health-vpn-banner--ok { background: rgba(50, 210, 77, 0.12); border: 1px solid rgba(50, 210, 77, 0.45); }
.health-vpn-banner--warn { background: rgba(232, 93, 93, 0.12); border: 1px solid rgba(232, 93, 93, 0.45); }

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.portal-footer {
  margin-top: 2rem;
  padding-top: 1.25rem;
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 10px;
  color: var(--text);
  text-decoration: none;
  font: inherit;
  font-size: 0.875rem;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn:hover,
.btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.45);
  outline: none;
}

.health-meta {
  margin-top: 0.65rem;
  font-size: 0.8rem;
  opacity: 0.75;
}

.health-refresh { margin-top: 0.75rem; }

/* ── Stack diagram ─────────────────────────────────────────── */

.diagram-section {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: var(--panel-bg);
}

.diagram {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin: 1rem 0 0;
}

.diagram-row {
  display: flex;
  justify-content: center;
  width: 100%;
}

.diagram-node {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  text-align: center;
  font-size: 0.95rem;
}

.diagram-node--portal {
  border: 2px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.05);
  min-width: 260px;
}

.diagram-node--storage {
  border: 2px dashed rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.03);
  min-width: 280px;
  gap: 0.45rem;
}

.diagram-sub {
  font-size: 0.78rem;
  opacity: 0.65;
  font-family: monospace;
}

.diagram-storage-tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 0.2rem;
}

.diagram-tag {
  padding: 0.15rem 0.55rem;
  border-radius: 6px;
  font-family: monospace;
  font-size: 0.78rem;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.diagram-vline {
  width: 2px;
  height: 22px;
  background: rgba(255, 255, 255, 0.2);
  flex-shrink: 0;
}

.diagram-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  width: 100%;
}

.diagram-group {
  border-radius: 10px;
  overflow: hidden;
}

.diagram-group--core { border: 2px solid var(--accent-green); }
.diagram-group--gluetun { border: 2px solid var(--accent-blue); }

.diagram-group-title {
  padding: 0.55rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.diagram-group--core .diagram-group-title {
  background: rgba(50, 210, 77, 0.14);
  color: var(--accent-green);
}

.diagram-group--gluetun .diagram-group-title {
  background: rgba(0, 166, 251, 0.14);
  color: var(--accent-blue);
}

.diagram-service {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.42rem 0.9rem;
  font-size: 0.88rem;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.diagram-service span {
  font-family: monospace;
  font-size: 0.8rem;
  opacity: 0.6;
}

/* Data flow steps */

.diagram-flow {
  margin-top: 1.5rem;
  padding: 1rem 1.1rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.1);
  width: 100%;
  box-sizing: border-box;
}

.diagram-flow-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.65rem;
}

.diagram-flow-steps {
  margin: 0;
  padding-left: 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.diagram-flow-steps li {
  font-size: 0.88rem;
  line-height: 1.5;
  opacity: 0.88;
}

.diagram-flow-steps code {
  font-family: monospace;
  font-size: 0.82rem;
  background: rgba(255, 255, 255, 0.08);
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
}

@media (max-width: 560px) {
  .diagram-columns { grid-template-columns: 1fr; }
  .diagram-node--portal,
  .diagram-node--storage { min-width: unset; width: 100%; }
}

/* ── Common commands ───────────────────────────────────────── */

.commands-section {
  margin-top: 2rem;
  padding: 1.25rem 1.25rem 1.5rem;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  background: var(--panel-bg);
}

.cmd-groups {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1rem;
}

.cmd-group-title {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.55;
  margin-bottom: 0.6rem;
}

.cmd-card {
  padding: 0.7rem 0.9rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
  margin-bottom: 0.5rem;
}

.cmd-card:last-child { margin-bottom: 0; }

.cmd-card--highlight {
  border-color: rgba(0, 166, 251, 0.35);
  background: rgba(0, 166, 251, 0.05);
}

.cmd-label {
  font-size: 0.8rem;
  opacity: 0.7;
  margin-bottom: 0.45rem;
  line-height: 1.4;
}

.cmd-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.cmd-code {
  flex: 1;
  font-family: monospace;
  font-size: 0.82rem;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 6px;
  padding: 0.35rem 0.6rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: block;
  min-width: 0;
}

.cmd-copy {
  flex-shrink: 0;
  padding: 0.3rem 0.65rem;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font: inherit;
  font-size: 0.75rem;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
  white-space: nowrap;
}

.cmd-copy:hover,
.cmd-copy:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.cmd-copy--ok {
  background: rgba(50, 210, 77, 0.18) !important;
  border-color: var(--accent-green) !important;
  color: var(--accent-green) !important;
}

.cmd-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin-top: 0.5rem;
}

.cmd-tag-btn {
  padding: 0.25rem 0.65rem;
  border-radius: 20px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font: inherit;
  font-size: 0.78rem;
  font-family: monospace;
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}

.cmd-tag-btn:hover,
.cmd-tag-btn:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

@media (max-width: 600px) {
  .cmd-code { font-size: 0.75rem; }
}

/* ── Connection badge (fixed top-right) ───────────────────────── */

.conn-badge {
  position: fixed;
  top: 1rem;
  right: 1rem;
  z-index: 100;
}

.conn-badge-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.35rem 0.7rem 0.35rem 0.55rem;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: default;
  user-select: none;
  backdrop-filter: blur(4px);
}

.conn-badge--up {
  background: rgba(50, 210, 77, 0.15);
  border-color: rgba(50, 210, 77, 0.45);
  color: var(--accent-green);
}

.conn-badge--unknown {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.55);
}

.conn-badge-label { line-height: 1; }

/* ── IP address rows in health panel ──────────────────────────── */

.health-ips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 2rem;
  margin-bottom: 1.25rem;
  padding: 0.6rem 0.85rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.health-ip-row {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 0.88rem;
}

.health-ip-label {
  opacity: 0.6;
  white-space: nowrap;
}

.health-ip-value {
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text);
}

.health-ip-value--warn { color: var(--danger); }

/* ── Network speed (on-demand sample) ───────────────────────── */

.network-speed {
  margin-bottom: 1.25rem;
  padding: 0.85rem 1rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.09);
}

.network-speed-note {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  opacity: 0.8;
}

.network-speed-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
}

.network-speed-stat {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.network-speed-label {
  font-size: 0.78rem;
  opacity: 0.6;
}

.network-speed-value {
  font-family: monospace;
  font-size: 1rem;
  color: var(--accent-green);
}

.network-speed-meta {
  margin: 0.55rem 0 0;
  font-size: 0.78rem;
  opacity: 0.75;
}

.network-speed-meta--error { color: var(--danger); opacity: 1; }

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* ── Portal nav (shared footer) ─────────────────────────────── */

.portal-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
}

.btn--active {
  border-color: var(--accent-green);
  background: rgba(50, 210, 77, 0.12);
}

/* ── Dashboard widgets (pythoness / bills) ──────────────────── */

.page-header { margin-bottom: 1.5rem; }

.page-header h1 { margin-bottom: 0.35rem; }

.page-tagline {
  margin: 0;
  opacity: 0.8;
  font-size: 0.95rem;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.widget-panel {
  padding: 1rem 1.1rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  background: var(--panel-bg);
}

.widget-panel--wide { grid-column: 1 / -1; }

.widget-title {
  margin: 0 0 0.75rem;
  font-size: 1rem;
  font-weight: 700;
}

.widget-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.widget-list li {
  padding: 0.45rem 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.88rem;
  line-height: 1.4;
}

.widget-list li:last-child { border-bottom: none; }

.widget-list a {
  color: var(--accent-blue);
  text-decoration: none;
}

.widget-list a:hover { text-decoration: underline; }

.widget-empty {
  margin: 0;
  font-size: 0.85rem;
  opacity: 0.7;
}

.widget-error {
  margin: 0;
  font-size: 0.85rem;
  color: var(--danger);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
}

.link-card {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  text-decoration: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.link-card:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.35);
}

.link-card-name { font-weight: 700; font-size: 0.95rem; }

.link-card-desc { font-size: 0.78rem; opacity: 0.7; }

/* ── Bills page tables & forms ──────────────────────────────── */

.summary-snowball {
  margin: 1rem 0 0.85rem;
}

.summary-snowball-card {
  padding: 1rem 1.15rem;
  border-radius: 12px;
  border: 2px solid var(--accent-blue);
  background: rgba(0, 166, 251, 0.08);
}

.summary-snowball-card--warn {
  border-color: rgba(232, 93, 93, 0.55);
  background: rgba(232, 93, 93, 0.1);
}

.summary-snowball-card--muted {
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

.summary-snowball-title {
  margin: 0 0 0.35rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  opacity: 0.75;
}

.summary-snowball-main {
  margin: 0;
  font-size: clamp(1.35rem, 2.5vw, 1.75rem);
  font-weight: 700;
  line-height: 1.25;
}

.summary-snowball-main--positive { color: var(--accent-green); }

.summary-snowball-details {
  margin: 0.55rem 0 0;
  font-size: 0.86rem;
  line-height: 1.45;
  opacity: 0.88;
}

.summary-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.75rem;
  margin: 0 0 1.25rem;
}

.summary-card {
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.summary-card-label {
  display: block;
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  opacity: 0.6;
  margin-bottom: 0.25rem;
}

.summary-card-value {
  font-size: 1.15rem;
  font-weight: 700;
  font-family: monospace;
}

.summary-card-value--positive { color: var(--accent-green); }

.summary-card-value--negative { color: var(--danger); }

.summary-card-hint {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  opacity: 0.55;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  margin-bottom: 0.75rem;
}

.data-table th,
.data-table td {
  padding: 0.45rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.data-table th {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  opacity: 0.6;
  font-weight: 600;
}

.th-sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0;
  border: none;
  background: none;
  color: inherit;
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
  opacity: 0.85;
  transition: opacity 0.12s ease, color 0.12s ease;
}

.th-sort-btn:hover,
.th-sort-btn:focus-visible {
  opacity: 1;
  color: var(--accent-blue);
  outline: none;
}

.th-sort-btn--active {
  opacity: 1;
  color: var(--accent-green);
}

.th-sort-indicator {
  font-size: 0.7rem;
  opacity: 0.9;
}

.data-table input[type="text"],
.data-table input[type="number"] {
  width: 100%;
  max-width: 8rem;
  padding: 0.3rem 0.45rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.data-table input[type="text"].input-wide { max-width: none; }

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.btn--small {
  padding: 0.35rem 0.65rem;
  font-size: 0.78rem;
}

.btn--danger {
  border-color: rgba(232, 93, 93, 0.5);
  color: var(--danger);
}

.btn--primary {
  border-color: var(--accent-green);
  background: rgba(50, 210, 77, 0.15);
}

.income-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.income-row label { font-size: 0.9rem; }

.income-row input {
  width: 8rem;
  padding: 0.4rem 0.55rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
}

.notes-field {
  width: 100%;
  min-height: 3rem;
  padding: 0.5rem 0.65rem;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
  margin-bottom: 1rem;
}

.save-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.15);
}

.save-status {
  font-size: 0.85rem;
  opacity: 0.8;
}

.save-status--ok { color: var(--accent-green); }

.save-status--err { color: var(--danger); }

.debt-payoff {
  font-size: 0.78rem;
  opacity: 0.7;
  display: block;
  margin-top: 0.15rem;
}

.section-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}

.section-toolbar .widget-title { margin-bottom: 0; }

.bill-link-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.bill-link-fields {
  display: none;
  flex-direction: column;
  gap: 0.35rem;
}

.bill-link-fields input {
  width: 100%;
  padding: 0.35rem 0.5rem;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(0, 0, 0, 0.2);
  color: var(--text);
  font: inherit;
  font-size: 0.85rem;
}

.bill-portals-section--editing .bill-link-fields { display: flex; }

.bill-portals-section--editing .bill-link-item .link-card { opacity: 0.85; }

.widget-note {
  margin: -0.35rem 0 0.75rem;
  font-size: 0.82rem;
  opacity: 0.78;
  line-height: 1.4;
}

.widget-note--compact {
  margin-top: -0.5rem;
  margin-bottom: 0.55rem;
}

.check-cell {
  text-align: center;
  vertical-align: middle;
}

.check-cell label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  cursor: pointer;
  white-space: nowrap;
}

.check-cell input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--accent-green);
  cursor: pointer;
}

.extra-equiv {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.72rem;
  opacity: 0.65;
  font-family: monospace;
}

.row-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  white-space: nowrap;
}

.btn-visibility {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  cursor: pointer;
  transition: background 0.12s ease, border-color 0.12s ease, opacity 0.12s ease;
}

.btn-visibility:hover,
.btn-visibility:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.4);
  outline: none;
}

.btn-visibility--off {
  opacity: 0.45;
  border-color: rgba(255, 255, 255, 0.15);
}

.budget-row--excluded {
  opacity: 0.5;
}

.budget-row--excluded input:not(:focus) {
  text-decoration: line-through;
  text-decoration-color: rgba(255, 255, 255, 0.35);
}

.data-table .row-actions .btn--small {
  min-width: 2rem;
  padding: 0.35rem 0.5rem;
}
