/* TE Live shared design system v323. Append after V316 and V318.
   Fonts, theme ownership, data and component layouts remain with their existing modules. */
:root[data-live-appearance="v316"] {
  --live-font: "Geist Mono TRS", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --live-space-1: 4px;
  --live-space-2: 8px;
  --live-space-3: 12px;
  --live-space-4: 16px;
  --live-space-5: 24px;
  --live-space-6: 32px;
  --live-brand-size: 14px;
  --live-title-size: clamp(20px, 2.3vw, 26px);
  --live-control-size: 44px;
  --live-icon-size: 18px;
  --live-icon-stroke: 1.4;
  --live-radius-control: 10px;
  --live-radius-panel: 18px;
  --live-focus-width: 2px;
  --live-paper: #090404;
  --live-ink: #f5f1f1;
  --live-muted: #bfb5b6;
  --live-accent: #ef4b55;
  --live-soft: rgba(255,255,255,.055);
}
:root[data-live-appearance="v316"][data-theme="trs"] {
  --live-paper: #ffffff;
  --live-ink: #202124;
  --live-muted: #596066;
  --live-accent: #b82b37;
  --live-soft: #f1f2f3;
}
/* Only the known branding layer, never a card title or content image. */
:root[data-live-appearance="v316"] [data-live-brand-layer="visible"] {
  font-size: var(--live-brand-size) !important;
  font-weight: 500 !important;
  line-height: 1.2 !important;
  letter-spacing: .055em !important;
  text-transform: uppercase;
  gap: 8px !important;
}
:root[data-live-appearance="v316"] [data-live-brand-layer="visible"] .te-logo {
  display: inline-block !important;
  flex: 0 0 44px !important;
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 28px !important;
  min-height: 28px !important;
  max-height: 28px !important;
  margin: 0 !important;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
}
:root[data-live-appearance="v316"][data-theme="trs"] [data-live-brand-layer="visible"] .te-logo {
  background-size: calc(100% - 6px) auto;
}
/* 44px hit target, 18px drawing: existing button elements/listeners remain intact. */
:root[data-live-appearance="v316"] button[data-live-theme-control] {
  width: 44px !important;
  min-width: 44px !important;
  max-width: 44px !important;
  height: 44px !important;
  min-height: 44px !important;
  border-radius: var(--live-radius-control) !important;
}
:root[data-live-appearance="v316"] :is([data-live-theme-icon], [data-live-mono-icon]) {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 1.4;
  flex: none;
}
:root[data-live-appearance="v316"] :is(header.top, #workout-header) {
  min-height: 56px;
  gap: 12px;
  padding-block: 12px;
}
/* Explicit page-header hook; never a blanket h1/h2/card-title override. */
:root[data-live-appearance="v316"] [data-live-page-header] {
  margin-block: 20px 16px;
}
:root[data-live-appearance="v316"] [data-live-page-header] > :is(h1, [data-live-page-title]) {
  margin: 0;
  font: 500 var(--live-title-size)/1.3 var(--live-font);
  letter-spacing: -.025em;
}
:root[data-live-appearance="v316"] [data-live-page-header] > p {
  margin: 8px 0 0;
  color: var(--live-muted);
  font-size: 13px;
  line-height: 1.55;
}
[data-live-pro-footer="v323"] {
  box-sizing: border-box;
  width: calc(100% - 32px);
  max-width: 1440px;
  margin: 40px auto 20px;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 20px;
  color: var(--live-muted, #bfb5b6);
  font: 400 12px/1.5 var(--live-font, "Geist Mono TRS", ui-monospace, monospace);
  background: transparent;
}
[data-live-pro-footer="v323"] a {
  display: inline-flex;
  box-sizing: border-box;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  max-width: 100%;
  padding: 8px 0;
  color: inherit;
  text-decoration: none;
  overflow-wrap: anywhere;
}
[data-live-pro-footer="v323"] a:hover { color: var(--live-ink, #f5f1f1); }
[data-live-pro-footer="v323"] a:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
  border-radius: 4px;
}
[data-live-pro-footer="v323"] svg {
  width: 18px;
  height: 18px;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.4;
}
@media (max-width: 600px) {
  [data-live-pro-footer="v323"] { margin-top: 24px; justify-content: flex-start; gap: 0 20px; }
}
