/* ==========================================================================
   MERLIN KIT — component styles. Layer: kit.
   Prefix: .m-*  (shell uses .sh-*, views use .<view>-*)
   State lives in attributes (aria-*, data-state, data-tone); CSS owns looks.
   ========================================================================== */
@layer kit {

/* ---- Icon ------------------------------------------------------------- */
.m-icon {
  display: inline-block;
  flex: none;
  width: var(--icon-size, 16px);
  height: var(--icon-size, 16px);
  stroke: currentColor;
  stroke-width: var(--icon-stroke, 1.6);
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
  vertical-align: -0.18em;
}

/* ---- Kbd -------------------------------------------------------------- */
@media (pointer: coarse), (max-width: 799px) { .m-btn .m-kbd-group, .sh-nav-item .m-kbd-group { display: none; } }
.m-kbd {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.35rem;
  height: 1.3rem;
  padding: 0 0.3rem;
  font-family: var(--font-mono);
  font-size: var(--fs-2);
  line-height: 1;
  color: var(--ink-3);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-bottom-width: 2px;
  border-radius: var(--r-sm);
}
.m-kbd-group { display: inline-flex; align-items: center; gap: 3px; white-space: nowrap; }
.m-kbd-then { font-size: var(--fs-2); color: var(--ink-4); padding-inline: 2px; }

/* ---- Button ----------------------------------------------------------- */
.m-btn {
  --btn-h: var(--control-h);
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  height: var(--btn-h);
  min-width: var(--btn-h);
  padding: 0 var(--s-4);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-1);
  font-size: var(--fs-4);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  text-decoration: none;
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out),
    color var(--dur-2) var(--ease-out), transform var(--dur-0) var(--ease-out);
}
.m-btn .m-icon { --icon-size: 16px; }
.m-btn:active:not([disabled]):not([aria-disabled="true"]) { transform: translateY(0.5px); }
@media (hover: hover) {
  .m-btn:hover { transition-duration: var(--dur-0); border-color: var(--line-3); background: var(--surface-3); }
}
.m-btn[data-variant="primary"] {
  background: var(--accent-fill);
  border-color: var(--accent-fill-edge);
  color: var(--accent-ink);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-weight: var(--fw-semibold);
}
@media (hover: hover) {
  .m-btn[data-variant="primary"]:hover { background: var(--accent-fill-hover); border-color: var(--accent-fill-edge); }
}
.m-btn[data-variant="ghost"] { background: transparent; border-color: transparent; color: var(--ink-2); }
@media (hover: hover) {
  .m-btn[data-variant="ghost"]:hover { background: var(--line-1); border-color: transparent; color: var(--ink-1); }
}
.m-btn[data-variant="quiet"] { background: transparent; border-color: var(--line-1); color: var(--ink-2); }
@media (hover: hover) {
  .m-btn[data-variant="quiet"]:hover { background: var(--surface-2); border-color: var(--line-2); color: var(--ink-1); }
}
.m-btn[data-variant="danger"] { background: var(--down-soft); border-color: transparent; color: var(--down); }
.m-btn[data-variant="link"] {
  height: auto; min-width: 0; padding: 0; border: 0; background: none; color: var(--accent);
  font-weight: var(--fw-medium);
}
@media (hover: hover) { .m-btn[data-variant="link"]:hover { background: none; text-decoration: underline; text-underline-offset: 0.2em; } }
.m-btn[data-size="sm"] { --btn-h: var(--control-h-sm); padding: 0 var(--s-2_5); font-size: var(--fs-3); gap: var(--s-1_5); }
.m-btn[data-size="sm"] .m-icon { --icon-size: 14px; }
.m-btn[data-size="lg"] { --btn-h: var(--control-h-lg); padding: 0 var(--s-5); font-size: var(--fs-5); }
.m-btn[data-full] { width: 100%; }
.m-btn[disabled], .m-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.m-btn[aria-busy="true"] { cursor: progress; }
.m-btn[aria-busy="true"] > :not(.m-spinner) { opacity: 0; }
.m-btn > .m-spinner { position: absolute; inset: 0; margin: auto; }
.m-btn .m-kbd { margin-left: var(--s-1); margin-right: calc(var(--s-2) * -1); height: 1.2rem; background: transparent; }
.m-btn[data-variant="primary"] .m-kbd { color: var(--accent-ink); border-color: rgba(0, 0, 0, 0.22); }
.m-btn[aria-pressed="true"] { background: var(--surface-3); border-color: var(--line-3); color: var(--ink-1); }

.m-iconbtn {
  --btn-h: var(--control-h);
  position: relative;
  display: inline-grid;
  place-items: center;
  width: var(--btn-h);
  height: var(--btn-h);
  flex: none;
  border-radius: var(--r-sm);
  color: var(--ink-3);
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
.m-iconbtn .m-icon { --icon-size: 18px; }
@media (hover: hover) { .m-iconbtn:hover { color: var(--ink-1); background: var(--line-1); transition-duration: var(--dur-0); } }
.m-iconbtn[data-size="sm"] { --btn-h: var(--control-h-sm); }
.m-iconbtn[data-size="sm"] .m-icon { --icon-size: 16px; }
.m-iconbtn[data-variant="outline"] { border-color: var(--line-2); background: var(--surface-2); color: var(--ink-2); }
.m-iconbtn[aria-pressed="true"], .m-iconbtn[aria-expanded="true"] { color: var(--ink-1); background: var(--line-1); }
.m-iconbtn::after { content: ""; position: absolute; inset: min(0px, calc((var(--btn-h) - var(--hit)) / 2)); }
.m-iconbtn[data-badge]::before {
  content: attr(data-badge);
  position: absolute; top: 2px; right: 2px;
  min-width: 14px; height: 14px; padding: 0 3px;
  border-radius: var(--r-pill);
  background: var(--accent-fill); color: var(--accent-ink);
  font: 600 9.5px/14px var(--font-sans);
  text-align: center;
}

.m-spinner {
  width: 16px; height: 16px; border-radius: 50%;
  border: 2px solid currentColor; border-right-color: transparent;
  animation: m-spin 700ms linear infinite;
  opacity: 0.8;
}
@keyframes m-spin { to { transform: rotate(360deg); } }

/* ---- Chip / Tag ------------------------------------------------------- */
.m-chip {
  --chip-fg: var(--ink-2);
  --chip-bg: var(--line-1);
  --chip-bd: transparent;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 22px;
  padding: 0 7px;
  border-radius: var(--r-sm);
  border: 1px solid var(--chip-bd);
  background: var(--chip-bg);
  color: var(--chip-fg);
  font-size: var(--fs-2);
  font-weight: var(--fw-medium);
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
.m-chip .m-icon { --icon-size: 12px; --icon-stroke: 2; }
.m-chip[data-tone="accent"] { --chip-fg: var(--accent); --chip-bg: var(--accent-soft); }
.m-chip[data-tone="live"] { --chip-fg: var(--live); --chip-bg: var(--live-soft); }
.m-chip[data-tone="up"] { --chip-fg: var(--up); --chip-bg: var(--up-soft); }
.m-chip[data-tone="down"] { --chip-fg: var(--down); --chip-bg: var(--down-soft); }
.m-chip[data-tone="warn"] { --chip-fg: var(--warn); --chip-bg: var(--warn-soft); }
.m-chip[data-tone="model"] { --chip-fg: var(--model); --chip-bg: var(--model-soft); }
.m-chip[data-tone="outline"] { --chip-bg: transparent; --chip-bd: var(--line-2); --chip-fg: var(--ink-3); }
.m-chip[data-tone="solid"] { --chip-bg: var(--ink-1); --chip-fg: var(--bg); }
.m-chip[data-size="lg"] { height: 26px; padding: 0 10px; font-size: var(--fs-3); }
.m-chip[data-upper] { font-size: var(--fs-1); letter-spacing: var(--track-micro); text-transform: uppercase; font-weight: var(--fw-semibold); }
.m-chip-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }
button.m-chip { cursor: pointer; height: 28px; padding: 0 10px; font-size: var(--fs-3); --chip-bg: transparent; --chip-bd: var(--line-2); --chip-fg: var(--ink-2);
  transition: background-color var(--dur-2) var(--ease-out), border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out); }
@media (hover: hover) { button.m-chip:hover { --chip-bd: var(--line-3); --chip-fg: var(--ink-1); transition-duration: var(--dur-0); } }
button.m-chip[aria-pressed="true"] { --chip-bg: var(--accent-soft); --chip-bd: var(--accent-line); --chip-fg: var(--ink-1); }
button.m-chip[aria-pressed="true"] .m-chip-dot { background: var(--accent); }
@media (pointer: coarse) { button.m-chip { height: 36px; padding: 0 12px; } }

/* ---- Pip (live / age / stale) ------------------------------------------ */
.m-pip {
  --pip: var(--ink-3);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-mono);
  font-size: var(--fs-2);
  line-height: 1;
  color: var(--ink-3);
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.m-pip-dot {
  position: relative;
  width: 7px; height: 7px; flex: none;
  border-radius: 50%;
  background: var(--pip);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--pip) 30%, transparent);
}
.m-pip[data-state="live"] { --pip: var(--live); color: var(--live); }
.m-pip[data-state="live"] .m-pip-dot::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 1.5px solid var(--live);
  animation: m-pulse var(--dur-pulse) var(--ease-out) infinite;
}
@keyframes m-pulse { 0% { transform: scale(0.6); opacity: 0.9; } 70%, 100% { transform: scale(1.9); opacity: 0; } }
.m-pip[data-state="fresh"] { --pip: var(--ink-3); }
.m-pip[data-state="aging"] { --pip: var(--ink-3); }
.m-pip[data-state="aging"] .m-pip-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pip); }
.m-pip[data-state="stale"] { --pip: var(--warn); color: var(--warn); }
.m-pip[data-state="stale"] .m-pip-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pip); }
.m-pip[data-state="error"] { --pip: var(--down); color: var(--down); }
.m-pip[data-state="offline"] { --pip: var(--ink-4); color: var(--ink-4); }
.m-pip[data-state="offline"] .m-pip-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pip); }
.m-pip[data-state="delayed"] { --pip: var(--accent); color: var(--accent); }
.m-pip[data-state="delayed"] .m-pip-dot { background: transparent; box-shadow: inset 0 0 0 1.5px var(--pip); }
.m-pip[data-state="connecting"] { --pip: var(--ink-4); }
.m-pip[data-state="connecting"] .m-pip-dot { animation: m-blink 1.2s steps(2) infinite; }
@keyframes m-blink { 50% { opacity: 0.25; } }
.m-pip-label { text-transform: uppercase; letter-spacing: 0.06em; font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: var(--fs-1); }

/* ---- Tooltip ----------------------------------------------------------- */
.m-tooltip {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-popover);
  max-width: min(300px, calc(100vw - 24px));
  padding: 6px 9px;
  border-radius: var(--r-sm);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2), var(--rim);
  color: var(--ink-1);
  font-size: var(--fs-2);
  line-height: 1.4;
  pointer-events: none;
  transform-origin: var(--origin, center top);
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out);
}
.m-tooltip[data-starting], .m-tooltip[data-ending] { opacity: 0; transform: scale(0.96); }
.m-tooltip[data-ending] { transition-duration: 90ms; }
.m-tooltip .m-kbd-group { margin-left: 6px; }
.m-tooltip-sub { display: block; color: var(--ink-3); margin-top: 2px; }

/* ---- Popover + Menu ---------------------------------------------------- */
.m-popover {
  position: fixed;
  top: 0; left: 0;
  z-index: var(--z-popover);
  min-width: 180px;
  max-width: min(380px, calc(100vw - 16px));
  max-height: min(70vh, 560px);
  overflow: auto;
  padding: var(--s-1_5);
  border-radius: var(--r-lg);
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2), var(--rim);
  color: var(--ink-2);
  transform-origin: var(--origin, top left);
  transition: opacity var(--dur-1) var(--ease-out), transform var(--dur-1) var(--ease-out-strong);
  overscroll-behavior: contain;
}
.m-popover[data-starting], .m-popover[data-ending] { opacity: 0; transform: scale(0.97) translateY(-2px); }
.m-popover[data-ending] { transition-duration: 110ms; transition-timing-function: var(--ease-exit); }
.m-popover[data-pad="lg"] { padding: var(--s-4); }
.m-menu-item {
  display: flex;
  align-items: center;
  gap: var(--s-2_5);
  width: 100%;
  min-height: 34px;
  padding: 0 var(--s-2_5);
  border-radius: var(--r-sm);
  color: var(--ink-1);
  font-size: var(--fs-4);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  outline: none;
}
.m-menu-item .m-icon { color: var(--ink-3); --icon-size: 16px; }
.m-menu-item[data-active], .m-menu-item:focus-visible { background: var(--line-1); }
.m-menu-item[data-active] .m-icon { color: var(--ink-1); }
.m-menu-item[aria-disabled="true"] { opacity: 0.45; cursor: default; }
.m-menu-item[data-danger] { color: var(--down); }
.m-menu-item-meta { margin-left: auto; color: var(--ink-4); font-size: var(--fs-2); display: inline-flex; align-items: center; gap: 4px; }
.m-menu-check { margin-left: auto; color: var(--accent); }
.m-menu-label { padding: var(--s-2) var(--s-2_5) var(--s-1); }
.m-menu-sep { height: 1px; margin: var(--s-1_5) calc(var(--s-1_5) * -1); background: var(--line-1); }
@media (pointer: coarse) { .m-menu-item { min-height: 44px; } }

/* ---- Dialog + Sheet (native <dialog>, top layer) ------------------------ */
.m-dialog, .m-sheet {
  padding: 0;
  border: 1px solid var(--line-2);
  background: var(--surface-3);
  color: var(--ink-2);
  box-shadow: var(--shadow-3), var(--rim);
  overflow: hidden;
  overscroll-behavior: contain;
}
.m-dialog::backdrop, .m-sheet::backdrop {
  background: var(--scrim);
  opacity: 1;
  transition: opacity var(--dur-2) var(--ease-out);
}
.m-dialog[data-starting]::backdrop, .m-dialog[data-ending]::backdrop,
.m-sheet[data-starting]::backdrop, .m-sheet[data-ending]::backdrop { opacity: 0; }

.m-dialog {
  width: min(520px, calc(100vw - 32px));
  max-height: min(86dvh, 760px);
  margin: auto;
  border-radius: var(--r-lg);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-3) var(--ease-spring);
}
.m-dialog[data-starting] { opacity: 0; transform: translateY(8px) scale(0.98); }
.m-dialog[data-ending] { opacity: 0; transform: scale(0.985); transition-duration: 140ms; transition-timing-function: var(--ease-exit); }
.m-dialog[data-size="lg"] { width: min(760px, calc(100vw - 32px)); }
.m-dialog-inner { display: flex; flex-direction: column; max-height: inherit; }
.m-dialog-head { display: flex; align-items: flex-start; gap: var(--s-3); padding: var(--s-5) var(--s-5) var(--s-3) var(--s-6); }
.m-dialog-title { font-family: var(--font-serif); font-size: var(--fs-7); font-weight: 500; line-height: 1.2; color: var(--ink-1); flex: 1; letter-spacing: var(--track-tight); }
.m-dialog-body { padding: 0 var(--s-6) var(--s-5); overflow: auto; }
.m-dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-4) var(--s-6); border-top: 1px solid var(--line-1); background: var(--surface-2); }

.m-sheet {
  margin: 0;
  max-width: none;
  max-height: none;
  position: fixed;
  will-change: transform;
}
.m-sheet[data-side="bottom"] {
  inset: auto 0 0 0;
  width: 100%;
  max-height: min(88dvh, 100% - 40px);
  border-radius: var(--r-xl) var(--r-xl) 0 0;
  border-bottom: 0;
  transform: translateY(var(--drag-y, 0px));
  transition: transform var(--dur-sheet) var(--ease-sheet), opacity var(--dur-2) var(--ease-out);
  padding-bottom: var(--safe-b);
}
.m-sheet[data-side="bottom"][data-starting], .m-sheet[data-side="bottom"][data-ending] { transform: translateY(100%); }
.m-sheet[data-side="bottom"][data-ending] { transition-duration: 260ms; transition-timing-function: var(--ease-exit); }
.m-sheet[data-side="bottom"][data-dragging] { transition: none; }
.m-sheet[data-side="right"] {
  inset: 0 0 0 auto;
  height: 100dvh;
  max-height: none;
  width: min(var(--sheet-w, 480px), 100vw);
  border-radius: 0;
  border-width: 0 0 0 1px;
  transition: transform var(--dur-3) var(--ease-out-strong), opacity var(--dur-2) var(--ease-out);
}
.m-sheet[data-side="right"][data-starting], .m-sheet[data-side="right"][data-ending] { transform: translateX(100%); }
.m-sheet[data-side="right"][data-ending] { transition-duration: 200ms; transition-timing-function: var(--ease-exit); }
.m-sheet-inner { display: flex; flex-direction: column; height: 100%; max-height: inherit; }
.m-sheet[data-side="bottom"] .m-sheet-inner { max-height: min(88dvh, 100dvh - 40px); }
.m-sheet-handle { display: grid; place-items: center; height: 18px; flex: none; cursor: grab; touch-action: none; }
.m-sheet-handle::before { content: ""; width: 32px; height: 3px; border-radius: 3px; background: var(--line-3); }
.m-sheet-head { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-2) var(--s-3) var(--s-3) var(--s-5); flex: none; touch-action: none; }
.m-sheet[data-side="right"] .m-sheet-head { padding: var(--s-4) var(--s-3) var(--s-4) var(--s-6); border-bottom: 1px solid var(--line-1); }
.m-sheet-title { flex: 1; min-width: 0; font-family: var(--font-serif); font-size: var(--fs-6); font-weight: 560; color: var(--ink-1); line-height: 1.25; }
.m-sheet-sub { display: block; font-family: var(--font-sans); font-size: var(--fs-2); color: var(--ink-3); font-weight: 400; margin-top: 2px; }
.m-sheet-body { flex: 1 1 auto; overflow: auto; padding: 0 var(--s-5) var(--s-5); overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.m-sheet[data-side="right"] .m-sheet-body { padding: var(--s-5) var(--s-6); }

/* ---- Toast ------------------------------------------------------------- */
.m-toasts {
  position: fixed;
  z-index: var(--z-toast);
  right: var(--s-6);
  bottom: var(--s-6);
  width: min(360px, calc(100vw - 32px));
  display: flex;
  flex-direction: column-reverse;
  gap: var(--s-2_5);
  pointer-events: none;
}
@media (max-width: 719px) {
  .m-toasts { left: 50%; right: auto; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + var(--s-3)); }
}
.m-toast {
  --tone: var(--ink-3);
  pointer-events: auto;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: start;
  gap: var(--s-3);
  padding: var(--s-3) var(--s-2) var(--s-3) var(--s-4);
  border-radius: 8px;
  background: var(--surface-3);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow-2), var(--rim);
  color: var(--ink-2);
  font-size: var(--fs-3);
  transform: translateX(var(--swipe-x, 0px));
  transition: transform 380ms var(--ease-out-strong), opacity 260ms var(--ease-out);
  touch-action: pan-y;
}
.m-toast::before { content: ""; position: absolute; left: 0; top: 10px; bottom: 10px; width: 2px; border-radius: 2px; background: var(--tone); }
.m-toast { position: relative; }
.m-toast[data-starting] { opacity: 0; transform: translateY(12px) scale(0.98); }
.m-toast[data-ending] { opacity: 0; transform: translateX(var(--swipe-x, 0px)) scale(0.97); transition-duration: 200ms; }
.m-toast[data-swiping] { transition: none; }
.m-toast[data-tone="success"] { --tone: var(--up); }
.m-toast[data-tone="warn"] { --tone: var(--warn); }
.m-toast[data-tone="error"] { --tone: var(--down); }
.m-toast[data-tone="live"] { --tone: var(--live); }
.m-toast[data-tone="accent"] { --tone: var(--accent); }
.m-toast-icon { color: var(--tone); margin-top: 1px; }
.m-toast-icon .m-icon { --icon-size: 18px; }
.m-toast-title { color: var(--ink-1); font-size: var(--fs-4); font-weight: var(--fw-medium); line-height: 1.35; }
.m-toast-body { margin-top: 2px; color: var(--ink-2); line-height: 1.45; }
.m-toast-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); }
.m-toast .m-iconbtn { margin-top: -4px; }

/* ---- Tabs + Segmented --------------------------------------------------- */
.m-tabs {
  display: flex;
  align-items: stretch;
  gap: var(--s-1);
  border-bottom: 1px solid var(--line-1);
  overflow-x: auto;
  scrollbar-width: none;
}
.m-tabs::-webkit-scrollbar { display: none; }
.m-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: var(--s-1_5);
  height: 40px;
  padding: 0 var(--s-3);
  color: var(--ink-3);
  font-size: var(--fs-4);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: color var(--dur-2) var(--ease-out);
}
.m-tab::after {
  content: ""; position: absolute; left: var(--s-3); right: var(--s-3); bottom: -1px; height: 2px;
  border-radius: 2px 2px 0 0; background: var(--accent);
  transform: scaleX(0); transition: transform var(--dur-2) var(--ease-out-strong);
}
@media (hover: hover) { .m-tab:hover { color: var(--ink-1); transition-duration: var(--dur-0); } }
.m-tab[aria-selected="true"] { color: var(--ink-1); }
.m-tab[aria-selected="true"]::after { transform: scaleX(1); }
.m-tab:focus-visible { outline-offset: -2px; }
.m-tab-count { font-family: var(--font-mono); font-size: var(--fs-2); color: var(--ink-4); }
.m-tab[aria-selected="true"] .m-tab-count { color: var(--ink-3); }
.m-tabpanel:focus-visible { outline-offset: 4px; }

.m-seg {
  display: inline-flex;
  align-items: stretch;
  padding: 2px;
  gap: 2px;
  border-radius: calc(var(--r-sm) + 2px);
  background: var(--surface-sunken);
  border: 1px solid var(--line-1);
  max-width: 100%;
  overflow-x: auto;
  scrollbar-width: none;
}
.m-seg-opt {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1_5);
  height: calc(var(--control-h) - 6px);
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  color: var(--ink-3);
  font-size: var(--fs-3);
  font-weight: var(--fw-medium);
  white-space: nowrap;
  cursor: pointer;
  transition: background-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.m-seg-opt .m-icon { --icon-size: 15px; }
@media (hover: hover) { .m-seg-opt:hover { color: var(--ink-1); transition-duration: var(--dur-0); } }
.m-seg-opt[aria-checked="true"] { background: var(--surface-3); color: var(--ink-1); box-shadow: 0 0 0 1px var(--line-2), var(--shadow-1), var(--rim); }
.m-seg-opt:focus-visible { outline-offset: 0; }
.m-seg[data-size="sm"] .m-seg-opt { height: calc(var(--control-h-sm) - 6px); padding: 0 var(--s-2_5); }
.m-seg[data-full] { display: flex; width: 100%; }
.m-seg[data-full] .m-seg-opt { flex: 1; }

/* ---- Switch ------------------------------------------------------------ */
.m-switch-row { display: flex; align-items: flex-start; gap: var(--s-3); cursor: pointer; }
.m-switch {
  position: relative;
  flex: none;
  display: inline-block;
  width: 40px;
  height: 26px;
  margin: -3px -3px 0;
  cursor: pointer;
  border-radius: var(--r-pill);
}
.m-switch::before {
  content: ""; position: absolute; left: 3px; top: 3px; width: 34px; height: 20px; border-radius: var(--r-pill);
  background: var(--line-2); box-shadow: inset 0 0 0 1px var(--line-2);
  transition: background-color var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.m-switch::after {
  content: ""; position: absolute; top: 5px; left: 5px; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink-1); box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
  transition: transform var(--dur-2) var(--ease-spring);
}
.m-switch[aria-checked="true"]::before { background: var(--accent-fill); box-shadow: inset 0 0 0 1px var(--accent-fill-edge); }
.m-switch[aria-checked="true"]::after { transform: translateX(14px); background: #fff; }
.m-switch:focus-visible { outline-offset: 0; }
.m-switch-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.m-switch-label { color: var(--ink-1); font-size: var(--fs-4); line-height: 1.35; }
.m-switch-desc { color: var(--ink-3); font-size: var(--fs-3); line-height: 1.4; }

/* ---- Field: Input + Select --------------------------------------------- */
.m-field { display: flex; flex-direction: column; gap: var(--s-1_5); min-width: 0; }
.m-field-label { font-size: var(--fs-3); font-weight: var(--fw-medium); color: var(--ink-2); }
.m-field-hint { font-size: var(--fs-2); color: var(--ink-3); }
.m-field-error { font-size: var(--fs-2); color: var(--down); display: flex; gap: 6px; align-items: center; }
.m-input-wrap, .m-select { position: relative; display: flex; align-items: center; min-width: 0; }
.m-input, .m-select select {
  width: 100%;
  height: var(--control-h);
  padding: 0 var(--s-3);
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  background: var(--surface-2);
  color: var(--ink-1);
  font-size: var(--fs-4);
  transition: border-color var(--dur-2) var(--ease-out), background-color var(--dur-2) var(--ease-out);
}
.m-input::placeholder { color: var(--ink-4); opacity: 1; }
@media (hover: hover) { .m-input:hover, .m-select select:hover { border-color: var(--line-3); } }
.m-input:focus, .m-select select:focus { border-color: var(--accent-line); background: var(--surface-1); }
.m-input[aria-invalid="true"] { border-color: var(--down); }
.m-input-wrap > .m-icon { position: absolute; left: var(--s-3); color: var(--ink-3); pointer-events: none; }
.m-input-wrap:has(> .m-icon:first-child) .m-input { padding-left: calc(var(--s-3) + 24px); }
.m-input-wrap > .m-kbd-group, .m-input-wrap > .m-input-end { position: absolute; right: var(--s-2); }
.m-input[type="number"] { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.m-input[data-size="sm"], .m-select[data-size="sm"] select { height: var(--control-h-sm); font-size: var(--fs-3); }
.m-select select { appearance: none; -webkit-appearance: none; padding-right: calc(var(--s-3) + 20px); cursor: pointer; }
.m-select::after {
  content: ""; position: absolute; right: var(--s-3); width: 14px; height: 14px; pointer-events: none;
  background: var(--ink-3);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4 -4l4 4'/%3E%3Cpath d='M16 15l-4 4l-4 -4'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 9l4 -4l4 4'/%3E%3Cpath d='M16 15l-4 4l-4 -4'/%3E%3C/svg%3E") center / contain no-repeat;
}
.m-select option { background: var(--surface-3); color: var(--ink-1); }

/* ---- Card / Panel ------------------------------------------------------- */
.m-card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  background: var(--surface-1);
  border: 1px solid var(--line-1);
  border-radius: var(--r-md);
  padding: var(--pad-card);
  container-type: inline-size;
}
.m-card[data-variant="plain"] { background: transparent; border-color: transparent; padding: 0; }
.m-card[data-variant="inset"] { background: var(--surface-2); }
.m-card[data-flush] { padding: 0; }
.m-card[data-flush] > .m-card-head { padding: var(--pad-card) var(--pad-card) var(--s-4); margin: 0; border-bottom: 1px solid var(--line-1); }
.m-card[data-flush] > .m-card-foot { padding: var(--s-3) var(--pad-card); margin: 0; }
.m-card[data-flush] > .m-card-body > .m-state { margin: var(--pad-card); }
a.m-card, .m-card[data-href] { text-decoration: none; color: inherit; transition: border-color var(--dur-2) var(--ease-out); }
@media (hover: hover) { a.m-card:hover { border-color: var(--line-3); } }
.m-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--s-2) var(--s-3);
  margin-bottom: var(--s-4);
  min-width: 0;
}
.m-card-titles { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1 1 13rem; }
.m-card-title { margin: 0; }
.m-card-title a { color: inherit; text-decoration: none; }
@media (hover: hover) { .m-card-title a:hover { text-decoration: underline; text-decoration-color: var(--line-3); } }
.m-card-sub { font-size: var(--fs-3); color: var(--ink-3); line-height: 1.4; }
.m-card-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1); flex: none; margin: -4px -6px 0 auto; }
.m-card-meta > .m-pip { margin-right: var(--s-1_5); }
.m-card-body { position: relative; min-width: 0; flex: 1 1 auto; }
.m-card-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--s-1) var(--s-3);
  margin-top: var(--s-4);
  padding-top: var(--s-3);
  border-top: 1px solid var(--line-1);
  font-size: var(--fs-2);
  color: var(--ink-4);
}
.m-card-foot a { color: var(--ink-3); }
.m-card[data-target-flash], [data-target-flash] { animation: m-target 1.6s var(--ease-out); }
@keyframes m-target { 0%, 30% { box-shadow: 0 0 0 2px var(--accent-line); } 100% { box-shadow: 0 0 0 2px transparent; } }

.m-stale {
  display: flex; align-items: center; gap: var(--s-2);
  margin: calc(var(--s-2) * -1) 0 var(--s-3);
  padding: 6px var(--s-2_5);
  border-radius: var(--r-sm);
  background: var(--warn-soft);
  color: var(--warn);
  font-size: var(--fs-2);
  line-height: 1.35;
}
.m-stale .m-icon { --icon-size: 14px; }
.m-stale span { color: var(--ink-1); }

/* ---- States: skeleton / empty / error ----------------------------------- */
.m-skel {
  display: block;
  position: relative;
  overflow: hidden;
  border-radius: var(--r-xs);
  background: var(--skeleton);
  animation: m-skel-in 240ms 160ms both var(--ease-out);
}
.m-skel::after {
  content: "";
  position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--skeleton-hi), transparent);
  animation: m-shimmer 1.6s 400ms var(--ease-in-out) infinite;
}
@keyframes m-skel-in { from { opacity: 0; } }
@keyframes m-shimmer { to { transform: translateX(100%); } }
.m-skel-text { height: 0.8em; margin: 0.35em 0; }
.m-skel-stack { display: flex; flex-direction: column; gap: var(--s-2); }
.m-skel-row { display: flex; gap: var(--s-3); align-items: center; }
.m-skel[data-shape="circle"] { border-radius: 50%; }
.m-skel[data-shape="num"] { height: 1.9em; width: 5.5em; border-radius: var(--r-sm); }

.m-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: var(--s-2);
  padding: var(--s-8) var(--s-4);
  min-height: 160px;
}
.m-state[data-compact] { flex-direction: row; justify-content: flex-start; text-align: left; min-height: 0; padding: var(--s-3) 0; gap: var(--s-3); }
.m-state-icon {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--line-2);
  color: var(--ink-3);
  background: var(--surface-2);
  margin-bottom: var(--s-1);
  flex: none;
}
.m-state[data-compact] .m-state-icon { width: 32px; height: 32px; margin: 0; }
.m-state-icon .m-icon { --icon-size: 18px; }
.m-state[data-tone="error"] .m-state-icon { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); background: var(--down-soft); }
.m-state[data-tone="warn"] .m-state-icon { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 35%, transparent); background: var(--warn-soft); }
.m-state-title { font-family: var(--font-serif); font-size: var(--fs-5); font-weight: 560; color: var(--ink-1); line-height: 1.3; }
.m-state-body { font-size: var(--fs-3); color: var(--ink-3); max-width: 46ch; line-height: 1.5; }
.m-state[data-compact] .m-state-title { font-size: var(--fs-4); }
.m-state-actions { display: flex; gap: var(--s-2); margin-top: var(--s-2); flex-wrap: wrap; justify-content: center; }

/* ---- Stat tile ---------------------------------------------------------- */
.m-stat { display: flex; flex-direction: column; gap: var(--s-2); min-width: 0; }
.m-stat-label { display: flex; align-items: center; gap: var(--s-2); }
.m-stat-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3); min-width: 0; }
.m-stat-value {
  display: inline-flex; align-items: baseline; gap: 4px;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: var(--fs-7);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--ink-1);
  border-radius: var(--r-xs);
  white-space: nowrap;
  transition: color var(--dur-3) var(--ease-out);
}
.m-stat[data-size="xl"] .m-stat-value { font-size: var(--fs-8); }
.m-stat[data-size="sm"] .m-stat-value { font-size: var(--fs-5); letter-spacing: -0.01em; }
.m-stat-unit { font-size: 0.5em; color: var(--ink-3); letter-spacing: 0; font-weight: 400; }
.m-stat-value[data-flash="up"] { animation: m-flash-up var(--dur-flash) var(--ease-out); }
.m-stat-value[data-flash="down"] { animation: m-flash-down var(--dur-flash) var(--ease-out); }
[data-flash="up"] { animation: m-flash-up var(--dur-flash) var(--ease-out); }
[data-flash="down"] { animation: m-flash-down var(--dur-flash) var(--ease-out); }
@keyframes m-flash-up { 0% { color: var(--up); background: var(--up-soft); } 100% { background: transparent; } }
@keyframes m-flash-down { 0% { color: var(--down); background: var(--down-soft); } 100% { background: transparent; } }
.m-stat-meta { display: flex; align-items: center; flex-wrap: wrap; gap: var(--s-1) var(--s-2); font-size: var(--fs-2); color: var(--ink-3); min-height: 20px; }
.m-stat-spark { flex: none; color: var(--ink-3); }

.m-delta {
  display: inline-flex; align-items: center; gap: 3px;
  font-family: var(--font-mono); font-size: var(--fs-3); font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
  white-space: nowrap;
}
.m-delta[data-dir="up"] { color: var(--up); }
.m-delta[data-dir="down"] { color: var(--down); }
.m-delta-tri { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; }
.m-delta[data-dir="up"] .m-delta-tri { border-bottom: 6px solid currentColor; }
.m-delta[data-dir="down"] .m-delta-tri { border-top: 6px solid currentColor; }
.m-delta[data-dir="flat"] .m-delta-tri { width: 7px; height: 2px; border: 0; background: currentColor; }

/* ---- Provenance tag ----------------------------------------------------- */
.m-prov {
  --prov: var(--ink-3);
  display: inline-flex;
  align-items: center;
  vertical-align: middle;
  padding: 0;
  border: 0;
  background: none;
  color: var(--prov);
  cursor: pointer;
  border-radius: var(--r-sm);
  flex: none;
}
.m-prov-face {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 20px;
  padding: 0 6px;
  border-radius: var(--r-sm);
  border: 1px solid var(--line-2);
  font-family: var(--font-sans);
  font-size: var(--fs-1);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  transition: border-color var(--dur-2) var(--ease-out), color var(--dur-2) var(--ease-out);
}
@media (hover: hover) { .m-prov:hover .m-prov-face { border-color: var(--line-3); color: var(--ink-1); } }
.m-prov-glyph { width: 7px; height: 7px; flex: none; }
.m-prov[data-kind="FACT"] { --prov: var(--ink-2); }
.m-prov[data-kind="FACT"] .m-prov-glyph { background: currentColor; border-radius: 1px; }
.m-prov[data-kind="INFERENCE"] { --prov: var(--ink-2); }
.m-prov[data-kind="INFERENCE"] .m-prov-face { border-style: dashed; }
.m-prov[data-kind="INFERENCE"] .m-prov-glyph { border: 1.5px solid currentColor; border-radius: 50%; }
.m-prov[data-kind="MODEL"] { --prov: var(--model); }
.m-prov[data-kind="MODEL"] .m-prov-face { border-color: color-mix(in srgb, var(--model) 45%, transparent); border-style: dashed; background: var(--model-soft); }
.m-prov[data-kind="MODEL"] .m-prov-glyph { border: 1.5px solid currentColor; transform: rotate(45deg) scale(0.85); }
.m-prov-conf { display: inline-flex; align-items: flex-end; gap: 1.5px; height: 9px; margin-left: 1px; padding-left: 5px; border-left: 1px solid var(--line-2); }
.m-prov-conf i { display: block; width: 2px; background: currentColor; opacity: 0.25; border-radius: 1px; }
.m-prov-conf i:nth-child(1) { height: 4px; } .m-prov-conf i:nth-child(2) { height: 6.5px; } .m-prov-conf i:nth-child(3) { height: 9px; }
.m-prov-conf[data-level="low"] i:nth-child(1),
.m-prov-conf[data-level="medium"] i:nth-child(-n+2),
.m-prov-conf[data-level="high"] i { opacity: 1; }
.m-prov[data-compact] .m-prov-face { padding: 0 5px; }
span.m-prov .m-prov-face { cursor: default; }

.m-prov-pop { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-2); min-width: 260px; max-width: 360px; }
.m-prov-pop-head { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
.m-prov-pop-def { font-size: var(--fs-3); color: var(--ink-2); line-height: 1.45; }
.m-prov-src { display: flex; flex-direction: column; gap: 6px; padding: 0; margin: 0; list-style: none; }
.m-prov-src li { display: flex; gap: var(--s-2); align-items: baseline; font-size: var(--fs-3); line-height: 1.4; color: var(--ink-2); min-width: 0; }
.m-prov-src li::before { content: ""; flex: none; width: 4px; height: 4px; border-radius: 50%; background: var(--ink-4); transform: translateY(-2px); }
.m-prov-src a { color: var(--ink-1); overflow-wrap: anywhere; }
.m-prov-src .id { color: var(--ink-3); font-size: var(--fs-2); }

/* ---- Countdown + age ------------------------------------------------------ */
m-countdown, m-age { display: inline; font-family: var(--font-mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.m-cd-n { color: var(--ink-1); }
.m-cd-u { color: var(--ink-3); font-size: 0.82em; margin-left: 1px; margin-right: 0.3em; }
.m-cd-u:last-child { margin-right: 0; }
m-countdown[data-urgent] .m-cd-n { color: var(--accent); }
m-countdown[data-past] { color: var(--ink-4); }

/* ---- Locked preview (the gate) ------------------------------------------- */
.m-locked {
  position: relative;
  isolation: isolate;
  min-height: 240px;
  border-radius: var(--r-md);
  overflow: hidden;
}
.m-locked-preview {
  position: absolute;
  inset: 0;
  filter: blur(5px) saturate(0.7);
  opacity: 0.5;
  pointer-events: none;
  user-select: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 45%, transparent 100%);
  transform: scale(1.01);
}
.m-locked-sample {
  position: absolute; top: var(--s-3); left: var(--s-3); z-index: 1;
}
.m-locked-panel {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--s-2);
  max-width: 440px;
  margin: 0 auto;
  padding: var(--s-10) var(--s-5) var(--s-8);
}
.m-locked[data-inline] { min-height: 0; }
.m-locked[data-inline] .m-locked-panel { padding: var(--s-6) var(--s-4); }
.m-locked-panel > * { flex: none; }
.m-locked-panel::before {
  content: ""; position: absolute; z-index: -1; inset: 4% -12%;
  background: radial-gradient(closest-side, color-mix(in srgb, var(--surface-1) 88%, transparent) 62%, transparent);
  pointer-events: none;
}
.m-locked-badge {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  color: var(--accent);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--accent-line);
  margin-bottom: var(--s-1);
}
.m-locked-badge .m-icon { --icon-size: 18px; }
.m-locked-title { font-family: var(--font-serif); font-size: var(--fs-6); font-weight: 560; color: var(--ink-1); line-height: 1.3; text-wrap: balance; }
.m-locked-body { font-size: var(--fs-3); color: var(--ink-2); line-height: 1.55; max-width: 42ch; }
.m-locked-list { display: flex; flex-direction: column; gap: 6px; margin: var(--s-1) 0 var(--s-2); padding: 0; list-style: none; text-align: left; }
.m-locked-list li { display: flex; gap: var(--s-2); font-size: var(--fs-3); color: var(--ink-2); line-height: 1.4; }
.m-locked-list .m-icon { color: var(--accent); --icon-size: 15px; margin-top: 2px; }
.m-locked-actions { display: flex; gap: var(--s-2); flex-wrap: wrap; justify-content: center; margin-top: var(--s-2); }
.m-locked-note { font-size: var(--fs-2); color: var(--ink-3); min-height: 1.4em; }
.m-locked-note[data-state="found"], .m-locked-note[data-state="unlocked"] { color: var(--up); }
.m-locked-note[data-state="not_found"], .m-locked-note[data-state="rate_limited"] { color: var(--warn); }
.m-locked-note[data-state="error"] { color: var(--down); }
.m-unlocked { animation: m-unlock 760ms var(--ease-out-strong) both; }
@keyframes m-unlock {
  0% { filter: blur(5px) saturate(0.7); opacity: 0.55; transform: scale(0.995); }
  100% { filter: none; opacity: 1; transform: none; }
}
.m-delayed-note {
  display: inline-flex; align-items: center; gap: var(--s-2);
  font-size: var(--fs-2); color: var(--ink-3);
}
.m-delayed-note a { color: var(--accent); }

/* ---- Table ------------------------------------------------------------------ */
.m-table-wrap {
  position: relative;
  overflow: auto;
  max-width: 100%;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
}
.m-table-wrap[data-max-h] { max-height: var(--table-max-h, 520px); }
.m-table { width: 100%; font-size: var(--fs-3); color: var(--ink-2); font-variant-numeric: tabular-nums; }
.m-table caption { text-align: left; padding-bottom: var(--s-2); color: var(--ink-3); font-size: var(--fs-2); }
.m-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  height: 34px;
  padding: 0 var(--pad-cell-x);
  background: var(--surface-1);
  color: var(--ink-3);
  font-size: var(--fs-2);
  font-weight: var(--fw-medium);
  text-align: left;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 var(--line-2);
}
.m-card[data-variant="inset"] .m-table th { background: var(--surface-2); }
.m-table th[data-align="right"], .m-table td[data-align="right"] { text-align: right; }
.m-table th[data-align="center"], .m-table td[data-align="center"] { text-align: center; }
.m-table th button {
  display: inline-flex; align-items: center; gap: 4px; height: 100%;
  color: inherit; font: inherit; cursor: pointer; white-space: nowrap;
}
.m-table th[data-align="right"] button { flex-direction: row-reverse; }
.m-table th button .m-icon { --icon-size: 12px; opacity: 0; transition: opacity var(--dur-1); }
@media (hover: hover) { .m-table th button:hover { color: var(--ink-1); } .m-table th button:hover .m-icon { opacity: 0.6; } }
.m-table th[aria-sort="ascending"], .m-table th[aria-sort="descending"] { color: var(--ink-1); }
.m-table th[aria-sort="ascending"] .m-icon, .m-table th[aria-sort="descending"] .m-icon { opacity: 1; color: var(--accent); }
.m-table td {
  height: 38px;
  padding: var(--pad-cell-y) var(--pad-cell-x);
  border-bottom: 1px solid var(--line-1);
  vertical-align: middle;
  line-height: 1.35;
}
.m-table[data-density="compact"] td { height: 30px; padding-block: 4px; }
.m-table tbody tr:last-child td { border-bottom: 0; }
.m-table td.num, .m-table td[data-num] { font-family: var(--font-mono); font-size: calc(var(--fs-3) - 0.5px); color: var(--ink-1); white-space: nowrap; }
.m-table td:first-child, .m-table th:first-child { padding-left: var(--s-1); }
.m-table td:last-child, .m-table th:last-child { padding-right: var(--s-1); }
.m-card:not([data-flush]) .m-table td:first-child, .m-card:not([data-flush]) .m-table th:first-child { padding-left: 0; }
.m-card:not([data-flush]) .m-table td:last-child, .m-card:not([data-flush]) .m-table th:last-child { padding-right: 0; }
.m-card[data-flush] .m-table td:first-child, .m-card[data-flush] .m-table th:first-child { padding-left: var(--pad-card); }
.m-card[data-flush] .m-table td:last-child, .m-card[data-flush] .m-table th:last-child { padding-right: var(--pad-card); }
.m-table td.strong, .m-table td[data-strong] { color: var(--ink-1); font-weight: var(--fw-medium); }
.m-table tr[data-clickable] { cursor: pointer; }
@media (hover: hover) { .m-table tbody tr[data-clickable]:hover td { background: var(--surface-2); } }
.m-table tr[aria-selected="true"] td { background: var(--accent-soft); }
.m-table tr[aria-selected="true"] td:first-child { box-shadow: inset 2px 0 0 var(--accent); }
.m-table tr:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.m-table tr[data-spacer] td { height: auto; padding: 0; border: 0; }
.m-table tr[data-muted] td { color: var(--ink-4); }
.m-table-empty { padding: var(--s-6) 0; text-align: center; color: var(--ink-3); }

/* ---- Charts: shared ------------------------------------------------------------ */
.m-chart { position: relative; min-width: 0; color: var(--ink-3); }
.m-chart svg { overflow: visible; display: block; }
.m-chart text, .m-axis-label { font-family: var(--font-mono); font-size: 11px; fill: var(--ink-4); }
.m-chart .grid { stroke: var(--chart-grid); stroke-width: 1; shape-rendering: crispEdges; }
.m-chart .axis { stroke: var(--chart-axis); stroke-width: 1; shape-rendering: crispEdges; }

.m-spark { display: block; overflow: visible; }
.m-spark .line { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.m-spark .area { stroke: none; }
.m-spark .base { stroke: var(--chart-axis); stroke-width: 1; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }
.m-spark .dot { fill: currentColor; stroke: var(--surface-1); stroke-width: 1.5; }

/* Vertical bars (percentage geometry: crisp at any width) */
.m-bars { position: relative; display: block; width: 100%; }
.m-bars .bar { fill: currentColor; }
.m-bars .bar[data-muted] { opacity: 0.35; }
.m-bars .val { fill: var(--ink-2); font-size: 11px; }
.m-bars .lab { fill: var(--ink-3); font-size: 11px; }
.m-bars .ann { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 2 2; }
.m-bars .ann-lab { fill: var(--accent); font-family: var(--font-sans); font-size: 10.5px; font-weight: 600; }
/* Horizontal bars (HTML) */
.m-hbars { display: grid; grid-template-columns: minmax(0, max-content) minmax(60px, 1fr) auto; align-items: center; gap: var(--s-2) var(--s-3); }
.m-hbar-label { font-size: var(--fs-3); color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 22ch; }
.m-hbar-track { height: 8px; border-radius: var(--r-xs); background: var(--line-1); overflow: hidden; }
.m-hbar-fill { display: block; height: 100%; border-radius: var(--r-xs); background: currentColor; min-width: 2px; transform-origin: left; }
.m-hbar-val { font-family: var(--font-mono); font-size: var(--fs-3); color: var(--ink-1); text-align: right; white-space: nowrap; }

/* Meter */
.m-meter { display: flex; flex-direction: column; gap: var(--s-1_5); min-width: 0; }
.m-meter-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-2); }
.m-meter-track { position: relative; height: 6px; border-radius: var(--r-pill); background: var(--line-1); }
.m-meter-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: var(--r-pill); background: currentColor; min-width: 3px; }
.m-meter-tick { position: absolute; top: -4px; bottom: -4px; width: 2px; margin-left: -1px; background: var(--ink-3); border-radius: 1px; }
.m-meter-tick[data-tone="warn"] { background: var(--warn); }
.m-meter-tick[data-tone="down"] { background: var(--down); }
.m-meter-tick[data-tone="up"] { background: var(--up); }
.m-meter-ticks { position: relative; height: 16px; font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); }
.m-meter-ticks span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.m-meter-ticks span:first-child[data-edge] { transform: none; }

/* Gauge (semicircle) */
.m-gauge { position: relative; width: 100%; max-width: 220px; aspect-ratio: 2 / 1.12; }
.m-gauge svg { width: 100%; height: auto; }
.m-gauge .track { fill: none; stroke: var(--line-2); stroke-linecap: round; }
.m-gauge .value { fill: none; stroke: currentColor; stroke-linecap: round; transition: stroke-dashoffset var(--dur-3) var(--ease-out); }
.m-gauge .tick { stroke: var(--ink-3); stroke-width: 2; stroke-linecap: round; }
.m-gauge-center { position: absolute; left: 0; right: 0; bottom: 4%; display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* Calendar heat */
.m-heat { overflow-x: auto; scrollbar-width: thin; }
.m-heat rect.cell { rx: 2px; shape-rendering: geometricPrecision; }
.m-heat .h0 { fill: var(--heat-0); } .m-heat .h1 { fill: var(--heat-1); } .m-heat .h2 { fill: var(--heat-2); }
.m-heat .h3 { fill: var(--heat-3); } .m-heat .h4 { fill: var(--heat-4); }
.m-heat .today { stroke: var(--ink-1); stroke-width: 1.2; }
.m-heat-legend { display: flex; align-items: center; gap: 4px; justify-content: flex-end; font-size: var(--fs-2); color: var(--ink-3); margin-top: var(--s-2); }
.m-heat-legend i { width: 10px; height: 10px; border-radius: 2px; display: block; }

/* Timeline (vertical agenda) */
.m-tl { display: flex; flex-direction: column; list-style: none; padding: 0; margin: 0; }
.m-tl-month { padding: var(--s-4) 0 var(--s-2); position: sticky; top: calc(var(--strip-h)); z-index: 1; background: linear-gradient(var(--tl-bg, var(--surface-1)) 70%, transparent); }
.m-tl-month:first-child { padding-top: 0; }
.m-tl-item {
  display: grid;
  grid-template-columns: 52px 18px minmax(0, 1fr);
  column-gap: var(--s-2);
  position: relative;
  padding: var(--s-2) 0 var(--s-3);
}
.m-tl-date { text-align: right; padding-top: 1px; }
.m-tl-day { display: block; font-family: var(--font-mono); font-size: var(--fs-5); font-weight: 500; color: var(--ink-1); line-height: 1.1; }
.m-tl-dow { display: block; font-size: var(--fs-1); text-transform: uppercase; letter-spacing: var(--track-micro); color: var(--ink-4); font-weight: 600; margin-top: 2px; }
.m-tl-prec { display: block; font-size: var(--fs-2); color: var(--ink-3); line-height: 1.25; }
.m-tl-rail { position: relative; display: flex; justify-content: center; }
.m-tl-rail::before { content: ""; position: absolute; top: 0; bottom: calc(var(--s-3) * -1); width: 1px; background: var(--line-2); }
.m-tl-item:last-child .m-tl-rail::before { bottom: auto; height: 12px; }
.m-tl-node { position: relative; z-index: 1; width: 11px; height: 11px; margin-top: 4px; border-radius: 50%; background: var(--surface-1); box-shadow: inset 0 0 0 2px currentColor; color: var(--ink-3); }
.m-tl-node[data-tier="confirmed"] { background: currentColor; box-shadow: 0 0 0 3px var(--tl-bg, var(--surface-1)); }
.m-tl-node[data-tier="expected"] { box-shadow: inset 0 0 0 2px currentColor, 0 0 0 3px var(--tl-bg, var(--surface-1)); }
.m-tl-node[data-tier="watch"] { background: transparent; box-shadow: none; border: 1.5px dashed currentColor; }
.m-tl-node[data-tier="completed"] { background: var(--line-2); box-shadow: 0 0 0 3px var(--tl-bg, var(--surface-1)); color: var(--ink-4); }
.m-tl-body { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.m-tl-title { color: var(--ink-1); font-size: var(--fs-4); font-weight: var(--fw-medium); line-height: 1.4; }
.m-tl-title a { color: inherit; text-decoration: none; }
@media (hover: hover) { .m-tl-title a:hover { text-decoration: underline; text-decoration-color: var(--line-3); } }
.m-tl-why { font-size: var(--fs-3); color: var(--ink-3); line-height: 1.5; }
.m-tl-meta { display: flex; flex-wrap: wrap; gap: var(--s-1_5); align-items: center; }
.m-tl-item[data-tier="completed"] .m-tl-title { color: var(--ink-3); }
.m-tl-item[data-today]::after { content: ""; position: absolute; left: 0; right: 0; top: 0; border-top: 1px dashed var(--accent-line); }

/* Timeline strip (horizontal, dated window) */
.m-strip { position: relative; padding-top: 4px; }
.m-strip-axis { position: relative; height: 1px; background: var(--line-2); margin: 0 6px; }
.m-strip-ticks { position: relative; height: 22px; margin: 0 6px; }
.m-strip-tick { position: absolute; top: 6px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.m-strip-tick::before { content: ""; position: absolute; left: 50%; top: -9px; height: 5px; width: 1px; background: var(--line-3); }
.m-strip-lanes { position: relative; margin: 0 6px; }
.m-strip-ev {
  position: absolute;
  display: flex; align-items: flex-start; gap: 6px;
  max-width: var(--lw, 25%);
  text-decoration: none;
  color: var(--ink-2);
  font-size: var(--fs-2);
  line-height: 1.3;
}
.m-strip-ev::before { content: ""; position: absolute; left: 4px; top: 12px; height: var(--stem, 0px); width: 1px; background: var(--line-2); }
.m-strip-ev[data-align="right"]::before { left: auto; right: 4px; }
.m-strip-mark { flex: none; width: 9px; height: 9px; margin-top: 2px; border-radius: 50%; background: currentColor; color: var(--ink-3); box-shadow: 0 0 0 2px var(--surface-1); }
.m-strip-ev[data-tier="expected"] .m-strip-mark { background: var(--surface-1); box-shadow: inset 0 0 0 2px currentColor, 0 0 0 2px var(--surface-1); }
.m-strip-ev[data-tier="watch"] .m-strip-mark { background: transparent; border: 1.5px dashed currentColor; box-shadow: none; }
.m-strip-ev-text { display: flex; flex-direction: column; min-width: 0; }
.m-strip-ev-date { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); }
.m-strip-ev-title { color: var(--ink-1); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
@media (hover: hover) { a.m-strip-ev:hover .m-strip-ev-title { text-decoration: underline; text-decoration-color: var(--line-3); } }
.m-strip-today { position: absolute; top: -6px; bottom: 0; width: 0; border-left: 1px dashed var(--accent-line); }
.m-strip-today span { position: absolute; top: -14px; left: 0; transform: translateX(-50%); font-size: var(--fs-1); font-weight: 600; letter-spacing: var(--track-micro); text-transform: uppercase; color: var(--accent); }

/* Gantt / ranges */
.m-gantt { display: grid; grid-template-columns: minmax(96px, max-content) minmax(0, 1fr); gap: 0 var(--s-3); align-items: center; }
.m-gantt-head { grid-column: 2; position: relative; height: 22px; border-bottom: 1px solid var(--line-1); }
.m-gantt-head span { position: absolute; bottom: 5px; transform: translateX(-50%); font-family: var(--font-mono); font-size: 11px; color: var(--ink-4); white-space: nowrap; }
.m-gantt-label { font-size: var(--fs-3); color: var(--ink-2); padding: var(--s-2) 0; line-height: 1.3; }
.m-gantt-track { position: relative; height: 34px; border-bottom: 1px solid var(--line-1); }
.m-gantt-bar {
  position: absolute; top: 9px; height: 16px;
  border-radius: var(--r-xs);
  background: color-mix(in srgb, currentColor 22%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, currentColor 60%, transparent);
  min-width: 3px;
}
.m-gantt-bar[data-style="solid"] { background: currentColor; box-shadow: none; }
.m-gantt-bar[data-style="dashed"] { background: transparent; box-shadow: none; border: 1px dashed currentColor; }
.m-gantt-bar-label { position: absolute; left: 6px; top: 50%; transform: translateY(-50%); font-size: 11px; color: var(--ink-1); white-space: nowrap; font-family: var(--font-mono); pointer-events: none; }
.m-gantt-mark { position: absolute; top: 6px; bottom: 6px; width: 2px; margin-left: -1px; background: currentColor; border-radius: 1px; }
.m-gantt-today { position: absolute; top: 0; bottom: 0; border-left: 1px dashed var(--accent-line); pointer-events: none; }

/* ---- Command palette ---------------------------------------------------- */
.m-palette {
  width: min(640px, calc(100vw - 24px));
  margin: 12vh auto auto;
  padding: 0;
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  background: var(--surface-3);
  color: var(--ink-2);
  box-shadow: var(--shadow-3), var(--rim);
  overflow: hidden;
  transition: opacity var(--dur-1) var(--ease-out), transform 360ms var(--ease-spring);
  transform-origin: top center;
}
.m-palette::backdrop { background: var(--scrim); transition: opacity var(--dur-1) var(--ease-out); }
.m-palette[data-starting] { opacity: 0; transform: scale(0.97) translateY(-4px); }
.m-palette[data-starting]::backdrop, .m-palette[data-ending]::backdrop { opacity: 0; }
.m-palette[data-ending] { opacity: 0; transform: scale(0.985); transition-duration: 120ms; transition-timing-function: var(--ease-exit); }
@media (max-width: 719px) { .m-palette { margin-top: calc(var(--safe-t) + 8px); max-height: calc(100dvh - 16px); } }
.m-palette-input-row { display: flex; align-items: center; gap: var(--s-3); padding: 0 var(--s-4); height: 54px; border-bottom: 1px solid var(--line-1); }
.m-palette-input-row .m-icon { color: var(--ink-3); --icon-size: 18px; }
.m-palette-input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent;
  color: var(--ink-1); font-size: var(--fs-5);
}
.m-palette-input::placeholder { color: var(--ink-4); }
.m-palette-input:focus-visible { outline: none; }
.m-palette-list { max-height: min(56vh, 480px); overflow: auto; padding: var(--s-1_5); overscroll-behavior: contain; scroll-padding: 28px 0 6px; }
.m-palette-group { padding: var(--s-2_5) var(--s-2_5) var(--s-1); }
.m-palette-item {
  position: relative;
  display: flex; align-items: center; gap: var(--s-3);
  min-height: 40px;
  padding: var(--s-1_5) var(--s-2_5);
  border-radius: var(--r-sm);
  cursor: pointer;
  color: var(--ink-1);
}
.m-palette-item .m-icon { color: var(--ink-3); --icon-size: 17px; }
.m-palette-item[aria-selected="true"] { background: var(--line-1); }
.m-palette-item[aria-selected="true"]::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.m-palette-item[aria-selected="true"] .m-icon { color: var(--ink-1); }
.m-palette-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.m-palette-title { font-size: var(--fs-4); line-height: 1.35; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-palette-title mark { background: none; color: var(--accent); font-weight: var(--fw-semibold); }
.m-palette-sub { font-size: var(--fs-2); color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m-palette-meta { flex: none; display: flex; align-items: center; gap: var(--s-2); color: var(--ink-4); font-size: var(--fs-2); }
.m-palette-empty { padding: var(--s-8) var(--s-4); text-align: center; color: var(--ink-3); font-size: var(--fs-3); }
.m-palette-foot { display: flex; align-items: center; gap: var(--s-4); padding: 0 var(--s-4); height: 38px; border-top: 1px solid var(--line-1); background: var(--surface-2); font-size: var(--fs-2); color: var(--ink-3); }
.m-palette-foot .m-kbd { height: 1.15rem; min-width: 1.15rem; font-size: 11px; }
.m-palette-foot span { display: inline-flex; align-items: center; gap: 6px; }
@media (max-width: 719px) { .m-palette-foot { display: none; } }

/* ---- Markdown-lite ----------------------------------------------------------- */
.m-md { color: var(--ink-2); }
.m-md > * + * { margin-top: 0.8em; }
.m-md h2, .m-md h3, .m-md h4 { font-family: var(--font-serif); color: var(--ink-1); font-weight: 560; letter-spacing: var(--track-tight); margin-top: 1.4em; }
.m-md h2 { font-size: var(--fs-7); }
.m-md h3 { font-size: var(--fs-6); }
.m-md h4 { font-size: var(--fs-5); }
.m-md ul, .m-md ol { padding-left: 1.3em; }
.m-md li + li { margin-top: 0.35em; }
.m-md li::marker { color: var(--ink-4); }
.m-md blockquote { border-left: 2px solid var(--accent-line); padding-left: var(--s-4); color: var(--ink-1); }
.m-md em { font-style: normal; color: var(--ink-1); }
.m-md code { padding: 1px 5px; border-radius: var(--r-xs); background: var(--surface-2); border: 1px solid var(--line-1); font-size: 0.86em; color: var(--ink-1); }
.m-md a { color: var(--ink-1); text-decoration-color: var(--accent-line); }
.m-md a:hover { text-decoration-color: var(--accent); }
.m-md hr { margin: 1.6em 0; }
.m-md sup a { text-decoration: none; color: var(--accent); font-family: var(--font-mono); font-size: 0.75em; }

/* ---- Section header (inside views) ------------------------------------------ */
.m-section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.m-section-head .t-kicker { display: block; margin-bottom: 6px; }

/* ---- View header (every view starts with one) ------------------------------- */
.m-viewhead { display: flex; flex-direction: column; gap: var(--s-3); padding: var(--s-8) 0 var(--s-6); }
.m-viewhead-top { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; }
.m-viewhead-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-4) var(--s-6); flex-wrap: wrap; }
.m-viewhead h1 { outline: none; }
.m-viewhead-actions { display: flex; align-items: center; gap: var(--s-2); flex-wrap: wrap; }
@media (max-width: 719px) { .m-viewhead { padding: var(--s-5) 0 var(--s-4); } }

/* Key/value list (telemetry rows) */
.m-kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0; margin: 0; }
.m-kv > dt, .m-kv > dd { padding: 7px 0; border-bottom: 1px solid var(--line-1); margin: 0; font-size: var(--fs-3); line-height: 1.4; }
.m-kv > dt { color: var(--ink-3); }
.m-kv > dd { color: var(--ink-1); text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; padding-left: var(--s-4); }
.m-kv > dt:nth-last-of-type(1), .m-kv > dd:nth-last-of-type(1) { border-bottom: 0; }

}

@layer kit {
/* ---- Area chart (uPlot) -------------------------------------------------- */
.m-area { position: relative; }
.m-area .uplot { font-family: var(--font-mono); }
.m-area .u-over, .m-area .u-under { border-radius: var(--r-xs); }
.m-area .u-cursor-x, .m-area .u-cursor-y { border-color: var(--line-3) !important; } /* sanctioned: override uPlot inline-styled defaults */
.m-area .u-cursor-y { display: none; }
.m-area-readout {
  position: absolute; top: 0; left: 64px; z-index: 2;
  display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap;
  font-size: var(--fs-2); color: var(--ink-2);
  opacity: 0; transition: opacity var(--dur-1) var(--ease-out);
  pointer-events: none;
}
.m-area-readout[data-on] { opacity: 1; }
.m-area-readout span { display: inline-flex; align-items: center; gap: 5px; }
.m-area-readout i { width: 8px; height: 2px; border-radius: 1px; display: inline-block; }
.m-area-readout b { color: var(--ink-1); font-weight: 500; }

/* Tables: column hiding by container width (cards are containers) */
@container (max-width: 560px) { .m-table .hide-sm { display: none; } }
@container (max-width: 760px) { .m-table .hide-md { display: none; } }

/* Strip: collapse to list on narrow containers */
.m-strip-list { display: none; }
@container (max-width: 560px) {
  .m-strip { display: none; }
  .m-strip-list { display: flex; }
}
}

/* Colour helpers: utilities layer so they beat component defaults. */
@layer utilities {
  .tone-ink { color: var(--ink-2); }
  .tone-up { color: var(--up); }
  .tone-down { color: var(--down); }
  .tone-warn { color: var(--warn); }
  .tone-live { color: var(--live); }
  .tone-accent { color: var(--accent); }
  .tone-model { color: var(--model); }
  .tone-muted { color: var(--ink-4); }
  .cat-1 { color: var(--cat-1); } .cat-2 { color: var(--cat-2); } .cat-3 { color: var(--cat-3); }
  .cat-4 { color: var(--cat-4); } .cat-5 { color: var(--cat-5); } .cat-6 { color: var(--cat-6); }
}

@layer kit {
/* Tier chip: glyph + word (confirmed solid, expected ring, watch dashed, completed check) */
.m-tier { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 7px; border-radius: var(--r-sm); border: 1px solid var(--line-2); font-size: var(--fs-2); font-weight: var(--fw-medium); color: var(--ink-2); white-space: nowrap; }
.m-tier i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.m-tier[data-tier="confirmed"] { color: var(--ink-1); border-color: var(--line-3); }
.m-tier[data-tier="confirmed"] i { background: var(--ink-1); }
.m-tier[data-tier="expected"] i { box-shadow: inset 0 0 0 1.5px currentColor; }
.m-tier[data-tier="watch"] { border-style: dashed; color: var(--ink-3); }
.m-tier[data-tier="watch"] i { border: 1.5px dashed currentColor; }
.m-tier[data-tier="completed"] { color: var(--ink-3); border-color: var(--line-1); }
.m-tier[data-tier="completed"] .m-icon { --icon-size: 11px; --icon-stroke: 2.4; }
}

@layer kit {
/* ---- Touch targets: 44px on touch devices and below 800px (spec §2) ----------- */
@media (pointer: coarse), (max-width: 799px) {
  :root { --control-h: 2.75rem; --control-h-sm: 2.75rem; }
  .m-iconbtn { --btn-h: 44px; }
  .m-iconbtn[data-size="sm"] { --btn-h: 44px; }
  .m-tab { height: 44px; }
  .m-seg-opt { min-height: 44px; }
  button.m-chip { height: 44px; }
  .m-prov { padding: 12px 2px; margin: -12px -2px; }
  .m-switch { width: 44px; height: 44px; margin: -12px -5px -12px -5px; }
  .m-switch::before { left: 5px; top: 12px; }
  .m-switch::after { left: 7px; top: 14px; }
  .m-card-title a, .m-tl-title a { display: inline-block; padding: 12px 0; margin: -12px 0; }
  .m-table td { height: 44px; }
  .m-menu-item { min-height: 44px; }
  .m-btn[data-variant="link"] { min-height: 44px; }
  .m-card-foot a { display: inline-flex; align-items: center; min-height: 44px; }
  .m-card-foot { padding-top: var(--s-1); }
  .m-delayed-note a, .m-prov-src a, .m-md a { display: inline-block; padding: 14px 0; margin: -14px 0; }
}
}
