/* Findable — generator screens: clients, batch wizard, preview, markets
   Extends findable.css tokens. */

/* ---------- Breadcrumb & subheads ---------- */

.crumb {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 0;
  background: none;
  padding: 0;
  margin: 0 0 14px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 550;
  color: var(--ink-soft);
  cursor: pointer;
}
.crumb:hover { color: var(--ink); }

.dash__subhead { margin: 34px 0 12px; }

/* ---------- Client grid ---------- */

.client-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.client-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  text-align: left;
  font: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 18px 16px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color calc(var(--m) * 200ms) ease,
              transform calc(var(--m) * 200ms) ease,
              box-shadow calc(var(--m) * 200ms) ease;
}
.client-card:hover {
  border-color: var(--line-strong);
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 34, 85, 0.08);
}
.client-card strong { font-size: 16.5px; font-weight: 640; }
.client-card__domain { font-size: 13px; color: var(--accent-deep); font-weight: 520; }
.client-card__meta { font-size: 12.5px; color: var(--ink-faint); margin-top: 6px; }

/* ---------- Welcome / empty state ---------- */

.dash__welcome {
  margin-top: 18px;
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 14px;
  padding: 34px 34px 30px;
  max-width: 560px;
}
.dash__welcome h3 { margin: 0 0 8px; font-size: 19px; }
.dash__welcome p { margin: 0 0 18px; color: var(--ink-soft); font-size: 14.5px; line-height: 1.55; }

/* ---------- Client facts ---------- */

.client-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  margin: 6px 0 8px;
  padding: 16px 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
}
.fact { display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; }
.fact--wide { flex-basis: 100%; }
.fact__label { font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-faint); font-weight: 600; }
.fact__empty { color: var(--ink-faint); font-style: italic; }
.fact a { color: var(--accent-deep); font-weight: 550; text-decoration: none; }
.fact a:hover { text-decoration: underline; }

/* ---------- Modal ---------- */

.modal-veil {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(0, 19, 53, 0.38);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.modal {
  width: min(460px, 100%);
  background: var(--surface);
  border-radius: 16px;
  padding: 26px 28px 24px;
  box-shadow: 0 24px 70px rgba(0, 19, 53, 0.25);
}
.modal__title { margin: 4px 0 18px; font-size: 22px; letter-spacing: -0.01em; }
.modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 22px;
}
.modal__actions .btn--danger { margin-right: auto; }

/* ---------- Fields ---------- */

.fld { display: block; margin-bottom: 14px; }
.fld > span {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
  color: var(--ink-soft);
}
.fld > span em { font-style: normal; font-weight: 450; color: var(--ink-faint); }
.fld input {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 12px;
  outline: none;
  transition: border-color calc(var(--m) * 180ms) ease;
}
.fld input:focus { border-color: var(--accent); }

.btn--danger { color: var(--red-deep); }
.btn--danger:hover { color: var(--red); }

/* ---------- Panels (wizard steps) ---------- */

.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 26px 28px 24px;
  max-width: 760px;
}
.panel--wide { max-width: 1080px; }
.panel__title { margin: 0 0 6px; font-size: 20px; letter-spacing: -0.01em; }
.panel__hint { margin: 0 0 20px; font-size: 14px; color: var(--ink-soft); line-height: 1.55; max-width: 64ch; }
.panel__hint code, .panel__warn code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.panel__error { color: var(--red-deep); font-size: 14px; font-weight: 550; }
.panel__warn {
  font-size: 13.5px;
  color: #7A5A1E;
  background: #FCF6E8;
  border: 1px solid #EAD9AE;
  border-radius: 9px;
  padding: 10px 14px;
  max-width: 64ch;
}
.panel__foot {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* ---------- Stepper ---------- */

.stepper {
  display: flex;
  gap: 6px;
  margin: 4px 0 18px;
  flex-wrap: wrap;
}
.stepper__step {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font: inherit;
  font-size: 13.5px;
  font-weight: 560;
  color: var(--ink-faint);
  background: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 7px 14px 7px 8px;
  cursor: pointer;
}
.stepper__step:disabled { cursor: default; opacity: 0.55; }
.stepper__step--on { color: var(--ink); background: var(--surface); border-color: var(--line); }
.stepper__step--done { color: var(--ink-soft); }
.stepper__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 21px;
  height: 21px;
  border-radius: 50%;
  font-size: 11.5px;
  background: var(--ghost);
  border: 1px solid var(--line);
}
.stepper__step--on .stepper__num { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper__step--done .stepper__num { background: #EAF1EA; border-color: #BFD4C0; color: #3F6B43; }

/* ---------- Dropzone ---------- */

.dropzone {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
  border: 1.5px dashed var(--line-strong);
  border-radius: 12px;
  background: var(--ghost);
  padding: 34px 20px;
  cursor: pointer;
  transition: border-color calc(var(--m) * 180ms) ease, background calc(var(--m) * 180ms) ease;
}
.dropzone:hover, .dropzone--over { border-color: var(--accent); background: #FDF7F8; }
.dropzone--has { border-style: solid; background: var(--surface); }
.dropzone strong { font-size: 15.5px; }
.dropzone span { font-size: 13px; color: var(--ink-faint); }
.dropzone__again { margin-top: 6px; color: var(--accent-deep) !important; font-weight: 550; }

/* ---------- Template chooser ---------- */

.tpl-list { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.tpl {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  text-align: left;
  font: inherit;
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 13px 15px;
  cursor: pointer;
  color: var(--ink);
}
.tpl--on { background: var(--surface); border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.tpl__radio {
  flex: none;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  border-radius: 50%;
  border: 2px solid var(--line-strong);
}
.tpl--on .tpl__radio { border-color: var(--accent); background: radial-gradient(circle, var(--accent) 0 4.5px, transparent 5px); }
.tpl__body { display: flex; flex-direction: column; gap: 3px; }
.tpl__body strong { font-size: 14.5px; }
.tpl__meta { font-size: 12.5px; color: var(--ink-faint); }
.tpl__meta em { font-style: normal; color: var(--accent-deep); }

/* ---------- Market data ---------- */

.market-actions { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.market-actions__file { font-size: 13px; color: var(--ink-faint); }

.tokmatch { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tokchip {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  font-weight: 600;
  border-radius: 6px;
  padding: 4px 9px;
}
.tokchip--ok { background: #EAF1EA; color: #3F6B43; border: 1px solid #BFD4C0; }
.tokchip--miss { background: #FBE9EC; color: #8F2533; border: 1px dashed #DC8B97; }

.market-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface);
  margin-bottom: 10px;
}
.market-table { border-collapse: collapse; width: 100%; min-width: 480px; }
.market-table th {
  text-align: left;
  font-size: 12px;
  font-weight: 650;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: var(--ink-soft);
  background: var(--ghost);
  border-bottom: 1px solid var(--line);
  padding: 8px 10px;
  white-space: nowrap;
}
.market-table__h { display: inline-flex; align-items: center; gap: 6px; }
.market-table__del, .market-table__rowdel button {
  border: 0;
  background: none;
  color: var(--ink-faint);
  font-size: 14px;
  cursor: pointer;
  line-height: 1;
  padding: 2px 4px;
  border-radius: 4px;
}
.market-table__del:hover, .market-table__rowdel button:hover { color: var(--red-deep); background: #FBE9EC; }
.market-table td { border-bottom: 1px solid var(--line); padding: 0; }
.market-table tr:last-child td { border-bottom: 0; }
.market-table td input {
  width: 100%;
  min-width: 120px;
  border: 0;
  font: inherit;
  font-size: 13.5px;
  padding: 9px 10px;
  background: transparent;
  color: var(--ink);
  outline: none;
}
.market-table td input:focus { background: #FDF7F8; box-shadow: inset 0 0 0 1.5px var(--accent); }
.market-table__addcol { background: var(--ghost); }
.market-table__rowdel { width: 36px; text-align: center; }

/* ---------- Approval preview ---------- */

.pv-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
}
.pv-toggle {
  display: inline-flex;
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px;
}
.pv-toggle__b {
  font: inherit;
  font-size: 13px;
  font-weight: 560;
  color: var(--ink-soft);
  border: 0;
  background: none;
  border-radius: 999px;
  padding: 7px 15px;
  cursor: pointer;
}
.pv-toggle__b--on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 4px rgba(0, 34, 85, 0.12); }
.pv-sample {
  font: inherit;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 7px 10px;
  background: var(--surface);
  color: var(--ink);
}
.pv-live { font-size: 12.5px; color: var(--ink-faint); }
.pv-live--on { color: #3F6B43; font-weight: 550; }

.browser {
  border: 1px solid var(--line-strong);
  border-radius: 13px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 18px 50px rgba(0, 19, 53, 0.12);
}
.browser__chrome {
  display: flex;
  align-items: center;
  gap: 6px;
  background: var(--ghost);
  border-bottom: 1px solid var(--line);
  padding: 9px 14px;
}
.browser__dot { width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.browser__dot:first-child { background: var(--red-light); }
.browser__dot:nth-child(2) { background: #E7D9A8; }
.browser__url {
  margin-left: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-soft);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 4px 12px;
  max-width: 70%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.browser__frame {
  display: block;
  width: 100%;
  height: min(64vh, 680px);
  border: 0;
  background: #fff;
}

/* ---------- Generate ---------- */

.gen-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 40px;
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 11px;
  padding: 14px 18px;
}
.gen-list {
  border: 1px solid var(--line);
  border-radius: 11px;
  overflow: hidden;
  max-height: 380px;
  overflow-y: auto;
}
.gen-list__row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.gen-list__row:last-child { border-bottom: 0; }
.gen-list__row span {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ---------- Rename ---------- */

.rename {
  font: inherit;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: inherit;
  color: var(--ink);
  border: 0;
  border-bottom: 2px solid var(--accent);
  background: none;
  outline: none;
  padding: 0;
  font-size: 30px;
  font-weight: 650;
}

/* ---------- Status pills: approved ---------- */

.pill--approved .pill__dot { background: #C9A23C; }
.pill--approved { color: #7A5A1E; background: #FCF6E8; border-color: #EAD9AE; }

@media (max-width: 640px) {
  .panel { padding: 20px 18px; }
  .browser__frame { height: 60vh; }
}

/* ---------- Checkbox + URL preview ---------- */

.check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-size: 14.5px;
  cursor: pointer;
  margin: 8px 0 4px;
}
.check input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}
.check code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.9em;
  background: var(--ghost);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
}
.check__preview {
  margin: 4px 0 14px 26px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  color: var(--ink-faint);
}
.check__preview strong { color: var(--accent-deep); font-weight: 650; }

.tokchip--url { background: #EAF0F8; color: #1B3F7A; border: 1px solid #C3D2E6; }

/* ============================================================
   Unlock loader — ink curtain, type reveal, eased counter, wipe
   ============================================================ */

.loader {
  position: fixed;
  inset: 0;
  z-index: 90;
}

.loader__panel {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    radial-gradient(120% 90% at 80% 110%, rgba(0, 0, 0, 0.5) 0%, rgba(0, 0, 0, 0) 60%),
    radial-gradient(100% 70% at 15% -10%, rgba(158, 170, 185, 0.35) 0%, rgba(158, 170, 185, 0) 55%),
    #002255;
  color: var(--ghost);
  display: flex;
  align-items: center;
  justify-content: center;
}
.loader--exit .loader__panel {
  transform: translateY(-100%);
  transition: transform calc(var(--m) * 900ms) cubic-bezier(0.76, 0, 0.24, 1);
}

/* inner content drifts down slightly as the curtain lifts (parallax) */
.loader__center, .loader__pct, .loader__bar, .loader__caption {
  transition: transform calc(var(--m) * 900ms) cubic-bezier(0.76, 0, 0.24, 1),
              opacity calc(var(--m) * 500ms) ease;
}
.loader--exit .loader__center { transform: translateY(34vh); opacity: 0.4; }
.loader--exit .loader__pct { transform: translateY(20vh); opacity: 0; }
.loader--exit .loader__bar { opacity: 0; }

/* ---------- wordmark reveal ---------- */

.loader__center {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 26px;
}

.loader__word {
  display: flex;
  align-items: baseline;
  font-size: clamp(54px, 10vw, 112px);
  font-weight: 650;
  letter-spacing: -0.03em;
  line-height: 1;
}

.loader__mask {
  display: inline-block;
  overflow: hidden;
  padding-bottom: 0.08em;
  margin-bottom: -0.08em;
}
.loader__letter {
  display: inline-block;
  transform: translateY(115%);
}
@media (prefers-reduced-motion: no-preference) {
  .loader__letter {
    animation: loaderLetter calc(var(--m) * 760ms) cubic-bezier(0.22, 1, 0.36, 1) forwards;
    animation-delay: calc(var(--m) * (220ms + var(--i) * 52ms));
  }
  @keyframes loaderLetter {
    to { transform: translateY(0); }
  }
}
@media (prefers-reduced-motion: reduce) {
  .loader__letter { transform: none; }
}

/* pin slides into the lockup when the count lands */
.loader__pinslot {
  display: inline-flex;
  justify-content: flex-end;
  width: 0;
  opacity: 0;
  transform: translateY(-0.55em);
  transition:
    width calc(var(--m) * 460ms) cubic-bezier(0.34, 1.56, 0.64, 1),
    opacity calc(var(--m) * 260ms) ease,
    transform calc(var(--m) * 460ms) cubic-bezier(0.34, 1.56, 0.64, 1);
}
.loader__pinslot--in {
  width: 0.72em;
  opacity: 1;
  transform: translateY(0);
}
.loader__pin {
  width: 0.56em;
  height: 0.75em;
  margin-right: 0.16em;
}

/* ---------- caption ---------- */

.loader__caption {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(248, 249, 252, 0.55);
}
.loader__caption-line {
  width: 34px;
  height: 1px;
  background: rgba(248, 249, 252, 0.35);
}
@media (prefers-reduced-motion: no-preference) {
  .loader__caption {
    opacity: 0;
    animation: loaderFade calc(var(--m) * 600ms) ease forwards;
    animation-delay: calc(var(--m) * 750ms);
  }
  @keyframes loaderFade { to { opacity: 1; } }
}

/* ---------- giant percentage ---------- */

.loader__pct {
  position: absolute;
  right: clamp(18px, 4vw, 56px);
  bottom: clamp(6px, 2.5vw, 28px);
  display: flex;
  align-items: baseline;
  font-weight: 600;
  letter-spacing: -0.045em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  color: rgba(248, 249, 252, 0.94);
}
.loader__pct-num { font-size: clamp(88px, 17vw, 190px); }
.loader__pct-sym {
  font-size: clamp(26px, 4.4vw, 48px);
  margin-left: 0.08em;
  color: rgba(248, 249, 252, 0.5);
}

/* ---------- progress hairline ---------- */

.loader__bar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 3px;
  background: rgba(248, 249, 252, 0.14);
}
.loader__bar-fill {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--accent);
  transform-origin: left center;
  transition: transform 140ms linear;
}

@media (max-width: 640px) {
  .loader__pct { right: 16px; bottom: 8px; }
}

/* ============================================================
   Dot grid — login background
   ============================================================ */

.wall > .dotgrid {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  /* canvas reads this computed color, alpha included */
  color: color-mix(in oklab, var(--wall-text) 9%, transparent);
}
.wall--ink > .dotgrid {
  color: color-mix(in oklab, var(--wall-text) 13%, transparent);
}
.dotgrid canvas { display: block; }

/* dot grid inside the loader — ghost dots on the ink curtain */
.loader__panel > .dotgrid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  color: color-mix(in oklab, var(--ghost) 13%, transparent);
}
