/* Hallmark · shape: app screen · genre: modern-minimal · theme: Rim (deal 2/3, seed private-tool-sharing-password-protected-eca4·d6eaf57e·2026-12-02·r0) · redesign: full
 * nav: a top bar, the hostname and one quiet action · signature: the handoff slip, link and password in mono with the expiry in UTC · states: default, hover, focus, active, disabled, loading, error, success
 * axes: dark/grotesk-sans/warm · posture: committed · rim: night · contrast: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S3 R5 V4 · weakest: S, a secrets form could be any tool; made the handoff slip with its UTC expiry the one object and dropped the centred card */
/* Hallmark · reworded "Unlock" to "Sign in" and "Lock" to "Sign out" · 19 names the word */
@import url("./tokens.css");
@import url("./base.css");

@font-face {
  font-family: "Switzer";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/switzer-400.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/switzer-500.woff2") format("woff2");
}
@font-face {
  font-family: "Geist Mono";
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/geist-mono-400.woff2") format("woff2");
}

body {
  min-height: 100dvh;
  color: var(--color-ink-2);
}

.shell {
  width: 100%;
  max-width: 70rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* Top bar */
.bar {
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.bar .shell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 56px;
}

.mark {
  margin-right: auto;
  color: var(--color-ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}

.tools {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-width: 0;
}

.tools .measure {
  margin-right: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Page head */
.head {
  padding-block: var(--space-xl) var(--space-lg);
}

.head p {
  margin-top: var(--space-xs);
  color: var(--color-muted);
}

h1,
h2 {
  color: var(--color-ink);
}

h2 {
  letter-spacing: -0.03em;
}

/* Fields */
label,
.label {
  display: block;
  margin-bottom: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
}

.field {
  margin-bottom: var(--space-lg);
}

input[type="text"],
input[type="password"],
select,
textarea {
  display: block;
  width: 100%;
  min-height: 40px;
  padding: var(--space-xs) var(--space-sm);
  color: var(--color-ink);
  background: var(--color-paper);
  border: var(--rule-hair) solid var(--color-muted);
  border-radius: 0;
  transition: background-color var(--dur-short) var(--ease-out);
}

input[type="text"],
input[type="password"],
textarea,
.measure {
  font-family: var(--font-outlier);
  font-variant-numeric: tabular-nums;
}

textarea {
  min-height: 26rem;
  padding: var(--space-md);
  line-height: 1.6;
  resize: vertical;
}

textarea::placeholder {
  color: var(--color-muted);
  font-family: var(--font-body);
}

:is(input, select, textarea):hover {
  background: var(--color-paper-2);
}

:is(input[type="text"], input[type="password"], select, textarea):focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

input[readonly] {
  background: var(--color-paper-3);
}

.check {
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  min-height: 44px;
  margin-bottom: var(--space-md);
  color: var(--color-ink-2);
  font-weight: 400;
}

.check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--color-accent);
}

.row {
  display: flex;
  gap: var(--space-xs);
}

.row input {
  flex: 1;
  min-width: 0;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: var(--space-xs) var(--space-md);
  color: var(--color-ink);
  background: none;
  border: var(--rule-hair) solid var(--color-muted);
  border-radius: 0;
  font-weight: 500;
  white-space: nowrap;
  cursor: pointer;
  transition:
    background-color var(--dur-short) var(--ease-out),
    transform var(--dur-micro) var(--ease-out);
}

.btn:hover {
  background: var(--color-paper-2);
}

.btn:active {
  transform: translateY(1px);
}

.btn--primary {
  width: 100%;
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.btn--primary:hover {
  background: var(--color-focus);
}

.btn--small {
  min-height: 32px;
  padding: var(--space-2xs) var(--space-sm);
  font-size: var(--text-sm);
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.55;
  color: var(--color-ink-2);
  background: var(--color-paper-2);
  border-color: var(--color-rule);
  cursor: not-allowed;
  transform: none;
}

.btn.is-done {
  color: var(--color-success);
  border-color: var(--color-success);
}

.error {
  min-height: 1lh;
  margin-top: var(--space-sm);
  color: var(--color-error);
  font-size: var(--text-sm);
}

/* Sign in and the recipient's gate: one field, 20rem */
.gate {
  max-width: 20rem;
}

/* Compose: the editor, then a rail of settings */
.bench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 24rem;
  gap: var(--space-xl);
  padding-bottom: var(--space-2xl);
}

.rail {
  padding-left: var(--space-xl);
  border-left: var(--rule-hair) solid var(--color-rule);
}

.seg {
  display: flex;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

.seg label {
  margin: 0;
  color: var(--color-muted);
  cursor: pointer;
}

.seg input {
  position: absolute;
  opacity: 0;
}

.seg span {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding-inline: var(--space-md);
  box-shadow: inset 0 0 0 0 var(--color-accent);
  transition: background-color var(--dur-short) var(--ease-out);
}

.seg label:hover span {
  background: var(--color-paper-2);
}

.seg input:checked + span {
  color: var(--color-ink);
  background: var(--color-paper-2);
  box-shadow: inset 0 -2px 0 0 var(--color-accent);
}

.seg input:focus-visible + span {
  outline: 2px solid var(--color-focus);
  outline-offset: -2px;
}

.bench textarea {
  border-top: 0;
}

/* The handoff slip */
.slip {
  position: relative;
  max-width: 44rem;
  margin-block: var(--space-lg) var(--space-2xl);
  padding: var(--space-lg);
  background: var(--color-paper-2);
}

.slip::before,
.slip::after {
  content: "";
  position: absolute;
  width: 12px;
  height: 12px;
  border: 0 solid var(--color-muted);
  pointer-events: none;
}

.slip::before {
  top: calc(-1 * var(--space-xs));
  left: calc(-1 * var(--space-xs));
  border-width: 1px 0 0 1px;
}

.slip::after {
  right: calc(-1 * var(--space-xs));
  bottom: calc(-1 * var(--space-xs));
  border-width: 0 1px 1px 0;
}

.slip h2 {
  margin-bottom: var(--space-lg);
}

.slip .field:last-of-type {
  margin-bottom: var(--space-md);
}

.slip .measure {
  display: block;
  color: var(--color-ink);
  font-size: var(--text-xl);
  letter-spacing: -0.03em;
}

.slip .note {
  margin-bottom: var(--space-lg);
}

.slip .btn {
  width: auto;
}

/* The admin's list of active shares */
.ledger {
  padding-block: var(--space-lg) var(--space-2xl);
  border-top: var(--rule-hair) solid var(--color-rule);
}

.ledger__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.note {
  min-height: 1lh;
  color: var(--color-muted);
  font-size: var(--text-sm);
}

.help {
  margin-top: var(--space-xs);
  color: var(--color-muted);
  font-size: var(--text-sm);
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--color-muted);
  font-size: var(--text-sm);
  font-weight: 500;
  white-space: nowrap;
  border-bottom: var(--rule-hair) solid var(--color-rule);
}

td {
  color: var(--color-ink);
  border-bottom: var(--rule-hair) solid var(--color-rule-2);
  overflow-wrap: anywhere;
}

td.measure {
  font-size: var(--text-sm);
  white-space: nowrap;
}

td.is-muted {
  color: var(--color-muted);
}

td.actions {
  padding-right: 0;
  text-align: right;
  white-space: nowrap;
}

td.actions .btn + .btn {
  margin-left: var(--space-xs);
}

.btn.is-danger {
  color: var(--color-error);
  border-color: var(--color-error);
}

/* The recipient's view, after decryption */
body.viewing {
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.viewer pre {
  flex: 1;
  margin: 0;
  padding: var(--space-lg) var(--gutter);
  overflow: auto;
  color: var(--color-ink);
  font-family: var(--font-outlier);
  font-size: var(--text-sm);
  line-height: 1.6;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.viewer iframe {
  flex: 1;
  width: 100%;
  border: 0;
  background: var(--color-paper);
}

.viewer iframe.is-html {
  background: var(--color-sheet);
}

@media (max-width: 60rem) {
  .bench {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-lg);
  }

  .rail {
    padding-left: 0;
    border-left: 0;
  }

  textarea {
    min-height: 16rem;
  }

  .tools .measure {
    display: none;
  }

  /* Each share restacks as a labelled block. */
  table,
  tbody,
  tr,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
  }

  tr {
    padding-block: var(--space-md);
    border-bottom: var(--rule-hair) solid var(--color-rule);
  }

  td {
    display: flex;
    justify-content: space-between;
    gap: var(--space-md);
    padding: var(--space-2xs) 0;
    border-bottom: 0;
  }

  td[data-label]::before {
    content: attr(data-label);
    flex: none;
    color: var(--color-muted);
    font-family: var(--font-body);
    font-size: var(--text-sm);
  }

  td.measure {
    white-space: normal;
    text-align: right;
  }

  td.actions {
    justify-content: flex-start;
    padding-top: var(--space-sm);
  }

  td.actions .btn {
    min-height: 44px;
  }

  td.actions .btn + .btn {
    margin-left: 0;
  }
}

.ledger .note:empty {
  display: none;
}
