:root {
  --bg: #080d16;
  --panel: #101826;
  --panel-soft: #141f2f;
  --line: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #38bdf8;
  --gold: #facc15;
  --green: #22c55e;
  --danger: #f87171;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
}

* { box-sizing: border-box; }
html { color-scheme: dark; }

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.demo-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 44px;
}

.demo-topbar,
.demo-actions,
.tool-actions,
.button-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.demo-topbar {
  justify-content: space-between;
  margin-bottom: 22px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #0b1220;
  box-shadow: var(--shadow);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid rgba(250, 204, 21, 0.38);
  border-radius: 8px;
  background: linear-gradient(135deg, #fef3c7, var(--gold));
  color: #111827;
  font-weight: 900;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 8px;
  padding: 10px 14px;
  background: rgba(56, 189, 248, 0.1);
  color: #e0f2fe;
  font-weight: 900;
}

.btn.primary {
  border-color: transparent;
  background: linear-gradient(135deg, #fef3c7, var(--gold));
  color: #111827;
}

.btn.subtle {
  border-color: var(--line);
  background: transparent;
  color: var(--soft);
}

.demo-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border: 1px solid rgba(250, 204, 21, 0.28);
  border-radius: 999px;
  padding: 6px 10px;
  color: #fde68a;
  background: rgba(250, 204, 21, 0.08);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero,
.panel,
.metric-card,
.tool-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  gap: 12px;
  margin-bottom: 22px;
  padding: 26px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 4px; font-size: clamp(2.15rem, 5vw, 3.35rem); line-height: 1.02; letter-spacing: -0.045em; }
h2 { margin-bottom: 12px; font-size: 1.25rem; }
h3 { margin-bottom: 6px; font-size: 1.05rem; }
p { color: var(--muted); line-height: 1.5; }

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

.demo-guide {
  margin-bottom: 22px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.guide-step {
  display: grid;
  gap: 10px;
  align-content: start;
  min-height: 156px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
}

.guide-step span {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 999px;
  background: rgba(250, 204, 21, 0.12);
  color: #fde68a;
  font-weight: 900;
}

.helper-text {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.07);
  color: #cbd5e1;
  font-size: 0.92rem;
}

.tool-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  min-height: 132px;
  padding: 20px;
  background: var(--panel-soft);
}

.tool-mark {
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.3);
  border-radius: 8px;
  background: #0b1220;
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
}

.arrow { color: var(--blue); font-size: 22px; font-weight: 900; }

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 16px;
  align-items: start;
}

.panel { padding: 18px; }
.panel + .panel { margin-top: 14px; }

.row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

label {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

input, select, textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  padding: 10px 12px;
  background: #0b1220;
  color: #fff;
}

textarea { min-height: 92px; resize: vertical; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 10px 8px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  text-align: left;
  vertical-align: top;
}
th {
  color: #fde68a;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric-card {
  padding: 20px;
  background: var(--panel-soft);
}

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

.metric-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--soft);
}

.metric-line strong { color: #fff; text-align: right; }

.notice {
  margin: 0;
  padding: 12px;
  border: 1px solid rgba(250, 204, 21, 0.22);
  border-radius: 8px;
  color: #fde68a;
  background: rgba(250, 204, 21, 0.08);
  font-size: 0.9rem;
}

.document-preview {
  margin-top: 12px;
  padding: 16px;
  border-radius: 8px;
  background: #f8fafc;
  color: #0f172a;
}

.document-preview p,
.document-preview .muted { color: #475569; }

.print-note { margin: 10px 0 0; font-size: 0.85rem; }

@media (max-width: 820px) {
  .demo-shell { width: min(100% - 18px, 1180px); padding-top: 8px; padding-bottom: 24px; }
  .demo-topbar { display: grid; align-items: flex-start; gap: 9px; margin-bottom: 10px; padding: 10px; }
  .brand { min-width: 0; }
  .brand span:last-child { overflow-wrap: anywhere; }
  .demo-actions,
  .tool-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    width: 100%;
    gap: 7px;
  }
  .demo-actions .demo-badge,
  .tool-actions .btn:first-child,
  .demo-actions .btn.primary,
  .tool-actions .btn.primary {
    grid-column: 1 / -1;
  }
  .demo-actions .btn, .tool-actions .btn, .button-row .btn { width: 100%; text-align: center; }
  .demo-layout, .grid, .guide-steps, .row { grid-template-columns: 1fr; }
  .hero { gap: 7px; margin-bottom: 10px; padding: 14px; }
  h1 { font-size: clamp(1.8rem, 11vw, 2.45rem); line-height: 1.08; }
  h2 { font-size: 1.12rem; }
  p { line-height: 1.45; }
  .demo-guide { margin-bottom: 12px; padding: 12px; }
  .guide-step { min-height: 0; padding: 12px; }
  .helper-text { margin-bottom: 12px; padding: 10px; }
  .panel, .metric-card { padding: 13px; }
  .tool-card { grid-template-columns: 44px minmax(0, 1fr) auto; min-height: 94px; padding: 13px; }
  .tool-mark { width: 44px; height: 44px; }
  .tool-actions .btn { min-height: 40px; padding: 8px 6px; text-align: center; }
  .button-row { display: grid; grid-template-columns: 1fr; width: 100%; }
  input, select { min-height: 42px; }
  textarea { min-height: 78px; }
  th, td { padding: 8px 7px; }
}
