  :root{ --font-vi: "Be Vietnam Pro", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif; }
  body, button, input, textarea { font-family: var(--font-vi); }
:root{
  --bg1:#19c37d;
  --bg2:#0e8aa5;
  --card:#ffffff;
  --green:#0aa35b;
  --welcome-h: 62px;
  --page-pad: 18px;
  --page-bottom-gap: 15px; /* ✅ khoảng hở đáy bạn muốn */
}

*{ box-sizing:border-box; }
html, body{ min-height:100%; }

body{
  margin:0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: radial-gradient(1200px 700px at 20% 10%, #a8f3d3 0%, transparent 60%),
              linear-gradient(135deg, var(--bg1), var(--bg2));
  min-height:100vh;
  overflow-x:hidden;
  display:flex;
  flex-direction:column;
}

/* ===== Layout: vừa màn hình, panel trái gọn & cuộn nội dung ===== */
/* ✅ PAGE */
.page{
  display:grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap:18px;
  align-items:stretch;

  padding: var(--page-pad);
  padding-bottom: calc(var(--page-pad) + var(--page-bottom-gap));

  /* ✅ QUAN TRỌNG: trừ cả padding-bottom để không bị hụt */
  height: calc(100vh - var(--welcome-h) - (var(--page-pad) + var(--page-bottom-gap)));
  max-height: calc(100vh - var(--welcome-h) - (var(--page-pad) + var(--page-bottom-gap)));
  flex:1 1 auto;
}

.left{
  background:rgba(255,255,255,.92);
  border:1px solid rgba(255,255,255,.76);
  border-radius:10px;
  padding:14px;
  box-shadow:0 18px 44px rgba(15,23,42,.16);
padding-bottom: 14px;
  height:100%;
  overflow:auto;          /* nếu form dài -> cuộn trong panel */
  -webkit-overflow-scrolling: touch;
}

.h1{
  margin:2px 0 10px;
  font-size:22px;
  font-weight:800;
  color:#0b2b28;
}

.btn{
  width:100%;
  display:block;
  padding:10px 12px;
  background:linear-gradient(180deg, #2460d7, #2d69d1);
  border-radius:10px;
  color:#fff;
  font-weight:800;
  text-align:center;
  cursor:pointer;
  margin-bottom:10px;
}

.btn2{
  width:100%;
  padding:10px 12px;
  border:none;
  border-radius:10px;
  background:#da2d1e;
  color:#fff;
  font-size: 15px;
  font-weight:800;
  cursor:pointer;
  margin-top:10px;
}

.share-action{
  display:flex;
  justify-content:center;
  margin-top:7px;
}
.share-action[hidden]{ display:none; }

.btn-share{
  position:relative;
  isolation:isolate;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  min-width:66px;
  min-height:24px;
  padding:5px 10px;
  border:0;
  border-radius:999px;
  color:#fff;
  background:
    linear-gradient(180deg, #31c47b 0%, #12925a 100%);
  box-shadow:
    0 3px 0 rgba(4,88,51,.72),
    0 8px 14px rgba(4,88,51,.18),
    inset 0 1px 0 rgba(255,255,255,.34);
  font:800 11px var(--font-vi);
  letter-spacing:0;
  cursor:pointer;
  transform:translateY(0);
  transition:transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.btn-share::after{
  content:"";
  position:absolute;
  inset:2px 6px auto;
  height:38%;
  border-radius:999px;
  background:linear-gradient(180deg, rgba(255,255,255,.26), rgba(255,255,255,0));
  z-index:-1;
}

.btn-share:hover{
  filter:saturate(1.04) brightness(1.02);
  transform:translateY(-1px);
  box-shadow:
    0 4px 0 rgba(4,88,51,.68),
    0 9px 16px rgba(4,88,51,.20),
    inset 0 1px 0 rgba(255,255,255,.34);
}

.btn-share:active{
  transform:translateY(3px);
  box-shadow:
    0 1px 0 rgba(4,88,51,.70),
    0 5px 10px rgba(4,88,51,.15),
    inset 0 1px 0 rgba(255,255,255,.28);
}

.btn-share:disabled,
.btn-share.is-disabled{
  opacity:.62;
  cursor:not-allowed;
  filter:grayscale(.12);
}

.btn-share.is-busy{
  cursor:wait;
}

.btn-share-icon{
  display:inline-grid;
  place-items:center;
  width:14px;
  height:14px;
  border-radius:999px;
  background:rgba(255,255,255,.16);
  box-shadow:inset 0 1px 0 rgba(255,255,255,.20);
  font-size:9px;
  font-weight:900;
}

.field{
  position:relative;
  margin:8px 0 12px;
}

.lbl{
  display:inline-block;
  background:#0b8f51;
  color:#fff;
  padding:6px 10px;
  border-radius:10px;
  font-weight:800;
  margin-bottom:6px;
  font-size:13px;
}

input, textarea{
  width:100%;
  border:1px solid rgba(0,0,0,.15);
  border-radius:10px;
  padding:10px 12px;
  outline:none;
  font-size:14px;
  background:#fff;
}

textarea{
  resize:vertical;
  min-height:120px; /* gọn hơn */
}

.count{
  position:absolute;
  right:10px;
  bottom:-18px;
  font-size:12px;
  opacity:.7;
}

/* ===== Preview fit-height, không tràn ===== */
.right{
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  min-width:0;
}

.preview-wrap{
  width:100%;
  height:100%;
  max-height:none;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:0;
}
.preview-wrap{
  transform: scale(0.90);
  transform-origin: center center;
}
#cv{
  border-radius:10px;
  box-shadow:0 18px 60px rgba(0,0,0,.28);
  background:transparent;
  max-width:100%;
  max-height:100%;
}

.hint{
  margin-top:10px;
  font-size:12px;
  opacity:.8;
}

/* ===== Responsive ===== */
@media (max-width: 980px){
  .page{
    grid-template-columns: 1fr;
    height:auto;
    max-height:none;
    min-height:100vh;
  }
  .left{
    height:auto;
    overflow:visible;
  }
  .preview-wrap{
    height:58vh;       /* giữ preview vừa màn hình mobile */
    padding:10px 0 18px;
  }
  .welcome-bar{
    height:auto;
    min-height:var(--welcome-h);
    padding-top:42px;
  }
  .welcome-text{
    font-size: min(28px, 100%) !important;
    overflow-wrap:anywhere;
  }
}

@media (max-height: 760px){
  .left{ overflow:auto; }
}

.left-col-title{
  display: flex;
  justify-content: center;   /* căn giữa ngang */
  text-align: center;        /* chữ căn giữa */
  margin-bottom: 8px;
}

.left-col-title .h1{
  margin: 0;
}

.quick-link{
  position: fixed;
  top: 25px;
  z-index: 9999;
  text-decoration: none;
  font-weight: 600;
  line-height: 1;
  user-select: none;
  -webkit-user-select: none;
}

/* Gallery (trái) */
.quick-gallery{
  left: 25px;              /* chỉnh theo layout của bạn nếu bị đè */
  font-size: 16px;
  color: #1b199c;           /* xanh tím giống ảnh */
  background: transparent;
  padding: 0;
}

/* Admin (phải) */
.quick-admin{
  right: 20px;
  font-size: 18px;
  color: #e11d48;           /* đỏ giống ảnh */
  background: transparent;
  padding: 0;
}

/* Hover */
.quick-link:hover{ opacity: .85; }

/* Mobile: kéo Gallery về sát trái nếu cần */
@media (max-width: 900px){
  .quick-gallery{ left: 18px; }
}

.welcome-bar{
  height: var(--welcome-h);
  display:flex;
  align-items:center;
  justify-content:center;

  padding: 30px 16px 8px;   /* ✅ tạo khoảng thở trên/dưới */
  margin-bottom: 8px;
}

.welcome-text{
  text-align:center;
  font-weight: 800;

  line-height: clamp(1.25, 1.1 + 0.2vw, 1.35);
  letter-spacing: .3px;

  text-shadow: 0 2px 10px rgba(0,0,0,.18);
  max-width: 1200px;

  /* ✅ tránh dính mép khi có 2 dòng */
  padding-top: 2px;
}

#download.is-disabled{
  opacity: .65;
  cursor: not-allowed;
}

.site-footer{
  text-align:center;
  color:rgba(255,255,255,.88);
  font-weight:700;
  font-size:12px;
  padding:0 16px 12px;
  text-shadow:0 2px 10px rgba(0,0,0,.2);
}
