:root {
  --bg: #f7f8fb;
  --ink: #17202a;
  --muted: #657180;
  --line: #dce2ea;
  --panel: #ffffff;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --warm: #b45309;
  --dark: #111827;
  --danger: #b91c1c;
  --success: #047857;
  --soft: #eef7f4;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.5;
}

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

.topbar {
  align-items: center;
  background: rgba(247, 248, 251, 0.9);
  border-bottom: 1px solid var(--line);
  display: flex;
  height: 68px;
  justify-content: space-between;
  padding: 0 32px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.brand {
  color: var(--dark);
  font-weight: 800;
}

.brand.stacked {
  align-items: center;
  display: flex;
  gap: 10px;
  line-height: 1.2;
  padding: 28px 24px;
}

.brand-logo {
  background: #ffffff;
  border-radius: 8px;
  display: block;
  flex: 0 0 auto;
  height: 38px;
  object-fit: contain;
  padding: 3px;
  width: 38px;
}

.brand-copy {
  display: block;
  min-width: 0;
}

.brand-copy strong {
  display: block;
  font-size: 14px;
  white-space: nowrap;
}

.brand small {
  color: #94a3b8;
  display: block;
  font-size: 12px;
  margin-top: 4px;
}

.nav {
  display: flex;
  gap: 20px;
  color: var(--muted);
  font-size: 14px;
}

.hero {
  display: grid;
  gap: 32px;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  min-height: calc(100vh - 68px);
  padding: 92px 56px 48px;
}

.hero-copy {
  align-self: center;
  max-width: 760px;
}

.eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.section-heading {
  margin-bottom: 22px;
}

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

h1 {
  font-size: clamp(44px, 7vw, 88px);
  line-height: 0.98;
  margin-bottom: 24px;
}

h2 {
  font-size: 32px;
  margin-bottom: 18px;
}

h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

.lead {
  color: var(--muted);
  font-size: 19px;
  line-height: 1.7;
  max-width: 680px;
}

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

.compact-actions {
  margin-top: 22px;
}

.button,
button {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  text-align: center;
  white-space: nowrap;
}

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

.button.secondary,
button {
  background: white;
  color: var(--ink);
}

.button.mini {
  font-size: 12px;
  min-height: 32px;
  padding: 0 10px;
}

.button.danger {
  border-color: #f1b7b7;
  color: var(--danger);
}

.hero-panel,
.panel,
.metrics article,
.grid article,
.search-demo {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero-panel {
  align-self: center;
  overflow: hidden;
}

.panel-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px 16px;
}

.panel-header > div {
  min-width: 0;
}

.panel-header h2 {
  font-size: 18px;
  line-height: 1.35;
  margin: 0;
}

.status {
  color: var(--warm);
  flex: 0 0 auto;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  max-width: 42%;
  overflow-wrap: anywhere;
  text-align: right;
}

.status.success {
  color: var(--success);
}

.status.warning {
  color: var(--warm);
}

pre {
  color: #213547;
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 13px;
  line-height: 1.65;
  margin: 0;
  overflow: auto;
  overflow-wrap: anywhere;
  padding: 18px;
  white-space: pre-wrap;
}

pre + .field-help {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 16px 14px;
}

.section {
  padding: 72px 56px;
}

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

.grid article {
  padding: 22px;
}

.grid p,
.split p,
.metrics span {
  color: var(--muted);
  line-height: 1.6;
}

.split {
  align-items: start;
  display: grid;
  gap: 28px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 440px);
}

.search-demo {
  padding: 22px;
}

.search-demo label {
  display: block;
  font-weight: 800;
  margin-bottom: 12px;
}

.search-row {
  display: flex;
  gap: 10px;
}

input {
  border: 1px solid var(--line);
  border-radius: 8px;
  flex: 1;
  font: inherit;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

input[type="checkbox"] {
  flex: 0 0 auto;
  min-height: auto;
  width: 18px;
}

select {
  appearance: none;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  min-height: 40px;
  min-width: 0;
  padding: 0 12px;
  width: 100%;
}

.footer {
  border-top: 1px solid var(--line);
  color: var(--muted);
  padding: 28px 56px;
}

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

.sidebar {
  background: var(--dark);
  color: white;
  display: flex;
  flex-direction: column;
  height: 100vh;
  position: sticky;
  top: 0;
}

.sidebar .brand {
  color: white;
}

.side-nav {
  display: grid;
  gap: 6px;
  padding: 0 14px;
}

.side-nav button,
.side-nav a {
  align-items: center;
  background: transparent;
  border-color: transparent;
  border-radius: 8px;
  color: #cbd5e1;
  display: flex;
  font-weight: 700;
  justify-content: flex-start;
  min-height: 42px;
  padding: 0 16px;
}

.side-nav button.active,
.side-nav a.active {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

.sidebar-account {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  display: grid;
  gap: 8px;
  margin: auto 14px 18px;
  padding-top: 16px;
}

.sidebar-account-summary {
  display: grid;
  gap: 4px;
  padding: 0 10px 8px;
}

.sidebar-account-summary span {
  color: #94a3b8;
  font-size: 11px;
  font-weight: 700;
}

.sidebar-account-summary strong {
  color: #ffffff;
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.sidebar-utility {
  align-items: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 8px;
  color: #e2e8f0;
  display: flex;
  font-size: 13px;
  font-weight: 700;
  justify-content: flex-start;
  min-height: 40px;
  padding: 0 12px;
  width: 100%;
}

.sidebar-utility:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.workspace {
  min-width: 0;
  padding: 32px;
}

.workspace-header {
  align-items: flex-start;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.workspace-header > div:first-child {
  min-width: 0;
}

.workspace-header h1 {
  font-size: 34px;
  line-height: 1.1;
  margin: 0;
}

.workspace-lead {
  color: var(--muted);
  line-height: 1.7;
  margin: 10px 0 0;
}

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

.header-context {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  gap: 12px;
  justify-content: flex-end;
  min-width: 0;
}

.site-context-control {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  flex: 1 1 360px;
  gap: 7px;
  padding: 12px;
  position: relative;
  width: min(400px, 100%);
}

.site-context-heading {
  align-items: center;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.site-context-heading > span:first-child {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.site-context-control select {
  font-weight: 700;
  min-height: 42px;
  width: 100%;
}

.site-context-meta {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.site-context-meta > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.site-context-meta strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.site-context-meta small {
  color: var(--muted);
  line-height: 1.5;
}

.site-count-label {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.sidebar .site-context-control.sidebar-site-context {
  background: rgba(30, 41, 59, 0.72);
  border-color: #334155;
  display: grid;
  flex: none;
  gap: 8px;
  margin: 0 16px 18px;
  padding: 12px;
  width: auto;
}

.sidebar-site-context .site-context-heading > span:first-child {
  color: #94a3b8;
}

.sidebar .sidebar-site-context select {
  background: #0f172a;
  border-color: #475569;
  color: #ffffff;
  height: 42px;
  min-height: 42px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-site-context .site-context-meta strong {
  color: #cbd5e1;
  font-size: 12px;
}

.header-actions {
  align-items: center;
  display: flex;
  flex: 0 0 auto;
  flex-wrap: nowrap;
  gap: 8px;
  justify-content: flex-end;
  min-width: 0;
}

.account-access-line {
  align-items: center;
  display: grid;
  gap: 2px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-bottom: 8px;
}

.account-access-line:last-child {
  margin-bottom: 0;
}

.account-access-line strong {
  font-size: 12px;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.account-access-line span {
  color: var(--muted);
  font-size: 11px;
}

.account-access-line small {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.header-actions .field-help {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.client-page-intro {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf9 100%);
}

.metrics {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-bottom: 18px;
}

.guide-panel {
  border-color: #b7d8d1;
}

.ops-guide {
  background: linear-gradient(180deg, #ffffff 0%, #f6fbf9 100%);
}

.guide-steps {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  padding: 16px;
}

.compact-guide {
  border-bottom: 1px solid var(--line);
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.guide-steps div {
  background: var(--soft);
  border: 1px solid #cce4df;
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 14px;
}

.guide-steps strong {
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1.45;
}

.guide-steps span,
.guide-note,
.field-help,
.form-help {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.guide-note {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 14px 16px 16px;
}

.guide-page {
  background: #ffffff;
}

.guide-manual {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.guide-manual article {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 16px;
}

.guide-manual h3 {
  color: var(--accent-strong);
  font-size: 16px;
  margin: 0;
}

.guide-manual p,
.guide-manual li {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.75;
}

.guide-manual p,
.guide-manual ul,
.guide-manual ol {
  margin-bottom: 0;
}

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

.analysis-grid div {
  background: #f9fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.analysis-grid strong {
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1.4;
}

.analysis-grid span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.metrics article {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 18px;
}

.metrics strong {
  font-size: 26px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.metric-label {
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.panel {
  margin-bottom: 18px;
  overflow: hidden;
}

.primary-queue {
  border-color: #9ccfc5;
}

.customer-ledger table {
  min-width: 960px;
}

.customer-ledger {
  overflow: hidden;
}

.ledger-table-wrap {
  overflow-x: auto;
}

.contract-metrics {
  border-bottom: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.contract-metrics > div {
  border-right: 1px solid var(--line);
  display: grid;
  gap: 4px;
  padding: 16px 20px;
}

.contract-metrics > div:last-child {
  border-right: 0;
}

.contract-metrics span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.contract-metrics strong {
  font-size: 23px;
}

.ledger-toolbar {
  align-items: end;
  background: #f8fafc;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(145px, 0.35fr));
  padding: 16px 20px;
}

.ledger-toolbar label {
  display: grid;
  gap: 6px;
}

.ledger-toolbar label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.service-contract-row {
  align-items: center;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: auto 1fr;
  min-width: 220px;
  padding: 9px 10px;
  text-align: left;
}

.service-contract-row:hover {
  border-color: #8fc9bf;
  box-shadow: 0 2px 8px rgba(15, 118, 110, 0.08);
}

.service-contract-row > span:not(.service-pill) {
  font-size: 12px;
  font-weight: 800;
  text-align: right;
}

.service-contract-row small {
  color: var(--muted);
  font-size: 11px;
  grid-column: 1 / -1;
}

.contract-dialog {
  border: 0;
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.28);
  color: var(--ink);
  max-width: 720px;
  padding: 0;
  width: calc(100% - 32px);
}

.contract-dialog::backdrop {
  background: rgba(15, 23, 42, 0.54);
}

.contract-dialog header,
.contract-dialog footer {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 20px 22px;
}

.contract-dialog header {
  border-bottom: 1px solid var(--line);
}

.contract-dialog header h2,
.contract-dialog header p {
  margin: 0;
}

.contract-dialog header > div {
  display: grid;
  gap: 5px;
}

.contract-dialog footer {
  border-top: 1px solid var(--line);
  gap: 10px;
  justify-content: flex-end;
}

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

.contract-form-grid label {
  display: grid;
  gap: 7px;
}

.contract-form-grid label > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.contract-dialog-meta {
  background: #f8fafc;
  color: var(--muted);
  display: flex;
  font-size: 12px;
  gap: 18px;
  justify-content: space-between;
  padding: 12px 22px;
}

.contract-lifecycle-panel,
.contract-audit-panel {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px 22px;
}

.contract-lifecycle-panel h3,
.contract-audit-panel h3 {
  font-size: 14px;
  margin: 0 0 5px;
}

.contract-lifecycle-panel p {
  color: var(--muted);
  font-size: 12px;
  margin: 0;
}

.contract-audit-panel {
  display: block;
}

.contract-audit-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  font-size: 12px;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto auto;
  padding: 8px 0;
}

.contract-audit-row small,
.contract-audit-row span {
  color: var(--muted);
}

.one-code-summary {
  align-items: flex-start;
  display: flex;
  flex-direction: column;
  gap: 7px;
  min-width: 106px;
}

.one-code-summary small {
  color: var(--muted);
  font-size: 11px;
}

.panel-header p {
  color: var(--muted);
  font-size: 13px;
  margin: 6px 0 0;
}

.panel-header.compact {
  min-height: 58px;
}

.tag-install-body {
  align-items: stretch;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) 220px;
  padding: 18px 16px;
}

.tag-install-body pre {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 72px;
  padding: 14px 16px;
}

.tag-install-actions {
  align-content: center;
  display: grid;
  gap: 12px;
}

.tag-install-actions .button {
  width: 100%;
}

.tag-site-key {
  align-items: center;
  background: #f9fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 42px;
  min-width: 0;
  padding: 0 12px;
}

.tag-site-key span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.tag-site-key code {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-install-body + .field-help {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 16px 14px;
}

#member-request-form + .field-help {
  border-top: 1px solid var(--line);
  margin: 0;
  padding: 12px 16px 14px;
}

.console-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.85fr);
}

.client-section-stack {
  display: block;
  min-width: 0;
  width: 100%;
}

.client-section-stack > .panel {
  min-width: 0;
  width: 100%;
}

.span-2 {
  grid-column: span 1;
}

.module-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.module-row {
  align-items: flex-start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px;
}

.module-row > div {
  min-width: 0;
}

.module-row div div {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin-top: 4px;
  overflow-wrap: anywhere;
}

.module-meta {
  align-items: flex-end;
  display: grid;
  gap: 6px;
  justify-items: end;
  min-width: 112px;
}

.module-meta.wide {
  align-items: end;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  max-width: 100%;
  min-width: min(100%, 360px);
}

.module-meta.wide label {
  display: grid;
  gap: 4px;
  min-width: 180px;
}

.module-meta.wide span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.readonly-meta {
  align-items: center;
}

.module-meta span:first-child {
  color: var(--muted);
  font-size: 12px;
}

.setting-list {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.setting-list .field-help,
.integration-list .field-help {
  margin: 0;
}

.setting-list label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.setting-list span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.subsection-header {
  align-items: flex-start;
  border-top: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 16px 16px 0;
}

.subsection-header h3 {
  font-size: 16px;
  margin: 0 0 4px;
}

.subsection-header p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.consent-impact-grid {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.consent-impact-grid div {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.consent-impact-grid strong {
  color: var(--ink);
  font-size: 13px;
}

.consent-impact-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.55;
}

.panel-body {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.panel-subsection {
  border-top: 1px solid var(--line);
  padding-top: 12px;
}

.panel-subsection h3 {
  font-size: 15px;
  margin: 0;
  padding: 0 16px 8px;
}

.muted-text {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  margin: 0;
}

.full-width {
  justify-content: center;
  width: 100%;
}

.form-grid,
.inline-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.form-help {
  background: #f9fbfc;
  border: 1px solid var(--line);
  border-radius: 8px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 12px;
}

.visual-flow {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-flow div {
  background: linear-gradient(180deg, #ffffff 0%, #f2faf7 100%);
  border: 1px solid #cce4df;
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 14px;
  position: relative;
}

.visual-flow span {
  align-items: center;
  background: var(--accent);
  border-radius: 999px;
  color: #ffffff;
  display: inline-flex;
  font-size: 12px;
  font-weight: 900;
  height: 24px;
  justify-content: center;
  width: 24px;
}

.visual-flow strong,
.preset-explainer strong,
.setup-map strong {
  color: var(--accent-strong);
  font-size: 14px;
  line-height: 1.4;
}

.visual-flow small,
.preset-explainer span,
.setup-map span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.setup-map {
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.setup-map div {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 12px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inline-form {
  align-items: end;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
}

.form-grid label,
.inline-form label {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.form-grid span,
.inline-form span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-grid small,
.inline-form small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

#integration-form label {
  align-content: start;
  align-self: start;
}

#integration-form {
  grid-template-areas:
    "help help"
    "ga4 mode"
    "clarity mode-note";
}

#integration-form .form-help {
  grid-area: help;
}

.integration-ga4-id {
  grid-area: ga4;
}

.integration-collection-mode {
  grid-area: mode;
}

.integration-clarity-id {
  grid-area: clarity;
}

.integration-mode-note {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  grid-area: mode-note;
  line-height: 1.55;
  margin: 0;
}

#integration-form input,
#integration-form select {
  height: 42px;
  min-height: 42px;
}

.checkbox-row {
  align-items: center;
  display: flex !important;
  gap: 8px;
  min-height: 42px;
}

.checkbox-row span {
  color: var(--ink);
  font-weight: 700;
  line-height: 1.4;
}

.event-form-actions {
  align-items: end;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-column: 1 / -1;
  grid-template-columns: minmax(0, 1fr) 220px;
  margin-top: 2px;
  padding-top: 14px;
}

.event-destinations {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  min-height: 42px;
}

.event-destinations > span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 800;
}

.event-form-actions > .button {
  min-height: 44px;
  width: 100%;
}

.preset-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.preset-explainer {
  align-items: stretch;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: 170px repeat(2, minmax(0, 1fr));
  padding: 16px;
}

.preset-explainer > div:not(.mini-screen) {
  background: #fbfcfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 12px;
}

.mini-screen {
  background: #111827;
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-height: 126px;
  padding: 14px;
}

.mini-screen-bar,
.mini-screen-row {
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  height: 9px;
}

.mini-screen-bar {
  background: #2dd4bf;
  height: 12px;
  width: 42%;
}

.mini-screen-row.strong {
  background: rgba(255, 255, 255, 0.72);
  width: 88%;
}

.mini-screen-row.short {
  width: 58%;
}

.preset-row {
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(220px, 0.8fr) minmax(0, 1.2fr);
  padding: 14px;
}

.preset-row.is-paused {
  background: #fbfcfd;
  opacity: 0.7;
}

.preset-toggle {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.preset-toggle input {
  flex: 0 0 auto;
}

.preset-toggle span {
  color: var(--ink);
  font-weight: 800;
  line-height: 1.45;
}

.preset-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.preset-meta strong {
  color: var(--accent-strong);
  font-size: 13px;
}

.preset-meta span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.dimension-chip-list {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.dimension-chip-list em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
}

.dimension-chip-list code {
  font-size: 11px;
  padding: 2px 5px;
}

.category-pill {
  background: #f1f5f9;
  border-radius: 999px;
  color: #475569;
  display: inline-flex;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.3;
  padding: 5px 8px;
  white-space: nowrap;
}

.table-help {
  border-bottom: 1px solid var(--line);
  margin: 0;
  padding: 12px 16px;
}

.integration-list {
  display: grid;
  gap: 0;
  padding: 8px 16px 16px;
}

.integration-list div {
  align-items: flex-start;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-height: 46px;
  padding: 10px 0;
}

.integration-list div:last-child {
  border-bottom: 0;
}

.integration-list span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  min-width: 0;
  overflow-wrap: anywhere;
  text-align: right;
}

table {
  border-collapse: collapse;
  min-width: 820px;
  width: 100%;
}

#ga4-setup-panel table {
  min-width: 930px;
}

#ga4-setup-panel th,
#ga4-setup-panel td {
  padding-left: 10px;
  padding-right: 10px;
}

#ga4-setup-panel td:nth-child(3) code,
#ga4-setup-panel td:nth-child(5) {
  overflow-wrap: normal;
  white-space: nowrap;
}

.panel > table,
.panel table {
  display: table;
}

.panel:has(table) {
  overflow-x: auto;
}

.cell-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
  margin-top: 5px;
  max-width: 520px;
}

.sync-summary {
  align-items: stretch;
  background: #f8fbfd;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  padding: 12px;
}

.sync-summary div {
  display: grid;
  gap: 4px;
}

.sync-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.sync-summary strong {
  color: var(--ink);
  font-size: 18px;
  line-height: 1.2;
}

.sync-summary p {
  color: var(--muted);
  font-size: 13px;
  grid-column: 1 / -1;
  line-height: 1.65;
  margin: 0;
}

.row-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  white-space: nowrap;
}

.compact-row-actions {
  margin-top: 8px;
}

.tag-snippet-inline {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  font-size: 11px;
  line-height: 1.55;
  max-width: 360px;
  overflow-wrap: anywhere;
  padding: 8px;
  white-space: normal;
}

.service-pill-list {
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-width: 320px;
}

.service-contract-control {
  align-items: stretch;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.service-contract-control > .button {
  align-self: flex-start;
}

.add-service-contract-button {
  align-self: flex-start;
  border-style: dashed;
}

.service-pill {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 800;
  line-height: 1.3;
  padding: 5px 8px;
}

.service-pill.is-active {
  background: var(--soft);
  border-color: #a9d8d0;
  color: var(--accent-strong);
}

.selected-row {
  background: #f0faf7;
}

.text-button {
  background: transparent;
  border: 0;
  color: var(--accent-strong);
  display: inline;
  font-weight: 800;
  min-height: auto;
  padding: 0;
  text-align: left;
}

.ops-details {
  background: #fbfcfd;
}

.ops-details > summary {
  cursor: pointer;
  font-weight: 800;
  padding: 16px;
}

.nested-panel {
  border-left: 0;
  border-right: 0;
  border-radius: 0;
  margin: 0;
}

.compact-list {
  gap: 8px;
}

code {
  background: var(--soft);
  border-radius: 6px;
  color: var(--accent-strong);
  font-family: "SFMono-Regular", Consolas, monospace;
  font-size: 12px;
  padding: 3px 6px;
}

th,
td {
  border-bottom: 1px solid var(--line);
  font-size: 14px;
  line-height: 1.55;
  padding: 14px 16px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .contract-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .contract-metrics > div:nth-child(2) {
    border-right: 0;
  }

  .contract-metrics > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }

  .ledger-toolbar,
  .contract-form-grid {
    grid-template-columns: 1fr;
  }

  .contract-dialog-meta {
    align-items: flex-start;
    flex-direction: column;
  }

  .client-console {
    display: block;
  }

  .client-console .sidebar {
    height: auto;
    position: static;
  }

  .client-console .brand.stacked {
    padding: 18px;
  }

  .client-console .side-nav {
    display: grid;
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0 14px 14px;
  }

  .client-console .sidebar-site-context {
    margin: 0 16px 14px;
  }

  .client-console .side-nav button {
    justify-content: center;
    min-width: 0;
    padding: 0 10px;
    width: 100%;
  }

  .client-console .sidebar-account {
    align-items: center;
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    padding: 12px 14px;
  }

  .client-console .sidebar-account-summary {
    flex: 1 1 220px;
    padding: 0 8px;
  }

  .client-console .sidebar-utility {
    flex: 0 0 auto;
    width: auto;
  }

  .topbar,
  .workspace-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
    height: auto;
    padding: 18px;
  }

  .hero,
  .split,
  .grid,
  .metrics,
  .guide-steps,
  .analysis-grid,
  .visual-flow,
  .setup-map,
  .preset-explainer,
  .console-grid,
  .form-grid,
  .inline-form,
  .app-shell {
    grid-template-columns: 1fr;
  }

  .hero,
  .section,
  .workspace,
  .footer {
    padding: 32px 18px;
  }

  h1 {
    font-size: 44px;
  }

  .panel-header,
  .workspace-header {
    align-items: stretch;
  }

  .panel-header {
    flex-direction: column;
  }

  .subsection-header {
    display: grid;
  }

  .consent-impact-grid {
    grid-template-columns: 1fr;
  }

  .status {
    max-width: 100%;
    text-align: left;
  }

  .header-actions {
    justify-content: flex-start;
    min-width: 0;
    width: 100%;
  }

  .header-context {
    align-items: stretch;
    flex: 0 0 auto;
    flex-direction: column;
    min-width: 0;
    width: 100%;
  }

  .site-context-control {
    flex: 0 0 auto;
    width: 100%;
  }

  .module-row {
    grid-template-columns: 1fr;
  }

  .tag-install-body,
  .event-form-actions,
  .preset-row {
    grid-template-columns: 1fr;
  }

  .module-meta,
  .module-meta.wide {
    justify-content: flex-start;
    justify-items: start;
    min-width: 0;
  }

  .integration-list div {
    display: grid;
  }

  .integration-list span {
    text-align: left;
  }

  #integration-form {
    grid-template-areas:
      "help"
      "ga4"
      "mode"
      "mode-note"
      "clarity";
  }
}

/* 受信トレイ: 処理済みセクションの区切り行 */
#service-request-table .section-divider td {
  background: rgba(120, 135, 165, 0.12);
  padding-top: 14px;
  border-top: 2px solid rgba(120, 135, 165, 0.35);
}
