html.savebot-home-mode,
body.savebot-home-body {
  min-width: 320px;
  background: #0f1114 !important;
  color: var(--frm-text, #edf1f4);
  letter-spacing: 0;
}

body.savebot-home-body [data-savebot-native-home] { display: none !important; }
#savebot-home-dashboard, #savebot-home-dashboard * { box-sizing: border-box; }

#savebot-home-dashboard {
  --sb-bg: #0f1114;
  --sb-panel: #15191d;
  --sb-panel-strong: #1a1f24;
  --sb-border: #303840;
  --sb-border-soft: #252c33;
  --sb-text: #edf1f4;
  --sb-muted: #9ba5ae;
  --sb-green: #72d69a;
  --sb-amber: #e8b765;
  --sb-cyan: #68b9dc;
  --sb-red: #eb7e83;
  position: relative;
  z-index: 1;
  width: min(1440px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0 36px;
  color: var(--sb-text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

#savebot-home-dashboard button, #savebot-home-dashboard a { font: inherit; }

.sb-hero {
  position: relative;
  min-height: 236px;
  overflow: hidden;
  border: 1px solid var(--sb-border);
  border-radius: 6px;
  background: #121519;
}

.sb-hero::after {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgb(15 17 20 / 0.98) 0%, rgb(15 17 20 / 0.86) 54%, rgb(15 17 20 / 0.58) 100%);
  content: "";
  pointer-events: none;
}

.sb-hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .42; }

.sb-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 340px);
  min-height: 236px;
  align-items: center;
  gap: 28px;
  padding: 26px 30px;
}

.sb-kicker, .sb-section-kicker {
  margin: 0 0 6px;
  color: var(--sb-amber);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0;
  text-transform: uppercase;
}

.sb-title {
  max-width: 780px;
  margin: 0;
  color: #fff;
  font-size: 34px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: 0;
}

.sb-subtitle { max-width: 700px; margin: 8px 0 0; color: #b8c0c8; font-size: 13px; }

.sb-live-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  color: #dce8e0;
  font-size: 11px;
  font-weight: 650;
}

.sb-live-dot {
  width: 8px;
  height: 8px;
  flex: 0 0 8px;
  border-radius: 50%;
  background: var(--sb-green);
  box-shadow: 0 0 0 4px rgb(114 214 154 / 0.12);
  animation: sb-pulse 2.4s ease-in-out infinite;
}

.sb-live-line.warn .sb-live-dot { background: var(--sb-amber); box-shadow: 0 0 0 4px rgb(232 183 101 / 0.12); }
.sb-live-line.error .sb-live-dot { background: var(--sb-red); box-shadow: 0 0 0 4px rgb(235 126 131 / 0.12); }

@keyframes sb-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .48; } }

.sb-hero-facts {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px;
  max-width: 720px;
  margin-top: 18px;
  border: 1px solid var(--sb-border-soft);
  background: var(--sb-border-soft);
}

.sb-hero-fact { min-width: 0; padding: 9px 11px; background: rgb(18 21 25 / 0.94); }
.sb-hero-fact span, .sb-stat-label, .sb-panel-copy, .sb-source, .sb-check-source { color: var(--sb-muted); font-size: 10px; }
.sb-hero-fact strong { display: block; margin-top: 2px; overflow-wrap: anywhere; color: #fff; font-size: 14px; font-weight: 650; }

.sb-hero-side {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 26px;
  padding-left: 24px;
  border-left: 1px solid var(--sb-border);
}

.sb-world-time { color: #fff; font-size: 30px; line-height: 1; font-variant-numeric: tabular-nums; }
.sb-world-meta { margin-top: 7px; color: var(--sb-muted); font-size: 11px; }
.sb-hero-links { display: flex; flex-wrap: wrap; gap: 7px; }

.sb-action {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  gap: 7px;
  padding: 8px 10px;
  border: 1px solid #46515c;
  border-radius: 6px;
  background: #20262c;
  color: #e7ebee;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.sb-action:hover { border-color: var(--sb-cyan); background: #293139; color: #fff; }
.sb-action svg { width: 16px; height: 16px; }
.sb-chart-caption { position: absolute; top: 13px; right: 15px; z-index: 2; color: #747f89; font-size: 9px; }

.sb-section { padding: 22px 0; border-bottom: 1px solid var(--sb-border); }
.sb-section:last-child { border-bottom: 0; }

.sb-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.sb-section-title { margin: 0; color: #fff; font-size: 18px; font-weight: 650; line-height: 1.2; letter-spacing: 0; }
.sb-section-meta { color: var(--sb-muted); font-size: 10px; text-align: right; }

.sb-check-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  border: 1px solid var(--sb-border-soft);
  border-radius: 6px;
  background: var(--sb-panel);
}

.sb-check { min-width: 0; padding: 11px 12px; border-right: 1px solid var(--sb-border-soft); }
.sb-check:last-child { border-right: 0; }
.sb-check-top { display: flex; justify-content: space-between; gap: 8px; }
.sb-check-label { color: #e5e9ec; font-size: 11px; font-weight: 650; }
.sb-countdown { color: var(--sb-cyan); font-family: "Cascadia Code", Consolas, monospace; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-check.due .sb-countdown { color: var(--sb-amber); }
.sb-progress { height: 3px; margin: 9px 0 7px; overflow: hidden; background: #293139; }
.sb-progress span { display: block; width: 0; height: 100%; background: var(--sb-cyan); transition: width .6s ease; }
.sb-check.due .sb-progress span { width: 100% !important; background: var(--sb-amber); animation: sb-checking 1.1s ease-in-out infinite; }
@keyframes sb-checking { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }

.sb-dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, .85fr); gap: 10px; }
.sb-factory-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; margin-top: 10px; }

.sb-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sb-border);
  border-radius: 6px;
  background: var(--sb-panel);
}

.sb-panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.sb-panel-title { margin: 0; color: #fff; font-size: 14px; font-weight: 650; letter-spacing: 0; }
.sb-panel-copy { margin-top: 4px; }
.sb-panel-value { color: #fff; font-size: 24px; font-weight: 680; line-height: 1; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-panel-value small { color: var(--sb-muted); font-size: 11px; font-weight: 550; }

.sb-meter { height: 8px; overflow: hidden; border: 1px solid var(--sb-border); background: #22282e; }
.sb-meter span { display: block; width: 0; height: 100%; background: var(--sb-green); transition: width .7s ease; }
.sb-meter.warn span { background: var(--sb-amber); }
.sb-meter.error span { background: var(--sb-red); }
.sb-meter.cyan span { background: var(--sb-cyan); }
.sb-meter-labels { display: flex; justify-content: space-between; gap: 14px; margin: 6px 0 14px; color: var(--sb-muted); font-size: 9px; }

.sb-stat-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; background: var(--sb-border-soft); }
.sb-stat { min-width: 0; padding: 10px; background: var(--sb-panel-strong); }
.sb-stat strong { display: block; margin-top: 2px; overflow-wrap: anywhere; color: #f4f6f7; font-size: 13px; font-variant-numeric: tabular-nums; }
.sb-system-row + .sb-system-row { margin-top: 13px; }
.sb-system-top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.sb-system-top span { color: #dfe4e8; font-size: 11px; font-weight: 600; }
.sb-system-top strong { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }

.sb-production-list, .sb-player-list { display: grid; gap: 8px; }
.sb-production-row { display: grid; grid-template-columns: minmax(100px, 1fr) minmax(110px, 1.4fr) auto; gap: 10px; align-items: center; }
.sb-production-name { min-width: 0; overflow: hidden; color: #dfe4e8; font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.sb-production-rate { color: #fff; font-family: "Cascadia Code", Consolas, monospace; font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.sb-mini-bar { height: 4px; background: #293139; }
.sb-mini-bar span { display: block; height: 100%; background: var(--sb-amber); }

.sb-rail-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; background: var(--sb-border-soft); }
.sb-rail-stat { min-height: 72px; padding: 11px; background: var(--sb-panel-strong); }
.sb-rail-stat strong { display: block; color: #fff; font-size: 21px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.sb-rail-stat span { display: block; margin-top: 6px; color: var(--sb-muted); font-size: 10px; }

.sb-player { display: flex; min-height: 34px; align-items: center; gap: 9px; padding: 6px 0; border-bottom: 1px solid var(--sb-border-soft); color: #e8ebee; font-size: 11px; }
.sb-player:last-child { border-bottom: 0; }
.sb-player-indicator { width: 7px; height: 7px; flex: 0 0 7px; border-radius: 50%; background: var(--sb-green); }

.sb-explain-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.sb-explain { padding: 4px 14px; border-left: 1px solid var(--sb-border); }
.sb-explain:first-child { border-left: 0; }
.sb-explain strong { display: block; margin-bottom: 4px; color: #e8ecef; font-size: 11px; }
.sb-explain span { color: var(--sb-muted); font-size: 10px; }
.sb-source { margin: 13px 0 0; }

.sb-loading .sb-panel-value, .sb-loading .sb-stat strong, .sb-loading .sb-rail-stat strong { opacity: .45; }

@media (max-width: 1060px) {
  .sb-hero-grid { grid-template-columns: 1fr minmax(230px, 280px); }
  .sb-check-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sb-check:nth-child(3n) { border-right: 0; }
  .sb-check:nth-child(n+4) { border-top: 1px solid var(--sb-border-soft); }
  .sb-dashboard-grid { grid-template-columns: 1fr; }
  .sb-explain-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-explain:nth-child(3) { border-left: 0; }
  .sb-explain:nth-child(n+3) { margin-top: 12px; }
}

@media (max-width: 700px) {
  #savebot-home-dashboard { width: calc(100% - 20px); padding-top: 66px; }
  .sb-hero { min-height: 0; }
  .sb-hero-grid { grid-template-columns: 1fr; min-height: 0; gap: 18px; padding: 19px 16px; }
  .sb-title { font-size: 27px; }
  .sb-subtitle { font-size: 12px; }
  .sb-hero-side { gap: 15px; padding: 14px 0 0; border-top: 1px solid var(--sb-border); border-left: 0; }
  .sb-world-time { font-size: 25px; }
  .sb-chart-caption { display: none; }
  .sb-section { padding: 18px 0; }
  .sb-section-head { display: grid; gap: 5px; }
  .sb-section-meta { text-align: left; }
  .sb-check-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-check, .sb-check:nth-child(3n) { border-right: 1px solid var(--sb-border-soft); }
  .sb-check:nth-child(2n) { border-right: 0; }
  .sb-check:nth-child(n+3) { border-top: 1px solid var(--sb-border-soft); }
  .sb-panel { padding: 13px; }
  .sb-panel-head { display: grid; gap: 8px; }
  .sb-panel-value { font-size: 22px; }
  .sb-factory-grid { grid-template-columns: 1fr; }
  .sb-rail-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sb-production-row { grid-template-columns: minmax(90px, 1fr) minmax(75px, 1fr) auto; gap: 7px; }
  .sb-explain-grid { grid-template-columns: 1fr; }
  .sb-explain, .sb-explain:first-child, .sb-explain:nth-child(3) { margin: 0; padding: 10px 0; border-top: 1px solid var(--sb-border); border-left: 0; }
  .sb-explain:first-child { border-top: 0; }
}

@media (max-width: 390px) {
  .sb-hero-facts { grid-template-columns: 1fr; }
  .sb-check-grid { grid-template-columns: 1fr; }
  .sb-check, .sb-check:nth-child(2n), .sb-check:nth-child(3n) { border-top: 1px solid var(--sb-border-soft); border-right: 0; }
  .sb-check:first-child { border-top: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .sb-live-dot, .sb-check.due .sb-progress span { animation: none; }
  .sb-meter span, .sb-progress span { transition: none; }
}
