:root {
  --primary: #E11D48;
  --primary-hover: #BE123C;
  --primary-light: #FFF0F3;
  --primary-shadow: rgba(225, 29, 72, 0.25);
  --accent: #BE123C;
  --accent-hover: #9F1239;
  --accent-light: #FDA4AF;
  --bg: #FFF0F3;
  --surface: #FFFFFF;
  --surface-hover: #FFF0F3;
  --text: #4C0519;
  --text-secondary: #831843;
  --text-muted: #F9A8D4;
  --border: #FDA4AF;
  --border-dark: #E11D48;
  --shadow-sm: 0 4px 6px -1px rgba(225, 29, 72, 0.08);
  --shadow-md: 0 10px 25px -5px rgba(225, 29, 72, 0.12);
  --shadow-lg: 0 20px 40px -8px rgba(225, 29, 72, 0.15);
  --clay: 0 8px 0 0 rgba(225, 29, 72, 0.2);
  --clay-pressed: 0 2px 0 0 rgba(225, 29, 72, 0.2);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --radius-full: 999px;
}

[data-theme="dark"] {
  --primary: #FB7185;
  --primary-hover: #FDA4AF;
  --primary-light: #2d0a15;
  --primary-shadow: rgba(251, 113, 133, 0.2);
  --accent: #FDA4AF;
  --accent-hover: #FECDD3;
  --accent-light: #4C0519;
  --bg: #1a0a0f;
  --surface: #2d0a15;
  --surface-hover: #3d0f1e;
  --text: #FFF0F3;
  --text-secondary: #FDA4AF;
  --text-muted: #be7a8a;
  --border: #4C0519;
  --border-dark: #FB7185;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 10px 25px -5px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 20px 40px -8px rgba(0, 0, 0, 0.4);
  --clay: 0 8px 0 0 rgba(251, 113, 133, 0.15);
  --clay-pressed: 0 2px 0 0 rgba(251, 113, 133, 0.15);
}

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Quicksand', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overflow-x: hidden;
  transition: background 0.3s, color 0.3s;
  background-image: url('../images/bg.png');
  background-size: cover;
  background-position: center 30%;
  background-attachment: fixed;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: rgba(255, 240, 243, 0.7);
  backdrop-filter: blur(2px);
  z-index: 0;
  transition: background 0.3s;
}

[data-theme="dark"] body::before {
  background: rgba(26, 10, 15, 0.78);
}

#app {
  position: relative;
  z-index: 1;
  max-width: 480px;
  margin: 0 auto;
  padding: 0 16px 80px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 4px 12px;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.app-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--clay);
  transition: box-shadow 0.2s;
  flex-shrink: 0;
}

.app-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 20px;
  color: var(--text);
  line-height: 1.2;
}

.app-subtitle {
  font-size: 12px;
  color: var(--text-muted);
  display: block;
}

.theme-toggle {
  width: 44px;
  height: 44px;
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 20px;
  cursor: pointer;
  box-shadow: var(--clay);
  transition: all 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.theme-toggle:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

.tab-panel {
  display: none;
  flex: 1;
  animation: fadeUp 0.35s ease-out;
}

.tab-panel.active {
  display: block;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

.step-display-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 24px;
  text-align: center;
  margin-bottom: 4px;
  box-shadow: var(--clay), var(--shadow-md);
  cursor: pointer;
  transition: all 0.15s;
  position: relative;
}

.step-display-card:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed), var(--shadow-sm);
}

.step-display-card .step-number {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 56px;
  color: var(--primary);
  line-height: 1;
  letter-spacing: -1px;
  transition: transform 0.15s;
}

.step-display-card .step-unit {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 18px;
  color: var(--text-muted);
  margin-left: 4px;
}

.step-input {
  width: 100%;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 48px;
  color: var(--primary);
  text-align: center;
  background: var(--primary-light);
  border: 3px solid var(--primary);
  border-radius: var(--radius-md);
  padding: 8px;
  outline: none;
  -moz-appearance: textfield;
}

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

.step-input.hidden { display: none; }

.step-hint {
  text-align: center;
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.preset-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.preset-btn {
  flex: 1;
  min-width: 0;
  padding: 12px 8px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 13px;
  border: 3px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: var(--clay);
  white-space: nowrap;
}

.preset-btn:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

.preset-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.preset-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 8px 0 0 rgba(225, 29, 72, 0.3);
}

.preset-btn.active:active {
  box-shadow: 0 2px 0 0 rgba(225, 29, 72, 0.3);
}

.preset-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: translateY(4px);
  box-shadow: 0 4px 0 0 rgba(225, 29, 72, 0.06);
}

.slider-container {
  margin-bottom: 20px;
  padding: 12px 4px;
}

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  background: var(--border);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.3);
  cursor: pointer;
  transition: transform 0.12s;
}

input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.15);
}

input[type="range"]::-moz-range-thumb {
  width: 28px;
  height: 28px;
  background: var(--primary);
  border-radius: 50%;
  border: 3px solid var(--surface);
  box-shadow: 0 3px 8px rgba(225, 29, 72, 0.3);
  cursor: pointer;
}

.slider-labels {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 6px;
  padding: 0 2px;
}

.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.rounded-select {
  width: 100%;
  padding: 16px 18px;
  font-family: 'Quicksand', sans-serif;
  font-size: 15px;
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='10' viewBox='0 0 16 10'%3E%3Cpath d='M2 2l6 6 6-6' stroke='%23E11D48' stroke-width='3' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  transition: border-color 0.15s;
  box-shadow: var(--clay);
}

.rounded-select:focus {
  border-color: var(--primary);
}

.rounded-select optgroup, .rounded-select option {
  color: var(--text);
  background: var(--surface);
}

.result-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 18px;
  margin-bottom: 16px;
  background: var(--primary-light);
  border: 3px solid var(--primary);
  border-radius: var(--radius-md);
  animation: popIn 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.result-banner.error {
  background: #fef2f2;
  border-color: #ef4444;
}

[data-theme="dark"] .result-banner.error {
  background: #450a0a;
  border-color: #ef4444;
}

.result-icon {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}

.result-banner.error .result-icon {
  background: #ef4444;
}

.result-msg {
  flex: 1;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.result-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.result-close:hover {
  background: rgba(0,0,0,0.05);
}

@keyframes popIn {
  from { transform: scale(0.85); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.submit-btn {
  width: 100%;
  padding: 18px 24px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  border: 3px solid var(--accent);
  border-radius: var(--radius-xl);
  background: var(--accent);
  color: white;
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: 0 8px 0 0 rgba(190, 18, 60, 0.3), var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-bottom: 24px;
}

.submit-btn:active {
  transform: translateY(6px);
  box-shadow: 0 2px 0 0 rgba(190, 18, 60, 0.3), var(--shadow-sm);
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: translateY(4px);
  box-shadow: 0 4px 0 0 rgba(190, 18, 60, 0.2);
}

.submit-btn .btn-icon {
  font-size: 22px;
  transition: transform 0.2s;
}

.submit-btn:not(:disabled):hover .btn-icon {
  transform: translateX(4px);
}

.history-section {
  margin-top: 4px;
}

.history-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.history-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.history-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13px;
  box-shadow: 0 3px 0 0 rgba(225, 29, 72, 0.12);
}

.history-item .h-step {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  color: var(--primary);
}

.history-item .h-account {
  color: var(--text-secondary);
}

.history-item .h-time {
  color: var(--text-muted);
  font-size: 11px;
}

.history-empty {
  text-align: center;
  padding: 18px;
  color: var(--text-muted);
  font-size: 13px;
}

.chart-container {
  margin-top: 14px;
  background: var(--surface);
  border: 2.5px solid var(--border);
  border-radius: var(--radius-md);
  padding: 8px 4px 2px;
  box-shadow: 0 3px 0 0 rgba(225, 29, 72, 0.08);
}

.chart-container svg {
  display: block;
  width: 100%;
  height: auto;
}

.add-account-hint {
  font-family: 'Fredoka', sans-serif;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-align: center;
  padding-bottom: 4px;
}

.add-account-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--clay), var(--shadow-md);
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 24px;
}

.add-account-card input {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  transition: border-color 0.15s;
}

.add-account-card input:focus {
  border-color: var(--primary);
}

.add-account-card input::placeholder {
  color: var(--text-muted);
}

.add-account-card button {
  padding: 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15px;
  border: 3px solid var(--primary);
  border-radius: var(--radius-md);
  background: var(--primary);
  color: white;
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: var(--clay);
}

.add-account-card button:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

.section-title {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text-secondary);
  margin-bottom: 12px;
  display: block;
}

.account-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.account-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--clay);
  transition: all 0.12s;
}

.account-item .info {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-item .name {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text);
}

.account-item .active-badge {
  display: inline-block;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 10px;
  border-radius: var(--radius-full);
}

.account-item .actions {
  display: flex;
  gap: 6px;
}

.btn-sm {
  padding: 8px 14px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 11px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: 0 4px 0 0 rgba(225, 29, 72, 0.12);
}

.btn-sm:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 0 rgba(225, 29, 72, 0.12);
}

.btn-sm:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm.primary {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
  box-shadow: 0 4px 0 0 rgba(225, 29, 72, 0.25);
}

.btn-sm.danger {
  color: #ef4444;
  border-color: #fca5a5;
  box-shadow: 0 4px 0 0 rgba(239, 68, 68, 0.15);
}

.btn-sm.danger:hover {
  background: #fef2f2;
  border-color: #ef4444;
}

.log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.clear-btn {
  padding: 8px 18px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 12px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-full);
  background: var(--surface);
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.12s;
  box-shadow: var(--clay);
}

.clear-btn:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

.log-panel {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  min-height: 240px;
  box-shadow: var(--clay), var(--shadow-md);
}

.log-content {
  font-family: 'Quicksand', monospace;
  font-size: 13px;
  color: var(--text-muted);
  line-height: 1.8;
  max-height: 320px;
  overflow-y: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

.log-content .log-prompt {
  color: var(--primary);
  font-weight: 700;
}

.log-content .log-line { color: var(--text-secondary); }
.log-content .log-line.success { color: var(--primary); }
.log-content .log-line.error { color: #ef4444; }
.log-content .log-line.info { color: var(--accent); }

.log-content::-webkit-scrollbar {
  width: 5px;
}

.log-content::-webkit-scrollbar-track {
  background: transparent;
}

.log-content::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 480px);
  display: flex;
  padding: 6px 8px 10px;
  gap: 4px;
  background: var(--surface);
  border-top: 3px solid var(--border);
  box-shadow: 0 -4px 20px rgba(225, 29, 72, 0.06);
  z-index: 100;
}

.nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px 6px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
}

.nav-item:hover {
  background: var(--surface-hover);
  color: var(--text-secondary);
}

.nav-item.active {
  background: var(--primary-light);
  color: var(--primary);
}

.nav-icon {
  font-size: 22px;
  line-height: 1;
}

.nav-label {
  font-size: 11px;
}

.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  margin-top: 20px;
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--clay);
}

.toggle-row .toggle-label {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  color: var(--text-secondary);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(76, 5, 25, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  animation: fadeIn 0.2s ease-out;
}

.modal-card {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px 20px;
  width: 100%;
  max-width: 360px;
  box-shadow: var(--clay), var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-card h3 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin-bottom: 16px;
}

.modal-card input {
  width: 100%;
  padding: 14px 16px;
  font-family: 'Quicksand', sans-serif;
  font-size: 14px;
  border: 3px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  color: var(--text);
  outline: none;
  margin-bottom: 16px;
}

.modal-card input:focus {
  border-color: var(--primary);
}

.modal-actions {
  display: flex;
  gap: 10px;
}

.modal-actions button {
  flex: 1;
  padding: 12px;
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 14px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.12s;
}

.modal-actions .modal-confirm {
  background: var(--primary);
  color: white;
  border: 3px solid var(--primary);
  box-shadow: var(--clay);
}

.modal-actions .modal-confirm:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

.modal-actions .modal-cancel {
  background: var(--surface);
  color: var(--text-secondary);
  border: 3px solid var(--border);
  box-shadow: var(--clay);
}

.modal-actions .modal-cancel:active {
  transform: translateY(6px);
  box-shadow: var(--clay-pressed);
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.confetti-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 300;
  overflow: hidden;
}

.confetti-piece {
  position: absolute;
  width: 10px;
  height: 10px;
  top: -10px;
  animation: confettiFall linear forwards;
}

@keyframes confettiFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(100vh) rotate(720deg); opacity: 0; }
}

.tutorial-btn {
  width: 32px;
  height: 32px;
  border: 2.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 15px;
  cursor: pointer;
  transition: all 0.15s;
  box-shadow: var(--clay);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 1;
}

.tutorial-btn:active {
  transform: translateY(4px);
  box-shadow: var(--clay-pressed);
}

.tutorial-btn:hover {
  border-color: var(--primary);
}

.tutorial-modal {
  background: var(--surface);
  border: 3px solid var(--border);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--clay), var(--shadow-lg);
  animation: popIn 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  overflow: hidden;
}

.tutorial-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px 14px;
  border-bottom: 2px solid var(--border);
  flex-shrink: 0;
}

.tutorial-header h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
}

.tutorial-close {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.tutorial-close:hover {
  background: rgba(0,0,0,0.05);
}

.tutorial-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
  line-height: 1.7;
  font-size: 14px;
  color: var(--text-secondary);
}

.tutorial-body h1 { display: none; }
.tutorial-body h2 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 600;
  font-size: 18px;
  color: var(--text);
  margin: 20px 0 10px;
}
.tutorial-body h3 {
  font-family: 'Fredoka', sans-serif;
  font-weight: 500;
  font-size: 15px;
  color: var(--text);
  margin: 16px 0 8px;
}

.tutorial-body p {
  margin-bottom: 10px;
}

.tutorial-body img {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 2.5px solid var(--border);
  margin: 8px 0 14px;
  display: block;
}

.tutorial-body blockquote {
  background: var(--primary-light);
  border-left: 4px solid var(--primary);
  padding: 12px 16px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  margin: 12px 0;
  color: var(--text-secondary);
  font-size: 13px;
}

.tutorial-body code {
  background: var(--bg);
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 13px;
  border: 1px solid var(--border);
}

.tutorial-body pre {
  background: var(--bg);
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  overflow-x: auto;
  margin: 10px 0;
}

.tutorial-body pre code {
  background: none;
  border: none;
  padding: 0;
}

.tutorial-body hr {
  border: none;
  border-top: 2px solid var(--border);
  margin: 20px 0;
}

.tutorial-body ul {
  padding-left: 20px;
  margin-bottom: 10px;
}

.tutorial-body li {
  margin-bottom: 4px;
}

.tutorial-body strong {
  color: var(--text);
  font-weight: 700;
}

.tutorial-body a {
  color: var(--primary);
  text-decoration: underline;
  word-break: break-all;
}

.tutorial-body::-webkit-scrollbar {
  width: 5px;
}
.tutorial-body::-webkit-scrollbar-track {
  background: transparent;
}
.tutorial-body::-webkit-scrollbar-thumb {
  background: var(--border);
  border-radius: var(--radius-full);
}

.hidden { display: none !important; }

@media (max-width: 400px) {
  #app { padding-left: 12px; padding-right: 12px; }
  .step-display-card .step-number { font-size: 44px; }
  .step-display-card { padding: 20px 16px; }
  .preset-btn { font-size: 12px; padding: 10px 6px; }
  .submit-btn { font-size: 16px; padding: 16px; }
  .bottom-nav { padding-bottom: 8px; }
}
