/* =========================================================
   TINA'S LAB — SHARED DESIGN SYSTEM (style.css)
   Giữ nguyên 100% tone màu, font chữ & bố cục gốc
   ========================================================= */
:root {
  --bg: #FAF8F5;
  --bg-alt: #F3EFEA;
  --surface: #FFFFFF;
  --text-primary: #1F2933;
  --text-secondary: #52606D;
  --text-muted: #7B8794;
  --border: #E5E0D8;
  --border-strong: #D3CCC2;

  --slate: #567289;
  --slate-dark: #41596D;
  --slate-soft: #EBF1F5;

  --sage: #3E7B67;
  --sage-soft: #EAF5F1;

  --terracotta: #C86D51;
  --terracotta-soft: #FDF0EC;

  --amber: #B4691E;
  --amber-soft: #FDF5E6;

  --shadow-sm: 0 2px 6px rgba(31, 41, 51, 0.04);
  --shadow-md: 0 10px 26px -4px rgba(31, 41, 51, 0.07);
  --shadow-lg: 0 18px 40px -6px rgba(31, 41, 51, 0.11);
  --radius-lg: 18px;
  --radius-md: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Be Vietnam Pro', -apple-system, BlinkMacSystemFont, sans-serif;
  background-color: var(--bg);
  color: var(--text-primary);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main { flex: 1; }

h1, h2, .serif-title {
  font-family: 'Lora', Georgia, serif;
  letter-spacing: -0.015em;
}

/* Header & Responsive Navigation */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(250, 248, 245, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 10px 24px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Hàng 1: Tìm kiếm + VIE | ENG — căn sát mép phải */
.nav-top-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 14px;
  width: 100%;
  position: relative;
}

/* Hàng 2: Logo bên trái — 5 tab nằm 1 hàng ngang bên phải */
.nav-main-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: 'Lora', serif;
  font-weight: 700;
  font-size: 1.18rem;
  text-decoration: none;
  color: var(--text-primary);
  flex-shrink: 0;
  user-select: none;
}

.logo-mark {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  background: var(--slate);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: 'Be Vietnam Pro', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
}

nav.desktop-nav { display: flex; gap: 4px; flex-wrap: nowrap; white-space: nowrap; }

nav.desktop-nav a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 7px 13px;
  border-radius: 999px;
  transition: all 0.2s ease;
}

nav.desktop-nav a:hover,
nav.desktop-nav a.active {
  color: var(--slate-dark);
  background: var(--slate-soft);
  font-weight: 600;
}

.nav-cta {
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  color: #fff;
  background: var(--slate);
  padding: 8px 16px;
  border-radius: 999px;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.nav-cta:hover { background: var(--slate-dark); }

/* Mobile / Tablet Hamburger Button & Drawer */
.mobile-menu-btn {
  display: none;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-primary);
  font-size: 1.15rem;
  cursor: pointer;
  align-items: center;
  justify-content: center;
}

.mobile-drawer {
  display: none;
  flex-direction: column;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 20px 18px;
  gap: 6px;
  box-shadow: var(--shadow-md);
}

.mobile-drawer.open { display: flex; }

.mobile-drawer a {
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.95rem;
  padding: 11px 14px;
  border-radius: 10px;
  transition: background 0.15s ease;
}

.mobile-drawer a:hover,
.mobile-drawer a.active {
  background: var(--slate-soft);
  color: var(--slate-dark);
}

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
  width: 100%;
}

/* Section Base */
section {
  padding: 58px 0;
  border-bottom: 1px solid rgba(229, 224, 216, 0.6);
}

section:last-of-type { border-bottom: none; }

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--slate);
  margin-bottom: 8px;
}

.section-header {
  margin-bottom: 30px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.section-header h2 {
  font-size: clamp(1.6rem, 3vw, 2.15rem);
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.25;
}

.section-desc {
  color: var(--text-secondary);
  font-size: 0.96rem;
  max-width: 680px;
  margin-top: 8px;
}

/* Sub-page Top Hero */
.subpage-hero {
  padding: 42px 0 34px;
  border-bottom: 1px solid var(--border);
}

.breadcrumb-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-decoration: none;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--bg-alt);
  transition: all 0.18s ease;
}

.breadcrumb-back:hover {
  background: var(--slate-soft);
  color: var(--slate-dark);
}

.subpage-hero-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
}

.subpage-hero h1 {
  font-size: clamp(2rem, 4vw, 2.75rem);
  line-height: 1.18;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
  min-height: 44px;
}

.btn-primary {
  background: var(--slate);
  color: #FFFFFF;
}

.btn-primary:hover {
  background: var(--slate-dark);
  transform: translateY(-1px);
}

.btn-outline {
  background: var(--surface);
  color: var(--text-primary);
  border-color: var(--border-strong);
}

.btn-outline:hover {
  background: var(--bg-alt);
  transform: translateY(-1px);
}

/* 1. HERO (Trang chủ) */
.hero {
  padding: 68px 0 60px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: center;
}

.hero h1 {
  font-size: clamp(2.25rem, 4.5vw, 3.4rem);
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary);
  margin-bottom: 18px;
}

.hero-sub {
  font-size: 1.06rem;
  color: var(--text-secondary);
  margin-bottom: 30px;
  max-width: 540px;
  line-height: 1.7;
}

.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; }

.hero-illustration {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 20px;
  box-shadow: var(--shadow-md);
  overflow: hidden;
}

.hero-illustration img.custom-banner-img,
.closing-visual img.custom-banner-img {
  width: 100%;
  height: auto;
  max-height: 320px;
  object-fit: cover;
  border-radius: 16px;
  display: block;
}

/* 2. BẠN SẼ NHẬN ĐƯỢC GÌ */
.value-grid {
  display: grid;
  grid-template-columns: 1.45fr 0.85fr;
  gap: 28px;
  align-items: stretch;
}

.value-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.value-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

.value-item h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 6px;
}

.value-item p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.visit-box {
  background: var(--slate);
  color: #FFFFFF;
  border-radius: var(--radius-lg);
  padding: 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.visit-box h3 {
  font-family: 'Lora', serif;
  font-size: 1.35rem;
  margin-bottom: 16px;
}

.visit-box ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.visit-box li {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.95rem;
  background: rgba(255, 255, 255, 0.1);
  padding: 10px 14px;
  border-radius: 10px;
}

/* 3. BẢN ĐỒ KHU VƯỜN (4 Khu Vực -> 4 Trang Con) */
.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.map-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 4px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 22px;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.map-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.map-card h3 {
  font-family: 'Lora', serif;
  font-size: 1.22rem;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.map-card p {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

.map-card-highlight {
  font-size: 0.8rem;
  color: var(--text-muted);
  background: var(--bg);
  padding: 8px 11px;
  border-radius: 8px;
  border: 1px solid var(--border);
  margin-top: 12px;
}

.map-card-cta {
  font-size: 0.86rem;
  font-weight: 700;
  color: var(--slate-dark);
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* Cards Grid (3 cols) */
.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}

.card-cover-wrap {
  margin: -6px -6px 16px -6px;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
}

.card-cover-wrap img {
  width: 100%;
  height: 185px;
  object-fit: cover;
  display: block;
}

.map-card .card-cover-wrap img {
  height: 135px;
}

.card h3 {
  font-size: 1.14rem;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.card p {
  font-size: 0.92rem;
  color: var(--text-secondary);
  margin-bottom: 18px;
}

/* Basic Tools Tip Box */
.tip-box {
  background: var(--bg);
  border-left: 3px solid var(--slate);
  padding: 12px 14px;
  border-radius: 0 10px 10px 0;
  font-size: 0.88rem;
  color: var(--text-primary);
  margin-top: auto;
}

.tip-label {
  font-weight: 700;
  color: var(--slate-dark);
}

/* Pass It On Filters & Archive Tab */
.filter-bar-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 26px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  padding: 8px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s ease;
}

.pill-btn:hover { border-color: var(--slate); color: var(--slate-dark); }

.pill-btn.active {
  background: var(--slate);
  border-color: var(--slate);
  color: #FFFFFF;
}

.pill-btn.pill-archive.active {
  background: #4B5563;
  border-color: #4B5563;
  color: #FFFFFF;
}

.badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  width: fit-content;
}

.badge-free { background: var(--sage-soft); color: var(--sage); }
.badge-pass { background: var(--amber-soft); color: var(--amber); }
.badge-done { background: #E5E7EB; color: #4B5563; }

.pass-card.is-claimed {
  background: #FAF9F7;
  border-style: dashed;
}

.pass-card.is-claimed h3 {
  color: var(--text-secondary);
}

.pass-card.is-claimed .card-cover-wrap img {
  filter: grayscale(35%);
  opacity: 0.88;
}

.pass-card.is-claimed .claim-status-text {
  display: inline;
}

.pass-card.is-claimed .card-bottom-row {
  justify-content: space-between;
}

.pass-card.is-claimed .link-arrow {
  opacity: 0.55;
  cursor: default;
  pointer-events: none;
  background: var(--bg-alt);
  color: var(--text-muted);
}

/* ---------- Nút trạng thái góc dưới thẻ: "Đã hết" / "↩ Đang còn" ----------
   Khách xem chỉ thấy CHỮ trạng thái (Đang còn / Đã tặng / Đã pass).
   Nút chỉ tồn tại khi bật chế độ Admin (body.is-editing). */
.claim-toggle-btn {
  display: none;
  white-space: nowrap;
  background: #FFFFFF;
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
  /* Luôn bấm được, kể cả trên thẻ đã tặng (link liên hệ đã bị ẩn) */
  pointer-events: auto;
  position: relative;
  z-index: 2;
  cursor: pointer;
}

body.is-editing .claim-toggle-btn {
  display: inline-flex;
  align-items: center;
}

/* Thẻ đã tặng: nút "↩ Đang còn" phải nằm trên, không bị lớp phủ/hiệu ứng chặn */
.pass-card.is-claimed .card-bottom-row {
  position: relative;
  z-index: 2;
}

.pass-card.is-claimed .claim-toggle-btn {
  pointer-events: auto;
  opacity: 1;
}

.claim-toggle-btn:hover {
  background: var(--slate);
  color: #FFFFFF;
  border-color: var(--slate);
}

.pass-card.is-claimed .claim-toggle-btn:hover {
  background: var(--sage);
  border-color: var(--sage);
  color: #FFFFFF;
}

.empty-tab-msg {
  display: none;
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-lg);
  padding: 40px 24px;
  text-align: center;
  color: var(--text-secondary);
  font-size: 0.95rem;
}

.card-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--bg-alt);
  gap: 10px;
}

.link-arrow {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--slate-dark);
  text-decoration: none;
  background: var(--slate-soft);
  padding: 7px 14px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.18s ease;
  white-space: nowrap;
}

.link-arrow:hover {
  background: var(--slate);
  color: #FFFFFF;
}

/* Field Notes Category Cards + Article Table */
.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 5px solid var(--slate);
  border-radius: var(--radius-md);
  padding: 24px 20px 20px;
  text-align: center;
  position: relative;
  cursor: pointer;
  transition: all 0.2s ease;
}

.cat-card:hover, .cat-card.active-cat {
  border-color: var(--slate);
  background: #FCFDFE;
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.cat-icon-circle {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--slate);
  color: #fff;
  display: grid;
  place-items: center;
  margin: 0 auto 12px;
  font-size: 1.1rem;
}

.cat-card h3 {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  margin-bottom: 6px;
}

.cat-card p {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin: 0;
}

.notes-table-wrap {
  margin-top: 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.notes-table-head {
  padding: 16px 22px;
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
}

.note-item-row {
  position: relative;
  padding: 18px 22px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  transition: background 0.15s ease;
}

.note-item-row:last-child { border-bottom: none; }
.note-item-row:hover { background: #FDFCFA; }

.note-item-title {
  font-weight: 600;
  font-size: 1rem;
  color: var(--text-primary);
  cursor: pointer;
}

.note-item-title:hover { color: var(--slate-dark); text-decoration: underline; }

.note-item-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 0.84rem;
  color: var(--text-muted);
  flex-wrap: wrap;
}

.cat-pill {
  background: var(--slate-soft);
  color: var(--slate-dark);
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.78rem;
}

/* Closing Banner */
.closing-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  box-shadow: var(--shadow-md);
}

.closing-visual {
  position: relative;
  background: linear-gradient(160deg, #EFE9E0 0%, #DFD6C9 100%);
  padding: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.closing-content {
  padding: 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.closing-content h2 {
  font-size: clamp(1.55rem, 3vw, 2.1rem);
  margin-bottom: 12px;
}

.closing-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin: 24px 0 28px;
}

.closing-mini-item {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
}

.closing-mini-item strong {
  display: block;
  font-size: 0.9rem;
  margin-bottom: 4px;
  color: var(--text-primary);
}

.closing-mini-item span {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.45;
  display: block;
}

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 28px 0;
  margin-top: 32px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 0.88rem;
  color: var(--text-secondary);
}

.footer-links {
  display: flex;
  gap: 18px;
  flex-wrap: wrap;
}

.footer-links a {
  color: var(--slate-dark);
  font-weight: 600;
  text-decoration: none;
}

.footer-links a:hover { text-decoration: underline; }

/* =========================================
   MODALS & ADMIN-ONLY EDITOR (100% ẨN VỚI KHÁCH)
   ========================================= */
.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(31, 41, 51, 0.55);
  backdrop-filter: blur(4px);
  z-index: 10000;
  place-items: center;
  padding: 16px;
  overflow-y: auto;
}

.modal-backdrop.open { display: grid; }

.modal-box {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 24px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
}

.reader-box {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 22px;
  width: 100%;
  max-width: 720px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
}

.reader-top {
  padding: 14px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.reader-scroll {
  padding: 28px 32px;
  overflow-y: auto;
  line-height: 1.75;
}

.reader-scroll h1 {
  font-size: clamp(1.35rem, 3vw, 1.7rem);
  margin: 10px 0 18px;
}

#reader-body-area {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text-secondary);
}

#reader-body-area h3 {
  font-family: 'Lora', serif;
  font-size: 1.22rem;
  color: var(--text-primary);
  margin-top: 8px;
}

#reader-body-area .note-callout {
  background: var(--slate-soft);
  border-left: 4px solid var(--slate);
  padding: 14px 18px;
  border-radius: 0 10px 10px 0;
  color: var(--slate-dark);
}

#reader-body-area figure.note-figure {
  margin: 8px 0;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}

#reader-body-area figure.note-figure img {
  width: 100%;
  max-height: 420px;
  object-fit: contain;
  border-radius: 10px;
  display: block;
  margin: 0 auto;
}

#reader-body-area figure.note-figure figcaption {
  font-size: 0.84rem;
  color: var(--text-muted);
  margin-top: 8px;
  font-style: italic;
}

#reader-body-area[contenteditable="true"] {
  outline: 2px dashed var(--terracotta);
  outline-offset: 8px;
  border-radius: 8px;
  min-height: 180px;
}

#reader-body-area[contenteditable="true"] figure.note-figure img {
  cursor: pointer;
}

/* Admin Floating Pill: Mặc định ẨN HOÀN TOÀN với khách xem web */
#edit-fab {
  display: none;
  position: fixed;
  bottom: 20px;
  right: 20px;
  z-index: 9998;
  background: var(--text-primary);
  color: #fff;
  border: none;
  padding: 10px 16px;
  border-radius: 999px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.84rem;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  align-items: center;
  gap: 6px;
}

#edit-fab:hover { background: var(--slate); }

#editor-bar {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1F2933;
  color: #F9FAFB;
  padding: 10px 16px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  box-shadow: 0 4px 18px rgba(0,0,0,0.2);
}

/* Thanh Admin luôn nằm SÁT mép trên cùng (top: 0), không hở khoảng trắng.
   Chiều cao thực tế do JS đo (syncEditorBarHeight) và set qua biến --editor-bar-h
   để đẩy header (top) và body (padding-top) xuống đúng bằng chiều cao đó. */
body.is-editing { padding-top: var(--editor-bar-h, 84px); }
body.is-editing header { top: var(--editor-bar-h, 84px); }
body.is-editing #editor-bar { display: flex; top: 0 !important; }
body.is-editing #edit-fab { display: none !important; }

@media (max-width: 600px) {
  /* Trên điện thoại thanh Admin có thể xuống dòng → JS vẫn tự đo lại */
  body.is-editing #editor-bar { max-height: 45vh; overflow-y: auto; }
}

body.is-editing [data-editable] {
  outline: 1.5px dashed #E07A5F;
  outline-offset: 3px;
  border-radius: 4px;
  cursor: text;
}

body.is-editing [data-editable]:focus {
  outline: 2px solid #3E7B67;
  background: rgba(62, 123, 103, 0.06);
}

body.is-editing [data-editable-link] {
  outline: 1.5px dashed #567289;
  outline-offset: 3px;
  cursor: pointer;
}

.status-badge-bar {
  font-size: 0.78rem;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255,255,255,0.12);
  color: #A7F3D0;
  font-weight: 600;
}

.ed-btn {
  padding: 7px 12px;
  border-radius: 8px;
  border: none;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  cursor: pointer;
}

.ed-save { background: #3E7B67; color: #fff; }
.ed-cloud { background: #567289; color: #fff; }
.ed-muted { background: #374151; color: #E5E7EB; }
.ed-danger { background: #B91C1C; color: #fff; }
.ed-exit { background: #111827; color: #9CA3AF; border: 1px solid #374151; }
.ed-backup { background: #B4691E; color: #fff; }
.ed-undo { background: #41596D; color: #fff; }
.ed-undo:disabled { opacity: 0.4; cursor: not-allowed; }

.admin-ctrl {
  display: none;
  position: absolute;
  top: 10px;
  right: 10px;
  gap: 5px;
  z-index: 20;
  flex-wrap: wrap;
  justify-content: flex-end;
}

body.is-editing .admin-ctrl { display: flex; }

/* Admin: cụm nút nằm thành một hàng riêng phía trên dòng mục, không đè lên nhãn/ngày/nút Mở → */
body.is-editing .note-item-row .admin-ctrl {
  position: static;
  width: 100%;
  justify-content: flex-end;
  margin-bottom: 6px;
  flex-wrap: wrap;
  gap: 6px;
}
.admin-only-btn { display: none; }
body.is-editing .admin-only-btn { display: inline-flex; }

.mini-btn {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 4px 8px;
  border-radius: 6px;
  border: 1px solid rgba(0,0,0,0.1);
  cursor: pointer;
  background: rgba(255, 255, 255, 0.96);
  color: var(--text-primary);
  box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.mini-btn:hover { background: var(--slate-soft); }

.field-group { margin-bottom: 12px; }
.field-group label {
  display: block;
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 5px;
}
.field-group input, .field-group textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.9rem;
}

.img-dropzone {
  border: 2px dashed var(--border-strong);
  border-radius: 12px;
  padding: 18px;
  text-align: center;
  background: var(--bg);
  cursor: pointer;
  transition: all 0.2s ease;
}
.img-dropzone:hover { border-color: var(--slate); background: var(--slate-soft); }

.img-preview-box {
  margin-top: 12px;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  display: none;
  text-align: center;
}
.img-preview-box img {
  max-width: 100%;
  max-height: 200px;
  display: block;
  margin: 0 auto;
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #1F2933;
  color: #fff;
  padding: 11px 18px;
  border-radius: 12px;
  border: 1px solid #3E7B67;
  font-size: 0.85rem;
  z-index: 10002;
  max-width: 90vw;
  text-align: center;
  transition: transform 0.25s ease;
}
#toast.show { transform: translateX(-50%) translateY(0); }

/* =========================================
   TABLET & IPAD BREAKPOINT (601px - 960px)
   ========================================= */
@media (max-width: 960px) {
  nav.desktop-nav { display: none; }
  .mobile-menu-btn { display: inline-flex; }

  .hero {
    grid-template-columns: 1fr;
    padding: 48px 0 44px;
    gap: 32px;
  }

  .hero-illustration {
    max-width: 520px;
    margin: 0 auto;
    width: 100%;
  }

  .value-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .closing-card { grid-template-columns: 1fr; }
  .closing-visual { padding: 24px; }
  .closing-content { padding: 32px 28px; }
}

/* =========================================
   MOBILE PHONE BREAKPOINT (<= 600px)
   ========================================= */
@media (max-width: 600px) {
  .nav-container { padding: 12px 16px; }
  .container { padding: 0 16px; }
  section { padding: 42px 0; }

  .hero { padding: 34px 0 36px; gap: 24px; }
  .hero-actions { flex-direction: column; width: 100%; }
  .hero-actions .btn { width: 100%; }

  .value-list,
  .grid-4,
  .grid-3,
  .closing-mini-grid {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .card { padding: 20px; }
  .visit-box { padding: 22px; }

  .note-item-row {
    flex-direction: column;
    align-items: flex-start;
    padding: 16px;
    gap: 10px;
  }

  .note-item-meta {
    width: 100%;
    justify-content: space-between;
  }

  .closing-content { padding: 24px 20px; }
  .closing-content .btn { width: 100%; }

  .reader-scroll { padding: 22px 18px; }
  .modal-box { padding: 20px 18px; }
}

/* =========================================================
   BỔ SUNG BẢN NÂNG CẤP: Tìm kiếm, Ngôn ngữ, Nhãn, My Data
   ========================================================= */

/* --- Nút tìm kiếm trên thanh menu --- */
.nav-search-btn {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-secondary);
  font-size: 0.95rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.18s ease;
}

.nav-search-btn:hover {
  background: var(--slate-soft);
  border-color: var(--slate);
  transform: translateY(-1px);
}

/* --- Chuyển đổi ngôn ngữ VIE | ENG --- */
.lang-switch {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  white-space: nowrap;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}

.lang-switch button {
  border: none;
  background: transparent;
  font-family: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--text-muted);
  padding: 7px 11px;
  cursor: pointer;
  transition: all 0.18s ease;
}

.lang-switch button.active { background: var(--slate); color: #fff; }
.lang-switch button:hover:not(.active) { color: var(--slate-dark); }

/* --- Hộp tìm kiếm toàn site: mở rộng ngay tại Hàng 1 của Header --- */
.header-search {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

/* Thanh tìm kiếm: mặc định rộng = 0, chỉ còn icon 🔍 */
.header-search .search-inline {
  display: flex;
  align-items: center;
  width: 0;
  opacity: 0;
  overflow: hidden;
  transition: width 0.26s ease, opacity 0.16s ease;
}

.header-search.is-open .search-inline {
  width: min(300px, 38vw);
  opacity: 1;
}

.header-search .site-search-input {
  width: 100%;
  border: 1.5px solid var(--slate);
  background: var(--surface);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.86rem;
  padding: 7px 14px;
  border-radius: 999px;
  outline: none;
}

.header-search .site-search-input:focus {
  box-shadow: 0 0 0 3px rgba(62, 123, 103, 0.14);
}

/* Dropdown kết quả: nổi đè lên nội dung bên dưới, chỉ hiện khi có từ khóa */
.header-search .search-panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 360px;
  max-width: 92vw;
  max-height: 66vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  padding: 10px;
  z-index: 1000;
  display: none;
}

.header-search .search-panel.has-results { display: block; }

.header-search .search-panel .search-empty { padding: 14px 8px; }

.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1.5px solid var(--border-strong);
  border-radius: 12px;
  padding: 10px 12px;
  background: var(--bg);
}

.search-input-wrap:focus-within {
  border-color: var(--slate);
  box-shadow: 0 0 0 3px rgba(86, 114, 137, 0.12);
}

.search-input-wrap .search-icon { font-size: 1rem; }

#site-search-input {
  flex: 1;
  border: none;
  background: transparent;
  outline: none;
  font-family: inherit;
  font-size: 1rem;
  color: var(--text-primary);
}

.search-results {
  margin-top: 14px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-result-item {
  display: block;
  padding: 11px 13px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg);
  text-decoration: none;
  color: inherit;
  transition: all 0.15s ease;
}

.search-result-item:hover { background: var(--slate-soft); border-color: var(--slate); }

.search-result-item strong {
  display: block;
  font-size: 0.92rem;
  color: var(--text-primary);
  margin-bottom: 3px;
}

/* --- Nhãn nhiều chuyên mục (Field Notes) --- */
.tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  border: 1.5px solid var(--border-strong);
  background: var(--surface);
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.16s ease;
  font-family: inherit;
}

.tag-chip:hover { border-color: var(--slate); }
.tag-chip.selected { background: var(--sage-soft); border-color: var(--sage); color: var(--sage); }
.cat-pill.multi { background: var(--slate-soft); }

/* --- Backlink công cụ ↔ Field Notes --- */
.tool-related {
  margin-top: 10px;
  border-top: 1px dashed var(--border);
  padding-top: 10px;
}

.tool-related-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  color: var(--text-muted);
  display: block;
  margin-bottom: 6px;
}

.tool-related a {
  display: block;
  font-size: 0.83rem;
  color: var(--slate-dark);
  text-decoration: none;
  padding: 3px 0;
}

.tool-related a:hover { text-decoration: underline; }

/* --- My Data: thẻ Thư mục / Chuyên mục (có thể khóa bằng mật khẩu) --- */
.data-folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}

.data-folder-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: all 0.18s ease;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.data-folder-card:hover {
  border-color: var(--slate);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.data-folder-card h3 {
  font-family: 'Lora', serif;
  font-size: 1.1rem;
  margin: 0;
  color: var(--text-primary);
}

.data-folder-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin: 0;
}

.data-folder-card.is-locked { border-left: 4px solid var(--amber); }

/* --- Trạng thái đang tải ảnh --- */
.img-uploading { opacity: 0.6; pointer-events: none; }

/* --- Field trong modal soạn bài: xếp dòng thoáng, ô nhập full chiều rộng --- */
#reader-edit-fields {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-bottom: 22px;
  padding: 18px 18px 4px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
}

.reader-field-row {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
  width: 100%;
}

.reader-field-row label {
  display: block;
  font-size: 0.74rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  margin: 0;
}

.reader-field-row input {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: 10px 13px;
  border: 1.5px solid var(--border-strong);
  border-radius: 9px;
  font-family: inherit;
  font-size: 0.92rem;
  line-height: 1.4;
  background: var(--surface);
  color: var(--text-primary);
}

.reader-field-row input:focus {
  outline: none;
  border-color: var(--sage);
  box-shadow: 0 0 0 3px rgba(62, 123, 103, 0.12);
}

/* Nhãn chuyên mục dạng nút pill, khoảng cách rõ ràng */
.reader-field-row .tag-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 2px;
}

.reader-field-row .tag-chip {
  margin: 0;
}

@media (max-width: 520px) {
  #reader-edit-fields { padding: 14px 12px 2px; gap: 12px; }
  .reader-field-row .tag-picker { gap: 8px; }
}

/* --- Mục lục nhãn trang Field Notes --- */
.notes-index-box {
  margin-top: 22px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}

.notes-index-ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: 0.86rem;
  color: var(--text-secondary);
}

@media (max-width: 760px) {
  .lang-switch button { padding: 6px 9px; }
  /* Search mở rộng tại Hàng 1: thu hẹp vừa màn hình điện thoại */
  .header-search.is-open .search-inline { width: min(170px, 40vw); }
  .header-search .search-panel { width: 300px; }
  .nav-top-row { gap: 10px; }

  /* My Data: thẻ tab xếp 1 cột trên màn hình hẹp */
  .data-folder-grid { grid-template-columns: 1fr; gap: 12px; }
  .notes-table-head { gap: 8px; }
  .notes-table-head > div { flex-wrap: wrap; }
  .notes-table-wrap .data-tab-index { padding: 12px 16px; }
  .data-tab-head { flex-wrap: wrap; }
  .data-tab-head button { flex: 1 1 auto; }
}


.search-result-item span { font-size: 0.78rem; color: var(--text-muted); }

.search-result-item mark {
  background: var(--amber-soft);
  color: var(--amber);
  padding: 0 2px;
  border-radius: 3px;
}

.search-empty {
  text-align: center;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 22px 10px;
}

/* =========================================================
   BẢN NÂNG CẤP: POPUP LIÊN HỆ, MY DATA, SOẠN BÀI, LINK
   ========================================================= */

/* --- Popup "Nhắn Tina" (Zalo / Telegram / Email) --- */
.contact-channel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.contact-channel {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  transition: all 0.18s ease;
}

.contact-channel:hover {
  border-color: var(--slate);
  background: var(--slate-soft);
  transform: translateX(2px);
}

.contact-channel-icon {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  font-size: 1.05rem;
}

.contact-channel strong {
  display: block;
  font-size: 0.94rem;
  color: var(--text-primary);
}

.contact-channel small {
  display: block;
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* --- My Data: hàng dưới cùng của thẻ tab (nút mật khẩu/sửa + nút quản trị) --- */
.data-folder-toolbar {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

/* Tên tab + icon 🔒 ngay cạnh tên (chỉ hiện khi tab có mật khẩu) */
.data-folder-name {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.data-lock-badge.data-folder-lock-inline {
  font-size: 0.72rem;
  padding: 2px 5px;
}

/* Hàng 2 nút của thẻ tab: chỉ hiện khi bật Admin */
.data-tab-head { display: none; }

body.is-editing .data-tab-head {
  display: flex;
  margin-top: 8px;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.data-tab-head:empty { display: none !important; }

.data-folder-card.is-active {
  border-color: var(--slate);
  box-shadow: var(--shadow-md);
}

/* --- Khung danh sách CHỈ hiện sau khi người dùng bấm vào một thẻ tab --- */
.notes-table-wrap[data-open="false"] { display: none !important; }

/* Nút bên trong thẻ tab / thanh công cụ phải luôn bấm được */
.data-folder-toolbar,
.data-folder-toolbar button,
.data-folder-card button,
.data-folder-card .data-tab-head {
  pointer-events: auto;
}

/* Nút luôn nổi trên vùng chữ contenteditable của thẻ */
.data-folder-toolbar button:not([disabled]),
.data-folder-card button:not([disabled]) {
  position: relative;
  z-index: 2;
  cursor: pointer;
}

/* Icon trang trí trong thẻ không chặn click của nút...
   NHƯNG khi bật Admin thì icon phải bấm được để mở popup Đổi Icon/Hình ảnh */
.data-folder-card .cat-icon-circle { pointer-events: none; }

body.is-editing .cat-icon-circle {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 5;
}

/* Các khung icon khác trên 6 trang: bấm được khi bật Admin */
body.is-editing .tool-icon,
body.is-editing .card-icon,
body.is-editing .feature-icon,
body.is-editing .step-icon,
body.is-editing .project-icon,
body.is-editing .badge-icon {
  pointer-events: auto !important;
  cursor: pointer !important;
  position: relative;
  z-index: 5;
}

body.is-editing main img {
  cursor: pointer !important;
  outline: 2px dashed rgba(224, 122, 95, 0.75);
  outline-offset: 3px;
}

/* Hiệu ứng "bấm được" cho icon/ảnh khi ở chế độ Admin */
body.is-editing .cat-icon-circle:hover,
body.is-editing .tool-icon:hover,
body.is-editing .card-icon:hover,
body.is-editing .feature-icon:hover,
body.is-editing .step-icon:hover,
body.is-editing .project-icon:hover,
body.is-editing .badge-icon:hover {
  box-shadow: 0 0 0 3px rgba(62, 123, 103, 0.35);
}

/* Chế độ Admin: vùng chữ của thẻ tab không phủ lên hàng nút */
body.is-editing .data-folder-card .data-tab-head { position: relative; z-index: 2; }

/* --- Mục lục theo tab nằm trong khung danh sách --- */
.notes-table-wrap .data-tab-index {
  margin: 0;
  padding: 14px 22px;
  border: none;
  border-top: 1px solid var(--border);
  border-radius: 0;
  box-shadow: none;
  background: var(--bg-alt);
}

/* --- Nhãn 🔒 trên thẻ danh sách (chỉ icon, không kèm chữ) --- */
.data-lock-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  line-height: 1;
  color: var(--amber);
  background: var(--amber-soft);
  border: 1px solid #F3DFC0;
  border-radius: 999px;
  padding: 3px 6px;
  white-space: nowrap;
}

/* --- Lỗi nhập sai mật khẩu (nhẹ nhàng) --- */
.data-lock-error {
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--terracotta);
}

/* --- Ô bôi đen được trong khung soạn thảo --- */
#reader-body-area[contenteditable="true"]::selection,
#reader-body-area[contenteditable="true"] *::selection {
  background: var(--slate-soft);
  color: var(--slate-dark);
}

/* --- Link gắn trong nội dung bài --- */
#reader-body-area a,
.note-body-hidden a {
  color: var(--slate-dark);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--slate);
  transition: color 0.15s ease;
}

#reader-body-area a:hover,
.note-body-hidden a:hover {
  color: var(--sage);
  text-decoration-color: var(--sage);
}


/* =====================================================
   POPUP DÙNG CHUNG: ĐỔI ICON (EMOJI) & HÌNH ẢNH (6 trang)
   ===================================================== */
#universal-media-modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 20010;
  background: rgba(31, 41, 51, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 16px;
  overflow-y: auto;
}

#universal-media-modal.open { display: flex; }

.um-box {
  background: #FFFFFF;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 22px;
  width: 100%;
  max-width: 480px;
  box-shadow: var(--shadow-lg);
  margin: auto;
}

.um-title {
  font-family: 'Lora', serif;
  font-size: 1.15rem;
  margin-bottom: 4px;
}

.um-subtitle {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-bottom: 16px;
  line-height: 1.5;
}

.um-section {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 14px;
  margin-bottom: 12px;
  background: var(--bg-alt);
}

.um-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--slate-dark);
  margin-bottom: 10px;
}

.um-emoji-grid {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 6px;
  margin-top: 10px;
}

.um-emoji-btn {
  font-size: 1.15rem;
  line-height: 1;
  padding: 7px 0;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.12s ease;
}

.um-emoji-btn:hover {
  transform: translateY(-2px);
  border-color: var(--slate);
}

.um-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.um-input {
  flex: 1 1 160px;
  min-width: 0;
  font-family: inherit;
  font-size: 0.88rem;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #FFFFFF;
  color: var(--text-primary);
}

.um-hint {
  font-size: 0.72rem;
  color: var(--text-secondary);
  margin-top: 8px;
  line-height: 1.5;
}

.um-preview {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: 12px;
  background: #FFFFFF;
}

.um-preview-label {
  font-size: 0.74rem;
  color: var(--text-secondary);
}

.um-preview-box {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 1.5rem;
  background: var(--bg-alt);
  overflow: hidden;
  flex: 0 0 auto;
}

.um-preview-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.um-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
}

@media (max-width: 600px) {
  .um-box { padding: 16px; }
  .um-emoji-grid { grid-template-columns: repeat(6, 1fr); }
  .um-footer .ed-btn { flex: 1 1 auto; justify-content: center; }
}

