header {
  background: var(--bg-card);
  height: 54px;
  padding: 0 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border);
  z-index: 100;
}
.logo { font-size: 18px; font-weight: 800; color: var(--primary); letter-spacing: -0.5px; }
.logo span { color: var(--danger); }
.h-title-center { font-weight: 700; color: var(--primary); font-size: 13px; text-transform: uppercase; letter-spacing: 1px; }
.flex-left { display: flex; align-items: center; gap: 20px; }
.flex-right { display: flex; align-items: center; gap: 12px; }
.conn-indicator { display: flex; align-items: center; gap: 6px; font-size: 10px; font-weight: 700; color: var(--text-muted); border: 1px solid var(--border); padding: 4px 10px; border-radius: 20px; background: #fff; }
.dot { width: 8px; height: 8px; border-radius: 50%; background: #94a3b8; transition: 0.3s; }
.dot.online { background: #22c55e; box-shadow: 0 0 8px rgba(34, 197, 94, 0.6); }
.timer-box { background: #eff6ff; padding: 4px 12px; border-radius: var(--radius); border: 1px solid #bfdbfe; display: flex; align-items: center; gap: 8px; }
.timer-val { font-family: 'Courier New', monospace; font-size: 18px; font-weight: 700; color: var(--accent); }
.submit-btn { background: var(--danger); color: white; border: none; padding: 8px 16px; border-radius: var(--radius); font-weight: 600; cursor: pointer; font-size: 11px; text-transform: uppercase; }

main { display: flex; flex: 1; overflow: hidden; gap: 1px; background: var(--border); }
.sidebar { width: 280px; background: var(--bg-card); display: flex; flex-direction: column; padding: 12px; overflow-y: auto; }
.sidebar h4 { font-size: 11px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-muted); margin: 2px 0 15px; font-weight: 700; }
.section-tabs { display: flex; gap: 4px; margin-bottom: 12px; border-bottom: 1px solid var(--border); padding-bottom: 12px; overflow-x: auto; flex-wrap: wrap; }
.section-tab { padding: 4px 10px; border: 1px solid var(--border); background: white; border-radius: var(--radius); font-size: 11px; font-weight: 600; cursor: pointer; color: var(--text-muted); }
.section-tab.active { background: var(--accent); color: white; border-color: var(--accent); }
.section-tab.locked { background: #e2e8f0; color: #94a3b8; cursor: not-allowed; }
.palette-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; overflow-y: auto; padding-bottom: 10px; }
.q-num { height: 34px; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; border-radius: 2px; cursor: pointer; border: 1px solid #cbd5e1; background: #f1f5f9; position: relative; }
.q-num.answered { background: var(--success); color: white; border-color: var(--success); }
.q-num.not-answered { background: var(--danger); color: white; border-color: var(--danger); }
.q-num.marked { background: #6366f1; color: white; border-color: #6366f1; }
.q-num.marked-answered { background: #6366f1; color: white; border: none; clip-path: polygon(0 0, calc(100% - 14px) 0, 100% 14px, 100% 100%, 0 100%); }
.q-num.marked-answered::after { content: ""; position: absolute; top: 0; right: 0; width: 14px; height: 14px; background: var(--success); }
.q-num.active { border: 4px solid #ffffff; }

.legend { margin: auto -12px 0; padding: 12px; border-top: 1px solid var(--border); display: grid; grid-template-columns: 1fr; gap: 6px; background: #fcfcfc; }
.legend-item { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--text-muted); }
.legend-icon { width: 20px; height: 20px; border-radius: 2px; border: 1px solid #cbd5e1; }
.legend-icon.marked-answered { clip-path: polygon(0 0, calc(100% - 10px) 0, 100% 10px, 100% 100%, 0 100%); background: #6366f1; position: relative; }
.legend-icon.marked-answered::after { content: ""; position: absolute; top: 0; right: 0; width: 10px; height: 10px; background: var(--success); }

.content { flex: 1; background: var(--bg-card); display: flex; flex-direction: column; overflow: hidden; position: relative; }
.q-header { border-bottom: 1px solid var(--border); background: #f8fafc; padding: 12px 24px; display: flex; justify-content: space-between; align-items: center; }
.q-content-scroll { flex: 1; overflow-y: auto; padding: 24px; position: relative; z-index: 5; background: transparent; }
.q-text { font-size: 15px; line-height: 1.6; margin-bottom: 24px; font-weight: 500; user-select: none; }
.option { display: flex; align-items: center; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--radius); cursor: pointer; margin-bottom: 8px; user-select: none; }
.option.selected { border-color: var(--accent); background: #eff6ff; font-weight: 600; }
.option input { margin-right: 12px; accent-color: var(--accent); }
.controls { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: space-between; align-items: center; background: #fcfcfc; }
.btn { padding: 8px 16px; border-radius: var(--radius); border: 1px solid var(--border); background: white; cursor: pointer; font-weight: 600; font-size: 12px; display: flex; align-items: center; gap: 6px; }
.btn-success { background: var(--success); color: white; border: none; }
.btn-warning { background: #f59e0b; color: white; border: none; }

#dynamic-watermark { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); transform: rotate(-25deg) scale(1.5); user-select: none; pointer-events: none; opacity: 0.04; position: absolute; inset: 0; }
.watermark-unit { font-weight: 900; font-size: 14px; color: #000; padding: 20px; white-space: nowrap; }