/* ══════════════════════════════════════════════════════════════════
   CHẾ ĐỘ SOẠN THIỆP — chỉ nạp ở trang /tao
   Cô dâu chú rể sửa THẲNG trên bản thiệp thật, không qua biểu mẫu riêng.
   Mọi thứ ở đây chỉ được TỰ THÊM VÀO, không đè lên giao diện thiệp — để
   bản khách mời nhìn thấy y hệt bản đang soạn.
   ══════════════════════════════════════════════════════════════════ */

:root {
  --sua-vien: #b08d4e;
  --sua-nen: rgba(191, 159, 98, .1);
}

/* Chừa chỗ cho dải hướng dẫn trên và thanh công cụ dưới */
body.dang-soan { padding-top: 46px; padding-bottom: 78px; }

/* ── Ô chữ sửa được ────────────────────────────────────────────── */
[data-sua] {
  outline: 1px dashed rgba(176, 141, 78, .5);
  outline-offset: 3px;
  border-radius: 2px;
  cursor: text;
  transition: background .18s ease, outline-color .18s ease;
  min-width: 2.5em;
  display: inline-block;
}
p[data-sua] { display: block; }

[data-sua]:hover { background: var(--sua-nen); outline-color: var(--sua-vien); }
[data-sua]:focus {
  outline: 2px solid var(--sua-vien);
  background: #fff;
  cursor: text;
}

/* Ô rỗng thì hiện gợi ý mờ — không có nó, cô dâu xoá hết chữ là mất luôn
   chỗ bấm, không biết ô đó ở đâu mà điền lại. */
[data-sua]:empty::before {
  content: attr(data-goi-y);
  color: #b3a795;
  font-style: italic;
}
[data-sua]:empty { min-height: 1.4em; }

/* ── Nút chip nhỏ gắn ngay cạnh khối ───────────────────────────── */
.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 13px;
  margin: 4px 3px;
  border: 1px solid var(--sua-vien);
  background: #fffdf9;
  color: #6b5430;
  font-family: var(--chu-than);
  font-size: 12.5px;
  line-height: 1.2;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .18s ease, color .18s ease;
}
.chip:hover { background: var(--sua-vien); color: #fff; }
.chip:active { transform: scale(.96); }

.chip-hang { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px; margin-bottom: 8px; }
.chip-them { display: block; margin: 16px auto 0; }
.chip-xoa { border-color: #c9a2a2; color: #8d332c; }
.chip-xoa:hover { background: #b4453c; border-color: #b4453c; }

.lich-trinh li .chip-xoa { padding: 4px 9px; margin: 0 0 0 8px; }

.o-anh { position: relative; }
.chip-goc {
  position: absolute;
  top: 5px;
  right: 5px;
  margin: 0;
  padding: 5px 9px;
  background: rgba(255, 253, 249, .93);
}

.anh-trong {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 150px;
  padding: 20px;
  background: repeating-linear-gradient(45deg, #f3ece0, #f3ece0 10px, #efe7d9 10px, #efe7d9 20px);
  color: #9d9081;
  font-size: 13px;
  font-style: italic;
  text-align: center;
}
.the-nhan .anh { min-height: 150px; }

/* ── Dải hướng dẫn trên cùng ───────────────────────────────────── */
#dai-huong-dan {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 70;
  padding: 12px 16px;
  background: #2b241d;
  color: #f8f4ed;
  font-size: 13px;
  text-align: center;
  line-height: 1.5;
}
#dai-huong-dan b { color: #d9c49a; font-weight: 500; }

/* ── Thanh công cụ dưới ────────────────────────────────────────── */
#thanh-soan {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex;
  gap: 8px;
  padding: 11px 14px calc(11px + env(safe-area-inset-bottom));
  background: rgba(248, 244, 237, .97);
  border-top: 1px solid #e6dbc8;
  backdrop-filter: blur(6px);
}
#thanh-soan button {
  flex: 1;
  padding: 14px 10px;
  border: 1px solid #2b241d;
  background: transparent;
  color: #2b241d;
  font-family: var(--chu-than);
  font-size: 12.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border-radius: 2px;
  cursor: pointer;
}
#nut-xuat {
  background: #2b241d !important;
  color: #f8f4ed !important;
  flex: 1.6 !important;
}
#nut-xuat:disabled { opacity: .6; cursor: progress; }

/* ── Hộp kết quả ───────────────────────────────────────────────── */
#lop-phu {
  position: fixed;
  inset: 0;
  z-index: 96;
  background: rgba(24, 19, 14, .72);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#lop-phu.mo { display: flex; }

.hop {
  width: min(94vw, 460px);
  max-height: 88vh;
  overflow-y: auto;
  background: #fffdf9;
  border: 1px solid #e6dbc8;
  padding: 28px 24px;
  text-align: center;
}
.hop h3 {
  font-family: var(--chu-ten);
  font-weight: 500;
  font-size: 19px;
  letter-spacing: .18em;
  text-transform: uppercase;
  margin: 0 0 6px;
  padding-left: .18em;
}
.hop .phu { color: #6f6357; font-size: 14px; margin: 0 0 18px; }

.o-link {
  display: flex;
  align-items: stretch;
  gap: 0;
  margin: 10px 0 4px;
  border: 1px solid #e6dbc8;
  background: #f8f4ed;
}
.o-link input {
  flex: 1;
  min-width: 0;
  padding: 12px;
  border: 0;
  background: transparent;
  font-family: var(--chu-than);
  font-size: 13.5px;
  color: #2b241d;
}
.o-link button {
  padding: 12px 15px;
  border: 0;
  border-left: 1px solid #e6dbc8;
  background: #2b241d;
  color: #f8f4ed;
  font-family: var(--chu-than);
  font-size: 12px;
  letter-spacing: .1em;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}
.nhan-link {
  display: block;
  text-align: left;
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6f6357;
  margin-top: 16px;
  padding-left: .16em;
}
.canh-bao {
  text-align: left;
  font-size: 12.5px;
  color: #8d6a2c;
  background: #fbf4e6;
  border-left: 3px solid #bf9f62;
  padding: 10px 12px;
  margin-top: 8px;
  line-height: 1.6;
}
.hop .dong-hop {
  margin-top: 20px;
  width: 100%;
  padding: 13px;
  border: 1px solid #2b241d;
  background: transparent;
  color: #2b241d;
  font-family: var(--chu-than);
  font-size: 12.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  cursor: pointer;
}

/* ── Hộp chọn ngày giờ ─────────────────────────────────────────── */
.hang-nhap { display: grid; gap: 12px; text-align: left; margin-bottom: 4px; }
.hang-nhap label {
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #6f6357;
  display: block;
  margin-bottom: 5px;
  padding-left: .16em;
}
.hang-nhap input {
  width: 100%;
  padding: 12px;
  border: 1px solid #e6dbc8;
  background: #f8f4ed;
  font-family: var(--chu-than);
  font-size: 15px;
  color: #2b241d;
}

#bao-soan {
  position: fixed;
  left: 50%;
  bottom: 92px;
  transform: translateX(-50%) translateY(14px);
  z-index: 75;
  padding: 11px 20px;
  background: #2b241d;
  color: #f8f4ed;
  font-size: 13px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease, transform .28s ease;
  max-width: 90vw;
  text-align: center;
}
#bao-soan.hien { opacity: 1; transform: translateX(-50%) translateY(0); }

@media (max-width: 400px) {
  #thanh-soan button { font-size: 11px; letter-spacing: .06em; padding: 13px 6px; }
  #dai-huong-dan { font-size: 12px; padding: 10px 12px; }
}
