/* PayVerify prototype — shared tokens and small components.
   Chrome is neutral black-on-white; semantic color is reserved for status. */

html { color-scheme: light; -webkit-text-size-adjust: 100%; background: #fff; }
body {
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  background: #fff;
  color: #000;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: rgb(0 0 0 / 12%); }

:focus-visible { outline: 2px solid rgb(0 0 0 / 55%); outline-offset: 2px; border-radius: 4px; }

/* Numeric alignment for tables and stats */
.tnum { font-variant-numeric: tabular-nums; }

/* Quiet scrollbar */
* { scrollbar-width: thin; scrollbar-color: rgb(0 0 0 / 18%) transparent; }

/* ---------- Tailwind forms plugin: pin its defaults to the monochrome ladder ----------
   :where() keeps specificity at zero, so every utility class on a field still wins. */
:where(input:not([type=checkbox]):not([type=radio]):not([type=range]):not([type=file]), select, textarea) {
  border-color: rgb(0 0 0 / 18%);
}
:where(input:not([type=checkbox]):not([type=radio])::placeholder, textarea::placeholder) {
  color: rgb(0 0 0 / 40%);
}
:where(input:not([type=checkbox]):not([type=radio]):focus-visible, select:focus-visible, textarea:focus-visible) {
  border-color: rgb(0 0 0 / 45%);
  --tw-ring-color: rgb(0 0 0 / 20%);
}
:where(input[type=checkbox], input[type=radio]) {
  color: #000;
  border-color: rgb(0 0 0 / 30%);
}
:where(input[type=checkbox]:checked, input[type=radio]:checked) {
  background-color: currentColor;
  border-color: currentColor;
}
:where(input[type=checkbox]:focus-visible, input[type=radio]:focus-visible) {
  --tw-ring-color: rgb(0 0 0 / 25%);
}

/* ---------- Wide tables: pin the last column so actions stay visible ----------
   The list tables are wider than the container, so the final column (status or
   row actions) is pinned to the right edge while the middle scrolls. */
.tbl-pin { border-collapse: separate; border-spacing: 0; }
.tbl-pin thead th:last-child, .tbl-pin tbody td:last-child {
  position: sticky; right: 0; z-index: 1;
  background: #fff;
  box-shadow: -8px 0 10px -8px rgb(0 0 0 / 14%);
}
.tbl-pin thead th:last-child { background: #f7f7f7; z-index: 2; }
.tbl-pin tbody tr:hover td:last-child { background: rgb(0 0 0 / 5%); }
.tbl-pin tbody td { border-top: 1px solid rgb(0 0 0 / 10%); }

/* ---------- Step indicator chips (checkout wizard) ---------- */
.pv-tab {
  display: inline-flex; align-items: center; gap: 8px; padding: 6px 4px;
  background: none; border: 0; cursor: default;
  font-size: 13px; font-weight: 500; color: rgb(0 0 0 / 56%);
  transition: color 180ms ease;
}
@media (hover: hover) and (pointer: fine) { .pv-tab.is-done { cursor: pointer; } .pv-tab.is-done:hover { color: rgb(0 0 0 / 64%); } }
.pv-tab-num {
  display: grid; place-items: center; width: 22px; height: 22px; border-radius: 999px; flex: none;
  border: 1.5px solid rgb(0 0 0 / 18%); background: #fff;
  font-size: 11.5px; font-weight: 600; color: rgb(0 0 0 / 56%);
  transition: all 180ms ease;
}
.pv-tab.is-todo .pv-tab-num { color: rgb(0 0 0 / 40%); }
.pv-tab.is-done .pv-tab-num { border-color: transparent; background: rgb(0 0 0 / 9%); color: rgb(0 0 0 / 64%); }
.pv-tab.is-current { color: #000; }
.pv-tab.is-current .pv-tab-num { border-color: #000; background: #000; color: #fff; }

/* ---------- Toggle switch ---------- */
.pv-switch {
  position: relative; flex: none; width: 36px; height: 20px; border-radius: 999px;
  background: rgb(0 0 0 / 14%); border: 0; padding: 0; cursor: pointer;
  transition: background 180ms ease;
}
.pv-switch::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
  border-radius: 999px; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / 25%);
  transition: transform 180ms ease;
}
.pv-switch[aria-checked="true"] { background: #000; }
.pv-switch[aria-checked="true"]::after { transform: translateX(16px); }
.pv-switch:disabled { opacity: .4; cursor: default; }

/* ---------- Segmented control (method picker, tabs) ---------- */
.pv-seg { display: flex; gap: 4px; padding: 4px; border: 1px solid rgb(0 0 0 / 10%); border-radius: 10px; }
.pv-seg button {
  flex: 1; height: 32px; border: 0; background: transparent; border-radius: 7px;
  font-size: 13px; font-weight: 500; color: rgb(0 0 0 / 64%); cursor: pointer;
  transition: background 150ms ease, color 150ms ease;
}
.pv-seg button:hover { background: rgb(0 0 0 / 5%); }
.pv-seg button[aria-pressed="true"] { background: #000; color: #fff; }

/* ---------- Radio row (checkout method choice) ---------- */
.pv-choice { position: relative; }
.pv-choice input { position: absolute; opacity: 0; pointer-events: none; }
.pv-choice label {
  display: flex; align-items: center; gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1px solid rgb(0 0 0 / 10%); border-radius: 12px; background: #fff;
  transition: border-color 150ms ease, background 150ms ease;
}
.pv-choice label:hover { border-color: rgb(0 0 0 / 18%); }
.pv-choice input:checked + label { border-color: rgb(0 0 0 / 55%); background: rgb(0 0 0 / 2%); }
.pv-choice input:focus-visible + label { outline: 2px solid rgb(0 0 0 / 55%); outline-offset: 2px; }
.pv-radio { width: 18px; height: 18px; border-radius: 999px; border: 1.5px solid rgb(0 0 0 / 30%); flex: none; display: grid; place-items: center; transition: border-color 150ms ease; }
.pv-choice input:checked + label .pv-radio { border-color: #000; }
.pv-choice input:checked + label .pv-radio::after { content: ""; width: 10px; height: 10px; border-radius: 999px; background: #000; }

/* ---------- Simulation timeline ---------- */
.pv-step { display: flex; align-items: flex-start; gap: 12px; padding: 9px 0; }
.pv-step-dot {
  width: 20px; height: 20px; border-radius: 999px; flex: none; margin-top: 1px;
  border: 1.5px solid rgb(0 0 0 / 18%); background: #fff;
  display: grid; place-items: center; transition: all 200ms ease-out;
}
.pv-step.is-running .pv-step-dot {
  border-color: rgb(0 0 0 / 40%);
  animation: pv-pulse 1s ease-in-out infinite;
}
.pv-step.is-done .pv-step-dot { border-color: #000; background: #000; }
.pv-step.is-done .pv-step-dot::after {
  content: ""; width: 8px; height: 4.5px; border-left: 1.6px solid #fff; border-bottom: 1.6px solid #fff;
  transform: rotate(-45deg) translate(1px, -1px);
}
.pv-step.is-warn .pv-step-dot { border-color: rgb(154 103 0 / 55%); background: rgb(154 103 0 / 10%); }
.pv-step.is-warn .pv-step-dot::after {
  content: "!"; font-size: 11px; font-weight: 600; line-height: 1; color: #9a6700; transform: none;
}
.pv-step-label { font-size: 13.5px; color: rgb(0 0 0 / 56%); transition: color 200ms ease; }
.pv-step.is-running .pv-step-label, .pv-step.is-done .pv-step-label, .pv-step.is-warn .pv-step-label { color: #000; }
.pv-step-meta { font-size: 12.5px; color: rgb(0 0 0 / 56%); }

@keyframes pv-pulse { 0%, 100% { box-shadow: 0 0 0 0 rgb(0 0 0 / 12%); } 50% { box-shadow: 0 0 0 5px rgb(0 0 0 / 0%); } }

/* Spinner */
.pv-spin { width: 14px; height: 14px; border-radius: 999px; border: 1.7px solid rgb(255 255 255 / 35%); border-top-color: #fff; animation: pv-rot .7s linear infinite; flex: none; }
@keyframes pv-rot { to { transform: rotate(360deg); } }

/* ---------- Toast ---------- */
#pv-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 8px);
  background: #000; color: #fff; font-size: 13px; font-weight: 500;
  padding: 10px 16px; border-radius: 10px; opacity: 0; pointer-events: none;
  transition: opacity 200ms ease-out, transform 200ms ease-out; z-index: 80;
  max-width: min(90vw, 420px); text-align: center;
}
#pv-toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Skeleton shimmer (demo loading) ---------- */
.pv-shimmer { position: relative; overflow: hidden; background: rgb(0 0 0 / 5%); }
.pv-shimmer::after {
  content: ""; position: absolute; inset: 0; transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgb(255 255 255 / 65%), transparent);
  animation: pv-shim 1.4s ease-in-out infinite;
}
@keyframes pv-shim { to { transform: translateX(100%); } }

/* Fade-in for revealed panels */
.pv-reveal { animation: pv-in 260ms ease-out both; }
@keyframes pv-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* Sidebar scroll region */
.pv-nav { scrollbar-width: thin; }

/* Code blocks */
.pv-code { font-family: ui-monospace, "SF Mono", "Cascadia Mono", Consolas, monospace; font-size: 12.5px; line-height: 1.7; }
