/* Customer portal. Brand colours arrive from /portal/api/me and are set on :root as --ink, --surface, --line. */
@font-face { font-family: "NHGD"; src: url(/portal/fonts/nhgd-400.woff2) format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "NHGD"; src: url(/portal/fonts/nhgd-500.woff2) format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

:root { --ink: #121110; --surface: #F4F4F4; --line: #E6E6E6; --err: #C0221F; --was: #E02D2D; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: #FFFFFF; color: var(--ink);
  font-family: "NHGD", "Helvetica Neue", Helvetica, Arial, sans-serif; font-size: 16px; line-height: 1.5;
  overflow-wrap: anywhere; -webkit-font-smoothing: antialiased;
}
button, input, textarea { font-family: inherit; font-size: 16px; color: var(--ink); }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
p { margin: 0; }
a { color: var(--ink); }
img { display: block; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.nowrap { white-space: nowrap; }
/* inline icons sit on the capitals of this font, not the line box */
.ic { position: relative; top: -0.09em; flex: none; }

/* ---------- frame ---------- */
.hdr {
  position: fixed; top: 0; left: 0; right: 0; height: 68px; z-index: 20; display: flex; align-items: center; justify-content: center;
  padding: 0 16px; background: #FFFFFF; border-bottom: 1px solid var(--line); transition: transform 0.25s ease;
}
.hdr.hidden { transform: translateY(-100%); }
.hdr .logo { display: flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 8px; }
.hdr .logo img { height: 22px; width: auto; }
.hdr .logo { text-decoration: none; }
.hdr .logo .wordmark { font-size: 18px; font-weight: 500; letter-spacing: .01em; color: var(--ink); }
.hdr nav { display: none; }
main { padding-top: 68px; padding-bottom: 68px; min-height: 100vh; }
.col { margin: 0 auto; }
.tabs {
  position: fixed; left: 0; right: 0; bottom: 0; height: 68px; z-index: 20; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  background: #FFFFFF; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom);
}
.tabs button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: none; border: 0; font-size: 14px; font-weight: 400; }
.tabs button[aria-current="page"] { font-weight: 500; }
.tabs .pill { display: flex; align-items: center; justify-content: center; width: 52px; height: 28px; border-radius: 4px; }
.tabs button[aria-current="page"] .pill { background: var(--surface); }
main.notabs { padding-bottom: 0; }

@media (min-width: 768px) {
  .hdr { transform: none !important; }
  .hdr nav { display: flex; position: absolute; right: 24px; top: 0; bottom: 0; align-items: center; gap: 4px; }
  .hdr nav button { padding: 10px 14px; border: 0; border-radius: 4px; background: none; font-size: 16px; font-weight: 400; }
  .hdr nav button[aria-current="page"] { background: var(--surface); font-weight: 500; }
  .tabs { display: none; }
  main { padding-top: 92px; padding-bottom: 32px; }
  .col { max-width: 560px; }
}

/* ---------- type and blocks ---------- */
.page { padding: 24px 16px 32px; display: flex; flex-direction: column; gap: 32px; }
.page.tight { padding-top: 8px; gap: 16px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-8 { display: flex; flex-direction: column; gap: 8px; }
.stack-12 { display: flex; flex-direction: column; gap: 12px; }
.stack-4 { display: flex; flex-direction: column; gap: 4px; }
h1, .h1 { margin: 0; font-size: 27px; line-height: 1.05; font-weight: 500; letter-spacing: -0.015em; text-wrap: wrap; }
h2, .h2 { margin: 0; font-size: 19px; line-height: 1.15; font-weight: 500; letter-spacing: -0.01em; }
.small { font-size: 14px; }
.b { font-weight: 500; }
.pill-label { align-self: flex-start; background: var(--surface); border-radius: 4px; padding: 2px 8px; font-size: 14px; font-weight: 500; }

.btn { min-height: 56px; border: 0; border-radius: 4px; background: var(--ink); color: #FFFFFF; font-size: 16px; font-weight: 500; padding: 0 16px; display: flex; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.btn:disabled { opacity: 1; }
.btn.outline { background: #FFFFFF; color: var(--ink); border: 1px solid var(--ink); }
.btn.white { background: #FFFFFF; color: var(--ink); min-height: 48px; }
.btn.big { min-height: 64px; padding: 10px 16px; flex-direction: column; gap: 2px; }
.btn.big .sub { font-size: 14px; font-weight: 400; }
.link { align-self: flex-start; background: none; border: 0; padding: 4px 0; font-size: 16px; color: var(--ink); text-decoration: underline; text-align: left; }
.link.center { align-self: center; }
.link.small { font-size: 14px; }
.back { align-self: flex-start; display: flex; align-items: center; gap: 2px; height: 44px; margin-left: -6px; background: none; border: 0; padding: 0; font-size: 16px; }
.bold-link { align-self: flex-start; display: flex; align-items: center; gap: 2px; background: none; border: 0; padding: 4px 0; font-size: 16px; font-weight: 500; }

.card { background: var(--surface); border-radius: 4px; padding: 12px; display: flex; flex-direction: column; gap: 10px; }
.line { display: flex; gap: 12px; align-items: center; }
.line .txt { flex: 1; min-width: 0; line-height: 1.3; }
.line .price { flex: none; white-space: nowrap; }
.pack { position: relative; flex: none; width: 56px; height: 56px; }
.pack img { width: 56px; height: 56px; object-fit: contain; background: #FFFFFF; border-radius: 4px; }
.pack.s48, .pack.s48 img { width: 48px; height: 48px; }
.pack.bordered img { border: 1px solid var(--line); }
.badge { position: absolute; top: -5px; right: -5px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--ink); color: #FFFFFF; font-size: 12px; font-weight: 500; line-height: 20px; text-align: center; }
.total { display: flex; justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; font-weight: 500; }

.previewnote { margin: 16px 16px 0; padding: 12px 16px; border: 1px solid var(--ink); border-radius: 4px; font-size: 14px; }
/* the brand's Home banner: their own designed image, always whole, never cropped (src/banner.js) */
.promo { display: block; width: 100%; padding: 0; border: 0; cursor: pointer; background: var(--surface); border-radius: 4px; overflow: hidden; text-decoration: none; }
.promo img { display: block; width: 100%; height: auto; aspect-ratio: var(--r, auto); }
div.promo { cursor: default; }
@media (min-width: 600px) { .promo img { aspect-ratio: var(--rw, var(--r, auto)); } }
.banner { background: var(--ink); color: #FFFFFF; border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.chip { min-height: 48px; padding: 0 4px; border: 0; border-radius: 4px; background: var(--surface); font-size: 16px; font-weight: 500; }
.choice { min-height: 48px; padding: 0 4px; border-radius: 4px; border: 1px solid var(--surface); background: var(--surface); font-size: 16px; font-weight: 500; }
.choice[aria-checked="true"] { border-color: var(--ink); background: #FFFFFF; }

.extra { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.extra img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; }
.extra .name { line-height: 1.3; flex: 1; text-wrap: balance; }   /* names take what room they need; prices and buttons line up below */   /* long Shopify names wrap; the Add buttons still line up */
.was { color: var(--was); text-decoration: line-through; }
.add { min-height: 44px; border-radius: 4px; background: #FFFFFF; border: 1px solid var(--ink); font-size: 16px; font-weight: 500; }
.stepper { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: center; min-height: 44px; border: 1px solid var(--ink); border-radius: 4px; }
.stepper button { height: 42px; border: 0; background: none; padding: 0; font-size: 22px; line-height: 1; }
.stepper button:disabled { text-decoration: line-through; }
.stepper span { text-align: center; font-weight: 500; }
.remove { align-self: center; background: none; border: 0; padding: 6px 0; font-size: 14px; text-decoration: underline; }
.extra .remove { align-self: center; }
.line .remove { align-self: flex-start; padding: 0; font-size: 14px; }

.rows { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 56px; padding: 0; background: none; border: 0; text-align: left; font-size: 16px; width: 100%; }
.rows .row + .row { border-top: 1px solid var(--line); }

.listcard { width: 100%; background: var(--surface); border: 0; border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 4px; font-size: 16px; line-height: 1.3; text-align: left; }
.listcard .top { width: 100%; display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.listcard .addr { display: block; width: 100%; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); font-size: 16px; }   /* one size for every line on the card (9 Nov) */
.listcard .foot { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 12px; font-size: 16px; }
.listcard .more { display: flex; align-items: center; gap: 2px; flex: none; }

.perk { display: flex; gap: 14px; align-items: flex-start; }
.perk .ico { width: 44px; height: 44px; border-radius: 4px; background: var(--surface); display: flex; align-items: center; justify-content: center; flex: none; }

.radios { display: flex; flex-direction: column; }
.radio { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 0; background: none; border: 0; font-size: 16px; text-align: left; width: 100%; }
.radios .radio + .radio { border-top: 1px solid var(--line); }
.radios.compact .radio { min-height: 44px; }
.radios.compact .radio + .radio { border-top: 0; }
.dot { width: 20px; height: 20px; border-radius: 50%; flex: none; border: 1px solid var(--ink); }
.radio[aria-checked="true"] .dot { border: 6px solid var(--ink); }
.note { background: var(--surface); border-radius: 4px; padding: 12px 16px; }
.note .inline { background: none; border: 0; padding: 0; font-size: 16px; font-weight: 500; text-decoration: underline; }

.sec { padding: 16px 0; display: flex; align-items: flex-start; gap: 12px; }
.sec + .sec { border-top: 1px solid var(--line); }
.sec .grow { flex: 1; min-width: 0; }
.sec .act { flex: none; background: none; border: 0; padding: 0; font-size: 16px; text-decoration: underline; }
.pre { white-space: pre-line; word-spacing: 0.12em; }
.paymarks { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 2px; }
.mark { width: 36px; height: 24px; border: 1px solid var(--line); border-radius: 4px; object-fit: contain; background: #FFFFFF; }
.mark.text { width: auto; display: block; padding: 0 6px; font-size: 12px; font-weight: 500; line-height: 22px; white-space: nowrap; }

/* ---------- forms ---------- */
label { font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.input { height: 48px; border: 1px solid var(--ink); border-radius: 4px; padding: 0 12px; font-size: 16px; min-width: 0; width: 100%; background: #FFFFFF; }
.input[aria-invalid="true"] { border: 2px solid var(--err); }
.input.upper { text-transform: uppercase; word-spacing: 0.12em; }
.err { margin: 0; display: flex; gap: 6px; align-items: flex-start; font-size: 14px; }
.err svg { flex: none; margin-top: 2px; }
.locked { min-height: 48px; display: flex; align-items: center; gap: 8px; padding: 12px; line-height: 1.3; border: 1px solid var(--line); border-radius: 4px; background: var(--surface); }
.locked span { flex: 1; min-width: 0; }
.codes { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.codes input { height: 56px; border: 1px solid var(--ink); border-radius: 4px; text-align: center; font-size: 22px; font-weight: 500; min-width: 0; width: 100%; padding: 0; }
.testcode { background: var(--surface); border-radius: 4px; padding: 12px 16px; }
.warnbox { background: var(--surface); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }

/* ---------- sheets and toasts ---------- */
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(0, 0, 0, 0.4); }
.scrim > .closer { position: absolute; inset: 0; width: 100%; height: 100%; background: none; border: 0; padding: 0; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 92%; border-radius: 4px 4px 0 0; padding: 20px 16px calc(24px + env(safe-area-inset-bottom));
  overflow-y: auto; background: #FFFFFF; display: flex; flex-direction: column; gap: 16px;
}
@media (min-width: 768px) {
  .sheet { left: 50%; top: 50%; bottom: auto; right: auto; transform: translate(-50%, -50%); width: 480px; max-height: 85%; border-radius: 4px; padding: 24px; }
}
.sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 24px; }
.sheet-head h2 { min-width: 0; display: flex; align-items: center; gap: 8px; font-size: 19px; line-height: 1.25; }
.sheet-head .x { width: 48px; height: 48px; flex: none; display: flex; align-items: center; justify-content: center; background: none; border: 0; padding: 0; margin: -12px -13px -12px 0; }

.toast {
  position: fixed; z-index: 25; left: 16px; right: 16px; bottom: calc(80px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.18); background: var(--ink); color: #FFFFFF; border-radius: 4px; padding: 12px 16px; font-size: 16px; line-height: 1.4;
}
.toast span { min-width: 0; text-wrap: balance; }
@media (min-width: 768px) { .toast { left: 50%; right: auto; transform: translateX(-50%); width: 440px; bottom: 24px; } }

/* ---------- calendar ---------- */
.cal-head { display: flex; align-items: center; justify-content: space-between; }
.cal-head button { width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border: 0; background: none; padding: 0; border-radius: 4px; }
.cal-head button:disabled { visibility: hidden; }
.cal-dow { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); text-align: center; font-size: 14px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; }
.cal-grid button { height: 44px; padding: 0; border: 0; border-radius: 4px; font-size: 16px; background: none; }
.cal-grid button:disabled { text-decoration: line-through; }
.cal-grid button.cur { background: var(--surface); font-weight: 500; }
.cal-grid button.sel { background: var(--ink); color: #FFFFFF; font-weight: 500; }
.cal-grid span { height: 44px; }

.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid rgba(255, 255, 255, 0.4); border-top-color: #FFFFFF; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 120px 16px; text-align: center; }

/* keyboard focus in the brand ink, never the browser's default colour */
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.input:focus-visible, .codes input:focus-visible { outline-offset: 1px; }
.sheet:focus-visible { outline: none; }

/* ---------- network: loading shape, progress, busy buttons ---------- */
.sk { background: var(--surface); border-radius: 4px; animation: sk 1.2s ease-in-out infinite alternate; }
.sk-h { height: 30px; width: 75%; }
.sk-line { height: 18px; width: 50%; margin-top: -20px; }
.sk-card { height: 112px; }
.sk-card.short { height: 64px; }
.sk-row { height: 48px; }
@keyframes sk { from { opacity: 1; } to { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 60; overflow: hidden; background: var(--line); }
.progress::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--ink); animation: progress 1.1s ease-in-out infinite; }
@keyframes progress { from { left: -40%; } to { left: 100%; } }
/* Working on it (9 Nov): the tapped button keeps its size and shows a spinner instead of its words, like the
   site's CTA buttons, so a tap on a slow connection never looks dead. White on dark buttons, ink on the rest. */
.is-busy { position: relative; color: transparent !important; cursor: progress; }
.is-busy > * { visibility: hidden; }
.is-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 18px; height: 18px; margin: -11px 0 0 -11px; border: 2px solid rgba(18, 17, 16, 0.2); border-top-color: var(--ink); border-radius: 50%; animation: spin 0.8s linear infinite; visibility: visible; }
.btn.is-busy:not(.outline):not(.white)::after, .promo-cta.is-busy::after { border-color: rgba(255, 255, 255, 0.35); border-top-color: #FFFFFF; }
/* while one change is working, the others wait (no second change on top of the first) */
body.busy [data-act]:not(.is-busy):not([data-act="close"]) { pointer-events: none; }
/* every button shows it was pressed the moment it's touched, before the network answers */
button:not(:disabled):active, a.btn:active, .promo:active { transform: scale(0.98); }
button, a.btn, .promo { transition: transform 0.08s ease; -webkit-tap-highlight-color: transparent; }
/* a slow connection: say so, above everything, until the change finishes */
.slownote { position: fixed; left: 16px; right: 16px; top: 12px; z-index: 61; background: var(--ink); color: #FFFFFF; border-radius: 4px; padding: 12px 16px; font-size: 14px; text-align: center; }
@media (min-width: 768px) { .slownote { left: 50%; right: auto; width: 440px; transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .is-busy::after { animation-duration: 2s; } button:active { transform: none; } }
.center { text-align: center; }

/* login reassurance and the greeting: kept quiet (Jack: less is more) */
.secure { display: flex; align-items: center; gap: 6px; width: max-content; margin: 4px auto 0; padding: 6px 12px; border: 1px solid var(--ink); border-radius: 999px; font-size: 14px; font-weight: 500; }
.hello { margin-bottom: 8px; }

/* a struck was-price above what was paid, right-aligned (order receipts) */
.price.stacked { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.3; }

/* Home's sections are cards (9 Nov, Jack: like P&F's Skio portal, not divider lines), in the brand's grey
   surface so they suit any brand (no cream: that's Legit's). Inside a grey card, chips, icon tiles and the
   stepper go white so they still stand out. */
.page.home { gap: 24px; }
/* the refill card, then its two notes ("Your refills carry on…" / "Need it sooner?") as one pair, same size */
.refill { display: flex; flex-direction: column; gap: 12px; }
.refill .notes { display: flex; flex-direction: column; gap: 8px; }
.refill .notes .link { padding: 0; }
.hsec, .impact { background: var(--surface); border-radius: 4px; padding: 16px; display: flex; flex-direction: column; gap: 12px; }
.hsec .chip, .impact .perk .ico, .hsec .stepper { background: #FFFFFF; }
.impact .perk { align-items: center; }
/* "You've saved £26.40": a percentage badge, the figure, and what it's from (P&F's Skio has the same shape) */
.saved { background: var(--surface); border-radius: 4px; padding: 16px; display: flex; align-items: center; gap: 14px; }
.saved .ico { width: 44px; height: 44px; border-radius: 4px; background: #FFFFFF; display: flex; align-items: center; justify-content: center; flex: none; }
.saved .b { font-size: 19px; line-height: 1.2; }
.hsec.nav { padding: 0 16px; }
.navrow { width: 100%; min-height: 56px; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0; border: 0; background: none; font-size: 16px; font-weight: 500; text-align: left; }

/* Line breaks (9 Nov QC at 320 to 430): headings break where the words run out ("Your next refill ships /
   Tue 1 Dec"), never rebalanced into odd splits; product names balance ("Concentrated / Body Wash", never a
   lone "Wash"); an address stays in one piece when it fits on a line. */
.line .txt .b { text-wrap: balance; }
.keep { display: inline-block; max-width: 100%; }

/* a note about a section ("Used for all 4 subscriptions."): smaller and on a light tag, so it reads apart
   from the details above it without fading (Jack, 9 Nov) */
.tag { display: inline-block; margin-top: 8px; padding: 3px 8px; border-radius: 4px; background: var(--surface); font-size: 14px; }
/* "Step 1 of 3" under each cancel screen (9 Nov) */
.step { margin-top: 8px; }
/* the "One last question" box after cancelling (9 Nov) */
.input.area { height: auto; min-height: 96px; padding: 12px; line-height: 1.4; resize: vertical; display: block; }
/* the feedback box at the end of the cancel flow: a light border, black only once you are typing (Jack, 9 Nov) */
.fb .input.area { border-color: #CCCCCC; }
.fb .input.area:focus { border-color: var(--ink); }
.fb .input.area[aria-invalid="true"] { border: 2px solid var(--err); }
/* a choice with its date under it: "1 month" / "Sat 9 Jan" (9 Nov) */
.chip.two { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 8px 4px; min-height: 60px; }
.chip.two .sub { font-size: 14px; font-weight: 400; }

/* expired or broken email link: say so plainly, then the email form (10 Nov) */
.expired{display:flex;flex-direction:column;align-items:center;text-align:center;gap:12px}
.page.expired{padding-top:48px}
.expired .ring{width:56px;height:56px;border:2px solid var(--ink);border-radius:50%;display:grid;place-items:center;color:var(--ink)}
.expired p{max-width:34ch}
.expired .btn{align-self:stretch;margin-top:12px}
.expired .ring svg,.expired .ring svg *{color:var(--ink);stroke:var(--ink)}
