﻿:root {
  --bg: #ecf3ff;
  --card: #ffffff;
  --ink: #10243e;
  --muted: #4e6179;
  --line: #d2deed;
  --brand: #0074d9;
  --brand-strong: #005eb3;
  --ok: #11a37f;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: linear-gradient(165deg, #f6f9ff 0%, var(--bg) 100%);
  font-family: "Segoe UI", "Trebuchet MS", sans-serif;
  position: relative;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(18px);
  z-index: -1;
  opacity: 0.65;
}

.bg-shape-a {
  width: 360px;
  height: 360px;
  top: -80px;
  right: -70px;
  background: #9fd3ff;
}

.bg-shape-b {
  width: 340px;
  height: 340px;
  bottom: -120px;
  left: -80px;
  background: #9cefd4;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.8);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 2;
}

.kicker {
  margin: 0;
  color: var(--brand);
  font-weight: 700;
}

h1 {
  margin: 2px 0 0;
  font-size: 1.2rem;
}

.top-stats {
  display: flex;
  gap: 8px;
}

.stat {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 5px 8px;
  min-width: 82px;
  text-align: center;
}

.stat span {
  font-weight: 700;
  color: var(--brand-strong);
  display: block;
}

.stat small {
  color: var(--muted);
  font-size: 0.72rem;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr 340px;
  gap: 10px;
  padding: 10px;
  min-height: calc(100vh - 74px);
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
}

.left-panel,
.right-panel {
  padding: 10px;
  overflow-y: auto;
}

.left-panel section,
.right-panel section {
  margin-bottom: 12px;
}

h2 {
  margin: 0 0 7px;
  font-size: 0.95rem;
}

.toolbar {
  display: flex;
  gap: 6px;
  align-items: center;
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: #f9fbff;
  flex-wrap: wrap;
}

.page-box {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

#viewer-wrap {
  overflow: auto;
  height: calc(100vh - 150px);
  padding: 14px;
}

#pdf-canvas {
  display: block;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 16px 34px rgba(14, 37, 66, 0.2);
}

input,
button,
textarea,
select {
  width: 100%;
  font-family: inherit;
  border: 1px solid #b9c9dc;
  border-radius: 8px;
  padding: 7px 8px;
  font-size: 0.9rem;
  background: #fff;
}

button {
  width: auto;
  color: #fff;
  background: var(--brand);
  border-color: var(--brand-strong);
  cursor: pointer;
}

button:hover { background: var(--brand-strong); }

button.ghost {
  background: #eef5ff;
  color: var(--brand-strong);
  border-color: #c9dcf6;
}

button.ghost:hover {
  background: #dcecff;
}

.row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 6px;
}

#page-input {
  width: 74px;
}

textarea {
  resize: vertical;
}

.scroll-list {
  max-height: 180px;
  overflow-y: auto;
  display: grid;
  gap: 5px;
}

.scroll-list button {
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.progress-track {
  height: 9px;
  background: #e5edf8;
  border-radius: 999px;
  overflow: hidden;
}

#progress-fill {
  height: 100%;
  width: 0;
  transition: width 0.2s ease;
  background: linear-gradient(90deg, var(--ok), #54d5ae);
}

.revision-card {
  border: 1px dashed #b9cce2;
  border-radius: 10px;
  padding: 8px;
  background: #fbfdff;
  line-height: 1.5;
}

.exam-list {
  max-height: 260px;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  background: #f9fcff;
  display: grid;
  gap: 8px;
}

.exam-q {
  border: 1px solid #dbe6f3;
  border-radius: 10px;
  padding: 8px;
  background: #fff;
}

.exam-q p {
  margin: 0 0 6px;
  font-weight: 600;
}

.exam-q label {
  display: block;
  margin-bottom: 4px;
  font-size: 0.86rem;
}

.muted {
  color: var(--muted);
  font-size: 0.83rem;
}

@media (max-width: 1360px) {
  .layout {
    grid-template-columns: 300px 1fr;
  }

  .right-panel {
    grid-column: 1 / -1;
    max-height: 42vh;
  }
}

@media (max-width: 940px) {
  .topbar,
  .top-stats {
    flex-direction: column;
    align-items: flex-start;
  }

  .layout {
    grid-template-columns: 1fr;
  }

  .left-panel,
  .right-panel {
    max-height: 42vh;
  }
}
