/* 未夜伙伴（undusk-partners）· 纸 + 墨 + 琥珀灯视觉体系
 * 与未夜官网、建议站、帮助中心保持统一品牌语言；零外链字体/样式，严格兼容 CSP style-src 'self'。
 */

:root {
  color-scheme: light;
  --bg: #f7f4ee;
  --bg-alt: #efeae1;
  --surface: #fffdf9;
  --surface-soft: #f3eee5;
  --ink: #1c1914;
  --ink-hover: #2f2920;
  --muted: #5c564c;
  --dim: #6d675c;
  --accent: #8a4318;
  --accent-hover: #713510;
  --accent-soft: #f5e9dc;
  --amber: #c46a2e;
  --amber-line: rgba(196, 106, 46, 0.36);
  --sage: #2b5a3e;
  --sage-soft: #e6f0e8;
  --warn: #7a5216;
  --warn-soft: #fbf1da;
  --danger: #8a2a1e;
  --danger-soft: #f8e7e4;
  --line: rgba(28, 25, 20, 0.11);
  --line-strong: rgba(28, 25, 20, 0.22);
  --header-veil: rgba(247, 244, 238, 0.88);
  --shadow-card: 0 1px 2px rgba(28, 25, 20, 0.04), 0 12px 28px -20px rgba(28, 25, 20, 0.18);
  --shadow-lift: 0 2px 6px rgba(28, 25, 20, 0.06), 0 18px 38px -20px rgba(28, 25, 20, 0.24);
  --glow: 0 0 0 4px rgba(138, 67, 24, 0.16);
  --radius-sm: 8px;
  --radius: 16px;
  --radius-lg: 22px;
  --font-sans: ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-display: "Noto Serif SC", "Noto Serif CJK SC", "Songti SC", "STSong", "Source Han Serif SC", Georgia, serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .025 .025 .025 0 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23g)'/%3E%3C/svg%3E");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 88px;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background-color: var(--bg);
  background-image:
    var(--noise),
    radial-gradient(110% 52% at 50% -10%, rgba(196, 106, 46, 0.10), rgba(196, 106, 46, 0) 64%);
  background-repeat: repeat, no-repeat;
  background-size: 200px 200px, 100% 820px;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a,
input,
select {
  touch-action: manipulation;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1,
h2 {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--ink);
}

h1 {
  font-size: clamp(36px, 4.4vw, 56px);
  line-height: 1.24;
  letter-spacing: -0.03em;
}

h2 {
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.32;
  letter-spacing: -0.02em;
}

h3 {
  font-size: 19px;
  line-height: 1.45;
  font-weight: 650;
}

p {
  color: var(--muted);
}

.num,
.price,
.stats-band strong,
.metric strong,
.calc-main strong,
.calc-sim-val strong {
  font-variant-numeric: tabular-nums;
}

.skip {
  position: fixed;
  left: 16px;
  top: -100px;
  padding: 12px 16px;
  border-radius: 8px;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  z-index: 100;
}

.skip:focus {
  top: 16px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

/* ============ Header ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: var(--header-veil);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: saturate(140%) blur(16px);
  backdrop-filter: saturate(140%) blur(16px);
}

.header {
  max-width: 1260px;
  margin: 0 auto;
  padding: 14px 40px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  white-space: nowrap;
  min-height: 44px;
}

.brand img {
  display: block;
  flex-shrink: 0;
  border-radius: 10px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-title {
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--ink);
}

.brand-light {
  font-weight: 500;
  color: var(--accent);
  margin-left: 2px;
}

.brand small {
  display: block;
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: var(--dim);
  font-weight: 600;
}

.header nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 14px;
  color: var(--muted);
}

.header nav a {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 4px 2px;
  transition: color 0.16s var(--ease);
}

.header nav a:hover {
  color: var(--ink);
}

.header nav a[aria-current="page"] {
  color: var(--ink);
  font-weight: 650;
}

.header nav a[aria-current="page"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

/* ============ Buttons & Links ============ */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid var(--ink);
  border-radius: 10px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.16s var(--ease), border-color 0.16s var(--ease), color 0.16s var(--ease), transform 0.12s var(--ease);
}

.button:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.button.secondary {
  border-color: var(--line-strong);
  background: var(--surface);
  color: var(--ink);
}

.button.secondary:hover {
  border-color: var(--amber);
  background: var(--accent-soft);
  color: var(--accent);
}

.button.small {
  min-height: 44px;
  padding: 9px 16px;
  font-size: 13px;
}

.text-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 44px;
  padding: 6px 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.text-link:hover {
  text-decoration: underline;
  text-underline-offset: 4px;
}

.link-button {
  border: 0;
  background: transparent;
  padding: 6px 0;
  text-align: left;
}

.inline-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============ Layout & Typography Helpers ============ */
main {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 40px 40px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  font-size: 11px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent);
}

.eyebrow::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 3px rgba(196, 106, 46, 0.22);
}

.section-kicker {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent);
}

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

.margin-top {
  margin-top: 24px;
}

.loading {
  padding: 110px 0;
  text-align: center;
  color: var(--dim);
}

/* ============ Hero ============ */
.hero {
  display: grid;
  grid-template-columns: 1.06fr 1fr;
  align-items: center;
  gap: 56px;
  padding: 64px 0 56px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
}

.hero-lede {
  margin-top: 20px;
  max-width: 470px;
  font-size: 15.5px;
  line-height: 1.9;
  color: var(--muted);
}

.hero-pillars {
  list-style: none;
  margin: 22px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 12px;
  color: var(--dim);
}

.hero-pillars li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.hero-pillars li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--amber);
  opacity: 0.7;
}

.illustration {
  position: relative;
  min-height: 390px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(ellipse at center, rgba(196, 106, 46, 0.14), rgba(196, 106, 46, 0) 68%);
}

.orbit {
  position: absolute;
  width: 332px;
  height: 332px;
  border: 1px solid rgba(138, 67, 24, 0.22);
  border-radius: 50%;
  transform: rotate(-16deg);
}

.orbit::after {
  content: "";
  position: absolute;
  top: 34px;
  left: 34px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--amber);
  border: 3px solid var(--bg);
}

.orbit-inner {
  position: absolute;
  width: 244px;
  height: 244px;
  border: 1px dashed rgba(28, 25, 20, 0.18);
  border-radius: 50%;
}

.core {
  position: relative;
  z-index: 1;
  width: 164px;
  height: 164px;
  border-radius: 34px;
  background: linear-gradient(155deg, #24201a 0%, #15120e 100%);
  border: 1px solid rgba(255, 253, 248, 0.12);
  box-shadow: 0 24px 48px -18px rgba(28, 25, 20, 0.45), 0 0 0 1px rgba(196, 106, 46, 0.22);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: #fffdf8;
  transform: rotate(-4deg);
}

.core img {
  width: 54px;
  height: 54px;
  border-radius: 14px;
}

.core strong {
  margin-top: 8px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: 0.05em;
}

.core small {
  margin-top: 3px;
  font-size: 9px;
  letter-spacing: 0.16em;
  color: #d9a77e;
}

.node {
  position: absolute;
  z-index: 2;
  min-width: 160px;
  padding: 14px 16px;
  border-radius: 14px;
  background: rgba(255, 253, 249, 0.92);
  border: 1px solid rgba(28, 25, 20, 0.10);
  box-shadow: var(--shadow-lift);
  display: flex;
  align-items: flex-start;
  gap: 10px;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}

.node strong {
  display: block;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  line-height: 1.3;
}

.node small {
  display: block;
  margin-top: 3px;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.4;
}

.node .dot {
  width: 8px;
  height: 8px;
  margin-top: 5px;
  border-radius: 50%;
  background: var(--sage);
  flex-shrink: 0;
}

.node .dot.amber {
  background: var(--amber);
}

.node.one { left: 0; top: 22px; }
.node.two { right: 0; top: 70px; }
.node.three { left: 10px; bottom: 34px; }
.node.four { right: 8px; bottom: 14px; }

/* ============ Stats Band ============ */
.stats-band {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 24px 0;
  margin-bottom: 68px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stats-band > div {
  padding: 0 26px;
  border-right: 1px solid var(--line);
}

.stats-band > div:first-child { padding-left: 0; }
.stats-band > div:last-child { border-right: 0; padding-right: 0; }

.stats-band strong {
  display: block;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  line-height: 1.2;
  color: var(--ink);
}

.stats-band strong small {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 400;
  color: var(--muted);
}

.stats-band span {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--muted);
}

/* ============ Sections & Cards ============ */
.section {
  padding-bottom: 68px;
}

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

.section-head p {
  margin-top: 8px;
  font-size: 14px;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  align-items: stretch;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.18s var(--ease), box-shadow 0.18s var(--ease);
}

.card:hover {
  border-color: rgba(138, 67, 24, 0.32);
  box-shadow: var(--shadow-lift);
}

.card.featured {
  border: 2px solid var(--accent);
  background: linear-gradient(180deg, #fffbf4 0%, #fffdf9 42%);
  padding: 27px;
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.label {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
}

.featured .label {
  background: var(--accent);
  color: #fffdf8;
}

.card-unit {
  font-size: 12px;
  color: var(--dim);
}

.card h3 {
  margin-top: 16px;
  font-family: var(--font-display);
  font-size: 21px;
}

.price {
  margin: 14px 0 6px;
  font-family: Georgia, serif;
  font-size: 38px;
  line-height: 1.2;
  font-weight: 500;
  color: var(--ink);
}

.price small {
  font-family: var(--font-sans);
  font-size: 14px;
  font-weight: 400;
  color: var(--muted);
}

.card-intro {
  font-size: 13.5px;
  min-height: 46px;
  color: var(--muted);
}

.features {
  list-style: none;
  margin: 18px 0 22px;
  padding: 18px 0 0;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
  color: var(--ink);
}

.features li {
  position: relative;
  padding-left: 22px;
  margin: 9px 0;
}

.features li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sage);
  font-weight: 700;
}

.card-foot {
  margin-top: auto;
}

.card .button {
  width: 100%;
}

.hint {
  margin-top: 10px;
  font-size: 12px;
  text-align: center;
  color: var(--dim);
}

/* ============ Channels & Process ============ */
.channel-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.channel-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px 22px 18px;
  box-shadow: var(--shadow-card);
  transition: border-color 0.16s var(--ease), transform 0.16s var(--ease);
}

.channel-card:hover {
  border-color: var(--amber-line);
  transform: translateY(-2px);
}

.channel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 18px;
}

.channel-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
}

.channel-tag {
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--bg);
  border: 1px solid var(--line);
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}

.channel-card h3 {
  font-size: 18px;
}

.channel-card p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.7;
}

.channel-fit {
  margin-top: 8px !important;
  font-size: 12px !important;
  color: var(--dim) !important;
}

.channel-card .text-link {
  margin-top: auto;
  padding-top: 14px;
}

.process {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  padding: 32px;
  border-radius: var(--radius-lg);
  background: var(--bg-alt);
  border: 1px solid var(--line);
}

.process-step span {
  display: inline-block;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.process-step h3 {
  margin-top: 10px;
  font-size: 16.5px;
}

.process-step p {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.75;
}

/* ============ CTA Band ============ */
.cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 40px 42px;
  margin-bottom: 36px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(60% 130% at 88% 15%, rgba(196, 106, 46, 0.28), rgba(196, 106, 46, 0) 65%),
    #1c1914;
  color: #fffdf8;
}

.cta-eyebrow {
  margin-bottom: 10px;
  font-size: 10px;
  letter-spacing: 0.18em;
  font-weight: 700;
  color: #e0a473;
}

.cta h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  color: #fffdf8;
}

.cta p {
  margin-top: 8px;
  font-size: 14px;
  color: #cfc8bc;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  flex-shrink: 0;
}

.cta .cta-primary {
  background: #fffdf8;
  border-color: #fffdf8;
  color: var(--ink);
}

.cta .cta-primary:hover {
  background: #f5e9dc;
  border-color: #f5e9dc;
  color: var(--accent);
}

.cta .cta-ghost {
  background: transparent;
  border-color: rgba(255, 253, 248, 0.28);
  color: #fffdf8;
}

.cta .cta-ghost:hover {
  background: rgba(255, 253, 248, 0.12);
  border-color: rgba(255, 253, 248, 0.52);
}

/* ============ Inner Pages, Guards & Notices ============ */
.page-head {
  padding: 48px 0 32px;
  max-width: 780px;
}

.page-head h1 {
  font-size: clamp(30px, 3.6vw, 44px);
}

.page-head p {
  margin-top: 14px;
  font-size: 15px;
}

.notice {
  padding: 16px 20px;
  margin-bottom: 24px;
  border-radius: 12px;
  border: 1px solid #e2d5c1;
  border-left: 3px solid var(--amber);
  background: #faf4e8;
  color: #544636;
  font-size: 13.5px;
  line-height: 1.8;
}

.guard-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin-top: 22px;
}

.guard-item {
  padding: 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.guard-item h3 {
  font-size: 16px;
}

.guard-item p {
  margin-top: 8px;
  font-size: 13px;
}

/* ============ Tables & Tiers ============ */
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-card);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
  font-size: 13.5px;
}

th,
td {
  padding: 16px 20px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

th.num,
td.num {
  text-align: right;
}

th {
  background: var(--bg-alt);
  font-size: 12px;
  font-weight: 650;
  color: var(--muted);
}

tr:last-child td {
  border-bottom: 0;
}

.tier-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 30px;
  padding: 2px 7px;
  margin-right: 6px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
}

.tier-l0 { background: var(--bg-alt); color: var(--muted); }
.tier-l1 { background: #f3e8d7; color: var(--accent); }
.tier-l2 { background: #e8e2f0; color: #4b3d6e; }
.tier-l3 { background: #1c1914; color: #f4d6b5; }

/* ============ Panels, Forms & Simulator ============ */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  align-items: start;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-card);
}

.panel-soft {
  background: var(--surface-soft);
}

.panel h3 {
  font-family: var(--font-display);
  font-size: 22px;
  margin-bottom: 8px;
}

.panel-sub {
  font-size: 13.5px;
  margin-bottom: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin: 16px 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.field input,
.field select {
  width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-weight: 400;
}

.field input:focus,
.field select:focus {
  border-color: var(--accent);
  box-shadow: var(--glow);
  outline: none;
}

.check {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 18px 0;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}

.check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex-shrink: 0;
  accent-color: var(--accent);
}

.calc-result {
  margin-top: 20px;
  padding: 22px;
  border-radius: 14px;
  background: var(--bg);
  border: 1px solid var(--line);
}

.calc-main p {
  font-size: 12px;
  color: var(--muted);
}

.calc-main strong {
  display: block;
  margin-top: 4px;
  font-family: Georgia, serif;
  font-size: 36px;
  line-height: 1.15;
  color: var(--accent);
}

.calc-breakdown {
  margin: 16px 0 0;
  padding: 14px 0 0;
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.calc-breakdown dt {
  font-size: 11.5px;
  color: var(--dim);
}

.calc-breakdown dd {
  margin: 3px 0 0;
  font-size: 14px;
  font-weight: 650;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}

.calc-sim {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.calc-sim-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.qty-group {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.qty-btn {
  min-height: 44px;
  min-width: 52px;
  padding: 6px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.qty-btn.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffdf8;
}

.calc-sim-val {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 13px;
  color: var(--muted);
}

.calc-sim-val strong {
  font-family: Georgia, serif;
  font-size: 24px;
  color: var(--ink);
}

.calc-note {
  margin-top: 8px;
  font-size: 12px;
  color: var(--sage);
}

.calc-footnote {
  margin-top: 12px;
  font-size: 11.5px;
  color: var(--dim);
}

.apply-panel form .button {
  width: 100%;
  margin-top: 6px;
}

/* ============ Workspace & Operations ============ */
.workspace-head {
  max-width: none;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.ws-sub {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.ws-head-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.workspace-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  margin: 22px 0;
}

.metric {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}

.metric p {
  font-size: 12px;
  color: var(--dim);
}

.metric strong {
  display: block;
  margin-top: 8px;
  font-family: Georgia, serif;
  font-size: 30px;
  font-weight: 500;
  color: var(--ink);
}

.tier-progress {
  margin-bottom: 24px;
  padding: 18px 22px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.tier-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.tier-progress-head strong {
  color: var(--accent);
}

.progress-rail {
  width: 100%;
  height: 8px;
  margin-top: 10px;
  border: 0;
  border-radius: 999px;
  background: var(--bg-alt);
  overflow: hidden;
  appearance: none;
}

.progress-rail::-webkit-progress-bar {
  background: var(--bg-alt);
  border-radius: 999px;
}

.progress-rail::-webkit-progress-value {
  background: linear-gradient(90deg, var(--amber), var(--accent));
  border-radius: 999px;
}

.progress-rail::-moz-progress-bar {
  background: linear-gradient(90deg, var(--amber), var(--accent));
  border-radius: 999px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.tab {
  min-height: 44px;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  transition: background-color 0.14s var(--ease), border-color 0.14s var(--ease), color 0.14s var(--ease);
}

.tab:hover {
  border-color: var(--amber-line);
  color: var(--ink);
}

.tab.active {
  background: var(--ink);
  border-color: var(--ink);
  color: #fffdf8;
}

.status {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--bg-alt);
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  vertical-align: middle;
}

.status.good { background: var(--sage-soft); color: var(--sage); }
.status.warn { background: var(--warn-soft); color: var(--warn); }
.status.bad { background: var(--danger-soft); color: var(--danger); }

.channel-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
}

.split-line {
  height: 1px;
  background: var(--line);
  margin: 16px 0;
}

.copy-field {
  margin: 16px 0 12px;
  padding: 13px 15px;
  border-radius: 10px;
  background: var(--bg);
  border: 1px dashed var(--line-strong);
  font-size: 12px;
  word-break: break-all;
  color: var(--ink);
}

.empty {
  padding: 52px 24px;
  text-align: center;
  border-radius: var(--radius);
  background: rgba(255, 253, 249, 0.7);
  border: 1px dashed var(--line-strong);
}

.empty strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  color: var(--ink);
}

.empty p {
  margin-top: 8px;
  font-size: 13.5px;
}

.order-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px;
  margin-bottom: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.order-meta {
  margin-top: 6px;
  font-size: 13px;
}

.order-id {
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--dim);
}

.order-card .actions {
  margin: 0;
}

.mono {
  font-family: var(--font-mono);
  overflow-wrap: anywhere;
  white-space: normal;
}

.faq-list {
  border-top: 1px solid var(--line);
}

.faq {
  border-bottom: 1px solid var(--line);
  padding: 6px 0;
}

.faq summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 600;
  color: var(--ink);
  list-style: none;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  font-size: 18px;
  color: var(--accent);
  flex-shrink: 0;
}

.faq[open] summary::after {
  content: "−";
}

.faq p {
  max-width: 780px;
  padding: 0 0 16px;
  font-size: 13.5px;
  line-height: 1.85;
}

.staff-card {
  padding: 22px 24px;
  margin-bottom: 16px;
  border-radius: var(--radius);
  background: var(--surface);
  border: 1px solid var(--line);
}

.staff-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.staff-card > p {
  margin: 8px 0 14px;
  font-size: 13px;
}

.reviews {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.reviews select {
  min-height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
}

.staff-card-foot {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

/* ============ Footer ============ */
.site-footer {
  margin-top: auto;
  border-top: 1px solid var(--line);
  background: var(--bg-alt);
}

.footer {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 40px 34px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.footer-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.footer-brand {
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}

.footer-slogan {
  font-size: 13px;
  color: var(--muted);
}

.footer-bottom {
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  flex-wrap: wrap;
  font-size: 12px;
  color: var(--dim);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
}

.footer-links a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.footer-legal {
  font-size: 12px;
  color: var(--dim);
}

.footer-legal a {
  color: var(--dim);
  white-space: nowrap;
}

.footer-legal a:hover {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ============ Dialog & Toast ============ */
dialog {
  width: min(468px, calc(100vw - 32px));
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 28px 72px rgba(28, 25, 20, 0.28);
}

dialog::backdrop {
  background: rgba(28, 25, 20, 0.48);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.dialog-eyebrow {
  margin-bottom: 8px;
  font-size: 10px;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--accent);
}

dialog h2 {
  font-size: 26px;
  margin-bottom: 8px;
}

.dialog-sub {
  font-size: 13.5px;
  color: var(--muted);
}

dialog .button {
  width: 100%;
  margin-top: 12px;
}

.dialog-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 24px;
}

.dialog-close:hover {
  background: var(--bg-alt);
  color: var(--ink);
}

.form-error {
  min-height: 20px;
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--danger);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 10px;
  background: var(--ink);
  color: #fffdf8;
  font-size: 13px;
  box-shadow: 0 10px 28px rgba(28, 25, 20, 0.28);
  z-index: 60;
}

/* ============ Responsive ============ */
@media (max-width: 1040px) {
  .header { padding: 14px 28px; gap: 16px; }
  .header nav { gap: 18px; font-size: 13px; }
  main { padding: 0 28px 32px; }
  .hero { gap: 32px; padding: 48px 0 42px; }
  .illustration { min-height: 340px; }
  .node { min-width: 140px; padding: 12px; }
  .stats-band { grid-template-columns: repeat(2, 1fr); gap: 18px 0; }
  .stats-band > div:nth-child(2) { border-right: 0; }
  .stats-band > div:nth-child(3) { padding-left: 0; }
  .channel-grid { grid-template-columns: repeat(2, 1fr); }
  .process { grid-template-columns: repeat(2, 1fr); padding: 26px; }
  .guard-grid { grid-template-columns: 1fr; }
  .footer { padding: 24px 28px 30px; }
}

@media (max-width: 700px) {
  .header { flex-wrap: wrap; padding: 12px 18px; gap: 10px 14px; }
  .brand-title { font-size: 17px; }
  .header nav { order: 3; flex-basis: 100%; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
  .header > .button { margin-left: auto; }
  #account-button { max-width: 158px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  main { padding: 0 18px 28px; }
  .hero { grid-template-columns: 1fr; gap: 22px; padding: 30px 0 28px; }
  .hero h1 { font-size: 36px; }
  .hero-lede { font-size: 14px; margin-top: 14px; }
  .hero .actions { margin-top: 20px; }
  .illustration { min-height: 344px; max-width: 390px; width: 100%; margin: 0 auto; }
  .orbit { width: 256px; height: 256px; }
  .orbit-inner { width: 188px; height: 188px; }
  .core { width: 122px; height: 122px; border-radius: 26px; }
  .core img { width: 42px; height: 42px; }
  .core strong { font-size: 14.5px; }
  .core small { font-size: 8px; }
  .node { min-width: 124px; padding: 9px 11px; gap: 7px; }
  .node strong { font-size: 12px; }
  .node small { font-size: 10px; }
  .node.one { left: 0; top: 4px; }
  .node.two { right: 0; top: 36px; }
  .node.three { left: 0; bottom: 26px; }
  .node.four { right: 0; bottom: 0; }
  .stats-band { margin-bottom: 42px; padding: 18px 0; }
  .stats-band > div { padding: 0 12px; }
  .stats-band > div:nth-child(odd) { padding-left: 0; }
  .stats-band strong { font-size: 21px; }
  .section { padding-bottom: 44px; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .card-grid,
  .two-col,
  .workspace-grid { grid-template-columns: 1fr; }
  .card,
  .card.featured,
  .panel { padding: 22px; }
  .card-intro { min-height: 0; }
  .price { font-size: 34px; }
  .channel-grid { grid-template-columns: 1fr; gap: 14px; }
  .process { grid-template-columns: 1fr; padding: 22px; gap: 20px; }
  .cta { padding: 28px 22px; flex-direction: column; align-items: flex-start; }
  .cta-actions { width: 100%; }
  .cta-actions .button { flex: 1; }
  .page-head { padding: 28px 0 22px; }
  .page-head h1 { font-size: 28px; }
  .workspace-head { flex-direction: column; align-items: flex-start; }
  .metric { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; }
  .metric strong { margin: 0; font-size: 24px; }
  .calc-breakdown { grid-template-columns: 1fr; }
  .order-card { flex-direction: column; align-items: flex-start; padding: 18px; }
  .order-card .actions { width: 100%; }
  .order-card .button { flex: 1; }
  th, td { padding: 13px 14px; }
  .footer { padding: 22px 18px 28px; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
  dialog { padding: 26px 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
