:root {
  --ink: #10212d;
  --ink-soft: #435461;
  --navy: #091823;
  --navy-2: #102938;
  --paper: #f5f6f1;
  --surface: #ffffff;
  --line: #d9dedb;
  --line-dark: #30434f;
  --teal: #147765;
  --teal-dark: #0a5b4d;
  --teal-pale: #dff1eb;
  --amber: #b66b1c;
  --amber-pale: #fff0d9;
  --red: #a93c36;
  --red-pale: #fbe8e6;
  --blue: #315f80;
  --shadow: 0 18px 55px rgba(14, 34, 46, 0.1);
  --radius: 18px;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html { color-scheme: light; scroll-behavior: smooth; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background:
    radial-gradient(circle at 9% 12%, rgba(20, 119, 101, 0.09), transparent 28rem),
    radial-gradient(circle at 94% 18%, rgba(182, 107, 28, 0.07), transparent 25rem),
    linear-gradient(rgba(16, 33, 45, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 33, 45, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 36px 36px, 36px 36px;
}

button, input, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { color: inherit; }
h1, h2, h3, p, dl, dd { margin-top: 0; }
code, .mono { font-family: var(--mono); }
.hidden { display: none !important; }
.wrap { width: min(1180px, calc(100% - 48px)); margin-inline: auto; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.site-header {
  position: relative;
  z-index: 20;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 14px 34px;
  border-bottom: 1px solid rgba(48, 67, 79, 0.16);
  background: rgba(245, 246, 241, 0.88);
  backdrop-filter: blur(18px);
}

.workspace-header { position: sticky; top: 0; }

.brand { display: inline-flex; align-items: center; gap: 12px; letter-spacing: 0.09em; }
.brand > span:last-child { display: grid; }
.brand strong { font-size: 0.84rem; line-height: 1.25; }
.brand small { color: var(--ink-soft); font-family: var(--mono); font-size: 0.64rem; letter-spacing: 0.14em; }

.brand-mark {
  position: relative;
  display: block;
  width: 34px;
  height: 34px;
  border: 1px solid var(--teal);
  border-radius: 50%;
}
.brand-mark::after, .brand-mark::before, .brand-mark i {
  position: absolute;
  content: "";
  border: 1px solid var(--teal);
  border-radius: 50%;
}
.brand-mark::before { inset: 6px; }
.brand-mark::after { inset: 12px; background: var(--teal); }
.brand-mark i:first-child { inset: -4px 14px; border-width: 0 1px; border-radius: 0; transform: rotate(45deg); }
.brand-mark i:last-child { inset: -4px 14px; border-width: 0 1px; border-radius: 0; transform: rotate(-45deg); }

.header-actions { display: flex; align-items: center; justify-content: flex-end; gap: 12px; }
.trust-pill, .role-badge, .environment-badge, .stage-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  font-size: 0.74rem;
  font-weight: 750;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #87949b; box-shadow: 0 0 0 4px rgba(135, 148, 155, 0.14); }
.trust-pill.verified { border-color: rgba(20, 119, 101, 0.4); color: var(--teal-dark); }
.trust-pill.verified .status-dot { background: var(--teal); box-shadow: 0 0 0 4px rgba(20, 119, 101, 0.13); }
.trust-pill.warning { border-color: rgba(182, 107, 28, 0.4); color: #8b4d10; background: var(--amber-pale); }
.trust-pill.warning .status-dot { background: var(--amber); box-shadow: 0 0 0 4px rgba(182, 107, 28, 0.14); }
.trust-pill.error { border-color: rgba(169, 60, 54, 0.35); color: var(--red); background: var(--red-pale); }
.trust-pill.error .status-dot { background: var(--red); }
.role-badge { text-transform: uppercase; letter-spacing: 0.1em; }
.role-badge.buyer { border-color: rgba(49, 95, 128, 0.35); color: #274e69; background: #e6f0f6; }
.role-badge.seller { border-color: rgba(20, 119, 101, 0.36); color: var(--teal-dark); background: var(--teal-pale); }

.text-button, .copy-inline {
  padding: 3px;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.76rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 4px;
}
.text-button:hover, .copy-inline:hover { color: var(--teal-dark); text-decoration-color: currentColor; }

.button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 17px;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 760;
  transition: transform 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.button:not(:disabled):hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(9, 24, 35, 0.12); }
.button.primary { border-color: var(--teal); background: var(--teal); color: white; }
.button.primary:not(:disabled):hover { background: var(--teal-dark); }
.button.secondary { border-color: var(--line-dark); background: transparent; color: var(--ink); }
.button.quiet { min-height: 36px; padding: 6px 11px; border-color: var(--line); background: var(--surface); font-size: 0.78rem; }
.button.danger { border-color: var(--red); background: var(--red); color: white; }
.button.full { width: 100%; }
.button:disabled { opacity: 0.43; cursor: not-allowed; filter: grayscale(0.2); }

.hero {
  display: grid;
  min-height: 660px;
  grid-template-columns: minmax(0, 1.12fr) minmax(370px, 0.72fr);
  align-items: center;
  gap: clamp(52px, 8vw, 110px);
  padding-block: 80px 86px;
}
.eyebrow, .kicker, .micro-label {
  color: var(--teal-dark);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.eyebrow { display: flex; align-items: center; gap: 9px; margin-bottom: 22px; }
.eyebrow > span { width: 27px; height: 1px; background: var(--teal); }
.hero h1 { margin-bottom: 27px; font-size: clamp(3rem, 6vw, 5.4rem); font-weight: 650; letter-spacing: -0.06em; line-height: 0.98; }
.hero h1 em { color: var(--teal); font-family: Georgia, "Songti SC", serif; font-weight: 500; }
.hero-lede { max-width: 680px; color: var(--ink-soft); font-size: 1.08rem; }
.hero-assurances { display: flex; flex-wrap: wrap; gap: 9px; margin: 28px 0; }
.hero-assurances span { padding: 7px 10px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255, 255, 255, 0.6); color: var(--ink-soft); font-size: 0.75rem; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.status-console {
  position: relative;
  min-height: 470px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid #28414f;
  border-radius: 24px;
  background: var(--navy);
  box-shadow: 0 30px 80px rgba(9, 24, 35, 0.27);
  color: #dfece8;
}
.status-console::after { position: absolute; inset: 0; pointer-events: none; content: ""; background: linear-gradient(115deg, rgba(255,255,255,0.07), transparent 22%, transparent 75%, rgba(20,119,101,0.1)); }
.console-head, .console-foot { position: relative; z-index: 2; display: flex; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 0.65rem; letter-spacing: 0.1em; }
.live-label { color: #7dd9c5; }
.live-label i { display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: #52caae; box-shadow: 0 0 10px #52caae; }
.security-orbit { position: relative; height: 245px; }
.orbit, .vault-core { position: absolute; top: 50%; left: 50%; border-radius: 50%; transform: translate(-50%, -50%); }
.orbit { border: 1px solid rgba(89, 200, 176, 0.23); }
.orbit-one { width: 180px; height: 180px; }
.orbit-two { width: 125px; height: 125px; border-style: dashed; animation: spin 24s linear infinite; }
.vault-core { display: grid; width: 58px; height: 58px; place-items: center; border: 1px solid #57c4ab; background: rgba(20, 119, 101, 0.16); box-shadow: 0 0 40px rgba(61, 190, 160, 0.2); }
.vault-core span { width: 16px; height: 16px; border: 2px solid #79d7c2; border-radius: 3px; transform: rotate(45deg); }
@keyframes spin { to { transform: translate(-50%, -50%) rotate(360deg); } }
.console-grid { position: relative; z-index: 2; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 0; }
.console-grid > div { min-width: 0; padding: 10px; border: 1px solid rgba(202, 227, 219, 0.12); border-radius: 8px; background: rgba(255, 255, 255, 0.035); }
.console-grid .wide { grid-column: 1 / -1; }
.console-grid dt { color: #839b9a; font-size: 0.65rem; }
.console-grid dd { margin: 3px 0 0; font-size: 0.77rem; }
.console-foot { margin-top: 18px; color: #728989; }

.portal-section { padding-block: 78px 104px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 40px; margin-bottom: 34px; }
.section-heading h2 { margin-bottom: 0; font-size: clamp(1.8rem, 3.4vw, 2.65rem); letter-spacing: -0.035em; }
.section-heading > p { max-width: 430px; margin-bottom: 3px; color: var(--ink-soft); font-size: 0.9rem; }
.kicker { margin-bottom: 7px; }
.portal-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px; }
.portal-card { display: flex; min-height: 430px; flex-direction: column; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.75); transition: border 180ms ease, transform 180ms ease, box-shadow 180ms ease; }
.portal-card:hover { transform: translateY(-4px); border-color: var(--teal); box-shadow: var(--shadow); }
.portal-top { display: flex; justify-content: space-between; align-items: start; }
.portal-icon { display: grid; width: 56px; height: 56px; place-items: center; border-radius: 14px; background: var(--navy); color: white; font-family: var(--mono); font-size: 1.15rem; }
.buyer-card .portal-icon { background: var(--blue); }
.seller-card .portal-icon { background: var(--teal); }
.arrow-link { color: var(--ink-soft); font-size: 1.35rem; }
.portal-number { margin: 34px 0 6px; color: var(--ink-soft); font-family: var(--mono); font-size: 0.67rem; letter-spacing: 0.1em; }
.portal-card h3 { margin-bottom: 12px; font-size: 2rem; }
.portal-card > p:not(.portal-number) { color: var(--ink-soft); }
.permission-list { display: grid; gap: 9px; margin: 12px 0 28px; padding: 0; list-style: none; font-size: 0.82rem; }
.permission-list li { display: flex; gap: 9px; }
.permission-list span { flex: 0 0 auto; color: var(--teal-dark); font-weight: 760; }
.enter-label { display: flex; justify-content: space-between; margin-top: auto; padding-top: 19px; border-top: 1px solid var(--line); font-weight: 750; }

.process-section { padding: 90px 0 104px; background: var(--navy); color: #edf5f2; }
.process-section .section-heading > p { color: #98aaa9; }
.process-flow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; padding: 0; list-style: none; counter-reset: process; }
.process-flow.six-step { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.process-flow li { position: relative; min-height: 220px; padding: 18px 15px; border: 1px solid rgba(202, 227, 219, 0.13); border-radius: 12px; background: rgba(255, 255, 255, 0.03); }
.process-flow li:not(:last-child)::after { position: absolute; top: 31px; right: -8px; z-index: 2; content: "→"; color: #52bba2; }
.process-flow b { color: #61c5ac; font-family: var(--mono); font-size: 0.68rem; }
.process-flow h3 { margin: 50px 0 9px; font-size: 0.98rem; }
.process-flow p { margin-bottom: 0; color: #9eb0af; font-size: 0.76rem; }
.site-footer { display: flex; min-height: 96px; align-items: center; justify-content: space-between; gap: 24px; color: var(--ink-soft); font-family: var(--mono); font-size: 0.68rem; }

.workspace-shell { display: grid; min-height: calc(100vh - 82px); grid-template-columns: 290px minmax(0, 1fr); }
.matter-sidebar { position: sticky; top: 82px; height: calc(100vh - 82px); overflow: auto; padding: 27px 20px; border-right: 1px solid var(--line); background: rgba(255, 255, 255, 0.64); }
.sidebar-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; margin-bottom: 19px; }
.sidebar-head h1 { margin: 0; font-size: 1.32rem; }
.icon-button { display: grid; width: 34px; height: 34px; place-items: center; border: 1px solid var(--line); border-radius: 9px; background: var(--surface); cursor: pointer; font-size: 1.2rem; }
.matter-list { display: grid; gap: 8px; margin-top: 17px; }
.matter-list-item { display: grid; width: 100%; gap: 3px; padding: 13px; border: 1px solid transparent; border-radius: 11px; background: transparent; text-align: left; cursor: pointer; }
.matter-list-item:hover { background: rgba(255, 255, 255, 0.8); }
.matter-list-item.active { border-color: rgba(20, 119, 101, 0.35); background: var(--teal-pale); }
.matter-list-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.84rem; }
.matter-list-item span { color: var(--ink-soft); font-size: 0.71rem; }
.matter-list-item code { color: #718089; font-size: 0.62rem; }
.empty-copy { color: var(--ink-soft); font-size: 0.82rem; }
.identity-mini-card { display: grid; gap: 6px; margin-top: 26px; padding: 14px; border: 1px solid rgba(182, 107, 28, 0.28); border-radius: 11px; background: var(--amber-pale); }
.identity-mini-card strong { color: #8b4d10; font-family: var(--mono); font-size: 0.72rem; }
.identity-mini-card code { overflow-wrap: anywhere; color: #5d3a18; font-size: 0.62rem; }
.identity-mini-card .text-button { justify-self: start; color: #7c4816; }
.identity-mini-card p { margin: 3px 0 0; color: #755231; font-size: 0.67rem; }

.workspace-main { min-width: 0; padding: clamp(26px, 4vw, 55px); }
.welcome-panel { display: grid; min-height: calc(100vh - 190px); place-content: center; text-align: center; }
.welcome-panel .eyebrow { justify-content: center; }
.welcome-panel h2 { max-width: 680px; margin-bottom: 16px; font-size: clamp(2rem, 4vw, 3.5rem); letter-spacing: -0.045em; }
.welcome-panel > p:last-child { max-width: 640px; color: var(--ink-soft); }
.builder-panel, .content-card { max-width: 1040px; margin: 0 auto 22px; padding: 25px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(255, 255, 255, 0.84); box-shadow: 0 8px 26px rgba(14, 34, 46, 0.04); }
.builder-panel { max-width: 920px; }
.panel-heading { display: flex; align-items: start; justify-content: space-between; gap: 20px; margin-bottom: 20px; }
.panel-heading h2 { margin: 0; font-size: 1.35rem; }
.local-test-pack-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(190px, 0.36fr);
  align-items: center;
  gap: 18px;
  margin: 0 0 20px;
  padding: 14px;
  border: 1px solid rgba(49, 95, 128, 0.27);
  border-radius: 11px;
  background: #edf4f7;
}
.local-test-pack-control h3 { margin: 5px 0 3px; font-size: 0.86rem; }
.local-test-pack-control p { margin: 0; color: var(--ink-soft); font-size: 0.69rem; }
.local-only-badge { color: var(--blue); font-family: var(--mono); font-size: 0.58rem; font-weight: 850; letter-spacing: 0.1em; }
.local-test-pack-action { display: grid; justify-items: stretch; gap: 5px; }
.local-test-pack-action .button { min-height: 36px; text-align: center; }
.local-test-pack-action small { color: var(--ink-soft); font-size: 0.6rem; text-align: center; overflow-wrap: anywhere; }
.field { display: grid; gap: 7px; margin-bottom: 17px; }
.field > span, .field-label { color: var(--ink); font-size: 0.78rem; font-weight: 760; }
.field small { margin-top: -2px; color: var(--ink-soft); font-size: 0.68rem; }
.field input, .field textarea { width: 100%; border: 1px solid #cbd2cf; border-radius: 9px; outline: 0; background: var(--surface); color: var(--ink); }
.field input { min-height: 43px; padding: 9px 11px; }
.field textarea { min-height: 104px; padding: 10px 11px; resize: vertical; }
.field input::placeholder, .field textarea::placeholder { color: #6f7d85; opacity: 1; }
.field input:focus, .field textarea:focus { border-color: var(--teal); box-shadow: 0 0 0 3px rgba(20, 119, 101, 0.11); }
.clauses-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin: 25px 0 12px; }
.clauses-head p { margin: 2px 0 0; color: var(--ink-soft); font-size: 0.72rem; }
.clause-editor-list { display: grid; gap: 12px; }
.clause-editor { padding: 16px; border: 1px solid var(--line); border-radius: 12px; background: #fafbf8; }
.clause-editor-head { display: flex; justify-content: space-between; margin-bottom: 12px; }
.clause-order { color: var(--teal-dark); font-family: var(--mono); font-size: 0.68rem; font-weight: 800; }
.remove-clause { border: 0; background: none; color: var(--red); cursor: pointer; font-size: 0.7rem; }
.clause-field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 13px; }
.clause-field-grid .field { margin-bottom: 0; }
.form-actions, .card-actions, .trust-actions, .inline-actions, .title-actions { display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.form-actions { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }

.matter-workspace { max-width: 1120px; margin: 0 auto; }
.matter-titlebar { display: flex; align-items: start; justify-content: space-between; gap: 22px; margin-bottom: 25px; }
.matter-titlebar h1 { margin-bottom: 2px; font-size: clamp(1.8rem, 3vw, 2.65rem); letter-spacing: -0.04em; }
.matter-id { margin: 0; color: var(--ink-soft); font-size: 0.68rem; }
.stage-chip { border-color: rgba(20, 119, 101, 0.33); background: var(--teal-pale); color: var(--teal-dark); }

.trust-card { margin-bottom: 22px; overflow: hidden; padding: 25px; border: 1px solid #29414e; border-radius: var(--radius); background: var(--navy); box-shadow: 0 22px 50px rgba(9, 24, 35, 0.14); color: #e7f1ee; }
.trust-card-head { display: flex; align-items: start; justify-content: space-between; gap: 20px; }
.trust-card h2 { margin: 0; font-size: 1.45rem; }
.environment-badge { border-color: rgba(230, 239, 235, 0.2); background: rgba(255, 255, 255, 0.05); color: #cddbd7; font-family: var(--mono); }
.environment-badge.warning { border-color: rgba(230, 163, 81, 0.44); background: rgba(182, 107, 28, 0.14); color: #f0bf80; }
.environment-badge.verified { border-color: rgba(82, 202, 174, 0.44); background: rgba(20, 119, 101, 0.18); color: #7dd9c5; }
.trust-overview { display: grid; grid-template-columns: 0.55fr 1.45fr; gap: 10px; margin: 22px 0; }
.trust-overview > div { min-width: 0; padding: 12px; border: 1px solid rgba(202, 227, 219, 0.12); border-radius: 9px; background: rgba(255, 255, 255, 0.035); }
.trust-overview span { display: block; margin-bottom: 3px; color: #829897; font-size: 0.66rem; }
.trust-overview strong { font-size: 0.8rem; }
.trust-overview code { color: #cce4dd; font-size: 0.68rem; overflow-wrap: anywhere; }
.copy-inline { margin-left: 8px; color: #76baa9; }
.attestation-proof-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin: -10px 0 10px; }
.attestation-proof-grid > div { min-width: 0; padding: 10px; border: 1px solid rgba(110, 159, 193, 0.25); border-radius: 9px; background: rgba(110, 159, 193, 0.07); }
.attestation-proof-grid > .wide { grid-column: span 4; }
.attestation-proof-grid span { display: block; margin-bottom: 3px; color: #829897; font-size: 0.6rem; }
.attestation-proof-grid strong, .attestation-proof-grid code { color: #cce4dd; font-size: 0.66rem; overflow-wrap: anywhere; }
.attestation-proof-note { margin: 0 0 12px; color: #91aaa8; font-size: 0.62rem; }
.trust-layer-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.trust-layer { display: grid; min-width: 0; grid-template-columns: auto 1fr; gap: 2px 8px; padding: 12px 10px; border: 1px solid rgba(202, 227, 219, 0.12); border-radius: 9px; background: rgba(255, 255, 255, 0.025); }
.trust-layer i { grid-row: 1 / span 2; width: 7px; height: 7px; align-self: center; border-radius: 50%; background: #778d8d; }
.trust-layer span { color: #d9e5e1; font-size: 0.72rem; font-weight: 700; }
.trust-layer strong { overflow: hidden; color: #829897; font-size: 0.59rem; text-overflow: ellipsis; white-space: nowrap; }
.trust-layer.verified { border-color: rgba(82, 202, 174, 0.31); background: rgba(20, 119, 101, 0.11); }
.trust-layer.verified i { background: #52caae; box-shadow: 0 0 8px rgba(82, 202, 174, 0.55); }
.trust-layer.verified strong { color: #78d6c0; }
.trust-layer.bound i { background: #6e9fc1; }
.trust-layer.bound strong { color: #91b9d3; }
.trust-layer.failed { border-color: rgba(220, 93, 84, 0.4); background: rgba(169, 60, 54, 0.12); }
.trust-layer.failed i { background: #dc5d54; }
.trust-layer.failed strong { color: #f09b96; }
.party-verification-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-top: 12px; }
.party-verification-grid article { padding: 12px; border: 1px solid rgba(202, 227, 219, 0.12); border-radius: 9px; }
.party-verification-grid header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 9px; }
.party-verification-grid header span { font-weight: 760; }
.party-verification-grid header b { padding: 2px 7px; border-radius: 20px; background: rgba(82, 202, 174, 0.16); color: #7dd9c5; font-size: 0.58rem; }
.party-verification-grid dl { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 0; }
.party-verification-grid dl > div { padding: 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.035); }
.party-verification-grid dt { color: #829897; font-size: 0.59rem; }
.party-verification-grid dd { margin: 1px 0 0; font-size: 0.68rem; }
.trust-actions { margin-top: 16px; }
.trust-card .button.quiet { border-color: rgba(217, 222, 219, 0.24); background: rgba(255, 255, 255, 0.04); color: #edf5f2; }
.gate-note { margin: 10px 0 0; color: #809594; font-size: 0.65rem; text-align: right; }

.workflow-strip { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 5px; margin-bottom: 22px; }
.workflow-step { position: relative; display: grid; justify-items: center; gap: 5px; padding: 9px 4px; color: #8a989e; text-align: center; }
.workflow-step:not(:last-child)::after { position: absolute; top: 18px; left: 60%; width: 80%; height: 1px; content: ""; background: var(--line); }
.workflow-number { position: relative; z-index: 1; display: grid; width: 20px; height: 20px; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); font-family: var(--mono); font-size: 0.56rem; }
.workflow-step strong { font-size: 0.61rem; }
.workflow-step.complete { color: var(--teal); }
.workflow-step.complete .workflow-number { border-color: var(--teal); background: var(--teal); color: white; }
.workflow-step.complete::after { background: var(--teal); }
.workflow-step.current { color: var(--ink); }
.workflow-step.current .workflow-number { border-color: var(--amber); box-shadow: 0 0 0 4px var(--amber-pale); color: var(--amber); }

.content-card.restricted-card { border-color: rgba(182, 107, 28, 0.31); }
.content-card.report-card { border-color: rgba(20, 119, 101, 0.3); }
.content-card.release-card { background: #f8faf7; }
.credential-card { border-color: rgba(20, 119, 101, 0.35); background: linear-gradient(145deg, rgba(255,255,255,0.96), rgba(231,245,240,0.72)); }
.single-agent-badge { padding: 6px 9px; border: 1px solid rgba(20,119,101,0.28); border-radius: 999px; background: var(--teal-pale); color: var(--teal-dark); font-family: var(--mono); font-size: 0.61rem; font-weight: 800; letter-spacing: 0.06em; }
.credential-grid { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.8fr); gap: 14px; align-items: stretch; }
.fixed-model-card { display: grid; align-content: center; gap: 5px; padding: 14px; border: 1px solid rgba(20,119,101,0.2); border-radius: 10px; background: rgba(255,255,255,0.78); }
.fixed-model-card span, .fixed-model-card small { color: var(--ink-soft); font-size: 0.65rem; }
.fixed-model-card strong { font-size: 0.78rem; }
.fixed-model-card code { overflow-wrap: anywhere; color: var(--teal-dark); font-size: 0.7rem; }
.consent-row { display: flex; align-items: flex-start; gap: 9px; margin-top: 14px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; background: rgba(255,255,255,0.72); color: var(--ink-soft); font-size: 0.72rem; line-height: 1.45; cursor: pointer; }
.consent-row input { flex: 0 0 auto; margin-top: 2px; accent-color: var(--teal); }
.disclosure-note { margin: -6px 0 18px; padding: 10px 12px; border-left: 3px solid var(--amber); background: var(--amber-pale); color: #6f4b26; font-size: 0.75rem; }
.artifact-meta { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.artifact-meta span { padding: 6px 8px; border: 1px solid var(--line); border-radius: 7px; color: var(--ink-soft); font-size: 0.68rem; }
.artifact-meta code { color: var(--ink); }
.artifact-view { min-height: 74px; }
.json-artifact { max-height: 480px; margin: 0; overflow: auto; padding: 15px; border: 1px solid #233b48; border-radius: 10px; background: var(--navy); color: #dceae6; font-family: var(--mono); font-size: 0.67rem; line-height: 1.55; white-space: pre-wrap; overflow-wrap: anywhere; }
.card-actions { margin-top: 18px; padding-top: 15px; border-top: 1px solid var(--line); }
.report-download-status { flex: 1 1 250px; margin-right: auto; color: var(--ink-soft); font-size: 0.68rem; line-height: 1.45; }
.report-download-status[data-state="ready"] { color: var(--teal-dark); }
.report-download-status[data-state="loading"] { color: #6f4b26; }
.report-download-status[data-state="error"] { color: var(--red); }
.requirement-card { padding: 15px 0; border-bottom: 1px solid var(--line); }
.requirement-card:last-child { border-bottom: 0; }
.requirement-card header { display: flex; align-items: center; gap: 10px; margin-bottom: 7px; }
.requirement-card h3 { margin: 0; font-size: 0.94rem; }
.clause-id { flex: 0 0 auto; padding: 3px 6px; border-radius: 5px; background: var(--teal-pale); color: var(--teal-dark); font-family: var(--mono); font-size: 0.59rem; font-weight: 800; }
.requirement-text { margin: 0 0 9px; color: var(--ink-soft); font-size: 0.8rem; }
.criterion-line { display: grid; grid-template-columns: 75px minmax(0, 1fr); gap: 8px; padding: 8px; border-radius: 7px; background: #f0f2ee; font-size: 0.68rem; }
.criterion-line span { color: var(--ink-soft); }
.criterion-line code { overflow-wrap: anywhere; }

.summary-clause-list { display: grid; gap: 9px; }
.summary-clause { padding: 14px; border: 1px solid var(--line); border-radius: 10px; }
.summary-clause header { display: flex; align-items: center; gap: 9px; }
.summary-clause header strong { flex: 1; font-size: 0.83rem; }
.summary-clause .result { padding: 3px 7px; border-radius: 999px; background: #edf0ed; font-size: 0.6rem; }
.summary-clause .result.pass, .summary-clause .result.satisfied, .summary-clause .result.met { background: var(--teal-pale); color: var(--teal-dark); }
.summary-clause .result.fail, .summary-clause .result.unsatisfied, .summary-clause .result.not_met { background: var(--red-pale); color: var(--red); }
.summary-clause p { margin: 8px 0 0; color: var(--ink-soft); font-size: 0.75rem; }
.commitment-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.commitment-section h3 { font-size: 0.84rem; }
.commitment-list { display: grid; gap: 6px; }
.commitment-row { display: grid; grid-template-columns: minmax(140px, 0.65fr) minmax(0, 1.35fr); gap: 9px; padding: 8px; border-radius: 7px; background: #eef2ef; }
.commitment-row span { overflow-wrap: anywhere; color: var(--ink-soft); font-size: 0.64rem; }
.commitment-row code { overflow-wrap: anywhere; color: var(--teal-dark); font-size: 0.64rem; }
.raw-details { margin-top: 15px; }
.raw-details summary { margin-bottom: 9px; color: var(--ink-soft); cursor: pointer; font-size: 0.7rem; }
.form-error { color: var(--red); font-size: 0.74rem; }

.source-drop-zone { display: grid; min-height: 145px; place-content: center; justify-items: center; gap: 4px; border: 1px dashed #9eaaa5; border-radius: 12px; background: #fafbf8; cursor: pointer; text-align: center; }
.source-drop-zone:hover, .source-drop-zone.dragging { border-color: var(--teal); background: var(--teal-pale); }
.drop-icon { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 5px; border-radius: 50%; background: var(--teal-pale); color: var(--teal); font-size: 1.2rem; }
.source-drop-zone strong { font-size: 0.85rem; }
.source-drop-zone small { color: var(--ink-soft); }
.source-drop-zone .template-example { max-width: 520px; margin-top: 2px; color: #6f7d85; font-size: 0.68rem; }
.file-selection { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; }
.file-selection > div { display: grid; }
.file-selection strong { font-size: 0.76rem; }
.file-selection span { color: var(--ink-soft); font-size: 0.66rem; }

.release-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 11px; }
.release-grid article { display: flex; min-height: 225px; flex-direction: column; padding: 16px; border: 1px solid var(--line); border-radius: 11px; background: white; }
.release-grid article.danger-zone { border-color: rgba(169, 60, 54, 0.28); background: #fffafa; }
.step-number { color: var(--teal-dark); font-family: var(--mono); font-size: 0.65rem; font-weight: 800; }
.release-grid h3 { margin: 22px 0 7px; font-size: 0.91rem; }
.release-grid p { color: var(--ink-soft); font-size: 0.7rem; }
.release-grid .button { width: 100%; margin-top: auto; }
.bundle-import { display: grid; gap: 5px; margin: 8px 0 10px; }
.bundle-import .button { min-height: 34px; margin: 0; padding: 6px 8px; font-size: 0.68rem; }
.bundle-import small { color: var(--ink-soft); font-size: 0.6rem; text-align: center; }

.receipt-list { display: grid; gap: 7px; }
.receipt-item { display: grid; grid-template-columns: minmax(130px, 0.6fr) minmax(0, 1.2fr) minmax(100px, 0.5fr); gap: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; align-items: center; }
.receipt-item strong { font-size: 0.7rem; text-transform: uppercase; }
.receipt-item code { overflow-wrap: anywhere; color: var(--teal-dark); font-size: 0.61rem; }
.receipt-item span { color: var(--ink-soft); font-size: 0.62rem; }

.access-gate { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: 22px; background: rgba(5, 18, 26, 0.8); backdrop-filter: blur(10px); }
.access-card { width: min(440px, 100%); padding: 30px; border: 1px solid #52626b; border-radius: 18px; background: var(--paper); box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35); }
.access-card h2 { margin: 18px 0 8px; font-size: 1.65rem; }
.access-card > p { color: var(--ink-soft); font-size: 0.78rem; }
.access-card .role-badge { justify-self: start; }
.back-link { display: block; margin-top: 15px; color: var(--ink-soft); font-size: 0.72rem; text-align: center; }

.busy-layer { position: fixed; inset: 0; z-index: 120; display: grid; place-content: center; justify-items: center; gap: 7px; background: rgba(5, 18, 26, 0.82); color: white; }
.busy-layer strong { margin-top: 8px; }
.busy-layer span { color: #a9bbb9; font-size: 0.75rem; }
.spinner { width: 40px; height: 40px; border: 2px solid rgba(255, 255, 255, 0.18); border-top-color: #68d1b8; border-radius: 50%; animation: spin 0.8s linear infinite; }
.toast-region { position: fixed; right: 20px; bottom: 20px; z-index: 150; display: grid; width: min(380px, calc(100vw - 40px)); gap: 8px; pointer-events: none; }
.toast { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: white; box-shadow: var(--shadow); font-size: 0.76rem; }
.toast.success { border-color: rgba(20, 119, 101, 0.35); color: var(--teal-dark); }
.toast.warning { border-color: rgba(182, 107, 28, 0.4); background: var(--amber-pale); color: #75430f; }
.toast.error { border-color: rgba(169, 60, 54, 0.35); background: var(--red-pale); color: var(--red); }

@media (max-width: 1100px) {
  .process-flow { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .process-flow.six-step { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .process-flow li:not(:last-child)::after { display: none; }
  .trust-layer-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .attestation-proof-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .attestation-proof-grid > .wide { grid-column: span 2; }
  .release-grid { grid-template-columns: 1fr; }
  .release-grid article { min-height: auto; }
}

@media (max-width: 860px) {
  .site-header { min-height: 72px; padding-inline: 20px; }
  .header-actions .trust-pill, .header-actions .text-button { display: none; }
  .hero { min-height: 0; grid-template-columns: 1fr; padding-block: 62px; }
  .status-console { width: min(520px, 100%); min-height: 430px; }
  .portal-grid { grid-template-columns: 1fr; }
  .process-flow { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .process-flow.six-step { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .credential-grid { grid-template-columns: 1fr; }
  .workspace-shell { grid-template-columns: 1fr; }
  .matter-sidebar { position: relative; top: auto; height: auto; padding: 18px 20px; border-right: 0; border-bottom: 1px solid var(--line); }
  .matter-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .identity-mini-card { margin-top: 14px; }
  .trust-layer-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .workspace-main { padding: 28px 20px; }
}

@media (max-width: 600px) {
  .wrap { width: min(100% - 28px, 1180px); }
  .site-header { padding-inline: 14px; }
  .brand strong { font-size: 0.72rem; }
  .brand small { font-size: 0.55rem; }
  .site-header > .trust-pill { display: none; }
  .hero { gap: 38px; padding-block: 48px; }
  .hero h1 { font-size: 2.8rem; }
  .hero-actions .button { width: 100%; }
  .status-console { min-height: 410px; padding: 17px; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 12px; }
  .portal-card { min-height: 390px; padding: 22px; }
  .process-flow { grid-template-columns: 1fr; }
  .process-flow.six-step { grid-template-columns: 1fr; }
  .process-flow li { min-height: 160px; }
  .process-flow h3 { margin-top: 24px; }
  .site-footer { align-items: flex-start; flex-direction: column; justify-content: center; }
  .matter-list { grid-template-columns: 1fr; }
  .workspace-main { padding-inline: 12px; }
  .builder-panel, .content-card, .trust-card { padding: 17px; border-radius: 14px; }
  .matter-titlebar, .trust-card-head, .panel-heading { align-items: stretch; flex-direction: column; }
  .title-actions { align-items: stretch; flex-direction: column; }
  .trust-overview, .party-verification-grid, .clause-field-grid, .local-test-pack-control { grid-template-columns: 1fr; }
  .attestation-proof-grid { grid-template-columns: 1fr; }
  .attestation-proof-grid > .wide { grid-column: auto; }
  .trust-layer-grid { grid-template-columns: 1fr; }
  .workflow-strip { overflow-x: auto; grid-template-columns: repeat(7, 92px); }
  .workflow-step:not(:last-child)::after { display: none; }
  .criterion-line, .commitment-row, .receipt-item { grid-template-columns: 1fr; }
  .form-actions, .card-actions, .trust-actions, .inline-actions { align-items: stretch; flex-direction: column; }
  .form-actions .button, .card-actions .button, .trust-actions .button, .inline-actions .button { width: 100%; }
  .access-card { padding: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
