*,
*::before,
*::after {
  box-sizing: border-box;
}

.builder-ui {
  font-family: "Manrope", "Open Sans", sans-serif;
}

.builder-card {
  border: 1px solid #dbe2ea;
  border-radius: 16px;
  box-shadow: 0 12px 35px rgba(15, 23, 42, 0.06);
  background: #ffffff;
}

.preview-shell {
  background: radial-gradient(circle at top, #f8fafc 0%, #f1f5f9 65%, #edf2f7 100%);
  transition: background 0.25s ease;
}

.preview-shell.is-dark {
  background: radial-gradient(circle at top, #1f2937 0%, #111827 55%, #020617 100%);
}

.preview-theme-btn {
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  background: #ffffff;
  color: #334155;
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1;
  padding: 0.5rem 0.9rem;
  transition: all 0.2s ease;
}

.preview-theme-btn:hover {
  border-color: #94a3b8;
  color: #0f172a;
}

.preview-theme-btn.is-active {
  border-color: #0284c7;
  background: #0284c7;
  color: #ffffff;
}

.builder-tab {
  border: 1px solid #dbe2ea;
  border-radius: 10px;
  background: #ffffff;
  color: #334155;
  padding: 0.55rem 0.85rem;
  font-size: 0.91rem;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  transition: all 0.2s ease;
}

.builder-tab:hover {
  border-color: #94a3b8;
}

.builder-tab.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #f8fafc;
}

.example-link {
  text-align: left;
  color: #0369a1;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.example-link:hover {
  color: #0c4a6e;
}

.timer-type-card {
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  background: #ffffff;
  color: #1e293b;
  font-size: 0.96rem;
  font-weight: 600;
  line-height: 1.25;
  min-height: 84px;
  padding: 1rem;
  transition: all 0.2s ease;
}

.timer-type-card:hover {
  border-color: #7dd3fc;
}

.timer-type-card.is-active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.16);
}

.section-title {
  color: #0f172a;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
}

.field-label {
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.25;
}

.field-input {
  border: 1px solid #cbd5e1;
  border-radius: 0.7rem;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.9rem;
  line-height: 1.2;
  min-height: 2.6rem;
  padding: 0.55rem 0.75rem;
}

.field-input:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.18);
  outline: none;
}

.field-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 20 20' fill='none'%3E%3Cpath d='M5 7L10 12L15 7' stroke='%23475569' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.65rem center;
  padding-right: 2.1rem;
}

.builder-ui input[type="color"].field-color {
  appearance: none !important;
  -webkit-appearance: none !important;
  inline-size: 2.5rem !important;
  block-size: 2.5rem !important;
  min-inline-size: 2.5rem;
  min-block-size: 2.5rem;
  max-inline-size: 2.5rem;
  max-block-size: 2.5rem;
  padding: 0 !important;
  border: 1px solid #cbd5e1;
  border-radius: 999px !important;
  background: transparent !important;
  cursor: pointer;
  overflow: hidden;
}

.builder-ui input[type="color"].field-color::-webkit-color-swatch-wrapper {
  padding: 0;
}

.builder-ui input[type="color"].field-color::-webkit-color-swatch {
  border: 0;
  border-radius: 999px;
}

.builder-ui input[type="color"].field-color::-moz-color-swatch {
  border: 0;
  border-radius: 999px;
}

.field-unit {
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 600;
}

.weekday-chip {
  cursor: pointer;
  user-select: none;
}

.weekday-chip input {
  display: none;
}

.weekday-chip span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.35rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.6rem;
  background: #ffffff;
  padding: 0.35rem 0.55rem;
  color: #334155;
  font-size: 0.8rem;
  font-weight: 700;
  transition: all 0.2s ease;
}

.weekday-chip input:checked + span {
  border-color: #0284c7;
  background: #0284c7;
  color: #ffffff;
}

.preset-card {
  border: 1px solid #dbe2ea;
  border-radius: 14px;
  padding: 0.75rem;
  text-align: left;
  transition: all 0.2s ease;
  background: #ffffff;
}

.preset-card:hover {
  border-color: #7dd3fc;
}

.preset-card.is-active {
  border-color: #0284c7;
  box-shadow: 0 0 0 2px rgba(2, 132, 199, 0.16);
}

.preset-thumb {
  align-items: center;
  background: linear-gradient(170deg, #f8fafc, #eef2f7);
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  display: flex;
  justify-content: center;
  min-height: 128px;
  overflow: hidden;
  padding: 0.6rem;
}

.preset-live {
  width: 100%;
}

.preset-name {
  display: block;
  margin-top: 0.45rem;
  color: #334155;
  font-size: 0.9rem;
  font-weight: 600;
}

.next-step-btn {
  background: #0284c7;
  border-radius: 999px;
  border: 0;
  color: #ffffff;
  font-size: 0.87rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.75rem 1.25rem;
  transition: all 0.2s ease;
}

.next-step-btn:hover {
  background: #0369a1;
  transform: translateY(-1px);
}

.code-options {
  border: 1px solid #dbe2ea;
  border-radius: 0.75rem;
  background: #f8fafc;
  padding: 0.75rem;
}

.settings-grid {
  display: grid;
  gap: 1rem;
}

.code-textarea {
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: #f8fafc;
  color: #0f172a;
  font-family: "JetBrains Mono", "Consolas", monospace;
  font-size: 0.84rem;
  line-height: 1.45;
  min-height: 140px;
  padding: 0.75rem;
  width: 100%;
  resize: vertical;
}

.code-textarea:focus {
  border-color: #0ea5e9;
  box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.18);
  outline: none;
}

@media (min-width: 640px) {
  .builder-tab {
    font-size: 0.94rem;
    padding: 0.6rem 1rem;
  }

  .timer-type-card {
    font-size: 0.98rem;
  }
}

@media (min-width: 1200px) {
  .settings-grid {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
