/* iSharpe CRM. One stylesheet for the app, the sign-in steps and the customer's sign-up form. */

:root {
  --bg: #f2f5f7; --surface: #ffffff; --surface-2: #f7f9fa; --raise: #ffffff;
  --text: #0e1a22; --text-2: #4f5d69; --text-3: #8695a2; --line: #e2e8ed; --line-2: #d3dbe2;
  --brand: #0b6b71; --brand-hi: #0f878d; --brand-ink: #ffffff; --brand-soft: #e3f3f2; --brand-softer: #f0f8f8;
  --ok: #157f3e; --ok-soft: #e4f5ea; --warn: #b25b0a; --warn-soft: #fdf1e3; --bad: #c4321f; --bad-soft: #fde9e6; --info-soft: #e8f0fb;
  --sh-1: 0 1px 2px rgba(15, 30, 45, .05), 0 1px 3px rgba(15, 30, 45, .07);
  --sh-2: 0 4px 12px rgba(15, 30, 45, .08), 0 1px 3px rgba(15, 30, 45, .06);
  --sh-3: 0 12px 32px rgba(15, 30, 45, .16);
  --r: 14px; --r-sm: 10px;
  --tabs-h: 64px;
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: "Segoe UI Variable Display", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a1116; --surface: #121b22; --surface-2: #17222a; --raise: #1a2630;
    --text: #e6edf2; --text-2: #a2b2be; --text-3: #6f8090; --line: #213039; --line-2: #2b3c47;
    --brand: #27aeab; --brand-hi: #3cc5c1; --brand-ink: #04211f; --brand-soft: #0f2c2d; --brand-softer: #0d2224;
    --ok: #4ccb7f; --ok-soft: #12291c; --warn: #f0a24a; --warn-soft: #2c2111; --bad: #f2735f; --bad-soft: #321914; --info-soft: #15233a;
    --sh-1: 0 1px 2px rgba(0, 0, 0, .4); --sh-2: 0 4px 14px rgba(0, 0, 0, .45); --sh-3: 0 14px 36px rgba(0, 0, 0, .6);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 15.5px/1.5 var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
a { color: var(--brand); text-decoration: none; }
h1, h2, h3 { font-family: var(--font-display); letter-spacing: -.012em; margin: 0; }
h1 { font-size: 26px; font-weight: 650; line-height: 1.2; }
h2 { font-size: 16.5px; font-weight: 620; }
p { margin: 0 0 10px; }
.sub, .muted { color: var(--text-2); font-size: 14px; }
.small { font-size: 14px; }
.center { text-align: center; }
[hidden] { display: none !important; }

/* ---------- Icons and the brand mark ---------- */
.ic { width: 20px; height: 20px; flex: none; vertical-align: -4px; }
.ic.big { width: 40px; height: 40px; color: var(--brand); }
.mark { width: 30px; height: 30px; flex: none; border-radius: 9px; background: linear-gradient(140deg, #13969b, #0b5f65);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .12), 0 2px 6px rgba(11, 95, 101, .35); position: relative; }
.mark::after { content: ""; position: absolute; inset: 0; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3E%3Ccircle cx='15' cy='11.2' r='4.6' fill='%23fff'/%3E%3Cpath d='M6.8 24.2c.9-4.6 4.2-7.4 8.2-7.4s7.3 2.8 8.2 7.4z' fill='%23fff'/%3E%3C/svg%3E") center / 100% no-repeat; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); font: 600 17px/1 var(--font-display); letter-spacing: -.01em; }
.brand b { color: var(--brand); font-weight: 700; }

/* ---------- Frame: sidebar on big screens, top bar + tab bar on phones ---------- */
.shell { min-height: 100vh; }
.side { display: none; }
.main { min-width: 0; }
.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 18px; padding-top: calc(12px + env(safe-area-inset-top)); background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid var(--line); }
.status { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 6px; }
.status:not(:empty)::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--brand); }
.status.off { color: var(--warn); font-weight: 600; } .status.off::before { background: var(--warn); }
#view { max-width: 1120px; margin: 0 auto; padding: 18px 16px calc(var(--tabs-h) + 32px + env(safe-area-inset-bottom)); }

.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; display: flex; height: calc(var(--tabs-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-top: 1px solid var(--line); }
.tabs a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--text-3);
  font-size: 11.5px; font-weight: 600; letter-spacing: .01em; position: relative; }
.tabs a .ic { width: 23px; height: 23px; }
.tabs a.on { color: var(--brand); }
.tabs a.on::before { content: ""; position: absolute; top: 0; width: 36px; height: 3px; border-radius: 0 0 3px 3px; background: var(--brand); }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: 252px 1fr; }
  .side { display: flex; flex-direction: column; gap: 6px; position: sticky; top: 0; height: 100vh; padding: 22px 16px;
    background: var(--surface); border-right: 1px solid var(--line); }
  .side .brand { padding: 4px 8px 18px; }
  .side .new { margin: 0 0 14px; width: 100%; }
  .sidenav { display: flex; flex-direction: column; gap: 2px; }
  .sidenav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-sm); color: var(--text-2); font-weight: 600; }
  .sidenav a:hover { background: var(--surface-2); color: var(--text); }
  .sidenav a.on { background: var(--brand-soft); color: var(--brand); }
  .side-foot { margin-top: auto; padding: 8px 12px; font-size: 12px; color: var(--text-3); }
  .top .brand { visibility: hidden; }
  .top { padding: 10px 28px; min-height: 52px; }
  .tabs { display: none; }
  #view { padding: 26px 32px 48px; }
}

/* ---------- Page headers ---------- */
.pagehead { margin: 2px 0 18px; }
.pagehead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.pagehead .sub { margin: 4px 0 0; font-size: 14.5px; }
.pagehead-actions { display: flex; gap: 8px; }
.backlink { display: inline-flex; align-items: center; gap: 4px; margin: 0 0 10px -4px; padding: 4px 8px 4px 4px; border-radius: 8px;
  color: var(--text-2); font-size: 14px; font-weight: 600; }
.backlink:hover { background: var(--surface); color: var(--text); }

/* ---------- Buttons ---------- */
button, .button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px;
  border: 1px solid transparent; border-radius: var(--r-sm); background: var(--brand); color: var(--brand-ink); font: 600 15px/1 var(--font);
  cursor: pointer; white-space: nowrap; box-shadow: 0 1px 2px rgba(11, 95, 101, .25); transition: background .15s, box-shadow .15s, transform .05s; }
button:hover, .button:hover { background: var(--brand-hi); }
button:active, .button:active { transform: translateY(1px); }
button:focus-visible, .button:focus-visible, a:focus-visible { outline: 3px solid color-mix(in srgb, var(--brand) 40%, transparent); outline-offset: 2px; }
button.secondary, .button.secondary { background: var(--surface); color: var(--text); border-color: var(--line-2); box-shadow: var(--sh-1); }
button.secondary:hover, .button.secondary:hover { background: var(--surface-2); }
button.danger { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 45%, transparent); box-shadow: none; }
button.danger:hover { background: var(--bad-soft); }
button.small, .button.small { min-height: 36px; padding: 7px 13px; font-size: 14px; gap: 6px; }
button.small .ic, .button.small .ic { width: 17px; height: 17px; }
button.link { background: none; border: 0; box-shadow: none; color: var(--text-2); padding: 0; min-height: 0; font-weight: 500; }
button.link:hover { background: none; color: var(--bad); }
.textlink { display: inline-flex; align-items: center; gap: 4px; font-size: 14px; font-weight: 600; color: var(--brand); }
.textlink .ic { width: 17px; height: 17px; }
.iconbtn { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--brand-soft); color: var(--brand); }
.iconbtn:hover { background: var(--brand); color: var(--brand-ink); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 14px; }
.actions.column { flex-direction: column; align-items: stretch; }
.actions .push { margin-left: auto; }

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px; margin-bottom: 16px; box-shadow: var(--sh-1); }
.card.warn { border-color: color-mix(in srgb, var(--warn) 35%, var(--line)); background: linear-gradient(var(--warn-soft), var(--surface) 90px); }
.card.muted-card { background: var(--surface-2); box-shadow: none; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; min-height: 28px; }
.card-head h2 { display: flex; align-items: center; gap: 10px; }
.h-ic { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--brand-soft); color: var(--brand); }
.h-ic .ic { width: 18px; height: 18px; }
.card.warn .h-ic { background: var(--warn-soft); color: var(--warn); }
.count { min-width: 26px; height: 26px; padding: 0 8px; border-radius: 13px; display: inline-grid; place-items: center; background: var(--surface-2);
  border: 1px solid var(--line); font-size: 13px; font-weight: 600; color: var(--text-2); }
.empty { text-align: center; padding: 34px 20px; }
.empty h2, .empty h1 { margin: 10px 0 6px; }
.empty p { color: var(--text-2); max-width: 420px; margin: 0 auto 14px; }
.empty-inline { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 14px; padding: 6px 0; }
.feature { width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--brand-soft); margin-bottom: 14px; }

/* ---------- Today: greeting, numbers, banner ---------- */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
@media (min-width: 720px) { .stats { grid-template-columns: repeat(4, 1fr); } }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; padding: 14px 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); color: var(--text); }
a.stat:hover { box-shadow: var(--sh-2); border-color: var(--line-2); }
.stat-ic { grid-row: span 2; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); }
.stat b { font: 700 24px/1.1 var(--font-display); letter-spacing: -.02em; }
.stat span:last-child { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.stat.warn .stat-ic { background: var(--warn-soft); color: var(--warn); } .stat.warn b { color: var(--warn); }

.banner { width: 100%; display: flex; align-items: center; gap: 14px; text-align: left; padding: 16px 18px; margin-bottom: 18px; min-height: 0;
  border-radius: var(--r); background: linear-gradient(120deg, #0d7f85, #0a5b61); color: #fff; font-weight: 400; box-shadow: var(--sh-2); white-space: normal; }
.banner:hover { background: linear-gradient(120deg, #11939a, #0b666c); }
.banner-ic { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .16); flex: none; }
.banner-text { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.banner-text b { font-size: 15.5px; } .banner-text span { font-size: 13.5px; opacity: .88; }
.chev { color: var(--text-3); width: 18px; height: 18px; }
.banner .chev { color: rgba(255, 255, 255, .8); }

/* ---------- Search and the customer list ---------- */
.searchbar { position: sticky; top: calc(53px + env(safe-area-inset-top)); z-index: 10; padding: 8px 0 10px; background: var(--bg); }
@media (min-width: 960px) { .searchbar { top: 52px; } }
.search { position: relative; display: block; margin: 0; }
.search .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); pointer-events: none; }
.search input { margin: 0; padding-left: 44px; height: 48px; border-radius: 12px; background: var(--surface); box-shadow: var(--sh-1); font-size: 16px; }
.listhead { display: flex; align-items: baseline; gap: 10px; margin: 8px 2px 10px; }
.listhead .sub { font-weight: 600; }
ul.customers, ul.tasks, ul.people, ol.timeline { list-style: none; margin: 0; padding: 0; }
ul.customers { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--sh-1); overflow: hidden; }
ul.customers li.letter { padding: 5px 18px; font-size: 12px; font-weight: 700; letter-spacing: .08em; color: var(--brand); background: var(--surface-2);
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
ul.customers li.letter:first-child { border-top: 0; }
ul.customers li:not(.letter) + li:not(.letter) { border-top: 1px solid var(--line); }
ul.customers a { display: flex; align-items: center; gap: 14px; padding: 12px 16px; color: var(--text); transition: background .12s; }
ul.customers a:hover { background: var(--surface-2); }
ul.customers a:active { background: var(--brand-softer); }
.row-text { display: flex; flex-direction: column; min-width: 0; flex: 1; color: var(--text); }
.row-text b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-text .sub { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Avatars: twelve hues, each readable in light and dark ---------- */
.avatar { --h: 180; flex: none; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center;
  font: 650 15px/1 var(--font-display); letter-spacing: .02em; background: hsl(var(--h) 62% 91%); color: hsl(var(--h) 55% 30%);
  box-shadow: inset 0 0 0 1px hsl(var(--h) 45% 82%); }
.avatar.sm { width: 36px; height: 36px; font-size: 13px; }
.avatar.xl { width: 84px; height: 84px; font-size: 30px; box-shadow: inset 0 0 0 1px hsl(var(--h) 45% 82%), var(--sh-2); }
@media (prefers-color-scheme: dark) {
  .avatar { background: hsl(var(--h) 32% 22%); color: hsl(var(--h) 70% 82%); box-shadow: inset 0 0 0 1px hsl(var(--h) 30% 30%); }
}
.h0 { --h: 4; } .h1 { --h: 28; } .h2 { --h: 45; } .h3 { --h: 95; } .h4 { --h: 145; } .h5 { --h: 172; }
.h6 { --h: 195; } .h7 { --h: 215; } .h8 { --h: 240; } .h9 { --h: 265; } .h10 { --h: 295; } .h11 { --h: 330; }

/* ---------- Customer page ---------- */
.hero { text-align: center; padding: 22px 18px 18px; margin-bottom: 16px; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); box-shadow: var(--sh-1); position: relative; overflow: hidden; }
.hero::before { content: ""; position: absolute; inset: 0 0 auto; height: 74px; background: linear-gradient(120deg, var(--brand-soft), var(--brand-softer)); }
.hero > * { position: relative; }
.hero .avatar.xl { margin: 4px auto 12px; border: 4px solid var(--surface); }
.hero h1 { font-size: 24px; }
.hero .sub { margin: 4px 0 0; font-size: 15px; }
.chips { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 10px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border-radius: 20px; font-size: 12.5px; font-weight: 600;
  background: var(--surface-2); border: 1px solid var(--line); color: var(--text-2); }
.chip .ic { width: 14px; height: 14px; }
.chip.square { background: var(--info-soft); }
.actions-row { display: flex; justify-content: center; gap: 10px; margin: 18px 0 14px; }
.act { display: flex; flex-direction: column; align-items: center; gap: 6px; width: 76px; font-size: 12.5px; font-weight: 600; color: var(--brand); }
.act-ic { width: 52px; height: 52px; border-radius: 50%; display: grid; place-items: center; background: var(--brand); color: var(--brand-ink);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 35%, transparent); transition: transform .12s, background .12s; }
.act:hover .act-ic { background: var(--brand-hi); transform: translateY(-1px); }
.act-ic .ic { width: 22px; height: 22px; }
.act.off { color: var(--text-3); } .act.off .act-ic { background: var(--surface-2); color: var(--text-3); box-shadow: inset 0 0 0 1px var(--line); }
.hero-tools { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }

.cols { display: block; }
@media (min-width: 1100px) { .cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; } }

.infos { display: flex; flex-direction: column; }
.info { display: flex; align-items: center; gap: 14px; padding: 10px 6px; margin: 0 -6px; border-radius: var(--r-sm); color: var(--text); }
a.info:hover { background: var(--surface-2); }
.info + .info { border-top: 1px solid var(--line); border-radius: 0; }
.info-ic { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.info-ic .ic { width: 19px; height: 19px; }
.info-text { display: flex; flex-direction: column; min-width: 0; }
.info-text small { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; }
.info-text span { overflow-wrap: anywhere; }
.notes { white-space: normal; overflow-wrap: anywhere; color: var(--text); margin: 0; }

ul.people li { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
ul.people li + li { border-top: 1px solid var(--line); }
.mini-acts { display: flex; gap: 6px; }

/* ---------- Appointments, follow-ups, visits ---------- */
.datetile { flex: none; width: 50px; height: 54px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: var(--brand); color: var(--brand-ink); box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 30%, transparent); line-height: 1; }
.datetile small { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; opacity: .9; }
.datetile b { font: 700 21px/1.05 var(--font-display); margin-top: 2px; }
.datetile.soft { background: var(--brand-soft); color: var(--brand); box-shadow: none; }
.datetile.late { background: var(--warn-soft); color: var(--warn); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--warn) 35%, transparent); }
ul.tasks li { display: flex; align-items: center; gap: 14px; padding: 10px 0; }
ul.tasks li + li { border-top: 1px solid var(--line); }
.task-main { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 0; color: var(--text); }
.task-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; font-size: 13px; color: var(--text-2); }
.meta > span { display: inline-flex; align-items: center; gap: 4px; }
.meta .ic { width: 15px; height: 15px; vertical-align: -3px; }
.who { font-weight: 600; color: var(--text); }
.pill { display: inline-flex; align-items: center; padding: 2px 8px; border-radius: 20px; font-size: 11.5px; font-weight: 700; letter-spacing: .02em; }
.pill.appt { background: var(--brand-soft); color: var(--brand); }
.pill.fup { background: var(--warn-soft); color: var(--warn); }
.pill.ok { background: var(--ok-soft); color: var(--ok); }
.check { flex: none; width: 36px; height: 36px; min-height: 0; padding: 0; border-radius: 50%; background: var(--surface); color: transparent;
  border: 2px solid var(--line-2); box-shadow: none; }
.check:hover { border-color: var(--ok); color: var(--ok); background: var(--ok-soft); }
.check .ic { width: 18px; height: 18px; }
li.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
li.done .task-main b { text-decoration: line-through; color: var(--text-3); }
li.done .datetile { opacity: .5; }
li.overdue .meta > span:nth-child(2) { color: var(--warn); font-weight: 600; }

ol.timeline { position: relative; padding-left: 22px; }
ol.timeline::before { content: ""; position: absolute; left: 6px; top: 8px; bottom: 8px; width: 2px; background: var(--line); border-radius: 1px; }
ol.timeline li { position: relative; }
ol.timeline li::before { content: ""; position: absolute; left: -22px; top: 15px; width: 14px; height: 14px; border-radius: 50%;
  background: var(--surface); border: 3px solid var(--brand); }
ol.timeline a { display: flex; flex-direction: column; gap: 3px; padding: 10px 10px 12px; margin: 0 -10px; border-radius: var(--r-sm); color: var(--text); }
ol.timeline a:hover { background: var(--surface-2); }
.tl-date { font-size: 12.5px; font-weight: 700; color: var(--brand); letter-spacing: .02em; }
.tl-notes { font-size: 14px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.todo { color: var(--warn); font-weight: 600; }

/* ---------- Forms ---------- */
label { display: block; margin: 10px 0; font-size: 13.5px; font-weight: 600; color: var(--text-2); }
input, textarea, select { display: block; width: 100%; margin-top: 6px; padding: 11px 13px; min-height: 46px; border: 1px solid var(--line-2);
  border-radius: var(--r-sm); background: var(--surface); color: var(--text); font: 400 16px/1.4 var(--font); transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 96px; }
input:hover, textarea:hover, select:hover { border-color: var(--text-3); }
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
form.grid { display: flex; flex-wrap: wrap; column-gap: 14px; }
form.grid > * { flex: 1 1 100%; }
form.grid > label.half { flex: 1 1 calc(50% - 7px); min-width: 140px; }
.form-section { margin: 14px 0 0; padding-top: 14px; border-top: 1px solid var(--line); font-size: 12px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .08em; color: var(--brand); }
.form-section:first-child { margin-top: 0; padding-top: 0; border-top: 0; }
.form-card .actions { position: sticky; bottom: calc(var(--tabs-h) + env(safe-area-inset-bottom)); z-index: 5; margin: 16px -18px -18px; padding: 12px 18px;
  background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line); border-radius: 0 0 var(--r) var(--r); }
@media (min-width: 960px) { .form-card .actions { bottom: 0; } }
fieldset.seg { margin: 4px 0 6px; display: flex; gap: 0; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 12px; padding: 4px; }
fieldset.seg legend { float: left; width: 100%; font-size: 13.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; padding: 0; }
fieldset.seg label { flex: 1; display: flex; align-items: center; justify-content: center; gap: 8px; margin: 0; padding: 10px; border-radius: 9px;
  font-size: 15px; color: var(--text-2); cursor: pointer; }
fieldset.seg label:has(input:checked) { background: var(--surface); color: var(--brand); box-shadow: var(--sh-1); }
fieldset.seg input { width: auto; min-height: 0; margin: 0; accent-color: var(--brand); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.photos img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 12px; display: block; box-shadow: var(--sh-1); }
.filepick { position: relative; overflow: hidden; }
.filepick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; margin: 0; }

/* ---------- Settings and messages ---------- */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; margin: 0 0 4px; }
.facts dt { color: var(--text-2); font-size: 14px; } .facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.bullets { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); font-size: 14px; } .bullets li { margin: 4px 0; }
.error { background: var(--bad-soft); color: var(--bad); padding: 11px 14px; border-radius: var(--r-sm); font-size: 14.5px; }
.error ul { margin: 6px 0; padding-left: 18px; }
.notice { background: var(--brand-soft); color: var(--text); padding: 11px 14px; border-radius: var(--r-sm); font-size: 14.5px; margin-top: 12px; }
.secret { font: 600 17px ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .5px; background: var(--surface-2); border: 1px dashed var(--line-2);
  padding: 10px 12px; border-radius: var(--r-sm); margin: 8px 0; word-break: break-all; color: var(--text); }
.secret.small { font-size: 13px; }
details { margin-top: 14px; } summary { cursor: pointer; color: var(--brand); font-weight: 600; font-size: 14.5px; padding: 4px 0; }
details form { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; margin-top: 8px; } details form > * { flex: 1 1 220px; }
details form input { margin-top: 6px; }

/* ---------- Billing ---------- */
.alert { display: flex; align-items: center; gap: 14px; padding: 14px 16px; margin-bottom: 16px; border-radius: var(--r); background: var(--bad-soft);
  border: 1px solid color-mix(in srgb, var(--bad) 30%, transparent); }
.alert-ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--bad); color: #fff; flex: none; }
.alert-text { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.alert-text b { color: var(--bad); } .alert-text span { font-size: 13.5px; color: var(--text-2); }
.alert button { background: var(--bad); box-shadow: none; } .alert button:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
@media (max-width: 520px) { .alert { flex-wrap: wrap; } .alert button { width: 100%; } }
.cardline { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 12px; background: linear-gradient(120deg, #1d2b36, #0f1a22);
  color: #e9f1f6; font: 600 16px/1.2 ui-monospace, "Cascadia Mono", Consolas, monospace; letter-spacing: .3px; box-shadow: var(--sh-2); }
.cardline .ic { color: #7fd6d3; }
ul.subs, ul.history { list-style: none; margin: 0; padding: 0; }
.sub-item { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 12px 0; }
.sub-item + .sub-item { border-top: 1px solid var(--line); }
.sub-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
ul.history li { display: flex; justify-content: space-between; gap: 12px; padding: 11px 0; }
ul.history li + li { border-top: 1px solid var(--line); }
.hist-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hist-main b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-side { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex: none; }
.hist-links { display: flex; gap: 10px; font-size: 13px; font-weight: 600; }
.pill.bad { background: var(--bad-soft); color: var(--bad); }
.pill.plain { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }
.quote { padding: 12px 14px; border-left: 3px solid var(--brand); background: var(--surface-2); border-radius: 0 var(--r-sm) var(--r-sm) 0; color: var(--text); font-size: 14.5px; }

/* ---------- Bits ---------- */
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabs-h) + 18px + env(safe-area-inset-bottom)); z-index: 50;
  max-width: min(92vw, 520px); background: #0e1a22; color: #f1f5f8; padding: 12px 18px; border-radius: 12px; font-size: 14.5px; box-shadow: var(--sh-3);
  animation: rise .2s ease-out; }
@media (min-width: 960px) { .toast { bottom: 28px; } }
@keyframes rise { from { opacity: 0; transform: translate(-50%, 8px); } }
.loading { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 60px 0; color: var(--text-2); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- Sign-in steps and the customer's sign-up form (server pages, no app frame) ---------- */
body.plain { min-height: 100vh; background: radial-gradient(1200px 600px at 50% -10%, var(--brand-soft), var(--bg) 70%); }
body.plain .top { position: static; background: transparent; border: 0; backdrop-filter: none; -webkit-backdrop-filter: none; justify-content: center; padding-top: calc(28px + env(safe-area-inset-top)); }
body.plain main { max-width: 640px; margin: 0 auto; padding: 8px 16px 40px; }
.narrow { max-width: 440px; margin: 18px auto; }
body.plain .card { padding: 26px; box-shadow: var(--sh-2); }
body.plain h1 { font-size: 23px; margin-bottom: 8px; }
body.plain .card > p { color: var(--text-2); }
body.plain form button { width: 100%; margin-top: 8px; min-height: 48px; }
body.plain ol { padding-left: 20px; color: var(--text-2); } body.plain ol li { margin: 8px 0; }
.signup h1 { font-size: 25px; }
