:root {
  --bg: #FDFBF7;
  --card: #FFF4D6;
  --card-alt: #FFF9E8;
  --y: #F5B82E;
  --y-dark: #E09E00;
  --o: #E8892B;
  --ink: #1C1A16;
  --mut: #7A6F5A;
  --line: #EFE3C3;
  --line-strong: #ECDCAE;
}

html {
  box-sizing: border-box;
  overflow-x: hidden;
  width: 100%;
  -webkit-text-size-adjust: 100%;
}

*, *:before, *:after {
  box-sizing: inherit;
  margin: 0;
  padding: 0;
}

[hidden] { display: none !important; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  padding: 0 16px 60px;
  max-width: 1160px;
  margin-inline: auto;
  line-height: 1.5;
  overflow-x: hidden;
  width: 100%;
}

@media (min-width: 768px) {
  body {
    padding: 0 24px 60px;
    scrollbar-gutter: stable;
  }
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; border: 0; }

/* ==================== HEADER & TABS ==================== */
.header {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 16px 0 8px;
  position: relative;
  width: 100%;
}

.header-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  width: 100%;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: none;
}

.btn-admin-zalo {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  background: #0068FF;
  color: #fff;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(0, 104, 255, 0.28);
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
  flex: none;
}

.btn-admin-zalo:hover {
  background: #0056d6;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 104, 255, 0.4);
}

.btn-admin-zalo:active {
  transform: translateY(0);
}

.zalo-icon-badge {
  background: #fff;
  color: #0068FF;
  font-size: 11px;
  font-weight: 900;
  padding: 1.5px 6px;
  border-radius: 6px;
  letter-spacing: -0.2px;
  display: inline-block;
  line-height: 1.3;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  flex: none;
}

.brand b {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.brand small {
  color: var(--mut);
  font-size: 13px;
}

.logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--y);
  display: grid;
  place-items: center;
  font-size: 22px;
}

.corner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--y);
  display: grid;
  place-items: center;
  color: var(--ink);
  text-decoration: none;
  font-weight: 800;
  font-size: 20px;
  flex: none;
  transition: transform 0.15s ease;
}

.corner:hover {
  transform: scale(1.05);
}

/* ==================== TABS NAVIGATION ==================== */
.tabs {
  display: flex;
  gap: 8px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  width: 100%;
  padding: 4px 0;
}

.pill {
  padding: 10px 18px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  white-space: nowrap;
  font-weight: 700;
  font-size: 13.5px;
  color: var(--ink);
  transition: all 0.2s ease;
  user-select: none;
  text-align: center;
}

.pill:hover:not(.active) {
  background: #fdf5df;
}

.pill.active {
  background: var(--y);
  border-color: var(--y-dark);
  box-shadow: 0 2px 6px rgba(245, 184, 46, 0.35);
}

@media (max-width: 680px) {
  .tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 2px 0;
  }

  .pill {
    width: 100%;
    padding: 10px 8px;
    font-size: 12.5px;
    border-radius: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    white-space: normal;
    line-height: 1.25;
    min-height: 44px;
  }

  .hide-mobile {
    display: none;
  }
}

/* ==================== TAB PANES ==================== */
.tab-pane {
  display: none;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.22s ease-out, transform 0.22s ease-out;
}

.tab-pane.active {
  display: block;
  opacity: 1;
  transform: translateY(0);
}

/* ==================== HERO BANNER ==================== */
.hero {
  text-align: center;
  padding: 36px 16px 26px;
}

.badge {
  display: inline-block;
  background: var(--card);
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 700;
  border: 1px solid var(--line);
}

h1 {
  font-size: clamp(28px, 4.5vw, 48px);
  margin: 16px 0 10px;
  line-height: 1.15;
  font-weight: 900;
}

.hl {
  color: var(--o);
  text-decoration: underline;
  text-decoration-color: rgba(245, 184, 46, 0.6);
  text-decoration-thickness: 6px;
  text-underline-offset: 6px;
}

.hero p {
  color: var(--mut);
  font-size: 17px;
  margin: 0 auto 20px;
  max-width: 580px;
}

.cta {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.steps {
  list-style: none;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 12px;
  padding: 0;
  margin: 26px 0 0;
  flex-wrap: wrap;
}

.steps li {
  display: flex;
  gap: 8px;
  align-items: center;
  font-weight: 700;
  font-size: 14px;
}

.steps i {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--y);
  display: grid;
  place-items: center;
  font-style: normal;
  font-weight: 800;
  font-size: 12px;
}

.steps .sep {
  width: 36px;
  height: 2px;
  background: var(--line-strong);
}

/* ==================== 2-COLUMN MAIN LAYOUT ==================== */
.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 24px;
  align-items: start;
  width: 100%;
}

.card {
  background: var(--card);
  border-radius: 28px;
  padding: 24px;
  border: 1px solid var(--line);
  min-width: 0;
  box-sizing: border-box;
}

.right {
  position: sticky;
  top: 16px;
  min-width: 0;
}

.title-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 800;
}

.count {
  color: var(--mut);
  font-weight: 700;
  font-size: 14px;
}

.tag {
  background: #fff;
  border: 1px solid var(--line);
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: var(--mut);
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 800;
  text-decoration: none;
  color: var(--ink);
  text-align: center;
  transition: filter 0.15s ease, transform 0.1s ease;
}

.btn.primary {
  background: var(--y);
  box-shadow: 0 2px 0 var(--y-dark);
}

.btn.white {
  background: #fff;
  border: 1px solid var(--line);
}

.btn.sm {
  padding: 9px 16px;
  white-space: nowrap;
  font-size: 13px;
}

.btn.block {
  display: block;
  width: 100%;
  margin-top: 10px;
}

.btn.big {
  padding: 14px;
  font-size: 15.5px;
  margin-top: 14px;
}

.btn:hover:not(:disabled) {
  filter: brightness(0.97);
}

.btn:active:not(:disabled) {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-cancel {
  background: transparent;
  border: 1px solid var(--mut);
  color: var(--mut);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

/* Fields & Searches */
.search-row {
  display: flex;
  gap: 8px;
  margin: 14px 0 10px;
  align-items: center;
  width: 100%;
}

input.field, #search, textarea.field {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: #fff;
  font: inherit;
  font-size: 14px;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.search-row input.field,
.search-row #search,
.search-row input[type="search"],
.search-row input[type="text"] {
  flex: 1 1 auto;
  min-width: 0;
  width: auto;
}

.search-row .btn {
  flex-shrink: 0;
}

input.field.sm {
  width: auto;
  min-width: 140px;
  padding: 8px 14px;
  font-size: 13px;
}

input:focus, textarea:focus {
  border-color: var(--y);
  box-shadow: 0 0 0 3px rgba(245, 184, 46, 0.3);
}

.filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 4px;
  margin-bottom: 14px;
  flex-wrap: nowrap;
}

.filters::-webkit-scrollbar { display: none; }

.chip {
  flex-shrink: 0;
  padding: 7px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  transition: all 0.15s ease;
}

@media (min-width: 768px) {
  .filters {
    flex-wrap: wrap;
    overflow-x: visible;
  }
}

.chip.active {
  background: var(--y);
  border-color: var(--y-dark);
}

.label {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  font-weight: 800;
  color: var(--mut);
  margin-bottom: 10px;
}

.empty {
  text-align: center;
  color: var(--mut);
  padding: 30px 10px;
  font-size: 13.5px;
}

.sub-hint {
  font-size: 13px;
  color: var(--mut);
  margin-bottom: 10px;
}

/* ==================== TAB 1: WIDGET STYLES ==================== */
.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding: 2px;
}

@media (min-width: 600px) {
  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

.item {
  position: relative;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 8px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.item:hover {
  transform: translateY(-2px);
}

.item.sel {
  border-color: var(--y);
  box-shadow: 0 0 0 3px rgba(245, 184, 46, 0.4);
}

.item .thumb-box {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: conic-gradient(#eeeeee 25%, #ffffff 0 50%, #eeeeee 0 75%, #ffffff 0) 0 0/14px 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 2px;
}

.item .thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.item .fav {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  font-size: 15px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  z-index: 2;
  transition: transform 0.1s ease;
}

.item .fav:hover {
  transform: scale(1.1);
}

.item .nm {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: center;
  color: var(--ink);
  padding: 0 2px;
}

.skel {
  aspect-ratio: 1;
  border-radius: 18px;
  background: #f6e8bd;
  animation: pulse 1s infinite alternate;
}

@keyframes pulse { to { opacity: 0.4; } }

.preview {
  position: relative;
  aspect-ratio: 1;
  border-radius: 36px;
  overflow: hidden;
  cursor: pointer;
  background: #e9dcb8;
  border: 2px solid var(--line-strong);
  max-width: 320px;
  width: 100%;
  margin: 0 auto 12px;
}

.preview img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

#overlay {
  object-fit: fill;
  pointer-events: none;
}

.hint {
  position: absolute;
  left: 50%;
  bottom: 12px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 12px;
  padding: 4px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.selected {
  margin: 10px 0 12px;
  font-weight: 800;
  text-align: center;
  font-size: 15px;
}

.account {
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.6;
  border: 1px solid var(--line);
  word-break: break-all;
}

.share {
  display: flex;
  gap: 8px;
  align-items: center;
  font-size: 13.5px;
  margin-top: 10px;
  font-weight: 600;
}

.note {
  background: #fff;
  border-radius: 16px;
  padding: 10px 14px;
  font-size: 13.5px;
  margin: 12px 0 0;
  border-left: 4px solid var(--y);
  line-height: 1.5;
}

/* ==================== TAB 2: CHỤP CÙNG BẠN STYLES ==================== */
.grid-together {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 600px;
  overflow-y: auto;
  padding: 2px;
}

@media (min-width: 600px) {
  .grid-together {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
  }
}

.item-together {
  position: relative;
  background: #fff;
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 8px 8px 10px;
  text-align: center;
  cursor: pointer;
  transition: transform 0.1s ease, border-color 0.15s ease;
}

.item-together:hover {
  transform: translateY(-2px);
}

.item-together.sel {
  border-color: var(--y);
  box-shadow: 0 0 0 3px rgba(245, 184, 46, 0.4);
}

.item-together .thumb-box {
  aspect-ratio: 1;
  border-radius: 12px;
  background: conic-gradient(#eeeeee 25%, #ffffff 0 50%, #eeeeee 0 75%, #ffffff 0) 0 0/14px 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 2px;
}

.item-together img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.item-together .tag-slots {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(28, 26, 22, 0.85);
  color: #fff;
  font-size: 10.5px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 999px;
  z-index: 2;
}

.item-together .frame-title {
  display: block;
  font-size: 12px;
  font-weight: 800;
  margin-top: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sel-together-preview {
  background: #fff;
  border-radius: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
  text-align: center;
}

.preview-stub {
  font-size: 13px;
  color: var(--mut);
  padding: 12px 0;
}

.members-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin: 10px 0;
}

.member-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 12px 5px 6px;
}

.member-dot {
  flex: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  font-weight: 900;
  font-size: 12px;
  overflow: hidden;
}

.member-dot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.member-row input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  outline: none;
  padding: 6px 0;
  font-size: 13.5px;
  color: var(--ink);
}

.member-tag-you {
  font-size: 11px;
  font-weight: 800;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  background: #fdf5df;
}

.member-status {
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.member-status.ok { color: #169a5b; }
.member-status.bad { color: #d9443a; }
.member-status.wait { color: var(--mut); }

.info-note {
  font-size: 12px;
  color: var(--mut);
  line-height: 1.4;
  margin: 8px 0;
}

.room-status-card {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  border: 1.5px solid var(--y);
  margin-top: 14px;
}

.room-code {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 6px;
  text-align: center;
  color: var(--y-dark);
  margin: 6px 0 12px;
}

.room-btn-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 12px;
}

.room-prog-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 700;
  padding: 6px 0;
  border-bottom: 1px dashed var(--line);
}

#roomFinalResult {
  margin-top: 12px;
  text-align: center;
}

#roomFinalResult img {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid var(--line);
}

.room-check-box {
  background: #fff;
  border-radius: 18px;
  padding: 14px;
  border: 1px solid var(--line);
  margin-top: 14px;
}

/* ==================== TAB 3: CAPTION LOCKET STYLES ==================== */
.cap-mock-wrapper {
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  border: 1px solid var(--line);
  margin-bottom: 16px;
}

.mock-photo-frame {
  position: relative;
  aspect-ratio: 4 / 3;
  border-radius: 18px;
  background: linear-gradient(135deg, #FFE0B2, #FFCCBC, #E1BEE7);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding: 14px;
}

.mock-photo-content {
  position: absolute;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: rgba(0, 0, 0, 0.35);
  font-weight: 800;
  font-size: 14px;
}

.caption-pill-preview {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 800;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  max-width: 90%;
  word-break: break-word;
  background: linear-gradient(135deg, #FF9A9E, #FECFEF);
  color: #FFFFFF;
}

.cap-emoji {
  font-size: 17px;
  flex: none;
}

.cap-text {
  line-height: 1.3;
}

.form-group {
  margin-bottom: 14px;
}

.form-group label {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 800;
  margin-bottom: 6px;
}

.emoji-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip-emoji {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  background: #fff;
  cursor: pointer;
  font-size: 16px;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease;
}

.chip-emoji:hover {
  transform: scale(1.15);
}

.gradient-presets {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(75px, 1fr));
  gap: 6px;
  margin-bottom: 8px;
}

.grad-chip {
  padding: 7px 4px;
  border-radius: 999px;
  border: 2px solid transparent;
  color: #fff;
  font-weight: 800;
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  text-align: center;
  transition: transform 0.1s ease;
}

.grad-chip:hover { transform: translateY(-1px); }

.grad-chip.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 2px rgba(0,0,0,0.15);
}

.custom-color-row {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--mut);
}

.custom-color-row input[type="color"], #capCustomTextColor {
  width: 32px;
  height: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  background: #fff;
}

.text-color-presets {
  display: flex;
  align-items: center;
  gap: 8px;
}

.color-radio { cursor: pointer; }
.color-radio input { display: none; }
.color-badge {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  border: 2px solid transparent;
}

.color-radio input:checked + .color-badge {
  border-color: var(--y-dark);
  box-shadow: 0 0 0 2px var(--y);
}

.caption-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}

.cap-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 8px 12px;
  gap: 10px;
}

.cap-pill-mini {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  word-break: break-word;
  max-width: 220px;
}

.cap-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cap-date {
  font-size: 11px;
  color: var(--mut);
}

.cap-actions {
  display: flex;
  gap: 6px;
  flex: none;
}

.btn-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  display: grid;
  place-items: center;
  font-size: 13px;
  cursor: pointer;
  transition: transform 0.1s ease;
}

.btn-icon:hover { transform: scale(1.1); }
.btn-icon.del:hover { background: #ffe3e1; border-color: #fca5a5; }

/* ==================== NOTICE BAR ==================== */
.notice-bar {
  background: #FFF3CD;
  border: 1px solid #FFE08A;
  border-radius: 16px;
  padding: 12px 20px;
  font-size: 13.5px;
  text-align: center;
  margin-bottom: 20px;
  color: #7A5800;
  font-weight: 600;
}

/* ==================== PHOTOBOOTH STUDIO STYLES ==================== */
.pb-card-account, .pb-card-list {
  margin-bottom: 20px;
}

.pb-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.pb-item-card {
  background: #fff;
  border: 1.5px solid var(--line);
  border-radius: 18px;
  padding: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.1s ease, box-shadow 0.15s ease;
}

.pb-item-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.06);
}

.pb-item-thumb {
  position: relative;
  aspect-ratio: 1;
  border-radius: 12px;
  background: conic-gradient(#eeeeee 25%, #ffffff 0 50%, #eeeeee 0 75%, #ffffff 0) 0 0/14px 14px;
  overflow: hidden;
  display: grid;
  place-items: center;
}

.pb-item-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.pb-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pb-item-name {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-item-caption {
  font-size: 11.5px;
  color: var(--mut);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.pb-item-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
  padding-top: 4px;
  border-top: 1px dashed var(--line);
}

.pb-item-slots {
  font-size: 11px;
  font-weight: 800;
  color: var(--o);
}

.pb-studio-card {
  margin-bottom: 20px;
}

.pb-studio-header {
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
  margin-bottom: 16px;
}

.pb-upload-box {
  background: #fff;
  border: 1.5px dashed var(--line-strong);
  border-radius: 18px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
}

.pb-upload-icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--card);
  display: grid;
  place-items: center;
  font-size: 22px;
  flex: none;
}

.pb-upload-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.pb-upload-info b {
  font-size: 13.5px;
  color: var(--ink);
}

.pb-upload-info small {
  color: var(--mut);
  font-size: 11.5px;
}

.pb-file-name {
  display: inline-block;
  background: #E8F5E9;
  color: #2E7D32;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 11.5px;
  margin-top: 4px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 220px;
}

.pb-layout-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.btn-layout {
  padding: 8px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-strong);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.15s ease;
}

.btn-layout:hover {
  background: #fdf5df;
}

.btn-layout.active {
  background: var(--y);
  border-color: var(--y-dark);
  box-shadow: 0 2px 6px rgba(245, 184, 46, 0.35);
}

.btn-layout i {
  font-style: normal;
  font-size: 14px;
}

.pb-advanced-accordion {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 14px;
  padding: 10px 14px;
  margin-top: 14px;
}

.pb-accordion-toggle {
  background: transparent;
  border: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--mut);
  cursor: pointer;
  width: 100%;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 6px;
}

.pb-accordion-toggle:hover {
  color: var(--ink);
}

.pb-slots-editor {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
  margin-top: 10px;
}

.pb-slot-field {
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px;
  font-size: 11px;
}

.pb-slot-field b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink);
}

.pb-slot-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}

.pb-slot-inputs input {
  width: 100%;
  padding: 4px 6px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 11px;
}

/* Photobooth Mockup 1:1 */
.pb-mockup-square {
  position: relative;
  aspect-ratio: 1;
  border-radius: 28px;
  background: #000;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(0,0,0,0.25);
  border: 3px solid #222;
  max-width: 340px;
  width: 100%;
  margin: 0 auto;
}

.pb-slots-container {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.pb-slot {
  position: absolute;
  border-radius: 8px;
  overflow: hidden;
  background: #2a2a2a;
  cursor: pointer;
  transition: box-shadow 0.15s ease;
}

.pb-slot:hover {
  filter: brightness(1.08);
}

.pb-slot.active {
  box-shadow: 0 0 0 3px var(--y);
}

.pb-slot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  user-select: none;
  pointer-events: none;
}

.pb-overlay-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  z-index: 5;
}

.pb-preview-controls {
  background: #fff;
  border-radius: 18px;
  border: 1px solid var(--line);
  padding: 14px;
  margin-top: 12px;
}

.pb-ctrl-title {
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink);
  text-align: center;
}

.pb-slot-pills {
  display: flex;
  gap: 6px;
  justify-content: center;
  flex-wrap: wrap;
  margin: 8px 0;
}

.pb-slot-pill {
  padding: 4px 12px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
  transition: all 0.15s ease;
}

.pb-slot-pill:hover {
  background: #fdf5df;
}

.pb-slot-pill.active {
  background: var(--y);
  border-color: var(--y-dark);
}

.pb-ctrl-buttons {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 6px;
}

.pb-note-hint {
  font-size: 11px;
  color: var(--mut);
  text-align: center;
  margin-top: 10px;
}

.chip.chip-ai {
  background: linear-gradient(135deg, #FFE082, #FFB300);
  border-color: #FFA000;
  font-weight: 800;
  color: #3E2723;
  box-shadow: 0 2px 8px rgba(255, 179, 0, 0.35);
  animation: glowPulse 2.5s infinite alternate;
}

@keyframes glowPulse {
  to { box-shadow: 0 2px 14px rgba(255, 179, 0, 0.6); }
}

/* ==================== AI PROMPT GUIDE MODAL STYLES ==================== */
.ai-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(6px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  animation: fadeIn 0.2s ease;
}

.ai-modal-backdrop[hidden],
.ai-modal-backdrop.hidden {
  display: none !important;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.ai-modal-box {
  background: #FFFDF5;
  border: 2px solid var(--y);
  border-radius: 28px;
  width: 100%;
  max-width: 980px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.3);
  display: flex;
  flex-direction: column;
}

.ai-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid var(--line);
  background: #FFF9E8;
  border-radius: 26px 26px 0 0;
}

.ai-modal-title {
  display: flex;
  gap: 12px;
  align-items: center;
}

.ai-modal-title b {
  display: block;
  font-size: 18px;
  line-height: 1.1;
}

.ai-modal-title small {
  font-size: 12px;
  color: var(--mut);
}

.ai-sparkle-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: linear-gradient(135deg, #FFD54F, #FFB300);
  display: grid;
  place-items: center;
  font-size: 20px;
  box-shadow: 0 2px 6px rgba(255, 179, 0, 0.3);
}

.ai-modal-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 16px;
  font-weight: 800;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: transform 0.1s ease, background 0.15s ease;
}

.ai-modal-close:hover {
  background: #ffe3e1;
  border-color: #fca5a5;
  transform: scale(1.08);
}

.ai-modal-body {
  display: grid;
  grid-template-columns: 1.15fr 0.95fr;
  gap: 22px;
  padding: 22px;
}

.ai-step-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #FFF3CD;
  color: #855B00;
  border: 1px solid #FFE08A;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.ai-guide-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.ai-guide-card.highlight {
  background: #FFFBF0;
  border-color: var(--y);
}

.ai-tool-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #FAFAFA;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  text-decoration: none;
  color: var(--ink);
  margin-bottom: 8px;
  transition: all 0.15s ease;
}

.ai-tool-link:hover {
  background: #FFF9E8;
  border-color: var(--y-dark);
  transform: translateY(-1px);
}

.ai-tool-link.gemini:hover {
  border-color: #4285F4;
  background: #F1F6FD;
}

.ai-tool-link.copilot:hover {
  border-color: #0078D4;
  background: #F0F7FD;
}

.ai-tool-link.chatgpt:hover {
  border-color: #10A37F;
  background: #F0FAF7;
}

.tool-icon {
  font-size: 22px;
}

.tool-info {
  flex: 1;
}

.tool-info b {
  display: block;
  font-size: 13px;
  line-height: 1.2;
}

.tool-info small {
  font-size: 11px;
  color: var(--mut);
}

.tool-arrow {
  font-size: 16px;
  font-weight: 800;
  color: var(--mut);
}

.ai-quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.ai-tag {
  padding: 3px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--ink);
  cursor: pointer;
  transition: transform 0.1s ease, background 0.15s ease;
}

.ai-tag:hover {
  background: #fdf5df;
  transform: translateY(-1px);
}

/* ==================== TOASTS ==================== */
.toasts {
  position: fixed;
  top: 16px;
  right: 16px;
  display: grid;
  gap: 8px;
  z-index: 999;
  max-width: calc(100vw - 32px);
}

.toast {
  background: #fff;
  border-left: 5px solid var(--y);
  padding: 12px 16px;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  max-width: 380px;
  font-size: 13.5px;
  line-height: 1.4;
  animation: slideIn 0.2s ease;
}

.toast.err { border-color: #d9443a; }
.toast.ok { border-color: #3aa655; }

@keyframes slideIn {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==================== RESPONSIVE BREAKPOINTS ==================== */
@media (max-width: 900px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .right {
    position: static;
    width: 100%;
    max-width: 100%;
  }

  .header {
    gap: 12px;
    padding: 12px 0 8px;
  }

  .corner {
    display: none;
  }

  .ai-modal-box {
    margin: 8px;
    max-height: 94vh;
    border-radius: 20px;
  }

  .ai-modal-body {
    grid-template-columns: 1fr;
    padding: 16px;
    gap: 16px;
  }

  .ai-modal-header {
    padding: 12px 16px;
  }

  .pb-studio-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .pb-mockup-square {
    max-width: 320px;
    margin-inline: auto;
  }
}

@media (max-width: 600px) {
  body {
    padding: 0 12px 40px;
  }

  .card {
    border-radius: 20px;
    padding: 16px 12px;
  }

  .hero {
    padding: 20px 4px 14px;
  }

  h1 {
    font-size: 25px;
    margin: 10px 0 6px;
  }

  .hero p {
    font-size: 14px;
    margin-bottom: 14px;
  }

  .steps {
    gap: 8px;
    margin-top: 16px;
  }

  .steps li {
    font-size: 12px;
    gap: 5px;
  }

  .steps .sep {
    width: 16px;
  }

  .cta {
    gap: 8px;
  }

  .cta .btn {
    padding: 10px 16px;
    font-size: 13.5px;
  }

  .pb-upload-box {
    flex-direction: column;
    align-items: stretch;
    text-align: center;
    gap: 10px;
  }

  .pb-upload-icon {
    margin: 0 auto;
  }

  .pb-upload-box div[style*="display:flex"] {
    justify-content: center;
  }

  .mock-photo-frame {
    max-width: 100%;
  }

  .caption-pill-preview {
    font-size: 13px;
    padding: 7px 14px;
  }

  .room-code {
    font-size: 26px;
    letter-spacing: 4px;
  }

  .title-row h2 {
    font-size: 18px;
  }

  .btn-admin-zalo {
    padding: 6px 11px;
    font-size: 12px;
    gap: 5px;
  }

  .zalo-icon-badge {
    font-size: 10px;
    padding: 1px 5px;
  }
}
