/* MEOMEO Wedding — giao diện ứng dụng (trang chủ, chọn mẫu, trình thiết kế, quản lý) */
.tp-body {
  --tp-bg: var(--bg-primary); --tp-card: var(--bg-card); --tp-ink: var(--text-primary); --tp-muted: var(--text-muted);
  --tp-line: var(--border-color); --tp-pink: var(--primary-peach); --tp-pink-d: var(--rose-ink); --tp-accent: var(--accent-text);
  --tp-ok: var(--success-text); --tp-bad: var(--danger-text); --tp-radius: 18px;
  --tp-input: #FBF7EF; --tp-soft: #F5EEE2; --tp-soft-2: var(--accent-pastel-pink);
  --tp-shadow: var(--shadow-sticker-sm);
}
html[data-theme="dark"] .tp-body { --tp-input: #2B2521; --tp-soft: #2E2926; }
.tp-body * { box-sizing: border-box; }
.tp-body a { color: inherit; }
.tp-main { max-width: 1240px; margin: 0 auto; padding: calc(var(--nav-h-px, 92px) + 22px) 1.25rem 0 !important; }
.tp-loading { display: flex; justify-content: center; padding: 120px 0; }
.tp-spinner { width: 34px; height: 34px; border: 4px solid var(--tp-line); border-top-color: var(--tp-pink); border-radius: 50%; animation: tp-spin 1s linear infinite; }
@keyframes tp-spin { to { transform: rotate(360deg); } }
.tp-view { max-width: 1100px; margin: 0 auto; padding: 22px 16px 60px; }

.tp-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 2px solid var(--tp-line); background: var(--tp-input); color: var(--tp-ink); border-radius: 12px; padding: 9px 16px; font: 700 14px var(--font-body); cursor: pointer; text-decoration: none; white-space: nowrap; transition: transform .12s, box-shadow .2s, background .2s; }
.tp-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sticker-sm); }
.tp-btn:disabled { opacity: .6; cursor: default; transform: none; }
.tp-btn-primary { background: var(--tp-pink); border-color: var(--line-art-soft); color: #fff !important; font-family: var(--font-heading); box-shadow: var(--shadow-sticker-sm); }
.tp-btn-primary:hover { background: var(--tp-pink); filter: brightness(1.06); }
.tp-btn-danger { color: var(--tp-bad); border-color: var(--danger-border); }
.tp-btn-sm { padding: 6px 11px; font-size: 13px; border-radius: 10px; }
.tp-back { display: inline-block; text-decoration: none; color: var(--tp-muted); font-size: 14px; margin-bottom: 10px; }
.tp-sub, .tp-hint { color: var(--tp-muted); font-size: 14px; font-weight: 500; }
.tp-err { color: var(--tp-bad); }
.tp-chip { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--tp-soft); color: var(--tp-muted); font-size: 12px; white-space: nowrap; }
.tp-chip.ok { background: var(--success-bg); color: var(--success-text); } .tp-chip.bad { background: var(--danger-bg); color: var(--danger-text); }

/* trang chủ */
.tp-hero { margin-bottom: 26px; }
.tp-hero .tool-header-desc { max-width: 720px; margin: 0.8rem auto 0; }
.tp-kinds { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.tp-kind { display: grid; gap: 6px; justify-items: center; text-align: center; padding: 22px 18px; background: var(--tp-card); border: 3px solid var(--tp-line); border-radius: 22px; box-shadow: var(--tp-shadow); text-decoration: none; transition: transform .15s, border-color .2s, box-shadow .2s; }
.tp-kind:hover { transform: translateY(-3px); border-color: var(--tp-pink); box-shadow: var(--shadow-sticker); }
.tp-kind b { font-family: var(--font-heading); font-size: 20px; }
.tp-kind small { color: var(--tp-muted); font-weight: 500; font-size: 13.5px; }
.tp-draft { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 0; padding: 14px 18px; background: var(--warning-bg); border: 2px dashed var(--warning-border); border-radius: var(--tp-radius); }
.tp-draft-actions { display: flex; gap: 8px; }
.tp-mine { margin-top: 30px; }
.tp-sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tp-sec-head h2 { font-family: var(--font-heading); margin: 0 0 12px; }
.tp-usage { color: var(--tp-muted); font-size: 13px; }
.tp-empty { padding: 26px; text-align: center; background: var(--tp-card); border: 3px dashed var(--tp-line); border-radius: var(--tp-radius); }
.tp-cards { display: grid; gap: 10px; }
.tp-cardrow { display: flex; align-items: center; gap: 14px; padding: 14px 18px; background: var(--tp-card); border: 3px solid var(--tp-line); border-radius: var(--tp-radius); box-shadow: var(--tp-shadow); text-decoration: none; }
.tp-cardrow:hover { border-color: var(--tp-pink); }
.tp-cardrow-main { flex: 1; min-width: 0; display: grid; }
.tp-cardrow-main b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tp-cardrow-main small { color: var(--tp-muted); font-weight: 500; }

/* chọn mẫu */
.tp-new h1 { font-family: var(--font-heading); margin: 0; }
.tp-tpls { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px; margin-top: 18px; }
.tp-tpl { padding: 0 0 12px; border: 3px solid var(--tp-line); border-radius: 22px; background: var(--tp-card); box-shadow: var(--tp-shadow); cursor: pointer; overflow: hidden; font: 700 15px var(--font-body); color: var(--tp-ink); transition: transform .15s, border-color .2s; }
.tp-tpl:hover { transform: translateY(-3px); border-color: var(--tp-pink); }
.tp-tpl b { display: block; margin-top: 10px; }
.tp-mini { height: 330px; overflow: hidden; position: relative; pointer-events: none; }
.tp-mini-inner { width: 480px; transform: scale(.4); transform-origin: top left; position: absolute; left: calc(50% - 96px); top: 0; }
.tp-mini-inner .iv-card { min-height: 0; }
.tp-mini .iv-hero { min-height: 640px !important; }
.tp-mini .iv-hero-names { font-size: 60px; }
.tp-mini .iv-reveal { opacity: 1; transform: none; }

/* trình thiết kế */
body.tp-editing .clay-footer { display: none !important; }
body.tp-editing .tp-main { padding-bottom: 12px !important; }
.ed { display: flex; flex-direction: column; height: calc(100dvh - var(--nav-h-px, 92px) - 34px); min-height: 480px; background: var(--tp-card); border: 3px solid var(--tp-line); border-radius: 22px; box-shadow: var(--shadow-sticker); overflow: hidden; }
.ed-head { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: var(--tp-card); border-bottom: 2px solid var(--tp-line); }
.ed-head .tp-back { margin: 0; font-size: 20px; }
.ed-head-title { display: grid; flex: 1; min-width: 0; }
.ed-head-title small { color: var(--tp-muted); font-weight: 500; font-size: 12.5px; }
.ed-tabs { display: none; }
.ed-body { flex: 1; display: grid; grid-template-columns: minmax(340px, 460px) 1fr; min-height: 0; }
.ed-form { overflow-y: auto; padding: 14px 16px 60px; border-right: 2px solid var(--tp-line); background: var(--bg-card); }
.ed-preview-wrap { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 16px; background: var(--bg-secondary); border-radius: 0 0 var(--tp-radius) 0; min-height: 0; }
.ed-phone { width: 390px; max-width: 100%; height: min(760px, calc(100dvh - var(--nav-h-px, 92px) - 185px)); border-radius: 38px; padding: 12px; background: #1f1a1c; box-shadow: 0 24px 60px rgba(60, 20, 30, .25); }
.ed-phone-scroll { width: 100%; height: 100%; overflow-y: auto; border-radius: 28px; background: #fff; scrollbar-width: thin; }
.ed-phone .iv-card { max-width: none; }
.ed-phone .iv-card.is-preview .iv-hero { min-height: 640px; }
.ed-guest { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tp-muted); }
.ed-guest input { border: 1.5px solid var(--tp-line); border-radius: 10px; padding: 6px 10px; background: var(--tp-input); color: var(--tp-ink); font: 600 13px var(--font-body); }

.ed-sec { background: var(--tp-card); border: 2px solid var(--tp-line); box-shadow: var(--tp-shadow); border-radius: var(--tp-radius); margin-bottom: 10px; }
.ed-sec summary { display: flex; align-items: center; gap: 10px; padding: 13px 14px; cursor: pointer; list-style: none; }
.ed-sec summary::-webkit-details-marker { display: none; }
.ed-sec summary::after { content: '›'; margin-left: auto; font-size: 20px; color: var(--tp-muted); transition: transform .2s; }
.ed-sec[open] summary::after { transform: rotate(90deg); }
.ed-sec-body { padding: 0 14px 14px; display: grid; gap: 10px; }
.ed-field { display: grid; gap: 4px; font-size: 13px; color: var(--tp-muted); }
.ed-field input, .ed-field textarea, .ed-select { width: 100%; border: 1.5px solid var(--tp-line); border-radius: 10px; padding: 9px 11px; font: 600 14px var(--font-body); color: var(--tp-ink); background: var(--tp-input); outline: none; }
.ed-field input:focus, .ed-field textarea:focus, .ed-select:focus { border-color: var(--tp-pink); }
.ed-field small { font-weight: 500; }
.ed-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ed-toggle { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.ed-toggle input { width: 18px; height: 18px; accent-color: var(--tp-pink); }
.ed-hint { margin: 0; color: var(--tp-muted); font-size: 12.5px; font-weight: 500; }
.ed-lunar { margin-top: -4px; color: var(--tp-pink-d); font-size: 12.5px; }
.ed-group { display: grid; gap: 8px; padding: 12px; border: 1px dashed var(--tp-line); border-radius: 12px; }
.ed-group-title { display: flex; align-items: center; justify-content: space-between; font-size: 13px; color: var(--tp-ink); }
.ed-list { display: grid; gap: 10px; }
.ed-add { justify-self: start; }
.ed-x { border: 0; background: var(--danger-bg); color: var(--tp-bad); width: 26px; height: 26px; border-radius: 50%; font-size: 17px; line-height: 1; cursor: pointer; }
.ed-tpls { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-tpl { display: grid; gap: 6px; justify-items: center; padding: 8px 4px; border: 2px solid var(--tp-line); border-radius: 12px; background: var(--tp-input); cursor: pointer; font: 700 12px var(--font-body); color: var(--tp-ink); }
.ed-tpl.on { border-color: var(--tp-pink); box-shadow: 0 0 0 3px var(--primary-peach-glow); }
.ed-tpl-sw { width: 44px; height: 44px; border-radius: 50%; }
.ed-tpl.tpl-song-hy .ed-tpl-sw { background: conic-gradient(#a3201b 0 60%, #d9a441 0); }
.ed-tpl.tpl-toi-gian .ed-tpl-sw { background: conic-gradient(#f1eee9 0 60%, #3a3a3a 0); border: 1px solid #ddd; }
.ed-tpl.tpl-hoa-pastel .ed-tpl-sw { background: conic-gradient(#f7c9d2 0 50%, #d5e5d2 0 80%, #d07a8c 0); }
.ed-tpl.tpl-vintage .ed-tpl-sw { background: conic-gradient(#5d7350 0 60%, #e9dfc7 0); }
.ed-tpl.tpl-hong-dao .ed-tpl-sw { background: conic-gradient(#f59aa0 0 60%, #e8b45c 0); }
.ed-tpl.tpl-bong-bay .ed-tpl-sw { background: conic-gradient(#7c5cff 0 33%, #ff6b8b 0 66%, #ffc94d 0); }
.ed-cover { position: relative; border-radius: 12px; overflow: hidden; background: var(--tp-soft); min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--tp-muted); }
.ed-cover img { width: 100%; max-height: 260px; object-fit: cover; }
.ed-cover-actions { position: absolute; bottom: 8px; left: 8px; right: 8px; display: flex; gap: 6px; justify-content: center; }
.ed-cover:not(.has) .ed-cover-actions { position: static; }
.ed-cover:not(.has) { flex-direction: column; gap: 10px; padding: 18px; }
.ed-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.ed-thumb { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--tp-soft); }
.ed-thumb img { width: 100%; height: 100%; object-fit: cover; }
.ed-thumb-bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: space-between; background: linear-gradient(transparent, rgba(0,0,0,.55)); padding: 2px; }
.ed-thumb-bar button { border: 0; background: rgba(255,255,255,.9); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 14px; line-height: 1; }
.ed-thumb-add { display: flex; align-items: center; justify-content: center; text-align: center; border: 1.5px dashed var(--tp-pink); color: var(--tp-pink); font-size: 13px; cursor: pointer; padding: 4px; }
.ed-music-up { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; }

/* quản lý thiệp */
.tp-success { display: grid; gap: 2px; padding: 14px 18px; margin: 18px 0 0; background: var(--success-bg); border: 2px solid var(--success-border); border-radius: var(--tp-radius); }
.tp-manage-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 16px;
  background: var(--tp-card); border: 3px solid var(--tp-line); border-radius: 22px; box-shadow: var(--tp-shadow); padding: 16px 20px; }
.tp-manage-title { min-width: 0; flex: 1 1 320px; }
.tp-manage-title .tp-back { margin-bottom: 4px; font-weight: 600; }
.tp-manage-title .tp-back:hover { color: var(--tp-pink); }
.tp-manage-head h1 { font-family: var(--font-heading); margin: 0 0 4px; font-size: 28px; line-height: 1.25; color: var(--tp-ink); overflow-wrap: anywhere; }
.tp-manage-head .tp-sub { margin: 0; }
@media (max-width: 560px) { .tp-manage-head { padding: 14px 16px; } .tp-manage-head h1 { font-size: 22px; } }
.tp-manage-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-panel { background: var(--tp-card); border: 3px solid var(--tp-line); border-radius: 22px; padding: 20px; margin-top: 18px; box-shadow: var(--tp-shadow); }
.tp-panel h2 { font-family: var(--font-heading); font-size: 20px; margin: 0 0 10px; }
.tp-panel textarea { width: 100%; border: 1.5px solid var(--tp-line); border-radius: 12px; padding: 10px; font: 600 14px var(--font-body); margin-bottom: 10px; background: var(--tp-input); color: var(--tp-ink); }
.tp-share { display: flex; gap: 18px; align-items: flex-start; flex-wrap: wrap; }
.tp-share-main { flex: 1; min-width: 260px; display: grid; gap: 10px; }
.tp-linkbox { display: flex; gap: 8px; }
.tp-linkbox input { flex: 1; min-width: 0; border: 1.5px solid var(--tp-line); border-radius: 12px; padding: 9px 12px; font: 700 14px var(--font-body); color: var(--tp-ink); background: var(--tp-input); }
.tp-share-btns { display: flex; gap: 8px; flex-wrap: wrap; }
.tp-qr { width: 160px; height: 160px; border-radius: 12px; overflow: hidden; background: #fff; border: 1px solid var(--tp-line); }
.tp-guests { display: grid; gap: 6px; margin-top: 12px; }
.tp-guests-bar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tp-guest { display: grid; grid-template-columns: minmax(90px, 160px) 1fr auto; gap: 8px; align-items: center; padding: 8px 10px; border: 1px solid var(--tp-line); border-radius: 10px; font-size: 13px; }
.tp-guest code { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--tp-muted); font-size: 12px; }
.tp-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.tp-tab { border: 0; background: var(--tp-soft); color: var(--tp-muted); padding: 8px 14px; border-radius: 10px; font: 700 14px var(--font-body); cursor: pointer; }
.tp-tab.on { background: var(--tp-pink); color: #fff; }
.tp-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.tp-stats div { display: grid; text-align: center; padding: 10px; background: var(--tp-soft); border-radius: 12px; }
.tp-stats b { font-family: var(--font-heading); font-size: 24px; color: var(--tp-pink); }
.tp-stats span { font-size: 12px; color: var(--tp-muted); }
.tp-table-wrap { overflow-x: auto; margin-top: 10px; }
.tp-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tp-table th, .tp-table td { text-align: left; padding: 8px; border-bottom: 1px solid var(--tp-line); vertical-align: top; }
.tp-table th { color: var(--tp-muted); font-size: 12px; }
.tp-note { max-width: 260px; white-space: pre-wrap; font-weight: 500; }
.tp-wishes { display: grid; gap: 8px; margin-top: 10px; }
.tp-wish { display: flex; gap: 10px; justify-content: space-between; padding: 10px 12px; border: 1px solid var(--tp-line); border-radius: 12px; }
.tp-wish.is-hidden { opacity: .55; }
.tp-wish p { margin: 4px 0 0; font-weight: 500; white-space: pre-wrap; overflow-wrap: anywhere; }
.tp-wish small { color: var(--tp-muted); font-weight: 500; }
.tp-wish-actions { display: flex; gap: 6px; align-items: flex-start; }
.tp-setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--tp-line); }
.tp-setting:first-of-type { border-top: 0; }
.tp-setting > div { display: grid; }
.tp-setting small { color: var(--tp-muted); font-weight: 500; }

/* modal + toast */
[hidden] { display: none !important; }
.tp-modal { position: fixed; inset: 0; z-index: 3000; background: rgba(40, 20, 25, .45); display: flex; align-items: center; justify-content: center; padding: 16px; }
.tp-modal-card { position: relative; width: min(440px, 100%); background: var(--tp-card); color: var(--tp-ink); border: 3px solid var(--tp-line); border-radius: 22px; padding: 22px; box-shadow: var(--shadow-sticker); }
.tp-modal-card.wide { width: min(720px, 100%); }
.tp-modal-card h2 { font-family: var(--font-heading); margin: 0 0 8px; font-size: 22px; }
.tp-modal-card p { font-weight: 500; color: var(--tp-muted); }
.tp-modal-x { position: absolute; top: 10px; right: 12px; border: 0; background: none; font-size: 26px; cursor: pointer; color: var(--tp-muted); }
.tp-modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 14px; }
.tp-toasts { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); z-index: 3100; display: grid; gap: 8px; width: min(420px, calc(100% - 32px)); }
.tp-toast { background: #2b2226; color: #fff; padding: 11px 16px; border-radius: 12px; font-size: 14px; box-shadow: 0 8px 24px rgba(0,0,0,.2); transition: opacity .4s, transform .4s; }
.tp-toast.err { background: #9b2c2c; }
.tp-toast.out { opacity: 0; transform: translateY(8px); }

@media (max-width: 860px) {
  .ed-head-title b { white-space: nowrap; }
  .ed-head { gap: 8px; padding: 8px 10px; }
  .ed-tabs { display: flex; gap: 4px; background: var(--tp-soft); border-radius: 10px; padding: 3px; }
  .ed-tab { border: 0; background: transparent; padding: 6px 10px; border-radius: 8px; font: 700 13px var(--font-body); color: var(--tp-muted); cursor: pointer; }
  .ed-tab.on { background: var(--tp-card); color: var(--tp-ink); }
  .ed-head-title small { display: none; }
  .ed-body { grid-template-columns: 1fr; }
  .ed-form { border-right: 0; }
  .ed-preview-wrap { display: none; padding: 0; background: transparent; }
  .ed.show-preview .ed-form { display: none; }
  .ed.show-preview .ed-preview-wrap { display: flex; }
  .ed-phone { width: 100%; height: 100%; border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .ed-phone-scroll { border-radius: 0; }
  .tp-stats { grid-template-columns: repeat(2, 1fr); }
  .tp-guest { grid-template-columns: 1fr auto; }
  .tp-guest code { grid-column: 1 / -1; grid-row: 2; }
  .tp-setting { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 420px) { .ed-gallery { grid-template-columns: repeat(3, 1fr); } .ed-row { grid-template-columns: 1fr; } }

/* Ứng dụng chỉ có tiếng Việt: ẩn nút đổi ngôn ngữ của navbar chung */
.tp-body .navbar .lang-switch-container { display: none !important; }
body.tp-editing .tp-view { max-width: none; padding: 0; }
@media (max-width: 600px) {
  .tp-main { padding-left: 10px !important; padding-right: 10px !important; }
  .ed { border-radius: 16px; border-width: 2px; }
  .ed-form { padding: 10px 10px 50px; }
}

/* Khung tiêu đề công cụ dùng chung (3d-style.css chỉ có bản mobile) */
.tool-page-header { text-align: center; margin-bottom: 2.2rem; }
.tool-page-header .tool-page-title { margin-left: auto; margin-right: auto; }
.tool-badge {
  display: inline-flex; align-items: center; gap: 0.6rem; padding: 0.5rem 1.4rem;
  background: var(--secondary-butter, #FFE3A8); border: 3px solid var(--border-color, #2B3044); border-radius: 50px;
  color: var(--text-primary, #2B3044); font-family: var(--font-heading, "Fredoka", cursive); font-size: 0.95rem; font-weight: 700;
  margin-bottom: 1.2rem; box-shadow: var(--shadow-sticker-sm, 3px 3px 0px #2B3044);
}

/* Sửa chữ trực tiếp trên khung xem trước */
.ed-inline-hint { margin: 0; max-width: 390px; text-align: center; font-size: 12.5px; font-weight: 600; color: var(--tp-muted); }
#edPreview .iv-editable { cursor: text; border-radius: 4px; outline: 1.5px dashed transparent; outline-offset: 3px; transition: outline-color .15s, background-color .15s; }
#edPreview .iv-editable:hover { outline-color: currentColor; }
#edPreview .iv-editable:focus { outline: 2px dashed currentColor; background-color: rgba(255, 255, 255, .18); }
#edPreview .iv-editable:empty::before { content: attr(data-def); opacity: .45; }
@media (max-width: 860px) { .ed-inline-hint { padding: 6px 10px 0; } }

/* Mẫu mới: ô màu nhỏ trong trình thiết kế */
.ed-tpl.tpl-hoang-gia .ed-tpl-sw { background: conic-gradient(#1f2a44 0 62%, #c9a45c 0); }
.ed-tpl.tpl-lavender .ed-tpl-sw { background: conic-gradient(#8e7cc3 0 50%, #d9cff0 0 80%, #a9c49a 0); }
.ed-tpl.tpl-bien-xanh .ed-tpl-sw { background: conic-gradient(#2a7f8f 0 55%, #8fd0d6 0 80%, #e3c99a 0); }
.ed-tpl.tpl-thu-vang .ed-tpl-sw { background: conic-gradient(#7a2430 0 55%, #d29a3a 0 85%, #b4532f 0); }
.ed-tpl.tpl-den-vang .ed-tpl-sw { background: conic-gradient(#131211 0 62%, #d4af6a 0); }
.ed-tpl.tpl-do-son .ed-tpl-sw { background: conic-gradient(#c8102e 0 60%, #ffffff 0); border: 1px solid #eee; }
.ed-tpl.tpl-keo-ngot .ed-tpl-sw { background: conic-gradient(#ff7aa8 0 33%, #ffe9a8 0 66%, #7fd3c6 0); }
.ed-tpl.tpl-vu-tru .ed-tpl-sw { background: conic-gradient(#14173a 0 50%, #7c6cff 0 80%, #ffd166 0); }

/* Màu & font tuỳ chỉnh */
.ed-style { display: grid; gap: 10px; }
.ed-sub { font-size: 12.5px; font-weight: 700; color: var(--tp-ink); margin-top: 2px; }
.ed-palettes { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.ed-pal { display: grid; justify-items: center; gap: 4px; padding: 6px 2px; border: 1.5px solid var(--tp-line); border-radius: 10px; background: var(--tp-input); cursor: pointer; font: 600 10.5px var(--font-body); color: var(--tp-muted); }
.ed-pal:hover { border-color: var(--tp-pink); }
.ed-pal small { line-height: 1.2; text-align: center; }
.ed-pal-sw { width: 30px; height: 30px; border-radius: 50%; background: conic-gradient(var(--a) 0 55%, var(--b) 0 85%, var(--c, #fff) 0); box-shadow: inset 0 0 0 1px rgba(0,0,0,.08); }
.ed-colors { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ed-color { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1.5px solid var(--tp-line); border-radius: 10px; background: var(--tp-input); font-size: 12px; color: var(--tp-muted); cursor: pointer; }
.ed-color.set { border-color: var(--tp-pink); color: var(--tp-ink); }
.ed-color input { width: 28px; height: 28px; padding: 0; border: 0; background: none; cursor: pointer; flex: none; }
.ed-color input::-webkit-color-swatch-wrapper { padding: 0; } .ed-color input::-webkit-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 50%; }
.ed-color input::-moz-color-swatch { border: 1px solid rgba(0,0,0,.15); border-radius: 50%; }
.ed-style-actions { display: flex; gap: 8px; flex-wrap: wrap; justify-content: space-between; }
.ed-mine { display: grid; gap: 8px; }
.ed-mine-list { display: grid; gap: 6px; }
.ed-mine-item { display: flex; align-items: center; gap: 6px; }
.ed-mine-use { flex: 1; display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1.5px solid var(--tp-line); border-radius: 10px; background: var(--tp-input); color: var(--tp-ink); font: 700 13px var(--font-body); cursor: pointer; text-align: left; }
.ed-mine-use:hover { border-color: var(--tp-pink); }
.ed-mine-use .ed-pal-sw { width: 22px; height: 22px; flex: none; }
.tp-mine-h { font-family: var(--font-heading); font-size: 20px; margin: 22px 0 0; }
@media (max-width: 420px) { .ed-palettes { grid-template-columns: repeat(4, 1fr); } .ed-colors { grid-template-columns: repeat(2, 1fr); } }
.tp-muted { color: var(--tp-muted); font-size: 13px; font-weight: 700; white-space: nowrap; }
.tp-tpl.picked { outline: 3px solid var(--tp-pink); outline-offset: 3px; }
