/* DeductIt web components — consumes tokens.css. Prefix: di- */

/* Base */
.di-root, .di-preview { font-family: var(--font-sans); color: var(--text); background: var(--surface); -webkit-font-smoothing: antialiased; }
.di-preview { margin: 0; padding: var(--space-6); }
.di-preview.di-on-inverse, .di-on-inverse { background: var(--surface-inverse); color: var(--text-on-inverse); }
.di-preview.di-on-subtle, .di-on-subtle { background: var(--surface-subtle); }
.di-preview.di-on-warm, .di-on-warm { background: var(--surface-warm); }
.di-row { display: flex; flex-wrap: wrap; gap: var(--space-4); align-items: center; }
.di-stack { display: grid; gap: var(--space-4); }

/* Button — primary (apricot) once per view; secondary (deep jade) and ghost for the rest */
.di-btn { font-family: var(--font-sans); font-size: 16px; line-height: 24px; font-weight: 700; letter-spacing: 0;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-height); padding: 0 var(--space-6); border-radius: var(--radius-md);
  border: var(--border-width-strong) solid transparent; cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background-color .15s, box-shadow .15s, transform .15s; }
.di-btn:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }
.di-btn-primary { background: var(--action); border-color: var(--action); color: var(--on-action); }
.di-btn-primary:hover { background: var(--action-hover); border-color: var(--action-hover); box-shadow: var(--shadow-sm); }
.di-btn-primary:active { background: var(--action-hover); border-color: var(--action-hover); box-shadow: none; transform: translateY(1px); }
.di-btn-secondary { background: var(--action-secondary); border-color: var(--action-secondary); color: var(--on-action-secondary); }
.di-btn-secondary:hover { background: var(--action-secondary-hover); border-color: var(--action-secondary-hover); }
.di-btn-outline { background: transparent; border-color: var(--action-secondary); color: var(--text); }
.di-btn-outline:hover { background: var(--surface-subtle); }
.di-btn-ghost { background: transparent; border-color: transparent; color: var(--link); text-decoration: underline; text-underline-offset: 4px; padding: 0 var(--space-2); }
.di-btn-ghost:hover { color: var(--link-hover); }
.di-btn-sm { font-size: 14px; line-height: 20px; min-height: var(--control-height-sm); padding: 0 var(--space-4); }
.di-btn[disabled], .di-btn[aria-disabled="true"] { background: var(--neutral-100); border-color: var(--neutral-100); color: var(--neutral-500); cursor: not-allowed; box-shadow: none; }
.di-on-inverse .di-btn:focus-visible { box-shadow: 0 0 0 2px var(--surface-inverse), 0 0 0 4px var(--focus-ring-on-inverse); }
.di-on-inverse .di-btn-outline { border-color: var(--text-on-inverse); color: var(--text-on-inverse); }
.di-on-inverse .di-btn-outline:hover { background: var(--surface-inverse-raised); }
.di-on-inverse .di-btn-ghost { color: var(--text-on-inverse); }

/* Link */
.di-link { color: var(--link); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.di-link:hover { color: var(--link-hover); }
.di-link:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: 2px; }

/* Card — border on light surfaces, shadow only on hover or when floating */
.di-card { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-6); }
.di-card-media { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--radius-md); margin-bottom: var(--space-5); background: var(--jade-200); }
.di-card-title { font-size: 24px; line-height: 32px; font-weight: 700; letter-spacing: -0.005em; margin: 0 0 var(--space-2); }
.di-card-body { font-size: 16px; line-height: 24px; color: var(--text-muted); margin: 0; }
.di-card-link { display: inline-block; margin-top: var(--space-4); }
.di-card-hover:hover { box-shadow: var(--shadow-md); }
.di-card-raised { border-color: transparent; box-shadow: var(--shadow-lg); border-radius: var(--radius-xl); }
.di-on-inverse .di-card { background: var(--surface-inverse-raised); border-color: var(--border-on-inverse); color: var(--text-on-inverse); }
.di-on-inverse .di-card-body { color: var(--text-muted-on-inverse); }

/* Pill / tag */
.di-pill { display: inline-flex; align-items: center; gap: var(--space-1); font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0;
  padding: var(--space-2) var(--space-3); border-radius: var(--radius-full); background: var(--surface-subtle); color: var(--text); border: var(--border-width) solid transparent; }
.di-pill-brand { background: var(--jade-200); color: var(--jade-900); }
.di-pill-warm { background: var(--apricot-100); color: var(--apricot-700); }
.di-pill-success { background: var(--success-fill); color: var(--success-text); }
.di-pill-warning { background: var(--warning-fill); color: var(--warning-text); }
.di-pill-error { background: var(--error-fill); color: var(--error-text); }
.di-pill-outline { background: transparent; border-color: var(--border-strong); color: var(--text-muted); }
.di-pill svg { width: 14px; height: 14px; }

/* Eyebrow + section heading */
.di-eyebrow { font-size: 14px; line-height: 20px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--text-accent); margin: 0 0 var(--space-3); }
.di-section-head { max-width: var(--container-narrow); }
.di-section-head.di-center { margin-inline: auto; text-align: center; }
.di-section-title { font-size: 48px; line-height: 52px; font-weight: 800; letter-spacing: -0.02em; margin: 0; }
.di-section-title .di-accent { color: var(--text-brand); }
.di-section-sub { font-size: 18px; line-height: 28px; color: var(--text-muted); margin: var(--space-4) 0 0; }
.di-on-inverse .di-eyebrow { color: var(--display-apricot-on-inverse); }
.di-on-inverse .di-section-title .di-accent { color: var(--display-jade-on-inverse); }
.di-on-inverse .di-section-sub { color: var(--text-muted-on-inverse); }

/* Stat */
.di-stat { display: grid; gap: var(--space-1); padding: var(--space-5) var(--space-6); border-left: 0; }
.di-stat-value { font-size: 48px; line-height: 52px; font-weight: 800; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.di-stat-label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--text-muted); }
.di-stat-group { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: var(--space-4); }
.di-stat-group .di-stat + .di-stat { border-left: var(--border-width) solid var(--border); }
.di-on-inverse .di-stat-label { color: var(--text-muted-on-inverse); }
.di-on-inverse .di-stat-group .di-stat + .di-stat { border-left-color: var(--border-on-inverse); }

/* Quote / review card */
.di-quote { background: var(--surface); border: var(--border-width) solid var(--border); border-radius: var(--radius-lg); padding: var(--space-8) var(--space-6) var(--space-6); display: grid; gap: var(--space-5); }
.di-quote-rating { display: inline-flex; align-items: center; gap: var(--space-2); font-size: 14px; line-height: 20px; font-weight: 600; color: var(--text-muted); }
.di-quote-rating svg { width: 18px; height: 18px; fill: var(--star); }
.di-quote-text { font-family: var(--font-serif); font-size: 22px; line-height: 32px; font-weight: 400; font-variation-settings: "opsz" 20; margin: 0; }
.di-quote-text::before { content: "\201C"; } .di-quote-text::after { content: "\201D"; }
.di-quote-person { display: flex; align-items: center; gap: var(--space-3); }
.di-quote-avatar { width: 48px; height: 48px; border-radius: var(--radius-full); background: var(--jade-200); object-fit: cover; flex: none; }
.di-quote-name { font-size: 16px; line-height: 24px; font-weight: 700; display: block; }
.di-quote-meta { font-size: 14px; line-height: 20px; color: var(--text-muted); display: block; }
.di-quote.di-featured { background: var(--surface-inverse); color: var(--text-on-inverse); border-color: transparent; }
.di-quote.di-featured .di-quote-rating, .di-quote.di-featured .di-quote-meta { color: var(--text-muted-on-inverse); }
.di-quote.di-featured .di-quote-avatar { background: var(--jade-800); }

/* Step (numbered, selectable) */
.di-steps { display: grid; gap: var(--space-3); max-width: 520px; }
.di-step { display: flex; align-items: center; gap: var(--space-4); width: 100%; text-align: left; font-family: inherit; cursor: pointer;
  padding: var(--space-4) var(--space-5); border-radius: var(--radius-lg); border: var(--border-width) solid var(--border); background: var(--surface); color: var(--text); transition: background-color .15s, border-color .15s; }
.di-step:hover { background: var(--surface-subtle); }
.di-step:focus-visible { outline: none; box-shadow: var(--focus-ring-shadow); }
.di-step-num { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: var(--radius-full); font-size: 18px; line-height: 24px; font-weight: 700;
  background: var(--surface-subtle); color: var(--text-brand); border: var(--border-width-strong) solid var(--jade-200); }
.di-step[aria-selected="true"] { background: var(--surface-subtle); border-color: var(--jade-300); }
.di-step[aria-selected="true"] .di-step-num { background: var(--action-secondary); color: var(--on-action-secondary); border-color: var(--action-secondary); }
.di-step-title { font-size: 18px; line-height: 24px; font-weight: 600; display: block; }
.di-step-desc { font-size: 14px; line-height: 20px; color: var(--text-muted); display: block; margin-top: 2px; }
.di-step-arrow { margin-left: auto; color: var(--neutral-400); flex: none; }
.di-step-arrow svg { width: 20px; height: 20px; display: block; }
.di-on-inverse .di-step { background: var(--surface-inverse-raised); border-color: var(--border-on-inverse); color: var(--text-on-inverse); }
.di-on-inverse .di-step:hover { background: var(--jade-700); }
.di-on-inverse .di-step-desc { color: var(--text-muted-on-inverse); }
.di-on-inverse .di-step-num { background: transparent; color: var(--text-on-inverse); border-color: var(--jade-400); }
.di-on-inverse .di-step[aria-selected="true"] { background: var(--surface-subtle); border-color: var(--surface-subtle); color: var(--text); }
.di-on-inverse .di-step[aria-selected="true"] .di-step-desc { color: var(--text-muted); }
.di-on-inverse .di-step[aria-selected="true"] .di-step-num { background: var(--action); color: var(--on-action); border-color: var(--action); }

/* Header */
.di-header { display: flex; align-items: center; gap: var(--space-6); min-height: var(--header-height); padding: 0 var(--space-6); background: var(--surface-subtle); }
.di-header-logo { display: flex; align-items: center; height: 40px; flex: none; }
.di-header-logo img { height: 40px; width: auto; display: block; } /* the approved no-tagline lockup (1302×270) → 193×40 */
.di-header-nav { display: flex; gap: var(--space-6); margin-left: var(--space-4); }
.di-header-nav a { font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); text-decoration: none; padding: var(--space-2) 0; border-bottom: 2px solid transparent; white-space: nowrap; }
.di-header-nav a:hover { border-bottom-color: var(--jade-400); }
.di-header-nav a[aria-current="page"] { border-bottom-color: var(--action-secondary); }
.di-header-nav a:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 4px; border-radius: 2px; }
.di-header-actions { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); flex: none; }

/* Input */
.di-field { display: grid; gap: var(--space-2); max-width: 360px; }
.di-label { font-size: 14px; line-height: 20px; font-weight: 600; letter-spacing: 0; color: var(--text-muted); }
.di-input { font-family: inherit; font-size: 16px; line-height: 24px; color: var(--text); background: var(--surface); min-height: var(--control-height);
  padding: 0 var(--space-4); border-radius: var(--radius-sm); border: var(--border-width) solid var(--border-strong); }
.di-input::placeholder { color: var(--neutral-500); }
.di-input:focus-visible { outline: none; border-color: var(--focus-ring); box-shadow: 0 0 0 1px var(--focus-ring); }
.di-input[aria-invalid="true"] { border-color: var(--error-text); }
.di-help { font-size: 14px; line-height: 20px; color: var(--text-muted); }
.di-help.di-error { color: var(--error-text); }

/* GivingMix — a year's donations by kind: a thin segmented bar and its legend. Kind = colour + icon + name, never colour alone. */
.di-mix { background: var(--surface-subtle); border-radius: var(--radius-lg); padding: var(--space-4); display: grid; gap: var(--space-3); color: var(--text); font-family: var(--font-sans); }
.di-mix-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-4); }
.di-mix-year { font-size: 16px; line-height: 24px; font-weight: 700; }
.di-mix-total { text-align: right; font-size: 32px; line-height: 40px; font-weight: 800; letter-spacing: -0.02em; }
.di-mix-total small { display: block; font-size: 14px; line-height: 20px; font-weight: 500; letter-spacing: 0; color: var(--text-muted); }
.di-mix-bar { display: flex; gap: 2px; height: 8px; }
.di-mix-seg { min-width: 8px; border-radius: var(--radius-full); }
.di-mix-legend { display: flex; flex-wrap: wrap; gap: var(--space-2); margin: 0; padding: 0; list-style: none; }
.di-kind-chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--touch-target-min); padding: 0 var(--space-3) 0 var(--space-2); border-radius: var(--radius-full); background: var(--surface-raised); border: var(--border-control) solid var(--border-strong); font-size: 15px; line-height: 20px; font-weight: 600; color: var(--text); }
.di-kind-key { display: grid; place-items: center; width: 24px; height: 24px; border-radius: var(--radius-full); flex: none; }
.di-kind-key svg { width: 16px; height: 16px; }
.di-kind-tile { display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--radius-full); flex: none; }
.di-kind-tile svg { width: 24px; height: 24px; }
.di-kind-key svg, .di-kind-tile svg { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.di-fill-money { background: var(--data-money-fill); color: var(--on-data-money); }
.di-fill-items { background: var(--data-items-fill); color: var(--on-data-items); }
.di-fill-mileage { background: var(--data-mileage-fill); color: var(--on-data-mileage); }
.di-fill-stock { background: var(--data-stock-fill); color: var(--on-data-stock); }
.di-soft-money { background: var(--data-money-soft); color: var(--data-money); }
.di-soft-items { background: var(--data-items-soft); color: var(--data-items); }
.di-soft-mileage { background: var(--data-mileage-soft); color: var(--data-mileage); }
.di-soft-stock { background: var(--data-stock-soft); color: var(--data-stock); }
