/* otpx: neutral zinc surfaces, one blue accent, red only for loss and expiry. */

:root {
  color-scheme: light dark;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

  --ground: #fafafa;
  --fg: #18181b;
  --fg-2: #52525b;
  --rule: #e4e4e7;

  --surface: #ffffff;
  --edge: #e4e4e7;
  --ink: #18181b;
  --ink-2: #52525b;
  --field: #ffffff;
  --field-edge: #d4d4d8;
  --hover: #f4f4f5;

  --bar: #18181b;
  --bar-2: #27272a;
  --on-bar: #fafafa;
  --on-bar-2: #a1a1aa;

  --invert: #18181b;
  --invert-2: #3f3f46;
  --on-invert: #fafafa;
  --on-invert-2: #a1a1aa;

  --accent: #2563eb;
  --accent-hover: #1d4ed8;
  --on-accent: #ffffff;
  --accent-line: #2563eb;
  --accent-soft: #dbeafe;
  --accent-ink: #1d4ed8;

  --warn-soft: #fffbeb;
  --warn-edge: #f59e0b;
  --star: #f59e0b;
  --star-edge: #b45309;

  --danger: #dc2626;
  --danger-soft: #fef2f2;
  --danger-ink: #b91c1c;
  --danger-fill: #dc2626;
  --hole: #f4f4f5;

  --radius: 12px;
  --radius-sm: 9px;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --measure: 46rem;

  --focus: #2563eb;
  --focus-bar: #60a5fa;
  --size-code: 1.75rem;
  --size-body: 1rem;
  --size-small: 0.875rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ground: #09090b;
    --fg: #fafafa;
    --fg-2: #a1a1aa;
    --rule: #27272a;
    --surface: #18181b;
    --edge: #27272a;
    --ink: #fafafa;
    --ink-2: #a1a1aa;
    --field: #09090b;
    --field-edge: #3f3f46;
    --hover: #27272a;
    --bar: #18181b;
    --bar-2: #27272a;
    --invert: #fafafa;
    --invert-2: #e4e4e7;
    --on-invert: #18181b;
    --on-invert-2: #52525b;
    --accent-line: #3b82f6;
    --accent-soft: #1e3a8a;
    --accent-ink: #bfdbfe;
    --warn-soft: #422006;
    --warn-edge: #b45309;
    --star: #fbbf24;
    --star-edge: #d97706;
    --danger: #f87171;
    --danger-soft: #450a0a;
    --danger-ink: #fca5a5;
    --hole: #27272a;
    --focus: #60a5fa;
  }
}

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

html {
  -webkit-text-size-adjust: 100%;
  scrollbar-color: var(--rule) transparent;
}

body {
  margin: 0;
  min-height: 100dvh;
  background: var(--ground);
  color: var(--fg);
  font: 400 var(--size-body) / 1.5 var(--font);
  font-variant-numeric: tabular-nums;
  caret-color: var(--accent);
}

::selection {
  background: var(--accent-soft);
  color: var(--fg);
}

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

a {
  color: inherit;
  text-decoration-color: var(--accent-line);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.2em;
}

h1,
h2 {
  margin: 0;
  line-height: 1.2;
  text-wrap: balance;
  letter-spacing: -0.015em;
}

h1 {
  font-size: 1.5rem;
  font-weight: 700;
}

h2 {
  font-size: 1.0625rem;
  font-weight: 700;
}

h1:focus {
  outline: none;
}

p {
  margin: 0;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.icon {
  width: 1.25rem;
  height: 1.25rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Shell */

.skip {
  position: absolute;
  left: 1rem;
  top: -4rem;
  z-index: 10;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: var(--on-accent);
  border-radius: var(--radius-sm);
}

.skip:focus {
  top: 0.5rem;
}

.bar {
  --focus: var(--focus-bar);
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 3.75rem;
  padding: 0.625rem max(1rem, calc((100vw - var(--measure)) / 2));
  padding-top: max(0.625rem, env(safe-area-inset-top));
  background: var(--bar);
  color: var(--on-bar);
}

.brand {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
  color: var(--on-bar);
}

.search-wrap {
  position: relative;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}

.search-wrap .icon {
  position: absolute;
  left: 0.75rem;
  color: var(--on-bar-2);
  pointer-events: none;
}

.bar .search {
  width: 100%;
  height: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.875rem 0 2.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--bar-2);
  color: var(--on-bar);
  font: inherit;
}

.bar .search::placeholder {
  color: var(--on-bar-2);
}

.bar .search:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}

.nav {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.nav-btn,
.sync-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-width: 2.5rem;
  height: 2.5rem;
  padding: 0 0.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--on-bar);
  font: inherit;
  font-size: var(--size-small);
  text-decoration: none;
  cursor: pointer;
}

.nav-btn:hover,
.sync-state:hover,
.nav-btn[aria-current="page"] {
  background: var(--bar-2);
}

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

.sync-state {
  color: var(--on-bar-2);
  white-space: nowrap;
}

.sync-state.is-none,
.sync-state.is-error {
  color: var(--on-bar);
}

.sync-state.is-busy .icon {
  animation: spin 1.1s linear infinite;
}

@keyframes spin {
  to {
    rotate: 360deg;
  }
}

.main {
  max-width: var(--measure);
  margin: 0 auto;
  padding: 1.25rem 1rem calc(5rem + env(safe-area-inset-bottom));
}

/* Tags: the board */

.board {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.tag {
  position: relative;
  display: flex;
  align-items: stretch;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  transition:
    translate 220ms var(--ease),
    background-color 220ms var(--ease),
    border-color 220ms var(--ease),
    color 220ms var(--ease);
}

.tag-hit {
  flex: 1;
  min-width: 0;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 0.875rem;
  padding: 0.75rem 0.5rem 0.75rem 0.875rem;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  border-radius: var(--radius) 0 0 var(--radius);
}

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

.tag-name strong {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tag-account {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.fav .icon {
  width: 0.875rem;
  height: 0.875rem;
  fill: var(--star);
  stroke: var(--star-edge);
  stroke-width: 1.25;
}

.tag-code {
  display: grid;
  grid-template-rows: auto auto;
  justify-items: end;
}

.tag-code .next,
.tag-code .copied-mark {
  grid-area: 2 / 1;
}

.code {
  font-size: var(--size-code);
  font-weight: 650;
  line-height: 1.1;
  letter-spacing: 0.05em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.next {
  color: var(--ink-2);
  font-size: var(--size-small);
  white-space: nowrap;
  transition: opacity 160ms var(--ease);
}

.copied-mark {
  display: none;
  align-items: center;
  gap: 0.25rem;
  font-size: var(--size-small);
  font-weight: 650;
}

.copied-mark .icon {
  width: 1rem;
  height: 1rem;
}

.tag-open {
  display: grid;
  place-items: center;
  width: 2.75rem;
  border-left: 1px solid var(--edge);
  color: var(--ink-2);
  border-radius: 0 var(--radius) var(--radius) 0;
}

.tag-open:hover,
.tag-hit:hover {
  background: var(--hover);
}

@media (hover: hover) {
  .board .next {
    opacity: 0;
  }

  .board .tag:hover .next,
  .board .tag:focus-within .next {
    opacity: 1;
  }
}

@media (hover: none) {
  .board .next {
    visibility: hidden;
  }
}

/* The reversed plate: a copied tag, until the clipboard clears. */
.tag.is-copied {
  translate: 0 -2px;
  background: var(--invert);
  border-color: var(--invert);
  color: var(--on-invert);
}

.tag.is-copied .tag-account,
.tag.is-copied .next,
.tag.is-copied .tag-open {
  color: var(--on-invert-2);
}

.tag.is-copied .tag-open {
  border-color: var(--invert-2);
}

.tag.is-copied .tag-hit:hover,
.tag.is-copied .tag-open:hover {
  background: var(--invert-2);
}

.tag.is-copied .next {
  visibility: hidden;
}

.tag.is-copied .copied-mark {
  display: inline-flex;
}

/* The countdown ring: its blue arc is the time left. */
.eyelet {
  --left: 1;
  position: relative;
  width: 2.5rem;
  height: 2.5rem;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: conic-gradient(var(--accent-line) calc(var(--left) * 1turn), var(--edge) 0);
}

.eyelet.is-ending {
  background: conic-gradient(var(--danger) calc(var(--left) * 1turn), var(--edge) 0);
}

.eyelet.is-counter,
.eyelet-still {
  background: var(--accent);
}

.eyelet-hole {
  width: 1.875rem;
  height: 1.875rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--hole);
  color: var(--fg-2);
  font-size: 0.6875rem;
  font-weight: 650;
}

.eyelet.is-ending .eyelet-hole {
  color: var(--danger-ink);
}

.nomatch {
  padding: 2rem 0;
  color: var(--fg-2);
  text-align: center;
}

/* Plates, forms, controls */

.tag-plate {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 1.25rem;
}

.narrow {
  display: grid;
  gap: 1.25rem;
}

.page-head {
  display: grid;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}

.back {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  width: fit-content;
  color: var(--fg-2);
  font-size: var(--size-small);
  text-decoration: none;
}

.back:hover {
  color: var(--fg);
}

.back .icon {
  width: 1rem;
  height: 1rem;
}

.lead {
  color: var(--fg-2);
  max-width: 62ch;
}

.tag-plate .lead,
.tag-plate p {
  color: var(--ink-2);
}

.tag-plate h2 {
  color: var(--ink);
  margin-bottom: 0.5rem;
}

.form {
  display: grid;
  gap: 1rem;
}

.field {
  display: grid;
  gap: 0.375rem;
}

.field label {
  font-weight: 650;
  font-size: var(--size-small);
}

.hint {
  font-size: var(--size-small);
  color: var(--fg-2);
}

:is(.tag-plate, .remote-add, .tag, .choice, .remote) .hint {
  color: var(--ink-2);
}

:where(input:not([type="checkbox"]):not([type="file"]), textarea, select) {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--field-edge);
  border-radius: var(--radius-sm);
  background: var(--field);
  color: var(--ink);
  font: inherit;
  caret-color: var(--accent);
}

textarea {
  resize: vertical;
  line-height: 1.4;
}

:where(input, textarea)::placeholder {
  color: var(--ink-2);
}

:where(input, textarea, select):focus-visible {
  outline-offset: 0;
  border-color: var(--focus);
}

input:disabled {
  opacity: 0.6;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 2.75rem;
  cursor: pointer;
}

.check input {
  width: 1.25rem;
  height: 1.25rem;
  accent-color: var(--accent);
}

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr));
  gap: 1rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0 1rem;
  border: 1px solid var(--edge);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 650;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms var(--ease);
}

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

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}

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

.btn-quiet {
  background: transparent;
  border-color: transparent;
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.2em;
}

.btn-quiet:hover {
  background: transparent;
  text-decoration-thickness: 2px;
}

.btn-danger {
  background: transparent;
  border-color: var(--danger);
  color: var(--danger);
}

.btn-danger:hover {
  background: var(--danger-soft);
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn[aria-busy] {
  cursor: progress;
}

.file-input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.file-label {
  position: relative;
  width: fit-content;
}

.file-label:focus-within {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.notice {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  padding: 0.75rem 0.875rem;
  border: 1px solid var(--rule);
  border-radius: var(--radius-sm);
  color: var(--fg-2);
  font-size: var(--size-small);
  max-width: 62ch;
}

.notice .icon {
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.0625rem;
}

:is(.tag-plate, .remote-add) .notice {
  border-color: var(--edge);
  color: var(--ink-2);
}

.notice-warn,
.tag-plate .notice-warn {
  background: var(--warn-soft);
  border-color: var(--warn-edge);
  color: var(--fg);
}

.notice-error,
.tag-plate .notice-error {
  background: var(--danger-soft);
  border-color: var(--danger);
  color: var(--fg);
}

.form-status:empty {
  display: none;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.chip {
  padding: 0.125rem 0.625rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  font-size: var(--size-small);
  color: var(--fg-2);
}

.meta {
  color: var(--fg-2);
  font-size: var(--size-small);
}

.note {
  max-width: 62ch;
}

details > summary {
  cursor: pointer;
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

.advanced summary {
  font-weight: 650;
  font-size: var(--size-small);
  text-decoration: underline;
  text-decoration-color: var(--accent-line);
  text-underline-offset: 0.2em;
}

.advanced[open] summary {
  margin-bottom: 1rem;
}

.danger-zone {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule);
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.danger-zone summary {
  color: var(--danger);
  font-size: var(--size-small);
  font-weight: 650;
}

.danger-zone p {
  color: var(--fg-2);
  font-size: var(--size-small);
  max-width: 62ch;
}

/* Start, unlock */

.start {
  display: grid;
  gap: 1rem;
  padding-top: clamp(1rem, 6vh, 4rem);
}

.start-title {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.08;
  max-width: 18ch;
}

.choices {
  list-style: none;
  margin: 0.75rem 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.choice {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.875rem 1rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  text-decoration: none;
}

.choice:hover {
  background: var(--hover);
}

.choice > .icon:first-child {
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.5625rem;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.choice-text {
  flex: 1;
  display: grid;
}

.choice-text span {
  color: var(--ink-2);
  font-size: var(--size-small);
}

.choice > .icon:last-child {
  color: var(--ink-2);
}

.unlock {
  display: grid;
  gap: 1rem;
  justify-items: center;
  padding-top: clamp(1.5rem, 10vh, 5rem);
}

.unlock-tag {
  position: relative;
  width: min(100%, 24rem);
  display: grid;
  gap: 1rem;
  padding-top: 1.5rem;
}

.unlock-tag .eyelet {
  justify-self: start;
}

.alt {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 0.5rem;
  width: min(100%, 24rem);
}

.alt .btn-plain {
  width: 100%;
}

.unlock .danger-zone {
  width: min(100%, 24rem);
}

.recovery {
  display: grid;
  gap: 1rem;
  justify-items: start;
}

.tag-plate .recovery-code {
  font-size: 1.125rem;
  font-weight: 650;
  letter-spacing: 0.06em;
  line-height: 1.7;
  word-spacing: 0.2em;
  overflow-wrap: anywhere;
  color: var(--ink);
}

.empty {
  display: grid;
  gap: 1rem;
  justify-items: start;
  padding-top: clamp(1rem, 6vh, 3rem);
}

/* One account */

.account {
  display: grid;
  gap: 1.25rem;
}

.tag-big {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "eye name"
    "code code"
    "next next";
  gap: 1rem 1rem;
  align-items: center;
  padding: 1.5rem;
}

.tag-big .eyelet {
  grid-area: eye;
  width: 3.5rem;
  height: 3.5rem;
}

.tag-big .eyelet-hole {
  width: 2.625rem;
  height: 2.625rem;
  font-size: 0.875rem;
}

.tag-big .tag-name {
  grid-area: name;
}

.tag-big .code-big {
  grid-area: code;
  font-size: clamp(2.75rem, 13vw, 4.5rem);
  letter-spacing: 0.06em;
  line-height: 1;
  padding: 0.5rem 0;
}

.tag-big .next {
  grid-area: next;
  opacity: 1;
}

.tag-big .copied-mark {
  display: none;
}

.actions-wrap .btn {
  flex: 1 1 auto;
}

.qr-box:empty,
.secret-box:empty {
  display: none;
}

.qr-box,
.share-out {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.qr {
  width: min(100%, 15rem);
  height: auto;
  padding: 0.75rem;
  background: oklch(100% 0 0);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.qr-large {
  width: min(100%, 20rem);
}

.secret-row {
  display: grid;
  gap: 0.5rem;
  justify-items: start;
}

.secret-row .btn-quiet {
  padding: 0;
}

.secret {
  font-size: 1.0625rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  overflow-wrap: anywhere;
}

.link-out {
  font-size: var(--size-small);
  overflow-wrap: anywhere;
}

/* Tabs (add) */

.tabs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.25rem;
  padding: 0.25rem;
  background: var(--surface);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.tab {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  min-height: 2.5rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-weight: 650;
  font-size: var(--size-small);
  cursor: pointer;
}

.tab[aria-selected="true"] {
  background: var(--invert);
  color: var(--on-invert);
}

.tab-panel {
  display: grid;
  gap: 1rem;
}

.scanner-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  max-height: 60vh;
  border-radius: var(--radius);
  background: #18181b;
  overflow: hidden;
}

.scanner {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scanner-aim {
  position: absolute;
  inset: 18% 28%;
  border: 2px solid var(--accent);
  border-radius: var(--radius);
  opacity: 0.4;
}

.scanner-frame.is-live .scanner-aim {
  opacity: 1;
}

/* Transfer, sync, settings */

.block {
  display: grid;
  gap: 0.75rem;
  justify-items: start;
}

.block > .form,
.block > .field,
.block > .remotes {
  width: 100%;
}

.file-name {
  font-weight: 650;
  font-size: var(--size-small);
}

.remotes {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.5rem;
}

.remote {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 0.875rem;
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
}

.tag-plate .remote {
  padding: 0.5rem 0;
  border: 0;
  border-bottom: 1px solid var(--edge);
  border-radius: 0;
}

.remote-text {
  flex: 1;
  min-width: 0;
  display: grid;
  overflow-wrap: anywhere;
}

.remote-text > span:not(.hint) {
  color: var(--ink-2);
  font-size: var(--size-small);
}

.remote .hint {
  color: var(--ink-2);
}

.remote-add {
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--edge);
  border-radius: var(--radius);
  padding: 0 1.25rem;
}

.remote-add > summary {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  min-height: 3.25rem;
  font-weight: 700;
}

.remote-add[open] {
  padding-bottom: 1.25rem;
}

.remote-add[open] > summary {
  margin-bottom: 0.25rem;
}

.remote-add > p {
  color: var(--ink-2);
  margin-bottom: 1rem;
}

.board-preview .tag-hit {
  cursor: default;
  grid-template-columns: 1fr;
}

code {
  font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.92em;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  background: color-mix(in oklch, currentColor 9%, transparent);
}

.link-row {
  display: flex;
  gap: 0.5rem;
  width: 100%;
}

.link-row input {
  flex: 1;
  min-width: 0;
  font-size: var(--size-small);
}

/* Toast */

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(92vw, 34rem);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-sm);
  background: var(--invert);
  color: var(--on-invert);
  box-shadow: 0 6px 20px oklch(0% 0 0 / 0.22);
  translate: -50% 1rem;
  opacity: 0;
  pointer-events: none;
  transition:
    translate 260ms var(--ease),
    opacity 200ms var(--ease);
}

.toast.is-shown {
  translate: -50% 0;
  opacity: 1;
}

.toast[data-kind="error"] {
  background: var(--danger-fill);
  color: #ffffff;
}

/* Narrow screens */

@media (max-width: 40rem) {
  .bar {
    flex-wrap: wrap;
    row-gap: 0.5rem;
  }

  .search-wrap {
    order: 3;
    flex-basis: 100%;
  }

  .nav {
    margin-left: auto;
  }

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

  :root {
    --size-code: 1.5rem;
  }

  .tag-hit {
    column-gap: 0.75rem;
    padding-left: 0.75rem;
  }

  /* One account owns the phone screen: the code takes the width. */
  .tag-big .code-big {
    font-size: clamp(2.75rem, 16.5vw, 5.5rem);
  }

  .tag-big .code-big.code-8 {
    font-size: clamp(2.25rem, 12.5vw, 4.5rem);
  }

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

  .actions-wrap {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .tabs .tab span {
    font-size: 0.8125rem;
  }
}

@media (max-width: 22rem) {
  .tabs .tab span {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }

  .tag.is-copied {
    translate: none;
  }
}

body:not(.is-ready) .main {
  opacity: 0;
}
