/* Kwik Links. Follows BRAND.md: the phone's own font, light grounds, Ink text,
   and Emerald used only for "Paid" (and the overlap in the mark). */
:root {
  --ink: #12201A;
  --ink-2: #33433B;
  --muted: #4A5A52;
  --line: #D5DDD7;
  --line-soft: #E4EAE6;
  --field: #8A9A91;
  --counter: #F4F6F2;
  --white: #FFFFFF;
  --emerald: #0A7B55;
  --error: #A1261B;
  --font: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--counter);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: var(--ink); }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { margin: 0; font-weight: 700; line-height: 1.15; }
h1 { font-size: clamp(28px, 6vw, 40px); letter-spacing: -0.01em; }
h2 { font-size: 22px; }
.h3 { font-size: 18px; }
p { margin: 0; }

.wrap { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 16px; }
.main { flex: 1; padding-top: 28px; padding-bottom: 48px; }
.narrow { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: 20px; }
.stack-sm { display: flex; flex-direction: column; gap: 10px; }
.muted { color: var(--muted); }
.small { font-size: 14px; }
.lead { font-size: 18px; color: var(--ink-2); }
.eyebrow { font-size: 14px; font-weight: 600; color: var(--muted); }

/* Header and footer */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); }
.header-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; padding-top: 12px; padding-bottom: 12px; }
.brand { display: inline-flex; align-items: center; gap: 6px; text-decoration: none; }
.wordmark { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; line-height: 1; }
.header-nav { display: flex; align-items: center; gap: 16px; font-size: 15px; }
.header-nav form { margin: 0; }
.link-button { background: none; border: 0; padding: 0; text-decoration: underline; cursor: pointer; font-size: 15px; }
.site-footer { border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.footer-row { display: flex; justify-content: space-between; gap: 16px; padding-top: 16px; padding-bottom: 16px; }
.site-footer a { color: var(--muted); }

/* Buttons */
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.button {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 0 20px; border: 0; border-radius: 10px;
  background: var(--ink); color: var(--white);
  font-size: 16px; font-weight: 700; text-decoration: none; cursor: pointer;
}
.button-secondary { background: var(--white); color: var(--ink); border: 1.5px solid var(--field); font-weight: 600; }
.button-danger { background: var(--white); color: var(--error); border: 1.5px solid var(--error); font-weight: 600; }
.form > .button { align-self: flex-start; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field label, .field legend { font-weight: 600; padding: 0; }
.hint { font-size: 14px; color: var(--muted); }
.field input[type="text"], .field input[type="email"], .field input[type="tel"], .field input[type="password"], .field select {
  width: 100%; min-height: 48px; padding: 10px 12px;
  background: var(--white); border: 1.5px solid var(--field); border-radius: 8px; font-size: 16px;
}
.has-error input { border-color: var(--error); border-width: 2px; }
.error-text { color: var(--error); font-weight: 600; font-size: 15px; }
.choices { gap: 8px; }
.choices legend { margin-bottom: 4px; }
.choice { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 8px 12px; background: var(--white); border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 400 !important; }
.choice input { width: 20px; height: 20px; accent-color: var(--ink); margin: 0; }
.choice:has(input:checked) { border-color: var(--ink); }

/* Notices */
.notice { padding: 12px 16px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 8px; }
.notice-error { border-left-color: var(--error); }
.notice ul { margin: 6px 0 0; padding-left: 20px; }
.notice-error a { color: var(--error); }

/* Home */
.hero { padding-top: 24px; max-width: 620px; }
.hero h1 { font-size: clamp(32px, 7vw, 52px); line-height: 1.05; }

/* Payment list */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.today { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 14px 16px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.today-amount { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tabs { display: flex; gap: 4px; overflow-x: auto; border-bottom: 1px solid var(--line); }
.tabs a { padding: 10px 12px; white-space: nowrap; text-decoration: none; color: var(--muted); font-weight: 600; border-bottom: 3px solid transparent; margin-bottom: -1px; }
.tabs a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--ink); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); background: var(--white); border: 1px dashed var(--line); border-radius: 12px; }
.payment-list { list-style: none; margin: 0; padding: 0; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.payment-list li + li { border-top: 1px solid var(--line-soft); }
.payment-row { display: flex; justify-content: space-between; gap: 12px; padding: 14px 16px; text-decoration: none; }
.payment-row:hover .row-customer { text-decoration: underline; }
.row-main { display: flex; flex-direction: column; min-width: 0; }
.row-customer { font-weight: 600; }
.row-desc { color: var(--muted); font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-side { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; flex-shrink: 0; text-align: right; }
.row-amount { font-weight: 700; font-variant-numeric: tabular-nums; }
.row-time { font-size: 13px; color: var(--muted); }

/* Status. Emerald means paid, and nothing else. */
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.status-paid { color: var(--emerald); }
.status-cancelled, .status-expired { color: var(--muted); font-weight: 400; }
.paid-dot { display: inline-block; width: 10px; height: 14px; background: var(--emerald); border-radius: 50%; }

/* Cards, lines and receipts */
.card { padding: 18px; background: var(--white); border: 1px solid var(--line); border-radius: 12px; }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 8px; }
.detail-desc { font-size: 22px; }
.lines { margin: 0; display: flex; flex-direction: column; }
.lines > div { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; border-bottom: 1px solid var(--line-soft); }
.lines > div:last-child { border-bottom: 0; }
.lines dt { color: var(--muted); }
.lines dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.line-total dt { color: var(--ink); font-weight: 600; }
.line-total dd { font-size: 24px; font-weight: 700; }
.share-row { display: flex; gap: 8px; }
.share-input { flex: 1; min-width: 0; min-height: 48px; padding: 10px 12px; border: 1.5px solid var(--field); border-radius: 8px; background: var(--counter); font-size: 15px; }
details.card > summary { cursor: pointer; font-weight: 600; min-height: 24px; }
.cancel-form { margin-top: 12px; }

.steps { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.step { display: flex; align-items: center; gap: 10px; color: var(--muted); }
.step::before { content: ""; width: 14px; height: 14px; border: 2px solid var(--field); border-radius: 50%; flex-shrink: 0; }
.step.done { color: var(--ink); font-weight: 600; }
.step.done::before { background: var(--ink); border-color: var(--ink); }

.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.history li { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

/* Customer page */
.receipt { display: flex; flex-direction: column; gap: 14px; padding: 22px 20px; }
.business-name { font-size: clamp(26px, 6vw, 34px); }
.for { font-size: 17px; }
.pay-box { padding: 14px 16px; background: var(--counter); border-radius: 10px; display: flex; flex-direction: column; gap: 4px; }
.pay-line { font-size: 18px; font-weight: 700; }
.paid-line { display: inline-flex; align-items: center; gap: 8px; font-size: 20px; font-weight: 700; color: var(--emerald); }
.paid-line .paid-dot { width: 13px; height: 18px; }
.receipt-head { font-size: clamp(24px, 6vw, 32px); }

/* Privacy */
.prose h2 { font-size: 19px; margin-top: 8px; }
