/* Keisho X — Wika design system. Calm, precise, editorial.
   Colour carries meaning only. Channels are space-separated so Tailwind
   utilities can apply alpha. */

:root {
  --ink: 10 10 10;
  --on-ink: 255 255 255;
  --brand: 82 82 91;
  --brand-dark: 39 39 42;
  --silver: 161 161 170;
  --seal: 155 44 53;
  --canvas: 247 246 243;
  --wash: 247 246 243;
  --surface: 255 255 255;
  --line: 228 228 231;
  --shadow: 10 10 10;
  --shadow-soft-1: 0.04;
  --shadow-soft-2: 0.02;
  --shadow-pop-1: 0.16;
  --shadow-pop-2: 0.06;
  color-scheme: light;
}

.dark {
  --ink: 250 250 250;
  --on-ink: 9 9 11;
  --brand: 161 161 170;
  --brand-dark: 228 228 231;
  --silver: 113 113 122;
  --seal: 224 138 146;
  --canvas: 9 9 11;
  --wash: 39 39 42;
  --surface: 24 24 27;
  --line: 63 63 70;
  --shadow: 0 0 0;
  --shadow-soft-1: 0.45;
  --shadow-soft-2: 0.28;
  --shadow-pop-1: 0.55;
  --shadow-pop-2: 0.35;
  color-scheme: dark;
}

html {
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  background: rgb(var(--canvas));
}

body {
  font-feature-settings: "cv11", "ss01";
}

h1, h2, h3 {
  letter-spacing: -0.025em;
}

fieldset {
  border: 0;
  margin: 0;
  padding: 0;
  min-inline-size: 0;
}

legend {
  display: block;
  width: 100%;
  padding: 0;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 4px rgb(var(--ink));
}

.on-stage :focus-visible {
  box-shadow: 0 0 0 2px #0a0a0a, 0 0 0 4px #fff;
}

::selection {
  background: rgb(var(--ink));
  color: rgb(var(--on-ink));
}

[hidden] {
  display: none !important;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.kicker {
  font-size: 0.6875rem;
  line-height: 1rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: rgb(var(--seal));
}

.on-stage .kicker {
  color: #a1a1aa;
}

.on-stage .kicker.kicker-seal {
  color: #e08a92;
}

.tabular {
  font-variant-numeric: tabular-nums;
}

.text-balance {
  text-wrap: balance;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  white-space: nowrap;
  border-radius: 6px;
  border: 1px solid transparent;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  height: 2.25rem;
  padding: 0 0.875rem;
  transition: color 150ms, background-color 150ms, border-color 150ms;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-lg {
  height: 2.75rem;
  padding: 0 1.25rem;
  font-size: 15px;
}

.btn-icon {
  height: 2rem;
  width: 2rem;
  padding: 0;
}

.btn-primary {
  border-color: rgb(var(--ink));
  background: rgb(var(--ink));
  color: rgb(var(--on-ink));
}

.btn-primary:hover {
  border-color: rgb(var(--brand-dark));
  background: rgb(var(--brand-dark));
}

.btn-secondary {
  border-color: rgb(var(--line));
  background: rgb(var(--surface));
  color: rgb(var(--ink));
  box-shadow: 0 1px 2px rgb(var(--shadow) / var(--shadow-soft-1)), 0 1px 1px rgb(var(--shadow) / var(--shadow-soft-2));
}

.btn-secondary:hover {
  border-color: rgb(var(--silver));
  background: rgb(var(--wash));
}

.btn-ghost {
  border-color: transparent;
  background: transparent;
  color: rgb(var(--brand));
}

.btn-ghost:hover {
  background: rgb(var(--wash));
  color: rgb(var(--ink));
}

.btn-on-ink {
  border-color: #fff;
  background: #fff;
  color: #0a0a0a;
}

.btn-on-ink:hover {
  border-color: #f7f6f3;
  background: #f7f6f3;
}

.btn-on-ink-ghost {
  border-color: rgb(255 255 255 / 0.4);
  background: transparent;
  color: #fff;
}

.btn-on-ink-ghost:hover {
  border-color: #fff;
  background: rgb(255 255 255 / 0.1);
}

.label {
  display: block;
  margin-bottom: 0.375rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(var(--ink));
}

.hint {
  margin-top: 0.375rem;
  font-size: 13px;
  color: rgb(var(--brand));
}

.field-error {
  margin-top: 0.375rem;
  font-size: 13px;
  font-weight: 500;
  color: #be123c;
}

.dark .field-error {
  color: #fb7185;
}

.input,
.select,
.textarea {
  display: block;
  width: 100%;
  border-radius: 6px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--surface));
  padding: 0 0.75rem;
  font-size: 15px;
  color: rgb(var(--ink));
  box-shadow: 0 1px 2px rgb(var(--shadow) / var(--shadow-soft-1)), 0 1px 1px rgb(var(--shadow) / var(--shadow-soft-2));
}

.input::placeholder,
.textarea::placeholder {
  color: rgb(var(--silver));
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgb(var(--ink));
  outline: none;
  box-shadow: 0 0 0 1px rgb(var(--ink));
}

.input,
.select {
  height: 2.5rem;
}

.textarea {
  padding-top: 0.5rem;
  padding-bottom: 0.5rem;
  line-height: 1.625;
}

.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2352525b' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2.25rem;
}

.dark .select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%23a1a1aa' stroke-width='1.5'%3E%3Cpath d='m4 6 4 4 4-4'/%3E%3C/svg%3E");
}

.choice {
  position: relative;
  display: flex;
  cursor: pointer;
  flex-direction: column;
  border-radius: 6px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--surface));
  padding: 0.625rem 0.75rem;
  text-align: left;
  box-shadow: 0 1px 2px rgb(var(--shadow) / var(--shadow-soft-1)), 0 1px 1px rgb(var(--shadow) / var(--shadow-soft-2));
  transition: border-color 150ms, background-color 150ms;
}

.choice:hover {
  border-color: rgb(var(--silver));
}

.choice:has(input:checked) {
  border-color: rgb(var(--ink));
  box-shadow: 0 0 0 1px rgb(var(--ink));
}

.choice:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 4px rgb(var(--ink));
}

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

.panel {
  border-radius: 10px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--surface));
}

.panel-body {
  padding: 1.25rem;
}

@media (min-width: 640px) {
  .panel-body {
    padding: 1.5rem;
  }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  border-radius: 4px;
  border: 1px solid transparent;
  padding: 0.125rem 0.375rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
}

.badge-neutral {
  border-color: rgb(var(--line));
  background: rgb(var(--wash));
  color: rgb(var(--brand-dark));
}

.alert {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.alert-success {
  border-color: #a7f3d0;
  background: #ecfdf5;
  color: #064e3b;
}

.alert-error {
  border-color: #fecdd3;
  background: #fff1f2;
  color: #881337;
}

.dark .alert-success {
  border-color: #064e3b;
  background: rgb(6 78 59 / 0.4);
  color: #a7f3d0;
}

.dark .alert-error {
  border-color: #881337;
  background: rgb(136 19 55 / 0.4);
  color: #fecdd3;
}

.empty {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  border-radius: 10px;
  border: 1px dashed rgb(var(--silver) / 0.7);
  background: rgb(var(--surface));
  padding: 2.5rem 1.5rem;
  color: rgb(var(--brand));
}

@media (min-width: 640px) {
  .empty {
    align-items: center;
    text-align: center;
  }
}

.site-menu:focus,
.site-menu:focus-visible {
  outline: none;
  box-shadow: none;
}

.site-menu {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: var(--site-nav-bottom, 4rem);
  z-index: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overscroll-behavior: contain;
  background: rgb(var(--surface));
  padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
}

[data-site-nav-toggle][aria-expanded="true"] {
  background: rgb(var(--wash));
  color: rgb(var(--ink));
}

/* Lock scroll on <html> only. Also hiding body's overflow makes <body> its own scroll
   container at scrollTop 0, so the sticky header re-anchors to it and jumps off-screen. */
html.site-nav-open {
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .site-menu {
    animation: site-menu-in 180ms ease-out;
  }
}

@keyframes site-menu-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.theme-toggle {
  position: relative;
}

.theme-toggle__icon {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 150ms ease, transform 150ms ease;
}

.theme-toggle__icon--moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.theme-toggle__icon--sun {
  opacity: 0;
  transform: rotate(-45deg) scale(0.5);
}

.dark .theme-toggle__icon--moon {
  opacity: 0;
  transform: rotate(45deg) scale(0.5);
}

.dark .theme-toggle__icon--sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

html.no-theme-transition,
html.no-theme-transition * {
  transition: none !important;
}

@media (prefers-reduced-motion: no-preference) {
  html.no-theme-transition .theme-toggle__icon {
    transition: opacity 150ms ease, transform 150ms ease !important;
  }
}

.hp-field {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.prose {
  --tw-prose-body: rgb(var(--brand-dark));
  --tw-prose-headings: rgb(var(--ink));
  --tw-prose-lead: rgb(var(--brand-dark));
  --tw-prose-links: rgb(var(--ink));
  --tw-prose-bold: rgb(var(--ink));
  --tw-prose-counters: rgb(var(--brand));
  --tw-prose-bullets: rgb(var(--brand));
  --tw-prose-hr: rgb(var(--line));
  --tw-prose-quotes: rgb(var(--brand-dark));
  --tw-prose-quote-borders: rgb(var(--ink));
  --tw-prose-captions: rgb(var(--brand));
  --tw-prose-code: rgb(var(--ink));
  --tw-prose-pre-code: rgb(var(--ink));
  --tw-prose-pre-bg: rgb(var(--wash));
  --tw-prose-th-borders: rgb(var(--line));
  --tw-prose-td-borders: rgb(var(--line));
}

.prose :where(img):not(:where([class~="not-prose"] *)) {
  border-radius: 10px;
  border: 1px solid rgb(var(--line));
}

.prose :where(a):not(:where([class~="not-prose"] *)) {
  text-underline-offset: 4px;
}

/* Homepage hero. A quiet tatami floor: straw mats, cloth borders,
   weave running the long way. Seams never meet four at a corner. */
.hero {
  position: relative;
  isolation: isolate;
  background-color: #e6dfd4;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: url("/assets/img/hero-tatami.svg?v=3");
  background-size: 880px 440px;
}

.dark .hero {
  background-color: #18181b;
}

.dark .hero::before {
  background-image: url("/assets/img/hero-tatami-dark.svg?v=3");
  opacity: 1;
}

@media (forced-colors: active) {
  .hero::before {
    display: none;
  }
}

/* Why-this-exists. A shōji lattice over washi, quiet enough that the
   type stays sharper than the screen behind it. */
.why-shoji {
  background-color: #f7f6f3;
  background-image: url("/assets/img/why-shoji.svg");
  background-size: 360px 520px;
}

.dark .why-shoji {
  background-color: #141416;
  background-image: url("/assets/img/why-shoji-dark.svg");
}

@media (forced-colors: active) {
  .why-shoji,
  .dark .why-shoji {
    background-image: none;
  }
}

/* ------------------------------------------------------------------
   Buyer register: stepper, tap-friendly chips and cards, error states.
   ------------------------------------------------------------------ */
.chip-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.chip {
  position: relative;
  display: inline-flex;
  min-height: 2.75rem;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  border-radius: 999px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--surface));
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(var(--brand-dark));
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: border-color 150ms, background-color 150ms, color 150ms;
}

.chip:hover {
  border-color: rgb(var(--silver));
  color: rgb(var(--ink));
}

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

.chip .chip-check {
  display: none;
}

.chip:has(input:checked) {
  border-color: rgb(var(--ink));
  background: rgb(var(--ink));
  color: rgb(var(--on-ink));
}

.chip:has(input:checked) .chip-check {
  display: inline-flex;
}

.chip:has(input:focus-visible),
.choice:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 4px rgb(var(--seal));
}

.chip-hint {
  font-weight: 400;
  opacity: 0.75;
}

.choice-card {
  min-height: 3.5rem;
  justify-content: center;
  padding: 0.75rem 0.875rem 0.75rem 2.75rem;
}

.choice-card::before {
  content: "";
  position: absolute;
  left: 0.875rem;
  top: 50%;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: -0.5625rem;
  border-radius: 999px;
  border: 1.5px solid rgb(var(--silver));
  background: rgb(var(--surface));
  transition: border-color 150ms, box-shadow 150ms;
}

.choice-card:has(input:checked)::before {
  border-color: rgb(var(--ink));
  box-shadow: inset 0 0 0 4px rgb(var(--surface)), inset 0 0 0 9px rgb(var(--ink));
}

.choice-card:has(input:checked) {
  background: rgb(var(--wash));
}

/* Narrow phones: two deal-size cards per row need the room the radio dot takes. */
@media (max-width: 639px) {
  .choice-card--compact {
    padding-left: 0.875rem;
  }

  .choice-card--compact::before {
    display: none;
  }
}

/* Works without the Tailwind CDN script (e.g. with JavaScript off). */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

[aria-invalid="true"].input,
[aria-invalid="true"].textarea {
  border-color: #be123c;
}

.dark [aria-invalid="true"].input,
.dark [aria-invalid="true"].textarea {
  border-color: #fb7185;
}

fieldset[aria-invalid="true"] .chip,
fieldset[aria-invalid="true"] .choice {
  border-color: rgb(190 18 60 / 0.55);
}

.field-error::before {
  content: "";
  display: inline-block;
  width: 0.375rem;
  height: 0.375rem;
  margin-right: 0.4rem;
  border-radius: 999px;
  background: currentColor;
  vertical-align: 0.15em;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
  counter-reset: step;
}

.stepper li {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  font-size: 0.75rem;
  line-height: 1rem;
  font-weight: 500;
  color: rgb(var(--brand));
}

.stepper li::before {
  content: "";
  display: block;
  height: 4px;
  border-radius: 999px;
  background: rgb(var(--line));
  transition: background-color 200ms;
}

.stepper li[data-state="done"]::before,
.stepper li[aria-current="step"]::before {
  background: rgb(var(--ink));
}

.stepper li[aria-current="step"] {
  color: rgb(var(--ink));
  font-weight: 600;
}

.register-step-more {
  margin-top: 2.5rem;
  border-top: 1px solid rgb(var(--line));
  padding-top: 2rem;
}

.register-form.is-stepped .register-step-more {
  margin-top: 0;
  border-top: 0;
  padding-top: 0;
}

[data-step]:focus,
[data-register-success]:focus,
[data-error-summary]:focus {
  outline: none;
  box-shadow: none;
}

.register-form.is-stepped [data-step]:not([data-active]) {
  display: none;
}

.register-step-title {
  font-size: 1.25rem;
  line-height: 1.75rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.consent-box {
  display: flex;
  cursor: pointer;
  gap: 0.875rem;
  border-radius: 10px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--surface));
  padding: 1rem;
  transition: border-color 150ms, background-color 150ms;
}

.consent-box:hover {
  border-color: rgb(var(--silver));
}

.consent-box:has(input:checked) {
  border-color: rgb(var(--ink));
  background: rgb(var(--wash));
}

.consent-box input[type="checkbox"] {
  margin-top: 0.15rem;
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  accent-color: rgb(var(--ink));
}

.consent-box:has(input:focus-visible) {
  box-shadow: 0 0 0 2px rgb(var(--surface)), 0 0 0 4px rgb(var(--seal));
}

.consent-box input:focus-visible {
  box-shadow: none;
}

.summary-list {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 0.375rem 1rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.summary-list dt {
  color: rgb(var(--brand));
}

.summary-list dd {
  margin: 0;
  color: rgb(var(--ink));
  overflow-wrap: anywhere;
}

.optional-details > summary {
  display: flex;
  padding: 0.25rem 0;
  min-height: 2.75rem;
  cursor: pointer;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: rgb(var(--ink));
  list-style: none;
}

.optional-details > summary::-webkit-details-marker {
  display: none;
}

.optional-details > summary .summary-chevron {
  transition: transform 150ms;
}

.optional-details[open] > summary .summary-chevron {
  transform: rotate(90deg);
}

@media (prefers-reduced-motion: no-preference) {
  .register-form.is-stepped [data-step][data-active] {
    animation: register-step-in 200ms ease-out;
  }
}

@keyframes register-step-in {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: none; }
}

/* ---------------------------------------------------------------------------
   Article blocks (opt-in Markdown conventions, see App\Service\ArticleBlocks)
   --------------------------------------------------------------------------- */

/* Call-to-action button on its own line: [Label](/path "cta") */
.article-cta {
  margin: 2rem 0;
}

.article-cta .btn {
  max-width: 100%;
  white-space: normal;
  text-align: center;
  height: auto;
  min-height: 2.75rem;
  padding-top: 0.625rem;
  padding-bottom: 0.625rem;
}

@media (max-width: 639px) {
  .article-cta .btn {
    width: 100%;
  }
}

/* Figure with caption: ![Alt](/assets/img/x.jpg "Caption") */
.prose .article-figure {
  margin: 2.25rem 0;
}

.prose .article-figure img {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 10px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--wash));
}

.prose .article-figure figcaption {
  margin-top: 0.625rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: rgb(var(--brand));
}

/* Icon lists: "- :lock: text" (numbered lists show "Step 1", "Step 2", ...) */
.prose ul.icon-list,
.prose ol.icon-list {
  list-style: none;
  padding-left: 0;
  margin: 1.5rem 0;
  counter-reset: icon-step;
}

.prose .icon-list > li.icon-item {
  display: flex;
  align-items: flex-start;
  gap: 0.875rem;
  padding-left: 0;
  margin: 0;
  padding-top: 0.875rem;
  padding-bottom: 0.875rem;
  border-top: 1px solid rgb(var(--line));
}

.prose .icon-list > li.icon-item:last-child {
  border-bottom: 1px solid rgb(var(--line));
}

.prose .icon-list > li.icon-item::marker,
.prose .icon-list > li.icon-item::before {
  content: none;
}

.icon-item-badge {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-top: 0.125rem;
  border-radius: 9999px;
  border: 1px solid rgb(var(--line));
  background: rgb(var(--wash));
  color: rgb(var(--seal));
}

.icon-item-body {
  min-width: 0;
  flex: 1;
}

.prose ol.icon-list > li.icon-item {
  counter-increment: icon-step;
}

.prose ol.icon-list > li.icon-item .icon-item-body::before {
  content: "Step " counter(icon-step);
  display: block;
  margin-bottom: 0.125rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  letter-spacing: 0.08em;
  font-weight: 600;
  text-transform: uppercase;
  color: rgb(var(--seal));
}

/* Charts: ```chart JSON blocks (App\Service\ChartRenderer) */
.kx-chart {
  margin: 2.5rem 0;
  padding: 1.25rem;
  border: 1px solid rgb(var(--line));
  border-radius: 10px;
  background: rgb(var(--surface));
}

@media (min-width: 640px) {
  .kx-chart {
    padding: 1.5rem 1.75rem;
  }
}

.kx-chart-head {
  display: block;
  margin-bottom: 1.25rem;
}

.kx-chart-title {
  display: block;
  font-size: 1.0625rem;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: rgb(var(--ink));
}

.kx-chart-subtitle {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: rgb(var(--brand));
}

.kx-chart-plot {
  font-variant-numeric: tabular-nums;
}

/* Vertical columns (time series) */
.kx-chart-columns {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 0.375rem;
  align-items: end;
  height: 13rem;
  padding-bottom: 0.25rem;
  border-bottom: 1px solid rgb(var(--line));
}

.kx-chart-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}

.kx-chart-colbar {
  display: block;
  width: 100%;
  max-width: 2.5rem;
  height: calc((100% - 2.75rem) * var(--kx-v));
  min-height: 2px;
  border-radius: 3px 3px 0 0;
  background: rgb(var(--silver));
}

.kx-chart-col .kx-chart-value {
  margin-bottom: 0.25rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  font-weight: 500;
  color: rgb(var(--brand-dark));
  white-space: nowrap;
}

.kx-chart-axis {
  margin-top: 0.375rem;
  font-size: 0.6875rem;
  line-height: 1rem;
  color: rgb(var(--brand));
  white-space: nowrap;
}

.kx-chart-col.is-highlight .kx-chart-colbar,
.kx-chart-row.is-highlight .kx-chart-rowbar {
  background: rgb(var(--seal));
}

.kx-chart-col.is-highlight .kx-chart-value,
.kx-chart-row.is-highlight .kx-chart-value {
  color: rgb(var(--ink));
  font-weight: 600;
}

@media (max-width: 479px) {
  .kx-chart-columns {
    gap: 0.1875rem;
  }

  .kx-chart-col .kx-chart-value,
  .kx-chart-axis {
    font-size: 0.5625rem;
  }
}

/* Horizontal bars (categories) */
.kx-chart-bars {
  display: grid;
  gap: 0.75rem;
}

.kx-chart-row {
  display: grid;
  grid-template-columns: minmax(0, 11rem) minmax(0, 1fr);
  align-items: center;
  gap: 0.75rem;
}

@media (max-width: 479px) {
  .kx-chart-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.25rem;
  }
}

.kx-chart-rowlabel {
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: rgb(var(--brand-dark));
}

.kx-chart-track {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.kx-chart-rowbar {
  display: block;
  flex: 0 0 auto;
  width: calc((100% - 3.5rem) * var(--kx-v));
  min-width: 2px;
  height: 1.125rem;
  border-radius: 0 3px 3px 0;
  background: rgb(var(--silver));
}

.kx-chart-row .kx-chart-value {
  font-size: 0.8125rem;
  line-height: 1.25rem;
  font-weight: 500;
  color: rgb(var(--brand-dark));
  white-space: nowrap;
}

/* Data table and sources */
.kx-chart-data {
  margin-top: 1rem;
  font-size: 0.8125rem;
  color: rgb(var(--brand-dark));
}

.kx-chart-data > summary {
  cursor: pointer;
  width: fit-content;
  font-weight: 500;
  color: rgb(var(--ink));
  text-decoration: underline;
  text-decoration-color: rgb(var(--line));
  text-underline-offset: 4px;
}

.kx-chart-data table {
  width: 100%;
  margin-top: 0.75rem;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.kx-chart-data th,
.kx-chart-data td {
  padding: 0.375rem 0.5rem;
  border-bottom: 1px solid rgb(var(--line));
  text-align: left;
  font-weight: 400;
}

.kx-chart-data thead th {
  font-weight: 600;
  color: rgb(var(--ink));
}

.kx-chart-data td {
  text-align: right;
}

.kx-chart-source {
  margin-top: 1rem;
  font-size: 0.75rem;
  line-height: 1.125rem;
  color: rgb(var(--brand));
}

.kx-chart-source a {
  color: rgb(var(--ink));
  text-decoration: underline;
  text-decoration-color: rgb(var(--line));
  text-underline-offset: 3px;
}
