/*
  The shared components (src/ui/components.js), drawn as the seeded design
  draws them (vendor/design/mirimark-s1). Colours, radii, sizes and type are
  the design tokens (--mm-*); a size, radius or padding the tokens do not carry
  is the inline style of the design block named beside it. This file names no
  colour value of its own (tools/token-lint.js).
*/

/* Card: screen-body.dc.html, line 19 (16 px radius, 18 px padding, 10 px gap). */
.ui-card { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 18px; border: 1px solid var(--mm-line); border-radius: 16px; background: var(--mm-card); color: var(--mm-ink); }
.ui-card > h2, .ui-card > h3 { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; }
.ui-card > p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--mm-ink-2); }
/* The aside card of the two-column page (app.dc.html, line 307: 20 px radius, 22 px padding). */
.ui-card[data-role="aside"] { padding: 22px; border-radius: 20px; gap: 12px; }
.ui-card[data-role="aside"] > h2 { font-size: 18px; }

/* DashedEmpty: app.dc.html, line 303 (1.5 px dashed line-strong, 16 px radius, 18 / 20 padding). */
.ui-dashed { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 18px 20px; border: 1.5px dashed var(--mm-line-strong); border-radius: 16px; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
.ui-dashed > .ui-dashed-title { margin: 0; font-size: 17px; font-weight: 700; line-height: 1.4; color: var(--mm-ink); }
.ui-dashed > p { margin: 0; }

/* Hero: app.dc.html, lines 265 to 276 (the hero ground, 20 px radius, 26 px padding). */
.ui-hero { margin: 0; border-radius: 20px; background: var(--mm-hero); color: var(--mm-hero-text); }
.ui-hero-body { display: flex; flex-direction: column; gap: 12px; padding: 26px; }
.ui-hero-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--mm-hero-accent); }
.ui-hero-title { margin: 0; font-size: 24px; font-weight: 700; letter-spacing: -0.01em; line-height: 1.3; }
.ui-hero-reason { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-hero-muted); }
.ui-hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 4px; }
/* The button is in the dark hero style (components.dc.html, line 283): the card ground and the ink of the dark
   theme the hero body is in, 44 px, 12 px radius, no line. */
.ui-hero-actions .ui-hero-button { box-sizing: border-box; min-height: var(--mm-touch); padding: 0 20px; border: none; border-radius: var(--mm-radius-md); background: var(--mm-card); color: var(--mm-ink); font: 600 15px var(--mm-font); cursor: pointer; }
/* The source link inside the reason (line 281): the hero accent colour. */
.ui-hero-reason a { color: var(--mm-hero-accent); }
.ui-hero-plan { font-size: 14px; color: var(--mm-hero-muted); }

/* NumberedRow: screen-body.dc.html, line 35 (56 px mark, 10 px gap, 10 px padding, a line above). */
.ui-numbered { list-style: none; display: flex; flex-direction: column; margin: 0; padding: 0; }
.ui-numbered > li { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 10px 0; border-top: 1px solid var(--mm-line); }
.ui-numbered .ui-numbered-mark { font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }
.ui-numbered .ui-numbered-body { display: flex; flex-direction: column; gap: 6px; font-size: 15px; line-height: 1.55; }

/* KeyValue: screen-body.dc.html, line 28. */
.ui-kv { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 8px 14px; margin: 0; font-size: 14px; line-height: 1.5; }
.ui-kv > dt { color: var(--mm-muted); }
.ui-kv > dd { margin: 0; color: var(--mm-ink); }

/* Table: screen-body.dc.html, lines 59 to 63. */
.ui-table-wrap { overflow-x: auto; }
.ui-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ui-table th { padding: 8px 10px 8px 0; border-bottom: 1px solid var(--mm-line-strong); font-size: 12px; font-weight: 700; color: var(--mm-ink-2); text-align: left; white-space: nowrap; }
.ui-table td { padding: 9px 10px 9px 0; border-bottom: 1px solid var(--mm-line); vertical-align: top; line-height: 1.45; }

/* Chip: components.dc.html, line 242 (kind and source label). */
.ui-chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px; border: 1.5px solid var(--mm-ink-2); border-radius: 6px; background: var(--mm-card); color: var(--mm-ink-2); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; }
.ui-chip[data-tone="primary"] { border-color: var(--mm-primary-text); background: var(--mm-primary-soft); color: var(--mm-primary-text); }
.ui-chip[data-tone="success"] { border-color: var(--mm-success-text); background: var(--mm-success-soft); color: var(--mm-success-text); }
.ui-chip[data-tone="warning"] { border-color: var(--mm-warning-text); background: var(--mm-warning-soft); color: var(--mm-warning-text); }
.ui-chip[data-tone="danger"] { border-color: var(--mm-danger); background: var(--mm-danger-soft); color: var(--mm-danger); }
.ui-chip[data-edge="dashed"] { border-style: dashed; }
.ui-chip[data-edge="dotted"] { border-style: dotted; }
.ui-chip[data-shape="pill"] { padding: 5px 10px; border-radius: var(--mm-radius-full); font-size: 13px; font-weight: 600; letter-spacing: 0; }

/* A chip with no line, the soft state chip of a card or a list row (components.dc.html,
   lines 292, 303 and 314: 13 px / 600, a soft ground and no border). */
.ui-chip[data-edge="none"] { border: none; }
.ui-chip[data-tone="neutral"] { background: var(--mm-surface); color: var(--mm-ink-2); border-color: var(--mm-line-strong); }
.ui-chip[data-tone="ink"] { border-color: var(--mm-ink); color: var(--mm-ink); }
.ui-chip[data-tone="soft-primary"] { background: var(--mm-primary-soft); color: var(--mm-primary-text); }

/* The course card (components.dc.html, lines 287 to 293: 20 px radius, 22 px padding, a line above 14 px type). */
.ui-course { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 22px; border: 1px solid var(--mm-line); border-radius: 20px; color: var(--mm-ink); }
.ui-course > h3 { margin: 0; font-size: 17px; font-weight: 700; }
.ui-course .ui-course-meta { font-size: 14px; color: var(--mm-muted); }
.ui-course .ui-course-line { font-size: 14px; line-height: 1.5; color: var(--mm-ink-2); }
.ui-course .ui-chip { align-self: flex-start; padding: 4px 10px; }

/* The list card of rows (components.dc.html, lines 295 to 305): a bordered card, each row a date,
   the title with a line under it, and a state chip. */
.ui-list { margin: 0; padding: 0; list-style: none; border: 1px solid var(--mm-line); border-radius: 16px; overflow: hidden; }
.ui-list > li { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; box-sizing: border-box; min-height: 44px; padding: 14px 18px; border-bottom: 1px solid var(--mm-line); color: var(--mm-ink); }
.ui-list-mark { font-size: 13px; font-weight: 600; color: var(--mm-muted); }
.ui-list-body { min-width: 0; }
.ui-list-title { font-size: 15px; font-weight: 600; }
.ui-list-meta { margin-top: 2px; font-size: 13px; color: var(--mm-muted); }
.ui-list .ui-chip { padding: 4px 10px; white-space: nowrap; }

/* Tabs: app.dc.html, line 374 (44 px, 15px/600, a 2 px bar under the current one). */
.ui-tabs { display: flex; flex-wrap: nowrap; gap: 0 4px; margin: 0; padding: 0; list-style: none; border-bottom: 1px solid var(--mm-line); overflow-x: auto; overflow-y: hidden; }
.ui-tabs a { box-sizing: border-box; display: inline-flex; align-items: center; min-height: var(--mm-touch); padding: 0 16px; border-bottom: 2px solid transparent; color: var(--mm-ink-2); font: 600 15px var(--mm-font); text-decoration: none; white-space: nowrap; }
.ui-tabs a[aria-current="page"] { border-bottom-color: var(--mm-primary-text); color: var(--mm-ink); }
@media (min-width: 860px) { .ui-tabs a { padding: 0 16px; } }

/* Toast: app.dc.html, line 546. */
.ui-toast { position: fixed; left: 50%; bottom: 24px; z-index: var(--mm-z-toast); box-sizing: border-box; max-width: calc(100vw - 32px); padding: 14px 18px; transform: translateX(-50%); border-radius: var(--mm-radius-md); background: var(--mm-hero); color: var(--mm-hero-text); box-shadow: var(--mm-elev-2); font-size: 14px; line-height: 1.4; }
.ui-toast[data-inline] { position: static; transform: none; display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: none; padding: 12px 16px; }
.ui-toast button { min-height: var(--mm-touch); padding: 0; background: none; color: var(--mm-hero-accent); font: 600 14px var(--mm-font); }
@media (max-width: 859.98px) { .ui-toast { bottom: 96px; } }

/* BackLink: app.dc.html, line 361. */
.ui-back { align-self: flex-start; display: inline-flex; align-items: center; min-height: var(--mm-touch); padding: 0; border: none; background: none; color: var(--mm-primary-text); font: 600 15px var(--mm-font); text-decoration: none; cursor: pointer; }

/* Banner: screen-body.dc.html, line 16 (components.dc.html, lines 334 to 336 for the tones). */
.ui-banner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 0; padding: 14px 16px; border: 1px solid var(--mm-line-strong); border-radius: var(--mm-radius-md); background: var(--mm-surface); font-size: 14px; line-height: 1.5; color: var(--mm-ink-2); }
.ui-banner > p { margin: 0; }
.ui-banner strong { color: var(--mm-ink); }
.ui-banner[data-tone="danger"] { border-color: var(--mm-danger-soft); background: var(--mm-danger-soft); }
.ui-banner[data-tone="danger"] strong { color: var(--mm-danger); }
.ui-banner[data-tone="warning"] { border-color: var(--mm-warning-soft); background: var(--mm-warning-soft); }
.ui-banner[data-tone="warning"] strong { color: var(--mm-warning-text); }

/* The danger outline button of an error banner (components.dc.html, line 335: "Try again", 14px / 600, 44 px,
   10 px radius, a 1 px danger line on the card ground, danger text). */
.ui-danger-outline { box-sizing: border-box; min-height: var(--mm-touch); padding: 0 16px; border: 1px solid var(--mm-danger); border-radius: 10px; background: var(--mm-card); color: var(--mm-danger); font: 600 14px var(--mm-font); cursor: pointer; }

/* The opened metric explainer (components.dc.html, lines 345 to 352): a card with the name, then five
   labelled lines (110 px label column). */
.ui-explainer { box-sizing: border-box; display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 8px 14px; padding: 18px; border: 1px solid var(--mm-line); border-radius: 14px; background: var(--mm-card); box-shadow: var(--mm-elev-2); font-size: 14px; line-height: 1.5; color: var(--mm-ink); }
.ui-explainer > h3 { grid-column: 1 / -1; margin: 0; font-size: 16px; font-weight: 700; }
.ui-explainer > dt { color: var(--mm-muted); }
.ui-explainer > dd { margin: 0; }

/* Dialog: components.dc.html, line 357 (20 px radius, 24 px padding, the third elevation). */
.ui-dialog { box-sizing: border-box; display: flex; flex-direction: column; gap: 14px; max-width: 480px; padding: 24px; border: 1px solid var(--mm-line); border-radius: 20px; background: var(--mm-card); color: var(--mm-ink); box-shadow: var(--mm-elev-3); }
.ui-dialog > h2 { margin: 0; font-size: 20px; font-weight: 700; }
.ui-dialog > p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--mm-ink-2); }
.ui-dialog-note { padding: 10px 12px; border-radius: 10px; background: var(--mm-surface); font-size: 13px; line-height: 1.5; color: var(--mm-muted); }
.ui-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 16px; }
.ui-dialog-actions button { padding: 0 18px; }
.ui-dialog-actions button.ui-secondary { border: 1px solid var(--mm-line-strong); background: var(--mm-card); color: var(--mm-ink); }
.ui-dialog-actions button.ui-danger { background: var(--mm-danger-fill); color: var(--mm-on-primary); }

/* Loading, Empty, Error and Offline states per screen: components.dc.html, lines 374 to 403. */
.ui-state { display: flex; flex-direction: column; gap: 10px; padding: 20px; border: 1px solid var(--mm-line); border-radius: 16px; }
.ui-state-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--mm-muted); }
.ui-state[data-state="error"] .ui-state-label { color: var(--mm-danger); }
.ui-state[data-state="offline"] .ui-state-label { color: var(--mm-warning-text); }
.ui-state-title { margin: 0; font-size: 17px; font-weight: 700; }
.ui-state-text { margin: 0; font-size: 14px; line-height: 1.55; color: var(--mm-ink-2); }
.ui-state[data-state="empty"] { border: 1.5px dashed var(--mm-line-strong); }
.ui-state-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.ui-skeleton { display: block; border-radius: 7px; background: var(--mm-line); }

/* The quiet link a metric explainer opens from (components.dc.html, line 343). */
.ui-quiet { display: inline-flex; align-items: center; min-height: var(--mm-touch); padding: 0; border: none; background: none; color: var(--mm-primary-text); font: 600 14px var(--mm-font); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ui-toast button { border: none; }

/* The components page (components-gallery.html): the sheet of components.dc.html,
   lines 21 to 36 (page ground, 1200 px column, 28 px gap) and its blocks (line 36:
   card, 24 px radius, 32 px padding, 22 px gap, a 12 px eyebrow). */
body.gallery { margin: 0; background: var(--mm-page); color: var(--mm-ink); font-family: var(--mm-font); }
.g-page { box-sizing: border-box; min-height: 100vh; padding: 40px 24px 96px; }
.g-column { display: flex; flex-direction: column; gap: 28px; max-width: 1200px; margin: 0 auto; }
.g-block { display: flex; flex-direction: column; gap: 22px; padding: 32px; border: 1px solid var(--mm-line); border-radius: 24px; background: var(--mm-card); }
.g-eyebrow { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--mm-muted); }
.g-label { font-size: 14px; font-weight: 600; }
.g-specimen { display: flex; flex-direction: column; gap: 10px; }
.g-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; }
.g-grid-wide { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 20px; align-items: start; }
.g-grid-hero { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 20px; }
.g-wordmark { font-weight: 800; letter-spacing: -0.02em; }
.g-stack { display: flex; flex-direction: column; gap: 10px; }
.g-row { display: flex; flex-wrap: wrap; gap: 10px; }
/* Block 13 (components.dc.html, lines 441 to 460): skeleton list and the two permission cards. */
.g-skel { border: 1px solid var(--mm-line); border-radius: 16px; overflow: hidden; }
.g-skel-row { display: grid; grid-template-columns: 56px minmax(0, 1fr) 72px; gap: 14px; align-items: center; padding: 16px 18px; border-bottom: 1px solid var(--mm-line); }
.g-skel-lines { display: flex; flex-direction: column; gap: 8px; }
.g-skel-bar { background: var(--mm-line); }
.g-skel-soft { background: var(--mm-surface); }
.g-perm { display: flex; flex-direction: column; gap: 8px; padding: 18px; border: 1px solid var(--mm-line); border-radius: 16px; }
.g-perm-label { font-size: 12px; font-weight: 700; letter-spacing: 0.12em; color: var(--mm-warning-text); }
.g-perm-text { font-size: 15px; line-height: 1.5; color: var(--mm-ink-2); }
.g-perm-link { font-size: 14px; font-weight: 600; align-self: center; }
/* Block 06 (components.dc.html, lines 207 to 231): the side column and the bottom bar, four items, the
   current one marked by weight, colour and a bar. */
.g-nav-pair { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-start; }
.g-nav-col { display: flex; flex-direction: column; gap: 8px; }
.g-note { max-width: min(390px, 100%); font-size: 13px; line-height: 1.5; color: var(--mm-muted); }
/* A caption under a specimen runs the width of the block, and a block never grows wider than the window. */
.g-specimen > .g-note { max-width: none; }
.g-block, .g-specimen, .g-row { min-width: 0; max-width: 100%; }
.g-row .ui-chip { max-width: 100%; box-sizing: border-box; }
.g-nav-side { display: flex; flex-direction: column; gap: 24px; width: 240px; padding: 20px 14px; border: 1px solid var(--mm-line); border-radius: 16px; background: var(--mm-surface); }
.g-nav-logo { display: flex; align-items: center; gap: 10px; padding: 0 6px; }
.g-nav-items { display: flex; flex-direction: column; gap: 2px; }
.g-nav-items a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 12px 0 26px; border-radius: 10px; color: var(--mm-ink-2); font-size: 15px; font-weight: 600; text-decoration: none; }
.g-nav-items a[aria-current="page"] { padding-left: 12px; background: var(--mm-card); box-shadow: var(--mm-elev-1); color: var(--mm-ink); font-weight: 700; }
.g-nav-items a[aria-current="page"]::before { content: ""; width: 4px; height: 18px; border-radius: 2px; background: var(--mm-primary); }
.g-nav-bottom { box-sizing: border-box; display: grid; grid-template-columns: repeat(4, 1fr); width: 390px; max-width: 100%; padding: 6px 8px 22px; border: 1px solid var(--mm-line); border-radius: 16px; background: var(--mm-card); }
.g-nav-bottom a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 5px; min-height: 52px; color: var(--mm-ink-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.g-nav-bottom a::before { content: ""; width: 28px; height: 4px; border-radius: 2px; }
.g-nav-bottom a[aria-current="page"] { color: var(--mm-primary-text); font-weight: 700; }
.g-nav-bottom a[aria-current="page"]::before { background: var(--mm-primary); }
/* Block 07 (lines 238 to 271): the kind cards, the provenance chips and the translated pair. */
.g-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }
.g-kind { display: flex; flex-direction: column; gap: 10px; padding: 16px; border: 1px solid var(--mm-line); border-radius: 14px; }
.g-kind-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.g-kind-head a { font-size: 13px; font-weight: 600; color: var(--mm-primary-text); }
.g-kind-text { font-size: 15px; line-height: 1.5; color: var(--mm-ink); }
.g-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); overflow: hidden; border: 1px solid var(--mm-line); border-radius: 14px; }
.g-pair > div { display: flex; flex-direction: column; gap: 8px; padding: 16px; }
.g-pair > div + div { background: var(--mm-surface); border-left: 1px solid var(--mm-line); }
.g-pair-label { font-size: 12px; font-weight: 700; letter-spacing: 0.06em; color: var(--mm-muted); }
.g-pair-text { font-size: 15px; line-height: 1.5; }
.g-pair a { font-size: 13px; font-weight: 600; }
.g-pair .ui-chip { align-self: flex-start; }
.g-provenance { display: flex; flex-direction: column; gap: 12px; }
/* Block 09 (lines 312 to 327): status chips and the two progress cards. */
.g-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.g-progress { display: flex; flex-direction: column; gap: 10px; padding: 18px; border: 1px solid var(--mm-line); border-radius: 14px; }
.g-progress-head { display: flex; justify-content: space-between; gap: 12px; }
.g-progress-name { font-size: 15px; font-weight: 600; }
.g-progress-state { font-size: 13px; color: var(--mm-muted); }
.g-progress-state[data-tone="warning"] { color: var(--mm-warning-text); font-weight: 600; }
.g-progress-bar { position: relative; height: 6px; overflow: hidden; border-radius: 3px; background: var(--mm-line); }
.g-progress-bar > span { position: absolute; inset: 0; background: var(--mm-primary); mask-image: repeating-linear-gradient(90deg, black 0 24px, transparent 24px 40px); opacity: 0.5; }
.g-progress-text { font-size: 13px; line-height: 1.5; color: var(--mm-ink-2); }
.g-perm-button { min-height: 44px; padding: 0 16px; border: none; border-radius: 12px; background: var(--mm-primary); color: var(--mm-on-primary); font: 600 14px var(--mm-font); cursor: pointer; }
