\
:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --surface-soft: #f0f2f3;
  --text: #192126;
  --muted: #667179;
  --border: #d9dfe3;
  --accent: #255f72;
  --accent-soft: #e3eff3;
  --danger: #9b3131;
  --shadow: 0 10px 28px rgba(25, 33, 38, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
}

button, input, textarea { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

.topbar {
  min-height: 64px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand { font-weight: 750; }
.subbrand { color: var(--muted); font-size: 13px; }

.top-actions {
  display: flex;
  gap: 16px;
  align-items: center;
}

.top-link, .link-button {
  border: 0;
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--muted);
}

.page {
  max-width: 980px;
  margin: 0 auto;
  padding: 28px 20px 56px;
}

.muted { color: var(--muted); }

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: 14px;
  margin-bottom: 12px;
}

.context-card,
.question-block,
.finished-card,
.login-card,
.admin-card,
.stat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
}

.context-card {
  padding: 20px;
  margin-bottom: 18px;
}

.eyebrow, .small-label, .focal-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--muted);
  font-weight: 700;
}

.context-sentence {
  color: var(--muted);
  margin: 10px 0;
}

.focal-sentence {
  margin: 12px 0;
  padding: 16px 18px;
  border-left: 5px solid var(--accent);
  background: var(--surface-soft);
  border-radius: 12px;
  font-size: 18px;
  line-height: 1.55;
}

.focal-label { margin-bottom: 5px; }

.full-comment { margin-top: 14px; }

.full-comment summary {
  cursor: pointer;
  color: var(--accent);
}

.full-comment-text {
  margin-top: 10px;
  padding: 14px;
  border-radius: 12px;
  background: var(--surface-soft);
  white-space: pre-wrap;
}

.question-block {
  padding: 22px;
  margin-bottom: 18px;
}

.question-block.compact { padding: 18px 22px; }

.question-block h2,
.admin-card h2 {
  margin: 0;
  font-size: 19px;
}

.question-block p { margin: 4px 0 0; }

.section-head,
.admin-head,
.save-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}

.status {
  white-space: nowrap;
  font-size: 13px;
  padding-top: 3px;
}

.trust-wheel {
  position: relative;
  width: min(520px, 92vw);
  aspect-ratio: 1 / 1;
  margin: 18px auto 4px;
}

.wheel-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid var(--border);
  pointer-events: none;
}

.wheel-ring.outer {
  inset: 8%;
  background: linear-gradient(to bottom, rgba(255,255,255,.5), rgba(240,242,243,.65));
}

.wheel-ring.inner {
  inset: 31%;
  border-style: dashed;
  background: var(--surface);
}

.relation-choice,
.relation-center {
  position: absolute;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  transition: border-color .12s ease, background .12s ease;
}

.relation-choice {
  width: 142px;
  min-height: 78px;
  border-radius: 18px;
  padding: 10px 11px;
}

.relation-choice strong,
.relation-center strong { display: block; }

.relation-choice span,
.relation-center span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.relation-choice kbd,
.relation-center kbd,
.unclear-choice kbd {
  position: absolute;
  right: 8px;
  top: 7px;
  color: var(--muted);
  font-size: 10px;
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 4px;
  background: var(--surface-soft);
}

.relation-choice:hover,
.target-choice:hover,
.secondary-toggle:hover,
.unclear-choice:hover {
  border-color: #aab7bd;
}

.relation-choice.selected,
.relation-center.selected,
.unclear-choice.selected,
.target-choice.selected {
  border: 2px solid var(--accent);
  background: var(--accent-soft);
}

.relation-uncertainty {
  top: 2%;
  left: 50%;
  transform: translateX(-50%);
}

.relation-trust { top: 24%; right: 0; }
.relation-repair { bottom: 8%; right: 12%; }
.relation-betrayal { bottom: 8%; left: 12%; }
.relation-distrust { top: 24%; left: 0; }

.relation-center {
  left: 50%;
  top: 52%;
  transform: translate(-50%, -50%);
  width: 160px;
  height: 160px;
  border-radius: 50%;
  padding: 18px;
  text-align: center;
}

.unclear-row {
  display: flex;
  justify-content: center;
  margin-top: 4px;
}

.unclear-choice {
  position: relative;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 38px 9px 18px;
}

.targets-block.disabled { opacity: .48; }

.target-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-top: 14px;
}

.target-choice,
.secondary-toggle {
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 999px;
  padding: 9px 14px;
}

.secondary-toggle {
  margin-top: 14px;
  color: var(--accent);
}

.secondary-target-wrap {
  margin-top: 15px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.hidden { display: none; }

.review-line { margin-bottom: 14px; }

.check-label {
  display: inline-flex;
  align-items: center;
  gap: 9px;
}

.check-label input {
  width: 18px;
  height: 18px;
}

.notes-label {
  display: block;
  font-weight: 650;
}

textarea,
.login-form input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  padding: 11px 12px;
  margin-top: 6px;
}

textarea:focus,
.login-form input:focus,
button:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(37, 95, 114, .22);
  outline-offset: 2px;
}

.save-row { align-items: center; }

.save-message {
  color: var(--danger);
  font-size: 14px;
}

.primary-button {
  border: 0;
  border-radius: 12px;
  background: var(--accent);
  color: white;
  min-height: 44px;
  padding: 10px 18px;
  font-weight: 700;
}

.primary-button:disabled {
  opacity: .42;
  cursor: not-allowed;
}

.text-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.login-card,
.finished-card {
  max-width: 480px;
  margin: 60px auto;
  padding: 26px;
}

.login-card h1,
.finished-card h1,
.admin-head h1 { margin: 0 0 6px; }

.login-form {
  display: grid;
  gap: 16px;
  margin-top: 20px;
}

.login-form label { font-weight: 650; }

.error {
  margin-top: 14px;
  color: var(--danger);
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 20px 0;
}

.stat-card { padding: 18px; }

.stat-number {
  font-size: 30px;
  font-weight: 800;
}

.admin-card {
  padding: 20px;
  margin-top: 16px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 12px;
}

th, td {
  text-align: left;
  padding: 10px 9px;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 680px) {
  .page { padding: 18px 12px 40px; }
  .topbar { padding: 10px 14px; }

  .section-head,
  .admin-head {
    flex-direction: column;
    gap: 8px;
  }

  .trust-wheel { width: min(420px, 96vw); }

  .relation-choice {
    width: 116px;
    min-height: 70px;
    font-size: 13px;
  }

  .relation-center {
    width: 136px;
    height: 136px;
    padding: 14px;
    font-size: 13px;
  }

  .relation-trust { right: -2%; }
  .relation-distrust { left: -2%; }
  .relation-repair { right: 7%; }
  .relation-betrayal { left: 7%; }

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

/* --- annotation selection + persistent save controls --- */

.relation-choice.selected,
.relation-center.selected,
.unclear-choice.selected,
.target-choice.selected {
  background: #fff200 !important;
  color: #111 !important;
  border: 3px solid #111 !important;
  box-shadow: 0 0 0 3px rgba(255, 242, 0, 0.35);
  font-weight: 700;
}

.relation-choice.selected span,
.relation-center.selected span {
  color: #222 !important;
}

.relation-choice.selected kbd,
.relation-center.selected kbd,
.unclear-choice.selected kbd {
  background: #111;
  color: #fff;
  border-color: #111;
}

/* Keep the save control visible while annotating */
.save-row {
  position: sticky;
  bottom: 12px;
  z-index: 50;
  background: rgba(255,255,255,.97);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-top: 16px;
  box-shadow: 0 8px 28px rgba(25,33,38,.16);
  align-items: center;
}

.primary-button {
  min-width: 160px;
  min-height: 48px;
  font-size: 15px;
}

.primary-button:disabled {
  opacity: 1;
  background: #d7dde0;
  color: #70777b;
  border: 1px solid #bcc5ca;
}

/* Always-visible annotation action bar */
.save-row {
  position: fixed !important;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(920px, calc(100vw - 32px));
  box-sizing: border-box;
  z-index: 1000;

  display: flex !important;
  justify-content: space-between;
  align-items: center;

  background: rgba(255,255,255,.98);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  box-shadow: 0 8px 30px rgba(0,0,0,.18);
}

#save-next {
  display: inline-flex !important;
  visibility: visible !important;
  align-items: center;
  justify-content: center;
  min-width: 180px;
  min-height: 48px;
}

/* leave room so fixed bar doesn't cover bottom content */
.page {
  padding-bottom: 100px !important;
}
