/* Probeet Partners — mobile-first partner site.
   Phone first (360–414 px), then tablet and desktop. */

:root {
  --brand: #1d6fe0;
  --brand-strong: #1557b8;
  --brand-soft: #e8f1ff;
  --ink: #0b2d5b;
  --ink-deep: #06193a;
  --bg: #f3f6fb;
  --card: #ffffff;
  --border: #dbe4f0;
  --text: #13243b;
  --muted: #56677d;
  --ok: #157a46;
  --ok-soft: #e4f6ec;
  --warn: #9a5b00;
  --warn-soft: #fff4dd;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --radius: 14px;
  --radius-sm: 10px;
  --shadow: 0 1px 2px rgba(11, 45, 91, 0.06), 0 6px 20px rgba(11, 45, 91, 0.06);
  --tap: 44px;
  --font: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --top-h: 60px;
  --bottom-h: 64px;
  --side-w: 248px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(var(--top-h) + 12px);
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
svg,
canvas {
  max-width: 100%;
}

a {
  color: var(--brand);
}

h1,
h2,
h3 {
  line-height: 1.2;
  margin: 0 0 0.5rem;
  color: var(--ink-deep);
}

h1 {
  font-size: 1.6rem;
  font-weight: 800;
}

h2 {
  font-size: 1.2rem;
  font-weight: 800;
}

p {
  margin: 0 0 0.75rem;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.95em;
  background: var(--brand-soft);
  color: var(--ink);
  padding: 0.1em 0.4em;
  border-radius: 6px;
  overflow-wrap: anywhere;
}

.small {
  font-size: 0.875rem;
}

.muted {
  color: var(--muted);
}

.center {
  text-align: center;
}

[hidden] {
  display: none !important;
}

/* ——— Buttons ——— */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: var(--tap);
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-weight: 700;
  font-size: 0.95rem;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s, border-color 0.15s, color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.btn:focus-visible,
.link-btn:focus-visible,
.icon-btn:focus-visible,
.sheet-item:focus-visible,
.side-nav a:focus-visible,
.bottom-nav a:focus-visible,
.bottom-nav button:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(29, 111, 224, 0.45);
  outline-offset: 2px;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
}

.btn-primary:hover {
  background: var(--brand-strong);
}

.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--border);
}

.btn-ghost:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.btn-light {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.45);
}

.btn-light:hover {
  background: rgba(255, 255, 255, 0.2);
}

.btn-sm {
  padding: 0.45rem 0.85rem;
  font-size: 0.875rem;
}

.btn-lg {
  min-height: 52px;
  padding: 0.8rem 1.4rem;
  font-size: 1.02rem;
}

.btn.full,
.full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.link-btn {
  background: none;
  border: 0;
  padding: 0.5rem 0.6rem;
  min-height: var(--tap);
  font: inherit;
  font-weight: 600;
  color: inherit;
  cursor: pointer;
}

.link-btn.inline {
  padding: 0 0.2rem;
  min-height: 0;
  color: var(--brand);
  text-decoration: underline;
  /* Inline text link: extend the tap area without shifting the line. */
  position: relative;
}

.link-btn.inline::after {
  content: "";
  position: absolute;
  inset: -12px -6px;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  padding: 0;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: inherit;
  cursor: pointer;
}

.close-x {
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
}

.menu-toggle {
  flex-direction: column;
  gap: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
}

/* ——— Top bar ——— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  height: var(--top-h);
  padding: 0 12px;
  padding-top: env(safe-area-inset-top, 0);
  background: var(--ink);
  color: #fff;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: var(--tap);
  color: #fff;
  text-decoration: none;
  min-width: 0;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(135deg, #2f7bc8, #0a3764);
  border: 1px solid rgba(255, 255, 255, 0.25);
  font-weight: 800;
}

.brand-text {
  font-weight: 800;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  white-space: nowrap;
}

.brand-text em {
  font-style: normal;
  color: #8cc2ff;
}

.topbar-links {
  display: none;
}

.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  position: relative;
}

.topbar .btn-ghost {
  background: transparent;
  color: #fff;
  border-color: rgba(255, 255, 255, 0.4);
}

.topbar .btn-ghost:hover {
  border-color: #fff;
  color: #fff;
}

.hide-xs {
  display: none;
}

/* Phones: Sign out lives in the avatar menu, the side menu and Account. */
.topbar-logout {
  display: none;
}

@media (min-width: 720px) {
  .topbar-logout {
    display: inline-flex;
  }
}

/* Dropdown sheet under the top bar (guest menu) */
.sheet {
  position: fixed;
  top: var(--top-h);
  left: 0;
  right: 0;
  z-index: 39;
  display: grid;
  gap: 0.25rem;
  padding: 0.75rem 16px 1rem;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 12px 24px rgba(11, 45, 91, 0.15);
}

.sheet-item {
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: none;
  font: inherit;
  font-weight: 600;
  color: var(--ink);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.sheet-item:hover {
  background: var(--brand-soft);
}

.sheet-item.danger {
  color: var(--danger);
}

/* ——— Layout helpers ——— */
.wrap {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 16px;
}

.section {
  padding-top: 2.25rem;
}

.section-lead {
  color: var(--muted);
  margin-bottom: 1rem;
}

.eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--brand);
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.1rem 1rem;
  margin-bottom: 1rem;
  min-width: 0;
}

.card > :last-child {
  margin-bottom: 0;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-bottom: 0.6rem;
}

.card-head h2 {
  margin: 0;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 700;
  white-space: nowrap;
}

.pill.is-open {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill.is-closed,
.pill.is-full {
  background: var(--warn-soft);
  color: var(--warn);
}

.pill-yes,
.pill-no {
  display: inline-block;
  padding: 0.1rem 0.55rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}

.pill-yes {
  background: var(--ok-soft);
  color: var(--ok);
}

.pill-no {
  background: #eef1f5;
  color: var(--muted);
}

/* ——— Guest page ——— */
.hero {
  background: radial-gradient(120% 120% at 100% 0%, #2f7bc8 0%, var(--ink) 55%, var(--ink-deep) 100%);
  color: #fff;
  padding: 2.25rem 0 2.5rem;
}

.hero .eyebrow {
  color: #8cc2ff;
}

.hero h1 {
  color: #fff;
  font-size: clamp(1.9rem, 7vw, 3rem);
  margin-bottom: 0.9rem;
}

.hero h1 span {
  color: #8cc2ff;
}

.lead {
  font-size: 1.05rem;
  color: rgba(255, 255, 255, 0.88);
  max-width: 36rem;
  margin-bottom: 1.4rem;
}

.hero-actions {
  display: grid;
  gap: 0.65rem;
}

.invite {
  padding-top: 1.25rem;
}

.invite-card {
  border-color: #b9d4fb;
  background: #f5f9ff;
}

.invite-card h2 code {
  font-size: 1.1em;
}

.steps {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.75rem;
}

.steps li {
  display: flex;
  gap: 0.85rem;
  align-items: flex-start;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
}

.steps li p {
  margin: 0.15rem 0 0;
  color: var(--muted);
}

.steps strong {
  color: var(--ink-deep);
  font-size: 1.02rem;
}

.step-no {
  flex: 0 0 auto;
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}

.steps-sm li {
  border: 0;
  padding: 0.35rem 0;
  background: none;
}

.steps-sm .step-no {
  width: 28px;
  height: 28px;
  font-size: 0.85rem;
}

.steps-sm li p {
  color: var(--text);
}

.facts {
  display: grid;
  gap: 0.75rem;
}

.fact {
  background: var(--card);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: 0.95rem 1rem;
}

.fact strong {
  display: block;
  color: var(--ink-deep);
  margin-bottom: 0.2rem;
}

.fact p {
  margin: 0;
  color: var(--muted);
}

.tiers {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
}

.tier {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.9rem;
  text-align: center;
}

.tier.is-featured {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(29, 111, 224, 0.15);
}

.tier-name {
  margin: 0;
  font-weight: 700;
  color: var(--muted);
}

.tier-rate {
  margin: 0.2rem 0;
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--ink-deep);
}

.tier-note {
  margin: 0;
  font-size: 0.82rem;
  color: var(--muted);
}

.faq {
  display: grid;
  gap: 0.6rem;
}

.faq details,
.toggle-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.faq summary,
.toggle-card > summary,
.more-options > summary,
.toggle > summary {
  display: flex;
  align-items: center;
  min-height: 52px;
  padding: 0.6rem 1rem;
  font-weight: 700;
  color: var(--ink-deep);
  cursor: pointer;
  list-style: none;
}

.faq summary::-webkit-details-marker,
.toggle-card > summary::-webkit-details-marker,
.more-options > summary::-webkit-details-marker,
.toggle > summary::-webkit-details-marker {
  display: none;
}

.faq summary::after,
.toggle-card > summary::after,
.more-options > summary::after,
.toggle > summary::after {
  content: "+";
  margin-left: auto;
  padding-left: 0.75rem;
  font-size: 1.3rem;
  color: var(--brand);
}

.faq details[open] summary::after,
.toggle-card[open] > summary::after,
.more-options[open] > summary::after,
.toggle[open] > summary::after {
  content: "–";
}

.faq details p {
  margin: 0;
  padding: 0 1rem 1rem;
  color: var(--muted);
}

.toggle-card {
  padding: 0;
}

.toggle-card > .form {
  padding: 0 1rem 1rem;
}

.apps {
  display: grid;
  gap: 0.75rem;
}

.app-card {
  display: grid;
  gap: 0.8rem;
  margin: 0;
}

.app-card > div:first-of-type {
  min-width: 0;
}

.app-card p {
  margin: 0.15rem 0 0;
}

.app-mark {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, #2f7bc8, #0a3764);
  color: #fff;
  font-weight: 800;
  font-size: 1.2rem;
}

.app-mark-alt {
  background: linear-gradient(135deg, #18a06a, #0b5a3b);
}

.app-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0;
  border-top: 1px solid var(--border);
}

.app-row:first-child {
  border-top: 0;
}

.app-row p {
  margin: 0;
}

.form-card {
  max-width: 560px;
  margin: 0 auto;
}

.footer {
  padding: 2rem 16px 2.5rem;
  margin-top: 2.5rem;
  background: var(--ink-deep);
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
  font-size: 0.9rem;
}

.footer a {
  color: #8cc2ff;
  display: inline-block;
  padding: 0.7rem 0.2rem;
}

.footer p {
  margin: 0.2rem 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0 1rem;
  margin-bottom: 0.75rem;
}

.contacts {
  display: grid;
  gap: 0;
  margin: 0 auto 0.9rem;
  padding: 0.6rem 0;
  max-width: 420px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.contacts strong {
  color: #fff;
}

/* ——— Forms ——— */
.form {
  display: grid;
  gap: 0.9rem;
}

.form label {
  display: grid;
  gap: 0.35rem;
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--ink-deep);
}

.form label small {
  font-weight: 500;
  color: var(--muted);
}

.form .hint {
  font-weight: 500;
  font-size: 0.82rem;
  color: var(--muted);
}

input,
select {
  width: 100%;
  min-height: 48px;
  padding: 0.6rem 0.8rem;
  border: 1px solid #c4d1e2;
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--text);
  /* 16px stops phones zooming in on focus. */
  font: 500 16px/1.3 var(--font);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(29, 111, 224, 0.18);
}

input[readonly] {
  background: #f1f4f8;
  color: var(--muted);
}

.is-invalid {
  border-color: var(--danger) !important;
}

.field-error {
  font-weight: 600;
  font-size: 0.82rem;
  color: var(--danger);
}

.field-error:empty {
  display: none;
}

.form-status {
  margin: 0;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--muted);
}

.form-status:empty {
  display: none;
}

.form-status.ok {
  color: var(--ok);
}

.form-status.error {
  color: var(--danger);
}

.more-options {
  border: 1px dashed #c4d1e2;
  border-radius: var(--radius-sm);
}

.more-options > summary {
  min-height: 48px;
  padding: 0.5rem 0.8rem;
  font-size: 0.92rem;
}

.more-options > label {
  padding: 0 0.8rem 0.9rem;
}

.form-inline {
  margin-top: 0.75rem;
}

/* ——— Partner app ——— */
.guest,
.app {
  display: none;
}

body.is-guest .guest,
body.is-partner .app {
  display: block;
}

.app-topbar .brand {
  margin-right: auto;
}

.avatar {
  display: inline-grid;
  place-items: center;
  width: var(--tap);
  height: var(--tap);
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: #2f7bc8;
  color: #fff;
  font: 800 0.95rem var(--font);
  cursor: pointer;
}

.popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: min(280px, calc(100vw - 24px));
  padding: 0.8rem;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 32px rgba(11, 45, 91, 0.2);
}

.popover-name {
  margin: 0 0 0.1rem;
  font-weight: 800;
  color: var(--ink-deep);
  overflow-wrap: anywhere;
}

.popover .small {
  margin-bottom: 0.5rem;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 49;
  background: rgba(6, 25, 58, 0.45);
}

.side {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  z-index: 50;
  width: min(300px, 86vw);
  display: flex;
  flex-direction: column;
  padding: 0.75rem;
  padding-top: calc(0.75rem + env(safe-area-inset-top, 0));
  background: var(--card);
  border-right: 1px solid var(--border);
  transform: translateX(-102%);
  transition: transform 0.22s ease;
  visibility: hidden;
  overflow-y: auto;
}

.side.is-open {
  transform: translateX(0);
  visibility: visible;
}

.side-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0.25rem 0.5rem;
  color: var(--muted);
}

.side-head .brand-text {
  font-size: 0.8rem;
}

.side-nav {
  display: grid;
  gap: 0.2rem;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px;
  padding: 0.5rem 0.75rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.side-nav a:hover {
  background: var(--bg);
}

.side-nav a.is-active {
  background: var(--brand-soft);
  color: var(--brand-strong);
}

.side-nav svg,
.bottom-nav svg {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.side-logout {
  margin-top: auto;
}

.app-main {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 1rem 16px calc(var(--bottom-h) + 1.5rem + env(safe-area-inset-bottom, 0));
}

.view > h1 {
  margin-top: 0.25rem;
}

.welcome {
  margin-bottom: 1rem;
}

.welcome h1 {
  overflow-wrap: anywhere;
  margin-bottom: 0.25rem;
}

.rate-line {
  color: var(--muted);
  margin: 0;
}

.rate-line strong {
  color: var(--ink-deep);
}

.kpis {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.kpi {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  min-width: 0;
  padding: 0.85rem;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.kpi-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
}

.kpi-value {
  font-size: 1.12rem;
  font-weight: 800;
  color: var(--ink-deep);
  overflow-wrap: anywhere;
}

.kpi-main {
  grid-column: 1 / -1;
  background: linear-gradient(135deg, var(--brand), var(--ink));
  border: 0;
}

.kpi-main .kpi-label {
  color: rgba(255, 255, 255, 0.85);
}

.kpi-main .kpi-value {
  color: #fff;
  font-size: 1.7rem;
}

.checklist {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.checklist li {
  display: flex;
  gap: 0.7rem;
  align-items: flex-start;
}

.checklist p {
  margin: 0.1rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.checklist a {
  font-weight: 700;
  display: inline-block;
  padding: 0.7rem 0.1rem;
  margin: -0.35rem 0;
}

.tick {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  border: 2px solid #c4d1e2;
  background: #fff;
}

.checklist li.is-done .tick {
  border-color: var(--ok);
  background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 16px no-repeat;
}

.code-inline {
  font-weight: 700;
}

.copy-box {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.7rem;
}

.copy-value {
  flex: 1 1 180px;
  min-width: 0;
  display: flex;
  align-items: center;
  min-height: var(--tap);
  padding: 0.55rem 0.8rem;
  border: 1px dashed #9dbcf0;
  border-radius: var(--radius-sm);
  font-size: 1.05rem;
  font-weight: 700;
}

.copy-value.small-break {
  font-size: 0.85rem;
  font-weight: 600;
  word-break: break-all;
}

.copy-box .btn {
  flex: 0 0 auto;
}

.tiles {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
  margin-bottom: 0.75rem;
}

.tile {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
  padding: 0.7rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
}

.tile span {
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--muted);
}

.tile strong {
  font-size: 1rem;
  color: var(--ink-deep);
  overflow-wrap: anywhere;
}

.tile-accent {
  background: var(--brand-soft);
}

.note {
  font-size: 0.92rem;
  color: var(--text);
  background: var(--bg);
  border-radius: var(--radius-sm);
  padding: 0.75rem;
}

.note:empty {
  display: none;
}

.blockers {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.75rem 0.75rem 1.9rem;
  background: var(--warn-soft);
  color: var(--warn);
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
}

/* Lists */
.link-list,
.code-list,
.simple-list {
  list-style: none;
  margin: 0 0 0.75rem;
  padding: 0;
  display: grid;
  gap: 0.6rem;
}

.link-list li,
.code-list li {
  display: grid;
  gap: 0.5rem;
  padding: 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  min-width: 0;
}

.link-title {
  font-weight: 800;
  color: var(--ink-deep);
}

.link-help {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0;
}

.link-url {
  font-size: 0.85rem;
  word-break: break-all;
  padding: 0.4rem 0.6rem;
}

.code-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  flex-wrap: wrap;
}

.code-name {
  font-weight: 800;
  font-size: 1.05rem;
  color: var(--ink-deep);
  overflow-wrap: anywhere;
}

.code-stats {
  font-size: 0.85rem;
  color: var(--muted);
}

.code-actions {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.simple-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  flex-wrap: wrap;
  padding: 0.65rem 0;
  border-bottom: 1px solid var(--border);
}

.simple-list li:last-child {
  border-bottom: 0;
}

.simple-list li.muted {
  display: block;
}

.ledger-amount {
  font-weight: 800;
  color: var(--ink-deep);
}

.ledger-meta,
.signup-when {
  font-size: 0.85rem;
  color: var(--muted);
}

.empty {
  margin: 0.25rem 0 0;
  padding: 0.9rem;
  text-align: center;
  background: var(--bg);
  border-radius: var(--radius-sm);
  color: var(--muted);
}

/* Charts & tables */
.chart-box {
  position: relative;
  height: 220px;
  margin-bottom: 0.5rem;
}

.toggle {
  border-top: 1px solid var(--border);
  margin-top: 0.5rem;
}

.toggle > summary {
  padding: 0.5rem 0;
}

.table-box {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.table th,
.table td {
  padding: 0.6rem 0.55rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.table th {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--bg);
}

.table td code {
  font-size: 0.85rem;
}

.sub-name {
  font-weight: 800;
}

.sub-meta {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
}

/* Phones: each row of a .table-cards becomes its own card. */
@media (max-width: 719px) {
  .table-cards thead {
    display: none;
  }

  .table-cards,
  .table-cards tbody,
  .table-cards tr,
  .table-cards td {
    display: block;
    width: 100%;
  }

  .table-cards tr {
    margin-bottom: 0.6rem;
    padding: 0.35rem 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--card);
  }

  .table-cards td {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 1rem;
    padding: 0.45rem 0;
    white-space: normal;
    text-align: right;
    overflow-wrap: anywhere;
  }

  .table-cards td:last-child {
    border-bottom: 0;
  }

  .table-cards td::before {
    content: attr(data-label);
    flex: 0 0 auto;
    max-width: 50%;
    text-align: left;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--muted);
  }

  .table-cards td.cell-title {
    justify-content: flex-start;
    text-align: left;
    font-size: 1rem;
  }

  .table-cards td.cell-title::before {
    display: none;
  }

  .table-box {
    overflow: visible;
  }
}

/* Bottom navigation (phones) */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 45;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--bottom-h) + env(safe-area-inset-bottom, 0));
  padding-bottom: env(safe-area-inset-bottom, 0);
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -4px 16px rgba(11, 45, 91, 0.06);
}

.bottom-nav a,
.bottom-nav button {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-height: var(--tap);
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 700 0.72rem var(--font);
  text-decoration: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.bottom-nav a.is-active {
  color: var(--brand);
}

.app-footer {
  text-align: center;
  padding: 1.5rem 0 0.5rem;
}

.app-footer a {
  display: inline-block;
  padding: 0.75rem 0;
}

.strong-link {
  font-weight: 700;
  overflow-wrap: anywhere;
  display: inline-block;
  padding: 0.75rem 0;
}

/* ——— Sign-in dialog ——— */
.login-dialog {
  width: min(440px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  box-shadow: 0 24px 60px rgba(6, 25, 58, 0.35);
}

.login-dialog::backdrop {
  background: rgba(6, 25, 58, 0.55);
}

.login-card {
  padding: 1.1rem 1.1rem 1.25rem;
}

.login-card .card-head {
  margin-bottom: 0;
}

/* ——— Bigger phones ——— */
@media (min-width: 400px) {
  .hide-xs {
    display: inline-flex;
  }
}

/* ——— Tablet ——— */
@media (min-width: 720px) {
  h1 {
    font-size: 2rem;
  }

  .hero {
    padding: 4rem 0 4.5rem;
  }

  .hero-actions {
    display: flex;
    flex-wrap: wrap;
  }

  .steps {
    grid-template-columns: repeat(2, 1fr);
  }

  .facts,
  .apps {
    grid-template-columns: repeat(3, 1fr);
  }

  .apps {
    grid-template-columns: repeat(2, 1fr);
  }

  .tiers {
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  }

  .kpis {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .tiles {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .card {
    padding: 1.35rem 1.4rem;
  }

  .form-inline {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    align-items: end;
  }

  .link-list li {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }

  .link-list li .link-help,
  .link-list li .link-title {
    grid-column: 1 / -1;
  }

  .chart-box {
    height: 260px;
  }
}

/* ——— Desktop ——— */
@media (min-width: 960px) {
  .topbar {
    padding: 0 24px;
  }

  .topbar-links {
    display: flex;
    gap: 0.25rem;
    margin-left: 1.5rem;
  }

  .topbar-links .link-btn {
    color: rgba(255, 255, 255, 0.85);
  }

  .topbar-links .link-btn:hover {
    color: #fff;
  }

  .guest .menu-toggle,
  .app .menu-toggle,
  .sheet,
  .bottom-nav,
  .drawer-backdrop,
  .side-head {
    display: none !important;
  }

  .steps {
    grid-template-columns: repeat(5, 1fr);
  }

  .steps li {
    flex-direction: column;
  }

  .side {
    top: var(--top-h);
    width: var(--side-w);
    transform: none;
    visibility: visible;
    transition: none;
    z-index: 30;
  }

  .app-main {
    max-width: calc(980px + var(--side-w));
    padding: 1.75rem 32px 2rem calc(var(--side-w) + 32px);
  }

  .kpis {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .kpi-main {
    grid-column: auto;
  }

  .kpi-main .kpi-value {
    font-size: 1.35rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .side {
    transition: none;
  }
}

/* One of each (2026-11-21): the signed-in app had two menu buttons on
   phones (top ☰ and the bottom "More", both opening the same menu) and
   three Sign out buttons on desktop. Phones use the bottom bar; desktop the
   sidebar; Sign out lives in the avatar menu (and the phone menu). */
.app .menu-toggle,
.topbar-logout {
  display: none !important;
}

@media (min-width: 960px) {
  .side-logout {
    display: none;
  }
}
