:root {
  --bg: #080c16;
  --surface: #111c30;
  --ink: #0c1424;
  --primary: #00b8ff;
  --glow: #5eebff;
  --text: #f5f7ff;
  --muted: #a7b2c7;
  --line: rgba(167, 178, 199, 0.22);
  --danger: #ffd0c8;
  --page: 1120px;
  --radius: 18px;
  --font: "Segoe UI", "Segoe UI Variable", system-ui, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(980px 480px at 88% -8%, rgba(0, 184, 255, 0.14), transparent 56%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.6;
  overflow-x: clip;
}

:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 3px;
}

a {
  color: var(--glow);
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 40;
  transform: translateY(-140%);
  padding: 0.6rem 0.9rem;
  border: 1px solid var(--glow);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  text-decoration: none;
}

.skip-link:focus {
  transform: none;
}

.wrap {
  width: min(var(--page), calc(100% - 2.5rem));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(8, 12, 22, 0.84);
  border-bottom: 1px solid rgba(94, 235, 255, 0.12);
  backdrop-filter: blur(16px);
}

.header-inner {
  min-height: 4.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  color: var(--text);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-decoration: none;
}

.logo-placeholder {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(94, 235, 255, 0.6);
  border-radius: 8px;
  background:
    linear-gradient(155deg, rgba(94, 235, 255, 0.2), transparent 58%),
    #0b1220;
}

.header-links {
  display: flex;
  gap: 1rem;
}

.header-links a {
  color: var(--muted);
  text-decoration: none;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}

.header-links a:hover,
.header-links a:focus-visible {
  color: var(--text);
  text-decoration: underline;
  text-decoration-color: var(--glow);
  text-underline-offset: 0.22em;
}

.banner,
.notice,
.panel-block,
.card,
.history-item,
.summary {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.banner,
.notice {
  margin: 1.25rem 0;
  padding: 0.9rem 1rem;
  color: var(--muted);
}

.test-server {
  margin-top: 1.5rem;
  padding: 0.9rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.test-server h2 {
  margin-bottom: 0.4rem;
  font-size: 1.15rem;
}

.test-server p,
.test-server-label,
.test-server-status {
  margin: 0 0 0.7rem;
  color: var(--muted);
}

.test-server .test-server-address {
  margin: 0.15rem 0 0.8rem;
  color: var(--text);
  font-size: 1.05rem;
  overflow-wrap: anywhere;
}

.test-server-status {
  margin: 0;
}

.test-server-status:not(:empty) {
  margin-top: 0.65rem;
}

.banner strong,
.notice strong {
  color: var(--text);
}

h1,
h2,
h3 {
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 600;
}

h1 {
  margin: 0 0 0.75rem;
  font-size: clamp(1.8rem, 4vw, 2.7rem);
}

h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.35rem, 2.5vw, 1.8rem);
}

h3 {
  margin: 0 0 0.4rem;
  font-size: 1.15rem;
}

.lead,
.hint,
.panel-block p,
.card p,
.history-item p,
.summary p,
.steps,
dt {
  color: var(--muted);
}

.tabs,
.subtabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 0.5rem 0 1.25rem;
}

.tab,
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.65rem 1.1rem;
  border: 1px solid rgba(0, 184, 255, 0.72);
  border-radius: 999px;
  background: transparent;
  color: var(--glow);
  font: inherit;
  text-decoration: none;
  cursor: pointer;
}

.tab[aria-selected="true"] {
  color: var(--text);
  border-color: var(--glow);
  box-shadow: 0 0 0 1px rgba(94, 235, 255, 0.35);
}

.btn:hover,
.btn:focus-visible,
.tab:hover,
.tab:focus-visible {
  color: var(--text);
  border-color: var(--glow);
  background: transparent;
  box-shadow: 0 0 18px rgba(0, 184, 255, 0.22);
}

.btn:disabled,
.tab:disabled {
  border-color: rgba(167, 178, 199, 0.35);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.btn-danger {
  border-color: rgba(255, 208, 200, 0.7);
  color: var(--danger);
}

.stack {
  display: grid;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.panel-block,
.card,
.summary,
.history-item {
  padding: 1rem 1.05rem;
}

.cards {
  display: grid;
  gap: 0.8rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
}

input,
select {
  width: min(100%, 28rem);
  max-width: 100%;
  min-height: 48px;
  margin-bottom: 0.75rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid rgba(167, 178, 199, 0.38);
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
}

input:disabled,
select:disabled {
  color: var(--muted);
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin: 0.4rem 0;
}

.check input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin: 0.25rem 0 0;
}

.inline-form {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.7rem;
}

.inline-form input {
  margin-bottom: 0;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem 1rem;
  align-items: end;
}

.filters label {
  min-width: min(100%, 12rem);
}

.filters input,
.filters select {
  width: 100%;
  margin-bottom: 0;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-height: 0;
  margin: 0.8rem 0;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 40px;
  padding: 0.2rem 0.45rem 0.2rem 0.75rem;
  border: 1px dashed rgba(94, 235, 255, 0.5);
  border-radius: 999px;
  color: var(--text);
}

.chip button {
  min-width: 40px;
  min-height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--glow);
  font: inherit;
  cursor: pointer;
}

.steps {
  margin: 0;
  padding-left: 1.2rem;
}

fieldset {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem 0.4rem;
  border: 1px solid var(--line);
  border-radius: 12px;
}

legend {
  padding: 0 0.35rem;
}

.facts,
.summary dl,
.history-item dl {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.35rem 0.8rem;
  margin: 0.8rem 0;
}

.facts dd,
.summary dd,
.history-item dd {
  margin: 0;
}

.badge {
  display: inline-block;
  margin: 0 0 0.6rem;
  padding: 0.15rem 0.5rem;
  border: 1px dashed rgba(94, 235, 255, 0.5);
  border-radius: 7px;
  color: var(--glow);
  font-size: 0.92rem;
}

.history-list {
  display: grid;
  gap: 0.8rem;
}

.history-list:focus {
  outline: none;
}

.history-list:focus-visible {
  outline: 2px solid var(--glow);
  outline-offset: 4px;
}

.confirm {
  margin-top: 0.8rem;
  padding-top: 0.8rem;
  border-top: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.count {
  margin: 0.2rem 0 0.8rem;
}

.toast-stack {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 50;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 0.6rem;
  width: min(22rem, calc(100vw - 2rem));
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  padding: 0.8rem 0.85rem;
  border: 1px solid rgba(94, 235, 255, 0.38);
  border-left: 3px solid var(--glow);
  border-radius: 14px;
  background: rgba(17, 28, 48, 0.88);
  color: var(--text);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
  pointer-events: auto;
  opacity: 0;
}

.toast.is-visible {
  opacity: 1;
}

.toast p {
  margin: 0.15rem 0 0;
}

.toast-close {
  flex: none;
  min-width: 44px;
  min-height: 44px;
  border: 1px solid rgba(0, 184, 255, 0.72);
  border-radius: 999px;
  background: transparent;
  color: var(--glow);
  font: inherit;
  cursor: pointer;
}

@media (prefers-reduced-motion: no-preference) {
  .toast {
    transition: opacity 0.25s ease;
  }
}

@media (max-width: 719px) {
  .wrap {
    width: min(var(--page), calc(100% - 1.5rem));
  }

  .header-inner,
  .inline-form,
  .actions {
    align-items: stretch;
  }

  .inline-form,
  .actions,
  .btn,
  .tab {
    width: 100%;
  }

  .summary dl,
  .history-item dl {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 800px) {
  .cards {
    grid-template-columns: repeat(3, 1fr);
  }
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.55rem;
  margin: 1.25rem 0 0.5rem;
  padding: 0;
  list-style: none;
  color: var(--muted);
}

.crumbs li {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
}

.crumbs li:not(:last-child)::after {
  content: "/";
}

.crumbs a {
  text-decoration: none;
}

.wizard {
  margin: 1rem 0 2rem;
  padding: 1rem 1rem 0.9rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  max-width: 100%;
}

.step-compact {
  margin: 0 0 0.55rem;
  color: var(--muted);
}

.step-bar {
  display: flex;
  gap: 0.45rem;
  margin: 0 0 1rem;
  padding: 0 0 0.45rem;
  overflow-x: auto;
  list-style: none;
  max-width: 100%;
}

.step-bar button {
  flex: 0 0 auto;
  white-space: nowrap;
  min-height: 44px;
  padding: 0.4rem 0.85rem;
  border: 1px solid rgba(0, 184, 255, 0.72);
  border-radius: 999px;
  background: transparent;
  color: var(--glow);
  font: inherit;
  cursor: pointer;
}

.step-bar button[aria-current="step"] {
  color: var(--text);
  border-color: var(--glow);
  box-shadow: 0 0 0 1px rgba(94, 235, 255, 0.35);
}

.step-bar button:disabled {
  border-color: rgba(167, 178, 199, 0.35);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
}

.wizard-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.4rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--line);
}

.level-option {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  cursor: pointer;
}

.level-option input {
  width: 1.15rem;
  min-height: 1.15rem;
  margin: 0.25rem 0 0;
}

.level-name {
  display: block;
  font-weight: 600;
  margin-bottom: 0.2rem;
}

.summary {
  display: grid;
  grid-template-columns: minmax(9rem, 14rem) 1fr;
  gap: 0.35rem 1rem;
  margin: 0 0 1rem;
  padding: 1rem 1.05rem;
}

.summary dt {
  margin: 0;
}

.summary dd {
  margin: 0;
}

@media (max-width: 719px) {
  .wizard-nav .btn {
    width: 100%;
  }

  .summary {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  .step-bar button,
  .wizard-nav .btn {
    transition: none;
  }
}

input[type="range"] {
  width: 100%;
  height: 1.75rem;
  margin: 0.35rem 0 0.15rem;
  padding: 0;
  background: transparent;
  accent-color: #00b8ff;
}

input[type="range"]:focus-visible {
  outline: 2px solid #5eebff;
  outline-offset: 3px;
}

.slider-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
}

.slider-head output {
  color: var(--glow);
  font-weight: 600;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.config-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1rem;
  align-items: start;
  margin: 1rem 0 2rem;
}

.price-panel {
  padding: 1.15rem 1.2rem 1.25rem;
  border: 1px solid rgba(94, 235, 255, 0.4);
  border-radius: 18px;
  background:
    radial-gradient(circle at 18% 0%, rgba(0, 184, 255, 0.22), transparent 58%),
    var(--surface);
}

.price-panel h2,
.price-amount,
.price-unit,
.price-note {
  margin-top: 0;
}

.price-amount {
  margin-bottom: 0;
  font-size: clamp(2.1rem, 6vw, 3rem);
  font-weight: 600;
  line-height: 1.05;
}

.price-unit {
  margin: 0.15rem 0 0.75rem;
  color: var(--glow);
}

.price-note {
  color: var(--muted);
}

.period-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.period {
  flex: 1 1 6.4rem;
  min-height: 44px;
  padding: 0.4rem 0.7rem;
  border: 1px solid rgba(0, 184, 255, 0.55);
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.period[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--glow);
  background: rgba(0, 184, 255, 0.16);
  box-shadow: 0 0 0 1px rgba(94, 235, 255, 0.28);
}

@media (min-width: 860px) {
  .config-layout {
    grid-template-columns: minmax(0, 1fr) minmax(16rem, 22rem);
  }

  .price-panel {
    position: sticky;
    top: 5rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .period,
  input[type="range"] {
    transition: none;
  }
}

.template-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0.4rem 0 0.8rem;
}

.template[aria-pressed="true"] {
  color: var(--text);
  border-color: var(--glow);
  box-shadow: 0 0 0 1px rgba(94, 235, 255, 0.35);
}

.slider-block {
  margin: 0.85rem 0;
}
