:root {
  --ink: #18322d;
  --muted: #63756f;
  --paper: #f4f1e9;
  --surface: #fffdf8;
  --green: #1f5d4d;
  --green-dark: #123830;
  --sage: #dbe6d8;
  --danger: #a33c32;
  --line: #dfe3da;
  --focus-ring: 0 0 0 3px rgba(31, 93, 77, .22);
  --gradient-accent: linear-gradient(90deg, var(--green), var(--gold, #d39b42));
  --gradient-page: radial-gradient(1100px 520px at 12% -8%, rgba(219, 230, 216, .55), transparent 60%), linear-gradient(180deg, #f8f5eb, var(--paper) 420px);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--gradient-page);
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-height: 100vh; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
a, button, input, select, textarea, summary, [tabindex] { transition: box-shadow .15s ease, border-color .15s ease, background-color .15s ease, color .15s ease; }
:focus-visible { outline: none; box-shadow: var(--focus-ring); }

.topbar {
  height: 76px; padding: 0 max(24px, calc((100vw - 1440px) / 2));
  display: flex; align-items: center; justify-content: space-between;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 1px 0 rgba(24, 50, 45, .03), 0 2px 8px rgba(24, 50, 45, .04);
  position: sticky; top: 0; z-index: 10;
}
.topbar::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; background: var(--gradient-accent); }
.topbar-actions, .main-nav { display: flex; align-items: center; gap: 10px; }
.main-nav a { padding: 8px 10px; border-radius: 8px; color: var(--muted); text-decoration: none; font-size: .85rem; font-weight: 750; }
.main-nav a:hover { color: var(--green); background: var(--sage); }
.main-nav a.active { color: var(--green-dark); background: linear-gradient(135deg, var(--sage), #cfe0cb); box-shadow: inset 0 0 0 1px rgba(31, 93, 77, .18); }
.brand { display: flex; gap: 12px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 750; }
.brand small { color: var(--muted); font-size: .72rem; letter-spacing: .12em; margin-left: 4px; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; color: white; background: var(--green); border-radius: 50% 50% 46% 54%; font-weight: 800; }
.brand-mark.large { width: 60px; height: 60px; margin: 0 auto 28px; font-size: 1.15rem; }
.brand-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.product-mark { padding: 0; background: transparent; border-radius: 0; }
.product-mark img { object-fit: contain; }

.shell { width: min(1440px, calc(100% - 48px)); margin: 0 auto 64px; }
.hero { display: flex; align-items: end; justify-content: space-between; gap: 24px; padding: 48px 0 32px; }
h1, h2, p { margin-top: 0; }
h1 { max-width: 720px; margin-bottom: 10px; font-family: Georgia, serif; font-size: clamp(2.4rem, 5vw, 4.25rem); line-height: 1.02; font-weight: 500; letter-spacing: -.035em; }
h2 { margin-bottom: 0; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.eyebrow { margin-bottom: 10px; color: var(--green); text-transform: uppercase; letter-spacing: .14em; font-size: .72rem; font-weight: 800; }
.lede { margin-bottom: 0; color: var(--muted); font-size: 1.05rem; }

.workspace { position: relative; padding: 28px 0; }
.platform-workspace { margin-top: 24px; }
.workspace-heading { display: flex; justify-content: space-between; align-items: center; gap: 24px; margin-bottom: 24px; }
.search input { width: min(320px, 45vw); }
input, select, textarea { width: 100%; border: 1px solid #ccd5cd; border-radius: 10px; padding: 11px 12px; color: var(--ink); background: white; }
.empty { padding: 48px 10px; text-align: center; color: var(--muted); }

.platform-company-list { display: grid; gap: 14px; }
.platform-company-heading, .platform-badges { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.platform-company-heading h3 { margin: 0 0 3px; }
.platform-company-heading p { margin: 0; color: var(--muted); font-size: .8rem; }
.platform-usage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 18px 0; }
.platform-usage-grid > div { padding: 12px; border-radius: 10px; background: var(--paper); }
.platform-usage-grid strong, .platform-usage-grid span { display: block; }
.platform-usage-grid span { margin-top: 4px; color: var(--muted); font-size: .72rem; }
.platform-company-card summary { color: var(--green); cursor: pointer; font-weight: 750; }
.platform-detail-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; color: var(--muted); font-size: .8rem; }

dialog { width: min(620px, calc(100% - 32px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); background: var(--surface); box-shadow: 0 30px 90px rgba(12, 31, 26, .24); }
dialog::backdrop { background: rgba(17, 36, 31, .55); backdrop-filter: blur(3px); }
dialog:focus-visible { box-shadow: 0 30px 90px rgba(12, 31, 26, .24); }
form { padding: 28px; }
form > label, .form-row { margin-bottom: 16px; }
label { display: block; flex: 1; color: var(--muted); font-size: .78rem; font-weight: 700; }
label input, label select, label textarea { margin-top: 7px; color: var(--ink); font-weight: 400; }
.dialog-heading, .dialog-actions, .form-row { display: flex; gap: 14px; }
.dialog-heading { justify-content: space-between; align-items: start; margin-bottom: 24px; }
.dialog-actions { align-items: center; margin-top: 24px; }
.spacer { flex: 1; }
.error { min-height: 20px; margin: 0; color: var(--danger); font-size: .85rem; }
.field-help { margin: -6px 0 14px; color: var(--muted); font-size: .78rem; }

.signed-out { min-height: calc(100vh - 76px); display: grid; place-items: center; padding: 40px 24px; background: radial-gradient(circle at 50% 20%, #fffdf8, var(--paper) 58%); }
.signed-out-card { max-width: 620px; text-align: center; }
.signed-out-card h1 { font-size: clamp(2.3rem, 6vw, 4rem); }
.signed-out-card p:not(.eyebrow) { color: var(--muted); font-size: 1.05rem; margin-bottom: 28px; }

.toast { position: fixed; right: 24px; bottom: 24px; translate: 0 120px; opacity: 0; padding: 12px 18px; border-radius: 10px; color: white; background: var(--ink); transition: .2s; }
.toast.visible { translate: 0; opacity: 1; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

@media (max-width: 760px) {
  .platform-usage-grid, .platform-detail-grid { grid-template-columns: repeat(2, 1fr); }
}
