:root {
  color-scheme: light;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  background: #fff;
  color: #000;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #fff;
  color: #000;
}

.filter-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

body.is-api-loading {
  cursor: wait;
}

body.is-api-loading .shell {
  pointer-events: none;
  user-select: none;
}

/* Marching-ants on every visible border while an API call is in flight */
body.is-api-loading .mast,
body.is-api-loading .heartbeat-strip,
body.is-api-loading .panel,
body.is-api-loading .ping-week-chart {
  position: relative;
}

body.is-api-loading .mast::before,
body.is-api-loading .heartbeat-strip::before,
body.is-api-loading .panel::before,
body.is-api-loading .ping-week-chart::before {
  content: '';
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1000;
  background-image:
    linear-gradient(90deg, #000 50%, transparent 50%),
    linear-gradient(90deg, #000 50%, transparent 50%),
    linear-gradient(0deg,  #000 50%, transparent 50%),
    linear-gradient(0deg,  #000 50%, transparent 50%);
  background-repeat: repeat-x, repeat-x, repeat-y, repeat-y;
  background-size: 10px 2px, 10px 2px, 2px 10px, 2px 10px;
  background-position: 0 0, 0 100%, 0 0, 100% 0;
  animation: march-ants 0.45s infinite linear;
}

@keyframes march-ants {
  to {
    background-position: 10px 0, -10px 100%, 0 -10px, 100% 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.is-api-loading .mast::before,
  body.is-api-loading .heartbeat-strip::before,
  body.is-api-loading .panel::before,
  body.is-api-loading .ping-week-chart::before {
    animation: none;
    opacity: 0.25;
  }
}
button,
input,
textarea {
  font: inherit;
}

.shell {
  width: min(1240px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0;
  transform: translateZ(0);
  filter: url(#hand-drawn);
  transition:
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.4s ease,
    opacity 0.35s ease;
}

@media (prefers-reduced-motion: reduce) {
  .shell,
  .error-ticker {
    filter: none;
  }
}

.error-ticker {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 500;
  filter: url(#hand-drawn);
  border: 0 solid #000;
  background: #000;
  color: #fff;
  min-height: 0;
  max-height: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  opacity: 0;
  transform: translateY(-10px);
  pointer-events: none;
  transition:
    max-height 0.28s ease,
    border-width 0.2s ease,
    opacity 0.2s ease,
    transform 0.28s ease;
}

.error-ticker.error-ticker--visible {
  min-height: 34px;
  max-height: 46px;
  border-width: 1px;
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.error-ticker-track {
  white-space: nowrap;
  padding-left: 100%;
  will-change: transform;
  animation: error-ticker-run 14s linear 1 forwards;
}

@keyframes error-ticker-run {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-100%);
  }
}

.mast {
  min-height: 116px;
  border: 1px solid #000;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: stretch;
  margin-bottom: 16px;
}

.mast > div:first-child {
  padding: 18px;
}

.brand,
h1,
h2,
dl,
dd,
pre {
  margin: 0;
}

.brand {
  font-size: 14px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

h1 {
  font-size: 42px;
  line-height: 1;
}

h2 {
  font-size: 16px;
  line-height: 1.2;
}

.status-board {
  display: grid;
  grid-template-columns: 160px;
  border-left: 1px solid #000;
}

.status-cell {
  display: grid;
  place-items: center;
  min-height: 56px;
  padding: 10px;
  border-bottom: 1px solid #000;
  text-align: center;
  text-transform: uppercase;
}

.status-cell:last-child {
  border-bottom: 0;
}

/* io-state: subtle server / browser origin indicator */
.io-cell {
  position: relative;
  min-height: 36px;
  font-size: 10px;
  letter-spacing: 0.06em;
  cursor: default;
  transition:
    background 0.15s ease,
    color 0.15s ease,
    opacity 0.4s ease;
}

.io-cell.io-state--server {
  background: #000;
  color: #fff;
}

.io-cell.io-state--done {
  color: #777;
}

/* tooltip */
.io-cell::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  background: #000;
  color: #fff;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.45;
  white-space: nowrap;
  letter-spacing: 0;
  text-transform: none;
  pointer-events: none;
  opacity: 0;
  z-index: 300;
  transition: opacity 0.12s ease;
}

.io-cell:hover::after {
  opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
  .io-cell {
    transition: none;
  }
  .io-cell::after {
    transition: none;
  }
}

.workspace {
  display: grid;
  grid-template-columns: minmax(216px, 288px) minmax(0, 1fr) minmax(216px, 288px);
  gap: 24px;
  align-items: start;
}

.rail,
.main-grid {
  display: grid;
  gap: 16px;
  align-content: start;
}

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

.timeline-column {
  min-width: 0;
  padding-top: 0;
  padding-left: 18px;
}

.flow-column {
  display: grid;
  gap: 16px;
  align-content: start;
  min-width: 0;
  position: sticky;
  top: 16px;
  align-self: start;
}

.flow-viz {
  position: static;
}

.flow-viz-title {
  margin: 0;
  font-size: 15px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.flow-viz-deck {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  padding-bottom: 4px;
  border-bottom: 1px solid #000;
}

.flow-viz .viz-slide {
  display: none;
}

.flow-viz[data-active="0"] .viz-slide[data-viz-step="0"],
.flow-viz[data-active="1"] .viz-slide[data-viz-step="1"],
.flow-viz[data-active="2"] .viz-slide[data-viz-step="2"] {
  display: block;
}

.viz-slide-title {
  margin: 10px 0 8px;
  font-size: 13px;
  font-weight: 700;
}

.viz-flow {
  display: grid;
  gap: 10px;
}

.viz-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

.viz-row--nodes {
  align-items: center;
}

.viz-row--stack {
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.viz-box {
  flex: 0 0 auto;
  min-width: 64px;
  max-width: 92px;
  padding: 8px 6px;
  border: 1px solid #000;
  font-size: 11px;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: #fff;
}

.viz-box--wide {
  max-width: none;
  width: min(100%, 240px);
  text-transform: none;
  letter-spacing: 0;
  font-size: 11px;
}

.viz-kern {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  text-transform: none;
  letter-spacing: 0;
  font-weight: 400;
}

.viz-vault-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px 10px;
  align-items: start;
}

.viz-vault-span {
  grid-column: 1 / -1;
}

.viz-box--vault-owner {
  max-width: none;
  width: 100%;
  text-align: center;
  padding: 10px 8px;
}

.viz-mini-label {
  margin: 0 0 6px;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.viz-vault-leg .viz-box {
  max-width: none;
  flex: 1 1 0;
  min-width: 0;
}

.viz-box--hot {
  border-width: 2px;
  animation: viz-box-pulse 2.4s steps(2, end) infinite;
}

@keyframes viz-box-pulse {
  0%,
  100% {
    background: #fff;
  }
  50% {
    background: #000;
    color: #fff;
  }
}

.viz-ribbon {
  flex: 1 1 8px;
  min-width: 10px;
  min-height: 10px;
  align-self: center;
}

.viz-ribbon--h {
  height: 1px;
  background: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 7px);
  background-size: 200% 100%;
  animation: viz-h-march 0.75s linear infinite;
}

.viz-ribbon--v {
  width: 1px;
  background: repeating-linear-gradient(180deg, #000 0 3px, transparent 3px 7px);
  background-size: 100% 200%;
  animation: viz-v-march 0.75s linear infinite;
}

.viz-ribbon--short {
  min-height: 14px;
  flex: 0 0 auto;
  align-self: center;
}

@keyframes viz-h-march {
  to {
    background-position: -14px 0;
  }
}

@keyframes viz-v-march {
  to {
    background-position: 0 -14px;
  }
}

.viz-caption {
  margin: 0;
  font-size: 11px;
  line-height: 1.35;
}

.vault-flow-root {
  display: grid;
  gap: 10px;
}

.vault-flow-block {
  display: grid;
  gap: 6px;
}

.vault-flow-h {
  margin: 0;
  font-size: 10px;
  line-height: 1.2;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.vault-flow-lead {
  margin: 0;
  font-size: 11px;
  line-height: 1.4;
}

.vault-flow-lead--form {
  padding-top: 2px;
  border-top: 1px dashed #000;
}

.vault-out-stack {
  display: grid;
  gap: 0;
  border: 1px solid #000;
}

.vault-out-card {
  display: grid;
  gap: 4px;
  padding: 7px 8px 7px 10px;
  border-bottom: 1px solid #000;
  opacity: 0.46;
  transition:
    opacity 0.22s ease,
    border-left-width 0.22s ease,
    padding-left 0.22s ease;
  border-left: 1px solid #000;
}

.vault-out-card:last-of-type {
  border-bottom: 0;
}

.vault-out-card--ready {
  opacity: 1;
  border-left-width: 5px;
  padding-left: 5px;
}

.vault-out-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.vault-out-body {
  font-size: 11px;
  line-height: 1.35;
}

.vault-out-meta {
  font-size: 10px;
  line-height: 1.35;
  padding-top: 2px;
  border-top: 1px dashed #000;
}

.vault-out-ribbon {
  height: 10px;
  margin: 0 10px;
  background: repeating-linear-gradient(90deg, #000 0 3px, transparent 3px 7px);
  background-size: 200% 100%;
  animation: viz-h-march 0.75s linear infinite;
  opacity: 0.55;
}

.vault-flow-root.vault-flow--has-wrap .vault-out-ribbon {
  opacity: 0.85;
}

@media (prefers-reduced-motion: reduce) {
  .viz-ribbon--h,
  .viz-ribbon--v {
    animation: none;
  }

  .viz-box--hot {
    animation: none;
    background: #000;
    color: #fff;
  }

  .vault-out-card {
    transition: none;
  }

  .vault-out-ribbon {
    animation: none;
  }
}

.timeline-stage {
  position: relative;
  padding-top: 0;
  padding-bottom: 8px;
  display: grid;
  gap: 16px;
}

.timeline-hint {
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  min-height: 1.35em;
  position: relative;
  z-index: 1;
  background: #fff;
}

.vault-timeline {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
  max-width: 640px;
  margin-top: 2px;
}

.vault-timeline--no-motion .timeline-step,
.vault-timeline--no-motion .timeline-card,
.vault-timeline--no-motion .timeline-connector {
  transition: none;
}

.timeline-step {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  align-items: stretch;
  padding-bottom: 24px;
  position: relative;
}

.timeline-step:last-child {
  padding-bottom: 0;
}

.timeline-rail {
  display: none;
}

.timeline-node,
.timeline-connector {
  display: none;
}

.timeline-rail--last .timeline-connector {
  display: none;
}

.timeline-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: 18px;
  bottom: 2px;
  height: 20px;
  border-right: 1px solid #000;
  opacity: 0.65;
}

.timeline-node {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid #000;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  background: #fff;
  transition:
    background 0.35s ease,
    color 0.35s ease,
    border-color 0.35s ease;
}

.timeline-connector {
  flex: 1 1 12px;
  width: 0;
  min-height: 28px;
  border-left: 1px dashed #000;
  margin: 6px 0 0;
  opacity: 0.45;
  transition: opacity 0.35s ease;
}

.timeline-step.is-done .timeline-connector {
  border-left-style: solid;
  opacity: 1;
}

.timeline-step.is-done .timeline-node {
  background: #000;
  color: #fff;
}

.timeline-step.is-active .timeline-node {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}

.timeline-step.is-upcoming .timeline-connector {
  opacity: 0.28;
}

.timeline-card {
  transition:
    box-shadow 0.4s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.35s ease,
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.timeline-step.is-active .timeline-card {
  box-shadow:
    0 1px 0 #000,
    0 12px 0 rgba(0, 0, 0, 0.06);
}

.timeline-step.is-done .timeline-card {
  opacity: 0.92;
}

.timeline-step.is-upcoming .timeline-card {
  opacity: 0.88;
}

/* Signed in: register/sign-in stacked above vault; folded strips expand via 01 / 02 toggles. */
.vault-timeline.timeline--signed-in {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.vault-timeline.timeline--signed-in .timeline-step[data-vault-step="0"] {
  order: 1;
}

.vault-timeline.timeline--signed-in .timeline-step[data-vault-step="1"] {
  order: 2;
}

.vault-timeline.timeline--signed-in .timeline-step[data-vault-step="2"] {
  order: 3;
}

.vault-timeline.timeline--signed-in .timeline-step--past.is-done .timeline-card {
  opacity: 1;
}

.vault-timeline.timeline--signed-in .timeline-step--past.is-done:not(.timeline-step--past-open) .timeline-card {
  opacity: 0.94;
}

.vault-timeline.timeline--signed-in .timeline-step {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.vault-timeline.timeline--signed-in .timeline-node {
  width: 28px;
  height: 28px;
  font-size: 11px;
  font-weight: 700;
}

.vault-timeline.timeline--signed-in .timeline-step--past:not(.timeline-step--past-open) .timeline-card.panel {
  gap: 0;
  padding-top: 10px;
  padding-bottom: 30px;
  position: relative;
  overflow: hidden;
}

.vault-timeline .timeline-step.timeline-step--collapsed .timeline-card.panel::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 20px;
  background: repeating-linear-gradient(
    -45deg,
    #000 0px,
    #000 14px,
    transparent 14px,
    transparent 28px
  );
}

.vault-timeline .timeline-step.timeline-step--collapsed .timeline-card.panel {
  gap: 0;
  padding-top: 10px;
  padding-bottom: 30px;
  position: relative;
  overflow: hidden;
  opacity: 0.94;
}

.vault-timeline.timeline--signed-in .timeline-step--past:not(.timeline-step--past-open) .panel-head.timeline-head {
  border-bottom: 0;
  padding-bottom: 0;
  margin-bottom: 0;
}

.vault-timeline.timeline--signed-in .timeline-step--past:not(.timeline-step--past-open) .timeline-card-body {
  max-height: 0;
  margin: 0;
  padding-top: 0;
  padding-bottom: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  border: 0;
  transition:
    max-height 0.32s ease,
    opacity 0.22s ease,
    padding 0.22s ease;
}

.vault-timeline.timeline--signed-in .timeline-step--past.timeline-step--past-open .timeline-card-body {
  max-height: min(140vh, 2400px);
  opacity: 1;
  overflow: visible;
  pointer-events: auto;
  margin-top: 10px;
  padding-top: 2px;
  border-top: 1px solid #000;
  transition:
    max-height 0.32s ease,
    opacity 0.22s ease,
    padding 0.22s ease;
}

.timeline-reveal {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  align-self: flex-start;
  margin: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  min-height: 36px;
  font-size: 11px;
  font-weight: 700;
  text-transform: none;
  letter-spacing: 0.04em;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
}

.timeline-step.is-done .timeline-reveal {
  background: #000;
  color: #fff;
}

.timeline-step.is-active .timeline-reveal {
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #000;
}


.vault-timeline.timeline--signed-in .timeline-step[data-vault-step="2"] #timeline-body-2[hidden] {
  display: none;
}

.timeline-reveal:hover,
.timeline-reveal:focus-visible {
  background: #000;
  color: #fff;
  outline: 2px solid #000;
  outline-offset: 2px;
}

.timeline-card-body {
  display: grid;
  gap: 14px;
}

.timeline-card-body form {
  display: grid;
  gap: 14px;
}

.timeline-card-body form button[type="submit"],
.timeline-card-body .actions {
  margin-top: 6px;
}

.actions:has(> :only-child) {
  grid-template-columns: 1fr;
}

.actions:has(> :nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.vault-panel .actions {
  margin-top: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .vault-timeline.timeline--signed-in .timeline-step--past .timeline-card-body {
    transition: none;
  }
}

.timeline-head {
  align-items: flex-start;
}

.timeline-head .step {
  margin-top: 2px;
}

.timeline-jump {
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  font-size: 16px;
  line-height: 1.2;
  text-align: left;
  cursor: pointer;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0 6px;
  min-height: 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  flex: 1;
  min-width: 0;
}

.timeline-jump:hover:not(:disabled),
.timeline-jump:focus-visible:not(:disabled) {
  background: none;
  color: #000;
}

.timeline-jump:disabled {
  cursor: not-allowed;
  text-decoration: none;
  color: #555;
  opacity: 0.85;
}

.timeline-jump[aria-current="step"] {
  text-decoration: none;
  cursor: pointer;
}

.timeline-jump-title {
  display: inline;
}

.timeline-jump-lock {
  font-weight: 400;
  font-size: 12px;
  text-decoration: none;
  color: #333;
}

.timeline-lede {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
}

.timeline-lede--tight {
  margin-bottom: -4px;
}

.settings-note {
  margin: 0;
  font-size: 12px;
  line-height: 1.35;
  color: #333;
}

.settings-passkeys--locked {
  opacity: 0.88;
}

.settings-passkeys--locked .settings-passkeys-actions button:disabled {
  cursor: not-allowed;
}

.timeline-card.panel {
  min-height: 0;
}

.timeline-card-footer {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid #000;
}

@media (prefers-reduced-motion: reduce) {
  .timeline-card,
  .timeline-node,
  .timeline-connector {
    transition-duration: 0.01ms;
  }
}

.linkish {
  display: inline;
  margin: 0;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  min-height: 0;
}

.linkish:hover,
.linkish:focus-visible {
  background: none;
  color: #000;
}

button.secondary {
  font-weight: 600;
}

button.secondary:hover,
button.secondary:focus-visible {
  background: #fff;
  color: #000;
  outline: 2px solid #000;
  outline-offset: 2px;
}

.panel {
  border: 1px solid #000;
  padding: 16px;
  min-height: 230px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.panel.compact {
  min-height: 0;
}

.panel.wide {
  grid-column: 1 / -1;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid #000;
  padding-bottom: 12px;
}

.step {
  width: 36px;
  height: 36px;
  border: 1px solid #000;
  display: grid;
  place-items: center;
}

label {
  display: grid;
  gap: 6px;
}

input,
textarea,
button {
  border: 1px solid #000;
  border-radius: 0;
  background: #fff;
  color: #000;
  padding: 10px;
  min-height: 42px;
}

.totp-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px;
  gap: 14px;
  align-items: stretch;
}

.qr-frame {
  margin: 0;
  border: 1px solid #000;
  min-height: 180px;
  display: grid;
  grid-template-rows: 1fr auto;
}

#totp-qr {
  min-height: 146px;
  display: grid;
  place-items: center;
  padding: 10px;
}

#totp-qr svg {
  width: 132px;
  height: 132px;
  display: block;
}

figcaption {
  border-top: 1px solid #000;
  padding: 8px;
  font-size: 12px;
  line-height: 1.25;
}

textarea {
  width: 100%;
  resize: vertical;
  word-break: break-all;
}

button {
  cursor: pointer;
  font-weight: 700;
}

button:hover,
button:focus-visible {
  background: #000;
  color: #fff;
}

input:focus-visible,
textarea:focus-visible,
button:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.check-row {
  grid-template-columns: 24px 1fr;
  align-items: center;
}

.check-row input {
  min-height: 0;
  width: 18px;
  height: 18px;
  padding: 0;
}

.actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

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

.kv {
  display: grid;
  gap: 10px;
}

.passkey-list {
  display: grid;
  gap: 8px;
}

.passkey-item {
  border: 1px solid #000;
  padding: 10px;
  display: grid;
  gap: 6px;
}

.flow-list {
  margin: 0;
  padding-left: 24px;
}

.flow-list li {
  margin-bottom: 8px;
}

.flow-list .done {
  font-weight: 700;
  text-decoration: line-through;
}

.flow-list .active {
  font-weight: 700;
  outline: 1px solid #000;
  outline-offset: 3px;
}

.kv div {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  align-items: start;
}

dt {
  font-weight: 700;
}

dd {
  overflow-wrap: anywhere;
}

.code-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.code-list span {
  border: 1px solid #000;
  padding: 8px;
}

.output-panel {
  min-height: 220px;
}

.output-panel--side {
  margin-top: 0;
  min-height: 160px;
}

.flow-column .output {
  max-height: min(420px, 45vh);
}

.output {
  min-height: 120px;
  white-space: pre-wrap;
  overflow: auto;
  overflow-wrap: anywhere;
}

@media (max-width: 880px) {
  .shell {
    width: min(100% - 24px, 1240px);
    padding: 24px 0;
  }

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

  .rail {
    order: 1;
  }

  .flow-column {
    position: static;
    order: 2;
  }

  .timeline-column {
    order: 3;
  }

  .status-board {
    grid-template-columns: repeat(4, 1fr);
    border-left: 0;
    border-top: 1px solid #000;
  }

  .status-cell {
    border-bottom: 0;
  }

  .status-cell {
    border-right: 1px solid #000;
  }

  .status-cell:last-child {
    border-right: 0;
  }

  .status-cell:first-child {
    border-right: 1px solid #000;
  }

  h1 {
    font-size: 32px;
  }

  .actions,
  .code-list,
  .totp-grid,
  .ben-keytype-options {
    grid-template-columns: 1fr;
  }
}

.beneficiary-key-help {
  margin: 0;
  border: 1px solid #000;
}

.beneficiary-key-help-summary {
  padding: 10px 12px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  list-style: none;
}

.beneficiary-key-help-summary::-webkit-details-marker {
  display: none;
}

.beneficiary-key-help[open] .beneficiary-key-help-summary {
  border-bottom: 1px solid #000;
}

.beneficiary-key-help-body {
  margin: 0;
  padding: 12px;
  display: grid;
  gap: 12px;
  font-size: 12px;
  line-height: 1.4;
}

.beneficiary-key-help-body > p {
  margin: 0;
}

.beneficiary-key-help-steps {
  margin: 0;
  padding-left: 1.2rem;
  display: grid;
  gap: 12px;
}

.beneficiary-key-help-steps li {
  margin: 0;
}

.beneficiary-key-help-step-title {
  display: block;
  margin-bottom: 6px;
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.beneficiary-key-help-pre {
  margin: 0;
  padding: 10px;
  border: 1px solid #000;
  overflow: auto;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 11px;
  line-height: 1.35;
}

.beneficiary-key-help-note {
  margin: 8px 0 0;
  font-size: 11px;
  line-height: 1.35;
}

.beneficiary-key-help-summary:focus-visible {
  outline: 2px solid #000;
  outline-offset: 2px;
}

.vault-stack {
  margin-top: 16px;
  display: grid;
  gap: 16px;
}

.vault-panel .vault-panel-title {
  margin: 0 0 8px;
  font-size: 1rem;
}

.beneficiary-list {
  margin: 8px 0 0;
  padding-left: 1.25rem;
  list-style: square;
}

.beneficiary-list-item {
  margin: 4px 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.beneficiary-delete-btn {
  flex: 0 0 auto;
  padding: 2px 8px;
  min-height: 26px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.beneficiary-delete-btn:hover,
.beneficiary-delete-btn:focus-visible {
  background: #000;
  color: #fff;
}

.beneficiary-delete-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* Key-type radio group */
.ben-keytype-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0;
  min-width: 0;
}

.ben-keytype-legend {
  font-weight: 700;
  padding: 0;
  font-size: 0.85rem;
  margin-bottom: 10px;
}

.ben-keytype-options {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.ben-keytype-option {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  padding: 10px 6px;
  min-height: 42px;
  font-weight: 700;
  font-size: inherit;
  text-align: center;
  cursor: pointer;
  user-select: none;
  margin: 0;
  gap: 0;
}

.ben-keytype-option:hover {
  background: #000;
  color: #fff;
}

.ben-keytype-option:has(input:checked) {
  background: #000;
  color: #fff;
}

.ben-keytype-option input[type="radio"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
  margin: 0;
}

.ben-keytype-hint {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  padding: 5px 9px;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: nowrap;
  opacity: 0;
  pointer-events: none;
  z-index: 100;
  transition: opacity 0.12s ease;
}

.ben-keytype-option:hover .ben-keytype-hint {
  opacity: 1;
}

.ben-keytype-panel {
  margin: 4px 0 8px;
}

.ben-keytype-note {
  margin: 4px 0 0;
  font-size: 0.8rem;
  color: #555;
}

/* Read vault / decrypt section */
.decrypt-cred-panel {
  margin: 8px 0;
}

.decrypt-result {
  margin-top: 12px;
  border-top: 1px solid #000;
  padding-top: 10px;
}

.decrypt-result-label {
  font-weight: 700;
  font-size: 0.85rem;
  margin: 0 0 4px;
}

.decrypt-output {
  white-space: pre-wrap;
  word-break: break-word;
  font-family: inherit;
  font-size: 0.9rem;
  margin: 0;
  padding: 8px;
  border: 1px solid #000;
  background: #fff;
  min-height: 60px;
}

/* Passphrase section in Seal vault panel */
.vault-pw-section-label {
  font-weight: 700;
  font-size: 0.9rem;
  margin: 0 0 4px;
}

.vault-pw-list {
  list-style: none;
  padding: 0;
  margin: 8px 0;
}

.vault-pw-item {
  margin: 6px 0;
}

.vault-pw-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
}

.vault-pw-input {
  display: block;
  width: 100%;
  margin-top: 3px;
  font-size: 0.9rem;
}

.heartbeat-strip {
  position: relative;
  border: 1px solid #000;
  border-top: 0;
  padding: 10px 12px 8px;
  margin-bottom: 16px;
}

.heartbeat-strip-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 8px;
}

.heartbeat-strip-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.ping-tooltip {
  position: fixed;
  z-index: 200;
  background: #000;
  color: #fff;
  padding: 7px 10px;
  font-size: 11px;
  line-height: 1.5;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  gap: 1px;
  white-space: nowrap;
}

.ping-tooltip[hidden] {
  display: none;
}

.ping-tooltip-week {
  font-weight: 700;
  font-size: 10px;
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ping-tooltip-count {
  font-size: 13px;
  font-weight: 700;
}

.ping-tooltip-hint {
  font-size: 10px;
  opacity: 0.75;
}

.ping-week-chart {
  display: flex;
  align-items: flex-end;
  justify-content: stretch;
  gap: 4px;
  min-height: 100px;
  padding: 0 0 4px;
}

.ping-week-column {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
  gap: 6px;
}

.ping-week-bar-wrap {
  width: 100%;
  height: 80px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  border-bottom: 1px solid #000;
}

.ping-week-column:hover .ping-week-bar {
  background: #444;
}

.ping-week-column:hover .ping-week-bar--zero {
  background: #999;
}

.ping-week-bar {
  width: 100%;
  min-height: 2px;
  background: #000;
}

.ping-week-bar--zero {
  min-height: 0;
  height: 2px;
  background: #666;
}

.ping-week-label {
  font-size: 10px;
  line-height: 1.2;
  text-align: center;
  word-break: break-all;
}

.ping-week-count {
  font-size: 10px;
  line-height: 1;
}

.ping-week-footnote {
  font-size: 11px;
  line-height: 1.35;
  color: #666;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vault-retention-hint {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #000;
  font-size: 12px;
}

/* Cost card */
.cost-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.cost-refresh-btn {
  flex: 0 0 auto;
  padding: 2px 8px;
  min-height: 28px;
  font-size: 14px;
  font-weight: 400;
  border: 1px solid #000;
  background: #fff;
  color: #000;
  cursor: pointer;
  line-height: 1;
}

.cost-refresh-btn:hover,
.cost-refresh-btn:focus-visible {
  background: #000;
  color: #fff;
}

.cost-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
  line-height: 1.4;
}

.cost-table th {
  text-align: left;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 10px;
  padding: 4px 0 6px;
  border-bottom: 1px solid #000;
}

.cost-table th.cost-col-usd {
  text-align: right;
}

.cost-table td {
  padding: 5px 0;
  border-bottom: 1px solid rgba(0,0,0,0.1);
  vertical-align: top;
}

.cost-table tr:last-child td {
  border-bottom: 0;
}

.cost-col-n {
  text-align: right;
  white-space: nowrap;
  padding-left: 8px;
  color: #555;
}

.cost-col-usd {
  text-align: right;
  white-space: nowrap;
  padding-left: 12px;
  font-variant-numeric: tabular-nums;
}

.cost-loading {
  color: #888;
  font-style: italic;
  text-align: center;
  padding: 8px 0;
}

.cost-table tfoot td {
  padding-top: 7px;
  border-top: 1px solid #000;
  border-bottom: 0;
  font-weight: 700;
}

.cost-total-label {
  text-align: right;
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.04em;
}

.cost-total-val {
  font-size: 13px;
}

/* Threshold preset buttons */
.threshold-options {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.threshold-btn {
  padding: 8px 4px;
  min-height: 36px;
  font-size: 12px;
  font-weight: 700;
}

.threshold-btn--active {
  background: #000;
  color: #fff;
}

.threshold-btn--active:hover,
.threshold-btn--active:focus-visible {
  background: #333;
  color: #fff;
}

.threshold-status {
  margin: 0;
  font-size: 11px;
  color: #555;
  min-height: 1.2em;
}

.timeline-lede code {
  font-size: inherit;
}

code.inline-hint {
  display: inline-block;
  margin-top: 6px;
  padding: 2px 4px;
  border: 1px solid #000;
}

/* ── Details / Collapsible sections ── */
.app-details {
  border: 1px solid #000;
  margin-bottom: 16px;
  background: #fff;
}

.settings-details,
.dev-logs-details {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.settings-details > summary,
.settings-details > .details-body,
.dev-logs-details > summary,
.dev-logs-details > .details-body {
  width: 100%;
  min-width: 0;
}

.settings-details .panel,
.settings-details .threshold-options,
.settings-details .actions {
  min-width: 0;
}

.app-details summary {
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  cursor: pointer;
  user-select: none;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}

.heartbeat-details > summary,
.settings-details > summary,
.dev-logs-details > summary {
  cursor: pointer;
}

.app-details summary::-webkit-details-marker {
  display: none;
}

.app-details summary::after {
  content: "+";
  font-size: 16px;
  line-height: 1;
}

.app-details[open] summary {
  border-bottom: 1px solid #000;
}

.app-details[open] summary::after {
  content: "−";
}

.app-details:not([open]):not(.advanced-actions-details) summary {
  padding-bottom: 30px;
}

.app-details:not([open]):not(.advanced-actions-details) summary::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 18px;
  background: repeating-linear-gradient(
    -45deg,
    #000 0px,
    #000 14px,
    transparent 14px,
    transparent 28px
  );
}

.details-body {
  padding: 16px;
  display: grid;
  gap: 16px;
}

.advanced-actions-details {
  border: 0;
  margin-bottom: 0;
  margin-top: 10px;
}

.advanced-actions-details summary {
  padding: 0;
  font-size: 11px;
  color: #555;
  text-transform: none;
  letter-spacing: normal;
  display: inline-flex;
}

.advanced-actions-details[open] summary {
  border-bottom: 0;
  margin-bottom: 10px;
}

@media (prefers-reduced-motion: reduce) {
  .error-ticker-track {
    animation: none;
    padding-left: 12px;
  }
}
