* {
  box-sizing: border-box;
}
body {
  margin: 0;
  padding: 0 24px;
  font-size: 18px;
}
header,
main,
footer {
  max-width: var(--suite-content-width);
  margin-inline: auto;
}
main {
  max-width: var(--suite-content-width);
  padding: 32px 0 36px;
  min-height: calc(100svh - 155px);
}
h1 {
  font-size: clamp(32px, 6vw, 42px);
  font-weight: 400;
  letter-spacing: -.7px;
  line-height: 1.12;
  margin: 0 0 12px;
}
h2 {
  font-size: 26px;
  font-weight: 400;
  margin: 0 0 10px;
}
p {
  margin: 0 0 20px;
}
.lede {
  font-size: 23px;
  line-height: 1.4;
  color: var(--ink-2);
  max-width: 540px;
}
.choices {
  display: grid;
  gap: 0;
  margin-top: 24px;
  border-top: 1px solid var(--veil-2);
}
.choice {
  text-align: left;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 4px;
  border: 0;
  border-bottom: 1px solid var(--veil-2);
  border-radius: 0;
  color: var(--ink);
  background: transparent;
  font: inherit;
  cursor: pointer;
}
.choice:hover {
  background: var(--veil-1);
}
.choice strong {
  display: block;
  font-size: 22px;
  font-weight: 400;
}
.choice small {
  display: block;
  font-size: 17px;
  color: var(--ink-2);
  margin-top: 3px;
}
.panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--bg-surface);
  margin: 24px 0;
}
.panel p:last-child {
  margin-bottom: 0;
}
.hint {
  font-size: 17px;
  color: var(--ink-2);
  line-height: 1.5;
}
.small {
  font-size: 15px;
  color: var(--ink-3);
}
label {
  display: block;
  margin: 16px 0 8px;
  font-weight: 400;
}
textarea,
input {
  width: 100%;
  padding: 14px;
  color: var(--ink);
  background: var(--veil-1);
  border: 1px solid var(--veil-3);
  border-radius: 12px;
  font: 16px/1.5 var(--font-mono);
  resize: vertical;
  min-width: 0;
}
textarea {
  min-height: 120px;
}
textarea[readonly] {
  cursor: text;
}
.secret-input.masked {
  -webkit-text-security: disc;
}
.actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin: 16px 0;
}
.actions > * {
  flex: 1;
}
.btn {
  min-height: 56px;
  background: transparent;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--veil-3);
}
.btn:hover { background: var(--veil-2); }
.text-button {
  border: 0;
  background: none;
  color: var(--ink-2);
  font: inherit;
  font-size: 16px;
  text-decoration: underline;
  text-underline-offset: 4px;
  cursor: pointer;
  padding: 12px 0;
}
.timer {
  font: 13px var(--font-mono);
  color: var(--accent);
  display: inline-block;
}
.status-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.code {
  font: 17px var(--font-mono);
  letter-spacing: 1px;
  display: block;
  margin: 8px 0 12px;
  color: var(--ink);
}
details {
  border-top: 1px solid var(--veil-2);
  margin-top: 20px;
  padding-top: 8px;
}
summary {
  cursor: pointer;
  font-size: 16px;
  color: var(--ink-2);
  padding: 10px 0;
  min-height: 44px;
}
details p {
  font-size: 17px;
  color: var(--ink-2);
  margin: 14px 0;
}
.full {
  width: 100%;
}
#notice,
#error {
  padding: 14px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  font-size: 18px;
}
#error {
  margin-bottom: 22px;
  border-color: var(--danger);
  color: var(--danger);
}
#notice {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: min(520px, calc(100vw - 32px));
  margin: 0;
  z-index: 100;
  color: var(--ink);
  background: var(--ground-1);
  box-shadow: 0 4px 20px rgb(0 0 0 / 0.25);
  pointer-events: none;
}
footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 12px;
  padding: 22px 0 30px;
  border-top: 1px solid var(--line);
  font-size: 15px;
  color: var(--ink-3);
}
[hidden] {
  display: none !important;
}
.security h2 {
  margin-top: 32px;
}
.security p,
.security li {
  color: var(--ink-2);
}
.reveal {
  min-height: 140px;
}
.checkline {
  display: flex;
  align-items: start;
  gap: 10px;
  font-size: 17px;
  color: var(--ink-2);
  margin-top: 16px;
}
.checkline input {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 4px;
}
.quiet {
  margin-top: 26px;
}
a,
button {
  touch-action: manipulation;
}
@media (max-width: 500px) {
  body {
    padding: 0 16px;
  }
  main {
    padding-top: 32px;
  }
  .panel {
    padding: 18px;
  }
  .choice {
    padding: 16px 4px;
  }
  .status-row {
    align-items: start;
  }
  .code {
    font-size: 15px;
  }
  .lede {
    font-size: 21px;
  }
}
.share-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 156px;
  gap: 20px;
  align-items: center;
  margin: 16px 0;
}
.share-layout label {
  margin-top: 0;
}
.qr {
  background: white;
  padding: 10px;
  border-radius: 12px;
  max-width: 100%;
  line-height: 0;
}
.qr svg {
  display: block;
  width: 100%;
  height: auto;
}
.reply-qr {
  width: 260px;
  max-width: 100%;
  margin: 20px auto;
}
dialog {
  max-width: min(540px, calc(100% - 32px));
  color: var(--ink);
  background: var(--ground-1);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  font: inherit;
}
dialog::backdrop {
  background: #000b;
}
dialog video {
  width: 100%;
  max-height: 45svh;
  border-radius: 10px;
  background: #000;
}
dialog .scan-status {
  font-size: 17px;
  margin: 12px 0;
}
@media (max-width: 500px) {
  .share-layout {
    grid-template-columns: minmax(0, 1fr) 136px;
    gap: 16px;
  }
  .share-layout > .qr {
    width: 136px;
    margin: 0;
  }
  .reply-qr {
    width: 260px;
  }
}

.home-title {
  text-align: center;
}

/* Optional pasted-link entry stays out of the first-time path. */
details > input {
  margin-top: 14px;
}
.share-layout > div {
  min-width: 0;
}
.share-layout .actions {
  margin-bottom: 0;
}

#saved-links {
  margin-top: 32px;
}
#saved-links h2 {
  font-size: 18px;
  color: var(--ink-2);
}
.saved-record {
  display: block;
  width: 100%;
  text-align: left;
  padding: 14px 0;
  border: 0;
  border-bottom: 1px solid var(--veil-2);
  background: none;
  color: var(--ink);
  font: inherit;
  cursor: pointer;
}
.saved-record small {
  display: block;
  color: var(--ink-2);
  font-size: 15px;
  margin-top: 4px;
}

/* A two-step handoff, with secondary controls kept quiet. */
.step-title { font-size: 21px; margin: 0 0 12px; }
.step-title span { color: var(--accent); font-size: 16px; margin-right: 8px; font-style: italic; }
.receive-step { margin-top: 24px; }
.reply-section { padding-top: 20px; border-top: 1px solid var(--veil-2); }
.saved-note { line-height: 1.65; margin-bottom: 0; }
.expiry-note { text-align: center; margin: 10px 0 0; }
.draft-note { margin-bottom: 16px; }
.clear-note { margin: 20px 0 8px; }
#byte-count { font-size: 13px; }
#reply, #encrypted { min-height: 88px; }
.actions .suite-primary { padding-inline: 14px; }
input[readonly], textarea[readonly] { -webkit-user-select: all; user-select: all; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
button { -webkit-tap-highlight-color: transparent; transition: background-color .15s, opacity .15s, transform .15s; }
button:active:not(:disabled) { transform: scale(.985); }
button[aria-busy="true"] { cursor: progress; }

/* A result seals or opens once. The secret itself remains masked until asked. */
.seal { display: block; width: 36px; height: 42px; margin-bottom: 16px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.seal-body { fill: var(--veil-1); }
.seal-shackle { transform-origin: 14px 25px; }
.seal-code { stroke-width: 3; }
.seal.sealed .seal-shackle { animation: seal-close .5s ease-out both; }
.seal.sealed .seal-clear { animation: seal-hide .4s ease-out both; }
.seal.sealed .seal-code { animation: seal-show .4s .1s ease-out both; }
.seal.opened .seal-shackle { transform: rotate(-28deg); animation: seal-open .5s ease-out both; }
.seal.opened .seal-code { animation: seal-hide .4s ease-out both; }
.seal.opened .seal-clear { animation: seal-show .4s .1s ease-out both; }
@keyframes seal-close { from { transform: translateY(-7px); } to { transform: translateY(0); } }
@keyframes seal-open { from { transform: rotate(0); } to { transform: rotate(-28deg); } }
@keyframes seal-hide { from { opacity: 1; } to { opacity: 0; } }
@keyframes seal-show { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .seal * { animation: none !important; }
  .seal.sealed .seal-clear, .seal.opened .seal-code { opacity: 0; }
}
