.access-main {
  display: block;
  min-height: calc(100vh - var(--header-h));
  background: var(--paper-soft);
}

.access-conversation {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: calc(100vh - var(--header-h));
  padding: 32px 24px 72px;
}

.access-entry {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.access-copy,
.access-card {
  width: min(100%, 470px);
}

.access-card {
  margin-inline: auto;
}

.access-copy h1 {
  font-size: var(--display);
  line-height: 1.22;
}

.access-copy p {
  color: var(--ink-soft);
}

.access-dialog {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s4);
}

.access-dialog p {
  margin: 0;
  padding: var(--s3);
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--ink-soft);
  text-align: left;
}

.access-dialog strong {
  color: var(--ink);
  font-size: var(--body);
}

.access-card {
  padding: 32px;
  border-radius: var(--radius-panel);
  background: var(--paper);
  box-shadow: 0 18px 44px rgba(11, 40, 36, 0.08);
}

.access-card h1,
.access-card h2,
[data-code-pane] h2 {
  margin-bottom: var(--s2);
  font-size: 32px;
  line-height: 1.2;
}

.access-note {
  margin-bottom: var(--s4);
  color: var(--ink-soft);
  font-size: var(--small);
}

.form-field {
  display: grid;
  gap: var(--s1);
  margin-bottom: var(--s2);
  color: var(--ink-soft);
  font-size: var(--small);
  font-weight: 500;
}

.auth-phase label,
.access-card label {
  display: grid;
  gap: var(--s1);
}

.form-field input {
  width: 100%;
  min-width: 0;
  height: 43px;
  padding: 0 14px;
  border: 1px solid var(--ink-soft);
  border-radius: var(--radius-control);
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--small);
}

.form-field input:focus {
  border-color: var(--ink);
}

.access-card .button {
  width: 100%;
}

.access-actions {
  display: flex;
  gap: var(--s2);
  margin-top: var(--s3);
}

.access-actions .button {
  width: auto;
  flex: 1;
}

.code-notice {
  margin: var(--s4) 0 var(--s2);
  color: var(--ink-soft);
  font-size: var(--small);
}

.form-error {
  margin: var(--s2) 0 0;
  color: #a43c31;
  font-size: var(--small);
}

.desk-main {
  padding: var(--s5) 0 var(--s7);
  background: var(--paper);
}

.desk-main .wrap {
  width: min(1180px, calc(100% - 48px));
}

.desk-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--s4);
  margin-bottom: var(--s5);
}

.desk-head .button.secondary {
  border: 1px solid var(--ink-soft);
  background: var(--paper);
  color: var(--ink);
}

.desk-head h1 {
  margin-bottom: var(--s1);
  font-size: var(--display);
}

.session-line {
  color: var(--ink-soft);
  font-size: var(--small);
}

.session-line strong {
  font-family: var(--mono);
  color: var(--ink);
}

.route-board {
  display: grid;
  grid-template-areas:
    "alias archive"
    "guard archive";
  padding: var(--s3);
  border-radius: var(--radius-panel);
  background: var(--paper-soft);
  grid-template-columns: minmax(0, 1.05fr) minmax(340px, 0.95fr);
  align-items: stretch;
  gap: var(--s4);
}

.alias-station {
  grid-area: alias;
  box-shadow: 0 18px 44px rgba(8, 47, 41, 0.08);
}

.archive-station {
  grid-area: archive;
}

.guard-station {
  grid-area: guard;
}

.route-forge,
.arrival-stream,
.trust-pocket {
  border-radius: var(--radius-panel);
}

.alias-station {
  padding: var(--s4);
  background: var(--brand-wash);
}

.archive-station {
  padding: var(--s4);
  background: var(--paper);
}

.guard-station {
  padding: var(--s4);
  background: var(--paper);
}

.desk-section-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: var(--s3);
  margin-bottom: var(--s4);
}

.desk-section-head > div:first-child {
  min-width: 0;
  flex: 1 1 auto;
}

.desk-section-head .status-pill {
  flex-shrink: 0;
}

.archive-station .desk-section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  column-gap: var(--s3);
  row-gap: 0;
}

.archive-station .desk-section-head > div:first-child {
  display: contents;
}

.archive-station .desk-section-head .eyebrow {
  grid-column: 1;
  grid-row: 1;
  margin-bottom: 0;
}

.archive-station .desk-section-head h2,
.archive-station .desk-section-head p:not(.eyebrow) {
  grid-column: 1 / -1;
}

.archive-station .desk-section-head h2 {
  margin-top: 16px;
}

.desk-section-head,
.archive-station .desk-section-head,
.guard-station .desk-section-head {
  margin-bottom: var(--s5);
}

.desk-section-head + .compose-row,
.desk-section-head + .empty-state,
.desk-section-head + .archive-list,
.section-head + .compose-row,
.section-head + .archive-list {
  margin-top: var(--s5);
}

.desk-section-head p {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--ink-soft);
}

.compose-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.compose-row .prefix-wrap {
  flex: 1 1 100%;
}

.prefix-wrap {
  display: flex;
  min-width: 0;
  height: 43px;
  overflow: hidden;
  border-radius: var(--radius-control);
  background: var(--paper);
}

.prefix-wrap input {
  min-width: 0;
  flex: 1;
  padding: 0 14px;
  border: 0;
  border-radius: var(--radius-control) 0 0 var(--radius-control);
  outline: 0;
  background: var(--paper);
  color: var(--ink);
  font-size: var(--small);
}

.prefix-wrap:focus-within {
  box-shadow: 0 0 0 2px var(--brand);
}

.prefix-wrap input:focus {
  box-shadow: none;
}

.prefix-wrap span {
  display: inline-flex;
  align-items: center;
  padding: 0 14px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: var(--small);
}

.alias-list,
.archive-list {
  display: grid;
  gap: var(--s1);
  margin-top: var(--s3);
}

.alias-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--s2);
  padding: var(--s2);
  border-radius: var(--radius-card);
  background: var(--paper);
  color: var(--ink);
}

.alias-address {
  overflow: hidden;
  font-family: var(--mono);
  font-size: var(--small);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--brand-wash);
  color: var(--brand-deep);
  font-size: var(--tiny);
  font-weight: 600;
}

.alias-row .status-pill.is-active {
  background: var(--brand-wash);
  color: var(--brand-deep);
}

.alias-row .status-pill.is-paused {
  background: var(--accent-wash);
  color: #a43c31;
}

.alias-actions {
  display: flex;
  gap: var(--s1);
}

.mini-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--paper-soft);
  color: var(--ink);
  font-size: var(--tiny);
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s3);
}

.mini-button:hover {
  background: var(--night);
  color: var(--white);
}

.archive-tools {
  display: flex;
  grid-column: 2;
  grid-row: 1;
  align-items: center;
  justify-self: end;
  gap: var(--s2);
}

.filter-box {
  position: relative;
}

.filter-trigger {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  min-height: 43px;
  gap: 10px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--paper-soft);
  color: var(--ink);
  font-size: var(--small);
  white-space: nowrap;
}

.filter-chevron {
  width: 7px;
  height: 7px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.filter-menu {
  position: absolute;
  z-index: 5;
  top: calc(100% + 8px);
  right: 0;
  display: grid;
  min-width: 150px;
  padding: var(--s1);
  border-radius: var(--radius-panel);
  background: var(--paper);
  box-shadow: var(--shadow-soft);
}

.filter-menu button,
.filter-menu [role="option"] {
  display: inline-flex;
  align-items: center;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--small);
  text-align: left;
}

.filter-menu button:hover {
  background: var(--brand-wash);
  color: var(--brand-deep);
}

.archive-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  gap: var(--s2);
  padding: var(--s2);
  border: 0;
  border-radius: var(--radius-card);
  background: var(--paper-soft);
  color: var(--ink);
  text-align: left;
  white-space: normal;
}

.archive-row:hover {
  background: var(--brand-wash);
  color: var(--ink);
}

.archive-row > span {
  min-width: 0;
}

.archive-row strong,
.archive-row span {
  display: block;
  overflow-wrap: anywhere;
}

.archive-row span {
  margin-top: 4px;
  color: var(--muted);
  font-size: var(--small);
}

.archive-meta {
  text-align: right;
  white-space: nowrap;
}

.empty-state {
  padding: var(--s4);
  border-radius: var(--radius-card);
  background: var(--paper-soft);
  color: var(--ink-soft);
}

.empty-state strong {
  display: block;
  margin-bottom: var(--s1);
  color: var(--ink);
}

.archive-detail {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  margin-top: var(--s3);
  padding: var(--s3);
  border-radius: var(--radius-panel);
  background: var(--paper-soft);
  color: var(--ink);
}

.detail-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: var(--s3);
  margin-bottom: var(--s3);
}

.detail-head h3 {
  margin-bottom: var(--s1);
}

.detail-meta {
  color: var(--muted);
  font-size: var(--small);
}

.detail-body {
  min-height: 200px;
  padding-top: var(--s3);
  border-top: 1px solid var(--line);
}

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--s1);
  margin-top: var(--s3);
}

.attachment-list a {
  padding: 8px 10px;
  border-radius: var(--radius-control);
  background: var(--brand-wash);
  color: var(--brand-deep);
  font-size: var(--small);
}

.detail-body iframe {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  min-height: 360px;
  border: 0;
}

.twofa-status {
  display: flex;
  align-items: center;
  gap: var(--s2);
  margin-bottom: var(--s3);
}

.twofa-status .status-pill {
  margin: 0;
  background: var(--accent-wash);
  color: #a43c31;
}

.twofa-setup {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: var(--s4);
  margin-top: var(--s3);
  padding: var(--s3);
  border-radius: var(--radius-panel);
  background: var(--paper-soft);
  color: var(--ink);
}

.twofa-qr-plate {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: flex-start;
  width: fit-content;
  max-width: 100%;
  gap: var(--s3);
  margin: 0;
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--paper);
}

.twofa-qr-plate figcaption {
  max-width: 8em;
  color: var(--ink-soft);
  font-size: var(--small);
  line-height: 1.45;
  text-align: start;
}

.qr-box {
  display: grid;
  flex: none;
  place-items: center;
  width: 108px;
  aspect-ratio: 1;
  padding: 8px;
  border-radius: var(--radius-card);
  background: var(--paper-soft);
}

.qr-box img {
  width: 100%;
  height: 100%;
}

.twofa-howto {
  width: 100%;
  margin: 0;
  padding-left: 0;
  list-style: none;
}

.twofa-steps {
  display: grid;
  gap: var(--s2);
}

.twofa-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: var(--s2);
  color: var(--ink-soft);
  font-size: var(--small);
}

.twofa-step b {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: var(--white);
  font-family: var(--mono);
}

.secret-line {
  display: flex;
  flex-wrap: wrap;
  justify-self: start;
  align-items: center;
  width: fit-content;
  max-width: 100%;
  gap: var(--s2);
  min-width: 0;
  padding: 8px 12px 8px 16px;
  border-radius: 22px;
  background: var(--night);
  color: var(--white);
  font-family: var(--mono);
  font-size: var(--tiny);
}

.secret-line code {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.secret-line .mini-button {
  flex: 0 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.72);
  background: transparent;
  color: var(--white);
  white-space: nowrap;
}

.secret-line .mini-button:hover,
.secret-line .mini-button:focus-visible {
  border-color: var(--brand);
  background: var(--brand);
  color: var(--white);
  box-shadow: 0 0 0 3px rgba(8, 127, 114, 0.45);
}

[data-twofa-disable-panel] {
  margin-top: 0;
}

[data-twofa-disable-panel] [data-2fa-disable] {
  margin-top: 24px;
}

.disable-spacer {
  display: flex;
  align-items: flex-end;
  min-height: 67px;
}

.form-actions [data-twofa-disable-panel] {
  align-self: flex-end;
}

.twofa-actions {
  align-items: flex-end;
}

.form-actions,
.twofa-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  gap: var(--s2);
  margin-top: var(--s3);
}

.twofa-confirm {
  display: flex;
  align-items: end;
  gap: var(--s2);
  margin-top: 0;
}

.twofa-confirm .form-field {
  flex: 1;
  margin: 0;
}

.console-toast {
  position: fixed;
  z-index: 100;
  right: var(--s3);
  bottom: var(--s3);
  padding: 12px 16px;
  border-radius: var(--radius-control);
  background: var(--night);
  color: var(--white);
  box-shadow: var(--shadow-soft);
  font-size: var(--small);
}

@media (max-width: 1100px) {
  .route-board {
    grid-template-areas: none;
    grid-template-columns: minmax(0, 1fr);
  }

  .access-conversation {
    display: flex;
  }

  .alias-station,
  .archive-station,
  .guard-station {
    grid-area: auto;
    grid-column: 1;
  }

  .access-conversation {
    grid-template-columns: minmax(0, 1fr);
  }

  .access-entry {
    padding: 0;
  }

  .access-card {
    width: min(100%, 620px);
    margin-inline: auto;
  }
}

@media (max-width: 700px) {
  .access-copy h1,
  .desk-head h1 {
    font-size: 36px;
  }

  .desk-main {
    padding-top: var(--s4);
  }

  .desk-main .wrap {
    width: min(1180px, calc(100% - 32px));
  }

  .desk-head,
  .desk-section-head {
    align-items: start;
    flex-direction: column;
  }

  .archive-station .desk-section-head {
    grid-template-columns: minmax(0, 1fr);
  }

  .archive-tools {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .compose-row {
    display: grid;
  }

  .compose-row .button {
    width: 100%;
    padding-inline: 14px;
    font-size: 15px;
    white-space: nowrap;
  }

  .compose-row,
  .alias-row,
  .twofa-setup {
    grid-template-columns: minmax(0, 1fr);
  }

  .alias-actions,
  .archive-tools,
  .twofa-confirm {
    flex-wrap: wrap;
  }

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

  .archive-row .archive-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    text-align: left;
    white-space: normal;
  }

  .archive-meta strong,
  .archive-meta span {
    display: inline;
  }

  .qr-box {
    width: min(108px, 100%);
  }

  .twofa-qr-plate {
    flex-direction: column;
    align-items: flex-start;
    width: fit-content;
    max-width: 100%;
  }

  .twofa-qr-plate figcaption {
    max-width: 12em;
  }

  .access-intro,
  .access-entry {
    padding: var(--s4) var(--s2);
  }
}
