:root {
  --bg-primary: #0f172a;
  --bg-card: #1e293b;
  --bg-card-hover: #334155;
  --bg-input: #0f172a;
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-primary: #f59e0b;
  --accent-primary-hover: #d97706;
  --accent-secondary: #6366f1;
  --accent-success: #10b981;
  --border-color: #334155;
  --border-focus: #f59e0b;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-full: 9999px;
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.4), 0 2px 4px -2px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.5), 0 4px 6px -4px rgba(0, 0, 0, 0.4);
  --font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 16px;
  line-height: 1.5;
}

.app-wrapper {
  width: 100%;
  max-width: 480px;
  display: flex;
  flex-direction: column;
  min-height: calc(100vh - 32px);
}

.app-header {
  text-align: center;
  padding: 16px 0 24px;
}

.app-title {
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.025em;
  background: linear-gradient(135deg, #fbbf24 0%, #f59e0b 50%, #ea580c 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

#center-panel {
  flex: 1;
  display: flex;
  flex-direction: column;
  width: 100%;
}

/* Setup Card & Form */
.setup-card {
  background-color: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.setup-card-header {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 12px;
}

.setup-card-title {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--text-primary);
}

.setup-card-desc {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.setup-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.option-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid rgba(51, 65, 85, 0.5);
}

.option-group:last-of-type {
  border-bottom: none;
}

.option-info {
  flex: 1;
  padding-right: 12px;
}

.option-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--text-primary);
}

.option-hint {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}

/* Category Segmented Control */
.option-group-vertical {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.option-group-vertical .option-info {
  padding-right: 0;
  width: 100%;
}

.segment-control {
  display: flex;
  width: 100%;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 4px;
  gap: 4px;
  box-shadow: var(--shadow-sm);
}

.segment-btn {
  flex: 1;
  padding: 10px 6px;
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  text-align: center;
  user-select: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.segment-btn:hover {
  color: var(--text-primary);
}

.segment-btn.active {
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
}

.segment-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
}


/* Stepper Control */
.stepper-control {
  display: inline-flex;
  align-items: center;
  background-color: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stepper-btn {
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.25rem;
  font-weight: bold;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
  user-select: none;
}

.stepper-btn:active {
  background-color: var(--bg-card-hover);
  color: var(--accent-primary);
}

.stepper-btn:focus-visible {
  outline: 2px solid var(--accent-primary);
}

.stepper-input {
  width: 48px;
  height: 44px;
  background: transparent;
  border: none;
  color: var(--text-primary);
  font-size: 1.0625rem;
  font-weight: 700;
  text-align: center;
  appearance: textfield;
  -moz-appearance: textfield;
}

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

.stepper-input:focus {
  outline: none;
  background-color: rgba(245, 158, 11, 0.08);
}

/* Action Button */
.btn-primary {
  width: 100%;
  padding: 16px 24px;
  background: linear-gradient(135deg, #f59e0b 0%, #ea580c 100%);
  color: #ffffff;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: 0.025em;
  text-transform: uppercase;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  transition: transform 0.15s ease, box-shadow 0.15s ease, filter 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 8px;
  min-height: 52px;
}

.btn-primary:hover {
  filter: brightness(1.08);
  box-shadow: 0 12px 20px -3px rgba(245, 158, 11, 0.35);
}

.btn-primary:active {
  transform: scale(0.98);
}

/* Footer / Version */
.app-footer {
  text-align: center;
  padding: 16px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
