:root {
  color-scheme: light;
  --ink: #25332f;
  --muted: #64716b;
  --green: #245c4f;
  --green-2: #194639;
  --brand: #245c4f;
  --cream: #f6f8f6;
  --paper: #fff;
  --line: #dce3df;
  --gold: #a98238;
  --danger: #9d392d;
  --ok: #20633e;
  --body: 16px;
  --space: 20px;
  --focus: 3px solid #388dce;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-size: var(--body);
  line-height: 1.6;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; overflow-x: hidden; }
body { background: var(--cream); }

.skip {
  position: absolute;
  left: -999px;
  top: 8px;
  background: var(--paper);
  color: var(--ink);
  padding: 8px 12px;
  z-index: 40;
}
.skip:focus { left: 8px; }

.shell {
  display: grid;
  grid-template-columns: 224px minmax(0, 1fr);
  min-height: 100vh;
}

.nav-side {
  background: #edf2ee;
  color: var(--ink);
  border-right: 1px solid var(--line);
  padding: 28px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 12px;
  padding: 0 8px;
}
.brand .mark {
  width: 36px;
  height: 43px;
  flex-shrink: 0;
  border-radius: 5px 12px 5px 5px;
  background: var(--brand);
  color: #fff;
  font: 34px Georgia, "Songti SC", serif;
  padding-left: 6px;
  line-height: 1.15;
}
.brand .mark span { color: #b9d7a9; }
.brand strong {
  display: block;
  font-size: 19px;
  letter-spacing: -0.04em;
  font-weight: 650;
}
.brand small {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  letter-spacing: 0.13em;
  color: var(--muted);
  font-weight: 600;
}
.brand-sub { display: none; }

#back-docs { margin: 0 8px 8px; }
#back-docs a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}
#back-docs a:hover { text-decoration: underline; }

nav { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
nav button, .actions button, button {
  font: inherit;
  font-size: 16px;
  border: 1px solid transparent;
  background: var(--paper);
  color: var(--ink);
  padding: 10px 14px;
  min-height: 44px;
  cursor: pointer;
  border-radius: 7px;
  font-weight: 600;
}
nav button {
  background: transparent;
  color: var(--ink);
  text-align: left;
  font-weight: 500;
}
nav button[aria-current="page"], nav button:hover {
  background: #fff;
  color: #174e3b;
  box-shadow: 0 1px 4px #25332f0a;
  font-weight: 650;
}
.who {
  font-size: 13px;
  color: var(--muted);
  margin-top: auto;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.workspace {
  padding: 32px 36px 64px;
  max-width: 1120px;
  min-width: 0;
}
.live {
  min-height: 1.5em;
  color: var(--ok);
  margin-bottom: 12px;
}
.live.is-error { color: var(--danger); }

.page-head { margin-bottom: 24px; }
.page-head h1 {
  font-size: 30px;
  margin: 0 0 10px;
  letter-spacing: -0.04em;
  font-weight: 650;
  line-height: 1.3;
}
.page-head p, .lede { color: var(--muted); margin: 0 0 12px; }
.eyebrow {
  font-size: 11px;
  letter-spacing: 0.16em;
  color: #57766a;
  margin: 0 0 8px;
  font-weight: 700;
}

.summary, .panel, .card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 22px;
  margin-bottom: 18px;
  min-width: 0;
}
.summary dl { display: grid; grid-template-columns: minmax(0, 120px) minmax(0, 1fr); gap: 6px 12px; margin: 0; }
.summary dt { color: var(--muted); }
.summary dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }

.layout {
  display: grid;
  grid-template-columns: minmax(0, 240px) minmax(0, 1fr);
  gap: 20px;
}
.list { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.list button {
  text-align: left;
  background: var(--cream);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.list button strong, .list button span { pointer-events: none; }
.list button span { font-size: 13px; color: var(--muted); font-weight: 400; }

label, .lbl { display: block; margin: 12px 0 6px; font-weight: 650; }
.hint { display: block; font-weight: 400; color: var(--muted); font-size: 14px; margin-top: 4px; }
.err {
  color: var(--danger);
  margin: 4px 0 0;
  min-height: 1.2em;
}
.ok { color: var(--ok); }
.muted { color: var(--muted); }

input, textarea, select {
  font: inherit;
  font-size: 16px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid #bfcac3;
  background: #fff;
  color: var(--ink);
  border-radius: 6px;
}
textarea { min-height: 88px; resize: vertical; }
textarea.mono, .diag textarea { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 13px; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 160px), 1fr)); gap: 12px; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.actions button[data-primary], button[data-primary] {
  background: var(--green);
  color: #fff;
}
button:disabled { opacity: 0.55; cursor: not-allowed; }
button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, a:focus-visible {
  outline: var(--focus);
  outline-offset: 2px;
}

.block { border: 1px dashed var(--line); padding: 12px; margin: 8px 0; background: var(--cream); border-radius: 8px; }
.block-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 8px; }
.synth {
  display: inline-block;
  background: #faf5e8;
  border: 1px solid #e5ddca;
  color: #765c24;
  padding: 2px 8px;
  font-size: 13px;
  border-radius: 20px;
}
.preview {
  border: 1px solid var(--line);
  background: #fff;
  padding: 16px;
  overflow: auto;
  max-width: 100%;
}
.preview.phone { width: 320px; max-width: 100%; }
.preview.desktop { width: 100%; }
iframe { width: 100%; min-height: 160px; border: 1px solid var(--line); background: #fff; }
.tita-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 160px), 1fr)); gap: 8px; }
.tita-card { border: 1px solid var(--line); padding: 12px; border-radius: 8px; min-width: 0; }
.tita-motion-static { animation: none; }
.tita-mobile-stack { display: block; }

.table-scroll { overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; }
th, td { border: 1px solid var(--line); padding: 8px 10px; text-align: left; vertical-align: top; }
th { background: var(--cream); }

details.diag {
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 12px;
}
details.diag > summary { cursor: pointer; font-weight: 650; }
.diag pre { overflow-x: auto; max-width: 100%; white-space: pre-wrap; overflow-wrap: anywhere; }
.banner {
  background: #edf7f0;
  border: 1px solid #bfd9c7;
  border-radius: 7px;
  padding: 13px 17px;
  margin-bottom: 18px;
}

.mod-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
  gap: 12px;
}
.cap-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px;
  background: #fcfdfc;
  min-width: 0;
}
.cap-card h3 { margin: 0 0 8px; font-size: 16px; }
.cap-card p { margin: 0 0 10px; color: var(--muted); }
.cap-card .next-step { color: var(--ink); font-weight: 600; }
.stage-pending { border-left: 4px solid var(--gold); }
.stage-authorized-pending { border-left: 4px solid var(--brand); }
.stage-limited { border-left: 4px solid var(--gold); }
.stage-live { border-left: 4px solid var(--ok); }
.surface-list { margin: 0; padding-left: 1.2em; }
.surface-list li { margin: 6px 0; }
.empty { text-align: left; padding: 8px 0; color: var(--muted); }
.empty h3 { color: var(--ink); margin: 0 0 6px; }
.error-panel { border-color: #e1b8ae; background: #fff0eb; }

.req-id { font-variant-numeric: tabular-nums; white-space: nowrap; }
.billing-test { border-left: 4px solid var(--gold); padding-left: 12px; }
.billing-real { border-left: 4px solid var(--danger); padding-left: 12px; }

@media (max-width: 800px) {
  .shell { display: block; }
  .nav-side { position: sticky; top: 0; z-index: 20; padding: 12px; border-right: 0; border-bottom: 1px solid var(--line); overflow-x: hidden; }
  .brand { padding: 0; margin-bottom: 8px; }
  .brand small { display: none; }
  nav { flex-direction: row; overflow-x: auto; }
  nav button { min-width: 92px; text-align: center; white-space: nowrap; }
  .workspace { padding: 16px 12px 48px; }
  .layout { grid-template-columns: 1fr; }
  .summary dl { grid-template-columns: 1fr; }
  .who { margin-top: 8px; }
}

@media (max-width: 320px) {
  .workspace { padding: 12px 8px 40px; }
  nav button { min-width: 72px; padding: 10px 8px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
