* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f5f5f5;
}

.page {
  display: none;
}

.page.active {
  display: flex;
}

/* Start Page */
/* Consent Page & Dev Config Page share the same background */
#consent-page,
#start-page {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.start-container {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 500px;
  width: 100%;
  text-align: center;
}

.consent-container {
  max-width: 840px;
  text-align: left;
}

.consent-container h1 {
  text-align: center;
}

.locale-selector-group {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 320px;
  margin-left: auto;
  margin-bottom: 24px;
}

.locale-selector-group label {
  margin-bottom: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.locale-selector-group .locale-select {
  flex: 1 1 auto;
}

.consent-intro {
  text-align: center;
}

.consent-description {
  margin-bottom: 16px;
}

.consent-description h3,
.consent-data-notice h3 {
  margin-bottom: 8px;
  color: #222;
}

.consent-description ul {
  margin: 10px 0 10px 22px;
  color: #555;
}

.consent-data-notice {
  border: 1px solid #c7c7c7;
  border-radius: 6px;
  background: #fafafa;
  padding: 16px;
  max-height: 120px;
  overflow-y: auto;
  margin-bottom: 18px;
  font-size: 13px;
  color: #555;
}

.consent-data-notice p:last-child {
  margin-bottom: 0;
} */

.consent-checkbox-group {
  margin-bottom: 14px;
}

.consent-device-group {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.consent-device-group > label {
  margin-bottom: 0;
  white-space: nowrap;
  flex: 0 0 auto;
}

.consent-device-options {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
}

.consent-device-option {
  display: flex;
  align-items: center;
  margin-bottom: 0;
  white-space: nowrap;
  /* font-weight: 500; */
}

.consent-device-option input[type="radio"] {
  width: auto;
}

.consent-checkbox-group .checkbox-row {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  /* font-weight: 500; */
  /* line-height: 1.4; */
}

.consent-checkbox-group .checkbox-row input[type="checkbox"] {
  width: auto;
  margin-top: 3px;
  flex: 0 0 auto;
}

.start-container h1 {
  font-size: 32px;
  margin-bottom: 10px;
  color: #222;
}

.start-container p {
  color: #555;
  margin-bottom: 15px;
  font-size: 15px;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-group label {
  display: block;
  margin-bottom: 5px;
  color: #555;
}

#pointing_device_question, #computer_checkbox {
  color: #222;
  font-weight: 600;
}


.form-group input {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 15px;
  transition: border-color 0.3s;
}

.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid #ddd;
  border-radius: 5px;
  font-size: 16px;
  transition: border-color 0.3s;
  background: white;
  color: #222;
}

.form-group input:focus {
  outline: none;
  border-color: #667eea;
}

.form-group select:focus {
  outline: none;
  border-color: #667eea;
}

.group-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 30px;
}

.mode-buttons {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.group-btn {
  padding: 15px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 5px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.group-btn:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.group-btn.selected {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.mode-btn {
  padding: 12px;
  border: 2px solid #ddd;
  background: white;
  border-radius: 5px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
}

.mode-btn:hover {
  border-color: #667eea;
  background: #f0f4ff;
}

.mode-btn.selected {
  background: #667eea;
  color: white;
  border-color: #667eea;
}

.checkbox-group {
  margin-bottom: 24px;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  /* font-weight: 500; */
  color: #222;
}

.checkbox-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.start-btn {
  width: 100%;
  padding: 15px;
  background: #667eea;
  color: white;
  border: none;
  border-radius: 5px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s;
}

.start-btn:hover:not(:disabled) {
  background: #764ba2;
}

.start-btn:disabled {
  background: #ccc;
  cursor: not-allowed;
}

/* Questionnaire Page */
#questionnaire-page {
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, #f5f7fb 0%, #e7ecf7 100%);
}

.questionnaire-container {
  width: 100%;
  max-width: 900px;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(15, 23, 42, 0.12);
  padding: 32px;
}

.questionnaire-container h2 {
  font-size: 28px;
  color: #1f2937;
  margin-bottom: 8px;
}

.questionnaire-container p {
  color: #4b5563;
  margin-bottom: 24px;
}

.questionnaire-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.question-block {
  border: 1px solid #dbe2f0;
  border-radius: 10px;
  padding: 18px;
  padding-top:  0px;
  background: #f8fafc;
}

.question-block legend {
  font-weight: 600;
  color: #1f2937;
  padding: 0 8px;
}

.question-block label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #374151;
  cursor: pointer;
}

.questionnaire-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.questionnaire-actions .start-btn {
  width: auto;
  min-width: 220px;
}

/* Annotation Page */
#annotation-page {
  flex-direction: column;
  height: 100vh;
  padding: 20px;
  background: #f5f5f5;
}

.annotation-header {
  background: white;
  padding: 15px 20px;
  border-radius: 5px;
  margin-bottom: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  justify-content: space-between;
  align-items: center;
}

.annotation-info {
  font-size: 16px;
  color: #333;
}

.annotation-info strong {
  color: #667eea;
}

.annotation-container {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 20px;
  flex: 1;
  min-height: 0;
}

.canvas-area {
  background: white;
  border-radius: 5px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  position: relative;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  overflow: auto;
}

.canvas-wrapper {
  position: relative;
  display: grid;
  align-items: start;
  justify-items: start;
  flex-shrink: 0;
  align-self: flex-start;
  min-width: 100%;
  min-height: 100%;
}

.mode-popup {
  position: fixed;
  z-index: 40;
  right: 370px;
  top: 28px;
  width: 420px;
  max-width: calc(100vw - 40px);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.8);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.mode-popup-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 12px;
  cursor: move;
}

.mode-popup-toggle {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}

.overlay-move-btn {
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(0, 0, 0, 0.28);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
  margin-left: auto;
  margin-right: 6px;
}

.mode-popup-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

.overlay-move-btn:hover {
  background: rgba(0, 0, 0, 0.4);
}

.mode-popup-body, .task-guidelines-body {
  padding: 8px 10px 10px;
}

.mode-popup-body p, .task-guidelines-body p {
  margin: 0 0 8px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.92);
}

.mode-popup-body ul, .task-guidelines-body ul {
  margin: 0 0 8px;
  padding-left: 18px;
  color: rgba(255, 255, 255, 0.92);
}

.mode-popup-body li, .task-guidelines-body li {
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 4px;
}

.mode-popup-body li:last-child {
  margin-bottom: 0;
}

.mode-popup-body p:last-child {
  margin-bottom: 0;
}

.mode-popup-practice-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 8px;
}

.mode-popup.minimized .mode-popup-body {
  display: none;
}

.practice-overlay {
  position: fixed;
  z-index: 40;
  left: 28px;
  top: 28px;
  width: 360px;
  max-width: calc(100vw - 40px);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(6px);
  pointer-events: auto;
  overflow: hidden;
}

.practice-overlay-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 12px;
  cursor: move;
}

.practice-overlay-toggle {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}

.practice-overlay-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

.practice-overlay-body {
  padding: 10px;
}

.practice-overlay-body p {
  font-size: 12px;
  line-height: 1.45;
  margin: 0 0 10px 0;
}

.practice-overlay-body p:last-child {
  margin-bottom: 0;
}

.practice-footer-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.practice-intro-dialog {
  max-width: 420px;
  width: calc(100vw - 40px);
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(15, 23, 42, 0.96);
  color: white;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
  padding: 24px;
  backdrop-filter: blur(8px);
}

.practice-intro-dialog::backdrop {
  background: rgba(0, 0, 0, 0.55);
}

.practice-intro-dialog p {
  margin: 0 0 20px 0;
  font-size: 14px;
  line-height: 1.6;
}

.practice-intro-dialog-actions {
  display: flex;
  justify-content: flex-end;
}

.practice-reset-shapes-btn {
  flex-shrink: 0;
  margin-left: auto;
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.practice-reset-shapes-btn:hover {
  background: rgba(255, 255, 255, 0.24);
}

.practice-overlay.minimized .practice-overlay-body {
  display: none;
}

.task-guidelines-window {
  position: fixed;
  z-index: 39;
  left: 28px;
  top: 28px;
  width: 360px;
  max-width: calc(100vw - 40px);
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.88);
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.22);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.22);
  backdrop-filter: blur(6px);
  overflow: hidden;
}

.task-guidelines-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 12px;
  cursor: move;
}

body.overlay-dragging {
  user-select: none;
}

.task-guidelines-toggle {
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
  color: white;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  cursor: pointer;
}

.task-guidelines-toggle:hover {
  background: rgba(255, 255, 255, 0.24);
}

/* .task-guidelines-body {
  padding: 10px;
}

.task-guidelines-body ul {
  margin: 0 0 10px 18px;
  font-size: 12px;
  line-height: 1.45;
} */

.task-guidelines-example-title {
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
}

.task-guidelines-image {
  width: 100%;
  max-height: 170px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.24);
}

.task-guidelines-window.minimized .task-guidelines-body {
  display: none;
}

.instructions-nudge-backdrop {
  position: fixed;
  inset: 0;
  z-index: 38;
  background: rgba(0, 0, 0, 0.55);
  animation: instructions-nudge-fade-in 0.2s ease;
}

.nudge {
  position: fixed;
  z-index: 40;
  max-width: 240px;
  background: #f59e0b;
  color: #1a1a1a;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  padding: 12px 14px;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  display: flex;
  flex-direction: column;
  gap: 10px;
  animation: nudge-fade-in 0.25s ease;
}

.instructions-nudge {
  left: calc(28px + 360px + 16px);
  top: 120px;
}

.nudge::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  border: 8px solid transparent;
  border-right-color: #f59e0b;
  border-left-width: 0;
}

.nudge-next-btn {
  align-self: flex-end;
  padding: 4px 14px;
  border: 2px solid rgba(0, 0, 0, 0.3);
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.12);
  color: #1a1a1a;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.nudge-next-btn:hover {
  background: rgba(0, 0, 0, 0.22);
}

.controls-nudge {
  left: auto;
  top: 120px;
  right: calc(370px + 420px + 16px);
}

.controls-nudge::before {
  left: auto;
  right: -8px;
  border-right-color: transparent;
  border-left-color: #f59e0b;
  border-right-width: 0;
  border-left-width: 8px;
}

.minimize-nudge {
  position: absolute;   /* or fixed */
  left: 0;
  right: 0;
  top: 120px;
  width: fit-content;
  max-width: 240px;
  margin-left: auto;
  margin-right: auto;
}

.minimize-nudge::before {
  display: none;
}

.minimize-btn-indicator {
  color: #f59e0b;
  font-size: 16px;
  line-height: 1;
  animation: minimize-indicator-bounce 0.7s ease-in-out infinite alternate;
  display: inline-block;
  margin-left: 4px;
}

@keyframes minimize-indicator-bounce {
  from { transform: translateX(0); opacity: 1; }
  to   { transform: translateX(-5px); opacity: 0.5; }
}

@keyframes nudge-fade-in {
  from { opacity: 0; transform: translateX(6px); }
  to   { opacity: 1; transform: translateX(0); }
}

/* @keyframes nudge-fade-in-opacity {
  from { opacity: 0; }
  to   { opacity: 1; }
} */

#canvas {
  grid-area: 1 / 1;
  position: sticky;
  top: 0;
  left: 0;
  border: 2px solid #ddd;
  display: block;
  z-index: 1;
  pointer-events: none;
}

#annotation-canvas {
  grid-area: 1 / 1;
  position: sticky;
  top: 0;
  left: 0;
  cursor: crosshair;
  border: 2px solid #ddd;
  display: block;
  z-index: 2;
  pointer-events: auto;
}

.confidence-tooltip {
  position: absolute;
  z-index: 30;
  min-width: 210px;
  max-width: 240px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  padding: 8px 10px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.16);
  color: #1f2937;
}

.confidence-tooltip-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.confidence-tooltip-title {
  font-size: 13px;
  margin-bottom: 1px;
}

.confidence-tooltip-close {
  border: none;
  background: transparent;
  color: #475569;
  width: 20px;
  height: 20px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  padding: 0;
}

.confidence-tooltip-close:hover {
  background: #e2e8f0;
  color: #0f172a;
}

.confidence-tooltip-row {
  display: flex;
  align-items: center;
  gap: 0px;
}

.confidence-tooltip-row input[type="range"] {
  flex: 1;
  cursor: pointer;
}

#confidence-value {
  min-width: 40px;
  text-align: right;
  font-size: 10px;
  font-weight: 700;
  color: #334155;
}

    .polygon-list {
      /* max-height: 150px; */
      overflow-y: auto;
      border: 1px solid #ddd;
      border-radius: 3px;
      padding: 8px;
      font-size: 12px;
      background: #f9f9f9;
      margin-bottom: 10px;
    }

    .polygon-item {
      padding: 5px;
      margin: 3px 0;
      background: white;
      border-left: 3px solid #667eea;
      cursor: pointer;
      display: flex;
      justify-content: space-between;
      align-items: center;
      border-radius: 3px;
    }

    .polygon-item:hover {
      background: #f0f4ff;
    }

    .polygon-item.selected {
      background: #e0e7ff;
      border-left-color: #764ba2;
    }

    .polygon-item.missing-confidence {
      background: #f3f4f6;
      border-left-color: #9ca3af;
      color: #6b7280;
      animation: missing-confidence-pulse 1.8s ease-in-out infinite;
    }

    .polygon-item.missing-confidence:hover {
      background: #e5e7eb;
    }

    .polygon-item.missing-confidence.selected {
      background: #dbe3ef;
      border-left-color: #64748b;
      color: #475569;
      animation: none;
    }

    @keyframes missing-confidence-pulse {
      0%,
      100% {
        box-shadow: 0 0 0 0 rgba(180, 83, 9, 0);
      }
      50% {
        box-shadow: 0 0 0 2px rgba(180, 83, 9, 0.16);
      }
    }

    .delete-polygon {
      background: #ef4444;
      color: white;
      border: none;
      border-radius: 3px;
      padding: 2px 6px;
      font-size: 11px;
      cursor: pointer;
    }

    .delete-polygon:hover {
      background: #dc2626;
    }

    .polygon-color {
      display: inline-block;
      width: 12px;
      height: 12px;
      border-radius: 2px;
      margin-right: 6px;
    }

    .polygon-confidence {
      margin-left: 4px;
      color: #475569;
      font-size: 11px;
      font-weight: 600;
    }

    .polygon-confidence-missing {
      display: inline-flex;
      align-items: center;
      margin-left: 6px;
      color: #b45309;
      font-size: 10px;
      font-weight: 700;
      text-transform: uppercase;
      letter-spacing: 0.02em;
      vertical-align: middle;
    }

    .polygon-confidence-missing::before {
      content: "!";
      display: inline-flex;
      align-items: center;
      justify-content: center;
      width: 13px;
      height: 13px;
      margin-right: 4px;
      border-radius: 999px;
      background: #d97706;
      color: #ffffff;
      font-size: 9px;
      font-weight: 700;
      line-height: 1;
    }

    .annotation-info-section {
      padding: 10px;
      border-top: 1px solid #ddd;
      margin-top: 10px;
      font-size: 12px;
      color: #666;
    }

    .annotation-controls {
      display: flex;
      gap: 8px;
      margin-bottom: 0px;
    }

    .mode-hint {
      font-size: 12px;
      color: #4b5563;
      line-height: 1.35;
    }

    .annotation-btn {
      flex: 1;
      padding: 8px;
      border: none;
      border-radius: 3px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.2s;
    }

    .undo-point-btn {
      background: #3b82f6;
      color: white;
    }

    .undo-point-btn:hover:not(:disabled) {
      background: #2563eb;
    }

    .undo-point-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .delete-shape-btn {
      background: #ef4444;
      color: white;
    }

    .delete-shape-btn:hover:not(:disabled) {
      background: #dc2626;
    }

    .delete-shape-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .finish-polygon-btn {
      background: #10b981;
      color: white;
    }

    .finish-polygon-btn:hover:not(:disabled) {
      background: #059669;
    }

    .finish-polygon-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .clear-all-btn {
      background: #f59e0b;
      color: white;
    }

    .clear-all-btn:hover {
      background: #d97706;
    }

    .controls {
      background: white;
      border-radius: 5px;
      padding: 20px;
      box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
      display: flex;
      flex-direction: column;
      gap: 20px;
    }

    .sidebar-column {
      display: flex;
      flex-direction: column;
      gap: 12px;
      min-height: 0;
    }

    .sidebar-column .controls {
      flex: 1;
      min-height: 0;
    }

    .slider-nudge {
      border: 1px solid #fde68a;
      background: #fffbeb;
      color: #92400e;
      border-radius: 6px;
      padding: 9px 10px;
      font-size: 13px;
      line-height: 1.35;
      box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.35);
      animation: slider-nudge-pulse 1.8s ease-out infinite;
      transition: opacity 0.2s ease;
    }

    .slider-nudge.is-hidden {
      display: none;
      animation: none;
    }

    @keyframes slider-nudge-pulse {
      0% {
        box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.32);
      }
      100% {
        box-shadow: 0 0 0 10px rgba(245, 158, 11, 0);
      }
    }

    .control-group {
      display: flex;
      flex-direction: column;
      gap: 2px;
    }

    .control-group label {
      font-weight: 600;
      color: #222;
      font-size: 14px;
    }

    .slider-row {
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .slider-row input[type="range"] {
      flex: 1;
      cursor: pointer;
    }

    .control-group input[type="range"] {
      cursor: pointer;
    }

    .control-value {
      font-size: 14px;
      color: #667eea;
      font-weight: 600;
      min-width: 38px;
      text-align: right;
    }

    .reset-btn {
      padding: 3px 8px;
      background: #e5e7eb;
      color: #374151;
      border: none;
      border-radius: 3px;
      font-size: 11px;
      font-weight: 600;
      cursor: pointer;
      white-space: nowrap;
      transition: background 0.2s;
    }

    .reset-btn:hover {
      background: #d1d5db;
    }

    .reset-all-btn {
      padding: 6px 12px;
      background: #e5e7eb;
      color: #374151;
      border: none;
      border-radius: 3px;
      font-size: 12px;
      font-weight: 600;
      cursor: pointer;
      width: 100%;
      transition: background 0.2s;
      margin-bottom: 10px;
    }

    .reset-all-btn:hover {
      background: #d1d5db;
    }

    .object-counter-section {
      border: 1px solid #e2e8f0;
      border-radius: 6px;
      background: #f8fafc;
      padding: 10px;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .object-counter-title {
      font-size: 13px;
      font-weight: 600;
      color: #1f2937;
    }

    .object-counter-inputs {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 8px;
    }

    .object-counter-field {
      display: flex;
      flex-direction: column;
      gap: 4px;
    }

    .object-counter-field label {
      font-size: 12px;
      color: #374151;
      font-weight: 600;
    }

    .object-counter-field input {
      width: 100%;
      border: 1px solid #cbd5e1;
      border-radius: 4px;
      padding: 6px 8px;
      font-size: 13px;
      color: #111827;
      background: #ffffff;
    }

    .object-counter-note {
      font-size: 12px;
      color: #64748b;
    }

    .object-counter-note.invalid {
      color: #b91c1c;
    }

    .annotation-buttons {
      display: flex;
      gap: 10px;
      flex-direction: column;
    }

    .nav-btn {
      padding: 12px;
      border: none;
      border-radius: 5px;
      font-weight: 600;
      cursor: pointer;
      transition: all 0.3s;
      font-size: 14px;
    }

    .next-btn {
      background: #667eea;
      color: white;
    }

    .practice-btn {
      background: #0f766e;
      color: white;
    }

    .practice-btn:hover:not(:disabled) {
      background: #115e59;
    }

    .next-btn:hover:not(:disabled) {
      background: #764ba2;
    }

    .next-btn:disabled {
      background: #ccc;
      cursor: not-allowed;
    }

    .finish-btn {
      background: #10b981;
      color: white;
    }

    .finish-btn:hover {
      background: #059669;
    }

    @media (max-width: 1024px) {
      .annotation-container {
        grid-template-columns: 1fr;
      }

      .sidebar-column {
        order: -1;
      }

      .mode-popup {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        left: 12px;
        top: 88px;
      }

      .practice-overlay {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        left: 12px;
        top: 88px;
      }

      .task-guidelines-window {
        width: calc(100vw - 24px);
        max-width: calc(100vw - 24px);
        right: 24px;
        top: 152px;
      }
    }

/* Completion Page */
#completion-page {
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 20px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.completion-container {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.completion-card {
  background: white;
  padding: 40px;
  border-radius: 10px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
  max-width: 600px;
  width: 100%;
  text-align: center;
}

.completion-icon {
  font-size: 56px;
  color: #4caf50;
  margin-bottom: 12px;
}

.completion-card h2 {
  font-size: 28px;
  color: #333;
  margin-bottom: 10px;
}

.completion-intro {
  color: #555;
  margin-bottom: 28px;
  font-size: 15px;
}

.completion-id-warning {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.2;
  color: #b91c1c;
  letter-spacing: 0.02em;
  text-align: left;
}

.user-id-block {
  background: #fff4db;
  border: 2px solid #f59e0b;
  border-radius: 8px;
  padding: 16px 20px;
  margin-bottom: 24px;
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  animation: user-id-critical-pulse 1.8s ease-out infinite;
}

.user-id-label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #9a3412;
  margin-bottom: 10px;
}

.user-id-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}

.user-id-display {
  font-family: "Courier New", Courier, monospace;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: #333;
  word-break: break-all;
  user-select: all;
}

.copy-btn {
  background: #d97706;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 14px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.15s;
  box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.35);
  animation: copy-btn-emphasis 1.6s ease-out infinite;
}

.copy-btn:hover {
  background: #b45309;
}

.copy-feedback {
  display: block;
  font-size: 13px;
  color: #4caf50;
  min-height: 18px;
  margin-top: 6px;
}

@keyframes user-id-critical-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.45);
  }
  70% {
    box-shadow: 0 0 0 12px rgba(245, 158, 11, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(245, 158, 11, 0);
  }
}

@keyframes copy-btn-emphasis {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0.35);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(217, 119, 6, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 119, 6, 0);
  }
}

.revocation-notice {
  background: #fff8e1;
  border-left: 4px solid #ffc107;
  border-radius: 4px;
  padding: 14px 16px;
  text-align: left;
  margin-bottom: 28px;
  font-size: 14px;
  color: #555;
  line-height: 1.6;
}

.revocation-notice a {
  color: #667eea;
  font-weight: 600;
}

.save-section {
  text-align: left;
}

.save-hint {
  font-size: 14px;
  color: #666;
  margin-bottom: 12px;
  text-align: center;
}

.save-actions {
  display: flex;
  justify-content: center;
  margin-bottom: 14px;
}

.save-btn {
  background: #764ba2;
  color: white;
  border: none;
  border-radius: 6px;
  padding: 10px 20px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}

.save-btn:hover {
  background: #653d8e;
}

@media print {
  body > * {
    display: none !important;
  }
  #completion-page {
    display: block !important;
    background: white !important;
    padding: 0 !important;
    min-height: unset !important;
  }
  .completion-card {
    box-shadow: none !important;
    max-width: 100% !important;
    padding: 20px !important;
  }
  .save-section,
  .copy-btn,
  .save-btn {
    display: none !important;
  }
}
