* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: system-ui, sans-serif;
  background: #12141a;
  color: #f1ede6;
  padding: 16px;
}

body.full-height {
  height: 100vh;
  align-items: stretch;
  justify-content: flex-start;
}

.brand-logo {
  width: 40px;
  height: 40px;
}

.login-box {
  background: #1d2025;
  border: 1px solid #34383e;
  border-radius: 8px;
  padding: 24px;
  max-width: 360px;
  width: 100%;
  text-align: center;
}

.login-box .brand-logo {
  width: 56px;
  height: 56px;
}

.brand-header {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
  padding-bottom: 12px;
}

.brand-header h1 {
  margin: 0;
}

.login-box input {
  width: 100%;
  padding: 10px;
  margin: 12px 0;
  border-radius: 4px;
  border: 1px solid #34383e;
  font-size: 14px;
}

.login-box button {
  width: 100%;
  padding: 10px;
  border: none;
  border-radius: 4px;
  background: #e9435d;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
}

.hidden { display: none !important; }

#path-view {
  max-width: 480px;
  width: 100%;
}

#path-view.full-height {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-width: 600px;
  margin: 0 auto;
}

#path-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
  position: relative;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

#path-list::-webkit-scrollbar {
  display: none;
}

#path-view.full-height #path-list {
  flex: 1;
  min-height: 0;
  max-height: none;
}

#path-svg {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 0;
  pointer-events: none;
}

.path-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  padding: 24px 0;
  text-align: left;
}

.path-track {
  position: relative;
  width: 140px;
  height: 40px;
  flex-shrink: 0;
}

.path-node-wrap {
  position: absolute;
  top: 0;
  width: 40px;
  height: 40px;
}

.path-node-wrap.side-left { left: 0; }
.path-node-wrap.side-right { left: 100px; }

.path-row .lesson-node {
  margin: 0;
}

.path-quote {
  flex: 1;
  font-size: 12px;
  line-height: 1.35;
  color: #b8b4ab;
  padding-left: 12px;
}

.path-section {
  font-weight: bold;
  font-size: 13px;
  letter-spacing: 1px;
  margin: 20px 0 8px 0;
}

.lesson-node {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 2px solid #34383e;
  background: #1d2025;
  color: #f1ede6;
  font-size: 13px;
  cursor: pointer;
}

.lesson-node.locked {
  background: #2a2d33;
  border-color: #2a2d33;
  color: #6b6f76;
  cursor: not-allowed;
}

.lesson-node.completed {
  background: #2f6f4e;
  border-color: #2f6f4e;
}

.lesson-node.current {
  border-color: #e9435d;
  border-width: 3px;
}

#lesson-view {
  max-width: 480px;
  width: 100%;
  text-align: center;
}

body.full-height #lesson-view {
  margin: auto;
}

.lesson-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  text-align: left;
}

.lesson-header-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.lesson-header-text strong {
  font-size: 14px;
}

.lesson-header-text #round-counter {
  font-size: 12px;
  color: #b8b4ab;
}

.cancel-btn {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #34383e;
  background: #1d2025;
  color: #b8b4ab;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.cancel-btn:hover {
  border-color: #e9435d;
  color: #e9435d;
}

#exercise-container button,
#exercise-container input {
  margin: 8px 4px;
  padding: 8px 14px;
  font-size: 14px;
}

.eq-graph {
  position: relative;
  height: 150px;
  background: #1a1c22;
  border: 1px solid #34383e;
  border-radius: 8px;
  margin: 16px 0;
  overflow: hidden;
}

.eq-graph-clickable {
  cursor: pointer;
}

.eq-graph-clickable:hover {
  background: #20232b;
}

.eq-graph-gridline {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(255, 255, 255, 0.08);
}

.eq-graph-centerline {
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  background: rgba(255, 255, 255, 0.15);
}

.eq-graph-label {
  position: absolute;
  bottom: 4px;
  transform: translateX(-50%);
  font-size: 10px;
  color: #6b6f76;
}

.eq-graph-curve-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.eq-graph-analyzer {
  fill: rgba(180, 184, 195, 0.16);
  stroke: rgba(180, 184, 195, 0.4);
  stroke-width: 1;
}

.eq-graph-curve {
  fill: none;
  stroke: #e9435d;
  stroke-width: 2.5;
}

.eq-graph-solution-line {
  stroke: #f1ede6;
  stroke-width: 2;
  stroke-dasharray: 5 4;
}

.eq-graph-tolerance-zone {
  position: absolute;
  top: 0;
  bottom: 0;
  background: rgba(47, 111, 78, 0.3);
  border-left: 1px solid rgba(47, 111, 78, 0.7);
  border-right: 1px solid rgba(47, 111, 78, 0.7);
}

#exercise-container .eq-cut-marker {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  cursor: grab;
  touch-action: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  opacity: 0.4;
  transition: opacity 0.15s ease;
}

#exercise-container .eq-cut-marker.active {
  opacity: 1;
  cursor: grab;
}

#exercise-container .eq-cut-marker:hover {
  opacity: 1;
}

.eq-cut-marker-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background-color: var(--marker-color);
  border: 2px solid rgba(255, 255, 255, 0.35);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.eq-cut-marker.active .eq-cut-marker-dot {
  border-color: #fff;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.25);
}

.eq-cut-marker:hover .eq-cut-marker-dot {
  box-shadow: 0 0 10px 3px var(--marker-color);
  transform: scale(1.15);
}

.eq-cut-marker-label {
  font-size: 11px;
  font-weight: 600;
  color: #f1ede6;
  white-space: nowrap;
}

.eq-cut-marker.correct .eq-cut-marker-dot {
  background-color: #2f6f4e;
  border-color: #fff;
}

.eq-cut-marker.incorrect .eq-cut-marker-dot {
  background-color: #b23b3b;
  border-color: #fff;
}

.eq-controls-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
}

#exercise-container .eq-ok-btn {
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  margin: 0 0 0 auto;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #e9435d;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.eq-ok-btn:hover:not(:disabled) {
  filter: brightness(1.1);
}

.eq-ok-btn:disabled {
  background: #2a2d33;
  color: #6b6f76;
  cursor: not-allowed;
}

.eq-feedback {
  font-size: 14px;
  min-height: 20px;
}

.eq-feedback.correct {
  color: #4fae7c;
}

.eq-feedback.incorrect {
  color: #d97575;
}

.ab-compare {
  display: flex;
  align-items: center;
  gap: 10px;
}

#exercise-container .play-stop-btn {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid #34383e;
  background: #1d2025;
  color: #f1ede6;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  margin: 0;
}

.play-stop-btn:hover {
  border-color: #e9435d;
}

.ab-compare-caption {
  font-size: 13px;
  color: #b8b4ab;
}

.ab-compare-state {
  font-size: 13px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
}

.ab-compare-state.original {
  background: #2a2d33;
  color: #f1ede6;
}

.ab-compare-state.processed {
  background: #e9435d;
  color: #fff;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
}

.overlay.hidden {
  display: none;
}

.overlay-box {
  background: #1d2025;
  border: 1px solid #34383e;
  border-radius: 8px;
  padding: 24px;
  text-align: center;
}

.overlay-box button {
  margin-top: 12px;
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  background: #e9435d;
  color: #fff;
  cursor: pointer;
}
