/* Round 11 (Tiago, 16 Nov): the screens after log in go to the night side too, matching log in / register.
   "If you enter and get into the dashboard, the background is still on a light version … we just need to update."
   Black-and-white and dark: the charcoal cloth (../assets/img/app-night/night-cloth.jpg) under a dark veil, a dark top
   bar, charcoal tiles with light words, the conversion tile in off-white as the one light accent, hover still swaps
   light ↔ dark, main buttons off-white with ink words. Loaded last, after app-light.css. Previews of the brand's own store
   (the plugin preview, the install window) keep their store look. No shadows anywhere (Tiago, 13 Nov). */

:root {
  --white: rgba(243,241,238,.94); --white-2: rgba(243,241,238,.72); --white-3: rgba(243,241,238,.52);
  --line: rgba(243,241,238,.14); --line-2: rgba(243,241,238,.26);
  --series-a: #F3F1EE; --series-b: rgba(243,241,238,.4);
  --night-tile: rgba(20,19,18,.86); --night-ink: #141413; --night-off: #F3F1EE;
}
html { background: #0c0b0a; color-scheme: dark; }
body { color: var(--white); }

/* background: the night cloth under a dark veil (no golden band, no grid) */
body .cloth { background: #0c0b0a url(../assets/img/app-night/night-cloth.jpg) center / cover no-repeat; }
body .cloth::before { display: none; }
body .cloth::after { background: linear-gradient(180deg, rgba(10,9,8,.62) 0%, rgba(10,9,8,.5) 50%, rgba(10,9,8,.66) 100%) !important; }
body .v7-bg .v7-tile.v7-glass { background: rgba(243,241,238,.04); }
body .v7-bg .v7-tile:not(.v7-glass) { background: rgba(243,241,238,.08); }

/* page titles: off-white, no shadow needed on the dark ground */
body .screen .head > .title { color: var(--night-off); }

/* the top bar: dark glass, light words, the current page in off-white */
body .nav.v7-nav { background: rgba(14,13,12,.86) !important; border-bottom: 1px solid rgba(243,241,238,.1); }
body .nav .brand img, body .nav .brand .wm, body .nav .brand .sym { filter: invert(1); }
body .nav-links a { color: var(--white-2); }
body .nav-links a:hover { color: var(--white); }
body .nav-links a[aria-current="page"] { background: var(--night-off); color: var(--night-ink); }
body .who > button { border-color: var(--line-2); color: var(--white-2); background: rgba(243,241,238,.05); }
body .avatar { background: var(--night-off); color: var(--night-ink); }
body .chip { background: rgba(243,241,238,.06); border-color: var(--line); color: var(--white-2); }
body .menu { background: #141312; border-color: var(--line); }
body .menu a:hover, body .menu button:hover { background: rgba(243,241,238,.07); }

/* controls on the background */
body .seg, body .screen-head .seg { background: rgba(243,241,238,.06); border-color: var(--line); }
body .seg button { color: var(--white-2); }
body .seg button[aria-pressed="true"], body .screen-head .seg button[aria-pressed="true"] { background: var(--night-off); color: var(--night-ink); }
body .btn { border-color: rgba(243,241,238,.32); color: var(--white); background: transparent; }
body .btn:hover { background: rgba(243,241,238,.08); border-color: rgba(243,241,238,.55); }
body .btn.primary, body .btn.light { background: var(--night-off); border-color: var(--night-off); color: var(--night-ink); }
body .inst-body .what .btn.primary { background: #141413; border-color: #141413; color: #F3F1EE; }   /* inside the store's white window: the dark button */
body .btn.primary:hover { background: #fff; border-color: #fff; color: var(--night-ink); }
body .input { background-color: rgba(243,241,238,.06); border-color: var(--line-2); color: var(--white); }
body .input:focus { border-color: rgba(243,241,238,.6); }
body select.input { background-image: linear-gradient(45deg, transparent 50%, var(--white-2) 50%), linear-gradient(135deg, var(--white-2) 50%, transparent 50%); }
body .switch { background: rgba(243,241,238,.2); }
body .switch[aria-checked="true"] { background: var(--night-off); }
body .switch[aria-checked="true"]::after { background: var(--night-ink); }
body .check input, body .reason input, body .reason input[type="checkbox"] { accent-color: #F3F1EE; }
body .stepper { background: rgba(243,241,238,.05); border-color: var(--line-2); }
body .stepper button, body .stepper input { color: var(--white); }
body .tag { border-color: rgba(243,241,238,.32); color: var(--white-2); }
body .tag.sample { border-color: rgba(235,195,138,.5); color: #EBC38A; }
body .src.live, body .data-live { border-color: rgba(111,211,162,.6) !important; color: #9FE3BF !important; }
body .chip.live::before { background: #6FD3A2; }
body .meter { background: rgba(243,241,238,.12); }
body .meter.accent > i, body .meter > i { background: var(--night-off); }
body .keybox { background: rgba(243,241,238,.05); border-color: var(--line-2); }
body .link { color: var(--white-2); text-decoration-color: rgba(243,241,238,.32); }
body .link.quiet { text-decoration-color: rgba(243,241,238,.16); }
body .rows.steps > button.r[aria-pressed="true"]::after { background: var(--night-off); }
body [data-screen="analytics"] .screen-head > div:last-child { background: var(--night-tile); }
body .looksmeter.warn .label::after { color: #EBC38A; }

/* tiles: charcoal with light words; the conversion tile is the light one; hover swaps light ↔ dark */
body .screen .card, body .screen .plan {
  --white: rgba(243,241,238,.94); --white-2: rgba(243,241,238,.72); --white-3: rgba(243,241,238,.52);
  --line: rgba(243,241,238,.12); --line-2: rgba(243,241,238,.24); --v7-track: rgba(243,241,238,.12);
  --series-a: #F3F1EE; --series-b: rgba(243,241,238,.4);
  background: var(--night-tile); color: var(--white); border: 1px solid rgba(243,241,238,.08);
}
body .screen .card.conv, body .screen .card:hover, body .screen .plan:hover {
  --white: rgba(20,19,18,.94); --white-2: rgba(20,19,18,.68); --white-3: rgba(20,19,18,.5);
  --line: rgba(20,19,18,.12); --line-2: rgba(20,19,18,.22); --v7-track: rgba(20,19,18,.1);
  --series-a: #141413; --series-b: rgba(20,19,18,.32);
  background: var(--night-off); color: var(--white);
}
body .screen .card.conv:hover {
  --white: rgba(243,241,238,.94); --white-2: rgba(243,241,238,.72); --white-3: rgba(243,241,238,.52);
  --line: rgba(243,241,238,.12); --line-2: rgba(243,241,238,.24); --v7-track: rgba(243,241,238,.12);
  --series-a: #F3F1EE; --series-b: rgba(243,241,238,.4); background: var(--night-tile);
}
body .screen .card .seg button[aria-pressed="true"] { background: var(--white); color: var(--night-tile); }
body .screen .card:hover .seg button[aria-pressed="true"], body .screen .card.conv .seg button[aria-pressed="true"] { color: var(--night-off); background: var(--night-ink); }
body .screen .card .src { border-color: var(--line-2); color: var(--white-3); }
body .screen .card .src.live { border-color: rgba(111,211,162,.6) !important; color: #9FE3BF !important; }
body .screen .card:hover .src.live, body .screen .card.conv .src.live { border-color: #2E8B5E !important; color: #1F7A4D !important; }
body .screen .card .input, body .screen .card select, body .screen .card textarea { background-color: rgba(243,241,238,.06); border-color: var(--line-2); color: var(--white); }
body .screen .card:hover .input, body .screen .card:hover select, body .screen .card:hover textarea { background-color: #fff; }
body .lps-card .stepper { background: rgba(243,241,238,.06); }
body .lps-card:hover .stepper { background: #fff; }
body .lps-card .lim { background: var(--night-off); color: var(--night-ink); }
body .lps-card:hover .lim { background: var(--night-ink); color: var(--night-off); }
body .chart .dot.a, body .chart .dot.b { stroke: var(--night-tile); }
body .card:hover .chart .dot, body .card.conv .chart .dot { stroke: var(--night-off); }
body .screen .plan[aria-pressed="true"] { border-color: var(--night-off); outline: 2px solid var(--night-off); outline-offset: -2px; }

/* dialogs, tooltip, toast */
body .modal-bg { background: rgba(6,6,5,.62); }
body .modal { background: #141312; color: var(--white); border-color: var(--line); }
body .mclose { color: var(--white-2); border-color: var(--line-2); }
body .offer { border-color: var(--line-2); background: rgba(243,241,238,.04); }
body .pk-tag { border-color: var(--line-2); color: var(--white); }
body .tip { background: #F3F1EE; color: #141413; }
body .tip .t, body .tip .row { color: #141413; }
body .toast { background: var(--night-off); color: var(--night-ink); }

/* the brand's own store stays in its own look (the plugin preview, the install window): ink words inside */
body .win > .body, body .device .store { --white: rgba(17,17,17,.92); --white-2: rgba(17,17,17,.66); --white-3: rgba(17,17,17,.46);
  --line: rgba(17,17,17,.12); --line-2: rgba(17,17,17,.22); color: #111; }
body .inst-body .what .btn:not(.primary) { color: #111; border-color: rgba(17,17,17,.3); background: #fff; }

/* ---------- the shopper journey (Tiago, 17 Nov): saw → clicked → on them → in the bag → bought, mantis vs everyone else ---------- */
.main-chart { display: grid; grid-template-rows: auto minmax(0, 1fr); }
.main-chart .card-head { flex-wrap: wrap; row-gap: 6px; }
.main-chart .card-head .seg button { padding: 0 10px; }
.journey { display: grid; grid-template-columns: auto repeat(5, minmax(0, 1fr) auto); grid-template-columns: 9.5ch minmax(0,1fr) 1.4ch minmax(0,1fr) 1.4ch minmax(0,1fr) 1.4ch minmax(0,1fr) 1.4ch minmax(0,1fr);
  align-items: stretch; gap: 0 6px; min-height: 0; }
.journey .jrows { display: grid; grid-template-rows: 2.6em 1fr 1fr 1.6em; align-items: center; font-size: 10.5px; color: var(--white-2); line-height: 1.25; }
.journey .jrows .jk.a { grid-row: 2; color: var(--white); } .journey .jrows .jk.b { grid-row: 3; }
.journey .jcol { display: grid; grid-template-rows: 2.6em 1fr 1fr 1.6em; align-items: center; min-width: 0; }
.journey .jl { font-size: 11px; color: var(--white-2); letter-spacing: .03em; align-self: end; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.journey .jl .src { margin-left: 4px; }
.journey .jv { display: grid; gap: 6px; align-content: center; }
.journey .jv b { font-family: var(--font-display); font-weight: 400; font-size: clamp(22px, 1.9vw, 34px); line-height: 1; color: var(--white); }
.journey .jv.b b { font-size: clamp(16px, 1.25vw, 22px); color: var(--white-2); }
.journey .jb { display: block; height: 4px; background: var(--v7-track); }
.journey .jb i { display: block; height: 100%; background: var(--white); }
.journey .jv.b .jb i { background: var(--white-3); }
.journey .jx { font-size: 10.5px; color: var(--white-2); align-self: start; }
.journey .jarrow { align-self: center; color: var(--white-3); font-size: 12px; }
@media (max-height: 760px) { .journey .jv b { font-size: 22px; } .journey .jv.b b { font-size: 15px; } }
@media (max-width: 900px) { .journey { grid-template-columns: 1fr; gap: 10px; } .journey .jarrow { display: none; } .journey .jcol, .journey .jrows { grid-template-rows: auto; grid-auto-flow: column; } }
.journey .jrows .jk.x { grid-row: 4; font-size: 10px; color: var(--white-3); }
.journey .jv b { font-size: clamp(20px, 1.6vw, 30px); white-space: nowrap; }
.journey .jcol { overflow: hidden; }

/* ---------- round 13 (Tiago, 17 Nov): usage limits. one pool of looks shared by every shopper; the per-shopper limit is a ceiling ---------- */
/* the dashboard's alerts, under the title: amber at 80%, solid amber with the upgrade button at 100%, plain for "most shoppers hit their limit" */
/* they sit to the right of the title, above the looks meter, one line each */
[data-screen="analytics"] .screen-head > .head-r { display: grid; justify-items: stretch; gap: 8px; flex: none; width: min-content; max-width: 100%; background: none !important; padding: 0 !important; border: 0 !important; }
[data-screen="analytics"] .screen-head .head-bar { background: var(--night-tile); padding: 10px 12px 10px 16px; position: relative; z-index: 1; }
.alerts { display: grid; gap: 6px; justify-items: stretch; width: 0; min-width: 100%; }   /* takes the bar's width, never sets it */
[data-screen="analytics"] .looksmeter .top .label, [data-screen="analytics"] .looksmeter .top .small { white-space: nowrap; }   /* one line, so the bar stays short */
[data-screen="analytics"] .looksmeter { width: auto; min-width: clamp(250px, 20vw, 300px); }
.alerts:empty { display: none; }
.alert { display: flex; align-items: center; flex-wrap: nowrap; gap: 4px 12px; margin: 0; padding: 5px 8px 5px 10px; max-width: 100%;
  font-size: 11.5px; line-height: 1.35; color: var(--white); background: rgba(20,19,18,.86); border: 1px solid var(--line-2); }
.alert::before { content: ""; width: 7px; height: 7px; flex: none; align-self: center; background: var(--white-2); }
.alert.warn { border-color: rgba(235,195,138,.6); color: #F3E2C4; }
.alert.warn::before { background: #EBC38A; }
.alert.full { background: #EBC38A; border-color: #EBC38A; color: #141413; }
.alert.full::before { background: #141413; }
body .alert.full .btn.primary { background: #141413; border-color: #141413; color: #F3F1EE; min-height: 26px; padding: 0 12px; }
.alert.full .link { color: #141413; text-decoration-color: rgba(20,19,18,.45); }
.alert .msg { flex: 0 1 auto; min-width: 0; }
.alert { min-width: 0; overflow: hidden; }
[data-screen="analytics"] .screen-head:has(.alert.warn, .alert.full) #aMore { display: none; }   /* the pool alert carries the upgrade link */
.alert .link, .alert .btn, .alert .x { flex: none; white-space: nowrap; }
.alert .link { font-size: 11px; }
.alert .x { background: none; border: 0; padding: 0 2px; color: var(--white-3); font: inherit; font-size: 14px; line-height: 1; cursor: pointer; }
.alert .x:hover { color: var(--white); }
.pulse { outline: 2px solid #EBC38A !important; outline-offset: 3px; }
.looksmeter.full .meter > i { background: #EBC38A; }
.looksmeter.full .label::after { content: none; }
/* billing: the pool and the per-shopper limit together */
.pool-card { display: grid; gap: clamp(5px, .9vh, 10px); }
.pool-card .months { height: clamp(52px, 10vh, 130px); }
.pool-card .meter.full > i { background: #EBC38A; }
.pool-card .capline { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: clamp(6px, 1vh, 10px); border-top: 1px solid var(--line); }
.pool-card .capline .stepper { min-height: 30px; }
.pool-card .capline .stepper input { width: 4ch; }
.pool-card .poolfoot { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.pool-card .poolfoot .seg { display: inline-flex; align-items: center; }
.pool-card .poolfoot .seg .small { padding: 0 8px 0 6px; }
.pool-card .poolfoot .seg button { min-height: 26px; padding: 0 10px; font-size: 11px; }
/* the email drafts (nothing is sent in the prototype) */
.modal:has(.mails.three) { width: min(1120px, 94vw); max-width: none; }
.mails { display: grid; gap: 12px; margin-top: 4px; }
.mails.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.mail { display: grid; gap: 6px; align-content: start; padding: 12px; border: 1px solid var(--line-2); }
.mail .mh { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.mail .mb { margin: 4px 0; white-space: pre-line; font-size: 11px; line-height: 1.45; color: var(--white-2); }
.mail .btn { justify-self: start; }
@media (max-width: 900px) { .mails.three { grid-template-columns: 1fr; } [data-screen="analytics"] .screen-head > .head-r { width: 100%; } [data-screen="analytics"] .screen-head .head-bar { flex-wrap: wrap; min-width: 0; max-width: 100%; } .alert { flex-wrap: wrap; } }
@media (max-height: 760px) { .mail .mb { font-size: 10.5px; line-height: 1.35; } .alerts { gap: 3px; } .alert { padding: 1px 8px 1px 10px; font-size: 11px; line-height: 1.25; } body .alert.full .btn.primary { min-height: 20px; } .alert .msg { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } [data-screen="analytics"] .screen-head > .head-r { gap: 4px; } }

/* ---------- round 14 (pricing, 18 Nov): five plan cards (the plan, starter, plus, growth, pro); products picker in the head ---------- */
[data-screen="plan"] .plans { grid-template-columns: repeat(5, minmax(0, 1fr)); }
[data-screen="plan"] .plan .num { font-size: clamp(24px, 2.2vw, 40px); }
@media (max-width: 900px) { [data-screen="plan"] .plans { grid-template-columns: 1fr; } }

/* ---------- eval round 1 (19 Nov) ---------- */
/* BP-02: phones get the menu button and the screens start below the top bar (app-v3.css's padding had undone it) */
@media (max-width: 900px), (max-height: 520px) {
  body .screen { padding-top: calc(var(--nav) + 16px); }
  body .nav-links.open { background: rgba(12,11,10,.97); border-bottom: 1px solid rgba(243,241,238,.12); gap: 4px; z-index: 50; }
  body .nav-links.open a { padding: 10px 0; }
}
/* BP-07: long lists scroll inside their card, header kept (bills, team, staff brands) */
body [data-screen="billing"] .stage > .card:last-child > div, body [data-screen="account"] .card > div:has(> table), body .card:has(> table) { overflow: auto !important; overscroll-behavior: contain; }
body .card table thead th { position: sticky; top: 0; background: var(--night-tile); z-index: 1; }
/* BP-19: the light conversion tile's faint words reach 4.5:1; a visible focus ring on every control */
body .screen .card.conv .faint, body .screen .card.conv .xs { color: #5f5d5a; }
body :is(button, a, input, select, textarea, [tabindex]):focus-visible { outline: 2px solid #EBC38A; outline-offset: 2px; }
/* BP-31: the register form fits a 720 px tall window */
@media (max-height: 760px) { .entry .frame { gap: 8px; } .entry .frame .field { gap: 3px; } .entry .frame .input { min-height: 38px; } }

/* ---------- real mode (27 Nov): the site's own server answers; log in, register, the email links, payment, team ---------- */
.frame .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.frame .row2 > [hidden] { display: none; }
.frame .row2:has(> :not([hidden]):only-of-type) { grid-template-columns: 1fr; }
.frame select.input { width: 100%; }
.auth-err { margin: 0; color: #F0A39A; line-height: 1.4; }
.auth-note { margin: 0; color: var(--white); line-height: 1.4; }
.verify-chip { display: inline-flex; align-items: center; gap: 10px; height: 30px; padding: 0 10px; font-size: 11px; white-space: nowrap;
  background: #EBC38A; color: #141413; }
.verify-chip[hidden] { display: none; }
.verify-chip .link { color: #141413; text-decoration-color: rgba(20,19,18,.45); font-size: 11px; }
#payNote.err { color: #F0A39A; }
/* prototype-only controls hide in real mode: the alert preview, the fake key's copy and renew */
body[data-mode="real"] .poolfoot .seg, body[data-mode="real"] [data-copy-key], body[data-mode="real"] #newKey { display: none !important; }
body[data-mode="real"] #sw2fa { opacity: .4; }
