/* Макеты TechCertify — цвета и шрифт из дизайн-системы платформы (packages/ui-preset/theme.css). */
:root {
  --page: #fafafa; --card: #ffffff; --soft: #f5f7fb;
  --text: #111827; --text-2: #374151; --muted: #6b7280; --subtle: #9ca3af;
  --border: #dde3ef; --divider: #e6eaf2;
  --blue: #0072dc; --blue-h: #0064c2; --blue-soft: #e7f2ff; --blue-border: #b6dbff;
  --ok: #0d8921; --ok-soft: #e8fceb; --ok-text: #0b7a1d; --ok-border: #bdeecc;
  --warn-soft: #fff4d6; --warn-text: #92610a; --warn-border: #fcd34d;
  --bad: #ed0b00; --bad-soft: #ffecec; --bad-text: #c0392b; --bad-border: #fecaca;
  --side: #0f172a;
  --r-card: 18px; --r: 12px;
  --shadow: 0 12px 32px rgba(15, 23, 42, .05);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--page); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif; -webkit-font-smoothing: antialiased; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-h); }
h1 { margin: 0; font-size: 28px; line-height: 1.2; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
h2 { margin: 0; font-size: 17px; font-weight: 800; }
.muted { color: var(--muted); }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* шапка */
.top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: 20px; height: 60px; padding: 0 24px; background: var(--side); color: #e2e8f0; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: #fff; font-weight: 800; font-size: 16px; white-space: nowrap; }
.brand:hover { color: #fff; }
.brand-mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 8px; background: #0185ff; color: #fff; font-size: 12px; font-weight: 800; letter-spacing: .02em; }
.top-search { flex: 1; max-width: 420px; }
.top-search input { width: 100%; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid #334155; background: #1e293b; color: #f8fafc; font: inherit; }
.top-search input::placeholder { color: #94a3b8; }
.top-me { margin-left: auto; display: flex; align-items: center; gap: 14px; font-size: 14px; color: #cbd5e1; }
.top-me .link { color: #94a3b8; }
.link { background: none; border: 0; padding: 0; color: var(--blue); font-weight: 600; }

.wrap { max-width: 1320px; margin: 0 auto; padding: 28px 24px 64px; }
.wrap.wide { max-width: none; padding: 20px 24px 40px; }
.head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.head .btn { margin-left: auto; }
.lead { max-width: 72ch; margin: 10px 0 0; color: var(--text-2); }

/* вкладки */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px; background: #eef2f7; margin-left: 12px; }
.tabs a { padding: 6px 12px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 14px; }
.tabs a.on { background: #fff; color: var(--text); box-shadow: 0 1px 2px rgba(15, 23, 42, .08); }
.tabs b { display: inline-block; min-width: 20px; padding: 0 6px; margin-left: 4px; border-radius: 999px; background: var(--warn-soft); color: var(--warn-text); font-size: 12px; text-align: center; }

/* разделы и карточки */
.group { margin-top: 34px; }
.group h2 { display: flex; align-items: baseline; gap: 8px; margin-bottom: 14px; }
.count { color: var(--subtle); font-weight: 700; font-size: 14px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 18px; }
.card { display: flex; flex-direction: column; overflow: hidden; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); color: inherit; transition: border-color .15s, box-shadow .15s; }
.card:hover { color: inherit; border-color: var(--blue-border); box-shadow: 0 16px 36px rgba(15, 23, 42, .08); }
.thumb { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--soft); border-bottom: 1px solid var(--divider); }
.thumb iframe { position: absolute; left: 0; top: 0; border: 0; transform-origin: 0 0; pointer-events: none; background: #fff; }
.card-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.card-title { font-weight: 700; font-size: 15.5px; line-height: 1.35; }
.card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); }
.card-pending { font-size: 13px; font-weight: 600; color: var(--warn-text); }
.card-date { font-size: 12.5px; color: var(--subtle); }

/* статусы */
.chip { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; border: 1px solid transparent; }
.chip.review { background: var(--warn-soft); color: var(--warn-text); border-color: var(--warn-border); }
.chip.approved { background: var(--ok-soft); color: var(--ok-text); border-color: var(--ok-border); }
.chip.rejected { background: var(--bad-soft); color: var(--bad-text); border-color: var(--bad-border); }
.tag-base { font-size: 12px; font-weight: 700; color: var(--blue); background: var(--blue-soft); border-radius: 999px; padding: 2px 8px; }

/* кнопки */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 38px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border); background: #fff; color: var(--text); font-weight: 700; font-size: 14px; white-space: nowrap; }
.btn:hover { border-color: #cbd5e1; color: var(--text); }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; height: 46px; }
.btn.primary:hover { background: var(--blue-h); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.bad { color: var(--bad-text); border-color: var(--bad-border); }
.btn.bad.solid { background: var(--bad-text); color: #fff; border-color: var(--bad-text); }

/* экран */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 8px; }
.crumbs span { margin: 0 4px; color: var(--subtle); }
.screen { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; margin-top: 18px; align-items: start; }
.stage { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-card); box-shadow: var(--shadow); overflow: hidden; }
.stage-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; padding: 12px 16px; border-bottom: 1px solid var(--divider); font-size: 14px; }
.zoom { margin-left: auto; display: inline-flex; gap: 14px; }
.zoom [aria-pressed="true"] { color: var(--text); }
.frame { position: relative; overflow: auto; background: var(--soft); max-height: calc(100vh - 210px); }
.frame iframe { display: block; border: 0; background: #fff; transform-origin: 0 0; }
.versions { position: sticky; top: 80px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100vh - 100px); overflow: auto; padding-bottom: 8px; }
.versions h2 { margin: 2px 0 4px; }
.ver { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.ver.sel { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.ver-head { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: center; gap: 10px; color: inherit; }
.ver-head:hover { color: inherit; }
.ver-n { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--soft); font-weight: 800; font-size: 13px; }
.ver-title { font-weight: 700; font-size: 14px; line-height: 1.35; }
.ver-note { margin: 8px 0 0; font-size: 13.5px; color: var(--text-2); }
.ver-meta { margin: 6px 0 0; font-size: 12.5px; color: var(--muted); }
.ver-decision { margin: 8px 0 0; font-size: 13px; padding: 6px 10px; border-radius: 8px; }
.ver-decision.approved { background: var(--ok-soft); color: var(--ok-text); }
.ver-decision.rejected { background: var(--bad-soft); color: var(--bad-text); }
.decide { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.decide details.reject { width: 100%; }
.decide details.reject summary { list-style: none; display: inline-flex; }
.decide details.reject summary::-webkit-details-marker { display: none; }
.decide details.reject[open] summary { display: none; }
.decide textarea { width: 100%; margin: 0 0 8px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; font: inherit; font-size: 14px; resize: vertical; }
.history { margin-top: 10px; font-size: 13px; color: var(--muted); }
.history summary { cursor: pointer; }
.history ul { margin: 6px 0 0; padding-left: 18px; }
details.rejected { margin-top: 6px; }
details.rejected > summary { cursor: pointer; font-weight: 700; color: var(--muted); padding: 6px 2px; }
details.rejected .ver { margin-top: 10px; opacity: .85; }

/* вход */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 12px; padding: 32px; background: #fff; border: 1px solid var(--border); border-radius: 20px; box-shadow: var(--shadow); }
.brand.big { color: var(--text); font-size: 20px; }
.login label { display: flex; flex-direction: column; gap: 6px; font-weight: 700; font-size: 14px; }
.login input { height: 46px; padding: 0 14px; border: 1px solid var(--border); border-radius: 12px; font: inherit; }
.login .hint { margin-top: -6px; font-size: 12.5px; color: var(--muted); }
.error { margin: 0; color: var(--bad-text); font-weight: 600; }
.empty { margin-top: 28px; padding: 28px; border: 1px dashed var(--border); border-radius: var(--r-card); color: var(--muted); text-align: center; }

@media (max-width: 960px) {
  .screen { grid-template-columns: 1fr; }
  .versions { position: static; max-height: none; }
  .top-search { display: none; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
