/* The kit's own tabs (Charts, UI): the page furniture, the "Open large" button and the large view, the small sheets, and the
   UI parts the app did not have (fields, checkbox, radio, switch, combobox, role badge, empty state). Loaded after
   overlay.css; every colour is a token the palette rule already defines (css/palette.css): mist and mint fills with dark
   ink, the deeper tempo blue for an exception, never red. Motion is the kit's: --k-enter in, --k-exit out, one ease. */

.kit-gallery { min-width: 0; }
.kg-page { display: grid; gap: 18px; min-width: 0; }
.kg-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; }
.kg-bar .segs { background: rgba(255, 255, 255, 0.55); }
.kg-status { margin: 0; display: inline-flex; align-items: center; gap: 8px; padding: 6px 14px; border-radius: 999px; background: var(--hue-mist, #dbe8fd); color: var(--k-pill-ink, #2a3560); font-size: var(--type-meta, 0.875rem); font-weight: 600; line-height: 1.3; }
.kg-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--hue-sky, #4f8df5); flex: none; }
.kg-foot { margin: 0; font-size: var(--type-meta, 0.875rem); color: var(--quiet, #66718b); }
.kg-grid { min-width: 0; }

/* ---------- "Open large", in a chart card's corner */
.kg-card { position: relative; }
.kg-card > .kc-card__kind, .kg-card > .kc-card__title { padding-right: 40px; }
.kg-open { position: absolute; top: 6px; right: 6px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 0; border-radius: 12px; background: transparent; color: var(--color-navy-700, #33405f); cursor: pointer;
  transition: background-color var(--k-exit, 280ms) var(--k-ease, ease), color var(--k-exit, 280ms) var(--k-ease, ease); }
@media (hover: hover) and (pointer: fine) { .kg-open:hover { background: rgba(17, 19, 22, 0.06); color: var(--color-navy-900, #1e2a4a); transition-duration: var(--k-enter, 140ms); } }
.kg-open:focus-visible { outline: 2px solid var(--k-focus, #1f3a68); outline-offset: 2px; }

/* ---------- the large view: the chart redrawn at the dialog's size on the left, the card's words on the right.
   A bottom sheet on a phone, the chart first. */
dialog.kg-large { width: min(1240px, calc(100% - 32px)); max-height: calc(100dvh - 48px); padding: 0; border: 0; border-radius: var(--k-r-tile, 22px); background: #fff; color: var(--color-navy-900, #1e2a4a); box-shadow: 0 40px 120px rgba(10, 25, 48, 0.5); overflow: hidden; }
dialog.kg-large:not([data-k-sheet]) { position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.kg-large::backdrop { background: rgba(10, 25, 48, 0.66); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
.kg-large__in { display: grid; grid-template-columns: 1.6fr 1fr; height: min(780px, calc(100dvh - 48px)); }
.kg-large__media { position: relative; min-width: 0; padding: 32px 28px 28px; background: rgba(244, 245, 247, 0.7); overflow-y: auto; }
.kg-large__chart { min-width: 0; }
.kg-large__side { position: relative; padding: 32px 32px 28px; overflow-y: auto; }
.kg-large__close { position: absolute; top: 12px; right: 14px; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; border: 0; border-radius: 10px; background: none; color: var(--color-navy-900, #1e2a4a); font: inherit; font-weight: 600; font-size: 0.86rem; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.kg-large__close:focus-visible { outline: 2px solid var(--k-focus, #1f3a68); outline-offset: 2px; }
.kg-large__h { margin: 28px 0 0; font-family: var(--font-heading); font-weight: 600; font-size: 0.7rem; letter-spacing: 0.18em; text-transform: uppercase; color: var(--color-navy-600, #545e77); }
.kg-large__title { margin: 10px 0 10px; font-family: var(--font-heading); font-weight: 600; font-size: 1.6rem; line-height: 1.15; letter-spacing: -0.02em; color: var(--color-navy-900, #1e2a4a); }
.kg-large__line { margin: 0 0 18px; color: var(--color-navy-700, #33405f); font-size: var(--type-secondary, 1rem); line-height: 1.55; }
.kg-large__figs { margin: 0 0 18px; }
.kg-large__read { margin: 0 0 18px; padding-top: 16px; border-top: 1px solid var(--color-navy-100, #e1e4eb); color: var(--color-navy-800, #263252); font-size: var(--type-secondary, 1rem); line-height: 1.6; }
.kg-large__src { margin: 0; font-size: var(--type-meta, 0.875rem); line-height: 1.45; color: var(--quiet, #5a5d63); }
.kg-large__srck { font-weight: 600; text-transform: uppercase; letter-spacing: 0.1em; font-size: 0.75rem; }
@media (max-width: 900px) {
  .kg-large__in { grid-template-columns: 1fr; height: auto; max-height: calc(100dvh - 48px); overflow-y: auto; }
  .kg-large__media { overflow: visible; }
}
@media (max-width: 640px) {
  dialog.kg-large[data-k-sheet] { width: 100%; border-radius: 24px 24px 0 0; overflow-y: auto; }
  .kg-large__in { max-height: none; overflow: visible; }
  .kg-large__media { padding: 20px 14px 12px; }
  .kg-large__side { padding: 8px 20px 24px; overflow: visible; }
  .kg-large__close { position: sticky; top: 0; z-index: 3; float: right; margin: -6px -8px 0 0; background: #fff; }
  .kg-large__h { margin-top: 6px; }
  .kg-large__title { font-size: 1.3rem; padding-right: 72px; }
}

/* ---------- the small sheets: where it comes from, a mark's detail, and the UI tab's dialog */
dialog.kg-sheet { width: min(520px, calc(100% - 32px)); padding: 24px; border: 0; border-radius: var(--k-r-tile, 22px); background: rgba(255, 255, 255, 0.96); color: var(--color-navy-900, #1e2a4a);
  box-shadow: 0 40px 120px rgba(10, 25, 48, 0.35); -webkit-backdrop-filter: var(--k-blur); backdrop-filter: var(--k-blur); }
dialog.kg-sheet:not([data-k-sheet]) { position: fixed; inset: 0; margin: auto; height: fit-content; }
dialog.kg-sheet::backdrop { background: rgba(10, 25, 48, 0.45); -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px); }
dialog.kg-sheet[data-k-sheet] { width: 100%; border-radius: 24px 24px 0 0; }
.kg-sheet h2 { margin: 0 0 8px; font-family: var(--font-heading); font-weight: 600; font-size: 1.25rem; line-height: 1.25; letter-spacing: -0.015em; }
.kg-sheet p { margin: 0 0 10px; font-size: var(--type-secondary, 1rem); line-height: 1.5; color: var(--color-navy-700, #33405f); }
.kg-sheet p[hidden], .kg-sheet div[hidden] { display: none; }
.kg-sheet__k { font-family: var(--font-heading); font-weight: 600; font-size: 0.75rem !important; letter-spacing: 0.14em; text-transform: uppercase; color: var(--color-navy-600, #545e77) !important; margin-bottom: 6px !important; }
.kg-sheet__v { font-family: var(--font-heading); font-size: 2.4rem !important; line-height: 1.05 !important; font-weight: 300; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; color: var(--k-chart-figure, #2a3560) !important; margin: 4px 0 8px !important; }
.kg-sheet__read { color: var(--color-navy-900, #1e2a4a) !important; }
.kg-sheet__src { font-size: var(--type-meta, 0.875rem); color: var(--color-navy-900, #1e2a4a); background: rgba(17, 19, 22, 0.05); border-radius: 12px; padding: 10px 12px; }
.kg-sheet__note { font-size: var(--type-meta, 0.875rem) !important; margin-top: 10px !important; }
.kg-sheet__acts { display: flex; justify-content: flex-end; margin-top: 14px; }
/* when to use a kind: one line under its title */
.kg-use { margin: -2px 0 8px; font-size: var(--type-meta, 0.875rem); line-height: 1.45; color: var(--quiet, #5a5d63); }
.kg-ctl { margin-bottom: 10px; }
.kg-spark { display: grid; gap: 8px; justify-items: start; }
.kg-spark__k { margin: 6px 0 0; font-size: var(--type-meta, 0.875rem); color: var(--quiet, #5a5d63); }
.kg-dots .sty-chart { margin-top: 0.5rem; }

/* the chart palette card: the series colours in their fixed order */
.kg-pal { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.kg-pal li { display: grid; grid-template-columns: 44px minmax(0, 1fr); align-items: center; gap: 12px; font-size: 13px; line-height: 1.4; color: var(--color-navy-900, #1e2a4a); }
.kg-pal i { display: block; width: 44px; height: 26px; border-radius: 6px; border: 1px solid rgba(30, 42, 74, 0.08); }
.kg-pal__name { font-weight: 600; }
.kg-pal code { font: 500 12px/1 ui-monospace, Menlo, monospace; color: var(--color-navy-700, #33405f); }
.kg-pal__use { display: block; color: var(--color-navy-700, #33405f); }
