:root {
  color-scheme: light;
  --canvas: #f7f5f2;
  --paper: #ffffff;
  --paper-strong: #ffffff;
  --ink: #111111;
  --muted: #74716f;
  --line: #e8e4df;
  --line-strong: #d1cbc5;
  --acid: #ff5000;
  --acid-deep: #ed4200;
  --coral: #ff5000;
  --orange-soft: #fff0e9;
  --success: #258a4b;
  --danger: #c83f2b;
  --shadow: 0 12px 34px rgba(36, 27, 22, 0.07);
  --serif: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  --sans: "Avenir Next", Avenir, "Trebuchet MS", sans-serif;
  --mono: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --canvas: #111111;
  --paper: #1b1b1b;
  --paper-strong: #242424;
  --ink: #ffffff;
  --muted: #a9a6a3;
  --line: #303030;
  --line-strong: #474747;
  --acid: #ff641f;
  --acid-deep: #ff5000;
  --coral: #ff641f;
  --orange-soft: #321a10;
  --success: #62c987;
  --danger: #ff806c;
  --shadow: 0 16px 46px rgba(0, 0, 0, 0.24);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--canvas);
}

body {
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  background: var(--canvas);
  color: var(--ink);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a,
label {
  -webkit-tap-highlight-color: transparent;
}

button,
a {
  color: inherit;
}

a {
  text-decoration: none;
}

[hidden][hidden] {
  display: none;
}

.grain {
  display: none;
}

.app-frame {
  position: relative;
  width: min(100%, 820px);
  min-width: 0;
  max-width: 100vw;
  min-height: 100dvh;
  margin: 0 auto;
}

.topbar {
  position: sticky;
  z-index: 15;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  padding: max(12px, env(safe-area-inset-top)) 20px 8px;
  background: color-mix(in srgb, var(--canvas) 94%, transparent);
  backdrop-filter: blur(18px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.brand img {
  width: 36px;
  height: 36px;
}

.wallet-slot {
  min-height: 36px;
}

.wallet-slot tc-root,
.wallet-slot button {
  font-family: var(--sans);
}

.billing-note {
  display: block;
  width: fit-content;
  padding: 6px 9px;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--acid);
  font-size: 9px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

.proof-panel .billing-note,
.verifier-card .billing-note,
.form-card .billing-note {
  justify-self: center;
}

.app-content {
  min-height: calc(100dvh - 68px);
}

.page {
  min-width: 0;
  padding: 24px 20px calc(96px + env(safe-area-inset-bottom));
  animation: page-in 320ms cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes page-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

.page-loader {
  display: flex;
  justify-content: center;
  gap: 7px;
  padding: 40vh 0;
}

.page-loader span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  animation: pulse 900ms infinite alternate;
}

.page-loader span:nth-child(2) {
  animation-delay: 180ms;
}

.page-loader span:nth-child(3) {
  animation-delay: 360ms;
}

@keyframes pulse {
  to {
    opacity: 0.2;
    transform: translateY(-5px);
  }
}

.bottom-nav {
  position: fixed;
  z-index: 12;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  width: 100%;
  min-width: 0;
  max-width: 820px;
  min-height: calc(72px + env(safe-area-inset-bottom));
  margin: 0 auto;
  padding: 7px 10px max(7px, env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: color-mix(in srgb, var(--paper-strong) 96%, transparent);
  box-shadow: 0 -8px 28px rgba(36, 27, 22, 0.04);
  backdrop-filter: blur(20px);
}

.bottom-nav a {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 650;
  transition:
    color 160ms ease,
    background 160ms ease,
    transform 160ms ease;
}

.bottom-nav a:active {
  transform: scale(0.94);
}

.bottom-nav a.is-active {
  background: transparent;
  color: var(--acid);
}

.bottom-nav svg {
  width: 23px;
  height: 23px;
}

.telegram-gate {
  display: grid;
  align-content: center;
  min-height: calc(100dvh - 90px);
  padding: 38px 24px 100px;
}

.telegram-gate::before {
  width: 70px;
  height: 5px;
  margin-bottom: 28px;
  border-radius: 999px;
  background: var(--acid);
  content: "";
}

.telegram-gate h1 {
  max-width: 680px;
  margin: 12px 0 18px;
  font-size: clamp(42px, 11vw, 72px);
  font-weight: 750;
  line-height: 0.94;
  letter-spacing: -0.06em;
}

.telegram-gate h1 em {
  color: var(--acid);
  font-style: normal;
  font-weight: 750;
}

.telegram-gate p {
  max-width: 460px;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.55;
}

.eyebrow {
  display: block;
  color: var(--acid);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 8px 0 28px;
}

.hero-copy h1,
.section-heading h1,
.room-hero h1 {
  margin: 8px 0 10px;
  font-size: clamp(36px, 10vw, 58px);
  font-weight: 750;
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-copy p,
.section-heading p,
.room-hero > p {
  max-width: 540px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.profile-action {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.profile-action svg {
  width: 22px;
}

.action-grid {
  display: grid;
  min-width: 0;
  gap: 14px;
}

.action-card {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 24px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  gap: 14px;
  align-items: center;
  min-height: 138px;
  overflow: hidden;
  padding: 22px 20px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition:
    transform 180ms ease,
    box-shadow 180ms ease;
}

.action-card:active {
  transform: translateY(2px);
  box-shadow: none;
}

.action-card--ink {
  border-color: transparent;
  background: linear-gradient(135deg, var(--acid-deep), var(--acid));
  color: #ffffff;
}

.action-card--ink::after {
  display: none;
}

.action-card > * {
  position: relative;
  z-index: 1;
}

.action-card > div {
  min-width: 0;
}

.action-icon {
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 15px;
  background: var(--orange-soft);
  color: var(--acid);
}

.action-card--ink .action-icon {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
}

.action-icon svg {
  width: 25px;
  height: 25px;
}

.action-card h2 {
  margin: 0 0 8px;
  overflow-wrap: anywhere;
  white-space: normal;
  font-size: 24px;
  font-weight: 750;
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.action-card p {
  max-width: 440px;
  margin: 0;
  color: color-mix(in srgb, currentcolor 72%, transparent);
  font-size: 13px;
  line-height: 1.5;
}

.action-card > svg {
  width: 25px;
}

.tool-grid {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.tool-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.tool-card > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--acid);
}

.tool-card > span svg {
  width: 23px;
}

.tool-card > svg {
  width: 18px;
}

.tool-card strong,
.tool-card small {
  display: block;
}

.tool-card strong {
  margin-bottom: 4px;
  font-size: 12px;
}

.tool-card small {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.local-note {
  display: grid;
  grid-template-columns: 38px 1fr 18px;
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.local-note > svg:first-child {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: var(--orange-soft);
  color: var(--acid);
}

.local-note > svg:last-child {
  width: 18px;
}

.local-note strong,
.local-note span {
  display: block;
}

.local-note strong {
  margin-bottom: 3px;
  font-size: 12px;
}

.local-note span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.4;
}

.trust-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  min-width: 0;
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.trust-strip div {
  min-width: 0;
  padding: 15px 10px;
  border-right: 1px solid var(--line);
}

.trust-strip div:last-child {
  border: 0;
}

.trust-strip strong,
.trust-strip span {
  display: block;
}

.trust-strip strong {
  margin-bottom: 5px;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.trust-strip span {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.35;
}

.section-heading {
  margin-bottom: 24px;
  padding: 8px 0 0;
}

.section-heading--row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
}

.section-heading--row h1 {
  margin-bottom: 0;
}

.back-link {
  display: inline-block;
  margin-bottom: 25px;
  color: var(--acid);
  font-size: 12px;
  font-weight: 700;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 15px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 750;
  transition:
    transform 150ms ease,
    opacity 150ms ease,
    background 150ms ease;
}

.button:active {
  transform: scale(0.98);
}

.button:disabled {
  cursor: wait;
  opacity: 0.48;
}

.button--primary {
  background: linear-gradient(135deg, var(--acid-deep), var(--acid));
  color: #ffffff;
}

.button--primary:hover {
  background: var(--acid-deep);
}

.button--secondary {
  border-color: var(--line);
  background: var(--paper);
}

.button--wide {
  width: 100%;
}

.button--compact {
  min-height: 40px;
  padding-inline: 15px;
  border-radius: 12px;
  white-space: nowrap;
}

.text-button,
.icon-button {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  position: relative;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-family: var(--mono);
  font-size: 17px;
}

.icon-button.is-loading {
  color: transparent;
  opacity: 1;
}

.icon-button.is-loading::after {
  position: absolute;
  width: 15px;
  height: 15px;
  border: 2px solid var(--line-strong);
  border-top-color: var(--acid);
  border-radius: 50%;
  animation: download-spin 700ms linear infinite;
  content: "";
}

.icon-button.is-success {
  border-color: color-mix(in srgb, var(--success) 35%, var(--line));
  background: color-mix(in srgb, var(--success) 10%, var(--paper));
  color: var(--success);
}

.icon-button.is-error {
  border-color: color-mix(in srgb, var(--danger) 35%, var(--line));
  background: color-mix(in srgb, var(--danger) 10%, var(--paper));
  color: var(--danger);
}

@keyframes download-spin {
  to {
    transform: rotate(360deg);
  }
}

.drop-zone {
  display: grid;
  min-height: 360px;
  place-items: center;
  align-content: center;
  padding: 44px 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}

.drop-zone > svg {
  width: 66px;
  height: 66px;
  margin-bottom: 18px;
  padding: 17px;
  border-radius: 20px;
  background: var(--orange-soft);
  color: var(--acid);
}

.drop-zone h2 {
  margin: 0 0 7px;
  font-size: 29px;
  font-weight: 750;
  letter-spacing: -0.045em;
}

.drop-zone p {
  margin: 0 0 24px;
  color: var(--muted);
  font-size: 12px;
}

.drop-zone small {
  margin-top: 16px;
  color: var(--muted);
  font-size: 10px;
}

.scan-entry-link {
  margin-top: 14px;
  color: var(--acid);
}

.drop-zone--compact {
  min-height: 310px;
}

.picker-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.converter-shell {
  display: grid;
  gap: 14px;
}

.conversion-panel {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.selection-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.selection-heading strong,
.selection-heading span {
  display: block;
}

.selection-heading strong {
  font-size: 13px;
}

.selection-heading span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 10px;
}

.selection-heading > div:last-child {
  display: flex;
  gap: 12px;
}

.image-list {
  display: grid;
  max-height: 210px;
  gap: 8px;
  margin: 0 0 16px;
  padding: 0;
  overflow: auto;
  list-style: none;
  overscroll-behavior: contain;
}

.image-list li {
  overflow: hidden;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--canvas);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scan-card {
  margin-bottom: 14px;
  padding: 16px;
  border-radius: 18px;
  background: var(--orange-soft);
}

.scan-card__heading {
  display: grid;
  grid-template-columns: 38px 1fr;
  gap: 11px;
  align-items: center;
  margin-bottom: 14px;
}

.scan-card__heading > svg {
  width: 38px;
  height: 38px;
  padding: 9px;
  border-radius: 12px;
  background: var(--paper);
  color: var(--acid);
}

.scan-card__heading strong,
.scan-card__heading span,
.scan-result strong,
.scan-result span {
  display: block;
}

.scan-card__heading strong,
.scan-result strong {
  font-size: 12px;
}

.scan-card__heading span,
.scan-result span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.4;
}

.scan-modes {
  grid-template-columns: repeat(2, 1fr);
  background: color-mix(in srgb, var(--paper) 72%, transparent);
}

.scan-result {
  display: grid;
  gap: 11px;
  margin-bottom: 14px;
  padding: 16px;
  border: 1px solid color-mix(in srgb, var(--success) 32%, var(--line));
  border-radius: 18px;
  background: color-mix(in srgb, var(--success) 7%, var(--paper));
}

.scan-preview {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 3px 0;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
}

.scan-preview::-webkit-scrollbar {
  display: none;
}

.scan-preview img {
  width: 70px;
  height: 92px;
  flex: 0 0 auto;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
  box-shadow: 0 7px 18px rgba(36, 27, 22, 0.1);
  object-fit: contain;
}

.original-pdf-action {
  display: block;
  margin: 2px auto 0;
}

.editor-workspace {
  display: grid;
  gap: 16px;
}

.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.editor-toolbar strong,
.editor-toolbar span {
  display: block;
  overflow: hidden;
  max-width: 68vw;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-toolbar strong {
  font-size: 13px;
}

.editor-toolbar span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.document-stage {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #eae7e3;
  box-shadow: var(--shadow);
}

.page-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 11px;
}

.page-controls button {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: inherit;
}

.pdf-canvas-wrap {
  position: relative;
  display: grid;
  min-height: 280px;
  place-items: start center;
  overflow: auto;
  padding: 14px;
  overscroll-behavior: contain;
}

#pdf-canvas {
  display: block;
  max-width: 100%;
  background: white;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.25);
}

.signature-overlay {
  position: absolute;
  z-index: 4;
  padding: 4px;
  touch-action: none;
  border: 2px solid var(--acid);
  background: rgba(255, 80, 0, 0.05);
  cursor: move;
}

.signature-overlay img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  right: -8px;
  bottom: -8px;
  width: 18px;
  height: 18px;
  padding: 0;
  border: 3px solid white;
  border-radius: 50%;
  background: var(--acid);
  touch-action: none;
}

.signature-panel,
.proof-panel,
.form-card,
.verifier-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.panel-title {
  display: block;
  margin-bottom: 13px;
  font-size: 13px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  margin-bottom: 16px;
  padding: 4px;
  border-radius: 13px;
  background: var(--canvas);
}

.segmented button {
  min-height: 38px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.segmented button.is-active {
  background: var(--orange-soft);
  box-shadow: none;
  color: var(--acid);
}

.draw-pad {
  display: block;
  width: 100%;
  height: 180px;
  margin-bottom: 10px;
  touch-action: none;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(var(--line) 1px, transparent 1px) 0 80% / 100% 30px,
    var(--paper-strong);
}

.signature-panel .button {
  margin-top: 16px;
}

.upload-signature {
  display: grid;
  min-height: 120px;
  place-items: center;
  padding: 20px;
  border: 1px dashed var(--line-strong);
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

.upload-signature input {
  max-width: 100%;
  margin-top: 10px;
  font-size: 11px;
}

.proof-panel {
  display: grid;
  gap: 10px;
}

.proof-panel > div {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 7px;
  padding: 12px;
  border-radius: 16px;
  background: var(--orange-soft);
}

.proof-panel svg {
  width: 26px;
  flex: none;
  color: var(--acid);
}

.proof-panel strong,
.proof-panel span span {
  display: block;
}

.proof-panel span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.proof-panel strong {
  color: var(--ink);
  font-size: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

.field + .field {
  margin-top: 18px;
}

.field > span {
  font-size: 11px;
  font-weight: 750;
}

.field input,
.join-strip input {
  width: 100%;
  height: 50px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  outline: none;
  background: var(--paper-strong);
  color: var(--ink);
  font-size: 14px;
}

.field input:focus,
.join-strip input:focus {
  border-color: var(--acid);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--acid) 18%, transparent);
}

.field small,
.file-field small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.file-field input {
  height: auto;
  padding-block: 13px;
}

.form-card {
  display: grid;
  gap: 18px;
}

.form-card .button {
  margin-top: 2px;
}

.privacy-note {
  display: flex;
  gap: 13px;
  padding: 15px;
  border-radius: 16px;
  background: var(--orange-soft);
  color: var(--acid);
}

.privacy-note svg {
  width: 23px;
  flex: none;
}

.privacy-note p,
.privacy-note strong {
  display: block;
}

.privacy-note p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.privacy-note strong {
  margin-bottom: 3px;
  color: var(--ink);
}

.join-strip {
  display: grid;
  gap: 12px;
  margin-bottom: 20px;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.join-strip strong,
.join-strip span {
  display: block;
}

.join-strip strong {
  font-size: 18px;
  font-weight: 750;
}

.join-strip span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.join-strip form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

.join-strip input {
  height: 42px;
  min-width: 0;
  font-family: var(--mono);
  font-size: 10px;
}

.join-strip button {
  padding-inline: 14px;
  border: 0;
  border-radius: 10px;
  background: var(--orange-soft);
  color: var(--acid);
  font-size: 11px;
  font-weight: 800;
}

.room-list {
  display: grid;
  gap: 12px;
}

.room-card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
  transition:
    transform 150ms ease,
    border-color 150ms ease;
}

.room-card:active {
  transform: scale(0.99);
}

.room-card__top {
  display: flex;
  gap: 7px;
  align-items: center;
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--acid);
}

.status-dot--completed {
  background: var(--success);
}

.status-dot--cancelled {
  background: var(--danger);
}

.room-date {
  margin-left: auto;
}

.room-card h2 {
  margin: 20px 0 4px;
  font-size: 22px;
  font-weight: 750;
  letter-spacing: -0.035em;
}

.room-card p {
  overflow: hidden;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-card footer {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.room-card footer svg {
  width: 19px;
  margin-left: auto;
}

.room-hero {
  padding-top: 6px;
}

.room-hero__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.room-status {
  padding: 5px 9px;
  border: 0;
  border-radius: 999px;
  background: var(--orange-soft);
  color: var(--acid);
  font-size: 9px;
  text-transform: uppercase;
}

.room-hero .button {
  margin-top: 25px;
}

.center-copy {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  text-align: center;
  font-size: 9px;
  line-height: 1.45;
}

.member-ledger {
  margin-top: 28px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.member-ledger header,
.member-row {
  display: flex;
  align-items: center;
}

.member-ledger header {
  justify-content: space-between;
  padding: 17px;
}

.member-ledger header h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 750;
}

.member-ledger header span {
  color: var(--muted);
  font-size: 10px;
}

.member-row {
  gap: 12px;
  padding: 13px 17px;
  border-top: 1px solid var(--line);
}

.member-order {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--acid);
  font-size: 9px;
}

.member-row div {
  min-width: 0;
}

.member-row strong,
.member-row small {
  display: block;
}

.member-row strong {
  font-size: 12px;
}

.member-row small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.member-state {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  text-transform: uppercase;
}

.member-state--ready {
  color: var(--coral);
}

.member-state--signed {
  color: var(--success);
}

.room-secret {
  display: grid;
  grid-template-columns: 30px 1fr auto;
  gap: 11px;
  align-items: center;
  margin-top: 22px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--paper);
}

.room-secret svg {
  width: 23px;
}

.room-secret strong,
.room-secret code {
  display: block;
}

.room-secret strong {
  margin-bottom: 3px;
  font-size: 10px;
}

.room-secret code {
  overflow: hidden;
  max-width: 55vw;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
}

.history-list {
  display: grid;
  gap: 10px;
}

.history-card {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.history-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 14px;
  background: var(--orange-soft);
  color: var(--acid);
}

.history-mark svg {
  width: 23px;
}

.history-main {
  min-width: 0;
}

.history-main h2 {
  overflow: hidden;
  margin: 0 0 4px;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-main p {
  overflow: hidden;
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
}

.history-main span {
  color: var(--muted);
  font-size: 9px;
}

.verifier-card {
  display: grid;
  gap: 12px;
}

.file-row {
  position: relative;
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 78px;
  padding: 12px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 17px;
  cursor: pointer;
}

.file-row > span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--acid);
  font-size: 9px;
}

.file-row strong,
.file-row small {
  display: block;
}

.file-row strong {
  font-size: 12px;
}

.file-row small {
  overflow: hidden;
  max-width: 60vw;
  margin-top: 4px;
  color: var(--muted);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-row input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.proof-explainer {
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: start;
  padding: 14px;
  border-radius: 17px;
  background: var(--orange-soft);
}

.proof-explainer > svg {
  width: 40px;
  height: 40px;
  padding: 9px;
  border-radius: 13px;
  background: var(--paper);
  color: var(--acid);
}

.proof-explainer strong {
  font-size: 11px;
}

.proof-explainer p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
}

.local-only-copy {
  color: var(--muted);
  font-size: 9px;
  line-height: 1.5;
  text-align: center;
}

.verification-result {
  padding: 16px;
  border-radius: 14px;
}

.verification-result--valid {
  background: color-mix(in srgb, var(--success) 16%, transparent);
  color: var(--success);
}

.verification-result--invalid {
  background: color-mix(in srgb, var(--danger) 15%, transparent);
  color: var(--danger);
}

.verification-result strong,
.verification-result p {
  display: block;
}

.verification-result strong {
  font-size: 20px;
}

.verification-result p {
  margin: 5px 0 0;
  font-size: 10px;
  line-height: 1.5;
}

.empty-state {
  display: grid;
  min-height: 250px;
  place-items: center;
  align-content: center;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper);
  text-align: center;
}

.empty-seal {
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  margin-bottom: 15px;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--acid);
}

.empty-seal svg {
  width: 26px;
}

.empty-state h3 {
  margin: 0 0 7px;
  font-size: 23px;
  font-weight: 750;
}

.empty-state p {
  max-width: 320px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.error-card {
  padding: 20px;
  border: 1px solid color-mix(in srgb, var(--danger) 40%, transparent);
  border-radius: 14px;
  background: color-mix(in srgb, var(--danger) 10%, transparent);
  color: var(--danger);
}

.toast-region {
  position: fixed;
  z-index: 10000;
  top: max(80px, calc(env(safe-area-inset-top) + 70px));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  gap: 8px;
  pointer-events: none;
}

.toast {
  max-width: 440px;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  color: #f8f5ec;
  font-size: 11px;
  line-height: 1.4;
  animation: toast-in 220ms ease;
}

.toast--error {
  background: var(--danger);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
}

.secret-dialog {
  width: min(calc(100% - 30px), 430px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--paper);
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3);
  color: var(--ink);
}

.secret-dialog::backdrop {
  background: rgba(12, 13, 10, 0.66);
  backdrop-filter: blur(5px);
}

.secret-dialog form {
  padding: 23px;
}

.secret-dialog h2 {
  margin: 8px 0;
  font-size: 28px;
  font-weight: 750;
}

.secret-dialog p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 11px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 20px;
}

@media (min-width: 680px) {
  .page {
    padding-inline: 30px;
  }

  .action-grid {
    grid-template-columns: 1.15fr 0.85fr;
  }

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

  .join-strip {
    grid-template-columns: 1fr minmax(300px, 0.8fr);
    align-items: center;
  }

  .room-list {
    grid-template-columns: repeat(2, 1fr);
  }

  .editor-workspace {
    grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
    align-items: start;
  }

  .editor-toolbar {
    grid-column: 1 / -1;
  }

  .document-stage {
    grid-row: span 2;
  }

  .proof-panel {
    grid-column: 2;
  }
}

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