/* Meet Day (meet.html, js/meet-day.js). Builds on tools.css (cards, fields,
   segments). Referee lights and missed attempts keep fixed white and red:
   they mean the same whatever app colour the lifter picks. */
.md-wrap { max-width: 760px; }
.md-mode { margin-bottom: 12px; }
#meetDay { display: grid; gap: 12px; }
#meetDay > .card { margin: 0; }
.md-h { margin: 0 0 8px; font-size: 1.05rem; color: var(--text); }
.md-credit { margin: 4px 2px 0; color: var(--text-faint); font-size: .78rem; }
.md-credit a, .md-save-msg a { color: var(--accent-hi); }

/* finding a meet or a lifter */
.md-search { margin-bottom: 8px; }
.md-search input { width: 100%; }
.md-list { display: grid; gap: 6px; }
.md-list .tl-h { margin: 10px 0 2px; }
.md-item { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 52px; padding: 10px 12px;
  border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text); text-align: left; cursor: pointer; font: inherit; }
.md-item:hover { border-color: var(--accent-line); }
.md-item:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.md-item strong { font-size: .95rem; }
.md-item small, .md-pick small { color: var(--text-dim); font-size: .8rem; }
.md-pick { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); }
.md-pick > div:first-child { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.md-pick-b { display: flex; gap: 6px; }
.md-pick-b .btn { min-height: 40px; padding: .4rem .8rem; font-size: .85rem; }

/* the meet and its platform */
.md-meet-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.md-meet .tl-dim { margin: 0; }
.md-meet-acts { display: flex; gap: 16px; flex-wrap: wrap; margin-top: 6px; }
.md-meet-acts .text-link { display: inline-flex; align-items: center; gap: 4px; min-height: 40px; background: none; border: 0; padding: 0;
  font: inherit; font-weight: 600; color: var(--accent-hi); cursor: pointer; text-decoration: none; }
.md-meet-acts svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-conn { display: inline-flex; align-items: center; gap: 6px; flex: none; padding: 4px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  color: var(--text-dim); background: var(--surface-2); }
.md-conn svg { width: 10px; height: 10px; fill: currentColor; }
.md-conn.live { color: var(--ok-hi); }
.md-conn.live svg { animation: md-pulse 1.8s ease-in-out infinite; }
.md-conn.reconnecting { color: var(--warn); }
@keyframes md-pulse { 50% { opacity: .35; } }
.md-now-k { margin: 0; color: var(--text-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; }
.md-now-l { margin: 4px 0 8px; color: var(--text); }
.md-now-l strong { font-size: 1.1rem; }
.md-now-l span { color: var(--text-dim); }
.md-last { margin: 0; color: var(--text-dim); font-size: .85rem; display: flex; align-items: center; flex-wrap: wrap; gap: 6px; }

/* referee lights */
.md-lights { display: inline-flex; gap: 8px; align-items: center; }
.md-light { position: relative; width: 30px; height: 30px; border-radius: 50%; border: 2px solid #3f3f46; background: #18181b; flex: none; }
.md-light.w { background: #fafafa; border-color: #fafafa; box-shadow: 0 0 12px rgba(255, 255, 255, .45); }
.md-light.r { background: #dc2626; border-color: #dc2626; box-shadow: 0 0 12px rgba(220, 38, 38, .55); }
.md-lights.sm { gap: 3px; }
.md-lights.sm .md-light { width: 9px; height: 9px; border-width: 1px; box-shadow: none; }
.md-cards { position: absolute; left: 50%; bottom: -9px; transform: translateX(-50%); display: flex; gap: 2px; }
.md-cards b { width: 8px; height: 6px; border-radius: 1px; }
.md-lights.sm .md-cards { bottom: -6px; }
.md-lights.sm .md-cards b { width: 4px; height: 3px; }
.c-red { background: #dc2626; } .c-blue { background: #2563eb; } .c-yellow { background: #eab308; }

/* a followed lifter */
.md-lifter.me { border-color: var(--accent-line); }
.md-l-top { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.md-l-name { margin: 0; font-size: 1.15rem; color: var(--text); }
.md-l-top .tl-dim { margin: 2px 0 0; font-size: .8rem; }
.md-me { display: inline-block; vertical-align: middle; margin-left: 4px; padding: 2px 8px; border-radius: 999px; font-size: .7rem; font-weight: 800;
  background: var(--accent-soft); color: var(--accent-hi); }
.md-x { width: 40px; height: 40px; flex: none; display: grid; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--text-faint); cursor: pointer; }
.md-x:hover { background: var(--surface-2); color: var(--text); }
.md-x svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.md-status { margin: 10px 0 12px; padding: 12px 14px; border-radius: var(--radius-md); background: var(--surface-2); }
.md-status.soon { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.md-status .tl-dim { margin: 4px 0 0; font-size: .8rem; }
.md-big { margin: 0; font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1.15; font-variant-numeric: tabular-nums; }
.md-big span { display: inline-block; font-size: .95rem; font-weight: 600; color: var(--text-dim); }
.md-next { margin: 6px 0 0; color: var(--text); font-weight: 600; }

/* attempts table */
.md-grid { width: 100%; border-collapse: separate; border-spacing: 4px; font-variant-numeric: tabular-nums; margin: 0 -4px; }
.md-grid th { color: var(--text-faint); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; text-align: center; padding: 0 2px; }
.md-grid tbody th { text-align: left; color: var(--text-dim); font-size: .78rem; text-transform: none; letter-spacing: 0; width: 64px; }
.md-att { position: relative; text-align: center; padding: 6px 2px 9px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border); vertical-align: top; }
.md-att .md-w { display: block; font-weight: 800; color: var(--text); font-size: .95rem; }
.md-att .md-lights { margin-top: 4px; }
.md-att.good { background: rgba(34, 197, 94, .14); border-color: rgba(34, 197, 94, .5); }
.md-att.bad { background: rgba(220, 38, 38, .14); border-color: rgba(220, 38, 38, .5); }
.md-att.bad .md-w { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgba(248, 113, 113, .8); }
.md-att.none .md-w { color: var(--text-faint); }
.md-att.next { box-shadow: inset 0 0 0 2px var(--accent-hi); }
.md-jury { position: absolute; top: -7px; right: -4px; padding: 1px 5px; border-radius: 6px; background: #eab308; color: #18181b; font-size: .6rem; font-weight: 800; }
.md-best { text-align: center; font-weight: 800; color: var(--text); }
.md-totals { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 10px 0 4px; color: var(--text-dim); font-size: .88rem; }
.md-totals strong { color: var(--text); font-variant-numeric: tabular-nums; }

/* places and what's needed */
.md-place { margin-top: 6px; }
.md-placing { margin: 0 0 6px; color: var(--text-dim); }
.md-placing strong { color: var(--text); font-size: 1.05rem; }
.md-need-h { margin: 6px 0 4px; font-size: .8rem; }
.md-needs { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.md-needs li { display: flex; gap: 10px; align-items: baseline; padding: 8px 10px; border-radius: var(--radius-sm); background: var(--surface-2); color: var(--text); font-size: .92rem; }
.md-needs small { display: block; color: var(--text-faint); font-size: .76rem; }
.md-pl { flex: none; min-width: 34px; font-weight: 800; color: var(--accent-hi); }
.md-table summary { cursor: pointer; color: var(--accent-hi); font-weight: 600; font-size: .88rem; min-height: 40px; display: flex; align-items: center; }
.md-table .tl-table { margin-top: 2px; }
.md-row-me td { color: var(--accent-hi); font-weight: 700; }

/* next attempt and warm-ups */
.md-help, .md-warm, .md-save { margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--border); }
.md-help .tl-dim, .md-warm .tl-dim, .md-save .tl-dim { margin: 0 0 8px; }
.md-feel button { min-height: 40px; font-weight: 700; }
.md-picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 10px 0 6px; }
.md-picks div { padding: 10px 12px; border-radius: var(--radius-sm); background: var(--surface-2); }
.md-picks small { display: block; color: var(--text-faint); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.md-picks strong { font-size: 1.2rem; color: var(--text); font-variant-numeric: tabular-nums; }
.md-wu { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.md-wu li { display: grid; grid-template-columns: auto 1fr auto; align-items: baseline; gap: 10px; padding: 8px 10px; border-radius: var(--radius-sm);
  background: var(--surface-2); color: var(--text); font-variant-numeric: tabular-nums; }
.md-wu li span { color: var(--text-dim); font-size: .85rem; }
.md-wu li small { color: var(--text-faint); font-size: .78rem; white-space: nowrap; }
.md-wu li.past { opacity: .5; }
.md-wu li.due { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.md-wu li.due small { color: var(--accent-hi); font-weight: 700; }
.md-save .btn { width: 100%; }
.md-recap { margin-top: 12px; }
.md-recap .btn { width: 100%; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; }
.md-recap svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* alerts and screen */
.md-tools { display: grid; gap: 8px; }
.md-switch { display: flex; align-items: center; justify-content: space-between; gap: 12px; cursor: pointer; }
.md-switch > span { display: flex; align-items: center; gap: 12px; order: -1; }
.md-switch > span > svg { width: 22px; height: 22px; flex: none; fill: none; stroke: var(--text-dim); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.md-switch strong { display: block; color: var(--text); font-size: .95rem; }
.md-switch small { color: var(--text-faint); font-size: .8rem; }
.md-alert { position: fixed; left: 50%; bottom: calc(var(--tabbar-h, 64px) + 14px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 40;
  width: min(520px, calc(100% - 32px)); padding: 14px 16px; border-radius: var(--radius-md); background: var(--accent); color: var(--on-accent, #fff);
  font-weight: 700; box-shadow: var(--shadow-2); }

/* manual mode */
.md-mrow { display: flex; align-items: center; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.md-mn { width: 18px; color: var(--text-faint); font-weight: 700; }
.md-mrow input[data-m="w"] { width: 84px; min-width: 0; min-height: 44px; padding: 0 10px; border-radius: var(--radius-sm); border: 1px solid var(--border);
  background: var(--surface-2); color: var(--text); font: inherit; font-weight: 700; }
.md-mlights { display: inline-flex; gap: 6px; }
.md-mlights .md-light { width: 34px; height: 34px; cursor: pointer; padding: 0; }
.md-mlights .md-light:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.md-check { display: inline-flex; align-items: center; gap: 6px; color: var(--text-dim); font-size: .82rem; min-height: 44px; cursor: pointer; }
.md-mjury { min-height: 36px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: transparent; color: var(--text-faint);
  font: inherit; font-size: .78rem; font-weight: 700; cursor: pointer; }
.md-mjury[aria-pressed="true"] { background: #eab308; border-color: #eab308; color: #18181b; }
.md-mjury:focus-visible { outline: 2px solid var(--accent-hi); outline-offset: 2px; }
.md-check { flex: 1 1 220px; }
.md-mout { margin-top: 10px; }
.md-step { display: flex; gap: 6px; }
.md-step input { flex: 1; min-width: 0; text-align: center; }
.md-step button { width: 44px; min-height: 44px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--surface-2); color: var(--text);
  font-size: 1.2rem; font-weight: 700; cursor: pointer; }

@media (max-width: 480px) {
  .md-grid tbody th { width: 52px; }
  .md-att .md-w { font-size: .88rem; }
  .md-big { font-size: 1.4rem; }
  .md-pick-b { width: 100%; }
  .md-pick-b .btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .md-conn.live svg { animation: none; } }
