:root {
  color-scheme: light;
  --ink: #050607;
  --text: #161b22;
  --muted: #566273;
  --faint: #7a8697;
  --line: #ccd6e3;
  --soft-line: #e5eaf1;
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-muted: #f7f9fb;
  --green: #14784f;
  --green-bg: #e7f4ef;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.preview-renderer {
  min-height: 100vh;
  padding: 14px;
  display: grid;
}

.renderer-object {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.renderer-head,
.renderer-contract {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.renderer-head {
  min-height: 76px;
  padding: 14px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.renderer-head span,
.access-hero span,
.access-heading span,
.access-box > span,
.access-box label span,
.renderer-contract span,
.contract-copy span,
.contract-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.renderer-head h1 {
  margin: 3px 0;
  font-size: 22px;
  line-height: 1.08;
}

.renderer-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.renderer-status {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.state-chip {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid #91bdb0;
  border-radius: 999px;
  color: var(--green);
  background: var(--green-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.state-chip__dot {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: currentColor;
}

.state-chip__label {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
}

.render-canvas {
  min-height: 560px;
  background: var(--surface-muted);
}

.access-preview {
  min-height: 560px;
  display: grid;
  grid-template-columns: minmax(320px, 1.08fr) minmax(390px, 0.92fr);
}

.access-hero {
  padding: clamp(28px, 6vw, 70px);
  color: #ffffff;
  background: #050607;
  display: grid;
  align-content: center;
  gap: 18px;
}

.access-hero span {
  color: #94e4c7;
}

.access-hero h2 {
  margin: 0;
  font-size: clamp(48px, 6vw, 78px);
  line-height: 0.98;
}

.access-hero p {
  margin: 0;
  color: #d9e0e8;
}

.access-card {
  width: min(430px, calc(100% - 36px));
  margin: auto;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 20px 54px rgba(21, 31, 43, 0.10);
  display: grid;
  gap: 16px;
}

.access-tools {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.access-tools button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 11px;
  color: var(--muted);
  background: var(--surface-muted);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 850;
}

.access-tools strong {
  color: var(--text);
}

.access-heading {
  display: grid;
  gap: 8px;
}

.access-heading h2,
.contract-copy h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.08;
}

.access-heading p,
.access-box p,
.access-message,
.contract-copy p,
.contract-grid dd {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.access-box {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  display: grid;
  gap: 11px;
}

.access-box label {
  display: grid;
  gap: 6px;
}

.access-box input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  color: var(--text);
  background: var(--surface);
}

.verification-slot {
  min-height: 42px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  background: var(--surface);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 850;
}

.access-box button {
  min-height: 44px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-weight: 900;
}

.access-message {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-muted);
  display: flex;
  align-items: center;
}

.contract-canvas {
  min-height: 560px;
  padding: clamp(24px, 5vw, 54px);
  display: grid;
  align-content: center;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 24px;
}

.contract-mark {
  width: 88px;
  height: 88px;
  border: 1px solid var(--ink);
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  display: grid;
  place-items: center;
  font-size: 32px;
  font-weight: 950;
}

.contract-copy {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 10px;
}

.contract-grid {
  grid-column: 1 / -1;
  margin: 8px 0 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.contract-grid div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: var(--surface);
  display: grid;
  align-content: start;
  gap: 6px;
}

.contract-grid dd {
  word-break: break-word;
}

.renderer-contract {
  min-height: 64px;
  border-top: 1px solid var(--line);
  border-bottom: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.renderer-contract div {
  min-width: 0;
  padding: 12px 14px;
  display: grid;
  gap: 4px;
}

.renderer-contract div + div {
  border-left: 1px solid var(--line);
}

.renderer-contract strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

@media (max-width: 760px) {
  .preview-renderer {
    padding: 8px;
  }

  .renderer-head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .access-preview {
    grid-template-columns: 1fr;
  }

  .access-hero {
    min-height: 220px;
  }

  .access-card {
    width: min(430px, calc(100% - 22px));
    margin: 14px auto;
  }

  .contract-canvas {
    grid-template-columns: 1fr;
    min-height: 500px;
  }

  .contract-grid,
  .renderer-contract {
    grid-template-columns: 1fr;
  }

  .renderer-contract div + div {
    border-top: 1px solid var(--line);
    border-left: 0;
  }
}
