:root {
  --bg: #3e4637;
  --bg-2: #374033;
  --panel: #4c5844;
  --panel-dark: #292d23;
  --panel-light: #899281;
  --panel-inner: #3e4637;
  --text: #d8ded3;
  --white: #f2f5ee;
  --gold: #c4b550;
  --gold-hi: #e3e41f;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 14px;
  min-height: 100vh;
  background:
    radial-gradient(circle at top, rgba(196, 181, 80, 0.08), transparent 26%),
    linear-gradient(180deg, rgba(62, 70, 55, 1) 0%, rgba(55, 63, 48, 1) 100%);
  background-attachment: fixed;
  font-family: "Trebuchet MS", Verdana, sans-serif;
  font-size: 14px;
  color: var(--text);
  image-rendering: pixelated;
}

.noise,
.noise::before {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

.noise::before {
  content: "";
  opacity: 0.035;
  background-image: linear-gradient(to bottom, transparent 50%, rgba(0, 0, 0, 0.16) 50%);
  background-size: 100% 3px;
}

h1,
h2,
p,
ol,
ul {
  margin: 0;
}

.page-shell {
  max-width: 980px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.panel {
  background: var(--panel);
  border-top: solid 1px var(--panel-light);
  border-right: solid 1px var(--panel-dark);
  border-bottom: solid 1px var(--panel-dark);
  border-left: solid 1px var(--panel-light);
  padding: 12px;
}

.hero,
.domain-panel,
.steps-panel,
.diagram-panel,
.prereq-panel,
.help-panel {
  padding: 14px;
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 14px;
}

.microline,
h2 {
  display: block;
  min-height: 18px;
  line-height: 18px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: #ffffff;
  -webkit-font-smoothing: none;
}

.microline {
  margin-bottom: 8px;
}

h1 {
  margin-bottom: 10px;
  color: var(--gold);
  font-size: clamp(2.2rem, 5vw, 3.4rem);
  line-height: 0.95;
  font-weight: 700;
  text-transform: uppercase;
}

h2 {
  margin-bottom: 12px;
}

.subtitle,
.diagram-note,
.prereq-line,
.steps-list,
.help-list {
  color: var(--text);
  font-size: 15px;
  line-height: 1.38;
}

strong,
.domain-label,
.flow-box-domain,
code {
  color: var(--gold);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 75px;
  min-height: 25px;
  padding: 0 14px;
  color: #ffffff;
  background-color: var(--panel);
  border-top: solid 1px var(--panel-light);
  border-right: solid 1px var(--panel-dark);
  border-bottom: solid 1px var(--panel-dark);
  border-left: solid 1px var(--panel-light);
  cursor: pointer;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.action-btn:hover {
  color: var(--gold-hi);
  background: #5a6a50;
}

.action-btn:active {
  border-top: solid 1px var(--panel-dark);
  border-right: solid 1px var(--panel-light);
  border-bottom: solid 1px var(--panel-light);
  border-left: solid 1px var(--panel-dark);
}

.action-btn:focus-visible {
  outline: 1px dashed var(--panel-dark);
  outline-offset: -4px;
}

.domain-panel {
  text-align: center;
}

.domain-label {
  margin-bottom: 10px;
  font-size: 11px;
  font-weight: bold;
  letter-spacing: 2px;
  text-transform: uppercase;
}

.domain-host {
  display: block;
  width: 100%;
  margin: 0 0 14px;
  padding: 12px 10px;
  background: var(--panel-inner);
  border-top: solid 1px var(--panel-dark);
  border-right: solid 1px var(--panel-light);
  border-bottom: solid 1px var(--panel-light);
  border-left: solid 1px var(--panel-dark);
  color: var(--gold);
  font-size: clamp(1.9rem, 5vw, 3.1rem);
  line-height: 1;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.steps-list,
.help-list {
  padding-left: 22px;
}

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

.flow-diagram {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  margin-bottom: 10px;
}

.flow-box {
  flex: 1 1 0;
  min-width: 0;
  padding: 12px 8px;
  background: #49533f;
  border-top: solid 1px var(--panel-light);
  border-right: solid 1px var(--panel-dark);
  border-bottom: solid 1px var(--panel-dark);
  border-left: solid 1px var(--panel-light);
  color: var(--white);
  text-align: center;
  font-size: clamp(11px, 1.55vw, 16px);
  line-height: 1.15;
  font-weight: bold;
  text-transform: uppercase;
}

.flow-box-domain {
  text-transform: none;
}

.flow-arrow {
  flex: 0 0 26px;
  align-self: center;
  height: 24px;
  line-height: 22px;
  margin: 0 2px;
  background: var(--panel);
  border-top: solid 1px var(--panel-light);
  border-right: solid 1px var(--panel-dark);
  border-bottom: solid 1px var(--panel-dark);
  border-left: solid 1px var(--panel-light);
  color: var(--gold-hi);
  text-align: center;
  font-size: 16px;
  font-weight: bold;
}

.diagram-note {
  color: var(--text);
}

.prereq-line {
  font-weight: bold;
}

.toast {
  position: fixed;
  right: 14px;
  bottom: 14px;
  max-width: min(320px, calc(100% - 28px));
  padding: 10px 12px;
  background: var(--panel);
  border-top: solid 1px var(--panel-light);
  border-right: solid 1px var(--panel-dark);
  border-bottom: solid 1px var(--panel-dark);
  border-left: solid 1px var(--panel-light);
  color: var(--white);
  font-size: 13px;
  line-height: 1.35;
  z-index: 30;
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 760px) {
  body {
    margin: 8px;
  }

  .page-shell {
    gap: 8px;
  }

  .hero,
  .domain-panel,
  .steps-panel,
  .diagram-panel,
  .prereq-panel,
  .help-panel {
    padding: 12px;
  }

  h1 {
    font-size: clamp(1.9rem, 10vw, 2.6rem);
  }

  .domain-host {
    font-size: clamp(1.5rem, 8vw, 2.2rem);
  }

  .hero-actions,
  .hero-actions .action-btn,
  .domain-panel .action-btn {
    width: 100%;
  }

  .flow-diagram {
    flex-direction: column;
    gap: 6px;
  }

  .flow-arrow {
    width: 30px;
    flex-basis: 24px;
    margin: 0 auto;
    transform: rotate(90deg);
  }
}
