/* ────────────────────────────────────────────────────────────────────────────
 * Component styles. Imports nothing — depends on ds.css being loaded first.
 * Naming: BEM-lite. Domain components prefixed with mc- (medconnekt).
 * ────────────────────────────────────────────────────────────────────────────
 */

/* ── Buttons ──────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; min-height: 44px;
  font-family: var(--sans); font-weight: 600; font-size: 14px; letter-spacing: 0.01em;
  border-radius: var(--radius-pill);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out),
              color var(--dur-fast) var(--ease-out),
              border-color var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-fast) var(--ease-out),
              transform var(--dur-fast) var(--ease-out);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary {
  background: var(--berry-500); color: var(--on-berry);
  border-color: var(--berry-500);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: var(--berry-600); border-color: var(--berry-600); box-shadow: var(--shadow-md); }

.btn--secondary {
  background: var(--paper); color: var(--ink);
  border-color: var(--ink);
}
.btn--secondary:hover { background: var(--ink); color: var(--paper); }

.btn--ghost {
  background: transparent; color: var(--ink); border-color: var(--line);
}
.btn--ghost:hover { background: var(--cream-100); border-color: var(--cream-400); }

.btn--olive {
  background: var(--olive-500); color: var(--on-olive); border-color: var(--olive-500);
}
.btn--olive:hover { background: var(--olive-700); border-color: var(--olive-700); }

.btn--link { padding: 0; min-height: 0; border: 0; background: transparent; color: var(--berry-600); }
.btn--link:hover { color: var(--berry-700); }

.btn--lg { padding: 16px 28px; font-size: 15px; min-height: 52px; }
.btn--sm { padding: 8px 14px; font-size: 12px; min-height: 36px; }
.btn--icon { padding: 10px; aspect-ratio: 1; }

.btn--block { width: 100%; }

/* ── Inputs ───────────────────────────────────────────────────────────────── */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--olive-700);
}
.field .hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.field .error { font-size: 12px; color: var(--danger-text); margin-top: 2px; }

.input, .select, .textarea {
  appearance: none;
  width: 100%;
  padding: 13px 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-family: var(--sans); font-size: 15px;
  color: var(--ink);
  transition: border-color var(--dur-fast), box-shadow var(--dur-fast);
}
.input::placeholder, .textarea::placeholder { color: var(--muted); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--cream-400); }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--berry-500); outline: none;
  box-shadow: var(--ring-focus);
}
.input[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  border-color: var(--danger); box-shadow: var(--ring-danger);
}

.input--lg { padding: 16px 18px; font-size: 16px; }

.select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path d='M1 1l5 5 5-5' fill='none' stroke='%237A6E68' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}

.input-group {
  display: flex; align-items: stretch;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  overflow: hidden;
}
.input-group:focus-within { border-color: var(--berry-500); box-shadow: var(--ring-focus); }
.input-group .prefix, .input-group .suffix {
  display: inline-flex; align-items: center; padding: 0 14px;
  background: var(--cream-100); color: var(--muted); font-size: 13px;
  border-right: 1px solid var(--line);
}
.input-group .suffix { border-right: 0; border-left: 1px solid var(--line); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none !important; }

/* checkbox / radio (custom but native-fallback) */
.check, .radio {
  display: inline-flex; align-items: flex-start; gap: 10px;
  font-size: 14px; line-height: 1.4; cursor: pointer;
  padding: 4px 0;
}
.check input, .radio input { position: absolute; opacity: 0; pointer-events: none; }
.check .box, .radio .box {
  flex-shrink: 0; width: 20px; height: 20px;
  border: 1.5px solid var(--cream-400); background: var(--paper);
  display: inline-grid; place-items: center;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.check .box { border-radius: 5px; }
.radio .box { border-radius: 50%; }
.check input:checked + .box { background: var(--berry-500); border-color: var(--berry-500); }
.check input:checked + .box::after {
  content:''; width: 10px; height: 6px; border: 2px solid var(--paper);
  border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px);
}
.radio input:checked + .box { border-color: var(--berry-500); }
.radio input:checked + .box::after {
  content:''; width: 9px; height: 9px; border-radius: 50%; background: var(--berry-500);
}
.check input:focus-visible + .box, .radio input:focus-visible + .box { box-shadow: var(--ring-focus); }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track {
  position: relative; width: 40px; height: 22px; background: var(--cream-400);
  border-radius: 999px; transition: background var(--dur-fast);
}
.switch .track::after {
  content:''; position: absolute; left: 2px; top: 2px; width: 18px; height: 18px;
  background: var(--paper); border-radius: 50%; transition: transform var(--dur-fast) var(--ease-out);
  box-shadow: var(--shadow-xs);
}
.switch input:checked + .track { background: var(--olive-500); }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ── Badges / Pills ───────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--sans); font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase;
  border: 1px solid transparent;
}
.badge--olive  { background: var(--olive-50);   color: var(--olive-700);   border-color: #C7D2A0; }
.badge--berry  { background: var(--berry-50);   color: var(--berry-700);   border-color: var(--berry-200); }
.badge--warn   { background: var(--warning-bg); color: var(--warning-text);border-color: var(--warning-line); }
.badge--danger { background: var(--danger-bg);  color: var(--danger-text); border-color: var(--danger-line); }
.badge--info   { background: var(--info-bg);    color: var(--info-text);   border-color: var(--info-line); }
.badge--mute   { background: var(--cream-300);  color: #6A5E58;            border-color: var(--cream-400); }

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.dot--live { background: var(--berry-500); animation: pulse-dot 1.4s var(--ease-in-out) infinite; }
.dot--olive { background: var(--olive-500); }
.dot--warn { background: var(--warning); }
.dot--mute { background: var(--cream-400); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 4px 10px;
  background: var(--cream-100); border: 1px solid var(--line);
  border-radius: var(--radius-xs);
  font-size: 12px; color: var(--muted); font-weight: 500;
}

/* ── Cards ────────────────────────────────────────────────────────────────── */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur-med) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out);
}
.card--hover:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--berry-200);
}
.card--soft { background: var(--cream-50); }
.card__head { display: flex; align-items: start; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-3); }
.card__title { font-family: var(--serif); font-weight: 600; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.card__meta { font-size: 12px; color: var(--muted); letter-spacing: 0.05em; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-4); margin-top: var(--space-4); border-top: 1px solid var(--line); }

/* stat card — magnum opus pattern */
.stat {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-5) var(--space-6);
  overflow: hidden;
}
.stat::before {
  content:''; position:absolute; right: -20px; top: -20px;
  width: 80px; height: 80px; background: var(--blush); border-radius: 50%;
  opacity: .35;
}
.stat .stat__label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--olive-700);
}
.stat .stat__value {
  font-family: var(--serif); font-weight: 700; font-size: 56px;
  line-height: 1; letter-spacing: -0.04em;
  color: var(--ink);
  margin-top: 6px;
  font-variant-numeric: tabular-nums lining-nums;
}
.stat .stat__sub { font-size: 12px; color: var(--muted); margin-top: 6px; }
.stat .stat__cta { margin-top: var(--space-4); }

/* ── Avatar ───────────────────────────────────────────────────────────────── */
.avatar {
  display: inline-grid; place-items: center;
  width: 36px; height: 36px;
  background: var(--berry-100); color: var(--berry-700);
  border-radius: 50%;
  font-weight: 700; font-size: 13px; letter-spacing: 0.05em;
  flex-shrink: 0;
}
.avatar--lg { width: 56px; height: 56px; font-size: 18px; }
.avatar--sm { width: 28px; height: 28px; font-size: 11px; }
.avatar--olive { background: var(--olive-100); color: var(--olive-700); }
.avatar img { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }

/* ── Tabs ─────────────────────────────────────────────────────────────────── */
.tabs {
  display: flex; gap: var(--space-6);
  border-bottom: 1px solid var(--line);
}
.tabs button, .tabs a {
  position: relative;
  padding: 12px 0;
  font-size: 13px; font-weight: 600; letter-spacing: 0.04em;
  color: var(--muted); background: transparent; border: 0; cursor: pointer;
  text-decoration: none;
  transition: color var(--dur-fast);
}
.tabs button:hover, .tabs a:hover { color: var(--ink); }
.tabs button[aria-selected="true"], .tabs a[aria-current="true"] {
  color: var(--ink);
}
.tabs button[aria-selected="true"]::after, .tabs a[aria-current="true"]::after {
  content:''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--berry-500);
}

.tabs-pill {
  display: inline-flex; gap: 4px; padding: 4px; background: var(--cream-100); border-radius: var(--radius-pill);
  border: 1px solid var(--line);
}
.tabs-pill button {
  padding: 8px 14px; font-size: 12px; font-weight: 600;
  color: var(--muted); border-radius: var(--radius-pill);
  border: 0; background: transparent; cursor: pointer;
  transition: background var(--dur-fast), color var(--dur-fast);
}
.tabs-pill button[aria-selected="true"] { background: var(--paper); color: var(--ink); box-shadow: var(--shadow-xs); }

/* ── Progress ─────────────────────────────────────────────────────────────── */
.progress {
  position: relative;
  height: 6px;
  background: var(--cream-300);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.progress > span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--berry-400), var(--berry-500));
  border-radius: var(--radius-pill);
  transition: width var(--dur-slow) var(--ease-out);
}
.progress--olive > span { background: linear-gradient(90deg, var(--olive-300), var(--olive-500)); }

.progress-radial {
  --pct: 60;
  --size: 80px;
  width: var(--size); height: var(--size);
  border-radius: 50%;
  background:
    conic-gradient(var(--berry-500) calc(var(--pct) * 1%), var(--cream-300) 0);
  display: grid; place-items: center;
}
.progress-radial > div {
  width: calc(var(--size) - 12px); height: calc(var(--size) - 12px);
  background: var(--paper); border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--serif); font-weight: 700; font-size: 22px; color: var(--ink);
  font-variant-numeric: tabular-nums;
}

/* ── Stepper / dots ───────────────────────────────────────────────────────── */
.stepper { display: inline-flex; align-items: center; gap: 6px; }
.stepper > span {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--cream-400);
}
.stepper > span[data-active="true"] { background: var(--berry-500); width: 20px; border-radius: var(--radius-pill); }
.stepper > span[data-done="true"] { background: var(--olive-500); }

/* ── Dialog / Modal ───────────────────────────────────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; z-index: 300;
  background: rgba(42,36,32,.55);
  backdrop-filter: blur(4px);
  display: grid; place-items: center;
  padding: var(--space-6);
  animation: fade var(--dur-fast);
}
.modal {
  width: 100%; max-width: 560px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8);
  animation: fadeUp var(--dur-med) var(--ease-out);
  max-height: 90vh; overflow-y: auto;
}
.modal__head { display:flex; align-items: start; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.modal__title { font-family: var(--serif); font-weight: 700; font-size: 26px; letter-spacing: -0.01em; line-height: 1.15; }
.modal__close {
  width: 36px; height: 36px; border-radius: 50%;
  display: inline-grid; place-items: center;
  color: var(--muted); background: transparent;
  transition: background var(--dur-fast);
}
.modal__close:hover { background: var(--cream-100); color: var(--ink); }
.modal__foot { display:flex; justify-content: flex-end; gap: var(--space-3); margin-top: var(--space-6); padding-top: var(--space-4); border-top: 1px solid var(--line); }

/* ── Toast ────────────────────────────────────────────────────────────────── */
.toast-stack { position: fixed; top: var(--space-6); right: var(--space-6); z-index: 400; display: flex; flex-direction: column; gap: var(--space-3); max-width: 360px; }
.toast {
  display: flex; gap: var(--space-3); padding: var(--space-4);
  background: var(--paper); border: 1px solid var(--line); border-left: 3px solid var(--olive-500);
  border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
  animation: fadeUp var(--dur-med) var(--ease-out);
  font-size: 14px;
}
.toast--success { border-left-color: var(--olive-500); }
.toast--warn { border-left-color: var(--warning); }
.toast--danger { border-left-color: var(--danger); }
.toast .icon { color: var(--olive-700); flex-shrink: 0; }
.toast--warn .icon { color: var(--warning-text); }
.toast--danger .icon { color: var(--danger-text); }

/* ── Tooltip ──────────────────────────────────────────────────────────────── */
.tooltip { position: relative; display: inline-flex; }
.tooltip[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
  background: var(--ink); color: var(--paper); font-size: 12px; padding: 6px 10px;
  border-radius: var(--radius-xs); white-space: nowrap;
  box-shadow: var(--shadow-md); pointer-events: none;
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.empty {
  padding: var(--space-16) var(--space-8);
  text-align: center;
  border: 1px dashed var(--cream-400);
  border-radius: var(--radius-xl);
  background: var(--cream-50);
}
.empty__icon {
  display:inline-grid; place-items:center;
  width: 64px; height: 64px;
  background: var(--blush); color: var(--berry-600);
  border-radius: 50%;
  margin-bottom: var(--space-4);
}
.empty__title { font-family: var(--serif); font-size: 28px; font-weight: 600; margin-bottom: 8px; letter-spacing: -0.01em; }
.empty__desc { color: var(--muted); max-width: 420px; margin: 0 auto var(--space-6); }

/* ── Skeleton ─────────────────────────────────────────────────────────────── */
.skel {
  background: linear-gradient(90deg, var(--cream-300) 0%, var(--cream-100) 50%, var(--cream-300) 100%);
  background-size: 200px 100%;
  background-repeat: no-repeat;
  animation: shimmer 1.4s linear infinite;
  border-radius: var(--radius-xs);
}
.skel--text { height: 14px; margin: 6px 0; }
.skel--title { height: 28px; width: 70%; }
.skel--card { height: 180px; border-radius: var(--radius-lg); }

/* ── Sidebar (cabinet) ────────────────────────────────────────────────────── */
.cab-shell {
  display: grid;
  grid-template-columns: 248px 1fr;
  min-height: 100vh;
  background: var(--cream);
}
@media (max-width: 1024px) { .cab-shell { grid-template-columns: 1fr; } .cab-side { display: none; } }

.cab-side {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--paper);
  border-right: 1px solid var(--line);
  padding: var(--space-6) var(--space-4);
  display: flex; flex-direction: column;
}
.cab-side .brand { padding: 6px 10px; margin-bottom: var(--space-6); }
.cab-side .user-pill {
  display: flex; align-items: center; gap: 10px;
  padding: 10px;
  background: var(--cream-100);
  border-radius: var(--radius-md);
  margin-bottom: var(--space-6);
}
.cab-side .user-pill .name { font-size: 13px; font-weight: 600; line-height: 1.2; }
.cab-side .user-pill .sub { font-size: 11px; color: var(--muted); letter-spacing: 0.04em; }
.cab-side nav { display: flex; flex-direction: column; gap: 2px; }
.cab-side nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 500; color: var(--ink);
  text-decoration: none;
  position: relative;
  transition: background var(--dur-fast);
}
.cab-side nav a:hover { background: var(--cream-100); }
.cab-side nav a[aria-current="page"] { background: var(--berry-50); color: var(--berry-700); font-weight: 600; }
.cab-side nav a[aria-current="page"] .icon { color: var(--berry-600); }
.cab-side nav .icon { color: var(--muted); width: 18px; }
.cab-side nav a[aria-current="page"]::before {
  content:''; position: absolute; left: -4px; top: 8px; bottom: 8px; width: 3px;
  background: var(--berry-500); border-radius: 2px;
}
.cab-side nav .badge-count {
  margin-left: auto;
  background: var(--berry-100); color: var(--berry-700);
  font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: var(--radius-pill);
  font-variant-numeric: tabular-nums;
}
.cab-side nav a[aria-current="page"] .badge-count { background: var(--berry-500); color: var(--paper); }
.cab-side .divider { height: 1px; background: var(--line); margin: var(--space-4) 6px; }

.cab-main { padding: 0; }
.cab-top {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-4);
  padding: var(--space-4) var(--space-8);
  background: rgba(249,245,240,.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
  min-height: var(--topbar-h);
}
[data-theme="dark"] .cab-top { background: rgba(34,28,25,.85); }
.cab-top .crumbs { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.cab-top .actions { display:flex; align-items: center; gap: var(--space-3); }
.cab-content { padding: var(--space-8); max-width: 1180px; }

/* mobile bottom nav */
.bot-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 50;
  background: var(--paper); border-top: 1px solid var(--line);
  padding: 8px var(--space-4) calc(8px + env(safe-area-inset-bottom));
}
.bot-nav ul { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(5, 1fr); }
.bot-nav a {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 6px 0; text-decoration: none;
  font-size: 10px; font-weight: 600; color: var(--muted);
  letter-spacing: 0.04em;
}
.bot-nav a[aria-current="page"] { color: var(--berry-600); }
@media (max-width: 1024px) { .bot-nav { display: block; } .cab-content { padding-bottom: 100px; } }

/* ── Domain components ────────────────────────────────────────────────────── */

/* event card */
.mc-event {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: transform var(--dur-med) var(--ease-out), box-shadow var(--dur-med) var(--ease-out), border-color var(--dur-med) var(--ease-out);
}
.mc-event:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--berry-200); }
.mc-event__cover {
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(120% 80% at 0% 0%, var(--blush), transparent 60%),
    radial-gradient(80% 60% at 100% 100%, var(--olive-50), transparent 60%),
    var(--cream-200);
  display: grid; place-items: center;
  color: var(--berry-300);
  font-family: var(--serif); font-style: italic; font-size: 38px;
  letter-spacing: -0.02em;
  position: relative;
  border-bottom: 1px solid var(--line);
}
.mc-event__cover .live-pill {
  position: absolute; top: 14px; left: 14px;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px;
  background: var(--paper);
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--berry-600);
  border: 1px solid var(--berry-200);
  box-shadow: var(--shadow-sm);
}
.mc-event__body { padding: var(--space-5) var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); flex: 1; }
.mc-event__date { font-family: var(--mono); font-size: 12px; color: var(--muted); letter-spacing: 0.06em; }
.mc-event__title { font-family: var(--serif); font-weight: 700; font-size: 21px; line-height: 1.2; letter-spacing: -0.01em; color: var(--ink); }
.mc-event__lect { font-size: 13px; color: var(--muted); }
.mc-event__foot {
  display: flex; align-items: center; justify-content: space-between; gap: var(--space-3);
  margin-top: auto; padding-top: var(--space-4); border-top: 1px solid var(--line);
}

/* certificate card */
.mc-cert {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  overflow: hidden;
}
.mc-cert::before {
  content:''; position: absolute; right: -30px; top: -30px;
  width: 120px; height: 120px;
  border: 1.5px solid var(--berry-200);
  border-radius: 50%; opacity: .5;
}
.mc-cert::after {
  content:''; position: absolute; right: -10px; top: -10px;
  width: 80px; height: 80px;
  border: 1.5px solid var(--berry-300);
  border-radius: 50%; opacity: .4;
}
.mc-cert__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--space-3); }
.mc-cert__title { font-family: var(--serif); font-weight: 700; font-size: 22px; line-height: 1.2; letter-spacing: -0.01em; margin-bottom: var(--space-3); position: relative; z-index: 1; max-width: 80%; }
.mc-cert__meta { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; font-size: 12px; margin-bottom: var(--space-4); position: relative; z-index: 1; }
.mc-cert__meta dt { color: var(--muted); text-transform: uppercase; letter-spacing: 0.12em; font-weight: 700; font-size: 10px; }
.mc-cert__meta dd { font-family: var(--mono); color: var(--ink); }
.mc-cert__actions { display: flex; gap: var(--space-3); }

/* recording card */
.mc-rec {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 0;
}
.mc-rec__thumb {
  aspect-ratio: 16/9;
  background: linear-gradient(135deg, var(--blush), var(--cream-300));
  display: grid; place-items: center;
  color: var(--paper);
  font-size: 28px;
  position: relative;
}
.mc-rec__thumb .play {
  width: 44px; height: 44px; border-radius: 50%;
  background: rgba(42,36,32,.6); display: grid; place-items: center;
  backdrop-filter: blur(2px); color: var(--paper);
}
.mc-rec__body { padding: var(--space-4) var(--space-5); display: flex; flex-direction: column; gap: 6px; }
.mc-rec__title { font-family: var(--serif); font-weight: 600; font-size: 17px; line-height: 1.25; }
.mc-rec__meta { display:flex; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.mc-rec__progress { margin-top: auto; }
@media (max-width: 640px) { .mc-rec { grid-template-columns: 1fr; } }

/* timer pill — for live countdowns + test timer */
.mc-timer {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: var(--cream-100);
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-family: var(--mono); font-size: 13px; font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.mc-timer--live { background: var(--berry-50); border-color: var(--berry-200); color: var(--berry-700); }
.mc-timer--warn { background: var(--warning-bg); border-color: var(--warning-line); color: var(--warning-text); }

/* test question */
.mc-q {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: var(--space-8);
}
.mc-q__num {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--muted); margin-bottom: var(--space-3);
}
.mc-q__text { font-family: var(--serif); font-weight: 500; font-size: 26px; line-height: 1.3; letter-spacing: -0.01em; margin-bottom: var(--space-6); }
.mc-q__opts { display: flex; flex-direction: column; gap: 10px; }
.mc-q__opt {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-4);
  background: var(--cream-50);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  cursor: pointer;
  font-size: 15px;
  transition: border-color var(--dur-fast), background var(--dur-fast);
}
.mc-q__opt:hover { border-color: var(--berry-200); background: var(--paper); }
.mc-q__opt[aria-checked="true"] { border-color: var(--berry-500); background: var(--berry-50); box-shadow: inset 0 0 0 1px var(--berry-500); }
.mc-q__opt[aria-checked="true"] .radio .box { border-color: var(--berry-500); }
.mc-q__opt[aria-checked="true"] .radio .box::after { content:''; width: 9px; height: 9px; border-radius: 50%; background: var(--berry-500); }

/* video frame (live / recording) */
.mc-video {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #0E0B09;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: var(--cream-200);
  display: grid; place-items: center;
}
.mc-video__placeholder {
  font-family: var(--serif); font-style: italic; opacity: .4; font-size: 22px;
}
.mc-video .controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: var(--space-4);
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.7));
  display: flex; align-items: center; gap: var(--space-3);
}
.mc-video .scrub { flex: 1; height: 4px; background: rgba(255,255,255,.18); border-radius: 999px; position: relative; }
.mc-video .scrub > span { display: block; height: 100%; background: var(--berry-500); border-radius: 999px; }
.mc-video__live-pill {
  position: absolute; top: var(--space-4); left: var(--space-4);
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 14px;
  background: rgba(185,51,82,.95);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: 11px; font-weight: 800; letter-spacing: 0.2em; text-transform: uppercase;
}
.mc-video__live-pill .dot { background: #fff; box-shadow: 0 0 0 4px rgba(255,255,255,.3); animation: pulse-dot 1.4s infinite; }

/* certificate preview frame (mini) */
.mc-cert-preview {
  aspect-ratio: 1 / 1.41;
  background: linear-gradient(180deg, var(--cream-50), var(--paper));
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: var(--space-8) var(--space-6);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.mc-cert-preview::before {
  content:''; position: absolute; inset: 8px;
  border: 1px solid var(--berry-300);
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.mc-cert-preview__brand { font-family: var(--serif); font-weight: 700; color: var(--berry-600); font-size: 18px; letter-spacing: 0.04em; margin-bottom: var(--space-4); }
.mc-cert-preview__kicker { font-size: 10px; font-weight: 700; letter-spacing: 0.3em; text-transform: uppercase; color: var(--muted); margin-bottom: var(--space-2); }
.mc-cert-preview__h { font-family: var(--serif); font-style: italic; font-size: 12px; color: var(--muted); margin-bottom: var(--space-4); }
.mc-cert-preview__name { font-family: var(--hand); color: var(--berry-700); font-size: 32px; line-height: 1; margin-bottom: var(--space-6); }
.mc-cert-preview__what { font-size: 12px; line-height: 1.4; margin-bottom: var(--space-3); color: var(--muted); }
.mc-cert-preview__title { font-family: var(--serif); font-weight: 700; font-size: 14px; max-width: 80%; margin: 0 auto var(--space-4); }
.mc-cert-preview__no { font-family: var(--mono); font-size: 10px; color: var(--muted); letter-spacing: 0.1em; }

/* Code snippet block */
.code {
  font-family: var(--mono); font-size: 13px;
  background: var(--ink); color: #F5F0EA;
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  line-height: 1.55;
}
.code .k { color: #DD7F95; }
.code .v { color: #B5C490; }
.code .c { color: #B5A89E; font-style: italic; }

/* spec / swatch tables */
.swatch-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: var(--space-4); }
.swatch {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
}
.swatch .chip { height: 84px; }
.swatch .meta { padding: 10px 12px; font-size: 12px; }
.swatch .meta b { display: block; font-family: var(--mono); font-weight: 500; color: var(--ink); }
.swatch .meta span { color: var(--muted); }

.type-row { display: grid; grid-template-columns: 140px 1fr; gap: var(--space-6); align-items: baseline; padding: var(--space-4) 0; border-bottom: 1px dashed var(--line); }
.type-row .label { font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }

.spec-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--space-4); }
.spec {
  border: 1px solid var(--line); border-radius: var(--radius-md);
  padding: var(--space-4);
  background: var(--paper);
  display: flex; flex-direction: column; gap: var(--space-3);
}
.spec .demo { height: 60px; background: var(--cream-100); border-radius: var(--radius-xs); display: grid; place-items: center; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.spec .nm { font-family: var(--mono); font-size: 11px; color: var(--ink); font-weight: 500; letter-spacing: 0.05em; }
.spec .v  { font-size: 11px; color: var(--muted); }

/* example block (preview + code) */
.example { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; margin: var(--space-6) 0; }
.example .preview { padding: var(--space-8); background: var(--paper); display:flex; align-items:center; justify-content: center; flex-wrap: wrap; gap: var(--space-4); }
.example .preview--start { justify-content: flex-start; }
.example .preview--col { flex-direction: column; align-items: stretch; }
.example .src {
  border-top: 1px solid var(--line);
  background: #1E1A17;
  color: #F5F0EA;
  font-family: var(--mono); font-size: 12px;
  padding: var(--space-4) var(--space-5);
  overflow-x: auto;
  line-height: 1.6;
}
.example .src .tag { color: #DD7F95; background: transparent; border: 0; padding: 0; font-family: inherit; }
.example .src .attr { color: #95A56C; }
.example .src .str { color: #F0CC72; }

table.spec-table {
  width: 100%;
  border-collapse: separate; border-spacing: 0;
  font-size: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  overflow: hidden;
}
table.spec-table th, table.spec-table td { text-align: left; padding: 12px 14px; }
table.spec-table th { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; font-weight: 700; color: var(--muted); background: var(--cream-100); border-bottom: 1px solid var(--line); }
table.spec-table tr + tr td { border-top: 1px solid var(--line); }
table.spec-table td.mono { font-family: var(--mono); }

/* ─────────────────────────────────────────────────────────────────────────── */
