/* Seller Portal, in the withadi.dev landing's design: its tokens (tokens.css) and faces (fonts.css)
   verbatim, and the rules below translated from its global.css — the base, the type, the one
   container, the nav, the ink button, hairline rows instead of cards — plus the form and table
   specs of the ADI design system (DESIGN.md §6), which the landing itself has no use for. */

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

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: 'tnum';
  text-rendering: optimizeLegibility;
}

h1, h2, p { margin: 0; padding: 0; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

/* The sprite that holds the mark: present (so its masks resolve), never seen. */
.defs { position: absolute; width: 0; height: 0; overflow: hidden; }
.mark { display: block; flex: none; }
.lobe-back { fill: var(--ink-3); }
.lobe-mid { fill: var(--accent); }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* On paper the ring is the accent (DESIGN.md §3, `--focus` in the light set). */
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* Text that carries content stays at --ink-2 or darker (7.6:1); --ink-3 (3.4:1) is chrome only,
   as the landing uses it: the footer and the product name beside the wordmark. */

/* ---- type ---------------------------------------------------------------------------------- */
h1, h2 {
  font-family: var(--display);
  font-weight: 500;
  letter-spacing: -0.03em;
  line-height: 1;
  font-variation-settings: 'opsz' 96;
  text-wrap: balance;
  color: var(--ink);
}

/* The document size of the landing's /privacy and /security titles, not the hero's. */
h1 {
  font-size: clamp(34px, 4vw, 48px);
  letter-spacing: -0.035em;
  margin-bottom: 16px;
  overflow-wrap: anywhere;
}

h2 {
  font-size: clamp(24px, 2.6vw, 30px);
  margin-bottom: 12px;
}

p { max-width: 60ch; color: var(--ink-2); }

.lede { font-size: 18px; }

/* ---- layout -------------------------------------------------------------------------------- */
/* One container: the nav, every section and the footer share its left edge. */
.c {
  width: min(var(--container), 100% - 48px);
  margin-inline: auto;
}

main { flex: 1; }

main section { padding: 56px 0 64px; }
main section + section { border-top: 1px solid var(--line); }
/* The documents pages are views of their own, not sections after a hidden one. */
#documents-view, #document-view { border-top: 0; }

/* ---- nav ----------------------------------------------------------------------------------- */
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 72px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 17px;
  color: var(--ink);
  white-space: nowrap;
}

.brand .product { font-weight: 400; color: var(--ink-3); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
  font-size: 15px;
  color: var(--ink-2);
  min-width: 0;
}

#whoami-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.navlink {
  font: inherit;
  color: var(--ink-2);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  white-space: nowrap;
}

.navlink:hover { color: var(--ink); }

/* ---- controls ------------------------------------------------------------------------------ */
/* The page's one button: ink on paper, as the landing's hero has it. */
.btn {
  display: inline-flex;
  align-items: center;
  font: inherit;
  font-weight: 500;
  font-size: 16px;
  padding: 14px 24px;
  border: 0;
  border-radius: 8px;
  background: var(--ink);
  color: var(--bg);
  cursor: pointer;
  transition: background 120ms ease-out;
}

.btn:hover { background: var(--ink-2); }
.btn:disabled { background: var(--ink-3); cursor: default; }

/* A square row action, as the landing's gallery steps are drawn: hairline, no fill until hover. */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  transition: background 120ms ease-out, color 120ms ease-out;
}

.icon:hover { background: var(--chip); color: var(--ink); }
.icon.danger:hover { background: var(--err-soft); color: var(--accent); }

.tag {
  display: inline-block;
  padding: 3px 10px;
  border-radius: var(--r-pill);
  background: var(--chip);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.5;
}

/* ---- forms (DESIGN.md §6: label above, help below, no card) -------------------------------- */
.form { margin-top: 32px; max-width: 400px; }

.field { display: block; margin-bottom: 16px; }

.field > span:first-child {
  display: block;
  margin-bottom: 6px;
  font-size: 14px;
  font-weight: 500;
  color: var(--ink-2);
}

.field small {
  display: block;
  margin-top: 6px;
  font-size: var(--fs-small);
  color: var(--ink-2);
}

input,
select {
  display: block;
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--bg-raise);
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  padding: 10px 12px;
  transition: border-color 120ms ease-out;
}

input::placeholder { color: var(--ink-3); }
input:hover, select:hover { border-color: var(--ink-3); }

input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 1px;
  border-color: transparent;
}

/* A select with the small chevron at right, drawn in CSS (the CSP allows no data: images). */
.select { position: relative; display: block; }
.select select { appearance: none; padding-right: 36px; cursor: pointer; }

.select::after {
  content: '';
  position: absolute;
  right: 15px;
  top: 50%;
  width: 6px;
  height: 6px;
  margin-top: -5px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg);
  pointer-events: none;
}

.actions { margin-top: 8px; }

/* An error is a sentence with a 6px dot (§3 status): --err as type does not clear 4.5:1 on paper. */
.error {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 15px;
  color: var(--ink);
}

.error:not(:empty) { margin: 0 0 16px; }

.error:not(:empty)::before {
  content: '';
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--err);
  transform: translateY(-2px);
}

.empty,
.note {
  margin-top: 16px;
  font-size: 15px;
  color: var(--ink-2);
}

/* The add form: two columns of fields at the form measure. */
.grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 16px;
  max-width: var(--form-w);
}

.grid .error,
.grid .actions { grid-column: 1 / -1; }

/* ---- the users table (DESIGN.md §6: no card, hairline rows) -------------------------------- */
.users {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 15px;
}

.users th {
  padding: 0 16px 10px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}

.users td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: middle;
}

.users tbody tr:hover { background: var(--bg-hover); }
.users .c-name { color: var(--ink); font-weight: 500; }
.users .c-added { white-space: nowrap; }
.users .c-act { width: 1%; padding-right: 0; text-align: right; }
.users th:last-child { padding-right: 0; }

/* ---- nav: the current section ----------------------------------------------------------- */
.navlink[aria-current="page"] { color: var(--ink); }

/* An inline text link: ink, underlined, as the landing's body links. */
.link {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 3px;
}
.link:hover { text-decoration-color: var(--ink); }

a.btn { text-decoration: none; }

/* ---- the rates panel ------------------------------------------------------------------------ */
.rates .lede strong { color: var(--ink); font-weight: 500; }

/* The two numbers that matter, in the display face. */
.figures {
  display: flex;
  gap: 56px;
  margin: 32px 0 0;
}
.figures dt { font-size: 14px; color: var(--ink-2); margin-bottom: 4px; }
.figures dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(40px, 5vw, 56px);
  line-height: 1;
  letter-spacing: -0.035em;
  font-variation-settings: 'opsz' 96;
  color: var(--ink);
}

.tiers {
  width: 100%;
  max-width: var(--form-w);
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 15px;
}
.tiers th {
  padding: 0 16px 10px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}
.tiers td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.tiers th:not(:first-child), .tiers td:not(:first-child) { text-align: right; width: 25%; }
.tiers th:last-child, .tiers td:last-child { padding-right: 0; }
.tiers .c-name { color: var(--ink); }
.tiers tr.current td { background: var(--bg-hover); color: var(--ink); font-weight: 500; }
.tiers tr.current td:first-child { box-shadow: inset 2px 0 0 var(--accent); padding-left: 12px; }
.tiers .tag { margin-left: 8px; font-weight: 400; }

.progress { margin-top: 32px; max-width: var(--form-w); }
.progress-line { font-size: 15px; }

/* A hairline track with the count as an ink fill and the M and H thresholds as ticks. */
.bar {
  position: relative;
  height: 6px;
  margin: 14px 0 28px;
  border-radius: var(--r-pill);
  background: var(--chip);
}
.bar .fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: var(--r-pill);
  background: var(--ink);
}
.bar .tick {
  position: absolute;
  top: -4px;
  width: 1px;
  height: 14px;
  background: var(--ink-2);
}
.bar .tick span {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 12px;
  color: var(--ink-2);
}

/* ---- documents ----------------------------------------------------------------------------- */
.doclist {
  list-style: none;
  margin: 40px 0 0;
  padding: 0;
  border-top: 1px solid var(--line-strong);
}
.doclist li {
  display: grid;
  grid-template-columns: auto auto 1fr auto;
  align-items: center;
  gap: 4px 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.doclist .doc-title { color: var(--ink); font-weight: 500; font-size: 17px; }
.doclist .doc-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.doclist .tag { justify-self: start; }
.doclist .doc-meta { font-size: 14px; color: var(--ink-2); }
.doclist .doc-links { display: flex; gap: 20px; font-size: 15px; }

.document .back { margin-bottom: 24px; font-size: 15px; }
.docmeta { display: flex; align-items: center; gap: 12px; font-size: 14px; }
#doc-meta { overflow-wrap: anywhere; }
.document .actions { margin: 24px 0 0; }

/* The document body: the landing's /privacy prose measure and rhythm. */
.prose {
  max-width: 68ch;
  margin-top: 48px;
  padding-top: 40px;
  border-top: 1px solid var(--line);
  color: var(--ink-2);
}
.prose p, .prose ul, .prose ol { margin: 0 0 16px; max-width: none; }
.prose h2 { font-size: clamp(22px, 2.2vw, 26px); margin: 40px 0 14px; }
.prose h3, .prose h4, .prose h5, .prose h6 {
  font-family: var(--sans); font-size: 17px; font-weight: 600; color: var(--ink); margin: 28px 0 10px;
}
.prose strong, .prose b { color: var(--ink); font-weight: 600; }
.prose a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.prose table { width: 100%; margin: 8px 0 24px; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { padding: 10px 16px 10px 0; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.prose th { font-weight: 400; font-size: 13px; color: var(--ink-2); border-bottom-color: var(--line-strong); }
.prose th strong { font-weight: 400; color: var(--ink-2); }
.prose th p, .prose td p { margin: 0; }
/* ---- payments: Stripe status and payment links -------------------------------------------- */
/* Status pills: the 12% tint behind ink text (DESIGN.md §3); colour alone never carries meaning. */
.tag.ok { background: var(--ok-soft); color: var(--ink); }
.tag.warn { background: var(--warn-soft); color: var(--ink); }

.status {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 48px;
  margin: 32px 0 0;
}
.status div { min-width: 0; }
.status dt { font-size: 13px; color: var(--ink-2); margin-bottom: 6px; }
.status dd { margin: 0; color: var(--ink); font-size: 15px; overflow-wrap: anywhere; }
#st-account { font-family: var(--mono); font-size: var(--fs-mono); color: var(--code); }

.actions.row { display: flex; align-items: center; gap: 24px; margin-top: 32px; }
.stripe .note, .links .note { max-width: 60ch; }
.note.off { color: var(--ink); }
.note.off::before {
  content: '';
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--warn);
  transform: translateY(-2px);
}
.field .opt { font-weight: 400; color: var(--ink-2); }
.grid .wide { grid-column: 1 / -1; margin: 0 0 16px; }

/* A small hairline row action with a label (the icon button's sibling). */
.chip {
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  padding: 5px 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--r);
  background: none;
  color: var(--ink-2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 120ms ease-out, color 120ms ease-out;
}
.chip:hover { background: var(--chip); color: var(--ink); }
.chip.danger:hover { background: var(--err-soft); color: var(--ink); }
.chip:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }

.deals {
  width: 100%;
  margin-top: 40px;
  border-collapse: collapse;
  font-size: 15px;
}
.deals th {
  padding: 0 16px 10px 0;
  text-align: left;
  font-size: 13px;
  font-weight: 400;
  color: var(--ink-2);
  border-bottom: 1px solid var(--line-strong);
}
.deals td {
  padding: 14px 16px 14px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
  vertical-align: top;
}
.deals tbody tr:hover { background: var(--bg-hover); }
.deals .c-name { color: var(--ink); font-weight: 500; }
.deals .sub { display: block; margin-top: 4px; font-size: 13.5px; font-weight: 400; color: var(--ink-2); overflow-wrap: anywhere; }
.deals .c-added { white-space: nowrap; }
.deals .c-act { width: 1%; padding-right: 0; text-align: right; white-space: nowrap; }
.deals .c-act .chip + .chip { margin-left: 8px; }
.deals th:last-child { padding-right: 0; }

.thanks { border-top: 0; }


/* ---- footer -------------------------------------------------------------------------------- */
footer {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 40px 0 64px;
  border-top: 1px solid var(--line);
  font-size: 14px;
  color: var(--ink-3);
}

footer .brand { margin-right: auto; font-size: 15px; }
footer a:hover { color: var(--ink); }

/* ---- narrow -------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  main section { padding: 40px 0 48px; }
  .nav-links { gap: 20px; }
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }

  .figures { gap: 40px; }
  .doclist li { grid-template-columns: auto 1fr; }
  .doclist .doc-meta, .doclist .doc-links { grid-column: 1 / -1; }

  /* Each user becomes a short stack: name and the action, then email, then role and date. */
  .users thead { display: none; }
  .users, .users tbody { display: block; }
  .users { margin-top: 32px; border-top: 1px solid var(--line-strong); }

  .users tr {
    display: grid;
    grid-template-columns: auto 1fr auto;
    grid-template-areas: "name name act" "email email act" "role added act";
    gap: 2px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }

  .users td { display: block; padding: 0; border: 0; }
  .users .c-name { grid-area: name; }
  .users .c-email { grid-area: email; overflow-wrap: anywhere; }
  .users .c-role { grid-area: role; margin-top: 6px; }
  .users .c-added { grid-area: added; margin-top: 6px; align-self: center; font-size: 14px; }
  .users .c-act { grid-area: act; align-self: center; width: auto; }

  /* Each payment link becomes a short stack, as the users rows do. */
  .deals thead { display: none; }
  .deals, .deals tbody { display: block; }
  .deals { margin-top: 32px; border-top: 1px solid var(--line-strong); }
  .deals tr {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "name status" "qty added" "act act";
    gap: 6px 12px;
    padding: 14px 0;
    border-bottom: 1px solid var(--line);
  }
  .deals td { display: block; padding: 0; border: 0; }
  .deals .c-name { grid-area: name; }
  .deals .c-status { grid-area: status; text-align: right; }
  .deals .c-qty { grid-area: qty; }
  .deals .c-added { grid-area: added; text-align: right; font-size: 14px; }
  .deals .c-act { grid-area: act; width: auto; text-align: left; }
  .deals .c-act:empty { display: none; }
  .status { gap: 16px 32px; }
}

@media (max-width: 560px) {
  #whoami-name { display: none; }
  .nav-links { gap: 18px; }
  .brand .product { display: none; }
}

/* The Ukraine attestation: a checkbox beside the statement, at the form measure. */
#ua-form { max-width: 60ch; }
.check { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; font-size: 15px; color: var(--ink); cursor: pointer; }
.check input { width: 18px; height: 18px; padding: 0; margin: 3px 0 0; flex: none; accent-color: var(--ink); }
.check span { flex: 1; max-width: 60ch; }

/* The payouts list under the ledger. */
.payouts h3 { font-family: var(--display); font-weight: 500; font-size: 20px; letter-spacing: -0.02em; color: var(--ink); margin: 40px 0 0; }
