/* The plan to try ("go here", 22 Nov 2026). */
.plans { display: flex; flex-direction: column; }
.plans-q { margin: 2px 0 0; font-size: 14px; font-weight: 600; }
#tr-plans { margin-top: 8px; }
#tr-plan { margin-bottom: 10px; }
select.gap-below { margin-bottom: 10px; }
.plans.safety { margin-bottom: 10px; }
.plans.safety .cp-plan { display: flex; align-items: center; gap: 10px; border: 2px solid var(--accent); border-radius: 10px; padding: 10px 12px; margin-top: 6px; }
.plans.safety .cp-name { flex: 1; }
.plans.safety small { display: block; color: var(--ink-2); font-size: 12px; }
.plans.safety .cp-price { font-variant-numeric: tabular-nums; white-space: nowrap; }
/* The Add tile says the whole offer ("save 30% with both"), never cut. */
.apps button.add .co { white-space: normal; }
.when { margin-top: 10px; }
#plan-next { margin-top: 0; }
#plan-next tr.head td { font-weight: 600; color: var(--ink); }
/* Before Stripe's page, which can't show the whole bill yet. */
.heads-up { margin: 8px 0 6px; padding: 8px 10px; border-radius: 8px; background: #fdf3dc; color: #7a5300; font-size: 13px; }
@media (prefers-color-scheme: dark) { .heads-up { background: #3a2f12; color: #f3d48a; } }
.when td small { display: block; color: var(--ink-2); font-size: 12px; padding-right: 10px; }
.when td.money { white-space: nowrap; }
table.plan tr.item td { padding: 4px 0 4px 10px; border-bottom: none; color: var(--ink-2); font-size: 12px; }
table.plan .link.try { display: block; margin-left: auto; padding: 2px 0 0; text-align: right; }
:root {
  --ground: #f4f5f7;
  --card: #ffffff;
  --ink: #14171c;
  --ink-2: #5b6270;
  --ink-3: #8a909c;
  --line: #dfe2e7;
  --line-2: #c5cad3;
  --accent: #1f5fae;
  --btn: #14171c;
  --btn-ink: #ffffff;
  --danger: #b3261e;
  --ok: #2e7d32;
}
@media (prefers-color-scheme: dark) {
  :root {
    --ground: #0d1117;
    --card: #161b22;
    --ink: #e8eaee;
    --ink-2: #a8afbb;
    --ink-3: #7d8592;
    --line: #2a313b;
    --line-2: #3a434f;
    --accent: #79a8ec;
    --btn: #e8eaee;
    --btn-ink: #0d1117;
    --danger: #f08b84;
    --ok: #7cc47f;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--ground);
  color: var(--ink);
  font: 15px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  min-height: 100vh;
}
.wrap { max-width: 400px; margin: 0 auto; padding: 48px 16px 24px; display: flex; flex-direction: column; gap: 16px; }
.mark { font-weight: 600; font-size: 15px; letter-spacing: .3px; text-align: center; }
.mark-logo img { display: block; margin: 0 auto; width: 220px; max-width: 70vw; height: auto; }
.mark-logo[hidden] { display: none; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 24px 20px; display: flex; flex-direction: column; gap: 10px; }
.card[hidden], [hidden] { display: none !important; }
h1 { font-size: 22px; font-weight: 600; margin: 0; }
.sub { color: var(--ink-2); font-size: 13.5px; margin: 0 0 6px; }
.center { text-align: center; }
form { display: flex; flex-direction: column; gap: 6px; }
label { font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
input {
  font: inherit; color: var(--ink); background: var(--card);
  border: 1px solid var(--line-2); border-radius: 8px; padding: 11px 12px; width: 100%;
}
input:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: var(--accent); }
input.code { font-size: 24px; letter-spacing: 8px; text-align: center; }
button, .secondary { font: inherit; cursor: pointer; }
.primary {
  margin-top: 10px; background: var(--btn); color: var(--btn-ink); border: none;
  border-radius: 8px; padding: 12px; font-weight: 600; font-size: 15px;
}
.primary:disabled { opacity: .6; cursor: default; }
.secondary {
  display: block; text-align: center; text-decoration: none; color: var(--ink); background: transparent;
  border: 1px solid var(--line-2); border-radius: 8px; padding: 11px; font-weight: 500;
}
.link { background: none; border: none; color: var(--accent); padding: 6px; font-size: 13.5px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.error { color: var(--danger); font-size: 13px; margin: 4px 0 0; }
.ok { color: var(--ok); font-size: 13px; margin: 4px 0 0; }
.hint { color: var(--ink-3); font-size: 12px; margin: 4px 0 0; }
.newhere { color: var(--ink-3); font-size: 12.5px; text-align: center; margin: 6px 0 0; }
.newhere a, .foot a { color: var(--accent); text-decoration: none; }
.apps { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.apps button, .apps a.tile {
  width: 100%; display: flex; align-items: center; gap: 12px; text-align: left;
  background: var(--card); color: var(--ink); border: 1px solid var(--line-2); border-radius: 10px; padding: 12px;
}
.apps .dot { width: 34px; height: 34px; border-radius: 8px; flex: none; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; color: #fff; }
.apps .meta { flex: 1; min-width: 0; }
.apps .name { font-weight: 600; font-size: 14.5px; display: block; }
.apps .co { color: var(--ink-2); font-size: 12.5px; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.apps .go { color: var(--accent); font-size: 13px; }
.foot { color: var(--ink-3); font-size: 12px; text-align: center; margin: 8px 0 0; }
.spinner { width: 28px; height: 28px; margin: 6px auto; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--ink); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .spinner { animation: none; } }
.link.inline { padding: 0; font-size: inherit; }
.link:disabled { color: var(--ink-3); cursor: default; }

/* The "busy" card stays invisible for its first 1.5 s: most steps finish in
   half a second, and a card that shows for that long only flickers (his
   "flash", 19 Nov 2026). It appears only when something is slow. */
@keyframes late { from { visibility: hidden; } to { visibility: visible; } }
#busy:not([hidden]) { animation: late 0s linear 1.5s both; }
.co-name { margin: 0; font-weight: 600; }
.apps .role { color: var(--accent); font-size: 13px; }
/* Bundle card (trial choice) and the Admin's "Add" tile. */
.bundle { border: 1.5px dashed var(--accent); border-radius: 10px; padding: 10px 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13px; color: var(--accent); }
.bundle strong { font-size: 14px; }
.bundle .tag { align-self: flex-start; font-size: 11px; font-weight: 600; letter-spacing: .3px; padding: 1px 8px; border-radius: 6px; background: #e3f3e6; color: #1d6b34; }
.apps button.add { border-style: dashed; border-color: var(--accent); }
.apps button.add .dot { opacity: .55; }
.apps a.tile { text-decoration: none; cursor: pointer; }
/* Roof 1: trial banner, Your plan, the Add Safety form. */
.trial-banner { margin: 2px 0 0; padding: 8px 10px; border-radius: 8px; background: #fdf3dc; color: #7a5300; font-size: 13px; }
table.plan { width: 100%; border-collapse: collapse; font-size: 14px; }
table.plan td { padding: 8px 0; border-bottom: 1px solid var(--line); }
table.plan td:last-child { text-align: right; color: var(--ink-2); }
a.as-button { display: block; text-align: center; text-decoration: none; }
select { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--card); color: var(--ink); }
@media (prefers-color-scheme: dark) { .trial-banner { background: #3a2f12; color: #f3d48a; } }
/* Roof 1 C: the one trial form. */
label.pick { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 12px; margin: 0 0 8px; font-weight: 400; cursor: pointer; }
label.pick input { width: 20px; height: 20px; flex: none; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }
#trial-bundle { margin: 2px 0 6px; }
#trial-bundle.on { background: #e8f1fc; }
@media (prefers-color-scheme: dark) { #trial-bundle.on { background: #15263d; } }
/* Roof 2: Choose a plan. */
.seg { display: flex; border: 1px solid var(--line-2); border-radius: 10px; overflow: hidden; }
.seg button { flex: 1; padding: 9px 0; border: none; background: var(--card); color: var(--ink); font: inherit; cursor: pointer; }
.seg button.seg-on { background: var(--accent); color: #fff; }
.cp-app { margin-top: 6px; }
.cp-app h2 { font-size: 15px; margin: 8px 0 6px; }
label.cp-plan { display: flex; align-items: center; gap: 10px; border: 1px solid var(--line-2); border-radius: 10px; padding: 10px 12px; margin: 0 0 6px; font-weight: 400; cursor: pointer; }
label.cp-plan input { width: 18px; height: 18px; flex: none; }
label.cp-plan .cp-name { flex: 1; }
label.cp-plan .cp-name small { display: block; color: var(--ink-2); font-size: 12px; }
label.cp-plan .cp-price { font-variant-numeric: tabular-nums; }
label.cp-plan.off { opacity: .5; cursor: not-allowed; }
.cp-fit { font-size: 11px; padding: 1px 7px; border-radius: 6px; background: #e3f3e6; color: #1d6b34; margin-left: 6px; display: inline-block; white-space: nowrap; }
table.plan td.money { font-variant-numeric: tabular-nums; }
table.plan tr.total td { font-weight: 700; border-bottom: none; }
table.plan tr.disc td:last-child { color: #1d6b34; }
/* An invitation not accepted yet (23 Nov 2026). */
.apps .go.invite { background: #e3f3e6; color: #1d6b34; border-radius: 6px; padding: 3px 8px; white-space: nowrap; }
@media (prefers-color-scheme: dark) { .apps .go.invite { background: #173823; color: #9fd8ad; } }
.apps .co.wrap { white-space: normal; }

/* Roof 3: the apps a people invitation gives */
.pi-apps { margin: 6px 0 14px; padding-left: 20px; }
.pi-apps li { margin: 3px 0; }

/* Unified pricing (28 Nov 2026): the people count, the Founding note, the price calculator, the HHD staff screen. */
.people-box { border: 1px solid var(--line, #d9dee5); border-radius: 10px; padding: 10px 12px; margin: 4px 0 10px; font-size: 13px; }
.people-box strong { font-size: 15px; }
.people-box details { margin-top: 6px; }
.people-box ul { margin: 6px 0 0; padding-left: 18px; }
.people-box li { margin: 2px 0; overflow-wrap: anywhere; }
.founding { border: 1.5px solid var(--accent); border-radius: 10px; padding: 8px 12px; font-size: 13px; color: var(--accent); margin: 0 0 10px; }
.plan tr.save td { color: var(--accent); }
.plan tr.sub td { font-weight: 600; border-top: 1px solid var(--line, #d9dee5); }
.sub-pick { margin-left: 26px; font-size: 13px; }
.card.wide { max-width: 980px; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: flex-end; margin: 8px 0 12px; }
.admin-row label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.admin-row input { width: 90px; }
.ha-co { border-top: 1px solid var(--line, #d9dee5); padding: 10px 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 6px; font-size: 13px; }
.ha-co .row { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.ha-co input[type=number] { width: 80px; }
.log { font-size: 12px; max-height: 260px; overflow-y: auto; overflow-wrap: anywhere; }
/* HHD finance (28 Nov 2026) */
/* Refused (not on the staff list): only the title, the reason and "Sign in with another account". */
#hhdfinance.fi-locked > :not(h1):not(#fi-error):not(#fi-signout) { display: none; }
/* HHD billing admin refused: only the title, the reason and Sign out. */
#hhdadmin.ha-locked > :not(h1):not(#ha-error):not(#ha-signout) { display: none; }
/* Always offered: switching account (or testing the refusal) must never need the browser's own tools. */
.fi-kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 8px 0 4px; }
.fi-kpi { border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; min-width: 0; }
.fi-kpi .k { font-size: 11px; color: var(--ink-2); }
.fi-kpi .v { font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fi-kpi .s { font-size: 11px; color: var(--ink-3); }
.fi-kpi.neg .v { color: var(--danger); }
.fi-scroll { overflow-x: auto; max-width: 100%; }
.fi-table { border-collapse: collapse; width: 100%; font-size: 12.5px; }
.fi-table th, .fi-table td { text-align: left; padding: 5px 8px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.fi-table td.n, .fi-table th.n { text-align: right; font-variant-numeric: tabular-nums; }
.fi-table tr.tot td { font-weight: 700; border-top: 1.5px solid var(--line-2); }
.fi-table .al { color: var(--danger); font-weight: 700; }
.fi-table .warn { color: var(--accent); font-weight: 600; }
#fi-expenses .row { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; font-size: 13px; border-top: 1px solid var(--line); padding: 6px 0; }
#fi-expenses .row span { min-width: 0; overflow-wrap: anywhere; }

/* His GO (29 Nov 2026): what just happened on Your plan; adding an app shows only that app's plans. */
.done-msg { margin: 4px 0 10px; padding: 8px 10px; border-radius: 8px; background: #e6f4ea; color: #1e5b2a; font-size: 13px; }
@media (prefers-color-scheme: dark) { .done-msg { background: #17331f; color: #9fd8a8; } }
#chooseplan.adding .cp-app:not(.cp-new), #chooseplan.adding label[for="cp-crew"], #chooseplan.adding #cp-crew,
#chooseplan.adding .seg, #chooseplan.adding #cp-people, #chooseplan.adding #cp-founding, #chooseplan.adding #cp-add-more { display: none; }
.cp-more { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); font-size: 14px; }
.cp-more small { display: block; color: var(--muted, inherit); opacity: .85; font-size: 12px; }
