
/* ---------- base ---------- */
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-sans); font-size: 16px; line-height: 24px; -webkit-font-smoothing: antialiased; }
.ct-mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.ct-num { text-align: right; font-variant-numeric: tabular-nums; }
.ct-row { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; padding: var(--space-5); }
.ct-stack { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); max-width: 420px; }
:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); }
@keyframes ct-spin { to { transform: rotate(360deg); } }
.ct-spin { animation: ct-spin 0.9s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ct-spin { animation: none; } }

/* ---------- Logo ---------- */
.ct-logo { display: inline-flex; align-items: center; gap: 0.32em; color: inherit; line-height: 1; }
.ct-logo__mark { display: block; flex: none; }
.ct-logo__roof { stroke: var(--moss); }
.ct-logo__pod { fill: var(--moss); }
.ct-logo__pod--lit { fill: var(--hearth); }
.ct-logo__mark--mono .ct-logo__roof { stroke: currentColor; }
.ct-logo__mark--mono .ct-logo__pod { fill: currentColor; }
.ct-logo--lockup { align-items: flex-end; }
.ct-logo__word { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.035em; color: var(--ink); line-height: 0.8; padding-bottom: 0.13em; }

/* ---------- Button ---------- */
.ct-btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2); font-family: var(--font-sans); font-weight: 600; border-radius: var(--radius-sm); border: 1px solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color 120ms cubic-bezier(0.2, 0, 0, 1), border-color 120ms, color 120ms; }
.ct-btn--sm { height: var(--control-sm); padding: 0 var(--space-3); font-size: 14px; line-height: 20px; }
.ct-btn--md { height: var(--control-md); padding: 0 var(--space-4); font-size: 14px; line-height: 20px; }
.ct-btn--lg { height: var(--control-lg); padding: 0 var(--space-6); font-size: 16px; line-height: 24px; }
.ct-btn--block { width: 100%; }
.ct-btn--primary { background: var(--moss); color: var(--on-moss); }
.ct-btn--primary:hover { background: var(--moss-hover); }
.ct-btn--secondary { background: var(--paper-raised); color: var(--ink); border-color: var(--line-strong); }
.ct-btn--secondary:hover { background: var(--paper-sunken); }
.ct-btn--quiet { background: transparent; color: var(--ink); }
.ct-btn--quiet:hover { background: var(--paper-sunken); }
.ct-btn--danger { background: var(--paper-raised); color: var(--danger); border-color: var(--danger); }
.ct-btn--danger:hover { background: var(--danger-soft); }
.ct-btn--inverse { background: transparent; color: var(--on-moss); border-color: var(--on-moss); }
.ct-btn:disabled { opacity: 0.45; cursor: not-allowed; }
.ct-btn__icon { display: inline-flex; width: 20px; height: 20px; align-items: center; justify-content: center; }

/* ---------- TextField ---------- */
.ct-field { display: flex; flex-direction: column; gap: var(--space-2); }
.ct-field__label { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.ct-field__control { display: flex; align-items: stretch; background: var(--paper-raised); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; }
.ct-field__control:focus-within { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--focus); border-color: var(--focus); }
.ct-field__control--sm { height: var(--control-sm); }
.ct-field__control--md { height: var(--control-md); }
.ct-field__control--lg { height: var(--control-lg); }
.ct-field__input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0 var(--space-3); font: inherit; font-size: 15px; color: var(--ink); outline: none; box-shadow: none !important; }
.ct-field__input::placeholder { color: var(--ink-subtle); }
.ct-field__affix { display: inline-flex; align-items: center; padding: 0 var(--space-3); background: var(--paper-sunken); color: var(--ink-muted); font-size: 14px; border-left: 1px solid var(--line); }
.ct-field__affix:first-child { border-left: 0; border-right: 1px solid var(--line); }
.ct-field__hint { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.ct-field__error { margin: 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--danger); }
.ct-field--error .ct-field__control { border-color: var(--danger); }

/* ---------- Badge ---------- */
.ct-badge { display: inline-flex; align-items: center; gap: var(--space-1); height: 22px; padding: 0 var(--space-2); border-radius: var(--radius-xs); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.ct-badge--neutral { background: var(--paper-sunken); color: var(--ink-muted); }
.ct-badge--outline { background: transparent; color: var(--ink-muted); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ct-badge--moss { background: var(--moss-soft); color: var(--moss); }
.ct-badge--hearth { background: var(--hearth-soft); color: var(--hearth-ink); }
.ct-badge--honey { background: var(--honey-soft); color: var(--honey-ink); }
.ct-badge__dot { width: 8px; height: 8px; border-radius: var(--radius-full); background: var(--honey); box-shadow: 0 0 0 1px var(--honey-ink); }

/* ---------- StatusPill ---------- */
.ct-pill { display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px 0 8px; border-radius: var(--radius-full); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap; }
.ct-pill--success { background: var(--success-soft); color: var(--success); }
.ct-pill--warning { background: var(--warning-soft); color: var(--warning); }
.ct-pill--danger { background: var(--danger-soft); color: var(--danger); }
.ct-pill--neutral { background: var(--paper-sunken); color: var(--ink-muted); }

/* ---------- Banner ---------- */
.ct-banner { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-4); border-radius: var(--radius-md); }
.ct-banner__icon { flex: none; margin-top: 2px; }
.ct-banner__body { flex: 1; min-width: 0; }
.ct-banner__title { margin: 0; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink); }
.ct-banner__text { margin: 2px 0 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ct-banner__action { flex: none; align-self: center; }
.ct-banner--info { background: var(--info-soft); color: var(--info); }
.ct-banner--success { background: var(--success-soft); color: var(--success); }
.ct-banner--warning { background: var(--warning-soft); color: var(--warning); }
.ct-banner--danger { background: var(--danger-soft); color: var(--danger); }

/* ---------- AppIcon ---------- */
.ct-appicon { display: inline-flex; flex: none; align-items: center; justify-content: center; background: var(--paper-raised); box-shadow: inset 0 0 0 1px var(--line); overflow: hidden; }
.ct-appicon__letter { font-family: var(--font-display); font-weight: 600; color: var(--moss); background: var(--moss-soft); width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-variation-settings: 'opsz' 24; }

/* ---------- AppCard ---------- */
.ct-appcard { position: relative; display: flex; flex-direction: column; gap: var(--space-3); min-height: 196px; box-sizing: border-box; padding: var(--space-5); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-sm); transition: box-shadow 120ms, border-color 120ms; }
.ct-appcard:hover { box-shadow: var(--shadow-md); border-color: var(--line-strong); }
.ct-appcard__head { display: flex; gap: var(--space-3); align-items: center; }
.ct-appcard__titles { min-width: 0; }
.ct-appcard__name { margin: 0; font-size: 18px; line-height: 26px; font-weight: 600; color: var(--ink); }
.ct-appcard__link { color: inherit; text-decoration: none; }
.ct-appcard__link::after { content: ''; position: absolute; inset: 0; border-radius: var(--radius-md); }
.ct-appcard__cat { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.ct-appcard__tagline { margin: 0; flex: 1; font-size: 14px; line-height: 20px; color: var(--ink-muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ct-appcard__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--line); }
.ct-appcard__price { margin: 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ct-appcard__price strong { color: var(--ink); font-weight: 600; }

/* ---------- PriceEstimate ---------- */
.ct-price { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-6); padding: var(--space-6); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ct-price__rows { display: flex; flex-direction: column; }
.ct-stepper { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 56px; border-bottom: 1px solid var(--line); }
.ct-stepper:last-child { border-bottom: 0; }
.ct-stepper__label { font-size: 14px; line-height: 20px; font-weight: 600; }
.ct-stepper__control { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: var(--radius-sm); overflow: hidden; height: var(--control-md); }
.ct-stepper__btn { width: 40px; height: 100%; border: 0; background: var(--paper-raised); color: var(--ink); font-size: 18px; cursor: pointer; }
.ct-stepper__btn:hover { background: var(--paper-sunken); }
.ct-stepper__btn:disabled { color: var(--ink-subtle); cursor: not-allowed; background: var(--paper-raised); }
.ct-stepper__value { min-width: 96px; text-align: center; font-size: 14px; border-left: 1px solid var(--line); border-right: 1px solid var(--line); line-height: 38px; }
.ct-price__total { display: flex; flex-direction: column; justify-content: center; padding: var(--space-5); background: var(--paper-sunken); border-radius: var(--radius-md); }
.ct-price__caption { margin: 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-subtle); }
.ct-price__amount { margin: var(--space-1) 0 0; font-family: var(--font-display); font-weight: 600; font-size: 48px; line-height: 52px; color: var(--hearth-ink); font-variation-settings: 'opsz' 72; font-variant-numeric: tabular-nums lining-nums; }
.ct-price__amount span { font-family: var(--font-sans); font-size: 16px; font-weight: 500; color: var(--ink-muted); margin-left: 2px; }
.ct-price__hourly { margin: var(--space-2) 0 0; font-size: 12px; line-height: 16px; color: var(--ink-muted); }
.ct-price__note { margin: var(--space-3) 0 0; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
@media (max-width: 640px) { .ct-price { grid-template-columns: 1fr; } }

/* ---------- BalanceCard ---------- */
.ct-balance { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-1); padding: var(--space-5); background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); }
.ct-balance__label { margin: 0; font-size: 12px; line-height: 16px; font-weight: 500; color: var(--ink-subtle); }
.ct-balance__amount { margin: 0; font-size: 24px; line-height: 30px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ct-balance__runway { margin: 0 0 var(--space-3); font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ct-balance__runway--warning { color: var(--warning); font-weight: 600; }
.ct-balance__runway--danger { color: var(--danger); font-weight: 600; }
.ct-balance--compact { padding: var(--space-3); align-items: stretch; }
.ct-balance--compact .ct-balance__amount { font-size: 18px; line-height: 26px; }
.ct-balance--compact .ct-balance__runway { font-size: 12px; line-height: 16px; margin-bottom: var(--space-2); }

/* ---------- AppTable ---------- */
.ct-table-wrap { background: var(--paper-raised); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.ct-table { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.ct-table th { height: 40px; padding: 0 var(--space-4); text-align: left; font-weight: 600; color: var(--ink-muted); background: var(--paper-sunken); border-bottom: 1px solid var(--line); }
.ct-table th.ct-num { text-align: right; }
.ct-table td { height: var(--table-row); padding: var(--space-2) var(--space-4); border-bottom: 1px solid var(--line); vertical-align: middle; }
.ct-table tr:last-child td { border-bottom: 0; }
.ct-table tbody tr:hover td { background: var(--paper-sunken); cursor: pointer; }
.ct-table__app { display: flex; align-items: center; gap: var(--space-3); }
.ct-table__name { margin: 0; font-weight: 600; }
.ct-table__type { margin: 0; font-size: 12px; line-height: 16px; color: var(--ink-subtle); }
.ct-table__addr { color: var(--ink-muted); font-size: 13px; }
.ct-table__size { color: var(--ink-muted); font-size: 13px; white-space: nowrap; }

/* ---------- EmptyState ---------- */
.ct-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); background: var(--paper-raised); border: 1px dashed var(--line-strong); border-radius: var(--radius-lg); }
.ct-empty__title { margin: var(--space-2) 0 0; font-family: var(--font-display); font-size: 24px; line-height: 30px; font-weight: 600; font-variation-settings: 'opsz' 24; }
.ct-empty__text { margin: 0; max-width: 420px; font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.ct-empty__actions { display: flex; gap: var(--space-2); margin-top: var(--space-3); flex-wrap: wrap; justify-content: center; }

/* ---------- PodRow + RoofRule ---------- */
.ct-podrow { display: block; flex: none; }
.ct-podrow__roof { stroke: var(--moss); }
.ct-pod--full { fill: var(--moss); }
.ct-pod--lit { fill: var(--hearth); }
.ct-pod--empty { fill: var(--moss-soft); stroke: var(--moss); stroke-width: 1.5; }
.ct-roof-rule { display: flex; align-items: center; gap: var(--space-3); width: 100%; }
.ct-roof-rule__line { flex: 1; height: 1px; background: var(--line); }
.ct-roof-rule__peak { flex: none; stroke: var(--moss); }

/* ---------- SiteHeader ---------- */
.ct-site-header { position: sticky; top: 0; z-index: 10; background: var(--paper); border-bottom: 1px solid var(--line); }
.ct-site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--space-8); height: var(--site-header-height); max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-8); }
.ct-site-header__home { display: inline-flex; text-decoration: none; border-radius: var(--radius-sm); }
.ct-site-header__nav { display: flex; gap: var(--space-8); }
.ct-site-header__link { position: relative; font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); text-decoration: none; padding: var(--space-2) 0; }
.ct-site-header__link:hover, .ct-site-header__link.is-current { color: var(--ink); }
.ct-site-header__link.is-current::after { content: ''; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: var(--moss); border-radius: 2px; }
.ct-site-header__actions { display: flex; gap: var(--space-2); }
@media (max-width: 1023px) { .ct-site-header__nav { display: none; } }

/* ---------- AppSidebar ---------- */
.ct-sidebar { display: flex; flex-direction: column; width: var(--sidebar-width); box-sizing: border-box; min-height: 100%; padding: var(--space-5) var(--space-4); background: var(--paper-sunken); border-right: 1px solid var(--line); }
.ct-sidebar__brand { height: 40px; display: flex; align-items: center; padding: 0 var(--space-1); margin-bottom: var(--space-6); }
.ct-sidebar__nav { display: flex; flex-direction: column; gap: var(--space-1); }
.ct-sidebar__item { display: flex; align-items: center; gap: var(--space-3); height: 40px; padding: 0 var(--space-3); border-radius: var(--radius-sm); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--ink-muted); text-decoration: none; }
.ct-sidebar__item:hover { background: var(--paper-raised); color: var(--ink); }
.ct-sidebar__item.is-active { background: var(--moss-soft); color: var(--moss); }
.ct-sidebar__rule { border: 0; border-top: 1px solid var(--line); margin: var(--space-3) 0; width: 100%; }
.ct-sidebar__foot { margin-top: auto; padding-top: var(--space-6); }

/* ---------- Layout helpers used by the page showcases ---------- */
.ct-container { max-width: var(--container-max); margin: 0 auto; padding: 0 var(--space-8); }
.ct-band { padding: var(--space-24) 0; }
.ct-band--sunken { background: var(--paper-sunken); }
.ct-band--moss { background: var(--moss); color: var(--on-moss); }
.ct-eyebrow { margin: 0; font-size: 13px; line-height: 16px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--moss); }
.ct-display-xl { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 64px; line-height: 68px; letter-spacing: -0.02em; font-variation-settings: 'opsz' 96; }
.ct-display-l { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 48px; line-height: 52px; letter-spacing: -0.015em; font-variation-settings: 'opsz' 72; }
.ct-h1 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 40px; line-height: 46px; letter-spacing: -0.01em; font-variation-settings: 'opsz' 48; }
.ct-h2 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 32px; line-height: 38px; letter-spacing: -0.01em; font-variation-settings: 'opsz' 36; }
.ct-h3 { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: 24px; line-height: 30px; font-variation-settings: 'opsz' 24; }
.ct-lede { margin: 0; font-size: 18px; line-height: 28px; color: var(--ink-muted); }
.ct-muted { color: var(--ink-muted); }
.ct-caption { font-size: 12px; line-height: 16px; color: var(--ink-subtle); font-weight: 500; }
