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

body {
  background: #0d1117;
  color: #c9d1d9;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: 240px;
  min-width: 240px;
  background: #161b22;
  border-right: 1px solid #21262d;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: fixed;
  top: 0;
  left: 0;
  overflow-y: auto;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid #21262d;
}

.sidebar-header svg {
  flex-shrink: 0;
}

.sidebar-title {
  font-size: 1.1em;
  font-weight: 600;
  color: #e6edf3;
}

.status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-left: auto;
  flex-shrink: 0;
}
.status-dot.running { background: #2ea043; box-shadow: 0 0 6px #2ea04388; }
.status-dot.stopped { background: #da3633; }

.nav-section {
  padding: 12px 0;
}

.nav-label {
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #8b949e;
  padding: 0 16px 6px;
}

.nav-item {
  display: block;
  padding: 8px 16px;
  font-size: 0.85em;
  color: #c9d1d9;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
  border-left: 3px solid transparent;
}

.nav-item:hover {
  background: #1c2128;
}

.nav-item.active {
  background: #1c2128;
  color: #58a6ff;
  border-left-color: #58a6ff;
}

.nav-item.dim {
  color: #484f58;
  font-style: italic;
  cursor: default;
  border-left-color: transparent;
}

.nav-item.dim:hover {
  background: transparent;
}

.nav-newbrew {
  color: #2ea043;
  font-weight: 600;
}

.device-list {
  display: flex;
  flex-direction: column;
}
.nav-item.stale {
  opacity: 0.5;
}
.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 6px;
  vertical-align: middle;
}
.status-dot.online {
  background: #3fb950;
}
.status-dot.offline {
  background: #f85149;
}

/* --- Stale / Offline device --- */
.stale-banner {
  background: #f8514922;
  border: 1px solid #f8514944;
  border-radius: 6px;
  padding: 10px 14px;
  margin-bottom: 16px;
  color: #f85149;
  font-size: 0.85em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.stale-banner-icon {
  font-size: 1.2em;
}
.stale-content .device-card { opacity: 0.5; }

/* --- Device Management --- */
.manage-device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.manage-device-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.manage-device-card.offline {
  border-color: #f8514944;
}
.manage-device-card .device-photo {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 6px;
  background: #0d1117;
}
.manage-device-card .device-photo-placeholder {
  width: 100%;
  height: 140px;
  border-radius: 6px;
  background: #0d1117;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #484f58;
  font-size: 2em;
}
.manage-device-card .device-meta {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.manage-device-card .device-meta .name {
  font-weight: 600;
  color: #e6edf3;
  font-size: 1em;
}
.manage-device-card .device-meta .nickname {
  color: #8b949e;
  font-size: 0.85em;
}
.manage-device-card .device-meta .type-badge {
  display: inline-block;
  font-size: 0.72em;
  padding: 2px 8px;
  border-radius: 10px;
  background: #21262d;
  color: #8b949e;
  width: fit-content;
}
.manage-device-card .device-meta .type-badge.tilt { background: #1f3a5f; color: #58a6ff; }
.manage-device-card .device-meta .type-badge.rapt { background: #3b2f1a; color: #e6a817; }
.manage-device-card .card-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
}
.manage-device-card .card-actions button {
  flex: 1;
  padding: 6px 0;
  border-radius: 4px;
  border: 1px solid #21262d;
  background: #21262d;
  color: #c9d1d9;
  cursor: pointer;
  font-size: 0.8em;
}
.manage-device-card .card-actions button:hover { background: #30363d; }
.manage-device-card .card-actions .btn-forget {
  background: transparent;
  border-color: #f8514944;
  color: #f85149;
}
.manage-device-card .card-actions .btn-forget:hover { background: #f8514922; }

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}
.modal-content {
  background: #161b22;
  border: 1px solid #30363d;
  border-radius: 10px;
  padding: 24px;
  width: 90%;
  max-width: 420px;
}
.modal-content h3 {
  margin-bottom: 16px;
  color: #e6edf3;
}
.modal-content textarea {
  width: 100%;
  background: #0d1117;
  color: #c9d1d9;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 12px;
  font-family: inherit;
  font-size: 0.9em;
  resize: vertical;
}

/* --- Legendary Brews --- */
.legendary-brew-card {
  margin-bottom: 16px;
}
.legendary-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}
.legendary-header h3 {
  margin: 0;
  color: #e6edf3;
}
.legendary-stars {
  white-space: nowrap;
}
.legendary-stars .star {
  font-size: 1.4em;
  color: #30363d;
  cursor: pointer;
  transition: color 0.15s;
}
.legendary-stars .star.filled {
  color: #e6a817;
}
.legendary-stars:hover .star { color: #e6a817; }
.legendary-stars .star:hover ~ .star { color: #30363d; }
.legendary-stats {
  display: flex;
  gap: 16px;
  font-size: 0.9em;
  color: #8b949e;
  margin-bottom: 12px;
}
.legendary-notes {
  margin-top: 8px;
  font-size: 0.85em;
  color: #8b949e;
}
.legendary-notes strong {
  color: #c9d1d9;
  display: block;
  margin-bottom: 4px;
}
.legendary-notes p {
  white-space: pre-wrap;
  margin: 0;
}
.legendary-photo {
  width: 100%;
  max-height: 300px;
  object-fit: cover;
  border-radius: 6px;
  margin-bottom: 12px;
}

/* --- Brew nav items --- */
.nav-item.brew-nav {
  padding-left: 20px;
  font-size: 0.85em;
}

/* --- Main content --- */
.content {
  margin-left: 240px;
  flex: 1;
  padding: 24px;
  min-height: 100vh;
  max-width: 960px;
}

/* --- Pages --- */
.page {
  display: none;
}

.page.active {
  display: block;
}

/* --- Panels --- */
.panel {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 20px;
  margin-bottom: 16px;
}

.panel h2 {
  font-size: 1em;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 16px;
}

/* --- Form grid --- */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.form-group.full-width {
  grid-column: 1 / -1;
}

label {
  font-size: 0.8em;
  color: #8b949e;
  font-weight: 500;
}

input, select {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 6px;
  padding: 8px 12px;
  color: #c9d1d9;
  font-size: 0.9em;
  font-family: inherit;
}

input:focus {
  outline: none;
  border-color: #58a6ff;
  box-shadow: 0 0 0 2px #58a6ff33;
}

.checkbox-group {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.checkbox-group input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: #238636;
}

/* --- Buttons --- */
.btn-row {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

button {
  padding: 8px 16px;
  border-radius: 6px;
  border: 1px solid #30363d;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s;
}

button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.btn-save {
  background: #238636;
  border-color: #238636;
  color: #fff;
}

.btn-start {
  background: #238636;
  border-color: #238636;
  color: #fff;
}

.btn-stop {
  background: #da3633;
  border-color: #da3633;
  color: #fff;
}

.btn-tiny {
  padding: 2px 8px;
  font-size: 0.75em;
  border-radius: 4px;
}

.inline-edit-btn {
  background: none;
  border: none;
  color: #58a6ff;
  font-size: 0.65em;
  padding: 0 4px;
  cursor: pointer;
  text-transform: lowercase;
  vertical-align: super;
}

.inline-edit-btn:hover {
  text-decoration: underline;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
}

.form-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.form-row .form-group {
  min-width: 160px;
  flex: 1;
}

.btn-sm {
  font-size: 0.85em;
  padding: 4px 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.reminder-form-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-start;
}

.reminder-form-grid .form-group {
  min-width: 100px;
  flex: 1;
}

.icon-picker {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.icon-pick {
  width: 32px;
  height: 32px;
  border: 1px solid #30363d;
  border-radius: 6px;
  background: #0d1117;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.15s;
}

.icon-pick:hover {
  border-color: #58a6ff;
}

.icon-pick.selected {
  border-color: #58a6ff;
  background: rgba(88,166,255,0.15);
}

.reminder-table {
  width: 100%;
  border-collapse: collapse;
}

.reminder-table th {
  text-align: left;
  color: #484f58;
  font-size: 0.8em;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 6px 8px;
  border-bottom: 1px solid #21262d;
}

.reminder-table td {
  padding: 8px;
  border-bottom: 1px solid #161b22;
  font-size: 0.9em;
}

.reminder-table .badge-sm {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.8em;
  font-weight: 500;
}

.reminder-table .badge-sm.pending {
  background: rgba(88,166,255,0.15);
  color: #58a6ff;
}

.reminder-table .badge-sm.fired {
  background: rgba(46,160,67,0.15);
  color: #2ea043;
}

.controls span {
  font-size: 0.85em;
  color: #8b949e;
}

/* --- Console --- */
#console {
  background: #010409;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 12px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.8em;
  line-height: 1.5;
  height: 400px;
  overflow-y: auto;
  color: #7ee787;
}

#console .log-line {
  white-space: pre-wrap;
  word-break: break-all;
}

#console .log-line.error {
  color: #f85149;
}

#console .log-line.warning {
  color: #d29922;
}

/* --- Device header --- */
.device-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.device-header h2 {
  font-size: 1.3em;
  font-weight: 600;
  color: #e6edf3;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 0.75em;
  font-weight: 600;
  text-transform: uppercase;
}

.badge.online {
  background: #23864633;
  color: #2ea043;
  border: 1px solid #2ea04355;
}

.badge.offline {
  background: #da363333;
  color: #f85149;
  border: 1px solid #da363355;
}

/* --- Device cards grid --- */
.device-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.device-card {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 16px;
}

.device-card.primary {
  border-color: #30363d;
}

.card-label {
  font-size: 0.75em;
  color: #8b949e;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.card-value {
  font-size: 1.6em;
  font-weight: 700;
  color: #e6edf3;
}

.device-card.primary .card-value {
  color: #58a6ff;
}

.card-hint {
  font-size: 0.7em;
  color: #f0883e;
  margin-top: 4px;
}

.card-value.mode-cool {
  color: #79c0ff;
}

.card-value.mode-heat {
  color: #f0883e;
}

/* --- Info tables --- */
.info-table {
  width: 100%;
  border-collapse: collapse;
}

.info-table td {
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 0.85em;
}

.info-table tr:last-child td {
  border-bottom: none;
}

.info-table td:first-child {
  color: #8b949e;
  width: 45%;
}

.info-table td:last-child {
  color: #e6edf3;
  text-align: right;
}

/* --- Toast --- */
.toast {
  position: fixed;
  bottom: 20px;
  right: 20px;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 0.85em;
  color: #fff;
  opacity: 0;
  transition: opacity 0.3s;
  z-index: 100;
}

.toast.success { background: #238636; }
.toast.error { background: #da3633; }
.toast.show { opacity: 1; }

/* --- Help page --- */
.help-text {
  font-size: 0.85em;
  color: #8b949e;
  margin-bottom: 12px;
}

.help-list {
  padding-left: 20px;
  font-size: 0.85em;
  line-height: 1.8;
  color: #c9d1d9;
}

.help-list li {
  margin-bottom: 8px;
}

.panel p {
  font-size: 0.85em;
  line-height: 1.6;
  margin-bottom: 8px;
}

.panel h3 {
  font-size: 0.9em;
  font-weight: 600;
  color: #e6edf3;
  margin-bottom: 8px;
}

.panel a {
  color: #58a6ff;
  text-decoration: none;
}

.panel a:hover {
  text-decoration: underline;
}

code {
  background: #0d1117;
  border: 1px solid #30363d;
  border-radius: 4px;
  padding: 1px 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 0.9em;
  color: #e6edf3;
}

/* --- Sub-tabs --- */
.sub-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid #21262d;
  margin-bottom: 16px;
}

.sub-tab {
  padding: 10px 20px;
  background: transparent;
  border: none;
  border-bottom: 2px solid transparent;
  color: #8b949e;
  font-size: 0.85em;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.sub-tab:hover {
  color: #c9d1d9;
}

.sub-tab.active {
  color: #58a6ff;
  border-bottom-color: #58a6ff;
}

.subtab-content {
  display: none;
}

.subtab-content.active {
  display: block;
}

/* --- Chart controls & containers --- */
.chart-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 16px;
}

.chart-controls .form-group {
  min-width: 120px;
}

.chart-controls select {
  width: 100%;
}

.chart-container {
  position: relative;
  height: 300px;
  width: 100%;
}

/* --- Gauge Dashboard (ECharts) --- */
.gauge-dashboard {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 12px;
}

.gauge-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 16px 12px 12px;
}

.gauge-title {
  font-size: 0.85em;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: #8b949e;
  margin-bottom: 0;
}

.gauge-el {
  width: 100%;
  max-width: 380px;
  height: 240px;
}

.gauge-abv {
  text-align: center;
  font-size: 1.3em;
  font-weight: 600;
  color: #e6edf3;
  margin-top: -8px;
  letter-spacing: 1px;
}

.gauge-sub {
  text-align: center;
  color: #484f58;
  font-size: 0.8em;
  margin-top: 4px;
  letter-spacing: 0.5px;
}

/* --- Brew Tiles --- */
.brew-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.brew-tile {
  cursor: pointer;
  transition: border-color 0.15s, transform 0.1s;
}

.brew-tile:hover {
  border-color: #58a6ff;
  transform: translateY(-1px);
}

.brew-tile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.brew-tile-header strong {
  color: #e6edf3;
  font-size: 1em;
}

.brew-tile-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 12px;
}

.brew-tile-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brew-tile-label {
  font-size: 0.65em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b949e;
}

.brew-tile-value {
  font-size: 1.1em;
  font-weight: 600;
  color: #58a6ff;
}

.brew-tile-bar {
  height: 4px;
  background: #21262d;
  border-radius: 2px;
  overflow: hidden;
}

.brew-tile-fill {
  height: 100%;
  background: linear-gradient(90deg, #238636, #2ea043, #f0883e);
  border-radius: 2px;
  transition: width 0.6s ease;
}

/* --- Brew Log (text-based) --- */
.brew-log-text {
  max-height: 400px;
  overflow-y: auto;
}

.brew-log-entry {
  display: flex;
  gap: 12px;
  align-items: baseline;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
  font-size: 0.85em;
}

.brew-log-entry:last-child {
  border-bottom: none;
}

.brew-log-entry.dim {
  color: #484f58;
  font-style: italic;
}

.brew-log-day {
  color: #58a6ff;
  font-weight: 600;
  min-width: 48px;
  font-size: 0.85em;
}

.brew-log-time {
  color: #484f58;
  font-size: 0.8em;
  min-width: 100px;
}

.brew-log-type {
  color: #e6edf3;
  font-weight: 600;
  min-width: 80px;
}

.brew-log-desc {
  color: #c9d1d9;
}

/* --- Reminders --- */
.reminder-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.reminder-form select,
.reminder-form input {
  padding: 6px 10px;
  font-size: 0.85em;
}

.reminder-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  border-bottom: 1px solid #21262d;
  font-size: 0.85em;
}

.reminder-item:last-child {
  border-bottom: none;
}

.reminder-trigger {
  color: #58a6ff;
  font-weight: 600;
  min-width: 80px;
}

.reminder-msg {
  color: #c9d1d9;
  flex: 1;
}

.reminder-icon {
  color: #8b949e;
  font-size: 0.8em;
}

.badge-sm {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 8px;
  font-size: 0.7em;
  font-weight: 600;
  text-transform: uppercase;
}

.badge-sm.pending {
  background: #f0883e33;
  color: #f0883e;
}

.badge-sm.fired {
  background: #23864633;
  color: #2ea043;
}

/* --- Dim values --- */
.dim-value {
  color: #484f58 !important;
  font-size: 0.85em !important;
  font-weight: 400 !important;
}

/* --- Dashboard --- */
.checkbox-list {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.dash-check {
  font-size: 0.85em;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.dash-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.dash-card-header strong {
  color: #e6edf3;
  font-size: 0.95em;
}

.dash-card-metrics {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.dash-metric {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.dash-metric-label {
  font-size: 0.7em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #8b949e;
}

.dash-metric-value {
  font-size: 1.1em;
  font-weight: 600;
  color: #58a6ff;
}

.dash-metric-value.active-cool {
  color: #79c0ff;
}

.dash-metric-value.active-heat {
  color: #f0883e;
}

.dash-metric-updated {
  flex-basis: 100%;
  margin-top: 4px;
}

/* --- Brew event buttons --- */
.brew-event-btn {
  font-size: 0.8em;
  padding: 6px 14px;
}

/* --- Brew history items --- */
.brew-history-item {
  padding: 8px 0;
  border-bottom: 1px solid #21262d;
  font-size: 0.85em;
}

.brew-history-item:last-child {
  border-bottom: none;
}

.brew-history-item strong {
  color: #e6edf3;
}

/* --- Info tips --- */
.info-tip {
  display: inline-block;
  cursor: help;
  color: #484f58;
  font-size: 0.85em;
  vertical-align: middle;
}

.info-tip:hover {
  color: #8b949e;
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .sidebar {
    width: 200px;
    min-width: 200px;
  }
  .content {
    margin-left: 200px;
    padding: 16px;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .device-grid {
    grid-template-columns: 1fr 1fr;
  }
  .chart-controls {
    flex-direction: column;
    align-items: stretch;
  }
  .chart-container {
    height: 250px;
  }
  .reminder-form {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .sidebar {
    position: relative;
    width: 100%;
    min-width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid #21262d;
  }
  body {
    flex-direction: column;
  }
  .content {
    margin-left: 0;
  }
  .device-grid {
    grid-template-columns: 1fr;
  }
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
  .brew-tile-grid {
    grid-template-columns: 1fr;
  }
  .sub-tabs {
    overflow-x: auto;
  }
  .chart-container {
    height: 200px;
  }
  .gauge-dashboard {
    grid-template-columns: 1fr;
  }
  .gauge-el {
    height: 200px;
  }
  .integration-grid {
    grid-template-columns: 1fr;
  }
  .donate-tiers {
    grid-template-columns: 1fr;
  }
}

/* --- Affiliate hint --- */
.affiliate-hint {
  color: #484f58;
  font-size: 0.75em;
  font-weight: normal;
  text-decoration: none;
  margin-left: 6px;
}
.affiliate-hint:hover {
  color: #8b949e;
  text-decoration: underline;
}

/* --- About Page --- */
.about-features {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.about-feature {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 16px;
}
.about-feature strong {
  color: #e6edf3;
  display: block;
  margin-bottom: 6px;
}
.about-feature p {
  color: #8b949e;
  font-size: 0.9em;
  line-height: 1.4;
}

/* --- Integrations Page --- */
.integration-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.integration-card {
  display: flex;
  flex-direction: column;
}
.integration-card h3 {
  color: #e6edf3;
  margin-bottom: 8px;
}
.integration-desc {
  color: #8b949e;
  font-size: 0.9em;
  line-height: 1.4;
  flex: 1;
  margin-bottom: 12px;
}
.integration-progress {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.integration-bar {
  flex: 1;
  height: 8px;
  background: #21262d;
  border-radius: 4px;
  overflow: hidden;
}
.integration-fill {
  height: 100%;
  background: #2ea043;
  border-radius: 4px;
  transition: width 0.3s;
}
.integration-pct {
  color: #8b949e;
  font-size: 0.85em;
  white-space: nowrap;
}
.integration-fund {
  align-self: flex-start;
}
.integration-type-badges {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
}
.badge-type {
  font-size: 0.75em;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-type.sensor {
  background: rgba(88, 166, 255, 0.15);
  color: #58a6ff;
  border: 1px solid rgba(88, 166, 255, 0.3);
}
.badge-type.controller {
  background: rgba(240, 136, 62, 0.15);
  color: #f0883e;
  border: 1px solid rgba(240, 136, 62, 0.3);
}
.badge-type.supported {
  background: rgba(46, 160, 67, 0.15);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.3);
}
.badge-type.bridge {
  background: rgba(163, 113, 247, 0.15);
  color: #a371f7;
  border: 1px solid rgba(163, 113, 247, 0.3);
}
.integration-status-bar {
  font-size: 0.85em;
  padding: 6px 12px;
  border-radius: 6px;
  text-align: center;
  font-weight: 600;
  margin-top: auto;
}
.integration-status-bar.supported {
  background: rgba(46, 160, 67, 0.1);
  color: #3fb950;
  border: 1px solid rgba(46, 160, 67, 0.25);
}
.integration-affiliate {
  font-size: 0.75em;
  color: #484f58;
  margin-bottom: 12px;
}
.integration-affiliate a {
  color: #6e7681;
  text-decoration: none;
}
.integration-affiliate a:hover {
  color: #8b949e;
  text-decoration: underline;
}

/* --- Support / Donate Page --- */
.support-breakdown {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.support-item {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 6px;
  padding: 16px;
}
.support-item strong {
  color: #e6edf3;
  display: block;
  margin-bottom: 6px;
}
.support-item p {
  color: #8b949e;
  font-size: 0.9em;
}
.donate-tiers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-top: 12px;
}
.donate-tier {
  background: #161b22;
  border: 1px solid #21262d;
  border-radius: 8px;
  padding: 20px;
  text-align: center;
}
.donate-tier.featured {
  border-color: #e6a817;
  background: #1c1e0f;
}
.donate-tier-name {
  color: #e6edf3;
  font-weight: bold;
  font-size: 1.1em;
  margin-bottom: 4px;
}
.donate-tier-price {
  color: #58a6ff;
  font-size: 1.8em;
  font-weight: bold;
  margin-bottom: 8px;
}
.donate-tier p {
  color: #8b949e;
  font-size: 0.9em;
  margin-bottom: 12px;
}
.donate-btn {
  width: 100%;
}
.fund-total {
  text-align: center;
  padding: 20px 0;
}
.fund-amount {
  font-size: 3em;
  font-weight: bold;
  color: #2ea043;
}
.fund-label {
  color: #8b949e;
  font-size: 1.1em;
}
