/* TruePyramids design tokens and components, matching the design canvas. */
:root {
  --green-900: #004D1F;
  --green-700: #007F32;
  --green-500: #3E9F5E;
  --green-300: #8CCB9F;
  --green-100: #CBE8D3;
  --green-50: #E8F4EC;
  --purple-900: #431566;
  --purple-800: #5B1F8A;
  --purple-600: #7A2FB5;
  --purple-100: #D9C2EE;
  --purple-50: #F4ECFB;
  --ink: #13171F;
  --ink-2: #4B5563;
  --ink-3: #5B6472;
  --line: #DDE1E7;
  --line-strong: #C9CFD8;
  --line-soft: #E8EBEF;
  --page: #F5F6F8;
  --surface: #FFFFFF;
  --surface-2: #F9FAFB;
  --gold: #E0A100;
  --font-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-head: 'Space Grotesk', system-ui, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--page); color: var(--ink); font-family: var(--font-body); font-size: 16px; line-height: 1.55; }
a { color: var(--green-700); }
a:hover { color: var(--green-900); }
:focus-visible { outline: 2px solid var(--green-700); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--font-head); font-weight: 600; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: 36px; line-height: 1.1; }
h2 { font-size: 22px; line-height: 1.2; }
p { margin: 0; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Layout classes like .stack set display, which would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

/* Header */
.tp-header { background: var(--surface); border-bottom: 1px solid var(--line); }
.tp-header__inner { max-width: 1200px; margin: 0 auto; padding: 10px 24px; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; }
.tp-brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 700; font-size: 20px; letter-spacing: -0.01em; }
.tp-brand:hover { color: var(--ink); }
.tp-nav { display: flex; gap: 4px; }
.tp-nav a { display: inline-flex; align-items: center; height: 44px; padding: 0 14px; border-radius: 8px; color: var(--ink-2); text-decoration: none; font-weight: 500; }
.tp-nav a[aria-current="page"] { background: var(--green-50); color: var(--green-900); font-weight: 600; }
/* Right-aligned even when the header wraps on phones, so the menu opens inside the screen. */
.tp-account { display: flex; align-items: center; gap: 14px; font-size: 14px; color: var(--ink-2); margin-left: auto; min-width: 0; }
.tp-account__org { min-width: 0; max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-avatar { width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--green-900); color: #fff; font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.tp-menu { position: relative; }
.tp-menu__panel { position: absolute; right: 0; top: 48px; z-index: 50; min-width: 220px; width: max-content; max-width: min(320px, calc(100vw - 48px)); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 32px rgba(0,0,0,.12); padding: 8px; display: flex; flex-direction: column; }
.tp-menu__panel[hidden] { display: none; }
.tp-menu__panel a, .tp-menu__panel button { display: flex; align-items: center; height: 44px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; text-decoration: none; cursor: pointer; text-align: left; width: 100%; }
.tp-menu__panel a:hover, .tp-menu__panel button:hover { background: var(--page); }
/* Organization switcher: the person's organizations (the current one checked), then invitations to others. */
.tp-menu__label { padding: 8px 12px 4px; font-size: 12px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-3); }
.tp-menu__group { display: flex; flex-direction: column; max-height: 40vh; overflow-y: auto; }
.tp-menu__panel .tp-menu__item { height: auto; min-height: 44px; padding-top: 10px; padding-bottom: 10px; line-height: 1.3; overflow-wrap: anywhere; }
.tp-menu__panel .tp-menu__org { position: relative; padding-left: 36px; }
.tp-menu__panel .tp-menu__org[aria-checked="true"] { color: var(--green-900); font-weight: 600; }
.tp-menu__org[aria-checked="true"]::before { content: ""; position: absolute; left: 14px; top: 50%; width: 10px; height: 5px; border-left: 2px solid var(--green-700); border-bottom: 2px solid var(--green-700); transform: translateY(-75%) rotate(-45deg); }
.tp-menu__panel .tp-menu__new { position: relative; padding-left: 36px; color: var(--green-700); font-weight: 600; }
.tp-menu__new::before { content: "+"; position: absolute; left: 13px; top: 50%; font-size: 20px; line-height: 1; transform: translateY(-55%); }
.tp-menu__divider { height: 1px; margin: 6px 4px; background: var(--line-soft); }

/* Layout */
.tp-main { max-width: 1200px; margin: 0 auto; padding: 32px 24px 96px; display: flex; flex-direction: column; gap: 24px; }
.tp-narrow { max-width: 560px; margin: 0 auto; padding: 64px 16px 96px; }
.tp-center { min-height: calc(100vh - 66px); display: flex; align-items: center; justify-content: center; padding: 48px 16px 96px; }
.eyebrow { font-size: 13px; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--green-700); }
.muted { color: var(--ink-2); }
.small { font-size: 14px; }

/* Cards and panels */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px 24px; }
.card--auth { width: 100%; max-width: 440px; border-radius: 16px; padding: 40px; display: flex; flex-direction: column; gap: 28px; box-shadow: 0 24px 48px -24px rgba(0, 77, 31, 0.2); }
.card--form { border-radius: 16px; padding: 40px; display: flex; flex-direction: column; gap: 24px; }
.stack { display: flex; flex-direction: column; gap: 8px; }
.stack-lg { display: flex; flex-direction: column; gap: 16px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.row--between { justify-content: space-between; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr)); gap: 24px; }
.divider-top { border-top: 1px solid var(--line-soft); padding-top: 20px; }
.notice { padding: 14px 18px; border-radius: 10px; background: var(--purple-50); border: 1px solid var(--purple-100); color: var(--purple-900); }
.notice b { color: var(--purple-800); }
.notice--ok { background: var(--green-50); border-color: var(--green-100); color: #33473B; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 18px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.btn:hover { color: var(--ink); border-color: #A3ABB8; }
.btn--primary { background: var(--green-700); border-color: var(--green-700); color: #fff; font-weight: 600; }
.btn--primary:hover { background: var(--green-900); border-color: var(--green-900); color: #fff; }
.btn--lg { height: 48px; padding: 0 28px; }
.btn--provider { height: 52px; justify-content: flex-start; gap: 12px; padding: 0 20px; width: 100%; }
.btn--link { border: 0; background: transparent; padding: 0 8px; color: var(--ink-2); text-decoration: underline; }
.btn--danger { background: var(--purple-600); border-color: var(--purple-600); color: #fff; font-weight: 600; }
.btn--danger:hover { background: var(--purple-800); border-color: var(--purple-800); color: #fff; }
.provider-mark { width: 22px; height: 22px; border-radius: 4px; background: #EEF1F5; border: 1px solid var(--line-strong); font-size: 12px; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; }
.btn[aria-disabled="true"] { opacity: 0.55; pointer-events: none; }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; font-weight: 600; }
.field__from { font-size: 12px; font-weight: 600; color: var(--green-700); }
.field__hint { font-size: 14px; color: var(--ink-3); }
.input { height: 48px; padding: 0 14px; border: 1px solid var(--line-strong); border-radius: 8px; font: inherit; color: var(--ink); background: var(--surface); width: 100%; }
.input--prefilled { background: var(--surface-2); }
.input-validation-error { border-color: var(--purple-600); }
.field-validation-error { font-size: 14px; color: var(--purple-800); font-weight: 600; }

/* The "?" beside a section heading in the app. */
.help-link { display: inline-flex; align-items: center; gap: 6px; vertical-align: middle; color: var(--ink-3); text-decoration: none; font-family: var(--font-body); font-size: 14px; font-weight: 500; letter-spacing: 0; line-height: 1; }
.help-link__mark { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid currentColor; font-size: 12px; font-weight: 700; }
.help-link:hover { color: var(--green-700); }
/* A 44px tap target around the small mark. */
.help-link { position: relative; }
.help-link::after { content: ""; position: absolute; inset: -12px; }
.help-link--text { text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 3px; }
@media print { .help-link { display: none !important; } }

/* Plus tag */
.plus-tag { background: var(--green-50); color: var(--green-900); border: 1px solid var(--green-100); font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }

/* Pyramid and History tabs on each pyramid */
.pyramid-views { display: flex; gap: 8px; border-bottom: 1px solid var(--line); }
.pyramid-views a, .pyramid-views button { display: inline-flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; margin-bottom: -1px; border: 0; border-bottom: 3px solid transparent; background: transparent; color: var(--ink-2); font: inherit; font-weight: 500; text-decoration: none; cursor: pointer; }
.pyramid-views a[aria-current="page"] { border-bottom-color: var(--green-700); color: var(--green-900); font-weight: 600; }
.pyramid-views a:not([aria-current="page"]):hover, .pyramid-views button:hover { color: var(--ink); }
.pyramid-views .help-link { height: auto; padding: 0 4px; margin: 0; border: 0; align-self: center; color: var(--ink-3); }

@media (max-width: 600px) {
  h1 { font-size: 30px; }
  .card--auth, .card--form { padding: 28px 20px; }
}

/* Settings › Plan: inline cancel confirmation */
.plan-cancel > summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; height: 44px; }
.plan-cancel > summary::-webkit-details-marker { display: none; }
.plan-cancel__body { margin-top: 12px; padding: 16px 18px; border: 1px solid var(--purple-100); background: var(--purple-50); border-radius: 10px; max-width: 620px; }
.plan-cancel__body ul { margin: 0; padding-left: 20px; color: var(--ink-2); display: flex; flex-direction: column; gap: 4px; }
.plan-key { border-top: 1px solid var(--line); padding-top: 20px; margin-top: 4px; }
.plan-key__form > summary { list-style: none; cursor: pointer; align-self: flex-start; display: inline-flex; }
.plan-key__form > summary::-webkit-details-marker { display: none; }
.plan-key__form[open] > summary { margin-bottom: 12px; }
