/* ======================================================
   Nama Kucing - Modern, responsive, and SEO-friendly UI
   ====================================================== */

/* --- 1. RESET & VARIABLES --- */
* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #fffafc;
  --bg-soft: #fff4f8;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --ink: #241737;
  --muted: #746983;
  --line: #efd8e3;
  --line-strong: #e8c7d6;
  --brand: #ff7fa3;
  --brand-dark: #e94f7d;
  --brand-soft: #fff0f5;
  --brand-soft-2: #fff8fb;
  --success-bg: #eef9f1;
  --success-line: #b9e3c4;
  --success-ink: #17663a;
  --error-bg: #fff1f4;
  --error-line: #f4c6d6;
  --error-ink: #9b1c4f;
  --shadow-sm: 0 10px 26px rgba(91, 54, 78, 0.08);
  --shadow: 0 22px 60px rgba(91, 54, 78, 0.11);
  --radius-sm: 14px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 30px;
  --container: 1180px;
}

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(255, 208, 221, 0.55), transparent 27rem),
              linear-gradient(180deg, var(--bg) 0%, #fff7fb 18%, #fffdfd 100%);
  line-height: 1.65;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand-dark); }
img, picture, svg, video, iframe, table { max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; }
button { touch-action: manipulation; }

:focus-visible {
  outline: 3px solid rgba(255, 127, 163, 0.45);
  outline-offset: 3px;
}

::selection {
  background: #ffd4e1;
  color: var(--ink);
}

/* --- 2. LAYOUT & CONTAINERS --- */
.container {
  width: min(var(--container), calc(100% - 32px));
  margin-inline: auto;
  min-width: 0;
}

.container > *, .hero-shell > *, .generator-grid > *, .stat-grid > *, 
.showcase-grid > *, .faq-grid > *, .grid-3 > *, .grid-4 > *, .name-grid > *, 
.dashboard-grid > *, .footer-grid > *, .form-grid > *, .admin-split > *, 
.cat-fun-card > *, .cat-image-card > * {
  min-width: 0;
}

.section, .hero-section, .generator-section, .article-section, 
.faq-section, .stats-section, .cat-fun-section, .cat-image-section {
  position: relative;
}

.section { padding: 42px 0; }

.skip-link {
  position: fixed;
  left: 16px; top: 16px;
  z-index: 100;
  padding: 10px 14px;
  border-radius: 999px;
  background: var(--surface-solid);
  box-shadow: var(--shadow-sm);
  transform: translateY(-150%);
  transition: transform 0.2s ease;
}
.skip-link:focus { transform: translateY(0); }

/* --- 3. HEADER & NAVIGATION --- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 999;
  border-bottom: 1px solid rgba(240, 219, 230, 0.92);
  background: rgba(255, 250, 252, 0.98);
  backdrop-filter: blur(16px);
  box-shadow: 0 10px 30px rgba(91, 54, 78, 0.08);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 74px;
  padding: 14px 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.brand-badge {
  width: 42px; height: 42px;
  flex: 0 0 auto;
  display: grid; place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #ffc8d8, #ffdfe8);
  box-shadow: var(--shadow-sm);
}

.nav-toggle {
  display: none;
  width: 44px; height: 44px;
  place-items: center; gap: 4px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: none;
}
.nav-toggle:hover {
  transform: none;
  color: var(--ink);
}

.nav-toggle-line {
  width: 18px; height: 2px;
  border-radius: 999px;
  background: currentColor;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.nav-toggle.is-open .nav-toggle-line:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle.is-open .nav-toggle-line:nth-child(2) { opacity: 0; }
.nav-toggle.is-open .nav-toggle-line:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.nav-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.96rem;
  font-weight: 750;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  background: var(--brand-soft);
  color: var(--ink);
}

/* --- 4. BUTTONS & FORMS --- */
.button, button, input[type="submit"] {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  border: 0;
  border-radius: 16px;
  cursor: pointer;
  background: linear-gradient(180deg, var(--brand), var(--brand-dark));
  color: #ffffff;
  padding: 13px 18px;
  font-weight: 850;
  line-height: 1.1;
  box-shadow: 0 16px 30px rgba(255, 127, 163, 0.28);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease;
}

.button:hover, button:hover, input[type="submit"]:hover {
  color: #ffffff;
  transform: translateY(-1px);
}

.button.secondary {
  border: 1px solid var(--line);
  background: var(--surface-solid);
  color: var(--ink);
  box-shadow: none;
}
.button.secondary:hover {
  color: var(--ink);
  border-color: var(--line-strong);
}
.button.full, .button-lg.full { width: 100%; }
.button-lg { min-height: 50px; padding: 15px 20px; }

label { font-size: 0.94rem; font-weight: 850; }

input[type="text"], input[type="url"], input[type="email"], 
input[type="password"], textarea, select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #ffffff;
  color: var(--ink);
  padding: 13px 14px;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.65) inset;
}

textarea { min-height: 140px; resize: vertical; }

select {
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), 
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 21px, calc(100% - 13px) 21px;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 38px;
}

.form-row, .form-grid, .field, .filter-stack { display: grid; gap: 10px; }
.form-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.stack-actions { margin-top: 10px; }

/* --- 5. UTILITIES, CHIPS, & TAGS --- */
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }

.eyebrow, .mini-tag, .chip, .pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  border-radius: 999px;
  font-weight: 800;
  line-height: 1.2;
}

.eyebrow {
  gap: 8px; padding: 7px 12px;
  border: 1px solid #ffd6e3; background: var(--brand-soft); color: #c54370;
  font-size: 0.82rem;
}

.mini-tag {
  min-height: 34px; padding: 8px 12px;
  border: 1px solid #f3d8e1; background: var(--surface-solid); color: var(--muted);
  font-size: 0.84rem;
}
.mini-tag.subtle { background: var(--brand-soft-2); }

.chip, .pill {
  min-height: 32px; padding: 7px 11px;
  border: 1px solid #f2d7e2; background: #ffffff; color: #7e6e8d;
  font-size: 0.84rem;
}
.pill { border-color: #efdfd1; background: #f7f1ea; color: #6c4b38; }

.chip-row, .showcase-meta, .name-meta, .search-actions, 
.actions, .result-actions, .copy-row, .hero-cta-row, .hero-mini-tags, .editor-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
}

.notice, .alert {
  border: 1px solid; border-radius: 18px; padding: 14px 16px; margin-bottom: 16px;
}
.notice.success, .alert.success { border-color: var(--success-line); background: var(--success-bg); color: var(--success-ink); }
.notice.error, .alert.error { border-color: var(--error-line); background: var(--error-bg); color: var(--error-ink); }

/* --- 6. SHARED CARDS & PANELS --- */
.preview-card, .filter-panel, .result-panel, .stat-card, 
.showcase-card, .faq-card, .card, .panel, .admin-card, 
.form-card, .content-box, .cat-fun-card, .cat-image-banner, .cat-image-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.preview-card, .filter-panel, .result-panel, .stat-card, 
.showcase-card, .faq-card, .card, .panel, .admin-card, 
.form-card, .content-box {
  padding: 22px;
}

.preview-topline, .result-header, .section-subheader, 
.section-header, .showcase-card-top {
  display: flex; justify-content: space-between; gap: 12px;
}
.preview-topline, .showcase-card-top { align-items: flex-start; }

.preview-card p, .showcase-card p, .faq-card p, 
.section-heading p, .page-header p, .result-caption { color: var(--muted); }

/* Specific Result & Preview Card Styling */
.preview-card, .result-panel, .showcase-card { overflow: hidden; }
.preview-card { display: flex; flex-direction: column; gap: 12px; min-height: 280px; }
.preview-card .preview-topline { flex-wrap: wrap; margin-bottom: 4px; }
.preview-card .eyebrow, .preview-card .pill, .preview-card .chip,
.preview-topline .eyebrow, .preview-topline .pill, .preview-topline .chip {
  max-width: 100%; white-space: normal; overflow-wrap: anywhere;
}

.preview-card h2 { margin: 0 0 12px; font-size: clamp(2rem, 4vw, 3rem); line-height: 1; }
.preview-card .result-name, .result-name {
  display: block; margin: 4px 0 8px; padding: 0;
  font-size: clamp(2rem, 9vw, 3.75rem); line-height: 0.98;
  letter-spacing: -0.04em; word-break: break-word; overflow-wrap: anywhere;
}
.preview-card .result-meaning, .result-meaning {
  display: block; margin: 0; max-width: 760px;
  font-size: 1rem; line-height: 1.65; color: var(--muted); overflow-wrap: anywhere;
}

.preview-card .chip-row, .preview-card .name-meta, .preview-card .showcase-meta {
  margin-top: 16px; margin-bottom: 24px;
}
.preview-card .chip-row .chip, .preview-card .name-meta .chip, .preview-card .showcase-meta .chip {
  flex: 0 1 auto; max-width: 100%;
}
.preview-card .actions, .preview-card .result-actions, .preview-card .copy-row {
  margin-top: 16px; margin-bottom: 10px;
}
.preview-card .actions button, .preview-card .result-actions button, .preview-card .copy-row button {
  margin: 0;
}

/* ======================================================
   FIX TOMBOL LOVE (HEART BUTTON) 
   ====================================================== */

/* 1. Kondisi Normal: Background putih, Logo Love warna Merah/Pink */
.heart-btn {
  width: 46px; 
  height: 46px; 
  flex: 0 0 auto; 
  padding: 0;
  border: 1px solid var(--line-strong); 
  border-radius: 16px;
  background: #ffffff; 
  color: var(--brand-dark); /* Membuat logo love berwarna merah */
  box-shadow: none; 
  font-size: 1.25rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease-in-out; /* Memberikan efek transisi warna yang halus */
}

/* 2. Kondisi Hover (Kursor diarahkan): Background Merah, Logo Putih */
.heart-btn:hover {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #ffffff; /* Logo love menjadi putih */
  transform: translateY(-2px); /* Tambahan efek sedikit melayang (opsional) */
}

/* 3. Kondisi Aktif / Diklik: Mengatasi masalah Blank Putih */
.heart-btn:active,
.heart-btn:focus-visible {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff !important; /* Mencegah icon hilang / blank putih */
  transform: translateY(0);
  outline: none; /* Menghilangkan garis biru/putih bawaan browser saat diklik */
}

/* 4. Kondisi Tersimpan (Jika ada interaksi JavaScript saat tombol di-klik/disimpan) */
.heart-btn.active,
.heart-btn.is-active,
.heart-btn.saved {
  background: var(--brand-dark);
  border-color: var(--brand-dark);
  color: #ffffff !important;
}


/* --- 7. TYPOGRAPHY & SECTIONS --- */
.hero-content h1, .section-heading h2, .page-header h1, 
.section-heading h1, .content-box > h1:first-child {
  margin: 14px 0 10px; letter-spacing: -0.035em; line-height: 1.05;
}
.section-heading p, .page-header p { margin: 0; }

.hero-section { padding: 48px 0 22px; }
.hero-shell { display: grid; grid-template-columns: minmax(0, 1.18fr) minmax(300px, 0.82fr); gap: 28px; align-items: center; }
.hero-content h1 { max-width: 820px; font-size: clamp(2.35rem, 6vw, 4.65rem); line-height: 0.98; }
.hero-lead { max-width: 720px; margin: 0; color: var(--muted); font-size: 1.07rem; }
.hero-cta-row { margin: 26px 0 16px; }

.stats-section { padding: 8px 0 24px; }
.stat-grid, .showcase-grid, .faq-grid, .grid-3, .grid-4, .name-grid, .dashboard-grid, .footer-grid { display: grid; gap: 18px; }
.stat-grid, .showcase-grid, .faq-grid, .grid-3, .name-grid, .dashboard-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat-card { text-align: center; }
.stat-card strong, .kpi { display: block; font-size: clamp(1.9rem, 3vw, 2.6rem); font-weight: 850; line-height: 1; }
.stat-card span { color: var(--muted); font-weight: 650; }
.kpi { margin: 8px 0 0; }

.generator-section { padding: 20px 0 34px; }
.section-heading { margin-bottom: 20px; }
.section-heading.narrow { max-width: 760px; }
.section-heading h2, .page-header h1, .section-heading h1 { font-size: clamp(2rem, 4vw, 3rem); }
.generator-grid { display: grid; grid-template-columns: 330px minmax(0, 1fr); gap: 20px; align-items: stretch; }

.result-kicker { display: block; margin-bottom: 6px; color: var(--muted); font-size: 0.88rem; font-weight: 850; }
.section-subheader, .section-header { align-items: flex-end; margin: 26px 0 16px; }
.section-header { align-items: flex-start; margin-bottom: 20px; }
.section-subheader h3, .section-header h1 { margin: 0 0 8px; }

.showcase-card, .article-card, .name-card { display: flex; flex-direction: column; gap: 12px; }
.showcase-card h3, .faq-card h3 { margin: 0; font-size: 1.18rem; line-height: 1.25; }
.showcase-card p { margin: 0 0 4px; }

.faq-section { padding: 14px 0 44px; }
.faq-card h3 { margin-bottom: 8px; }
.empty-state { padding: 16px 0 4px; }
.empty-state h3 { margin-top: 0; }

/* --- 8. ARTICLE PAGES --- */
.article-section { padding: 12px 0 40px; }
.article-thumb {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover;
  border: 1px solid var(--line); border-radius: 18px; background: var(--brand-soft);
}
.article-body, .article-preview-content, .content-box { overflow-wrap: anywhere; }
.article-body { margin-top: 20px; font-size: 1.04rem; }
.article-body > :first-child, .content-box > :first-child { margin-top: 0; }
.article-body img, .content-box img { max-width: 100%; height: auto; margin: 16px 0; border: 1px solid var(--line); border-radius: 18px; }
.article-body figure { margin: 18px 0; }
.article-body figcaption { margin-top: 8px; color: var(--muted); font-size: 0.92rem; text-align: center; }
.article-body h2, .article-body h3, .content-box h2, .content-box h3 { margin-top: 24px; margin-bottom: 12px; line-height: 1.25; }
.article-body p, .article-body ul, .content-box p, .content-box ul { margin: 0 0 16px; }
.article-body ul, .content-box ul { padding-left: 22px; }

.breadcrumb {
  display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 18px; color: var(--muted); list-style: none;
}
.breadcrumb li::after { content: "/"; margin-left: 8px; }
.breadcrumb li:last-child::after { content: ""; margin-left: 0; }

/* --- 9. ADMIN & TABLES --- */
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card { width: min(520px, 100%); }
.admin-split { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr); gap: 20px; }
.sticky-side { position: sticky; top: 96px; align-self: start; }
.info-list { display: grid; gap: 12px; }
.info-list .small-card { padding: 14px; border: 1px solid var(--line); border-radius: 18px; background: #ffffff; }
.internal-link-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.inline-help { margin-top: 6px; color: var(--muted); font-size: 0.9rem; }
.image-preview { display: block; width: 100%; max-width: 420px; margin-top: 10px; border: 1px solid var(--line); border-radius: 16px; }
.upload-box { display: grid; gap: 14px; }
.upload-preview { margin-top: 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.upload-box input[type="file"] { border: 1px dashed var(--line); border-radius: 14px; background: #ffffff; padding: 12px; }
.code-snippet {
  width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 14px; background: #ffffff;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92rem; line-height: 1.5; resize: vertical;
}
.editor-toolbar { margin-bottom: 10px; }
.editor-toolbar button { min-height: 38px; padding: 9px 12px; border-radius: 12px; box-shadow: none; }
.editor-surface { min-height: 280px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: #ffffff; }
.list-clean { padding: 0; margin: 0; list-style: none; }
.list-clean li { margin-bottom: 10px; }
.table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; min-width: 640px; border-collapse: collapse; }
th, td { padding: 12px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: var(--muted); font-size: 0.92rem; }

/* --- 10. DECORATIVE CAT MODULES --- */
.cat-fun-section, .cat-image-section { padding: 18px 0 34px; }
.cat-fun-card, .cat-image-card {
  display: grid; grid-template-columns: minmax(260px, 360px) minmax(0, 1fr); gap: 24px; align-items: center; padding: 22px; background: #ffffff;
}
.cat-stage { position: relative; min-height: 230px; overflow: hidden; border-radius: 22px; background: linear-gradient(180deg, #fff7fb 0%, #ffe9f0 100%); }
.cat-shadow, .cat-figure, .cat-ear, .cat-head, .cat-body, .cat-eye, .cat-nose, .cat-mouth, .cat-whisker, .cat-paw, .cat-tail, .cat-ball { position: absolute; }
.cat-shadow { left: 50%; bottom: 18px; width: 120px; height: 16px; border-radius: 50%; background: rgba(0, 0, 0, 0.1); filter: blur(1px); transform: translateX(-50%); animation: cat-shadow-bounce 2.8s ease-in-out infinite; }
.cat-figure { left: 50%; bottom: 28px; width: 150px; height: 150px; transform: translateX(-50%); animation: cat-float 2.8s ease-in-out infinite; }
.cat-ear { top: 4px; width: 28px; height: 28px; border-radius: 4px 18px; background: #ffffff; transform: rotate(45deg); z-index: 1; }
.cat-ear::after { content: ""; position: absolute; inset: 6px; border-radius: 3px 10px; background: #ffd4e1; }
.ear-left { left: 24px; } .ear-right { right: 24px; }
.cat-head { top: 18px; left: 50%; width: 86px; height: 76px; border-radius: 50%; background: #ffffff; box-shadow: 0 6px 14px rgba(0, 0, 0, 0.06); transform: translateX(-50%); z-index: 2; }
.cat-body { left: 50%; bottom: 8px; width: 108px; height: 88px; border-radius: 48px 48px 28px 28px; background: #ffffff; box-shadow: 0 8px 18px rgba(0, 0, 0, 0.06); transform: translateX(-50%); }
.cat-eye { top: 24px; width: 9px; height: 12px; border-radius: 50%; background: #222222; animation: cat-blink 4s infinite; }
.eye-left { left: 22px; } .eye-right { right: 22px; }
.cat-nose { top: 38px; left: 50%; width: 12px; height: 8px; border-radius: 50% 50% 60% 60%; background: #ff9ab8; transform: translateX(-50%); }
.cat-mouth { top: 46px; left: 50%; width: 30px; height: 14px; transform: translateX(-50%); }
.cat-mouth::before, .cat-mouth::after { content: ""; position: absolute; top: 0; width: 14px; height: 10px; border-bottom: 2px solid #555555; border-radius: 0 0 14px 14px; }
.cat-mouth::before { left: 1px; } .cat-mouth::after { right: 1px; }
.cat-whisker { width: 22px; height: 2px; border-radius: 2px; background: #b8b8b8; }
.whisker-left { left: -12px; } .whisker-right { right: -12px; }
.whisker-top { top: 38px; } .whisker-bottom { top: 48px; }
.whisker-left.whisker-top { transform: rotate(10deg); } .whisker-left.whisker-bottom { transform: rotate(-8deg); }
.whisker-right.whisker-top { transform: rotate(-10deg); } .whisker-right.whisker-bottom { transform: rotate(8deg); }
.cat-paw { bottom: 6px; width: 22px; height: 18px; border-radius: 14px; background: #ffffff; z-index: 3; }
.paw-left { left: 46px; } .paw-right { right: 46px; }
.cat-tail { right: 6px; bottom: 28px; width: 52px; height: 52px; border-top: 12px solid #ffffff; border-right: 12px solid #ffffff; border-radius: 0 100% 0 0; transform-origin: left bottom; animation: cat-tail-swing 1.8s ease-in-out infinite; }
.cat-ball { right: 56px; bottom: 28px; width: 22px; height: 22px; border-radius: 50%; background: var(--brand); box-shadow: inset -4px -4px 0 rgba(255, 255, 255, 0.35); animation: cat-ball-bounce 2.8s ease-in-out infinite; }
.cat-image-banner { width: 100%; overflow: hidden; background: #ffffff; }
.cat-image-banner picture, .cat-image-banner img, .cat-image-media picture, .cat-image-media img { display: block; width: 100%; }
.cat-image-banner img { aspect-ratio: 16 / 9; object-fit: cover; object-position: center; }
.cat-image-media { position: relative; overflow: hidden; border-radius: 22px; background: #fff2f6; aspect-ratio: 16 / 9; }
.cat-image-media img { height: 100%; object-fit: cover; object-position: center; }
.cat-image-copy { padding: 24px 28px 28px; }
.cat-image-card .cat-image-copy, .cat-fun-copy { padding: 0; }
.cat-image-copy h2, .cat-fun-copy h2 { margin: 8px 0 10px; font-size: clamp(1.45rem, 3vw, 2.1rem); line-height: 1.2; }
.cat-image-copy p, .cat-fun-copy p { max-width: 760px; margin: 0 0 18px; color: #5c5c5c; line-height: 1.7; }

@keyframes cat-float { 0%, 100% { transform: translateX(-50%) translateY(0); } 50% { transform: translateX(-50%) translateY(-8px); } }
@keyframes cat-shadow-bounce { 0%, 100% { transform: translateX(-50%) scaleX(1); opacity: 0.22; } 50% { transform: translateX(-50%) scaleX(0.9); opacity: 0.14; } }
@keyframes cat-tail-swing { 0%, 100% { transform: rotate(12deg); } 50% { transform: rotate(-8deg); } }
@keyframes cat-ball-bounce { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes cat-blink { 0%, 44%, 48%, 100% { transform: scaleY(1); } 46% { transform: scaleY(0.1); } }

/* --- 11. FOOTER --- */
.footer { margin-top: 20px; padding: 34px 0 30px; border-top: 1px solid var(--line); color: var(--muted); }
.footer-grid { grid-template-columns: minmax(0, 1.2fr) minmax(180px, 0.8fr) minmax(180px, 0.8fr); }
.footer h3 { margin: 0 0 10px; color: var(--ink); }
.footer-links a { display: inline-flex; padding: 4px 0; color: var(--muted); }
.footer-links a:hover { color: var(--ink); }
.footer-bottom { margin-top: 24px; padding-top: 18px; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.95rem; text-align: center; }
.footer-bottom p { margin: 0; }

/* ======================================================
   12. MEDIA QUERIES (GROUPED AND OPTIMIZED)
   ====================================================== */

/* --- TABLET LARGE (1040px) --- */
@media (max-width: 1040px) {
  .hero-shell, .showcase-grid, .faq-grid, .stat-grid, .grid-4, 
  .grid-3, .name-grid, .dashboard-grid, .footer-grid, .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .generator-grid, .admin-split, .internal-link-grid { grid-template-columns: 1fr; }
  .sticky-side { position: static; }
}

/* --- TABLET (820px) --- */
@media (max-width: 820px) {
  .topbar { position: sticky; top: 0; background: #fffafc; border-bottom: 1px solid var(--line); backdrop-filter: none; }
  .nav { flex-wrap: nowrap; min-height: 66px; padding: 10px 0; gap: 12px; position: relative; }
  .brand { flex: 1 1 auto; max-width: calc(100% - 58px); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .brand-badge { width: 38px; height: 38px; }
  .nav-toggle { display: inline-grid; flex: 0 0 46px; width: 46px; height: 46px; padding: 0; border-radius: 14px; background: #ffffff; box-shadow: 0 8px 18px rgba(91, 54, 78, 0.08); }
  
  .nav-links {
    position: absolute; top: calc(100% + 10px); left: 0; right: 0; width: 100%;
    z-index: 1000; display: none; flex-direction: column; align-items: stretch; justify-content: flex-start;
    gap: 6px; padding: 10px; border: 1px solid var(--line); border-radius: 22px; background: #ffffff; box-shadow: 0 22px 50px rgba(91, 54, 78, 0.16);
  }
  body.has-js .nav-links { display: none; }
  body.has-js .nav-links.is-open, .nav-links.is-open { display: flex; }
  .nav-links a { width: 100%; min-height: 44px; justify-content: flex-start; padding: 11px 14px; border-radius: 14px; color: var(--ink); background: transparent; }
  .nav-links a:hover, .nav-links a:focus-visible { background: var(--brand-soft); }
  .cat-fun-card, .cat-image-card { grid-template-columns: 1fr; }
}

/* --- MOBILE LANDSCAPE (720px) --- */
@media (max-width: 720px) {
  .container { width: calc(100% - 24px); }
  .section, .hero-section, .generator-section, .article-section, 
  .faq-section, .stats-section, .cat-fun-section, .cat-image-section { padding-top: 22px; padding-bottom: 22px; }
  .hero-section { padding-top: 24px; }
  
  .hero-shell, .generator-grid, .stat-grid, .showcase-grid, .faq-grid, 
  .grid-3, .grid-4, .name-grid, .dashboard-grid, .footer-grid, .form-grid, 
  .admin-split, .cat-fun-card, .cat-image-card { grid-template-columns: 1fr; gap: 16px; }

  .hero-content h1, .section-heading h1, .section-heading h2, 
  .page-header h1, .content-box > h1:first-child { margin-top: 8px; margin-bottom: 10px; line-height: 1.08; letter-spacing: -0.03em; }
  .hero-content h1 { font-size: clamp(2rem, 10vw, 3.2rem); }
  .section-heading h1, .section-heading h2, .page-header h1, .content-box > h1:first-child { font-size: clamp(1.75rem, 8vw, 2.4rem); }
  .hero-lead, .section-heading p, .page-header p, .result-meaning, .preview-card p, .showcase-card p, .faq-card p { font-size: 1rem; line-height: 1.65; }

  .hero-cta-row, .search-actions, .actions, .result-actions, .copy-row { display: grid; grid-template-columns: 1fr; width: 100%; gap: 10px; }
  .button, .button-lg, button, input[type="submit"] { width: 100%; min-height: 48px; padding: 13px 16px; border-radius: 15px; text-align: center; }
  
  .preview-card, .filter-panel, .result-panel, .stat-card, .showcase-card, 
  .faq-card, .card, .panel, .admin-card, .form-card, .content-box, 
  .cat-fun-card, .cat-image-card { padding: 18px; border-radius: 22px; }

  .preview-topline, .result-header, .section-subheader, .section-header, .showcase-card-top, .preview-card .preview-topline { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 6px; }
  
  .preview-card { gap: 10px; min-height: 0; }
  .preview-card .eyebrow, .preview-card .pill, .preview-card .chip, .preview-topline .eyebrow, .preview-topline .pill, .preview-topline .chip { font-size: 0.82rem; padding: 7px 11px; border-radius: 999px; }
  .preview-card .result-name, .result-name { margin-top: 2px; margin-bottom: 8px; font-size: clamp(2rem, 12vw, 2.8rem); line-height: 1.02; word-break: break-word; }
  .preview-card .result-meaning, .result-meaning { font-size: 0.96rem; line-height: 1.7; }
  .preview-card .chip-row, .preview-card .name-meta, .preview-card .showcase-meta, .chip-row, .showcase-meta, .name-meta { gap: 7px; margin-top: 18px; margin-bottom: 18px; }
  .preview-card .actions, .preview-card .result-actions, .preview-card .copy-row { margin-top: 14px; margin-bottom: 12px; gap: 10px; }

  .chip, .pill, .mini-tag, .eyebrow { max-width: 100%; overflow-wrap: anywhere; }
  .stat-card { padding: 22px 16px; }
  .stat-card strong, .kpi { font-size: clamp(2rem, 11vw, 2.65rem); }
  .filter-panel, .sticky-side { position: static; }
  .cat-stage { min-height: 190px; }
  .cat-image-copy, .cat-fun-copy { padding: 0; text-align: left; }
  .cat-image-banner img, .cat-image-media { aspect-ratio: 16 / 10; }
  table { min-width: 560px; }
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .footer { margin-top: 8px; padding-top: 26px; padding-bottom: 24px; }
}

/* --- MOBILE PORTRAIT (560px) --- */
@media (max-width: 560px) {
  .nav { min-height: 64px; gap: 10px; }
  .brand-badge { width: 38px; height: 38px; }
  .hero-cta-row .button, .result-actions .button { width: 100%; }
  .chip-row, .showcase-meta, .hero-mini-tags { gap: 8px; }
  .article-body, .content-box { font-size: 1rem; }
  table { min-width: 560px; }
}

/* --- MOBILE SMALL (480px) --- */
@media (max-width: 480px) {
  .container { width: calc(100% - 20px); }
  .nav { min-height: 62px; }
  .brand { gap: 9px; font-size: 0.95rem; }
  .brand-badge { width: 36px; height: 36px; }
  .nav-toggle { flex-basis: 44px; width: 44px; height: 44px; }
  
  .hero-section, .section, .generator-section, .article-section, 
  .faq-section, .stats-section { padding-top: 18px; padding-bottom: 18px; }
  
  .preview-card, .filter-panel, .result-panel, .stat-card, .showcase-card, 
  .faq-card, .card, .panel, .admin-card, .form-card, .content-box, 
  .cat-fun-card, .cat-image-card { padding: 16px; border-radius: 20px; }
  
  .hero-content h1 { font-size: clamp(1.85rem, 11vw, 2.65rem); }
  .section-heading h1, .section-heading h2, .page-header h1, .content-box > h1:first-child { font-size: clamp(1.55rem, 8.8vw, 2.15rem); }
  
  .preview-card .result-name, .result-name { font-size: clamp(1.9rem, 13vw, 2.45rem); }
  .preview-card .result-meaning, .result-meaning { font-size: 0.94rem; }
  .preview-card .chip-row .chip, .preview-card .chip-row .pill, 
  .preview-card .showcase-meta .chip, .preview-card .name-meta .chip, 
  .chip, .pill, .mini-tag { font-size: 0.78rem; padding: 7px 10px; }

  input[type="text"], input[type="url"], input[type="email"], 
  input[type="password"], textarea, select { min-height: 48px; border-radius: 14px; font-size: 16px; }
}

/* --- PRINT & ACCESSIBILITY --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
@media print {
  .topbar, .footer, .button, button { display: none !important; }
  body { background: #ffffff; color: #000000; }
  .content-box, .card, .panel { border: 0; box-shadow: none; }
}

/* ======================================================
   FIX TUMPANG TINDIH CHIP & TOMBOL RESULT PANEL
   ====================================================== */

/* 1. Beri jarak antara teks arti nama dengan deretan chip */
.result-panel .result-meaning {
  margin-bottom: 18px;
}

/* 2. Beri jarak lega di bawah deretan chip (Gender, Warna, dll) */
.result-panel .showcase-meta,
.preview-card .showcase-meta,
.preview-card .chip-row {
  margin-bottom: 26px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

/* 3. Beri jarak antar tombol agar tidak menempel jika turun baris (di HP) */
.result-panel .result-actions,
.preview-card .result-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 10px;
}

/* 4. Pastikan tombol tidak punya margin bawaan yang merusak sejajaran */
.result-panel .result-actions .button,
.result-panel .result-actions button,
.preview-card .result-actions .button {
  margin: 0;
}

/* Styling untuk Maskot Kucing di Stats Section */
.stats-illustration {
    display: flex;
    justify-content: center;
    margin-bottom: 24px;
}

/* Animasi melayang tipis agar terlihat hidup */
.stats-illustration #catRun {
    animation: floatCat 3s ease-in-out infinite;
    transform-origin: center bottom;
}

@keyframes floatCat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

@media (max-width: 720px) {
    .stats-illustration {
        margin-bottom: 16px;
    }
}

/* ======================================================
   FIX TAG "CONTOH NAMA KUCING" KE SAMPING & RAPAT (SEMUA LAYAR)
   ====================================================== */
.preview-card .preview-topline,
.preview-topline {
  display: flex !important;
  flex-direction: row !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start !important; /* Membuatnya rapat ke kiri di HP maupun Desktop */
  gap: 10px !important; /* Jarak pas antar tag */
}

/* ======================================================
   FIX DOUBLE ARROW DI DROPDOWN (SELECT)
   ====================================================== */
select {
  -webkit-appearance: none !important;
  -moz-appearance: none !important;
  appearance: none !important;
}

/* ======================================================
   FIX TAG HERO SUPAYA BISA DI-SWIPE KE SAMPING (MOBILE)
   ====================================================== */
@media (max-width: 720px) {
  .hero-mini-tags {
    flex-wrap: nowrap !important; /* Mencegah tag turun ke bawah */
    overflow-x: auto; /* Mengaktifkan scroll ke samping */
    -webkit-overflow-scrolling: touch; /* Biar scroll-nya mulus di HP */
    padding-bottom: 5px; /* Sedikit ruang agar tidak terpotong */
    justify-content: flex-start !important;
    
    /* Menyembunyikan scrollbar agar terlihat bersih (opsional tapi disarankan) */
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
  }
  
  /* Menyembunyikan scrollbar untuk Chrome, Safari dan Opera */
  .hero-mini-tags::-webkit-scrollbar {
    display: none;
  }

  /* Pastikan teks di dalam tag tidak patah dan tag tidak mengecil */
  .hero-mini-tags .mini-tag {
    white-space: nowrap;
    flex-shrink: 0;
  }
}

/* ======================================================
   FIX NAMA & TAG KEPRIBADIAN SEJAJAR DI KARTU (MOBILE)
   ====================================================== */
@media (max-width: 720px) {
  .showcase-card .showcase-card-top,
  .name-card .showcase-card-top {
    flex-direction: row !important; /* Memaksa nama dan tag berjejer ke samping */
    align-items: center !important; /* Memastikan posisinya sejajar di tengah */
    justify-content: space-between !important; /* Nama di kiri, Tag di kanan (Otomatis rapi) */
    gap: 12px !important;
  }

  .showcase-card .showcase-card-top h3,
  .name-card .showcase-card-top h3 {
    margin: 0 !important; /* Mencegah nama turun atau terlalu jauh dari tag */
    line-height: 1.2 !important;
  }
}