:root {
  color-scheme: dark;
  --page: #0a1017;
  --panel: #111a23;
  --panel-2: #15212c;
  --panel-3: #0d151d;
  --line: rgba(137, 162, 178, 0.18);
  --ink: #eef7f8;
  --muted: #8fa2ae;
  --faint: #5d707d;
  --teal: #18b6a7;
  --teal-dark: #0c7d73;
  --amber: #e5a33c;
  --red: #e15f69;
  --blue: #57a7ff;
  --green: #7bd66f;
  --shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 82% 8%, rgba(24, 182, 167, 0.12), transparent 28%),
    linear-gradient(180deg, #091016 0%, #0c131a 42%, #070b10 100%);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

button,
input,
select {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  padding: 22px 24px 56px 112px;
}

.nav-rail {
  position: fixed;
  inset: 18px auto 18px 18px;
  z-index: 10;
  width: 76px;
  display: grid;
  grid-auto-rows: auto;
  gap: 8px;
  justify-items: center;
  align-content: start;
  padding: 9px 0;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(13, 21, 29, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.nav-logo,
.nav-icon {
  width: 58px;
  min-height: 46px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 900;
}

.nav-logo {
  background: var(--teal-dark);
  color: #dffbf8;
  font-size: 0.72rem;
  min-height: 34px;
}

.nav-icon {
  border: 1px solid transparent;
  gap: 2px;
  padding: 6px 4px;
}

.nav-icon.is-active,
.nav-icon:hover {
  border-color: rgba(24, 182, 167, 0.38);
  background: rgba(24, 182, 167, 0.12);
  color: var(--teal);
}

.nav-icon span {
  font-size: 0.86rem;
  line-height: 1;
}

.nav-icon b {
  color: currentColor;
  font-size: 0.64rem;
  line-height: 1;
}

.hero {
  position: relative;
  min-height: 360px;
  display: grid;
  grid-template-columns: minmax(320px, 0.86fr) minmax(380px, 1fr);
  align-items: stretch;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #0d141c;
  box-shadow: var(--shadow);
}

.hero__media {
  position: absolute;
  inset: 0;
  opacity: 0.46;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(7, 11, 16, 0.96) 0%, rgba(7, 11, 16, 0.82) 39%, rgba(7, 11, 16, 0.18) 100%),
    linear-gradient(0deg, rgba(7, 11, 16, 0.86), transparent 52%);
}

.hero__copy {
  position: relative;
  z-index: 1;
  max-width: 660px;
  padding: 46px;
  align-self: end;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--amber);
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 620px;
  margin-bottom: 16px;
  font-size: clamp(2.35rem, 5.2vw, 5rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
  letter-spacing: 0;
}

.hero__copy p:not(.eyebrow) {
  max-width: 560px;
  color: #b8c9d1;
  line-height: 1.55;
}

.hero__actions,
.output-actions,
.toggle-row,
.builder-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button,
.segment {
  border: 0;
  cursor: pointer;
}

.button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 16px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 850;
  text-decoration: none;
}

.button--primary {
  background: linear-gradient(180deg, #19b8aa, #0f8278);
  color: #effffc;
  box-shadow: 0 12px 28px rgba(24, 182, 167, 0.2);
}

.button--secondary {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
  color: #d6e6eb;
}

#start-tour {
  animation: tourButtonPulse 2.6s ease-in-out infinite;
  border-color: rgba(24, 182, 167, 0.58);
}

#start-tour:hover,
#start-tour:focus-visible {
  animation-play-state: paused;
}

@keyframes tourButtonPulse {
  0%,
  100% {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: 0 0 0 rgba(24, 182, 167, 0);
  }
  50% {
    background: rgba(24, 182, 167, 0.23);
    box-shadow: 0 0 0 6px rgba(24, 182, 167, 0.12);
  }
}

.full-width {
  width: 100%;
}

.dashboard,
.system-overview {
  display: grid;
  grid-template-columns: 1.05fr 1.1fr 1fr;
  gap: 14px;
  margin-top: 14px;
}

.system-overview {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel,
.guide-panel,
.console-section {
  border: 1px solid var(--line);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012)),
    var(--panel);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
}

.guide-panel {
  display: grid;
  grid-template-columns: 0.72fr 1.28fr;
  gap: 18px;
  margin-top: 14px;
  padding: 20px;
}

.storage-ring {
  background:
    radial-gradient(circle at center, var(--panel) 0 53%, transparent 54%),
    conic-gradient(var(--teal) 0 14%, rgba(120, 146, 160, 0.18) 14% 100%);
}

.storage-wheel-wrap {
  min-height: 210px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: center;
  gap: 14px;
  text-align: center;
}

.storage-note {
  margin: -6px 0 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.storage-wheel-card {
  min-width: 0;
  display: grid;
  justify-items: center;
  gap: 10px;
}

.storage-wheel-card strong {
  color: #cfe4ea;
  font-size: 0.96rem;
}

.upgrade-panel {
  grid-column: span 1;
}

.guide-copy {
  display: grid;
  align-content: start;
}

.guide-copy h2 {
  margin-bottom: 10px;
  font-size: 1.45rem;
}

.guide-copy p:not(.eyebrow):not(.scan-status),
#recommendation-summary {
  color: #b8c9d1;
  line-height: 1.55;
}

.read-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin: 14px 0 10px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 14, 20, 0.5);
}

.read-tab {
  min-height: 38px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 900;
}

.read-tab.is-active {
  background: rgba(24, 182, 167, 0.15);
  color: #effffc;
  box-shadow: inset 0 0 0 1px rgba(24, 182, 167, 0.4);
}

.read-card,
.scan-explain,
.diagnostic-panel {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 14, 20, 0.44);
}

.read-card h3,
.scan-explain h3,
.diagnostic-panel h3 {
  margin: 0 0 8px;
  font-size: 1rem;
}

.read-card p,
.scan-explain p,
.diagnostic-panel p {
  margin-bottom: 0;
}

.scan-explain,
.diagnostic-panel {
  margin-top: 10px;
  border-color: rgba(87, 167, 255, 0.24);
}

.diagnostic-panel {
  border-color: rgba(229, 163, 60, 0.28);
}

.diagnostic-panel ul {
  margin: 12px 0 0;
  padding-left: 18px;
  color: #aabdc7;
  line-height: 1.5;
}

.diagnostic-panel li + li {
  margin-top: 6px;
}

.diagnostic-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 12px;
}

.report-import {
  margin-top: 12px;
  color: #c5d3da;
}

.report-import summary {
  cursor: pointer;
  color: #effffc;
  font-weight: 900;
}

.report-import .field {
  margin-top: 12px;
}

.scan-status {
  margin-top: 10px;
  color: var(--amber);
  font-weight: 900;
}

.scan-status.is-complete {
  color: var(--green);
}

.question-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.question-card {
  min-width: 0;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(8, 14, 20, 0.48);
}

.question-card legend {
  float: left;
  width: 100%;
  margin: 0 0 12px;
  padding: 0;
  color: var(--ink);
  font-weight: 900;
  line-height: 1.35;
}

.question-card legend + * {
  clear: both;
}

.question-card label {
  min-width: 0;
  display: flex;
  gap: 9px;
  align-items: flex-start;
  margin-top: 12px;
  color: #c5d3da;
  font-weight: 760;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.question-card input[type="radio"] {
  width: 17px;
  height: 17px;
  margin-top: 1px;
  accent-color: var(--teal);
}

.question-card--inputs {
  align-content: start;
}

.question-card--inputs .field {
  display: grid;
  margin-top: 10px;
}

#recommendation-summary {
  flex: 1;
  min-width: 260px;
  margin: 0;
  font-weight: 750;
}

.builder-actions {
  align-items: center;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 14, 20, 0.34);
}

.panel {
  min-width: 0;
  padding: 18px;
}

.panel__head,
.console-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}

.health-panel,
.cleanup-panel,
.controls-panel {
  grid-column: span 1;
}

.cleanup-panel {
  grid-column: 1 / -1;
}

.controls-panel {
  grid-column: span 2;
}

.temperature-panel {
  grid-row: span 1;
}

.status-pill {
  min-width: 58px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(123, 214, 111, 0.12);
  color: var(--green);
  font-size: 0.78rem;
  font-weight: 900;
  text-align: center;
}

.health-grid {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

.ring {
  display: grid;
  place-items: center;
  width: 142px;
  aspect-ratio: 1;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, var(--panel) 0 53%, transparent 54%),
    conic-gradient(var(--teal) 0 85%, rgba(120, 146, 160, 0.18) 85% 100%);
}

.ring span {
  font-size: 1.74rem;
  font-weight: 950;
}

.ring small {
  display: block;
  margin-top: -34px;
  color: var(--muted);
  font-weight: 850;
}

.readiness-note {
  margin: 14px 0 0;
  padding: 12px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 14, 20, 0.34);
  color: #c5d3da;
  line-height: 1.5;
}

.metric-list {
  display: grid;
  gap: 10px;
}

.metric-row,
.task-row {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 14, 20, 0.42);
}

.metric-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  padding: 8px 11px;
}

.metric-row span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.metric-row strong {
  color: var(--ink);
  font-weight: 900;
}

.metric-row strong {
  text-align: right;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(8, 14, 20, 0.52);
}

.segment {
  min-height: 38px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.segment.is-active {
  background: rgba(24, 182, 167, 0.15);
  color: #effffc;
  box-shadow: inset 0 0 0 1px rgba(24, 182, 167, 0.4);
}

.cleanup-board {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.task-row {
  min-height: 48px;
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
}

.task-row span {
  min-width: 0;
  font-weight: 800;
  overflow-wrap: anywhere;
  line-height: 1.35;
}

.task-row strong {
  color: var(--muted);
  font-size: 0.78rem;
}

.task-row--advanced {
  border-color: rgba(229, 163, 60, 0.34);
  background: rgba(229, 163, 60, 0.06);
}

input[type="checkbox"] {
  width: 17px;
  height: 17px;
  accent-color: var(--teal);
}

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

.field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 850;
}

input[type="text"],
textarea,
select {
  min-height: 40px;
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 14, 20, 0.78);
  color: var(--ink);
  padding: 0 11px;
}

textarea {
  min-height: 130px;
  padding: 10px 11px;
  resize: vertical;
  line-height: 1.45;
}

.toggle-row {
  margin: 14px 0;
}

.toggle {
  min-height: 39px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 14, 20, 0.38);
  color: var(--ink);
  font-weight: 800;
}

.insight-list {
  margin: 0;
  padding-left: 19px;
  color: #aabdc7;
  line-height: 1.5;
}

.insight-list li + li {
  margin-top: 10px;
}

.console-section {
  margin-top: 14px;
  overflow: hidden;
}

.back-to-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 20;
  min-width: 52px;
  min-height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(24, 182, 167, 0.42);
  border-radius: 999px;
  background: rgba(13, 21, 29, 0.9);
  color: #effffc;
  box-shadow: var(--shadow);
  text-decoration: none;
  font-weight: 900;
  backdrop-filter: blur(16px);
}

.back-to-top:hover {
  background: rgba(24, 182, 167, 0.22);
}

.tour-overlay[hidden] {
  display: none;
}

.copy-help-overlay[hidden] {
  display: none;
}

.tour-overlay,
.copy-help-overlay {
  position: fixed;
  inset: 0;
  z-index: 5000;
  pointer-events: none;
}

.tour-shade {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.46);
  backdrop-filter: blur(1px);
}

.tour-card {
  position: fixed;
  right: 28px;
  bottom: 78px;
  z-index: 5002;
  width: min(440px, calc(100vw - 28px));
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: end;
  pointer-events: auto;
}

.tour-guide {
  display: grid;
  place-items: center;
}

.tour-face {
  position: relative;
  width: 66px;
  height: 66px;
  border: 2px solid rgba(24, 182, 167, 0.75);
  border-radius: 50%;
  background:
    radial-gradient(circle at 36% 28%, rgba(255, 255, 255, 0.22), transparent 18%),
    linear-gradient(180deg, #203241, #0f1b24);
  box-shadow: 0 14px 32px rgba(24, 182, 167, 0.18);
}

.tour-face::before {
  content: "";
  position: absolute;
  left: 16px;
  top: 8px;
  width: 34px;
  height: 9px;
  border-radius: 999px;
  background: #172632;
}

.tour-eye {
  position: absolute;
  top: 29px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #dffbf8;
}

.tour-eye--left {
  left: 22px;
}

.tour-eye--right {
  right: 22px;
}

.tour-smile {
  position: absolute;
  left: 23px;
  top: 43px;
  width: 20px;
  height: 9px;
  border-bottom: 3px solid #dffbf8;
  border-radius: 0 0 999px 999px;
}

.tour-bubble {
  position: relative;
  padding: 18px;
  border: 1px solid rgba(24, 182, 167, 0.36);
  border-radius: 12px;
  background: rgba(17, 26, 35, 0.96);
  box-shadow: var(--shadow);
}

.tour-bubble::before {
  content: "";
  position: absolute;
  left: -10px;
  bottom: 26px;
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
  border-left: 1px solid rgba(24, 182, 167, 0.36);
  border-bottom: 1px solid rgba(24, 182, 167, 0.36);
  background: rgba(17, 26, 35, 0.96);
}

.tour-bubble h2 {
  margin-bottom: 8px;
  font-size: 1.24rem;
}

.tour-bubble p:not(.eyebrow) {
  color: #c5d3da;
  line-height: 1.52;
}

.copy-help-card {
  width: min(520px, calc(100vw - 28px));
}

.copy-help-steps {
  margin: 12px 0 0;
  padding-left: 20px;
  color: #c5d3da;
  line-height: 1.5;
}

.copy-help-steps li + li {
  margin-top: 8px;
}

.tour-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tour-target {
  position: relative;
  box-shadow:
    0 0 0 3px rgba(24, 182, 167, 0.8),
    var(--shadow);
}

.console-head {
  margin-bottom: 0;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.025);
}

.download-note {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(229, 163, 60, 0.22);
  background: rgba(229, 163, 60, 0.07);
}

.download-note h3 {
  margin: 0 0 8px;
  color: #ffd18a;
  font-size: 1rem;
}

.download-note p {
  max-width: 980px;
  margin-bottom: 8px;
  color: #d5c5aa;
  line-height: 1.5;
}

.download-note p:last-child {
  margin-bottom: 0;
}

pre {
  margin: 0;
  max-height: 560px;
  overflow: auto;
  background: #071018;
  color: #d8e8ec;
  padding: 20px;
  font-size: 0.86rem;
  line-height: 1.55;
}

code {
  font-family: "Cascadia Code", Consolas, "Liberation Mono", monospace;
}

@media (max-width: 1180px) {
  .dashboard,
  .system-overview {
    grid-template-columns: 1fr 1fr;
  }

  .temperature-panel {
    grid-column: span 1;
  }

  .cleanup-panel,
  .controls-panel {
    grid-column: span 2;
  }

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

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

  .guide-panel {
    grid-template-columns: 1fr;
  }

}

@media (max-width: 780px) {
  .app-shell {
    padding: 14px 12px 40px;
  }

  .nav-rail {
    position: sticky;
    top: 8px;
    inset: auto;
    width: 100%;
    grid-template-columns: repeat(5, minmax(42px, 64px));
    grid-auto-rows: auto;
    justify-content: center;
    margin-bottom: 12px;
  }

  .nav-icon {
    width: 58px;
  }

  .hero {
    min-height: 420px;
    grid-template-columns: 1fr;
  }

  .hero__copy {
    padding: 32px 22px;
  }

  .dashboard,
  .system-overview,
  .cleanup-board,
  .control-grid,
  .question-grid,
  .read-tabs {
    grid-template-columns: 1fr;
  }

  .cleanup-panel,
  .controls-panel,
  .upgrade-panel {
    grid-column: span 1;
  }

  .health-grid {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .metric-list {
    width: 100%;
  }

  .console-head {
    flex-direction: column;
  }

  .output-actions,
  .output-actions .button {
    width: 100%;
  }

  .output-actions .button {
    flex: 1;
  }

  .tour-card {
    left: 10px;
    right: 10px;
    bottom: 12px;
    width: auto;
    grid-template-columns: 52px 1fr;
  }

  .tour-face {
    width: 48px;
    height: 48px;
  }

  .tour-face::before {
    left: 12px;
    top: 7px;
    width: 24px;
    height: 7px;
  }

  .tour-eye {
    top: 22px;
    width: 6px;
    height: 6px;
  }

  .tour-eye--left {
    left: 16px;
  }

  .tour-eye--right {
    right: 16px;
  }

  .tour-smile {
    left: 17px;
    top: 32px;
    width: 14px;
    height: 7px;
    border-bottom-width: 2px;
  }

  .tour-bubble {
    padding: 14px;
  }

  .tour-actions .button {
    flex: 1;
    min-width: 84px;
  }
}
