:root {
  --bg: #f5f4fb;
  --bg-2: #ecebf6;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --border: #e3e5ee;
  --text: #1a1c25;
  --text-muted: #6b7180;
  --accent: #6c5ce7;
  --accent-2: #ec4899;
  --accent-3: #38bdf8;
  --accent-hover: #5b4bd9;
  --accent-soft: #ece9ff;
  --accent-gradient: linear-gradient(135deg, #6c5ce7 0%, #a855f7 50%, #ec4899 100%);
  --accent-gradient-hover: linear-gradient(135deg, #5b4bd9 0%, #9333ea 50%, #db2777 100%);
  --accent-glow: 0 10px 28px rgba(108, 92, 231, 0.28), 0 4px 10px rgba(236, 72, 153, 0.18);
  --danger: #e15b6e;
  --shadow: 0 1px 2px rgba(20, 22, 36, 0.04), 0 4px 14px rgba(20, 22, 36, 0.06);
  --shadow-lg: 0 12px 40px rgba(72, 56, 150, 0.12), 0 4px 12px rgba(20, 22, 36, 0.05);
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 22px;
}

[data-theme="dark"] {
  --bg: #0c0d14;
  --bg-2: #161827;
  --surface: #181b24;
  --surface-2: #232734;
  --border: #2c3142;
  --text: #e8eaf2;
  --text-muted: #8b91a3;
  --accent: #8b7cff;
  --accent-2: #f472b6;
  --accent-3: #38bdf8;
  --accent-hover: #a597ff;
  --accent-soft: #2a2447;
  --accent-gradient: linear-gradient(135deg, #8b7cff 0%, #c084fc 50%, #f472b6 100%);
  --accent-gradient-hover: linear-gradient(135deg, #a597ff 0%, #d8b4fe 50%, #f9a8d4 100%);
  --accent-glow: 0 12px 32px rgba(139, 124, 255, 0.42), 0 4px 12px rgba(244, 114, 182, 0.28);
  --danger: #ff7187;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 16px 50px rgba(0, 0, 0, 0.5), 0 6px 16px rgba(0, 0, 0, 0.4);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Pretendard",
    "Apple SD Gothic Neo", "Noto Sans KR", "Hiragino Kaku Gothic Pro",
    "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background:
    radial-gradient(1200px 600px at 0% -10%, rgba(168, 85, 247, 0.18), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(56, 189, 248, 0.14), transparent 55%),
    radial-gradient(900px 600px at 50% 110%, rgba(236, 72, 153, 0.12), transparent 60%),
    var(--bg);
  background-attachment: fixed;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 36px;
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: saturate(160%) blur(12px);
  -webkit-backdrop-filter: saturate(160%) blur(12px);
  position: sticky;
  top: 0;
  z-index: 50;
}
[data-theme="dark"] .app-header {
  background: rgba(18, 21, 32, 0.72);
}
.app-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  text-decoration: none;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  transition: filter 0.2s;
}
.app-title::before {
  content: "";
  display: inline-block;
  width: 32px;
  height: 32px;
  background-image: url("favicon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}
.app-title:hover { filter: brightness(1.1) drop-shadow(0 2px 8px rgba(168, 85, 247, 0.4)); }

.header-tools {
  display: flex;
  align-items: center;
  gap: 15px;
}
.ui-lang {
  width: auto;
  padding: 12px 38px 12px 16px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%236b7180' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
  background-size: 12px 8px;
}
.ui-lang:hover { border-color: var(--accent); }
.ui-lang:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
[data-theme="dark"] .ui-lang {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'><path d='M1 1.5L6 6.5L11 1.5' stroke='%238b91a3' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
  background-repeat: no-repeat;
  background-position: right 14px center;
}

.icon-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 54px;
  height: 54px;
  cursor: pointer;
  font-size: 22px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.icon-btn:hover {
  background: var(--surface-2);
  transform: rotate(15deg) scale(1.06);
  border-color: var(--accent);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.18);
}
[data-theme="light"] .theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }

/* Top navigation */
.top-nav {
  display: flex;
  gap: 6px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 6px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.nav-link {
  padding: 12px 22px;
  border-radius: 18px;
  font-size: 16px;
  font-weight: 600;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.18s, background 0.18s, transform 0.1s;
  display: inline-flex;
  align-items: center;
  position: relative;
}
.nav-link:hover { color: var(--text); background: var(--surface-2); }
.nav-link.active {
  color: white;
  background: var(--accent-gradient);
  box-shadow: 0 6px 18px rgba(108, 92, 231, 0.3);
}
.badge {
  display: inline-block;
  background: var(--surface-2);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: 8px;
  min-width: 22px;
  text-align: center;
}
.nav-link.active .badge {
  background: rgba(255, 255, 255, 0.25);
  color: white;
}
@media (max-width: 760px) {
  /* Grid header with explicit areas: row 1 = [title | tools], row 2 = [nav    ] */
  .app-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "title tools"
      "nav   nav";
    column-gap: 10px;
    row-gap: 12px;
    padding: 14px 18px;
    align-items: center;
    justify-content: stretch;
  }
  .app-title { grid-area: title; min-width: 0; }
  .top-nav { grid-area: nav; width: auto; justify-content: space-between; }
  .header-tools {
    grid-area: tools;
    justify-self: end;
    flex-shrink: 0;
  }

  .nav-link { padding: 10px 14px; font-size: 14px; flex: 1; justify-content: center; }
  .ui-lang { padding: 10px 32px 10px 12px; font-size: 14px; background-position: right 10px center; }
  .icon-btn { width: 46px; height: 46px; font-size: 18px; }

  /* Title text shrinks with ellipsis when too long (e.g. English/Japanese) */
  .app-title > span {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    min-width: 0;
  }
}

/* Layout */
.layout { flex: 1; padding: 36px; max-width: 1400px; margin: 0 auto; width: 100%; }
.panel { animation: fadeIn 0.3s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

#panel-generate {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 36px;
  align-items: start;
}
@media (max-width: 900px) {
  #panel-generate { grid-template-columns: 1fr; }
  .layout { padding: 20px; }
}

/* Options */
.options {
  position: sticky;
  top: 100px;
  align-self: start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  box-shadow: var(--shadow-lg);
}
.options::before {
  content: "";
  position: absolute;
  inset: -1px;
  border-radius: var(--radius-lg);
  padding: 1px;
  background: linear-gradient(135deg, rgba(168, 85, 247, 0.4), rgba(236, 72, 153, 0.2), transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.7;
}
@media (max-width: 900px) {
  .options { position: static; }
}
.opt { margin-bottom: 24px; position: relative; }

/* Language + English case in 2-column grid when case is shown */
.lang-case-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 24px;
}
.lang-case-row.single-col { grid-template-columns: 1fr; }
.lang-case-row .opt { margin-bottom: 0; }
@media (max-width: 480px) {
  .lang-case-row { grid-template-columns: 1fr; }
}
.opt label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.opt-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface-2);
  padding: 14px 18px;
  border-radius: var(--radius-sm);
}
.opt-toggle label {
  margin-bottom: 0;
  text-transform: none;
  letter-spacing: 0;
  font-size: 15px;
  color: var(--text);
}
.opt-toggle input[type="checkbox"] {
  transform: scale(1.6);
  accent-color: var(--accent);
  cursor: pointer;
}

select, input[type="text"], input[type="number"] {
  width: 100%;
  padding: 14px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.18s, box-shadow 0.18s, background 0.18s;
}
select:hover, input:hover { border-color: var(--accent); }
select:focus, input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.row { display: flex; align-items: center; gap: 10px; }
.row input[type="number"] { flex: 1; }
.muted { color: var(--text-muted); font-size: 13px; font-weight: 500; text-transform: none; letter-spacing: 0; }

/* Custom number stepper */
.stepper {
  display: inline-flex;
  align-items: stretch;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
  transition: border-color 0.18s, box-shadow 0.18s;
}
.stepper:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.stepper input[type="number"] {
  border: none;
  text-align: center;
  width: 56px;
  padding: 14px 0;
  font-size: 18px;
  font-weight: 700;
  background: transparent;
  border-radius: 0;
  -moz-appearance: textfield;
  appearance: textfield;
}
.stepper input[type="number"]:focus { box-shadow: none; border: none; }
.stepper input[type="number"]::-webkit-inner-spin-button,
.stepper input[type="number"]::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.stepper-btn {
  background: var(--surface-2);
  border: none;
  width: 44px;
  cursor: pointer;
  font-size: 22px;
  font-weight: 800;
  color: var(--text-muted);
  transition: background 0.15s, color 0.15s, transform 0.08s;
  user-select: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.stepper-btn:hover { background: var(--accent-soft); color: var(--accent); }
.stepper-btn:active {
  background: var(--accent);
  color: white;
  transform: scale(0.94);
}
.stepper-wide { width: 100%; }
.stepper-wide input[type="number"] { flex: 1; width: auto; font-size: 20px; }
.stepper-wide .stepper-btn { width: 56px; font-size: 24px; }

/* Style chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: var(--surface-2);
  border: 1px solid transparent;
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.1s, box-shadow 0.18s;
}
.chip:hover {
  background: var(--accent-soft);
  transform: translateY(-1px);
}
.chip[aria-checked="true"] {
  background: var(--accent-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 16px rgba(108, 92, 231, 0.32);
  transform: translateY(-1px);
}

/* Buttons */
.primary {
  width: 100%;
  background: var(--accent-gradient);
  background-size: 200% 200%;
  background-position: 0% 50%;
  color: white;
  border: none;
  padding: 20px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.22s, background-position 0.5s;
  letter-spacing: 0.02em;
  box-shadow: var(--accent-glow);
  position: relative;
  overflow: hidden;
}
.primary::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, 0.25) 50%, transparent 70%);
  transform: translateX(-110%);
  transition: transform 0.6s;
}
.primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 36px rgba(108, 92, 231, 0.36), 0 6px 14px rgba(236, 72, 153, 0.22);
  background-position: 100% 50%;
}
.primary:hover::after { transform: translateX(110%); }
.primary:active { transform: translateY(0); }

.ghost {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: color 0.18s, border-color 0.18s, background 0.18s, transform 0.1s;
}
.ghost:hover { color: var(--danger); border-color: var(--danger); transform: translateY(-1px); }

/* Standalone page sections (favorites, history) */
.page-section { width: 100%; }
.page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  flex-wrap: wrap;
  gap: 12px;
}
.page-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}

/* Results grid */
.results { min-height: 280px; }
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.empty {
  text-align: center;
  color: var(--text-muted);
  padding: 90px 20px;
  font-size: 16px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--radius-lg);
}

/* Nickname card */
.card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px 22px;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s, border-color 0.18s, box-shadow 0.22s, background 0.18s;
  text-align: left;
  font-family: inherit;
  color: var(--text);
  word-break: break-all;
  min-height: 72px;
  position: relative;
  overflow: hidden;
  animation: cardIn 0.32s cubic-bezier(0.16, 1, 0.3, 1) backwards;
}
.card::before {
  content: "";
  position: absolute;
  top: 0; left: 0;
  width: 4px; height: 100%;
  background: var(--accent-gradient);
  opacity: 0;
  transition: opacity 0.2s;
}
.card:hover {
  border-color: transparent;
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(108, 92, 231, 0.2), 0 4px 10px rgba(236, 72, 153, 0.12);
}
.card:hover::before { opacity: 1; }
.card:active { transform: translateY(-1px); }
.card-name {
  flex: 1;
  color: var(--text);
  transition: color 0.2s;
}
.card:hover .card-name {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(8px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
/* Per-card animation-delay is set inline by JS (cards.js / render fns) */

.fav-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 32px;
  cursor: pointer;
  margin-left: 10px;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: color 0.18s, transform 0.15s, background 0.18s;
  flex-shrink: 0;
}
.fav-btn:hover {
  transform: scale(1.18) rotate(-8deg);
  color: var(--danger);
  background: rgba(225, 91, 110, 0.12);
}
.fav-btn[aria-pressed="true"] {
  color: var(--danger);
  text-shadow: 0 0 14px rgba(225, 91, 110, 0.55);
}
[data-theme="dark"] .fav-btn:hover { background: rgba(255, 113, 135, 0.18); }

/* Toast */
.toast {
  position: fixed;
  bottom: 36px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--accent-gradient);
  color: white;
  padding: 16px 28px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 700;
  box-shadow: var(--accent-glow);
  z-index: 100;
  animation: slideUp 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  letter-spacing: 0.01em;
}
@keyframes slideUp {
  from { opacity: 0; transform: translate(-50%, 16px) scale(0.95); }
  to { opacity: 1; transform: translate(-50%, 0) scale(1); }
}

/* Site footer */
.site-footer {
  margin-top: 60px;
  padding: 28px 36px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.footer-brand::before {
  content: "";
  display: inline-block;
  width: 22px;
  height: 22px;
  background-image: url("favicon.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  flex-shrink: 0;
}
.footer-nav {
  display: flex;
  gap: 18px;
}
.footer-nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s;
}
.footer-nav a:hover { color: var(--accent); }
@media (max-width: 480px) {
  .site-footer { padding: 22px 18px; }
  .footer-inner { justify-content: center; flex-direction: column; }
}

/* Legal pages (privacy, terms) */
.legal {
  max-width: 760px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 48px 56px;
  box-shadow: var(--shadow);
}
.legal h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.legal h2 {
  font-size: 20px;
  font-weight: 700;
  margin: 32px 0 12px;
  color: var(--text);
}
.legal h3 {
  font-size: 16px;
  font-weight: 700;
  margin: 18px 0 8px;
  color: var(--text);
}
.legal p, .legal li {
  font-size: 15px;
  color: var(--text);
  line-height: 1.75;
}
.legal ul {
  padding-left: 22px;
  margin: 8px 0 14px;
}
.legal li { margin-bottom: 6px; }
.legal a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.legal a:hover { filter: brightness(1.15); }
.legal-meta {
  color: var(--text-muted);
  font-size: 14px;
  margin-bottom: 28px;
}
.legal-back {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}
.legal-back a {
  font-weight: 600;
  text-decoration: none;
}
@media (max-width: 600px) {
  .legal { padding: 28px 22px; }
  .legal h1 { font-size: 26px; }
  .legal h2 { font-size: 18px; }
}

/* Scrollbar polish */
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: var(--surface-2);
  border-radius: 10px;
  border: 2px solid var(--bg);
}
::-webkit-scrollbar-thumb:hover { background: var(--accent-soft); }

/* =============================================
   Landing pages (lang × style combos)
   ============================================= */
.landing {
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.landing-hero {
  text-align: center;
  margin-bottom: 40px;
  padding: 12px 0 20px;
}
.landing-h1 {
  font-size: 40px;
  font-weight: 800;
  margin: 0 0 18px;
  letter-spacing: -0.02em;
  line-height: 1.2;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.landing-h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  color: var(--text);
}
.landing-intro {
  font-size: 17px;
  line-height: 1.75;
  color: var(--text);
  max-width: 760px;
  margin: 0 auto;
}
.landing-results {
  margin-bottom: 48px;
}
.landing-cta-section {
  display: flex;
  justify-content: center;
  margin: 32px 0 48px;
}
.landing-cta {
  display: inline-flex;
  align-items: center;
  width: auto;
  padding: 18px 36px;
  font-size: 18px;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.landing-related {
  margin-bottom: 32px;
}
.related-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.related-chip {
  display: inline-flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: background 0.18s, border-color 0.18s, color 0.18s, transform 0.1s;
}
.related-chip:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
  transform: translateY(-1px);
}

/* "Browse by style" section on main index */
.explore-section {
  margin: 64px 0 24px;
  padding: 36px 32px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}
.explore-h2 {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.explore-sub {
  color: var(--text-muted);
  font-size: 15px;
  margin: 0 0 24px;
}
.explore-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.explore-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px 24px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.18s, box-shadow 0.22s, transform 0.12s, background 0.18s;
}
.explore-card:hover {
  border-color: var(--accent);
  box-shadow: 0 8px 22px rgba(108, 92, 231, 0.14);
  transform: translateY(-2px);
  background: var(--surface);
}
.explore-card h3 {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}
.explore-card:hover h3 {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  -webkit-text-fill-color: transparent;
}
.explore-arrow {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-muted);
  transition: color 0.18s, transform 0.18s;
  line-height: 1;
}
.explore-card:hover .explore-arrow {
  color: var(--accent);
  transform: translateX(4px);
}
@media (max-width: 600px) {
  .landing-h1 { font-size: 28px; }
  .landing-h2 { font-size: 19px; }
  .landing-intro { font-size: 15px; line-height: 1.7; }
  .landing-cta { padding: 16px 28px; font-size: 16px; }
  .explore-section { padding: 22px 18px; margin: 40px 0 16px; }
  .explore-h2 { font-size: 22px; }
  .explore-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* =============================================
   Mobile responsive (mid-phone: ≤600px)
   ============================================= */
@media (max-width: 600px) {
  /* Layout & options panel padding */
  .layout { padding: 18px 14px; }
  .options { padding: 22px 18px; }
  .options::before { display: none; } /* gradient border ring hidden — looks cleaner on mobile */
  .opt { margin-bottom: 18px; }

  /* Steppers — compact for narrow widths */
  .stepper input[type="number"] {
    width: 44px;
    font-size: 17px;
    padding: 12px 0;
  }
  .stepper-btn {
    width: 38px;
    font-size: 20px;
  }
  .stepper-wide .stepper-btn { width: 48px; }
  .stepper-wide input[type="number"] { font-size: 18px; }

  /* Result grid: tighter cards */
  .grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 10px;
  }
  .card {
    padding: 16px 18px;
    font-size: 17px;
    min-height: 60px;
  }
  .empty { padding: 60px 16px; font-size: 14px; }

  /* Page section title scale */
  .page-title { font-size: 26px; }

  /* Toast: ensure no overflow */
  .toast {
    padding: 13px 22px;
    font-size: 14px;
    max-width: 90vw;
    bottom: 20px;
  }

  /* Style chips slight tighten */
  .chip { padding: 9px 14px; font-size: 13px; }

  /* Form inputs slightly smaller font */
  select, input[type="text"], input[type="number"] {
    padding: 12px 14px;
    font-size: 15px;
  }
  .opt-toggle { padding: 12px 16px; }
}

/* =============================================
   Mobile responsive (narrow phone: ≤380px, e.g. iPhone SE/13 mini)
   ============================================= */
@media (max-width: 380px) {
  /* Header */
  .app-header { padding: 12px 12px; gap: 8px; }
  .app-title { font-size: 20px; gap: 8px; }
  .app-title::before { width: 26px; height: 26px; }
  .header-tools { gap: 8px; }
  .ui-lang {
    padding: 8px 26px 8px 10px;
    font-size: 13px;
    background-size: 10px 7px;
    background-position: right 8px center;
  }
  .icon-btn { width: 40px; height: 40px; font-size: 16px; }

  /* Top nav */
  .top-nav { padding: 4px; }
  .nav-link { padding: 8px 10px; font-size: 13px; }
  .nav-link .badge { font-size: 11px; padding: 1px 6px; min-width: 18px; margin-left: 4px; }

  /* Layout & panel */
  .layout { padding: 14px 10px; }
  .options { padding: 18px 14px; }

  /* Steppers — even more compact */
  .stepper input[type="number"] { width: 38px; font-size: 16px; padding: 10px 0; }
  .stepper-btn { width: 34px; font-size: 19px; }
  .stepper-wide .stepper-btn { width: 44px; }

  /* Card */
  .card { padding: 14px 16px; font-size: 16px; min-height: 56px; }
  .grid { grid-template-columns: 1fr; }

  /* Page title */
  .page-title { font-size: 22px; }

  /* Generate button slightly smaller */
  .primary { padding: 16px; font-size: 16px; }

  /* Toast */
  .toast { padding: 11px 18px; font-size: 13px; max-width: 92vw; bottom: 16px; }
}
