.tool-main-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: 1.25rem;
  max-width: 520px;
  margin: 0 auto;
  padding: 1.75rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  box-shadow: var(--shadow-base);
}

.comparator-panel {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.panel-section {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-base);
  opacity: 0.7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.watch-input-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.watch-input-row input {
  flex: 1;
  padding: 0.65rem 0.75rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
  border-radius: 0.75rem;
  color: var(--text-base);
  font-size: 0.875rem;
  transition: border-color 0.2s;
  box-sizing: border-box;
}

.watch-input-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.btn-add {
  padding: 0.6rem 1rem;
  background: var(--accent);
  color: var(--on-accent);
  border: none;
  border-radius: 0.75rem;
  font-size: 0.8125rem;
  font-weight: 700;
  cursor: pointer;
  transition: opacity 0.2s;
  white-space: nowrap;
}

.btn-add:hover {
  opacity: 0.85;
}

.dims-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.dim-field {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.dim-field label {
  font-size: 0.65rem;
  font-weight: 600;
  color: var(--text-base);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.dim-field input {
  padding: 0.55rem 0.65rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
  border-radius: 0.6rem;
  color: var(--text-base);
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.2s;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.dim-field input::-webkit-inner-spin-button,
.dim-field input::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.dim-field input:focus {
  outline: none;
  border-color: var(--accent);
}

.input-with-unit {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.input-with-unit input {
  flex: 1;
}

.dim-unit {
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-base);
  opacity: 0.45;
  min-width: 1.5rem;
}

.wrist-row {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.wrist-row input {
  flex: 1;
  padding: 0.55rem 0.65rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
  border-radius: 0.6rem;
  color: var(--text-base);
  font-size: 0.875rem;
  font-weight: 600;
  transition: border-color 0.2s;
  box-sizing: border-box;
  -moz-appearance: textfield;
}

.wrist-row input:focus {
  outline: none;
  border-color: var(--accent);
}

.unit-toggle {
  display: flex;
  background: var(--bg-muted);
  border: 1px solid var(--border-color);
  border-radius: 0.4rem;
  padding: 0.1rem;
}

.unit-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.2rem 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
  transition: all 0.15s ease;
}

.unit-btn.active {
  background: var(--accent);
  color: var(--color-white);
}

/* Visualizer canvas */
.visualizer-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.visualizer-wrapper canvas {
  max-width: 100%;
  border-radius: 0.75rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
}

/* Watch list */
.watch-list {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
  max-height: 220px;
  overflow-y: auto;
}

.watch-list-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.625rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
  border-radius: 0.6rem;
  cursor: pointer;
  transition: all 0.2s;
  font-size: 0.8125rem;
}

.watch-list-item:hover {
  border-color: var(--accent);
}

.watch-list-item.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-page));
}

.watch-dot {
  width: 0.5rem;
  height: 0.5rem;
  border-radius: 50%;
  flex-shrink: 0;
}

.watch-name-label {
  flex: 1;
  font-weight: 600;
  color: var(--text-base);
}

.watch-dims-label {
  font-size: 0.65rem;
  color: var(--text-base);
  opacity: 0.5;
  font-variant-numeric: tabular-nums;
}

.watch-fit-badge {
  font-size: 0.6rem;
  font-weight: 700;
  padding: 0.15rem 0.4rem;
  border-radius: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.fit-excellent {
  background: color-mix(in srgb, var(--fit-excellent) 20%, transparent);
  color: var(--fit-excellent);
}

.fit-good {
  background: color-mix(in srgb, var(--fit-good) 20%, transparent);
  color: var(--fit-good);
}

.fit-borderline {
  background: color-mix(in srgb, var(--fit-borderline) 20%, transparent);
  color: var(--fit-borderline);
}

.fit-large {
  background: color-mix(in srgb, var(--fit-large) 20%, transparent);
  color: var(--fit-large);
}

.btn-remove {
  background: none;
  border: none;
  color: var(--text-base);
  opacity: 0.3;
  cursor: pointer;
  padding: 0.2rem;
  border-radius: 0.3rem;
  transition: opacity 0.2s;
  display: flex;
  align-items: center;
}

.btn-remove:hover {
  opacity: 0.8;
  background: color-mix(in srgb, var(--accent) 15%, transparent);
}

/* Legend */
.legend-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--bg-page);
  border: 1px solid var(--border-base);
  border-radius: 0.6rem;
  font-size: 0.65rem;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--text-base);
  opacity: 0.7;
}

.legend-swatch {
  width: 0.6rem;
  height: 0.6rem;
  border-radius: 50%;
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 1.5rem 1rem;
  color: var(--text-base);
  opacity: 0.4;
  font-size: 0.8125rem;
}

/* Info box */
.info-box {
  padding: 0.625rem 0.75rem;
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-page));
  border: 1px solid color-mix(in srgb, var(--accent) 20%, var(--border-base));
  border-radius: 0.6rem;
  font-size: 0.7rem;
  color: var(--text-base);
  opacity: 0.75;
  line-height: 1.45;
}

.info-box strong {
  opacity: 1;
}

@media (max-width: 520px) {
:root {
  --fit-excellent: #22c55e;
  --fit-good: #86efac;
  --fit-borderline: #facc15;
  --fit-large: #ef4444;
}

.tool-main-card {
    padding: 1rem;
  }
  .dims-grid {
    grid-template-columns: 1fr;
  }
  .watch-input-row {
    flex-direction: column;
  }
  .btn-add {
    width: 100%;
  }
}
