/* ===== @morginfp Redeem — Design System ===== */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=JetBrains+Mono:wght@400;500&display=swap');

/* --- CSS Custom Properties --- */
:root {
  /* Primary Palette — Sky Blue */
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-200: #bae6fd;
  --primary-300: #7dd3fc;
  --primary-400: #38bdf8;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --primary-800: #075985;
  --primary-900: #0c4a6e;

  /* Neutrals */
  --gray-50: #fafafa;
  --gray-100: #f4f4f5;
  --gray-200: #e4e4e7;
  --gray-300: #d4d4d8;
  --gray-400: #a1a1aa;
  --gray-500: #71717a;
  --gray-600: #52525b;
  --gray-700: #3f3f46;
  --gray-800: #27272a;
  --gray-900: #18181b;
  --gray-950: #09090b;

  /* Semantic */
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;

  /* Light theme */
  --bg: #f4fbff;
  --bg-subtle: #eaf7ff;
  --surface: #ffffff;
  --surface-border: rgba(14, 165, 233, 0.12);
  --surface-hover: #f6fcff;
  --text-primary: #18181b;
  --text-secondary: #52525b;
  --text-tertiary: #a1a1aa;
  --glow-color: rgba(2, 132, 199, 0.15);
  --glow-color-strong: rgba(14, 165, 233, 0.25);
  --header-bg: rgba(255, 255, 255, 0.8);
  --header-border: rgba(14, 165, 233, 0.1);
  --input-bg: #ffffff;
  --input-border: var(--gray-200);
  --input-focus: var(--primary-500);
  --badge-bg: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  --stepper-inactive-bg: var(--gray-200);
  --stepper-inactive-text: var(--gray-500);
  --stepper-line: var(--gray-200);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 8px 32px rgba(14, 165, 233, 0.08);
  --btn-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 100%);
  --btn-gradient-hover: linear-gradient(135deg, #7dd3fc 0%, #0ea5e9 100%);
  --btn-activate-gradient: linear-gradient(135deg, #38bdf8 0%, #0284c7 50%, #075985 100%);

  /* Typography */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'Fira Code', monospace;

  /* Spacing */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 250ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- Dark Theme --- */
html.dark {
  --bg: #020f1c;
  --bg-subtle: #06233a;
  --surface: rgba(7, 34, 56, 0.72);
  --surface-border: rgba(14, 165, 233, 0.18);
  --surface-hover: rgba(8, 44, 72, 0.82);
  --text-primary: #f4f4f5;
  --text-secondary: #a1a1aa;
  --text-tertiary: #71717a;
  --glow-color: rgba(2, 132, 199, 0.22);
  --glow-color-strong: rgba(14, 165, 233, 0.38);
  --header-bg: rgba(2, 15, 28, 0.88);
  --header-border: rgba(14, 165, 233, 0.15);
  --input-bg: rgba(4, 28, 48, 0.68);
  --input-border: rgba(14, 165, 233, 0.22);
  --input-focus: var(--primary-400);
  --stepper-inactive-bg: rgba(14, 165, 233, 0.16);
  --stepper-inactive-text: var(--gray-400);
  --stepper-line: rgba(14, 165, 233, 0.22);
  --card-shadow: 0 1px 3px rgba(0, 0, 0, 0.2), 0 8px 32px rgba(14, 165, 233, 0.1);
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  -ms-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

html.dark {
  color-scheme: dark;
}

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background var(--transition-slow), color var(--transition-slow);
  overflow-x: hidden;
}

/* --- Background Glow Effect --- */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  z-index: 0;
  background:
    radial-gradient(ellipse 80% 60% at 0% 0%, var(--glow-color-strong) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 100% 0%, var(--glow-color) 0%, transparent 60%),
    radial-gradient(ellipse 80% 60% at 50% 100%, var(--glow-color-strong) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 0% 100%, var(--glow-color) 0%, transparent 50%),
    radial-gradient(ellipse 60% 80% at 100% 100%, var(--glow-color) 0%, transparent 50%);
  transition: background var(--transition-slow);
}

/* --- Header --- */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--header-bg);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid var(--header-border);
  transition: background var(--transition-base), border-color var(--transition-base);
}

.header-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  transition: color var(--transition-fast);
}

.logo:hover {
  color: var(--primary-500);
}

.logo-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  background: var(--badge-bg);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.nav-link {
  position: relative;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.nav-link:hover {
  color: var(--text-primary);
  background: var(--glow-color);
}

.nav-link.active {
  color: var(--primary-600);
}

.nav-link.active::after {
  content: '';
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 2.5px;
  border-radius: var(--radius-full);
  background: var(--primary-500);
}

html.dark .nav-link.active {
  color: var(--primary-400);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: color var(--transition-fast), background var(--transition-fast);
  font-size: 0.85rem;
}

.icon-btn:hover {
  color: var(--text-primary);
  background: var(--glow-color);
}

.icon-btn svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.lang-btn {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

/* --- Main Content --- */
.main {
  flex: 1;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  justify-content: safe center;
  max-width: 820px;
  width: 100%;
  margin: 0 auto;
  padding: 36px 24px 48px;
}

.page-title {
  font-size: 2.25rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
  margin-bottom: 6px;
  background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-600) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

html.dark .page-title {
  background: linear-gradient(135deg, #ffffff 0%, var(--primary-400) 100%);
  -webkit-background-clip: text;
  background-clip: text;
}

.page-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  margin-bottom: 34px;
}

/* --- Stepper --- */
.stepper {
  display: flex;
  align-items: center;
  margin-bottom: 30px;
  padding: 0 4px;
}

.step-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 0.9rem;
  font-weight: 700;
  flex-shrink: 0;
  transition: all var(--transition-base);
  position: relative;
}

.step-indicator.active {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(14, 165, 233, 0.3);
}

.step-indicator.completed {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.2);
}

.step-indicator.inactive {
  background: var(--stepper-inactive-bg);
  color: var(--stepper-inactive-text);
}

.step-line {
  flex: 1;
  height: 2px;
  background: var(--stepper-line);
  margin: 0 4px;
  border-radius: var(--radius-full);
  transition: background var(--transition-base);
  position: relative;
  overflow: hidden;
}

.step-line.completed {
  background: var(--primary-500);
}

.step-line.completed::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: linear-gradient(90deg, var(--primary-500), var(--primary-400));
  animation: lineShimmer 2s ease-in-out infinite;
}

@keyframes lineShimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

/* --- Card --- */
.card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-xl);
  padding: 34px;
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transition: background var(--transition-base), border-color var(--transition-base), box-shadow var(--transition-base);
  margin-bottom: 16px;
}

.card-section {
  padding-bottom: 24px;
  margin-bottom: 24px;
  border-bottom: 1px solid var(--surface-border);
}

.card-section:last-child {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

#section1 {
  border-bottom: none;
  padding-bottom: 0;
  margin-bottom: 0;
}

.flow-page[hidden],
.warning-note[hidden] {
  display: none;
}

.flow-page:not([hidden]) {
  animation: flowPageIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.flow-back {
  display: inline-flex;
  gap: 7px;
  margin-bottom: 16px;
}

@keyframes flowPageIn {
  from {
    opacity: 0;
    transform: translateX(18px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.section-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.section-desc {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.section-links {
  display: flex;
  gap: 12px;
}

.section-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  color: var(--primary-500);
  text-decoration: none;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.section-link:hover {
  color: var(--primary-400);
}

.section-link svg {
  width: 14px;
  height: 14px;
}

/* --- Form Elements --- */
.input-row {
  display: flex;
  gap: 10px;
  align-items: stretch;
}

.input {
  flex: 1;
  padding: 12px 16px;
  font-family: var(--font-mono);
  font-size: 0.88rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.input::placeholder {
  color: var(--text-tertiary);
  font-family: var(--font-mono);
}

.input:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

/* Prevent iOS zoom on input focus */
@supports (-webkit-touch-callout: none) {
  .input {
    font-size: 16px;
  }
}

.textarea {
  width: 100%;
  min-height: 100px;
  padding: 14px 16px;
  font-family: var(--font-mono);
  font-size: 0.85rem;
  background: var(--input-bg);
  border: 1.5px solid var(--input-border);
  border-radius: var(--radius-md);
  color: var(--text-primary);
  outline: none;
  resize: vertical;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  -webkit-appearance: none;
  appearance: none;
}

.textarea::placeholder {
  color: var(--text-tertiary);
}

.textarea:focus {
  border-color: var(--input-focus);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.14);
}

/* Prevent iOS zoom on input focus */
@supports (-webkit-touch-callout: none) {
  .textarea {
    font-size: 16px;
  }
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 22px;
  font-family: var(--font-sans);
  font-size: 0.88rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
  user-select: none;
}

.btn-primary {
  background: var(--btn-gradient);
  color: #fff;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

.btn-primary:hover {
  background: var(--btn-gradient-hover);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.4);
  transform: translateY(-1px);
}

.btn-primary:active {
  transform: translateY(0);
  box-shadow: 0 1px 4px rgba(14, 165, 233, 0.3);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--input-border);
}

.btn-ghost:hover {
  color: var(--text-primary);
  background: var(--surface-hover);
}

.btn-activate {
  width: 100%;
  padding: 16px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--btn-activate-gradient);
  background-size: 200% 100%;
  color: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 20px rgba(14, 165, 233, 0.38);
  letter-spacing: 0.02em;
  position: relative;
  overflow: hidden;
  -webkit-tap-highlight-color: transparent;
}

.btn-activate::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.15), transparent);
  transition: left 0.6s ease;
}

.btn-activate:hover::before {
  left: 100%;
}

.btn-activate:hover {
  box-shadow: 0 6px 28px rgba(14, 165, 233, 0.5);
  transform: translateY(-2px);
}

.btn-activate:active {
  transform: translateY(0);
}

.btn-activate:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

.btn-activate:disabled::before {
  display: none;
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.82rem;
}

.btn-row {
  display: flex;
  justify-content: flex-end;
  margin-top: 12px;
}

.btn svg {
  width: 16px;
  height: 16px;
}

/* --- Warning Note --- */
.warning-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 20px;
  padding: 14px 16px;
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: var(--radius-md);
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.55;
}

.warning-note svg {
  width: 18px;
  height: 18px;
  color: var(--warning);
  flex-shrink: 0;
  margin-top: 1px;
}

/* --- Status Messages --- */
.status-msg {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  margin-top: 10px;
  animation: fadeSlide 0.3s ease;
}

.status-msg.show {
  display: flex;
}

.status-msg.success {
  background: rgba(34, 197, 94, 0.1);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.2);
}

.status-msg.error {
  background: rgba(239, 68, 68, 0.1);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-msg svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

@keyframes fadeSlide {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- Modal --- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(9, 9, 11, 0.5);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-base), visibility var(--transition-base);
}

.modal-overlay.show {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.modal-dialog {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius-lg);
  box-shadow: 0 24px 48px rgba(0, 0, 0, 0.25), 0 0 0 1px rgba(14, 165, 233, 0.18);
  padding: 18px;
  transform: translateY(8px) scale(0.98);
  transition: transform var(--transition-base);
}

.modal-overlay.show .modal-dialog {
  transform: translateY(0) scale(1);
}

.modal-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.modal-text {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 16px;
}

.tool-page .page-title {
  margin-bottom: 24px;
}

.tool-textarea {
  min-height: 220px;
}

/* --- Responsive --- */

/* Tablet: 768px and below */
@media (max-width: 768px) {
  html {
    font-size: 16px;
  }

  .header-inner {
    padding: 0 18px;
    height: 52px;
  }

  .logo {
    font-size: 1rem;
    gap: 6px;
  }

  .logo-badge {
    padding: 2px 6px;
    font-size: 0.6rem;
  }

  .nav-link {
    font-size: 0.85rem;
    padding: 6px 12px;
  }

  .main {
    padding: 32px 18px 48px;
    max-width: 100%;
  }

  .page-title {
    font-size: 1.8rem;
    margin-bottom: 8px;
  }

  .page-subtitle {
    font-size: 0.9rem;
    margin-bottom: 28px;
  }

  .stepper {
    margin-bottom: 24px;
    padding: 0 2px;
  }

  .step-indicator {
    width: 32px;
    height: 32px;
    font-size: 0.8rem;
  }

  .step-indicator.active {
    box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(14, 165, 233, 0.3);
  }

  .card {
    padding: 24px;
    margin-bottom: 16px;
    border-radius: var(--radius-lg);
  }

  .card-section {
    padding-bottom: 20px;
    margin-bottom: 20px;
  }

  .section-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
  }

  .section-header {
    gap: 10px;
    margin-bottom: 12px;
  }

  .section-links {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
  }

  .section-link {
    font-size: 0.78rem;
    padding: 4px 8px;
  }

  .input-row {
    gap: 8px;
  }

  .input {
    padding: 11px 14px;
    font-size: 0.86rem;
  }

  .textarea {
    min-height: 90px;
    padding: 12px 14px;
    font-size: 0.84rem;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.86rem;
  }

  .btn-sm {
    padding: 8px 14px;
    font-size: 0.8rem;
  }

  .btn-activate {
    padding: 14px;
    font-size: 0.95rem;
  }

  .warning-note {
    padding: 12px 14px;
    font-size: 0.8rem;
    gap: 8px;
  }

}

/* Mobile: 640px and below */
@media (max-width: 640px) {
  html {
    font-size: 15px;
  }

  .header {
    position: sticky;
    top: 0;
    z-index: 100;
  }

  .header-inner {
    padding: 0 14px;
    height: 48px;
    gap: 8px;
  }

  .logo {
    flex: 0 0 auto;
    font-size: 0.95rem;
    gap: 5px;
  }

  .logo-badge {
    padding: 2px 5px;
    font-size: 0.55rem;
    font-weight: 700;
  }

  .nav {
    flex: 1 1 auto;
    align-self: stretch;
    gap: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }

  .nav::-webkit-scrollbar {
    display: none;
  }

  .nav-link {
    font-size: 0.8rem;
    padding: 5px 10px;
    border-radius: 6px;
  }

  .nav-link.active::after {
    bottom: -10px;
    width: 20px;
    height: 2px;
  }

  .icon-btn {
    width: 34px;
    height: 34px;
  }

  .header-actions {
    flex: 0 0 auto;
  }

  .icon-btn svg {
    width: 16px;
    height: 16px;
  }

  .main {
    justify-content: flex-start;
    padding: 20px 14px 40px;
    margin: 0 auto;
  }

  .page-title {
    font-size: 1.45rem;
    font-weight: 800;
    line-height: 1.2;
    margin-bottom: 6px;
  }

  .page-subtitle {
    font-size: 0.85rem;
    margin-bottom: 24px;
  }

  .stepper {
    margin-bottom: 20px;
    padding: 0;
    gap: 8px;
  }

  .step-indicator {
    width: 28px;
    height: 28px;
    font-size: 0.75rem;
    font-weight: 700;
  }

  .step-indicator.active {
    box-shadow: 0 0 0 2px rgba(14, 165, 233, 0.2), 0 2px 8px rgba(14, 165, 233, 0.25);
  }

  .step-line {
    flex: 1;
    height: 2px;
    margin: 0 4px;
  }

  .card {
    padding: 18px;
    border-radius: var(--radius-lg);
    margin-bottom: 12px;
  }

  .card-section {
    padding-bottom: 16px;
    margin-bottom: 16px;
  }

  .card-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
  }

  .section-title {
    font-size: 0.9rem;
    font-weight: 700;
    margin-bottom: 6px;
  }

  .section-desc {
    font-size: 0.78rem;
    margin-bottom: 12px;
    line-height: 1.5;
  }

  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 10px;
  }

  .section-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
    width: 100%;
  }

  .section-link {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 8px 10px;
    background: rgba(14, 165, 233, 0.08);
    border-radius: 6px;
    text-decoration: none;
    color: var(--primary-500);
    font-weight: 500;
    transition: all var(--transition-fast);
  }

  .section-link:active {
    background: rgba(14, 165, 233, 0.12);
    transform: scale(0.98);
  }

  .section-link svg {
    width: 13px;
    height: 13px;
  }

  /* Form Elements */
  .input-row {
    flex-direction: column;
    gap: 8px;
    align-items: stretch;
  }

  .input {
    padding: 11px 13px;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    border-radius: 8px;
    min-height: 44px;
  }

  .input::placeholder {
    font-size: 0.82rem;
  }

  .textarea {
    padding: 11px 13px;
    font-size: 0.82rem;
    min-height: 80px;
    border-radius: 8px;
    min-height: 44px;
  }

  /* Buttons */
  .btn {
    padding: 11px 16px;
    font-size: 0.8rem;
    font-weight: 600;
    border-radius: 8px;
    min-height: 44px;
    min-width: 44px;
    gap: 6px;
  }

  .btn-primary {
    width: 100%;
  }

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

  .btn-sm {
    padding: 9px 12px;
    font-size: 0.75rem;
  }

  .btn-activate {
    width: 100%;
    padding: 13px;
    font-size: 0.9rem;
    border-radius: 10px;
    min-height: 48px;
  }

  .btn-activate svg {
    width: 18px;
    height: 18px;
  }

  .btn-row {
    justify-content: stretch;
  }

  .btn-row .btn {
    width: 100%;
  }

  /* Status Messages */
  .status-msg {
    padding: 9px 12px;
    font-size: 0.78rem;
    font-weight: 500;
    margin-top: 8px;
    border-radius: 8px;
    gap: 6px;
  }

  .status-msg svg {
    width: 14px;
    height: 14px;
    min-width: 14px;
  }

  /* Warning Note */
  .warning-note {
    padding: 10px 12px;
    font-size: 0.77rem;
    gap: 8px;
    margin-top: 16px;
    border-radius: 8px;
  }

  .warning-note svg {
    width: 16px;
    height: 16px;
    margin-top: 0;
  }

}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
  html {
    font-size: 14px;
  }

  .header-inner {
    padding: 0 12px;
    height: 44px;
    gap: 8px;
  }

  .logo {
    font-size: 0.9rem;
  }

  .nav-link {
    font-size: 0.75rem;
    padding: 5px 8px;
  }

  .icon-btn {
    width: 32px;
    height: 32px;
  }

  .main {
    padding: 16px 12px 32px;
  }

  .page-title {
    font-size: 1.3rem;
  }

  .page-subtitle {
    font-size: 0.8rem;
    margin-bottom: 20px;
  }

  .stepper {
    margin-bottom: 16px;
  }

  .step-indicator {
    width: 24px;
    height: 24px;
    font-size: 0.7rem;
  }

  .card {
    padding: 14px;
    margin-bottom: 10px;
  }

  .modal-overlay {
    padding: 12px;
  }

  .card-section {
    padding-bottom: 12px;
    margin-bottom: 12px;
  }

  .section-title {
    font-size: 0.85rem;
    margin-bottom: 4px;
  }

  .section-desc {
    font-size: 0.75rem;
    margin-bottom: 10px;
  }

  .section-link {
    font-size: 0.72rem;
    padding: 6px 8px;
  }

  .input {
    padding: 10px 12px;
    font-size: 0.8rem;
  }

  .textarea {
    padding: 10px 12px;
    font-size: 0.8rem;
    min-height: 75px;
  }

  .btn {
    padding: 10px 14px;
    font-size: 0.75rem;
  }

  .btn-activate {
    padding: 12px;
    font-size: 0.85rem;
  }

  .warning-note {
    padding: 8px 10px;
    font-size: 0.73rem;
    gap: 6px;
  }

}

/* Portrait orientation adjustment */
@media (orientation: portrait) and (max-width: 768px) {
  .input-row {
    flex-direction: column;
  }

  .section-header {
    flex-direction: column;
  }
}

/* --- Pulse animation for active step --- */
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.2), 0 4px 12px rgba(14, 165, 233, 0.3); }
  50% { box-shadow: 0 0 0 8px rgba(14, 165, 233, 0.1), 0 4px 12px rgba(14, 165, 233, 0.2); }
}

.step-indicator.active {
  animation: pulse 2.5s ease-in-out infinite;
}

/* --- Checkmark for completed steps --- */
.step-indicator.completed::after {
  content: '✓';
  font-size: 0.9rem;
}

.step-indicator.completed span {
  display: none;
}

/* --- Section disabled state --- */
.card-section.disabled {
  opacity: 0.45;
  pointer-events: none;
  user-select: none;
}

/* --- Smooth transitions for theme change --- */
.header,
.card,
.input,
.textarea,
.btn,
.step-indicator,
.step-line {
  transition-property: background, color, border-color, box-shadow, opacity;
  transition-duration: 300ms;
  transition-timing-function: cubic-bezier(0.4, 0, 0.2, 1);
}

/* --- ToS Warning Button --- */
.tos-btn-warning {
  background: rgba(245, 158, 11, 0.15);
  border: 1px dashed rgba(245, 158, 11, 0.4);
  color: #d97706;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all var(--transition-fast);
}

html.dark .tos-btn-warning {
  background: rgba(245, 158, 11, 0.2);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.5);
}

.tos-btn-warning:hover {
  background: rgba(245, 158, 11, 0.28);
  transform: translateY(-1px);
}

/* --- Stock Indicator Badges --- */
.stock-indicator-badge.red {
  background: rgba(239, 68, 68, 0.15);
  color: #dc2626;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.stock-indicator-badge.yellow {
  background: rgba(245, 158, 11, 0.15);
  color: #d97706;
  border: 1px solid rgba(245, 158, 11, 0.3);
}

.stock-indicator-badge.green {
  background: rgba(34, 197, 94, 0.15);
  color: #16a34a;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

/* --- Tab Buttons --- */
.tab-btn {
  padding: 8px 18px;
  font-size: 0.88rem;
  font-weight: 600;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text-secondary);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.tab-btn.active {
  background: var(--btn-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 2px 8px rgba(14, 165, 233, 0.3);
}

/* --- Subscription checker --- */
.subscription-tool {
  max-width: 1080px;
  justify-content: flex-start;
  padding-top: 54px;
}

.tool-hero {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.tool-hero .page-title { margin: 5px 0 7px; }
.tool-hero p { color: var(--text-secondary); }
.tool-kicker { color: var(--primary-600); font-size: .7rem; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
html.dark .tool-kicker { color: var(--primary-400); }
.service-switch { display: flex; gap: 8px; padding: 5px; border: 1px solid var(--surface-border); border-radius: 14px; background: var(--surface); box-shadow: var(--card-shadow); }
.service-switch .tab-btn { min-width: 112px; border: 0; }

.subscription-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(260px, .75fr); gap: 18px; align-items: stretch; }
.subscription-entry-card { margin: 0; }
.subscription-card-head { display: flex; gap: 13px; align-items: flex-start; margin-bottom: 22px; }
.subscription-card-head h2 { color: var(--text-primary); font-size: 1.1rem; margin-bottom: 4px; }
.subscription-card-head p { color: var(--text-secondary); font-size: .86rem; line-height: 1.55; }
.subscription-card-icon { width: 36px; height: 36px; flex: 0 0 36px; display: grid; place-items: center; border-radius: 11px; color: #fff; font-weight: 900; background: var(--btn-gradient); box-shadow: 0 8px 22px var(--glow-color-strong); }
.credential-label { display: block; margin-bottom: 7px; color: var(--text-primary); font-size: .76rem; font-weight: 750; }
.subscription-entry-card .tool-textarea { min-height: 190px; resize: vertical; font-family: var(--font-mono); font-size: .78rem; line-height: 1.55; }
.credential-privacy { margin: 11px 0 17px; display: flex; align-items: flex-start; gap: 8px; color: var(--text-secondary); font-size: .74rem; line-height: 1.5; }
.credential-privacy span { color: var(--success); font-size: .6rem; line-height: 1.8; }
.subscription-submit { width: 100%; justify-content: center; }

.subscription-guide { padding: 26px; border: 1px solid var(--surface-border); border-radius: var(--radius-xl); background: linear-gradient(155deg, var(--bg-subtle), var(--surface)); box-shadow: var(--card-shadow); }
.subscription-guide ol { margin: 20px 0 0; display: grid; gap: 21px; list-style: none; }
.subscription-guide li { display: flex; gap: 11px; align-items: flex-start; }
.subscription-guide li > span { width: 27px; height: 27px; flex: 0 0 27px; display: grid; place-items: center; border: 1px solid var(--surface-border); border-radius: 9px; background: var(--surface); color: var(--primary-600); font-size: .72rem; font-weight: 800; }
.subscription-guide li div { display: grid; gap: 3px; }
.subscription-guide strong { color: var(--text-primary); font-size: .82rem; }
.subscription-guide small { color: var(--text-secondary); font-size: .72rem; line-height: 1.45; }

.subscription-result { margin-top: 18px; }
.subscription-loading { min-height: 72px; padding: 18px 20px; display: flex; align-items: center; gap: 12px; border: 1px solid var(--surface-border); border-radius: 15px; background: var(--surface); color: var(--text-secondary); }
.subscription-loading i { width: 19px; height: 19px; border: 2px solid var(--surface-border); border-top-color: var(--primary-500); border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.subscription-result-card { overflow: hidden; border: 1px solid var(--surface-border); border-radius: 17px; background: var(--surface); box-shadow: var(--card-shadow); animation: fadeSlide .3s ease; }
.subscription-result-card header { padding: 20px 22px; display: flex; align-items: center; justify-content: space-between; gap: 18px; border-bottom: 1px solid var(--surface-border); background: var(--bg-subtle); }
.subscription-result-card header h2 { margin-top: 3px; color: var(--text-primary); font-size: 1.12rem; }
.subscription-status { padding: 5px 10px; border-radius: 999px; color: #fff; background: #6b7280; font-size: .68rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.subscription-result-card.is-active .subscription-status { background: var(--success); }
.subscription-result-card.is-inactive .subscription-status { background: #64748b; }
.subscription-result-card.is-warning .subscription-status { background: var(--warning); }
.subscription-result-grid { padding: 20px 22px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.subscription-result-grid div { min-width: 0; display: grid; gap: 5px; }
.subscription-result-grid small { color: var(--text-secondary); font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.subscription-result-grid strong { color: var(--text-primary); font-size: .82rem; overflow-wrap: anywhere; }
.subscription-result-card > p { margin: 0 22px 20px; padding: 12px 14px; border-radius: 10px; background: var(--bg-subtle); color: var(--text-secondary); font-size: .76rem; line-height: 1.5; }
.subscription-result-card.is-error { padding: 17px 19px; display: grid; gap: 5px; border-color: rgba(239,68,68,.3); background: rgba(239,68,68,.08); color: var(--error); }
.subscription-result-card.is-error strong { font-size: .84rem; }
.subscription-result-card.is-error span { color: var(--text-secondary); font-size: .78rem; }

@media (max-width: 820px) {
  .subscription-tool { padding-top: 32px; }
  .tool-hero { align-items: stretch; flex-direction: column; }
  .service-switch { width: fit-content; }
  .subscription-layout { grid-template-columns: 1fr; }
  .subscription-result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 520px) {
  .service-switch { width: 100%; }
  .service-switch .tab-btn { flex: 1; min-width: 0; }
  .subscription-entry-card,
  .subscription-guide { padding: 20px; }
  .subscription-result-grid { grid-template-columns: 1fr; }
  .subscription-result-card header { align-items: flex-start; flex-direction: column; }
}
