:root {
  color-scheme: light;
  --ink: #17212b;
  --muted: #5d6b77;
  --line: #cdd7e0;
  --page: #f3f6f7;
  --panel: #ffffff;
  --panel-soft: #eef6f3;
  --blue: #1f63b5;
  --green: #0f7a5a;
  --amber: #9a6700;
  --red: #b42318;
  --violet: #6d28d9;
  --shadow: 0 1px 2px rgba(21, 31, 41, 0.08);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.community-card h3 { margin: 0.45rem 0; }
.metric-line { margin-top: 1rem; }
.button-link {
  align-items: center;
  background: var(--green);
  border-radius: 0.6rem;
  color: #07120e;
  display: inline-flex;
  font-weight: 750;
  min-height: 44px;
  padding: 0 1rem;
  text-decoration: none;
}
.button-link:focus-visible, .nav-link:focus-visible, button:focus-visible, input:focus-visible {
  outline: 3px solid #f6c453;
  outline-offset: 3px;
}
.confirmation { align-items: center; display: flex; gap: 0.65rem; min-height: 44px; }
.confirmation input { height: 1.25rem; width: 1.25rem; }

@media (max-width: 760px) {
  .community-grid { grid-template-columns: 1fr; }
  .header-actions { align-items: stretch; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .nav-link { min-height: 44px; text-align: center; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--page);
}

header {
  background: #162029;
  color: white;
  border-bottom: 4px solid var(--green);
}

.header-inner,
main {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 22px 0;
}

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

h1 {
  margin-bottom: 6px;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: 0;
}

header p {
  margin-bottom: 0;
  color: #d9e2e9;
  line-height: 1.45;
}

main {
  padding: 20px 0 48px;
  min-width: 0;
  overflow-x: clip;
}

.status-strip,
.workspace,
.metric-grid,
.creator-form,
.form-grid,
.action-row,
.receipt-row,
.authority-grid,
.lock-grid,
.role-grid {
  display: grid;
  gap: 12px;
}

.status-strip {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 16px;
}

.workspace {
  grid-template-columns: 336px minmax(0, 1fr);
  align-items: start;
  margin-top: 16px;
}

.main-stack > * + *,
.side-stack > * + *,
section + section {
  margin-top: 12px;
}

.panel,
section {
  min-width: 0;
  max-width: 100%;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.panel {
  min-width: 0;
  padding: 14px;
}

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

.panel.warn {
  border-left: 4px solid var(--amber);
}

.panel.danger {
  border-left: 4px solid var(--red);
}

.panel.good {
  border-left: 4px solid var(--green);
}

.label,
.panel strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0;
  color: var(--muted);
}

.value {
  min-width: 0;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.small,
.muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--line);
}

section h2 {
  margin-bottom: 6px;
  font-size: 19px;
  line-height: 1.2;
  letter-spacing: 0;
}

section h3 {
  margin-bottom: 0;
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0;
}

.section-body {
  padding: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 5px 9px;
  border: 1px solid currentColor;
  border-radius: 999px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 700;
}

.badge.mock {
  color: var(--violet);
  background: #f4efff;
}

.badge.blocked {
  color: var(--red);
  background: #fff1f0;
}

.trust-dashboard {
  overflow: hidden;
}

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

.lock {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  min-height: 86px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.lock strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.lock span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.lock code {
  color: var(--green);
  font-weight: 700;
}

.lock.blocked code {
  color: var(--red);
}

.authority-grid {
  grid-template-columns: 1.4fr 2fr 1fr 1.2fr;
  padding: 0 16px 16px;
}

.metric-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.creator-form {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.form-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.creator-form label,
.form-grid label {
  min-width: 0;
}

.confirmation-copy {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 42px;
}

.confirmation-copy input[type="checkbox"] {
  width: 20px;
  min-height: 20px;
  padding: 0;
}

input,
select,
textarea {
  width: 100%;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--ink);
  font: inherit;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  outline: 2px solid rgba(31, 99, 181, 0.18);
  outline-offset: 1px;
}

.composer-dashboard {
  overflow: hidden;
  border-color: #9bcdbc;
  background: linear-gradient(135deg, #ffffff 0%, #f1fbf7 100%);
}

.composer-layout {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 18px;
  align-items: stretch;
}

.composer-controls {
  display: grid;
  gap: 12px;
  align-content: start;
}

.composer-preview {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 7px;
  min-width: 0;
}

.composer-preview textarea {
  min-height: 214px;
  resize: none;
  border-color: #8ebfad;
  background: #11241f;
  color: #dffcf2;
  font-family: Consolas, "Courier New", monospace;
  font-size: 14px;
  line-height: 1.55;
}

.composer-standing {
  margin: 0;
}

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

.locked-actions {
  padding-top: 0;
}

button {
  min-height: 42px;
  border: 1px solid #174f91;
  border-radius: 6px;
  background: var(--blue);
  color: white;
  font-weight: 700;
  cursor: pointer;
}

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

button.good {
  border-color: #0b684c;
  background: var(--green);
}

button[disabled] {
  cursor: not-allowed;
  border-color: var(--line);
  background: #e7ebef;
  color: #71808f;
}

code {
  font-family: Consolas, "Courier New", monospace;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.table-wrap {
  min-width: 0;
  max-width: 100%;
  overflow-x: auto;
}

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

th,
td {
  padding: 10px 8px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

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

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

.role {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

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

.role-head span {
  color: var(--green);
  font-weight: 700;
}

.role p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.role ol {
  display: grid;
  gap: 8px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.role li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px;
  border-radius: 6px;
  background: #eef2f5;
  color: var(--muted);
}

.role li.done {
  background: #eaf7f1;
  color: var(--ink);
}

.receipt-row {
  grid-template-columns: 170px minmax(0, 1fr) 180px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.receipt-row:last-child {
  border-bottom: 0;
}

.timeline,
.log-list {
  display: grid;
  gap: 8px;
}

.step {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}

.step-dot {
  width: 20px;
  height: 20px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: white;
}

.step.done .step-dot {
  border-color: var(--green);
  background: var(--green);
}

.log-row {
  display: grid;
  gap: 3px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fbfcfd;
}

.log-row strong {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
}

.log-row span {
  font-size: 13px;
  line-height: 1.35;
}

.reconciliation-panel {
  margin: 0 16px 16px;
}

@media (max-width: 1040px) {
  .check-grid,
  .receipt-grid,
  .workspace,
  .status-strip,
  .lock-grid,
  .authority-grid,
  .metric-grid,
  .role-grid,
  .receipt-row {
    grid-template-columns: 1fr 1fr;
  }

  .workspace {
    grid-template-columns: 1fr;
  }

  .composer-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .header-actions,
  .badge-row,
  .check-grid,
  .receipt-grid,
  .header-inner,
  .status-strip,
  .lock-grid,
  .authority-grid,
  .metric-grid,
  .role-grid,
  .action-row,
  .receipt-row {
    grid-template-columns: 1fr;
  }

  .section-head {
    display: block;
  }

  .section-head .badge {
    margin-top: 10px;
  }

  .badge {
    max-width: 100%;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: center;
  }
}

.header-actions,
.badge-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  border: 1px solid #d9e2e9;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
}

.badge.disclosed {
  color: var(--amber);
  background: #fff8e6;
}

.badge.pass {
  color: var(--green);
  background: #eaf7f1;
}

.panel.disclosed {
  border-left: 4px solid var(--amber);
}

.lock.disclosed code,
.check-card.disclosed code {
  color: var(--amber);
}

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

.check-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
}

.check-card.locked {
  border-left: 4px solid var(--green);
}

.check-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
  margin-bottom: 8px;
}

.check-card p,
.check-card li {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.check-card ul {
  display: grid;
  gap: 6px;
  margin: 10px 0 0;
  padding-left: 18px;
}

.mini-pill {
  display: inline-flex;
  max-width: 100%;
  margin: 2px 4px 2px 0;
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f7f9fa;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.disclosure-panel {
  margin: 0 16px 16px;
}

.trust-page section + section {
  margin-top: 12px;
}

.nav-link.active {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.72);
}

.mobile-bottom-nav {
  display: none;
}

.product-empty-state {
  display: grid;
  gap: 16px;
  max-width: 760px;
  margin: 40px auto;
}

.product-empty-state .primary-action {
  justify-self: start;
}
@media (max-width: 1040px) {
  .check-grid,
  .receipt-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .check-grid,
  .receipt-grid {
    grid-template-columns: 1fr;
  }

  .header-actions,
  .badge-row {
    justify-content: flex-start;
  }

  body {
    padding-bottom: 76px;
  }

  .header-actions .nav-link {
    display: none;
  }

  .mobile-bottom-nav {
    position: fixed;
    z-index: 100;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    min-height: 64px;
    padding: 6px max(6px, env(safe-area-inset-right)) max(6px, env(safe-area-inset-bottom)) max(6px, env(safe-area-inset-left));
    border-top: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 -8px 24px rgba(16, 25, 34, 0.12);
  }

  .mobile-bottom-nav a {
    display: grid;
    place-items: center;
    padding: 6px 3px;
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    text-align: center;
    text-decoration: none;
  }

  .mobile-bottom-nav a.active {
    color: var(--green);
    background: #eaf7f1;
    border-radius: 8px;
  }
}
