/* EquiDetails shell kit: design tokens.
 *
 * One palette for every surface in the family. Light is the parchment set on
 * :root. Dark lives ONLY under [data-theme="dark"]: there is deliberately no
 * operating-system colour query, because site mode is always light and tool
 * mode follows the signed-in account's saved choice (shell.js sets the
 * attribute).
 *
 * Where the app (apps/equidetails_web/src/styles/theme.css) and EquiFarrier
 * (now apps/equidetails_web/src/farrier/index.css) disagreed on a radius or shadow, the
 * app's value is the one here. Colours are the 7 September 2026 brand set.
 */

:root {
  /* Surfaces and text */
  --eqd-ground: #f7f3ea;
  --eqd-surface: #fffdf9;
  --eqd-surface-soft: #fcfaf4;
  --eqd-ink: #16202a;
  --eqd-muted: #5c6672;
  --eqd-line: #ded7c9;
  /* The highlighted row of any type-ahead list (keyboard or mouse). ink on it 12.2:1, 1.33:1 against --eqd-surface */
  --eqd-option-active: #cce3d4;
  --eqd-option-active-bar: #1e4a38;

  /* Brand */
  --eqd-hunter: #1e4a38;
  --eqd-on-hunter: #f7f3ea;
  --eqd-hunter-soft: rgba(30, 74, 56, 0.1);
  --eqd-brass-text: #8a6a30;
  --eqd-brass-mark: #c2a25a;
  --eqd-brass-soft: rgba(194, 162, 90, 0.16);
  --eqd-saddle: #8b5e34;
  --eqd-saddle-soft: rgba(139, 94, 52, 0.16);
  --eqd-wine: #6d2634;
  --eqd-on-wine: #ffffff;

  /* Type */
  --eqd-font-serif: "Playfair Display", Georgia, serif;
  --eqd-font-sans: Inter, system-ui, sans-serif;

  /* Shell geometry */
  --eqd-header-height: 56px;
  --eqd-width-read: 1040px;
  --eqd-gutter: 24px;
  --eqd-gutter-phone: 16px;
  --eqd-rail-width: 224px;

  /* Radii (the app's rounded-md / rounded-lg / rounded-xl / pill) */
  --eqd-radius-sm: 6px;
  --eqd-radius-md: 8px;
  --eqd-radius-lg: 12px;
  --eqd-radius-pill: 999px;

  /* Shadows and focus (the app's values) */
  --eqd-shadow-card: 0 14px 40px rgba(16, 35, 61, 0.08);
  --eqd-shadow-header: 0 8px 28px rgba(16, 35, 61, 0.06);
  --eqd-shadow-pop: 0 18px 40px rgba(16, 35, 61, 0.16);
  --eqd-focus-ring: rgba(183, 138, 67, 0.5);


  /* The chart palette: the ONE place chart colours live.
   *
   * Seven series colours drawn from the brand (hunter green, plum from the wine,
   * brass, wine, a navy from the ink, saddle, a slate violet), plus one neutral
   * for the folded tail ("Everyone else") and the catch-all kind ("Other").
   * Assigned in this order and never cycled: an eighth thing folds into the
   * neutral rather than getting a made-up colour. Colour follows the thing, never
   * its rank, wherever the thing is fixed (the money kinds, by slot: Feed 1,
   * Care 2, Medicine 3, Supplements 4, Hay 5, Facility operations 6, Services 7, Other
   * neutral). The vendor and customer rings use slots 1 to 6 and fold the rest.
   * Slot 7 is the slate violet: the hue the other six leave open (a teal sat
   * about 3 dE from the hunter green in dark).
   *
   * Validated 2026-10-16 with the dataviz skill's scripts/validate_palette.js,
   * against the panel surface of each theme, the whole set of seven both in slot
   * order and in the order the money kinds stack:
   *   light  "#008053,#6c3d76,#997825,#921f3c,#085491,#7e3f05,#6869cd" --surface "#fffdf9"
   *          ALL CHECKS PASS: worst adjacent CVD dE 13.2, normal-vision 21.8,
   *          every slot >= 3:1 on the surface.
   *          kinds  "#008053,#085491,#921f3c,#997825,#6c3d76,#7e3f05,#6869cd"
   *          ALL CHECKS PASS: worst adjacent CVD dE 14.8, normal-vision 15.5.
   *   dark   "#489e74,#9766a3,#b78b01,#c44f64,#4780b8,#ac6939,#6366ad" --surface "#182430"
   *          ALL CHECKS PASS: worst adjacent CVD dE 10.7, normal-vision 18.7,
   *          every slot >= 3:1 on the surface.
   *          kinds  "#489e74,#4780b8,#c44f64,#b78b01,#9766a3,#ac6939,#6366ad"
   *          ALL CHECKS PASS: worst adjacent CVD dE 11.8, normal-vision 15.7.
   * The neutral is not a series colour (it reads gray by design) and was checked
   * against the slots it sits beside (slot 6 and slot 1 in a ring, slot 7 in the
   * kinds): light #a3a8af worst CVD dE 17.7 / normal 18.3, contrast 2.35:1 (so
   * every chart ships with its list, which carries the numbers); dark #aeb5be
   * worst CVD dE 12.7 / normal 17.4, >= 3:1.
   * Change a value in either theme only by re-running the validator on the whole set.
   *
   * Dark follows the app: [data-theme="dark"] only, no operating-system query
   * (packages/shell-kit/tokens.css says why).
   */
  --eqd-chart-1: #008053; /* hunter green */
  --eqd-chart-2: #6c3d76; /* plum */
  --eqd-chart-3: #997825; /* brass */
  --eqd-chart-4: #921f3c; /* wine */
  --eqd-chart-5: #085491; /* navy */
  --eqd-chart-6: #7e3f05; /* saddle */
  --eqd-chart-7: #6869cd; /* slate violet */
  --eqd-chart-rest: #a3a8af;
  /* A comparison drawn behind a bar (last year, say): ink at low strength. */
  --eqd-chart-faint: rgba(22, 32, 42, 0.12);
  --eqd-chart-grid: #ece6da;

  color-scheme: light;
}

:root[data-theme="dark"] {
  --eqd-ground: #0f1922;
  --eqd-surface: #182430;
  --eqd-surface-soft: #131e29;
  --eqd-ink: #f2ecdd;
  --eqd-muted: #b5ad9d;
  --eqd-line: #2c3b49;
  /* ink on it 7.8:1, 1.72:1 against --eqd-surface */
  --eqd-option-active: #2a4f42;
  --eqd-option-active-bar: #d6b36a;

  --eqd-hunter: #2f6f55;
  --eqd-on-hunter: #f7f3ea;
  --eqd-hunter-soft: rgba(47, 111, 85, 0.22);
  --eqd-brass-text: #d6b36a;
  --eqd-brass-mark: #c2a25a;
  --eqd-brass-soft: rgba(214, 179, 106, 0.18);
  --eqd-saddle: #f0b76e;
  --eqd-saddle-soft: rgba(240, 183, 110, 0.18);
  --eqd-wine: #e3a1ad;
  --eqd-on-wine: #16202a;

  --eqd-shadow-card: 0 18px 50px rgba(0, 0, 0, 0.32);
  --eqd-shadow-header: 0 8px 28px rgba(0, 0, 0, 0.35);
  --eqd-shadow-pop: 0 18px 40px rgba(0, 0, 0, 0.45);
  --eqd-focus-ring: rgba(240, 183, 110, 0.45);


  /* Charts, dark: validated with the light set above. */
  --eqd-chart-1: #489e74;
  --eqd-chart-2: #9766a3;
  --eqd-chart-3: #b78b01;
  --eqd-chart-4: #c44f64;
  --eqd-chart-5: #4780b8;
  --eqd-chart-6: #ac6939;
  --eqd-chart-7: #6366ad;
  --eqd-chart-rest: #aeb5be;
  --eqd-chart-faint: rgba(242, 236, 221, 0.14);
  --eqd-chart-grid: #24323f;

  color-scheme: dark;
}

/* One highlight for every type-ahead list. Put `eqd-option` on each row (mouse
 * hover) and add `eqd-option-active` on the keyboard-active row, so both look
 * the same. A left bar backs up the tint for anyone who cannot see it. */
.eqd-option:hover:not(:disabled),
.eqd-option-active {
  background-color: var(--eqd-option-active);
  color: var(--eqd-ink);
  box-shadow: inset 3px 0 0 var(--eqd-option-active-bar);
}

/* The two content widths. The shell (header, rail) is always full width;
 * page content picks one of these. Tools default to fluid, prose to reading. */
.eqd-content {
  box-sizing: border-box;
  width: 100%;
  padding-left: var(--eqd-gutter);
  padding-right: var(--eqd-gutter);
}

.eqd-content--read {
  max-width: var(--eqd-width-read);
  margin-left: auto;
  margin-right: auto;
}

@media (max-width: 640px) {
  .eqd-content {
    padding-left: var(--eqd-gutter-phone);
    padding-right: var(--eqd-gutter-phone);
  }
}
