:root {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --ink: #16202a;
  --muted: #6b7785;
  --line: #e3e8ee;
  --accent: #0f766e;
  --accent-2: #14b8a6;
  --accent-soft: #e6f4f2;
  --danger: #dc2626;
  --radius: 14px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 4px 16px rgba(16, 24, 40, .06);
  /* thang màu độ 0 → 4 (nhạt): huyết tương trong (vàng rơm) → đục nặng (trắng sữa) */
  --g0: #f8e2a0;
  --g1: #f5e7bf;
  --g2: #f1e9d4;
  --g3: #ebe8df;
  --g4: #faf9f5;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  font-family: 'Be Vietnam Pro', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
button { font: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: 1px solid transparent; border-radius: 10px; padding: 10px 16px;
  font-weight: 600; text-decoration: none; transition: .15s; white-space: nowrap;
}
.btn.sm { padding: 7px 12px; font-size: 13px; }
.btn.block { width: 100%; }
.btn.primary { background: var(--accent); color: #fff; }
.btn.primary:hover { background: #0b5f59; }
.btn.outline { background: #fff; border-color: var(--line); color: var(--ink); }
.btn.outline:hover { border-color: var(--accent); color: var(--accent); }
.btn.ghost { background: transparent; color: var(--muted); }
.btn.ghost:hover { color: var(--ink); background: #eef1f4; }
.btn.danger-ghost { background: transparent; color: var(--danger); border-color: #f5d0d0; }
.btn.danger-ghost:hover { background: #fdecec; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.link { background: none; border: 0; padding: 0; color: var(--accent); font-weight: 500; font-size: 13px; text-decoration: none; }
.link:hover { text-decoration: underline; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -.01em; }
.brand.big { font-size: 20px; }
.drop {
  width: 22px; height: 22px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg);
  background: linear-gradient(135deg, var(--g0), var(--g3));
  box-shadow: inset -3px -3px 0 rgba(0,0,0,.08);
}

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-art {
  padding: 56px 64px; display: flex; flex-direction: column; justify-content: center; gap: 20px;
  background: radial-gradient(1200px 600px at -10% -10%, #d7f0ec 0, transparent 60%),
              radial-gradient(900px 500px at 110% 110%, #fbe8c0 0, transparent 55%), #f8faf9;
}
.auth-art h1 { font-size: 40px; line-height: 1.2; margin: 12px 0 0; letter-spacing: -.02em; }
.auth-art p { color: var(--muted); font-size: 16px; max-width: 480px; margin: 0; }
.scale-demo { display: flex; gap: 10px; margin-top: 12px; }
.scale-demo span {
  width: 52px; height: 72px; border-radius: 10px 10px 22px 22px; display: grid; place-items: end center;
  padding-bottom: 8px; font-weight: 700; border: 2px solid rgba(0,0,0,.06);
}
.auth-card {
  align-self: center; justify-self: center; width: min(420px, 90%); background: var(--panel);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow); border: 1px solid var(--line);
}
.tabs { display: grid; grid-template-columns: 1fr 1fr; background: #f0f3f6; border-radius: 12px; padding: 4px; margin-bottom: 24px; }
.tab { border: 0; background: transparent; padding: 10px; border-radius: 9px; font-weight: 600; color: var(--muted); }
.tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
form label { display: block; font-weight: 500; font-size: 13px; margin-bottom: 16px; }
form input {
  display: block; width: 100%; margin-top: 6px; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 10px; background: #fbfcfd; outline: none; transition: .15s;
}
form input:focus { border-color: var(--accent); background: #fff; box-shadow: 0 0 0 3px var(--accent-soft); }
.error { color: var(--danger); min-height: 20px; margin: 0 0 12px; font-size: 13px; }

/* ---------- Grade color helpers ---------- */
[data-g] { box-shadow: inset 0 0 0 1px rgba(90, 75, 40, .18); }
[data-g="0"] { background: var(--g0); color: #5c4710; }
[data-g="1"] { background: var(--g1); color: #5c4b1c; }
[data-g="2"] { background: var(--g2); color: #554a30; }
[data-g="3"] { background: var(--g3); color: #4d483c; }
[data-g="4"] { background: var(--g4); color: #4a4741; box-shadow: inset 0 0 0 1px rgba(90, 75, 40, .26); }
[data-g="5"] { background: #ece6f8; color: #4c3a7a; box-shadow: inset 0 0 0 1px rgba(76, 58, 122, .22); }

/* ---------- App layout ---------- */
.app { height: 100%; display: flex; flex-direction: column; }
.topbar {
  height: 60px; flex: none; display: flex; align-items: center; justify-content: space-between;
  padding: 0 20px; background: var(--panel); border-bottom: 1px solid var(--line);
}
.live { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); background: #f3f5f7; padding: 5px 12px; border-radius: 99px; }
.live i { width: 8px; height: 8px; border-radius: 50%; background: #c2c9d1; }
.live.on i { background: #16a34a; box-shadow: 0 0 0 3px #dcfce7; }
.live.off i { background: var(--danger); }
.user { display: flex; align-items: center; gap: 10px; font-weight: 500; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; text-transform: uppercase; }

.layout { flex: 1; display: grid; grid-template-columns: 290px 1fr; min-height: 0; }
.sidebar { background: var(--panel); border-right: 1px solid var(--line); padding: 18px; overflow-y: auto; display: flex; flex-direction: column; gap: 14px; }
.upload-box {
  border: 2px dashed #cfd8e1; border-radius: var(--radius); padding: 18px; text-align: center; transition: .15s; background: #fbfcfd;
}
.upload-box.drag { border-color: var(--accent); background: var(--accent-soft); }
.upload-box p { margin: 6px 0 12px; color: var(--muted); font-size: 13px; }
.upload-box b { color: var(--ink); }
.upload-icon { width: 40px; height: 40px; margin: 0 auto; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 18px; }
.upload-actions { display: flex; gap: 8px; justify-content: center; }
.upload-progress { background: var(--accent-soft); border-radius: 12px; padding: 12px; font-size: 13px; }
.row { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.bar { height: 6px; background: rgba(15,118,110,.15); border-radius: 99px; overflow: hidden; margin-top: 6px; }
.bar.lg { height: 8px; background: #eef1f4; }
.bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: inherit; transition: width .3s; }

.side-head { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; }
.side-head h3 { margin: 0; font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.batch-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.batch-list li { padding: 10px 12px; border-radius: 10px; cursor: pointer; border: 1px solid transparent; transition: .12s; }
.batch-list li:hover { background: #f4f6f8; }
.batch-list li.active { background: var(--accent-soft); border-color: #bfe3de; }
.batch-list .bn { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.batch-list .bm { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.batch-list .done { color: #16a34a; font-weight: 600; }
.batch-list .bar { background: #e6ebf0; height: 4px; }

.main { overflow-y: auto; padding: 22px 26px; min-width: 0; }
.empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; color: var(--muted); }
.empty h2 { color: var(--ink); margin: 18px 0 4px; }
.empty-illu { display: flex; gap: 10px; align-items: flex-end; }
.empty-illu span { width: 30px; border-radius: 6px 6px 14px 14px; border: 2px solid #d9e0e7; }
.empty-illu span:nth-child(1) { height: 60px; background: var(--g0); }
.empty-illu span:nth-child(2) { height: 76px; background: var(--g2); }
.empty-illu span:nth-child(3) { height: 92px; background: var(--g4); }

/* ---------- Workspace ---------- */
.ws-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 16px; }
.ws-title { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.title-input { font-size: 22px; font-weight: 700; border: 1px solid transparent; background: transparent; border-radius: 8px; padding: 2px 6px; margin-left: -7px; letter-spacing: -.01em; max-width: 100%; }
.title-input:hover { border-color: var(--line); }
.title-input:focus { outline: none; border-color: var(--accent); background: #fff; }
.ws-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.stats { display: grid; grid-template-columns: 260px 1fr; gap: 14px; margin-bottom: 16px; }
.progress-card, .dist { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.progress-card .row span { color: var(--muted); }
.dist { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.dist .d { display: flex; flex-direction: column; gap: 6px; }
.dist .d .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.dist .d .top b { color: var(--ink); font-size: 14px; }
.dist .d .track { height: 8px; border-radius: 99px; background: #eef1f4; overflow: hidden; }
.dist .d .track i { display: block; height: 100%; border-radius: inherit; transition: width .3s; }

.ws-body { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 16px; align-items: start; }
.viewer { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.stage { position: relative; overflow: hidden; background: #000; height: clamp(420px, calc(100vh - 200px), 1100px); cursor: grab; touch-action: none; display: grid; place-items: center; }
.stage img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; -webkit-user-drag: none; user-select: none; }
.nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%;
  border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 28px; line-height: 1; backdrop-filter: blur(6px);
}
.nav:hover { background: rgba(255,255,255,.28); }
.nav.prev { left: 14px; } .nav.next { right: 14px; }
.counter { position: absolute; top: 12px; left: 12px; background: rgba(0,0,0,.5); color: #fff; font-size: 12px; padding: 4px 10px; border-radius: 99px; }
.zoom-hint { position: absolute; bottom: 10px; right: 12px; color: rgba(255,255,255,.5); font-size: 11px; }
.img-info { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; border-bottom: 1px solid var(--line); gap: 10px; }
.fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.save-state { font-size: 12px; color: var(--muted); white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.save-state.ok::before { content: '✓'; color: #16a34a; font-weight: 700; }
.save-state.saving::before { content: ''; width: 10px; height: 10px; border: 2px solid #cbd5e1; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; }
.save-state.err { color: var(--danger); }
@keyframes spin { to { transform: rotate(360deg); } }

.grade-panel { padding: 16px 18px 18px; }
.gp-label { font-weight: 600; margin-bottom: 10px; }
.grades { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.grade-btn {
  position: relative; border: 2px solid rgba(0,0,0,.06); border-radius: 12px; padding: 12px 4px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px; transition: transform .1s, box-shadow .15s;
}
.grade-btn .n { font-size: 24px; font-weight: 700; line-height: 1; }
.grade-btn .t { font-size: 11px; opacity: .85; }
.grade-btn:hover { transform: translateY(-2px); box-shadow: 0 6px 14px rgba(0,0,0,.1); }
.grade-btn.selected { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(22,32,42,.15); transform: translateY(-2px); }
.grade-btn.selected::after { content: '✓'; position: absolute; top: -9px; right: -9px; width: 22px; height: 22px; border-radius: 50%; background: var(--ink); color: #fff; font-size: 12px; display: grid; place-items: center; }
.gp-foot { display: flex; justify-content: space-between; align-items: center; margin: 14px 0 10px; }
.switch { display: flex; align-items: center; gap: 8px; font-size: 13px; cursor: pointer; user-select: none; }
.switch input { display: none; }
.switch span { width: 34px; height: 20px; border-radius: 99px; background: #cfd6dd; position: relative; transition: .15s; }
.switch span::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { left: 16px; }
textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; resize: vertical; background: #fbfcfd; outline: none; }
textarea:focus { border-color: var(--accent); background: #fff; }

.thumbs-panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; position: sticky; top: 0; max-height: calc(100vh - 110px); display: flex; flex-direction: column; }
.filters { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.chip { border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 4px 10px; font-size: 12px; font-weight: 500; color: var(--muted); }
.chip.active { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .c { opacity: .7; margin-left: 3px; }
.thumbs { overflow-y: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; padding: 2px; }
.thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; cursor: pointer; background: #eef1f4; border: 2px solid transparent; }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.current { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.thumb .badge { position: absolute; bottom: 4px; right: 4px; min-width: 22px; height: 22px; border-radius: 7px; font-size: 12px; font-weight: 700; display: grid; place-items: center; box-shadow: 0 1px 3px rgba(0,0,0,.3); }
.thumb .badge.none { background: rgba(0,0,0,.55); color: #fff; font-weight: 500; }
.thumb .del { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 6px; border: 0; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; display: none; }
.thumb:hover .del { display: grid; place-items: center; }
.thumbs .none-msg { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 24px 0; }

.lightbox { position: fixed; inset: 0; background: rgba(5,8,10,.92); display: grid; place-items: center; z-index: 50; cursor: zoom-out; }
.lightbox img { max-width: 96vw; max-height: 96vh; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 20px); background: var(--ink); color: #fff; padding: 10px 18px; border-radius: 10px; opacity: 0; pointer-events: none; transition: .2s; z-index: 60; font-size: 13px; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Responsive ---------- */
@media (max-width: 1150px) {
  .ws-body { grid-template-columns: 1fr; }
  .thumbs-panel { position: static; max-height: 420px; }
  .thumbs { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
  .stats { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .auth { grid-template-columns: 1fr; }
  .auth-art { padding: 36px 24px 8px; }
  .auth-art h1 { font-size: 28px; }
  .auth-card { margin: 24px 0 40px; }
  .layout { grid-template-columns: 1fr; }
  .sidebar { border-right: 0; border-bottom: 1px solid var(--line); max-height: none; }
  .main { padding: 16px; overflow: visible; }
  .app { height: auto; min-height: 100%; }
  .live span { display: none; }
  .ws-head { flex-direction: column; align-items: stretch; }
  .ws-title { width: 100%; }
  #username { display: none; }
  .dist { grid-template-columns: repeat(3, 1fr); }
  .grades { grid-template-columns: repeat(3, 1fr); }
  .stage { height: 46vh; }
}

.switch.small { justify-content: center; margin-top: 12px; font-size: 12px; color: var(--muted); }
.setup-note { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 24px; z-index: 100; }
.setup-note code { background: #e8edf2; padding: 2px 6px; border-radius: 6px; }

form label.remember { display: flex; align-items: center; gap: 8px; font-weight: 400; color: var(--muted); margin: -4px 0 12px; cursor: pointer; }
form label.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

/* ---------- Admin ---------- */
.admin-btn { background: #1f2937; color: #fff; }
.admin-btn:hover { background: #111827; }
.admin-btn.active { background: var(--accent); }
.scope { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; display: flex; flex-direction: column; gap: 6px; }
.scope select { font: inherit; font-size: 14px; text-transform: none; letter-spacing: 0; font-weight: 500; color: var(--ink); padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.owner-tag { display: inline-block; font-size: 11px; font-weight: 600; color: #1f2937; background: #eef1f4; border-radius: 6px; padding: 1px 6px; margin-right: 6px; }
.viewing-other { background: #fff7e6; border: 1px solid #f5deb0; color: #7a5a12; border-radius: 10px; padding: 8px 12px; margin-bottom: 12px; font-size: 13px; }
.admin-title { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.card .k { color: var(--muted); font-size: 12px; }
.card .v { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.card .bar { background: #eef1f4; }
.card .bar.warn i { background: linear-gradient(90deg, #f59e0b, #dc2626); }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.panel-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.panel-head h3 { margin: 0; font-size: 15px; }
.table-wrap { overflow-x: auto; }
table.users { width: 100%; border-collapse: collapse; font-size: 13px; }
table.users th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12px; padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users td { padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.users tr:last-child td { border-bottom: 0; }
table.users .num { text-align: right; font-variant-numeric: tabular-nums; }
table.users .uname { font-weight: 600; }
.role { font-size: 11px; font-weight: 600; background: var(--accent-soft); color: var(--accent); border-radius: 6px; padding: 1px 6px; margin-left: 6px; }
.you { font-size: 11px; color: var(--muted); margin-left: 4px; }
.actions { display: flex; gap: 6px; }
.actions .btn { padding: 5px 9px; font-size: 12px; }

.raw-banner { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  background: #fff7e6; border: 1px solid #f5deb0; color: #6b4e0f; border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 13px; }
.thumb.raw::after { content: 'RAW'; position: absolute; inset: 0; display: grid; place-items: center; font-weight: 700; color: #8a6d2a; background: #f6efe0; }

/* ---------- Khoanh vùng AI ---------- */
:root { --r-cap: #2563eb; --r-head: #0ea5e9; --r-plasma: #eab308; --r-cell: #dc2626; }
.overlay { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.overlay.editing { pointer-events: auto; cursor: default; }
.overlay.drawing { cursor: crosshair; }
.overlay polygon:not(.m) { fill-opacity: 0; stroke-width: calc(2px / var(--zf, 1)); vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.overlay.editing polygon { cursor: pointer; }
.overlay polygon.sel { fill-opacity: .12; stroke-width: calc(3px / var(--zf, 1)); stroke-dasharray: calc(6px / var(--zf, 1)) calc(3px / var(--zf, 1)); }
.overlay text { font-weight: 700; paint-order: stroke; stroke: rgba(0,0,0,.65); fill: #fff; pointer-events: none; }
.overlay circle.h { fill: #fff; stroke-width: calc(2px / var(--zf, 1)); vector-effect: non-scaling-stroke; cursor: grab; }
.overlay circle.h:active { cursor: grabbing; }
.overlay polyline.draft { fill: none; stroke: #fff; stroke-width: calc(2px / var(--zf, 1)); stroke-dasharray: 5 4; vector-effect: non-scaling-stroke; }
.seg-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 18px; border-bottom: 1px solid var(--line); }
.seg-legend { display: flex; gap: 6px; flex-wrap: wrap; }
.seg-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); background: #fff; border-radius: 99px; padding: 3px 10px 3px 8px; font-size: 12px; font-weight: 500; }
.seg-chip i { width: 10px; height: 10px; border-radius: 3px; }
.seg-chip.off { opacity: .45; text-decoration: line-through; }
.seg-chip .c { color: var(--muted); font-size: 11px; }
.seg-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.seg-status { font-size: 12px; color: var(--muted); }
.seg-status.busy::before { content: ''; display: inline-block; width: 9px; height: 9px; margin-right: 6px; border: 2px solid #cbd5e1; border-top-color: var(--accent); border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -1px; }
#segEdit.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.seg-editbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 18px; background: #f0f9f8; border-bottom: 1px solid #cde9e5; font-size: 12px; color: #35524f; }
.seg-edit-actions { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.seg-edit-actions select { font: inherit; font-size: 12px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.gp-switches { display: flex; gap: 16px; flex-wrap: wrap; }

.zoomer { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .25s ease; }
#segZoom.active { background: #1f2937; color: #fff; border-color: #1f2937; }

.upload-opts { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; margin: 12px auto 0; width: fit-content; }
.upload-opts .switch.small { margin-top: 0; justify-content: flex-start; }
.overlay rect.tube { fill: none; stroke: #16a34a; stroke-width: calc(2px / var(--zf, 1)); stroke-dasharray: calc(8px / var(--zf, 1)) calc(5px / var(--zf, 1)); }
.thumb img { object-fit: contain; background: #e9edf1; }

.seg-master { font-size: 13px; margin-right: 6px; }
.seg-bar { justify-content: flex-start; }
.seg-bar .seg-actions { margin-left: auto; }
.viewer.seg-off .seg-legend, .viewer.seg-off .seg-actions, .viewer.seg-off .seg-editbar { display: none !important; }
.upload-opts .switch.disabled { opacity: .4; cursor: not-allowed; }
.grade-btn .t { text-align: center; line-height: 1.2; }

.stage.dragging { cursor: grabbing; }
.stage.dragging .zoomer { transition: none; }
.zoom-ctl { position: absolute; top: 12px; right: 12px; display: flex; gap: 2px; background: rgba(0,0,0,.55); padding: 3px; border-radius: 10px; backdrop-filter: blur(6px); z-index: 2; }
.zoom-ctl button { border: 0; background: transparent; color: #e5e7eb; font-size: 12px; font-weight: 600; padding: 5px 9px; border-radius: 7px; }
.zoom-ctl button:hover { background: rgba(255,255,255,.15); }
.zoom-ctl button.active { background: #fff; color: #111; }
.zoom-ctl button:disabled { opacity: .35; cursor: not-allowed; }
.nav, .counter { z-index: 2; }
.overlay rect.blackout { fill: #000; pointer-events: none; }

.layer-cb { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; padding: 3px 8px 3px 4px; border-radius: 8px; cursor: pointer; user-select: none; }
.layer-cb:hover { background: #f1f4f7; }
.layer-cb input { width: 15px; height: 15px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.layer-cb i { width: 10px; height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.layer-cb .c { color: var(--muted); font-size: 11px; }
.layer-cb:has(input:not(:checked)) { color: var(--muted); }
.shared-sw { font-size: 13px; font-weight: 500; margin-right: 4px; }
.owner-tag.lock { background: transparent; padding: 0; }

/* ---------- Tabs ---------- */
.nav-tabs { display: flex; gap: 4px; background: #f0f3f6; padding: 4px; border-radius: 11px; margin-left: 24px; margin-right: auto; }
.nav-tab { border: 0; background: transparent; padding: 7px 14px; border-radius: 8px; font-weight: 600; color: var(--muted); font-size: 13px; }
.nav-tab.active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.topbar .live { margin-right: 16px; }

/* ---------- Tổng kết ---------- */
.sum-select { font: inherit; font-size: 13px; padding: 7px 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; max-width: 320px; }
#sumBody { display: flex; flex-direction: column; gap: 16px; transition: opacity .2s; }
#sumBody.loading { opacity: .5; }
#sumBody .cards { margin-bottom: 0; }
.card .v small { font-size: 14px; color: var(--muted); font-weight: 500; }
.lgs { display: flex; flex-wrap: wrap; gap: 10px; font-size: 11.5px; color: var(--muted); }
.lgs .lg { display: inline-flex; align-items: center; gap: 5px; }
.lgs .lg i { width: 11px; height: 11px; border-radius: 3px; }
.sum-raters td { vertical-align: middle; }
.distcell { min-width: 260px; width: 45%; }
.stack { display: flex; gap: 2px; height: 16px; border-radius: 4px; overflow: hidden; background: #fff; }
.stack i { display: block; min-width: 3px; }
.dnum { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 11px; color: var(--muted); margin-top: 5px; font-variant-numeric: tabular-nums; }
.dnum span { display: inline-flex; align-items: center; gap: 4px; }
.dnum b { color: var(--ink); font-weight: 600; }
.dnum i { width: 8px; height: 8px; border-radius: 2px; }
/* thang màu biểu đồ (thứ bậc, một sắc xanh, đã kiểm tra) — độ 5 là xám riêng */
.cg0 { background: #86b6ef; } .cg1 { background: #5598e7; } .cg2 { background: #2a78d6; }
.cg3 { background: #1c5cab; } .cg4 { background: #104281; } .cg5 { background: #a8a6a0; }
.sum-raters small, .matrix small { color: var(--muted); font-size: 10.5px; margin-left: 3px; }
.empty-row { padding: 18px; text-align: center; }
.sum-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.3fr); gap: 16px; align-items: start; }
table.matrix { border-collapse: separate; border-spacing: 2px; margin: 12px; font-size: 12.5px; }
table.matrix th { font-weight: 600; color: var(--muted); padding: 6px 8px; text-align: center; white-space: nowrap; }
table.matrix tbody th { text-align: right; }
table.matrix td { min-width: 64px; text-align: center; padding: 8px 6px; border-radius: 6px; font-weight: 600; font-variant-numeric: tabular-nums;
  background: rgba(15, 118, 110, var(--a, .1)); color: var(--ink); }
table.matrix td.hi { color: #fff; }
table.matrix td.hi small { color: rgba(255,255,255,.8); }
table.matrix td.self, table.matrix td.na { background: #f3f5f7; color: var(--muted); font-weight: 400; }
.dis-list { max-height: 640px; overflow-y: auto; }
.dis { display: grid; grid-template-columns: 52px minmax(0, 1fr) 60px auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); cursor: pointer; }
.dis:hover { background: #fafbfc; }
.dthumb { width: 52px; height: 64px; border-radius: 8px; overflow: hidden; background: #111; }
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dname { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dinfo .muted { font-size: 11.5px; }
.dgrades { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 5px; }
.gchip { font-size: 11.5px; padding: 2px 7px; border-radius: 6px; }
.gchip b { margin-left: 2px; }
.dspread { text-align: center; line-height: 1.1; }
.dspread b { font-size: 20px; display: block; }
.dspread span { font-size: 10.5px; color: var(--muted); }
.dis-list .more { margin: 12px auto; display: flex; }
@media (max-width: 1150px) { .sum-grid { grid-template-columns: 1fr; } }
@media (max-width: 820px) { .nav-tabs { margin-left: 8px; } .nav-tab { padding: 6px 9px; } .brand { font-size: 0; gap: 0; } }

/* ---------- Gộp lô ---------- */
.side-links { display: flex; gap: 12px; }
.merge-box { border: 1px solid #bfe3de; background: var(--accent-soft); border-radius: 12px; padding: 12px; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.mb-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.mb-head .muted { font-size: 12px; }
.merge-box input { font: inherit; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; outline: none; }
.merge-box input:focus { border-color: var(--accent); }
.mb-actions { display: flex; gap: 6px; }
.mb-note { margin: 0; font-size: 11.5px; color: #35524f; }
.batch-list li { display: flex; gap: 10px; align-items: flex-start; }
.batch-list li .bbody { flex: 1; min-width: 0; }
.batch-list li .mpick { width: 16px; height: 16px; margin: 3px 0 0; accent-color: var(--accent); flex: none; pointer-events: none; }
.batch-list li .mpick-x { width: 16px; color: var(--muted); text-align: center; flex: none; }
.batch-list li.picking { border: 1px dashed #cfd8e1; }
.batch-list li.picked { background: var(--accent-soft); border-color: var(--accent); border-style: solid; }
.batch-list li.nopick { opacity: .5; cursor: not-allowed; }

/* ---------- Xoá ảnh ---------- */
.info-right { display: flex; align-items: center; gap: 10px; flex: none; }
.thumbs-head { display: flex; justify-content: flex-end; margin: -2px 0 6px; }
.pick-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; background: #fdf2f2; border: 1px solid #f5d0d0; border-radius: 10px; padding: 7px 10px; margin-bottom: 10px; font-size: 12.5px; }
.pick-bar #pickDel { margin-left: auto; }
.thumb .tpick { position: absolute; top: 5px; left: 5px; width: 17px; height: 17px; margin: 0; accent-color: var(--danger); pointer-events: none; }
.thumb.picked { border-color: var(--danger); box-shadow: 0 0 0 2px #fde2e2; }
.thumb.picked img { opacity: .75; }

/* ---------- Bảo mật ---------- */
.pending { min-height: 100%; display: grid; place-items: center; background: radial-gradient(1000px 500px at 0 0, #d7f0ec 0, transparent 60%), #f8faf9; }
.pending-card { display: flex; flex-direction: column; gap: 14px; max-width: 460px; }
.pending-card h2 { margin: 6px 0 0; }
.pending-card p { margin: 0; color: var(--muted); }
.st { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 6px; white-space: nowrap; }
.st.ok { background: #e7f6ec; color: #166534; }
.st.wait { background: #fff4e0; color: #8a5a00; }
.pend-badge { margin-left: 6px; background: #dc2626; color: #fff; border-radius: 99px; font-size: 11px; padding: 0 6px; line-height: 17px; }

/* ---------- Thùng rác ---------- */
.trash-link { border: 1px dashed #d6dde4; background: #fff; border-radius: 10px; padding: 8px 12px; font-size: 13px; font-weight: 500; color: var(--muted); text-align: left; margin-top: auto; }
.trash-link:hover, .trash-link.active { border-color: var(--danger); color: var(--danger); background: #fdf2f2; }
#trashCount:not(:empty) { margin-left: 6px; background: #f3f5f7; color: var(--ink); border-radius: 99px; padding: 0 7px; font-size: 11.5px; }
.trow { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto auto auto; gap: 12px; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.trow:last-child { border-bottom: 0; }
.ticon { font-size: 26px; text-align: center; }
.tthumb { width: 44px; height: 54px; border-radius: 8px; overflow: hidden; background: #111; }
.tthumb img { width: 100%; height: 100%; object-fit: cover; }
.tinfo { display: flex; flex-direction: column; min-width: 0; }
.tinfo b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13.5px; }
.tinfo .muted { font-size: 12px; }
.tleft { font-size: 12px; color: var(--muted); white-space: nowrap; }
.tleft.soon { color: var(--danger); font-weight: 600; }

.backup-panel { margin-bottom: 16px; }
.backup-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; }
.backup-body p { margin: 0; }
.muted.small { font-size: 12px; }


/* ---------- Đổi tên lô & thống kê theo lô ---------- */
.bren { border: 0; background: transparent; color: var(--muted); padding: 0 4px 0 0; font-size: 13px; cursor: pointer; opacity: 0; transition: opacity .15s; }
.batch-list li:hover .bren, .batch-list li.active .bren { opacity: 1; }
.bren:hover { color: var(--accent); }
.sum-scope { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.scope-chip { font-size: 13px; padding: 6px 12px; border-radius: 10px; }
.scope-chip.all { background: var(--accent-soft); color: #0b5f59; }
.scope-chip.one { background: #fff4e0; color: #7a5a12; }
.sum-batches tr.brow { cursor: pointer; }
.sum-batches tr.brow:hover { background: #f6faf9; }
.sum-batches tr.btotal td { font-weight: 700; background: #fafbfc; border-top: 2px solid var(--line); }
.sum-batches small { color: var(--muted); font-weight: 400; font-size: 11px; }
.sum-batches .distcell { min-width: 200px; width: 30%; }

.thumbs-head { justify-content: space-between; }
.shuffle-btn.on { color: var(--accent); font-weight: 600; }

/* ---------- Ảnh phân loại lệch nhau ---------- */
.diff-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; padding: 9px 18px; background: #fff6e6; border-bottom: 1px solid #f3dcae; font-size: 13px; }
.diff-bar .dmsg { color: #8a5a00; font-weight: 600; margin-right: 4px; }
.diff-bar .dchip { background: #fff; border: 1px solid #f0d9a8; border-radius: 8px; padding: 2px 8px; color: var(--ink); }
.diff-bar .dact { margin-left: auto; display: flex; gap: 14px; }
.thumb.diff::after { content: "⚠"; position: absolute; top: 3px; left: 4px; font-size: 12px; background: #fff3d6; color: #a86a00; border-radius: 6px; padding: 0 4px; line-height: 16px; }
.chip.diffchip { border-color: #f0c674; color: #8a5a00; }
.chip.diffchip.active { background: #b7791f; border-color: #b7791f; color: #fff; }

/* ---------- Phân tích màu ---------- */
.col-progress { display: flex; align-items: center; gap: 12px; font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.col-progress .bar { flex: 1; height: 6px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.col-progress .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.col-feat { display: flex; flex-wrap: wrap; gap: 6px; }
.col-chart { padding: 8px 16px 14px; }
.col-chart svg.strip { width: 100%; height: auto; display: block; }
.strip .grid { stroke: #eef1f4; }
.strip .ax { font-size: 9.5px; fill: var(--muted); }
.strip .thr { stroke: #b7791f; stroke-dasharray: 4 4; }
.strip .med { stroke: var(--ink); stroke-width: 2; stroke-linecap: round; }
.strip .pt { stroke: #fff; stroke-width: 1.5; cursor: pointer; fill-opacity: .85; }
.strip .pt:hover { stroke: var(--ink); }
.strip .pt.nhan, .pt-l.nhan { fill: #2a78d6; background: #2a78d6; }
.strip .pt.loai, .pt-l.loai { fill: #c2410c; background: #c2410c; }
.col-chart .lgs { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12px; margin-top: 6px; }
.col-chart .lgs span { display: inline-flex; align-items: center; gap: 6px; }
.pt-l { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.med-l { width: 14px; height: 2px; background: var(--ink); display: inline-block; }
.col-table td { vertical-align: middle; }
.col-table .cname { display: flex; align-items: center; gap: 10px; min-width: 170px; }
.col-table .cname img { width: 34px; height: 44px; object-fit: cover; border-radius: 6px; background: #eef1f4; }
.col-table .cname b { font-weight: 600; font-size: 13px; }
.col-table .muted { font-size: 11px; }
.swatch { display: inline-block; width: 16px; height: 16px; border-radius: 5px; border: 1px solid rgba(0,0,0,.12); vertical-align: -3px; margin-right: 6px; }
.verdict { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 8px; }
.verdict.nhan { background: #e8f1fc; color: #1c5cab; }
.verdict.loai { background: #fdeee6; color: #9a3412; }
.gpill { display: inline-block; min-width: 20px; text-align: center; font-size: 12px; font-weight: 700; padding: 1px 6px; border-radius: 7px; }
.col-table .ok { color: #15803d; font-weight: 700; margin-left: 4px; }
.col-table .ok.half { color: #b7791f; }
.col-table .bad { color: #c2410c; font-weight: 700; margin-left: 4px; }

/* ---------- Phân loại nhanh ---------- */
.panel.quick { margin-bottom: 16px; }
.quick-drop { margin: 14px 16px; border: 2px dashed var(--line); border-radius: 14px; padding: 22px; text-align: center; display: grid; gap: 6px; cursor: pointer; transition: .15s; }
.quick-drop:hover, .quick-drop.over { border-color: var(--accent); background: var(--accent-soft); }
.quick-head { display: flex; justify-content: space-between; padding: 0 16px 8px; font-size: 13px; color: var(--muted); }
.quick-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.quick-list:empty { display: none; }
.qcard { display: flex; gap: 12px; border: 1px solid var(--line); border-radius: 12px; padding: 10px; background: #fff; }
.qimg { position: relative; width: 84px; flex: none; align-self: flex-start; }
.qimg img { width: 100%; display: block; border-radius: 8px; background: #111; }
.qimg svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.qimg polygon { fill: none; stroke: #22c55e; stroke-width: .012; vector-effect: non-scaling-stroke; stroke-width: 1.6; }
.qwait { height: 120px; display: grid; place-items: center; background: #f3f5f7; border-radius: 8px; color: var(--muted); }
.qbody { flex: 1; min-width: 0; display: grid; gap: 5px; align-content: start; font-size: 13px; }
.qname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qerr { color: #b42318; }
.qverdict { font-size: 20px; font-weight: 800; letter-spacing: .02em; display: flex; align-items: baseline; gap: 8px; }
.qverdict small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.qverdict.nhan { color: #1c5cab; }
.qverdict.loai { color: #c2410c; }
.qprobs { display: grid; gap: 2px; margin: 2px 0; }
.qp { display: grid; grid-template-columns: 38px 1fr 34px; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); }
.qp b { text-align: right; color: var(--ink); font-weight: 600; }
.qbar { height: 6px; background: #eef1f4; border-radius: 4px; overflow: hidden; }
.qbar i { display: block; height: 100%; }

.mode-tg { display: inline-flex; background: #eef1f4; border-radius: 10px; padding: 3px; }
.mode-tg button { border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--muted); cursor: pointer; }
.mode-tg button.active { background: #fff; color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.col-one { margin-bottom: 16px; }
.quick-list.one { padding: 0; grid-template-columns: minmax(320px, 560px); }
.quick-list.one .qimg { width: 150px; }
.qsub { font-size: 11px; margin-top: -4px; }
.okc { color: #15803d; font-weight: 600; } .halfc { color: #b7791f; font-weight: 600; } .badc { color: #c2410c; font-weight: 600; }

/* ---------- Vai trò Bác sĩ / Sinh viên ---------- */
.role-pick { display: flex; align-items: center; gap: 14px; font-size: 14px; margin: 2px 0 6px; }
.role-pick > span { color: var(--muted); }
.role-pick label { display: inline-flex; align-items: center; gap: 6px; margin: 0; font-weight: 500; }
.role-pick input { width: auto; margin: 0; }
.role-tag { display: inline-block; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 6px; letter-spacing: .02em; vertical-align: 1px; background: #eef1f4; color: #475467; }
.role-tag[data-r="doctor"] { background: #e6f4f2; color: #0b5f59; }
#myRole { margin-left: 6px; font-size: 11px; }
.diff-bar .dchip.doc { border-color: #9fd6cf; background: #f0faf8; }
.diff-bar .dmsg.ok { color: #0b5f59; }
.diff-bar.agree { background: #eef9f6; border-bottom-color: #cdebe5; }
.role-sel { padding: 4px 8px; border-radius: 8px; border: 1px solid var(--line); font-size: 13px; background: #fff; }
.cam { margin: 0 16px 14px; border: 1px solid var(--line); border-radius: 14px; padding: 12px; display: grid; gap: 10px; }
.cam-view { position: relative; background: #111; border-radius: 10px; overflow: hidden; max-height: 60vh; display: flex; justify-content: center; }
.cam-view video { max-width: 100%; max-height: 60vh; display: block; }
.cam-guide { position: absolute; top: 6%; bottom: 6%; left: 50%; width: 22%; transform: translateX(-50%); border: 2px dashed rgba(255,255,255,.55); border-radius: 12px; pointer-events: none; }
.cam-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: center; }
.cam-tip { font-size: 12px; text-align: center; }

.diff-bar .dmsg.bad { color: #b42318; }
.diff-bar.miss { background: #fdf0ec; border-bottom-color: #f6d2c6; }

/* ---------- Bảng kết quả cho bác sĩ ---------- */
.doc-result { position: absolute; inset: 0; z-index: 30; display: grid; place-items: center; background: rgba(15, 23, 32, .55); backdrop-filter: blur(2px); animation: drIn .15s ease-out; }
@keyframes drIn { from { opacity: 0; } to { opacity: 1; } }
.dr-card { width: min(440px, 88%); background: #fff; border-radius: 18px; padding: 26px 26px 18px; text-align: center; box-shadow: 0 20px 60px rgba(0,0,0,.35); border-top: 8px solid #98a2b3; }
.doc-result.ok .dr-card { border-top-color: #16a34a; }
.doc-result.bad .dr-card { border-top-color: #dc2626; }
.doc-result.tie .dr-card { border-top-color: #d97706; }
.dr-icon { font-size: 46px; font-weight: 800; line-height: 1; margin-bottom: 6px; color: #667085; }
.doc-result.ok .dr-icon, .doc-result.ok .dr-title { color: #15803d; }
.doc-result.bad .dr-icon, .doc-result.bad .dr-title { color: #b91c1c; }
.doc-result.tie .dr-icon, .doc-result.tie .dr-title { color: #b45309; }
.dr-title { font-size: 30px; font-weight: 800; letter-spacing: .02em; }
.dr-sub { font-size: 15px; color: var(--ink); margin: 8px 0 14px; }
.dr-votes { display: grid; gap: 4px; text-align: left; margin: 0 auto 16px; max-width: 320px; }
.dr-v { display: grid; grid-template-columns: 84px 1fr 24px; white-space: nowrap; gap: 8px; align-items: center; font-size: 12px; color: var(--muted); padding: 2px 6px; border-radius: 6px; }
.dr-v b { text-align: right; color: var(--ink); }
.dr-v.top { background: #f2f4f7; color: var(--ink); font-weight: 600; }
.dr-v.mine span::after { content: " ← bạn"; color: var(--accent); font-weight: 600; }
.dr-act { display: flex; gap: 10px; justify-content: center; }
.dr-act .btn { padding: 10px 18px; font-size: 14px; }
.dr-hint { font-size: 11px; color: var(--muted); margin-top: 10px; }

.dr-keep { display: inline-flex; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--ink); cursor: pointer; }
.dr-keep input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
