/* jxlab 工具箱
   Motif: the security tint printed inside envelopes so nobody can read through them.
   It marks every place where content exists only as ciphertext. */

:root {
  --paper: #EEF1F5;
  --surface: #FFFFFF;
  --ink: #141A26;
  --ink-2: #566074;
  --ink-3: #8A93A5;
  --line: rgba(20, 26, 38, 0.10);
  --line-2: rgba(20, 26, 38, 0.16);
  --tint: #3B5BA5;
  --tint-a: rgba(59, 91, 165, 0.16);
  --tint-b: rgba(59, 91, 165, 0.09);
  --tint-bg: #E4E9F3;
  --seal: #1F3A8A;
  --seal-hover: #183078;
  --seal-ink: #FFFFFF;
  --ok: #1A7F55;
  --warn: #A9561B;
  --danger: #B9372C;
  --focus: #2E5BFF;
  --material: rgba(238, 241, 245, 0.72);
  --material-edge: rgba(255, 255, 255, 0.6);
  --shadow-sheet: 0 24px 64px rgba(20, 26, 38, 0.18), 0 2px 8px rgba(20, 26, 38, 0.08);

  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Hiragino Sans GB", "Microsoft YaHei UI", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --r-s: 8px;
  --r-m: 12px;
  --r-l: 18px;
  --gutter: clamp(16px, 4vw, 40px);
  --bar-h: 60px;
  --dock-h: 0px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0F131A;
    --surface: #171C26;
    --ink: #E8ECF3;
    --ink-2: #A0A9BB;
    --ink-3: #6F788A;
    --line: rgba(232, 236, 243, 0.10);
    --line-2: rgba(232, 236, 243, 0.16);
    --tint: #8FA8E8;
    --tint-a: rgba(143, 168, 232, 0.16);
    --tint-b: rgba(143, 168, 232, 0.08);
    --tint-bg: #141B29;
    --seal: #4A6FE3;
    --seal-hover: #5B7DEA;
    --ok: #47C48D;
    --warn: #E3955A;
    --danger: #F0705F;
    --focus: #7EA0FF;
    --material: rgba(15, 19, 26, 0.72);
    --material-edge: rgba(255, 255, 255, 0.06);
    --shadow-sheet: 0 24px 64px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.3);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--paper);
  color: var(--ink);
  font: 400 1rem/1.6 var(--sans);
  letter-spacing: 0.01em;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

html.has-sheet { overflow: hidden; }

button, input, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-radius: 6px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  padding: 8px 12px;
  background: var(--surface);
  border-radius: var(--r-s);
  z-index: 100;
}
.skip:focus { top: 12px; }

/* The security tint: two diagonal line fields at different pitches, which moirés the
   way the printed pattern does. */
.tint {
  background-color: var(--tint-bg);
  background-image:
    repeating-linear-gradient(45deg, var(--tint-a) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, var(--tint-b) 0 1px, transparent 1px 4px);
}

/* ---------- bar ---------- */

.bar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 -1px 0 var(--line);
}

.bar__inner {
  max-width: 1080px;
  margin: 0 auto;
  height: var(--bar-h);
  padding: 0 var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.01em;
  flex: none;
}

.brand__mark { display: block; width: 26px; height: 26px; }

.tabs {
  display: flex;
  gap: 4px;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
}

.tabs__item {
  padding: 5px 14px;
  border-radius: 999px;
  color: var(--ink-2);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 500;
  transition: background-color 160ms ease, color 160ms ease;
}
.tabs__item:hover { color: var(--ink); }
.tabs__item[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 1px 2px rgba(20, 26, 38, 0.10), 0 0 0 0.5px var(--line);
}

.bar .bar__code { margin-left: auto; height: 36px; padding: 0 16px; }
.bar .bar__code[aria-current="page"] { background: var(--surface); box-shadow: 0 0 0 1px var(--line-2); }

/* ---------- dock (phones) ---------- */

.dock {
  display: none;
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 6px 12px calc(6px + env(safe-area-inset-bottom));
  background: var(--material);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: inset 0 1px 0 var(--line);
  justify-content: space-around;
}

.dock__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 0;
  color: var(--ink-3);
  text-decoration: none;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}
.dock__item svg {
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.dock__item[aria-current="page"] { color: var(--seal); }
@media (prefers-color-scheme: dark) { .dock__item[aria-current="page"] { color: var(--tint); } }

/* ---------- layout ---------- */

.main {
  max-width: 1080px;
  margin: 0 auto;
  padding: 40px var(--gutter) calc(64px + var(--dock-h));
  outline: none;
}

.page-head { margin-bottom: 24px; max-width: 40em; }

.page-title {
  margin: 0;
  font-size: clamp(1.75rem, 3.2vw, 2.25rem);
  line-height: 1.1;
  letter-spacing: -0.025em;
  font-weight: 700;
}

.page-lede {
  margin: 8px 0 0;
  color: var(--ink-2);
  font-size: 1.0625rem;
  line-height: 1.55;
}

/* ---------- controls ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.9375rem;
  text-decoration: none;
  white-space: nowrap;
  transition: background-color 140ms ease, transform 100ms ease-out, opacity 140ms ease;
  touch-action: manipulation;
}
.btn:active:not(:disabled) { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn[data-busy] { opacity: 0.75; cursor: progress; }

.btn--primary { background: var(--seal); color: var(--seal-ink); }
.btn--primary:hover:not(:disabled) { background: var(--seal-hover); }

.btn--quiet { background: var(--line); color: var(--ink); }
.btn--quiet:hover:not(:disabled) { background: var(--line-2); }
.btn[data-done] { color: var(--ok); }

.link-btn {
  border: 0;
  background: none;
  padding: 6px 2px;
  color: var(--seal);
  font-weight: 500;
  font-size: 0.9375rem;
}
@media (prefers-color-scheme: dark) { .link-btn { color: var(--tint); } }
.link-btn:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-btn--danger, .link-btn--danger:hover { color: var(--danger); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
}
.icon-btn:hover { background: var(--line); color: var(--ink); }

.input {
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: var(--surface);
  min-width: 0;
  transition: border-color 140ms ease, box-shadow 140ms ease;
}
.input::placeholder { color: var(--ink-3); }
.input:focus { outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px color-mix(in srgb, var(--focus) 22%, transparent); }

.field-row { display: flex; gap: 8px; }
.field-row .input { flex: 1; }

.seg {
  position: relative;
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--line);
  isolation: isolate;
}
.seg__thumb {
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 0;
  border-radius: 999px;
  background: var(--surface);
  box-shadow: 0 1px 2px rgba(20, 26, 38, 0.12), 0 0 0 0.5px var(--line);
  transition: transform 320ms cubic-bezier(0.2, 0.8, 0.2, 1), width 320ms cubic-bezier(0.2, 0.8, 0.2, 1);
  z-index: -1;
}
.seg__opt {
  border: 0;
  background: none;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--ink-2);
  white-space: nowrap;
}
.seg__opt[aria-checked="true"] { color: var(--ink); }

.switch {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.9375rem;
  color: var(--ink);
  cursor: pointer;
  user-select: none;
}
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  position: relative;
  width: 40px;
  height: 24px;
  border-radius: 999px;
  background: var(--line-2);
  transition: background-color 200ms ease;
  flex: none;
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.switch input:checked + .switch__track { background: var(--seal); }
.switch input:checked + .switch__track::after { transform: translateX(16px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--focus); outline-offset: 2px; }

/* ---------- editor + cipher ---------- */

.editor {
  display: grid;
  grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
  min-height: 360px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(20, 26, 38, 0.04);
  overflow: hidden;
}

.editor__main { display: flex; flex-direction: column; min-width: 0; }

.editor__input {
  flex: 1;
  width: 100%;
  min-height: 300px;
  padding: 22px 24px;
  border: 0;
  resize: none;
  background: transparent;
  font-size: 1.0625rem;
  line-height: 1.65;
  outline: none;
}
.editor__input::placeholder { color: var(--ink-3); }

.editor__foot {
  display: flex;
  justify-content: space-between;
  padding: 10px 24px 14px;
  color: var(--ink-3);
  font-size: 0.8125rem;
}

.cipher {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 18px 20px;
  border-left: 1px solid var(--line);
  color: var(--tint);
  overflow: hidden;
  background-color: var(--tint-bg);
  background-image:
    repeating-linear-gradient(45deg, var(--tint-a) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, var(--tint-b) 0 1px, transparent 1px 4px);
}

.cipher__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.cipher__label {
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink-2);
  padding: 2px 8px;
  margin-left: -8px;
  border-radius: 6px;
  background: var(--tint-bg);
}
.cipher__meta {
  font-size: 0.8125rem;
  color: var(--ink-2);
  font-variant-numeric: tabular-nums;
  background: var(--tint-bg);
  padding: 2px 6px;
  border-radius: 6px;
}

.cipher__text {
  flex: 1;
  font: 500 0.8125rem/1.55 var(--mono);
  word-break: break-all;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 70%, transparent);
  mask-image: linear-gradient(to bottom, #000 70%, transparent);
}

.cipher__empty {
  margin: auto 0;
  max-width: 18em;
  color: var(--ink-2);
  font-size: 0.9375rem;
  background: var(--tint-bg);
  padding: 4px 0;
  box-shadow: 0 0 0 6px var(--tint-bg);
  border-radius: 2px;
}

.cipher--strip {
  margin-top: 16px;
  height: 132px;
  border: 0;
  border-radius: var(--r-l);
  box-shadow: 0 0 0 1px var(--line);
}
.cipher--strip .cipher__empty { margin: 0; }

/* ---------- actions & options ---------- */

.actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.actions--end { justify-content: flex-end; }

.opts { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; }
.opt { display: flex; align-items: center; gap: 10px; }
.opt__label { font-size: 0.9375rem; color: var(--ink-2); }
.pw { display: flex; align-items: center; }
.input--pw { width: 160px; height: 36px; }

.kbd-hint { color: var(--ink-3); }

/* ---------- notes ---------- */

.notes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px 40px;
  margin-top: 64px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
}
.note__title { margin: 0 0 6px; font-size: 0.9375rem; font-weight: 600; letter-spacing: 0; }
.note__text { margin: 0; color: var(--ink-2); font-size: 0.875rem; line-height: 1.65; }

/* ---------- files ---------- */

.drop {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 36px 32px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  border: 1.5px dashed transparent;
  transition: background-color 160ms ease, border-color 160ms ease;
}
.drop .btn { margin-top: 16px; }
.drop__title { margin: 0; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.drop__sub { margin: 0; color: var(--ink-2); }
.drop.is-over {
  border-color: var(--tint);
  background-color: var(--tint-bg);
  background-image:
    repeating-linear-gradient(45deg, var(--tint-a) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, var(--tint-b) 0 1px, transparent 1px 4px);
}
.drop--compact { flex-direction: row; align-items: center; flex-wrap: wrap; padding: 18px 24px; gap: 4px 16px; }
.drop--compact .drop__title { font-size: 1rem; }
.drop--compact .drop__sub { flex: 1; }
.drop--compact .btn { margin-top: 0; }

.files {
  list-style: none;
  margin: 16px 0 0;
  padding: 0;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  overflow: hidden;
}
.files:empty { display: none; }

.file {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 12px 12px 20px;
  min-height: 56px;
}
.file + .file { box-shadow: inset 0 1px 0 var(--line); }
.file__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.file__size { color: var(--ink-2); font-size: 0.875rem; font-variant-numeric: tabular-nums; flex: none; }
.file .btn { height: 36px; padding: 0 16px; }
.file__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: left;
}
.files__total { margin: 10px 4px 0; color: var(--ink-2); font-size: 0.875rem; }
.files__total:empty { display: none; }

.progress { margin-top: 20px; }
.progress::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}
.progress__bar {
  height: 4px;
  margin-top: -4px;
  border-radius: 999px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 300ms ease-out;
}
.progress__text { margin: 8px 0 0; font-size: 0.875rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* ---------- home ---------- */

.hero { padding: clamp(24px, 6vw, 72px) 0 clamp(28px, 4vw, 44px); max-width: 52em; }

.hero__title {
  margin: 0;
  font-size: clamp(2.75rem, 8.4vw, 6.25rem);
  line-height: 1.02;
  letter-spacing: -0.045em;
  font-weight: 800;
}

.hero__lede {
  margin: 20px 0 0;
  max-width: 30em;
  color: var(--ink-2);
  font-size: clamp(1.0625rem, 1.6vw, 1.25rem);
  line-height: 1.6;
}

.hero__cta { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 32px; }
.btn--lg { height: 50px; padding: 0 26px; font-size: 1rem; }

.hero__band {
  margin: 0 calc(-1 * var(--gutter));
  min-height: 280px;
}

.lens {
  position: relative;
  margin: 0;
  height: 280px;
  overflow: hidden;
  border-radius: 0;
  box-shadow: inset 0 1px 0 var(--line), inset 0 -1px 0 var(--line);
  background-color: var(--tint-bg);
  background-image:
    repeating-linear-gradient(45deg, var(--tint-a) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, var(--tint-b) 0 1px, transparent 1px 4px);
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
}

.lens__cipher {
  position: absolute;
  inset: 0;
  padding: 18px var(--gutter);
  font: 500 0.9375rem/1.7 var(--mono);
  color: var(--tint);
  word-break: break-all;
  opacity: 0.9;
}

/* The window clips a copy of the plaintext that is shifted the opposite way, so
   moving it is two transforms and nothing repaints. */
.lens__frame {
  position: absolute;
  left: 0;
  top: 0;
  width: 236px;
  height: 92px;
  overflow: hidden;
  border-radius: 14px;
  box-shadow:
    0 0 0 1px var(--line-2),
    0 10px 30px rgba(20, 26, 38, 0.16);
  touch-action: none;
  cursor: grab;
  will-change: transform;
  transform: translate3d(-999px, -999px, 0);
}
.lens__frame:active { cursor: grabbing; }

.lens__plain {
  position: absolute;
  left: 0;
  top: 0;
  padding: 14px var(--gutter);
  background: var(--surface);
  color: var(--ink);
  font-size: 1.75rem;
  line-height: 1.55;
  font-weight: 600;
  letter-spacing: -0.01em;
  will-change: transform;
  pointer-events: none;
}

.lens__caption { margin: 12px 0 0; color: var(--ink-3); font-size: 0.875rem; }

/* ---------- clipboard room ---------- */

.room { max-width: 820px; border-radius: var(--r-l); }
.room.is-over { outline: 2px dashed var(--tint); outline-offset: 8px; }

.status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.status__left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.status__right { display: flex; align-items: center; gap: 12px; flex: none; }
.status__text { font-weight: 500; }
.status__dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--ink-3);
  flex: none;
  transition: background-color 200ms ease, box-shadow 200ms ease;
}
.status__dot[data-state="on"] { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 18%, transparent); }
.status__dot[data-state="away"] { background: var(--warn); }

.btn--sm { height: 34px; padding: 0 14px; font-size: 0.875rem; }

.pairbox { margin-bottom: 20px; }
.pairbox .code { height: 112px; }
.pairbox .code__digits { font-size: 3.25rem; }

.timeline { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 14px; }
.timeline:empty { display: none; }
.timeline__empty { margin: 8px 0 20px; color: var(--ink-3); }

.msg { display: flex; flex-direction: column; align-items: flex-start; max-width: 86%; }
.msg--mine { align-self: flex-end; align-items: flex-end; }
.msg__bubble {
  max-width: 100%;
  padding: 12px 16px;
  border-radius: 16px 16px 16px 6px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.msg--mine .msg__bubble {
  border-radius: 16px 16px 6px 16px;
  background: color-mix(in srgb, var(--seal) 9%, var(--surface));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--seal) 18%, transparent);
}
.msg__text { white-space: pre-wrap; word-break: break-word; font-size: 1.0625rem; line-height: 1.6; max-height: 50vh; overflow: auto; }
.msg__foot { display: flex; align-items: center; gap: 12px; margin-top: 4px; padding: 0 4px; }
.msg__time { color: var(--ink-3); font-size: 0.8125rem; }
.msg__foot .link-btn { font-size: 0.875rem; padding: 2px; }
.msg__img { display: block; max-width: 100%; max-height: 320px; border-radius: 10px; margin-bottom: 8px; }
.msg--pending { opacity: 0.85; min-width: min(320px, 80%); }
.msg--pending .msg__bubble { width: 100%; }
.msg--pending .progress { margin-top: 0; }

.files--inline { margin: 0; box-shadow: none; background: transparent; border-radius: 0; min-width: min(360px, 70vw); }
.files--inline .file { padding: 8px 0; min-height: 0; gap: 12px; }
.files--inline .file + .file { box-shadow: inset 0 1px 0 var(--line); }

.composer { position: sticky; bottom: calc(12px + var(--dock-h)); margin-top: 24px; z-index: 5; }
.composer__box {
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-2), 0 8px 28px rgba(20, 26, 38, 0.08);
  transition: box-shadow 140ms ease;
}
.composer__box:focus-within { box-shadow: 0 0 0 1.5px var(--focus), 0 8px 28px rgba(20, 26, 38, 0.10); }
.composer__input {
  display: block;
  width: 100%;
  min-height: 84px;
  max-height: 40vh;
  padding: 16px 18px 6px;
  border: 0;
  resize: vertical;
  background: transparent;
  font-size: 1.0625rem;
  line-height: 1.6;
  outline: none;
}
.composer__input::placeholder { color: var(--ink-3); }
.composer__bar { display: flex; align-items: center; gap: 12px; padding: 6px 10px 10px; }
.composer__bar .kbd-hint { margin-left: auto; font-size: 0.8125rem; }
.composer__bar .btn { height: 38px; padding: 0 20px; }
.icon { display: inline-grid; place-items: center; }

.cipher--line {
  margin-top: 8px;
  height: 58px;
  padding: 10px 16px;
  border: 0;
  border-radius: var(--r-m);
  box-shadow: 0 0 0 1px var(--line);
  flex-direction: row;
  align-items: center;
  gap: 12px;
}
.cipher--line .cipher__head { margin: 0; flex: none; }
.cipher--line .cipher__meta { display: none; }
.cipher--line .cipher__text { white-space: nowrap; text-overflow: clip; -webkit-mask-image: linear-gradient(to right, #000 80%, transparent); mask-image: linear-gradient(to right, #000 80%, transparent); }
.cipher--line .cipher__empty { margin: 0; font-size: 0.875rem; box-shadow: none; }

/* ---------- pickup code page ---------- */

.codepage { max-width: 560px; }

.otp { position: relative; display: block; cursor: text; }
.otp__cells { display: flex; align-items: center; gap: 10px; }
.otp__cell {
  display: grid;
  place-items: center;
  flex: 1;
  max-width: 76px;
  aspect-ratio: 4 / 5;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line-2);
  font-size: clamp(1.75rem, 6vw, 2.5rem);
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  transition: box-shadow 140ms ease, transform 100ms ease-out;
}
.otp__cell[data-state="filled"] { box-shadow: 0 0 0 1px var(--ink-3); }
.otp__cell[data-state="caret"] { box-shadow: 0 0 0 2px var(--focus); }
.otp__cell[data-state="caret"]::after {
  content: "";
  width: 2px;
  height: 40%;
  border-radius: 1px;
  background: var(--focus);
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.otp__dash { color: var(--ink-3); font-size: 1.75rem; font-weight: 500; padding: 0 2px; }
.otp__input {
  position: absolute;
  inset: 0;
  width: 100%;
  opacity: 0;
  border: 0;
  font-size: 16px;
  caret-color: transparent;
}
.otp[data-state="busy"] .otp__cell { opacity: 0.6; }
.otp[data-state="error"] .otp__cell { box-shadow: 0 0 0 1.5px var(--danger); }
.otp[data-state="error"] .otp__cells { animation: shake 320ms cubic-bezier(0.36, 0.07, 0.19, 0.97); }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }
.otp__msg { margin: 16px 0 0; min-height: 1.6em; color: var(--ink-2); }
.otp__msg[data-kind="error"] { color: var(--danger); }

/* ---------- open ---------- */

.open { max-width: 760px; }

.gate, .unlock, .empty {
  padding: 32px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.gate__title { margin: 0 0 6px; font-size: 1.25rem; font-weight: 600; letter-spacing: -0.01em; }
.gate__text, .unlock__text, .empty__text { margin: 0 0 20px; color: var(--ink-2); max-width: 36em; }
.empty__text { color: var(--ink); }
.form-error { margin: 10px 0 0; color: var(--danger); font-size: 0.9375rem; }
.form-error:empty { display: none; }

.reader {
  margin: 0;
  padding: 22px 24px;
  min-height: 200px;
  max-height: 60vh;
  overflow: auto;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  font: inherit;
  font-size: 1.0625rem;
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
}
.open__facts { margin: 0; color: var(--ink-2); font-size: 0.875rem; margin-right: auto; }
.preview {
  display: block;
  max-width: 100%;
  max-height: 56vh;
  margin-bottom: 16px;
  border-radius: var(--r-l);
  box-shadow: 0 0 0 1px var(--line);
}

/* ---------- video ---------- */

.video-form { max-width: 760px; }
.input--url { height: 52px; font-size: 1.0625rem; padding: 0 18px; border-radius: 999px; }
.video-form .btn { height: 52px; padding: 0 24px; }

.video-out { margin-top: 24px; max-width: 760px; }

.vcard {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 16px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
}
.vcard__thumb {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: var(--r-m);
  background: var(--line);
}
.vcard__body { min-width: 0; padding: 4px 4px 4px 0; }
.vcard__title {
  margin: 0;
  font-size: 1.125rem;
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.vcard__meta { margin: 4px 0 16px; color: var(--ink-2); font-size: 0.875rem; }
.vcard .actions { margin-top: 16px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--r-m);
  background: transparent;
  text-align: left;
  transition: border-color 140ms ease, background-color 140ms ease;
}
.chip:hover { border-color: var(--ink-3); }
.chip[aria-checked="true"] { border-color: var(--seal); background: color-mix(in srgb, var(--seal) 8%, transparent); box-shadow: inset 0 0 0 1px var(--seal); }
.chip__label { font-weight: 600; font-size: 0.9375rem; }
.chip__size { color: var(--ink-2); font-size: 0.75rem; font-variant-numeric: tabular-nums; }

.job { margin-top: 12px; }
.job .progress { margin-top: 0; }
.job .link-btn { margin-top: 4px; }
.job__done { margin: 0; color: var(--ok); }

.skeleton {
  height: 168px;
  border-radius: var(--r-l);
  background: var(--surface);
  box-shadow: 0 0 0 1px var(--line);
  position: relative;
  overflow: hidden;
}
.skeleton::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, var(--line), transparent);
  transform: translateX(-100%);
  animation: sweep 1.4s ease-in-out infinite;
}
@keyframes sweep { to { transform: translateX(100%); } }

/* ---------- sheet ---------- */

.sheet-root { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 24px; }

.scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 14, 22, 0.36);
  opacity: 0;
  transition: opacity 200ms ease;
}

.sheet {
  position: relative;
  width: min(520px, 100%);
  max-height: calc(100dvh - 48px);
  overflow: auto;
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow-sheet);
  opacity: 0;
  transform: scale(0.96);
  transition: opacity 200ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  overscroll-behavior: contain;
}
.sheet-root.is-open .scrim { opacity: 1; }
.sheet-root.is-open .sheet { opacity: 1; transform: none; }

.sheet__head {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px 10px 24px;
  background: var(--surface);
}
.sheet__handle { display: none; }
.sheet__title { flex: 1; margin: 0; font-size: 1.125rem; font-weight: 600; letter-spacing: -0.01em; }
.sheet__body { padding: 4px 24px 24px; }

.share__label { margin: 0 0 10px; color: var(--ink-2); font-size: 0.9375rem; }
.share__code { padding-bottom: 20px; }
.share__link { padding-top: 20px; border-top: 1px solid var(--line); }

.code {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 96px;
  border-radius: var(--r-l);
  color: var(--ink);
  background-color: var(--tint-bg);
  background-image:
    repeating-linear-gradient(45deg, var(--tint-a) 0 1px, transparent 1px 6px),
    repeating-linear-gradient(-45deg, var(--tint-b) 0 1px, transparent 1px 4px);
}
.code__digits {
  padding: 2px 14px;
  border-radius: 10px;
  background: var(--tint-bg);
  font-size: 2.75rem;
  font-weight: 650;
  line-height: 1;
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  transition: color 200ms ease;
}
.code[data-state="live"] .code__digits { color: var(--ink); }
.code[data-state="off"] .code__digits { font-size: 1.25rem; letter-spacing: 0; }
.code__hint { margin: 10px 0 0; font-size: 0.875rem; color: var(--ink-2); }
.codebox > .btn { margin-top: 12px; }
.code[data-state="off"] .code__digits { color: var(--ink-2); }

.input--link { font-size: 0.875rem; color: var(--ink-2); }

.share__qr-row { display: flex; align-items: center; gap: 20px; margin-top: 16px; }
.qr {
  flex: none;
  width: 116px;
  height: 116px;
  padding: 6px;
  border-radius: var(--r-m);
  background: #fff;
  color: #141A26;
  box-shadow: 0 0 0 1px var(--line);
}
.qr svg { display: block; width: 100%; height: 100%; }
.facts { margin: 0; padding: 0; list-style: none; color: var(--ink-2); font-size: 0.875rem; line-height: 1.9; }
.share__foot { margin-top: 20px; display: flex; justify-content: flex-end; }

.pickup-sheet { padding-bottom: 8px; }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(28px + var(--dock-h) + env(safe-area-inset-bottom));
  z-index: 80;
  max-width: min(92vw, 480px);
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9375rem;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(10, 14, 22, 0.22);
  opacity: 0;
  transform: translate(-50%, 12px);
  transition: opacity 180ms ease, transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }
.toast[data-kind="error"] { background: var(--danger); color: #fff; }
.toast[data-kind="ok"] { background: var(--ok); color: #fff; }
.toast[data-kind="warn"] { background: var(--warn); color: #fff; }

.noscript { max-width: 32em; margin: 80px auto; padding: 0 16px; color: var(--ink-2); }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .notes { grid-template-columns: 1fr; gap: 18px; margin-top: 48px; }
}

@media (max-width: 719px) {
  :root { --bar-h: 52px; --dock-h: 64px; }
  .tabs { display: none; }
  .dock { display: flex; }
  .main { padding-top: 24px; }
  .page-lede { font-size: 1rem; }

  .editor { grid-template-columns: 1fr; min-height: 0; }
  .editor__input { min-height: 200px; padding: 18px; }
  .editor__foot { padding: 8px 18px 12px; }
  .kbd-hint { display: none; }
  .cipher { border-left: 0; border-top: 1px solid var(--line); height: 120px; padding: 14px 18px; }

  .actions { flex-direction: column; align-items: stretch; }
  .actions > .btn { width: 100%; height: 50px; font-size: 1rem; }
  .opts { gap: 14px 20px; }

  .drop { padding: 28px 20px; }
  .vcard { grid-template-columns: 1fr; gap: 14px; padding: 12px; }
  .video-form .btn { padding: 0 18px; }

  .hero__cta .btn { flex: 1 1 100%; }
  .bar .bar__code { padding: 0 12px; font-size: 0.875rem; }
  .msg { max-width: 94%; }
  .composer__bar .kbd-hint { display: none; }
  .composer__bar .btn { margin-left: auto; }
  .status { flex-wrap: wrap; }
  .otp__cells { gap: 6px; }
  .lens, .hero__band { height: 220px; min-height: 220px; }
  .lens__plain { font-size: 1.375rem; }

  .sheet-root { place-items: end stretch; padding: 0; }
  .sheet {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 22px 22px 0 0;
    padding-bottom: env(safe-area-inset-bottom);
    opacity: 1;
    transform: translate3d(0, 100%, 0);
    transition: none;
    will-change: transform;
  }
  .sheet-root .scrim { transition: none; }
  .sheet__head { padding-top: 22px; touch-action: none; cursor: grab; }
  .sheet__handle {
    display: block;
    position: absolute;
    top: 8px;
    left: 50%;
    width: 36px;
    height: 5px;
    margin-left: -18px;
    border-radius: 999px;
    background: var(--line-2);
  }
  .sheet__body { padding: 4px 20px 24px; }
  .code__digits { font-size: 2.5rem; }
}

/* ---------- preferences ---------- */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
  .seg__thumb, .switch__track::after, .progress__bar, .toast { transition-duration: 0.01ms; }
  .sheet { transform: none !important; transition: opacity 150ms ease; }
  .btn:active:not(:disabled) { transform: none; }
}
@media (prefers-reduced-motion: reduce) and (max-width: 719px) {
  .sheet { opacity: 0; }
  .sheet-root.is-open .sheet { opacity: 1; transition: opacity 150ms ease; }
  .sheet-root .scrim { transition: opacity 150ms ease; }
}

@media (prefers-reduced-transparency: reduce) {
  .bar, .dock { background: var(--paper); -webkit-backdrop-filter: none; backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(20, 26, 38, 0.3); --line-2: rgba(20, 26, 38, 0.45); --ink-2: #333B4C; }
  .cipher__text { -webkit-mask-image: none; mask-image: none; }
}
