/* SHINHA Form Tools — Home Page (Template Gallery Home V1) */

.home-page {
  --shinha-navy: #061A40;
  --shinha-deep-blue: #082B66;
  --shinha-blue: #0B4DBA;
  --shinha-accent: #4F7DE8;
  --shinha-light-blue: #EAF3FF;
  --shinha-soft-blue: #F4F8FF;
  --shinha-border: #D8E4F5;
  --shinha-text: #0B1736;
  --shinha-muted: #5D6B82;
  --shinha-white: #FFFFFF;
  --shinha-gold: #F6C66B;
  --shinha-success: #1E9E64;
  --shinha-shadow: 0 18px 45px rgba(6, 26, 64, 0.12);
  --shinha-card-shadow: 0 10px 28px rgba(6, 26, 64, 0.10);
  --shinha-radius-lg: 24px;
  --shinha-radius-md: 16px;
  --shinha-radius-sm: 10px;

  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--shinha-text);
  background: var(--shinha-white);
}

.home-page h1,
.home-page h2,
.home-page h3 {
  font-family: "Be Vietnam Pro", "Inter", system-ui, sans-serif;
}

.home-container {
  width: 100%;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 20px;
}

/* Hero dùng container rộng hơn, sát viền hơn */
.hero-section .home-container {
  max-width: 1480px;
  padding: 0 16px;
}

/* ── Header ── */
.home-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(216, 228, 245, 0.9);
}

.home-header__inner {
  height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  text-decoration: none;
  color: var(--shinha-navy);
}

.site-brand:hover,
.site-brand:focus {
  text-decoration: none;
  color: var(--shinha-navy);
}

.site-brand__logo {
  height: 68px;
  width: auto;
  max-height: 68px;
  object-fit: contain;
  display: block;
  flex-shrink: 0;
}

.site-brand__name {
  font-family: "Be Vietnam Pro", "Inter", system-ui, sans-serif;
  font-weight: 800;
  font-size: 22px;
  letter-spacing: 0.02em;
  line-height: 1;
  white-space: nowrap;
}

.home-header__nav {
  display: flex;
  align-items: center;
  gap: 28px;
}

.home-header__nav a {
  font-size: 14px;
  font-weight: 600;
  color: var(--shinha-text);
  text-decoration: none;
  transition: color 0.2s;
}

.home-header__nav a:hover {
  color: var(--shinha-blue);
  text-decoration: none;
}

/* Nav dropdown — Công cụ khác (Mẫu có sẵn vẫn là link thường) */
.home-nav-dropdown {
  position: relative;
}

.home-nav-dropdown__toggle {
  list-style: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--shinha-text);
  line-height: inherit;
  font-family: inherit;
}

.home-nav-dropdown__toggle::-webkit-details-marker {
  display: none;
}

.home-nav-dropdown__toggle::marker {
  content: "";
}

.home-nav-dropdown__toggle:hover {
  color: var(--shinha-blue);
}

.home-nav-dropdown__menu {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  min-width: 220px;
  padding: 8px 0;
  background: var(--shinha-white);
  border: 1px solid var(--shinha-border);
  border-radius: var(--shinha-radius-sm);
  box-shadow: 0 12px 28px rgba(6, 26, 64, 0.12);
  z-index: 230;
}

.home-nav-dropdown__menu a {
  display: block;
  padding: 10px 16px;
  white-space: nowrap;
}

.home-header__actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-header__menu-btn {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--shinha-border);
  border-radius: var(--shinha-radius-sm);
  background: var(--shinha-white);
  cursor: pointer;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
}

.home-header__menu-btn span {
  display: block;
  width: 18px;
  height: 2px;
  background: var(--shinha-navy);
  border-radius: 2px;
}

/* ── Buttons (scoped) ── */
.home-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--shinha-radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
  white-space: nowrap;
}

.home-btn:hover {
  text-decoration: none;
  transform: translateY(-2px);
}

.home-btn--primary {
  background: var(--shinha-navy);
  color: var(--shinha-white);
  box-shadow: 0 8px 20px rgba(6, 26, 64, 0.18);
}

.home-btn--primary:hover {
  background: var(--shinha-deep-blue);
  box-shadow: 0 12px 28px rgba(6, 26, 64, 0.22);
}

.home-btn--outline {
  background: transparent;
  color: var(--shinha-navy);
  border-color: var(--shinha-navy);
}

.home-btn--outline:hover {
  background: var(--shinha-soft-blue);
}

.home-btn--accent {
  background: var(--shinha-blue);
  color: var(--shinha-white);
}

.home-btn--accent:hover {
  background: var(--shinha-accent);
}

.home-btn--sm {
  padding: 9px 16px;
  font-size: 14px;
  min-height: 42px;
}

/* ── Hero ── */
.hero-section {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #FFFFFF 0%, #F4F8FF 48%, #EAF3FF 100%);
  padding: 40px 0 36px;
}

.hero-section__decor {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
}

.hero-section__decor--1 {
  width: 420px;
  height: 420px;
  top: -120px;
  right: -80px;
  background: radial-gradient(circle, rgba(79, 125, 232, 0.12) 0%, transparent 70%);
}

.hero-section__decor--2 {
  width: 280px;
  height: 280px;
  bottom: -60px;
  left: -40px;
  background: radial-gradient(circle, rgba(11, 77, 186, 0.08) 0%, transparent 70%);
}

.hero-section__dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(79, 125, 232, 0.15) 1px, transparent 1px);
  background-size: 24px 24px;
  opacity: 0.35;
  pointer-events: none;
}

.hero-section__grid {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}

.hero-section__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.hero-badge {
  display: inline-block;
  padding: 4px 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 20px;
}

.hero-badge--beta {
  background: var(--shinha-navy);
  color: var(--shinha-white);
}

.hero-badge--free {
  background: var(--shinha-light-blue);
  color: var(--shinha-blue);
  border: 1px solid var(--shinha-border);
}

.hero-section__title {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.02em;
  color: var(--shinha-navy);
  margin: 0 0 16px;
}

.hero-section__desc {
  font-size: 14px;
  line-height: 1.7;
  color: var(--shinha-muted);
  margin: 0 0 22px;
  max-width: 520px;
}

.hero-section__cta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.hero-section__cta .home-btn {
  padding: 10px 18px;
  font-size: 14px;
}

.hero-features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px 28px;
  margin-bottom: 24px;
}

.hero-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--shinha-text);
}

.hero-feature__icon-wrap {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--shinha-light-blue);
  border: 1px solid rgba(216, 228, 245, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}

.hero-feature__icon {
  width: 18px;
  height: 18px;
  color: var(--shinha-blue);
}

.hero-feature__text {
  flex: 1;
}

.hero-beta-box {
  display: flex;
  gap: 14px;
  padding: 16px 18px;
  background: var(--shinha-white);
  border: 1px solid var(--shinha-border);
  border-radius: var(--shinha-radius-md);
  box-shadow: 0 6px 20px rgba(6, 26, 64, 0.06);
}

.hero-beta-box__icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  background: var(--shinha-light-blue);
  border-radius: 10px;
  border: 1px solid rgba(216, 228, 245, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shinha-blue);
}

.hero-beta-box__icon svg {
  width: 18px;
  height: 18px;
}

.hero-beta-box__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--shinha-navy);
  margin: 0 0 6px;
  line-height: 1.4;
}

.hero-beta-box__text {
  font-size: 12px;
  color: var(--shinha-muted);
  margin: 0;
  line-height: 1.6;
}

/* Hero visual */
.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  min-height: 440px;
  padding: 16px 8px 32px;
  overflow: visible;
}

/* Decorative panels behind mascot */
.hero-deco {
  position: absolute;
  inset: 8% 4% 12%;
  z-index: 0;
  pointer-events: none;
}

.hero-deco__panel {
  position: absolute;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(216, 228, 245, 0.75);
  border-radius: 14px;
  box-shadow: 0 10px 28px rgba(6, 26, 64, 0.05);
  padding: 12px 14px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.hero-deco__panel--1 {
  width: 190px;
  height: 130px;
  top: 4%;
  left: 0;
  transform: rotate(-5deg);
  opacity: 0.75;
}

.hero-deco__panel--2 {
  width: 170px;
  height: 115px;
  top: 14%;
  right: 2%;
  transform: rotate(4deg);
  opacity: 0.7;
}

.hero-deco__panel-bar {
  height: 6px;
  width: 48%;
  background: linear-gradient(90deg, var(--shinha-blue), var(--shinha-accent));
  border-radius: 3px;
  margin-bottom: 8px;
  opacity: 0.3;
}

.hero-deco__panel-line {
  height: 4px;
  background: var(--shinha-border);
  border-radius: 2px;
  margin-bottom: 5px;
  opacity: 0.55;
}

.hero-deco__panel-line--short {
  width: 60%;
}

.hero-deco__panel-block {
  height: 28px;
  background: rgba(79, 125, 232, 0.08);
  border-radius: 5px;
  margin: 6px 0 8px;
  border: 1px solid rgba(216, 228, 245, 0.6);
}

.hero-deco__panel-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 6px;
}

.hero-deco__panel-grid span {
  height: 22px;
  background: rgba(234, 243, 255, 0.85);
  border: 1px solid rgba(216, 228, 245, 0.7);
  border-radius: 4px;
}

.hero-deco__badge {
  position: absolute;
  top: 48%;
  right: 10%;
  width: 56px;
  height: 56px;
  background: var(--shinha-white);
  border-radius: 50%;
  box-shadow: 0 8px 24px rgba(6, 26, 64, 0.08);
  border: 1px solid var(--shinha-border);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
}

.hero-deco__badge img {
  width: 32px;
  height: auto;
  display: block;
}

.hero-mascot {
  position: relative;
  z-index: 2;
  max-width: min(425px, 86%);
  width: 100%;
  margin: 0 auto;
  animation: mascotFloat 6s ease-in-out infinite;
}

.hero-mascot img,
.hero-mascot svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 10px 28px rgba(6, 26, 64, 0.08));
}

/* Feature chips around mascot */
.hero-float-card {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(216, 228, 245, 0.95);
  border-radius: 12px;
  padding: 7px 11px 7px 7px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--shinha-text);
  box-shadow: 0 8px 22px rgba(6, 26, 64, 0.07);
  z-index: 3;
  white-space: nowrap;
}

.hero-float-card__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: var(--shinha-light-blue);
  border: 1px solid rgba(216, 228, 245, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--shinha-blue);
}

.hero-float-card__icon svg {
  width: 14px;
  height: 14px;
}

.hero-float-card__text {
  padding-right: 2px;
}

.hero-float-card--1 { top: 8%; left: -8%; }
.hero-float-card--2 { top: 34%; left: -12%; }
.hero-float-card--3 { top: 22%; right: -10%; }
.hero-float-card--4 { bottom: 22%; right: -10%; }
.hero-float-card--5 { top: 0; right: 6%; max-width: 190px; white-space: normal; }

.hero-pill {
  position: absolute;
  bottom: 4px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--shinha-navy);
  color: var(--shinha-white);
  font-size: 11px;
  font-weight: 700;
  padding: 7px 16px;
  border-radius: 20px;
  white-space: nowrap;
  z-index: 3;
  letter-spacing: 0.01em;
}

/* ── Template Gallery ── */
.template-gallery {
  padding: 44px 0 52px;
  background: var(--shinha-white);
}

.template-gallery__header {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 36px;
}

.template-gallery__title {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--shinha-navy);
  margin: 0 0 10px;
  line-height: 1.25;
}

.template-gallery__subtitle {
  font-size: 13px;
  line-height: 1.65;
  color: var(--shinha-muted);
  margin: 0;
}

.template-gallery__grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 28px 32px;
  width: 100%;
  max-width: 100%;
}

/* Template card */
.template-card {
  position: relative;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  background: var(--shinha-white);
  border: 1px solid var(--shinha-border);
  border-radius: 14px;
  padding: 12px;
  box-shadow: var(--shinha-card-shadow);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  display: flex;
  flex-direction: column;
}

.template-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 14px 32px rgba(6, 26, 64, 0.14);
  border-color: rgba(79, 125, 232, 0.45);
}

.template-card__order {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--shinha-navy);
  color: var(--shinha-white);
  font-size: 10px;
  font-weight: 800;
  padding: 3px 7px;
  border-radius: 6px;
  z-index: 2;
}

/*
  Shared gallery card preview frame (all templates).
  - Real previewImage: .template-card__preview + img
  - Placeholder mockup: .thumb-mockup inside .template-card__thumb
*/
.template-card__thumb {
  margin-bottom: 10px;
  border-radius: 14px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  /* Keep overflow visible so real-image shadow is not clipped (desktop) */
  overflow: visible;
  aspect-ratio: 4 / 4.2;
  background: transparent;
  border: none;
  box-sizing: border-box;
}

.template-card__preview {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #eef3f8 0%, #f8fbff 100%);
  border: 1px solid #dbe6f3;
  border-radius: 14px;
  padding: 14px;
  box-sizing: border-box;
}

.template-card__preview-img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: top center;
  background: #ffffff;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 6px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14);
  box-sizing: border-box;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.template-card:hover .template-card__preview-img {
  transform: translateY(-2px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.18);
}

/* Placeholder mockups share the same soft contrast frame */
.template-card__thumb > .thumb-mockup {
  width: 100%;
  height: 100%;
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, #eef3f8 0%, #f8fbff 100%);
  border: 1px solid #dbe6f3;
  box-sizing: border-box;
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
}

.template-card:hover .template-card__thumb > .thumb-mockup {
  border-color: #c9d8ea;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.template-card__name {
  font-size: 14px;
  font-weight: 800;
  color: var(--shinha-navy);
  margin: 0 0 5px;
  line-height: 1.35;
}

.template-card__desc {
  font-size: 12px;
  color: var(--shinha-muted);
  margin: 0 0 8px;
  flex: 1;
  line-height: 1.5;
}

.template-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 10px;
}

.template-card__tag {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--shinha-light-blue);
  color: var(--shinha-blue);
}

.template-card__actions {
  display: flex;
  gap: 6px;
}

.template-card__actions .home-btn {
  flex: 1;
  padding: 7px 10px;
  font-size: 12px;
  min-height: 36px;
  border-width: 1.5px;
}

/* ── Thumbnail mockups ── */
.thumb-mockup {
  width: 100%;
  height: 100%;
  padding: 10px 8px 8px;
  box-sizing: border-box;
}

.thumb-mockup__inner {
  width: 100%;
  height: 100%;
  border-radius: 6px;
  overflow: hidden;
}

/* professional */
.thumb-mockup--professional .thumb-mockup__inner {
  background: #fff;
  border: 1px solid #D8E4F5;
  box-shadow: inset 4px 0 0 #061A40;
}
.thumb-mockup--professional .thumb-mockup__inner::before {
  content: "";
  display: block;
  height: 14px;
  background: #061A40;
  margin-bottom: 8px;
}
.thumb-mockup--professional .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 0 8px;
  height: 60%;
  background: linear-gradient(#EAF3FF 30%, #fff 30%);
  border: 1px solid #D8E4F5;
}

/* simple */
.thumb-mockup--simple .thumb-mockup__inner {
  background: #fff;
  border: 1px solid #E8ECF2;
}
.thumb-mockup--simple .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 12px 10px 6px;
  height: 6px;
  background: #333;
  width: 50%;
}
.thumb-mockup--simple .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 4px 10px;
  height: 3px;
  background: #ddd;
  box-shadow: 0 8px 0 #ddd, 0 16px 0 #ddd, 0 24px 0 #ddd;
}

/* detailed */
.thumb-mockup--detailed .thumb-mockup__inner {
  background: #fafbfc;
  border: 1px solid #D8E4F5;
  padding: 6px;
}
.thumb-mockup--detailed .thumb-mockup__inner::before {
  content: "";
  display: block;
  height: 100%;
  background: repeating-linear-gradient(
    #EAF3FF 0px, #EAF3FF 12px,
    #fff 12px, #fff 14px,
    #f0f4f8 14px, #f0f4f8 26px,
    #fff 26px, #fff 28px
  );
}

/* bright */
.thumb-mockup--bright .thumb-mockup__inner {
  background: linear-gradient(160deg, #FFF3E0, #FFE0B2);
  border-radius: 8px;
}
.thumb-mockup--bright .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 10px;
  height: 10px;
  background: #E85D04;
  border-radius: 4px;
}
.thumb-mockup--bright .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 6px 10px;
  height: 40%;
  background: #fff;
  border-radius: 6px;
  border: 2px solid #FFB74D;
}

/* premium */
.thumb-mockup--premium .thumb-mockup__inner {
  background: linear-gradient(180deg, #1a1a2e, #061A40);
}
.thumb-mockup--premium .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 14px auto 8px;
  width: 40%;
  height: 4px;
  background: var(--shinha-gold);
}
.thumb-mockup--premium .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 0 12px;
  height: 50%;
  border: 1px solid rgba(246, 198, 107, 0.4);
  border-radius: 4px;
}

/* salary-highlight */
.thumb-mockup--salary-highlight .thumb-mockup__inner {
  background: #fff;
  border: 1px solid #ffcdd2;
}
.thumb-mockup--salary-highlight .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 10px;
  height: 22px;
  background: #d00000;
  border-radius: 4px;
}
.thumb-mockup--salary-highlight .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 6px 10px;
  height: 8px;
  background: #ff8a80;
  border-radius: 2px;
  box-shadow: 0 12px 0 #ffe0b2, 0 22px 0 #eee;
}

/* japanese-minimal */
.thumb-mockup--japanese-minimal .thumb-mockup__inner {
  background: #fff;
  border: 1px solid #e0e0e0;
}
.thumb-mockup--japanese-minimal .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 20px 16px 0;
  height: 1px;
  background: #bbb;
  box-shadow: 0 20px 0 #bbb, 0 40px 0 #bbb, 0 60px 0 #ddd;
}

/* social-square */
.thumb-mockup--social-square .thumb-mockup__inner {
  background: linear-gradient(135deg, #6a0dad, #9b59b6);
  aspect-ratio: 1;
  margin: auto;
  width: 85%;
  border-radius: 8px;
}
.thumb-mockup--social-square .thumb-mockup__inner::before {
  content: "HOT";
  display: block;
  color: #fff;
  font-size: 10px;
  font-weight: 900;
  padding: 12px 10px 0;
  letter-spacing: 1px;
}
.thumb-mockup--social-square .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 8px 10px;
  height: 12px;
  background: #F6C66B;
  border-radius: 3px;
}

/* compact-a4 */
.thumb-mockup--compact-a4 .thumb-mockup__inner {
  background: #fff;
  border: 1px solid #ccc;
  width: 70%;
  margin: 0 auto;
  min-height: 90%;
}
.thumb-mockup--compact-a4 .thumb-mockup__inner::before {
  content: "";
  display: block;
  margin: 6px;
  height: 4px;
  background: #061A40;
}
.thumb-mockup--compact-a4 .thumb-mockup__inner::after {
  content: "";
  display: block;
  margin: 4px 6px;
  height: 2px;
  background: #ddd;
  box-shadow: 0 5px 0 #ddd, 0 10px 0 #ddd, 0 15px 0 #ddd, 0 20px 0 #ddd, 0 25px 0 #ddd, 0 30px 0 #ddd;
}

/* info-card */
.thumb-mockup--info-card .thumb-mockup__inner {
  background: var(--shinha-light-blue);
  border-radius: 10px;
  border: 1px solid var(--shinha-border);
  display: flex;
  align-items: center;
  padding: 8px;
  gap: 8px;
}
.thumb-mockup--info-card .thumb-mockup__inner::before {
  content: "";
  width: 28px;
  height: 28px;
  background: var(--shinha-accent);
  border-radius: 50%;
  flex-shrink: 0;
}
.thumb-mockup--info-card .thumb-mockup__inner::after {
  content: "";
  flex: 1;
  height: 36px;
  background: #fff;
  border-radius: 6px;
  box-shadow: inset 0 0 0 1px #D8E4F5;
}

/* ── Custom Design CTA ── */
.custom-design-section {
  padding: 0 0 64px;
}

.custom-design-section__inner {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 40px 44px;
  background: linear-gradient(135deg, var(--shinha-soft-blue) 0%, var(--shinha-light-blue) 100%);
  border: 1px solid var(--shinha-border);
  border-radius: 26px;
}

.custom-design-section__mascot {
  flex-shrink: 0;
  width: 144px;
}

.custom-design-section__mascot img,
.custom-design-section__mascot svg {
  width: 100%;
  height: auto;
}

.custom-design-section__content {
  flex: 1;
}

.custom-design-section__title {
  font-size: 26px;
  font-weight: 800;
  color: var(--shinha-navy);
  margin: 0 0 8px;
}

.custom-design-section__desc {
  font-size: 15px;
  color: var(--shinha-muted);
  margin: 0 0 18px;
}

.custom-design-section__list {
  list-style: none;
  padding: 0;
  margin: 0 0 22px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 20px;
}

.custom-design-section__list li {
  font-size: 14px;
  color: var(--shinha-text);
  padding-left: 24px;
  position: relative;
}

.custom-design-section__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--shinha-success);
  font-weight: 800;
}

/* ── Footer ── */
.home-footer {
  background: linear-gradient(135deg, #061A40, #082B66);
  color: var(--shinha-white);
  padding: 56px 0 28px;
}

.home-footer a {
  color: rgba(255, 255, 255, 0.85);
  text-decoration: none;
  font-size: 14px;
}

.home-footer a:hover {
  color: var(--shinha-white);
  text-decoration: underline;
}

.home-footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 40px;
}

/*
  Footer logo PNG canvas 1536×1024 with large transparent padding.
  Opaque content (alpha>8): 402×417 at y=265..681
  → content_h/canvas_h ≈ 0.4072; top pad ≈ 0.2588; bottom pad ≈ 0.3340
  CSS height targets visual diamond/text, not the empty canvas.
*/
.home-footer__brand img {
  display: block;
  height: 196px; /* ~80px visible content: 196 * 0.4072 */
  width: auto;
  max-height: none;
  object-fit: contain;
  margin-top: calc(-0.2588 * 196px);
  margin-bottom: calc(12px - 0.3340 * 196px);
}

@media (max-width: 767px) {
  .home-footer__brand img {
    height: 152px; /* ~62px visible content: 152 * 0.4072 */
    width: auto;
    max-height: none;
    object-fit: contain;
    margin-top: calc(-0.2588 * 152px);
    margin-bottom: calc(10px - 0.3340 * 152px);
    margin-inline: auto;
  }
}

.home-footer__brand p {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin: 0;
  line-height: 1.6;
}

.home-footer__col h4 {
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 14px;
  color: var(--shinha-white);
}

.home-footer__col ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.home-footer__col li {
  margin-bottom: 8px;
}

.home-footer__contact li {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.8);
}

.home-footer__social {
  display: flex;
  gap: 12px;
  margin-top: 14px;
}

.home-footer__social a {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
}

.home-footer__bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.15);
  padding-top: 20px;
  text-align: center;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.home-anchor {
  height: 0;
  overflow: hidden;
}

/* ── Animations ── */
@keyframes mascotFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

@keyframes floatingCard {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

@media (prefers-reduced-motion: reduce) {
  .home-page *,
  .home-page *::before,
  .home-page *::after {
    animation: none !important;
    transition: none !important;
  }
}

/* ── Template Preview Modal ── */
body.modal-open {
  overflow: hidden;
}

.preview-modal {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.preview-modal[hidden] {
  display: none !important;
}

.preview-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 26, 64, 0.55);
  cursor: pointer;
}

.preview-modal__dialog {
  position: relative;
  width: 100%;
  max-width: 900px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(6, 26, 64, 0.25);
  padding: 28px 32px 24px;
  -webkit-overflow-scrolling: touch;
}

.preview-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: #f0f4fa;
  color: #061A40;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.preview-modal__close:hover {
  background: #e2eaf5;
}

.preview-modal__header {
  padding-right: 44px;
  margin-bottom: 20px;
}

.preview-modal__order {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: var(--shinha-blue, #0B4DBA);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}

.preview-modal__title {
  font-size: 24px;
  font-weight: 800;
  color: var(--shinha-navy, #061A40);
  margin: 0 0 8px;
  line-height: 1.3;
}

.preview-modal__desc {
  font-size: 15px;
  color: #5a6270;
  margin: 0 0 12px;
  line-height: 1.5;
}

.preview-modal__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.preview-modal__mockup-wrap {
  margin-bottom: 20px;
}

.preview-modal__zoom-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.preview-modal__zoom-label {
  min-width: 48px;
  text-align: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--shinha-navy, #061A40);
}

/* Live Preview temporary palette selector (modal only; no storage) */
.gallery-preview-palette-control {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 0 0 12px;
  min-width: 0;
}

.gallery-preview-palette-control[hidden] {
  display: none !important;
}

.gallery-preview-palette-label {
  flex: 0 0 auto;
  font-size: 13px;
  font-weight: 700;
  color: var(--shinha-navy, #061A40);
  white-space: nowrap;
}

.gallery-preview-palette-scroller {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
}

.gallery-preview-palette-list {
  display: flex;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 2px 0 6px;
  scrollbar-width: thin;
}

.gallery-preview-palette-fade,
.gallery-preview-palette-hint {
  display: none;
}

.gallery-preview-palette-option {
  position: relative;
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  flex: 0 0 auto;
  min-width: 96px;
  max-width: 148px;
  padding: 8px 10px;
  border: 1.5px solid #cfd8e3;
  border-radius: 10px;
  background: #ffffff;
  color: #0f172a;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.gallery-preview-palette-option:hover:not(:disabled) {
  border-color: #94a3b8;
}

.gallery-preview-palette-option:focus-visible {
  outline: 2px solid #0b3b75;
  outline-offset: 2px;
}

.gallery-preview-palette-option.is-active {
  border-color: #0b3b75;
  box-shadow: 0 0 0 1px #0b3b75;
  background: #f4f8fc;
}

.gallery-preview-palette-option:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.gallery-preview-palette-option .palette-swatches {
  display: flex;
  gap: 3px;
  align-items: center;
}

.gallery-preview-palette-option .palette-swatch {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.18);
  flex: 0 0 auto;
}

.gallery-preview-palette-option.is-primary-color .palette-swatches--primary .palette-swatch,
.gallery-preview-palette-option .palette-swatches--primary .palette-swatch {
  width: 18px;
  height: 18px;
}

.gallery-preview-palette-option .palette-name {
  font-size: 11px;
  font-weight: 650;
  line-height: 1.25;
  max-width: 128px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.gallery-preview-palette-option .palette-check {
  position: absolute;
  top: 5px;
  right: 6px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0b3b75;
  color: #fff;
  font-size: 9px;
  line-height: 14px;
  text-align: center;
  font-weight: 800;
  opacity: 0;
  pointer-events: none;
}

.gallery-preview-palette-option.is-active .palette-check {
  opacity: 1;
}

@media (max-width: 640px) {
  .gallery-preview-palette-control {
    flex-direction: column;
    align-items: stretch;
    flex-wrap: nowrap;
    gap: 6px;
    margin-bottom: 8px;
  }

  .gallery-preview-palette-scroller {
    width: 100%;
  }

  .gallery-preview-palette-list {
    display: flex;
    flex-wrap: nowrap;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    padding: 2px 18px 2px 2px;
    scrollbar-width: none;
    -ms-overflow-style: none;
  }

  .gallery-preview-palette-list::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  .gallery-preview-palette-option {
    flex-direction: row;
    align-items: center;
    gap: 8px;
    height: 44px;
    min-height: 44px;
    max-height: 44px;
    min-width: 0;
    max-width: none;
    padding: 0 14px;
    box-sizing: border-box;
  }

  .gallery-preview-palette-option .palette-name {
    max-width: 96px;
  }

  .gallery-preview-palette-option .palette-check {
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
  }

  .gallery-preview-palette-fade {
    display: block;
    position: absolute;
    top: 0;
    bottom: 0;
    width: 36px;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .gallery-preview-palette-fade--left {
    left: 0;
    background: linear-gradient(to right, #ffffff 35%, rgba(255, 255, 255, 0));
  }

  .gallery-preview-palette-fade--right {
    right: 0;
    background: linear-gradient(to left, #ffffff 35%, rgba(255, 255, 255, 0));
  }

  .gallery-preview-palette-hint {
    display: block;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    line-height: 18px;
    text-align: center;
    font-size: 20px;
    font-weight: 800;
    color: #0b3b75;
    text-shadow: 0 0 4px #ffffff, 0 0 2px #ffffff;
    pointer-events: none;
    z-index: 2;
    opacity: 0;
    transition: opacity 0.15s ease;
  }

  .gallery-preview-palette-hint--left {
    left: 0;
  }

  .gallery-preview-palette-hint--right {
    right: 0;
  }

  .gallery-preview-palette-scroller.is-overflow-left .gallery-preview-palette-fade--left,
  .gallery-preview-palette-scroller.is-overflow-left .gallery-preview-palette-hint--left {
    opacity: 1;
  }

  .gallery-preview-palette-scroller.is-overflow-right .gallery-preview-palette-fade--right,
  .gallery-preview-palette-scroller.is-overflow-right .gallery-preview-palette-hint--right {
    opacity: 1;
  }
}

.preview-modal__mockup {
  background: #eef3f8;
  border: 1px solid #d9e3ef;
  border-radius: 14px;
  padding: 16px;
  min-height: 360px;
  display: block;
  overflow: hidden;
}

.preview-modal__stage {
  width: 100%;
  height: min(62vh, 640px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  touch-action: none;
  cursor: grab;
  position: relative;
  /* Contrast behind PNG white page margin so export frame is visible */
  background: #eef3f8;
  border: 1px solid #d9e3ef;
  border-radius: 10px;
  padding: 0;
  box-sizing: border-box;
}

.preview-modal__stage.is-panning {
  cursor: grabbing;
}

.preview-modal__scale-box {
  position: relative;
  display: block;
  box-sizing: border-box;
  /* width/height set by JS after zoom */
}

.preview-modal__image {
  display: block;
  width: auto;
  height: auto;
  max-width: none;
  max-height: none;
  object-fit: contain;
  background: #ffffff;
  border: 1px solid #cfd8e3;
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
  transform-origin: top left;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.preview-modal__stage--live {
  /* Live HTML iframe preview — pan via stage scroll */
}

.preview-modal__scale-box--live {
  position: relative;
  overflow: hidden;
  background: #eef3f8;
  border: 1px solid #d9e3ef;
  border-radius: 6px;
  /* width/height = natural × scale (set by JS). Canvas inside stays natural size. */
}

/* Receipt modal only: transform on iframe; scale-box is visual spacer (no scale on box) */
#receipt-preview-modal .preview-modal__scale-box--live {
  transform: none;
  flex-shrink: 0;
}

/* Receipt A5 modal: logical scale layer = iframe CB; scale-box = visual spacer only */
#receipt-preview-modal[data-receipt-template="receipt-a5"] .preview-modal__frame-scale--a5 {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px;
  min-width: 794px;
  max-width: none;
  height: 559px;
  transform-origin: top left;
  transform: none;
}

#receipt-preview-modal[data-receipt-template="receipt-a5"] .gallery-live-preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  width: 794px !important;
  min-width: 794px !important;
  max-width: none !important;
  height: 559px !important;
  transform: none !important;
  transform-origin: top left;
  border: 0;
}

.gallery-live-preview-frame {
  position: absolute;
  top: 0;
  left: 0;
  display: block;
  /* Initial hint only — JS sets exact logical W×H per template (A4 / square / …) */
  width: 794px;
  height: 1123px;
  max-width: none;
  min-width: 0;
  border: 0;
  background: #eef3f8;
  transform-origin: top left;
  /* Single scale mechanism: transform on iframe; never shrink layout width */
}

.preview-modal__empty {
  margin: 12px 0 0;
  font-size: 13px;
  color: #5a6270;
  text-align: center;
}

.preview-modal__mockup .thumb-mockup--modal {
  width: 100%;
  max-width: 420px;
  height: 280px;
  padding: 16px;
}

.preview-modal__note {
  font-size: 13px;
  color: #5a6270;
  text-align: center;
  margin: 14px 0 0;
  line-height: 1.4;
}

.preview-modal__actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid #eef0f4;
}

.preview-modal__actions .home-btn {
  min-width: 140px;
  text-align: center;
}

@media (max-width: 767px) {
  .template-gallery__grid {
    grid-template-columns: 1fr;
    width: 100%;
    max-width: 100%;
  }

  .template-card {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .template-card__thumb,
  .template-card__preview {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow: hidden;
  }

  .template-card__preview {
    padding: 10px;
  }

  .template-card__preview-img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    object-fit: contain;
  }

  .preview-modal {
    padding: 0;
    align-items: stretch;
  }

  .preview-modal__dialog {
    max-width: none;
    max-height: none;
    min-height: 100vh;
    min-height: 100dvh;
    border-radius: 0;
    padding: 20px 16px 24px;
  }

  .preview-modal__mockup {
    min-height: 280px;
    padding: 10px;
  }

  .preview-modal__stage {
    height: min(55vh, 480px);
  }

  .preview-modal__mockup .thumb-mockup--modal {
    max-width: 100%;
    height: 220px;
  }

  .preview-modal__actions {
    flex-direction: column;
  }

  .preview-modal__actions .home-btn {
    width: 100%;
    min-width: 0;
  }
}

/* Receipt tool intro card (home only — separate from recruitment gallery) */
.receipt-tool-intro {
  padding: 8px 0 48px;
  background: var(--home-bg, #f5f7fb);
}

.receipt-tool-intro__card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px 32px;
  background: #fff;
  border: 1px solid #d6dee8;
  border-radius: 14px;
}

.receipt-tool-intro__title {
  margin: 0 0 8px;
  font-family: var(--home-display, "Be Vietnam Pro", sans-serif);
  font-size: 22px;
  font-weight: 800;
  color: #0b4dba;
}

.receipt-tool-intro__desc {
  margin: 0 0 16px;
  max-width: 52ch;
  font-size: 15px;
  line-height: 1.5;
  color: #5d6b82;
}

.receipt-tool-intro__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

@media (max-width: 640px) {
  .receipt-tool-intro {
    padding: 0 0 32px;
  }

  .receipt-tool-intro__card {
    padding: 20px 18px;
  }

  .receipt-tool-intro__actions .home-btn {
    width: 100%;
  }
}

/* Receipt gallery (2 cards) — reuses .template-card; does not alter 5-col recruitment grid */
.receipt-gallery {
  padding: 8px 0 56px;
  background: var(--home-bg, #f5f7fb);
}

.receipt-gallery__grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 720px;
  margin-inline: auto;
}

.receipt-template-card .template-card__thumb {
  aspect-ratio: 3 / 4.2;
}

/* A5 home card: full receipt visible, logo not cropped */
.receipt-template-card[data-receipt-template-id="receipt-a5"] .template-card__preview-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

@media (max-width: 720px) {
  .receipt-gallery__grid {
    grid-template-columns: 1fr;
    max-width: 420px;
  }
}
