/* ==========================================================================
   base.css — hệ thiết kế chung của nền tảng (khung ngoài + bảng điều khiển)
   Trang cá nhân dùng thêm blog.css và một tệp trong themes/.
   ========================================================================== */

/* --- 1. Token ------------------------------------------------------------ */
:root {
  /* Bộ chữ — xem fonts.css. Tất cả đều tự host và có đủ dấu tiếng Việt.
     Chuỗi dự phòng chỉ dùng các họ chung (serif/sans-serif/system-ui) vì
     font-display:swap khiến chúng hiện ra trong lúc phông chính đang tải.
     Tuyệt đối không thêm Georgia hay Palatino: chúng thiếu ế ồ ầ ộ ứ và sẽ
     làm chữ vỡ trong khoảnh khắc đó. Có test chặn ở fonts_test.go. */
  --font-display: "Playfair Display", "Lora", serif;
  --font-serif:   "Lora", serif;
  --font-sans:    "Be Vietnam Pro", ui-sans-serif, system-ui, -apple-system,
                  "Segoe UI", Roboto, "Noto Sans", sans-serif;
  --font-mono:    ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  /* Màu — nền ngà ấm, mực nâu đen; hợp với ảnh chân dung */
  --ink:      #17120f;
  --ink-2:    #4b423b;
  --ink-3:    #7d7269;
  --line:     #e8dfd6;
  --line-2:   #f2ece5;
  --bg:       #fbf8f5;
  --surface:  #ffffff;
  --surface-2:#f7f2ec;

  --brand:    #e8879f;            /* ghi đè theo tên miền trong thẻ <body> */
  --brand-ink:#ffffff;
  --danger:   #b3261e;
  --success:  #1f7a4d;
  --warn:     #9a6b00;

  --radius-sm: 6px;
  --radius:    12px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgb(23 18 15 / .06), 0 1px 3px rgb(23 18 15 / .04);
  --shadow:    0 4px 12px rgb(23 18 15 / .07), 0 1px 3px rgb(23 18 15 / .05);
  --shadow-lg: 0 18px 48px rgb(23 18 15 / .13), 0 4px 12px rgb(23 18 15 / .06);

  --wrap: 1180px;
  --wrap-narrow: 720px;
  --gap: clamp(1rem, 2.5vw, 1.75rem);

  --ease: cubic-bezier(.2, .7, .3, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink:      #f3ede7;
    --ink-2:    #c3b8ae;
    --ink-3:    #918479;
    --line:     #302a25;
    --line-2:   #251f1b;
    --bg:       #14100d;
    --surface:  #1c1714;
    --surface-2:#241d19;
    --shadow-sm: 0 1px 2px rgb(0 0 0 / .4);
    --shadow:    0 4px 14px rgb(0 0 0 / .45);
    --shadow-lg: 0 20px 50px rgb(0 0 0 / .6);
  }
}

/* --- 2. Nền tảng --------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-wrap: break-word;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
img { background: var(--surface-2); }

a { color: inherit; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }

h1, h2, h3, h4 { margin: 0; line-height: 1.18; font-weight: 600; letter-spacing: -.012em; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
li { list-style: none; }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip-path: inset(50%); white-space: nowrap;
}

.skip-link {
  position: absolute; left: -9999px; top: .5rem; z-index: 100;
  background: var(--ink); color: var(--bg);
  padding: .6rem 1rem; border-radius: var(--radius-sm);
}
.skip-link:focus { left: .5rem; }

.wrap {
  width: min(100% - 2rem, var(--wrap));
  margin-inline: auto;
}
.wrap--narrow { width: min(100% - 2rem, var(--wrap-narrow)); }

.icon { width: 1.15em; height: 1.15em; flex: none; }

/* --- 3. Nút -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .6rem 1.15rem;
  border: 1px solid transparent;
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-size: .94rem; font-weight: 550;
  text-decoration: none; cursor: pointer;
  transition: transform .15s var(--ease), box-shadow .15s var(--ease),
              background-color .15s var(--ease), border-color .15s var(--ease);
}
.btn:hover  { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn--primary {
  background: var(--ink); color: var(--bg);
  box-shadow: var(--shadow-sm);
}
.btn--primary:hover { background: color-mix(in srgb, var(--ink) 88%, var(--brand)); box-shadow: var(--shadow); }

.btn--ghost { border-color: var(--line); background: transparent; color: var(--ink); }
.btn--ghost:hover { border-color: var(--ink-3); background: var(--surface); }

.btn--google { background: var(--surface); border-color: var(--line); box-shadow: var(--shadow-sm); }
.btn--google:hover { border-color: var(--ink-3); }

.btn--danger { background: var(--danger); color: #fff; }
.btn--danger:hover { background: color-mix(in srgb, var(--danger) 85%, #000); }

.btn--sm  { padding: .38rem .85rem; font-size: .85rem; }
.btn--lg  { padding: .8rem 1.6rem; font-size: 1rem; }
.btn--block { width: 100%; }

.linkbtn {
  background: none; border: 0; padding: 0; cursor: pointer;
  font-size: .85rem; text-decoration: underline;
  text-underline-offset: .18em; color: var(--ink-2);
}
.linkbtn--danger { color: var(--danger); }
.inline-form { display: inline; }

/* --- 4. Đầu trang -------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex; align-items: center; gap: 1rem;
  min-height: 68px;
}

.logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; margin-right: auto; }
.logo-mark {
  display: grid; place-items: center;
  width: 34px; height: 34px; flex: none;
  border-radius: 50%;
  background: var(--brand); color: #fff;
  font-size: 1.05rem; line-height: 1;
}
.logo-text { display: flex; flex-direction: column; line-height: 1.15; }
.logo-text strong { font-family: var(--font-display); font-size: 1.12rem; font-weight: 600; letter-spacing: -.01em; }
.logo-text small  { font-size: .72rem; color: var(--ink-3); }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav > a {
  font-size: .93rem; text-decoration: none; color: var(--ink-2);
  padding-block: .35rem; position: relative;
}
.site-nav > a:hover { color: var(--ink); }
.site-nav > a.is-active { color: var(--ink); font-weight: 550; }
.site-nav > a.is-active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px;
  height: 2px; border-radius: 2px; background: var(--brand);
}

.site-nav__user { display: flex; align-items: center; gap: .75rem; padding-left: .8rem; border-left: 1px solid var(--line); }
.avatar-link { display: flex; align-items: center; gap: .5rem; text-decoration: none; font-size: .9rem; }
.avatar-link span { max-width: 10ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.nav-toggle {
  display: none; flex-direction: column; gap: 4px;
  background: none; border: 0; padding: .5rem; cursor: pointer;
}
.nav-toggle span { display: block; width: 22px; height: 2px; background: var(--ink); border-radius: 2px; transition: transform .2s var(--ease), opacity .2s; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 860px) {
  .nav-toggle { display: flex; }
  .site-nav {
    position: absolute; inset: 68px 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow);
    padding: .5rem 1rem 1.2rem;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav > a { padding: .8rem .2rem; border-bottom: 1px solid var(--line-2); }
  .site-nav > a.is-active::after { display: none; }
  .site-nav__user { border-left: 0; padding: .9rem .2rem 0; justify-content: space-between; }
  .site-nav .btn { margin-top: .9rem; }
}

/* --- 5. Ảnh đại diện ----------------------------------------------------- */
.avatar {
  border-radius: 50%; object-fit: cover; flex: none;
  background: var(--surface-2);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 8%, transparent);
}
.avatar--xs { width: 24px; height: 24px; }
.avatar--sm { width: 32px; height: 32px; }
.avatar--md { width: 48px; height: 48px; }
.avatar--lg { width: 72px; height: 72px; }
.avatar--xl { width: 128px; height: 128px; }

.avatar--letter {
  display: grid; place-items: center;
  background: linear-gradient(150deg, var(--brand), color-mix(in srgb, var(--brand) 45%, var(--ink)));
  color: #fff; font-weight: 600; letter-spacing: .02em;
}
.avatar--letter.avatar--xs { font-size: .65rem; }
.avatar--letter.avatar--sm { font-size: .78rem; }
.avatar--letter.avatar--md { font-size: 1.05rem; }
.avatar--letter.avatar--lg { font-size: 1.5rem; }
.avatar--letter.avatar--xl { font-size: 2.6rem; }

.verified { color: #2f6df6; display: inline-flex; vertical-align: middle; }

/* --- 6. Banner mở đầu ---------------------------------------------------- */
.banner {
  position: relative; overflow: hidden;
  padding-block: clamp(3rem, 9vw, 6.5rem);
  text-align: center;
  border-bottom: 1px solid var(--line);
}
.banner__glow {
  position: absolute; inset: -30% -10% auto -10%; height: 130%;
  background:
    radial-gradient(48ch 30ch at 22% 8%,  color-mix(in srgb, var(--brand) 30%, transparent), transparent 68%),
    radial-gradient(42ch 26ch at 78% 0%,  color-mix(in srgb, var(--warn)  22%, transparent), transparent 66%),
    radial-gradient(60ch 34ch at 50% 96%, color-mix(in srgb, var(--brand) 14%, transparent), transparent 70%);
  pointer-events: none;
}
.banner__inner { position: relative; }

.banner__eyebrow {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem 1rem;
  border: 1px solid color-mix(in srgb, var(--warn) 45%, var(--line));
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  font-size: .78rem; letter-spacing: .1em; text-transform: uppercase;
  font-weight: 600; color: var(--ink-2);
  margin-bottom: 1.4rem;
}
.banner__eyebrow .icon { color: var(--warn); width: 1.25em; height: 1.25em; }

.banner__title {
  font-family: var(--font-display);
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.06; letter-spacing: -.025em; font-weight: 400;
}
.banner__title em { font-style: italic; color: var(--brand); }

.banner__lead {
  margin: 1.3rem auto 0; max-width: 60ch;
  font-size: clamp(1rem, 1.6vw, 1.1rem); color: var(--ink-2);
}
.banner__lead code {
  font-family: var(--font-mono); font-size: .88em;
  background: var(--surface-2); padding: .12em .45em; border-radius: var(--radius-sm);
  white-space: nowrap;
}

.banner__actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: center; margin-top: 2rem; }

.banner__stats {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: clamp(1.5rem, 5vw, 3.5rem);
  margin: 3rem auto 0; padding-top: 2rem;
  border-top: 1px solid var(--line);
  max-width: 46rem;
}
.banner__stats dt { font-size: .74rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); }
.banner__stats dd {
  margin: .25rem 0 0; font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.4vw, 2.4rem); line-height: 1;
}

/* --- 7. Khối nội dung ---------------------------------------------------- */
.section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
.section--tint { background: var(--surface-2); }

.section__head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 1rem; margin-bottom: 2rem; flex-wrap: wrap;
}
.section__title { font-family: var(--font-display); font-size: clamp(1.5rem, 3vw, 2.1rem); font-weight: 400; }
.section__sub { color: var(--ink-3); margin-top: .35rem; max-width: 62ch; }
.section__more { font-size: .92rem; color: var(--brand); text-decoration: none; white-space: nowrap; }
.section__more:hover { text-decoration: underline; }

.page-head { padding-block: clamp(2rem, 5vw, 3.2rem) 1.5rem; }
.page-head__title { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 2.9rem); font-weight: 400; }
.page-head__sub { color: var(--ink-2); margin-top: .6rem; max-width: 68ch; }

.grid { display: grid; gap: var(--gap); }
.grid--cards  { grid-template-columns: repeat(auto-fill, minmax(min(100%, 236px), 1fr)); }
.grid--posts  { grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); }
.grid--themes { grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); }

.section__head--center { justify-content: center; text-align: center; }
.section__head--center .section__sub { margin-inline: auto; }
.section__kicker {
  display: inline-flex; align-items: center; gap: .4rem;
  font-size: .76rem; letter-spacing: .13em; text-transform: uppercase;
  font-weight: 600; color: var(--brand); margin-bottom: .5rem;
}
.section__kicker .icon { width: 1.1em; height: 1.1em; }
.section__foot { text-align: center; margin-top: 2rem; }
.chips--center { justify-content: center; }
.brackets--center { text-align: center; }
.brackets--center .brackets__row { justify-content: center; }

/* Ba bước bắt đầu */
.steps {
  display: grid; gap: var(--gap);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  counter-reset: step;
}
.step {
  position: relative;
  padding: 1.6rem 1.5rem 1.5rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg);
}
.step__num {
  display: grid; place-items: center;
  width: 40px; height: 40px; margin-bottom: 1rem;
  border-radius: 50%;
  background: linear-gradient(140deg, #e3c766, #b8901c);
  color: #221a05; font-family: var(--font-display); font-size: 1.2rem; font-weight: 600;
}
.step h3 { font-size: 1.08rem; margin-bottom: .45rem; }
.step p { font-size: .92rem; color: var(--ink-2); }
.step code {
  font-family: var(--font-mono); font-size: .85em;
  background: var(--surface-2); padding: .1em .35em; border-radius: 4px;
}

/* --- 8. Thẻ người đẹp ---------------------------------------------------- */
/* Bố cục học theo các trang thi nhan sắc Việt Nam: ảnh chân dung khổ dọc chiếm
   phần lớn thẻ, danh hiệu và số đo nằm gọn bên dưới. */
.pcard {
  position: relative;
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: transform .28s var(--ease), box-shadow .28s var(--ease), border-color .28s;
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: transparent; }

.pcard__photo {
  position: relative; display: block;
  aspect-ratio: 3 / 4;              /* khổ chân dung, đúng chuẩn ảnh dự thi */
  overflow: hidden;
  background: linear-gradient(150deg, color-mix(in srgb, var(--brand) 26%, var(--surface-2)), var(--surface-2));
}
.pcard__photo img {
  width: 100%; height: 100%; object-fit: cover; object-position: center 22%;
  transition: transform .6s var(--ease);
}
.pcard:hover .pcard__photo img { transform: scale(1.05); }

/* Lớp phủ chân ảnh để huy hiệu và tên luôn đọc được trên nền ảnh sáng */
.pcard__photo::after {
  content: ""; position: absolute; inset: auto 0 0 0; height: 42%;
  background: linear-gradient(to top, rgb(15 11 9 / .5), transparent);
  pointer-events: none;
}

.pcard__photo-blank {
  display: grid; place-items: center; width: 100%; height: 100%;
  font-family: var(--font-display); font-size: 3.4rem; color: #fff;
  background: linear-gradient(152deg,
    color-mix(in srgb, var(--brand) 88%, #fff 12%),
    color-mix(in srgb, var(--brand) 58%, #000 42%));
  text-shadow: 0 2px 6px rgb(0 0 0 / .2);
}

/* Vòng nguyệt quế kèm thứ hạng — dấu hiệu quen thuộc của các trang bình chọn */
.laurel {
  position: absolute; left: .7rem; top: .7rem; z-index: 2;
  display: inline-flex; align-items: center; gap: .18rem;
  padding: .28rem .6rem .28rem .45rem;
  border-radius: var(--radius-pill);
  background: rgb(20 16 13 / .58);
  backdrop-filter: blur(6px);
  color: #fff; font-size: .82rem; line-height: 1;
}
.laurel b { font-family: var(--font-display); font-weight: 600; font-size: .95rem; }
.laurel .icon { width: 1.05em; height: 1.05em; }
.laurel--top { background: linear-gradient(140deg, #e3c766, #b8901c); color: #221a05; }

.pcard__verified {
  position: absolute; right: .7rem; top: .7rem; z-index: 2;
  display: grid; place-items: center;
  width: 26px; height: 26px; border-radius: 50%;
  background: #fff; color: #2f6df6;
  box-shadow: var(--shadow-sm);
}

.pcard__body { padding: .95rem 1.05rem 1.1rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }

.pcard__award {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: .76rem; letter-spacing: .05em; text-transform: uppercase;
  font-weight: 600; color: var(--warn);
}
.pcard__name { font-family: var(--font-display); font-size: 1.22rem; font-weight: 500; line-height: 1.2; }
.pcard__name a { text-decoration: none; }
.pcard__name a:hover { color: var(--brand); }
.pcard__tagline {
  font-size: .87rem; color: var(--ink-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

/* Bảng số đo — kiểu trình bày thông số thí sinh */
.pcard__specs {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .1rem .8rem; margin: .15rem 0;
  padding: .55rem .7rem;
  background: var(--surface-2); border-radius: var(--radius-sm);
}
.pcard__specs:empty { display: none; }
.pcard__specs > div { min-width: 0; }
.pcard__specs-wide { grid-column: 1 / -1; }
.pcard__specs dt { font-size: .66rem; letter-spacing: .09em; text-transform: uppercase; color: var(--ink-3); }
.pcard__specs dd {
  margin: 0; font-family: var(--font-display); font-size: 1.02rem; line-height: 1.3;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pcard__specs dd small { font-family: var(--font-sans); font-size: .68rem; color: var(--ink-3); margin-left: .12em; }

.pcard__foot {
  margin-top: auto; padding-top: .75rem; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between;
  font-size: .83rem; color: var(--ink-3);
}
.pcard__link { color: var(--brand); text-decoration: none; font-weight: 550; }

/* Ba hồ sơ đầu bảng được viền vàng để nổi khỏi lưới */
.pcard--ranked { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); }

/* --- 9. Thẻ bài viết ----------------------------------------------------- */
.postcard {
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius-lg); overflow: hidden;
  transition: transform .25s var(--ease), box-shadow .25s var(--ease);
}
.postcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.postcard__cover { aspect-ratio: 16 / 9; overflow: hidden; }
.postcard__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.postcard:hover .postcard__cover img { transform: scale(1.04); }

.postcard__body { padding: 1.1rem 1.2rem 1.2rem; display: flex; flex-direction: column; gap: .55rem; flex: 1; }
.postcard__kicker { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--brand); font-weight: 600; }
.postcard__title { font-family: var(--font-display); font-size: 1.24rem; font-weight: 500; line-height: 1.28; }
.postcard__title a { text-decoration: none; }
.postcard__title a:hover { color: var(--brand); }
.postcard__excerpt { font-size: .9rem; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.postcard__foot {
  margin-top: auto; padding-top: .85rem; border-top: 1px solid var(--line-2);
  display: flex; align-items: center; justify-content: space-between; gap: .6rem;
  font-size: .8rem; color: var(--ink-3);
}
.postcard__author { display: flex; align-items: center; gap: .45rem; text-decoration: none; color: var(--ink-2); }
.postcard__author:hover { color: var(--brand); }
.postcard__date { white-space: nowrap; }

/* --- 10. Chip, thẻ phân loại --------------------------------------------- */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .42rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface); font-size: .87rem;
  text-decoration: none;
  transition: border-color .15s, background-color .15s, color .15s;
}
.chip:hover { border-color: var(--ink-3); }
.chip.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip em { font-style: normal; font-size: .74rem; opacity: .6; }
.chips--lg .chip { padding: .55rem 1.05rem; font-size: .95rem; }

.taglist { display: flex; flex-wrap: wrap; gap: .4rem; }
.taglist li > * {
  display: inline-block; padding: .22rem .6rem;
  border-radius: var(--radius-pill); background: var(--surface-2);
  font-size: .78rem; color: var(--ink-2); text-decoration: none;
}
.taglist li > a:hover { background: color-mix(in srgb, var(--brand) 18%, var(--surface-2)); color: var(--ink); }
.taglist--sm li > * { font-size: .72rem; padding: .18rem .5rem; }

.brackets { margin-top: 2.2rem; }
.brackets__title { font-size: .95rem; color: var(--ink-3); font-weight: 500; margin-bottom: .7rem; }
.brackets__row { display: flex; flex-wrap: wrap; gap: .5rem; }
.bracket {
  padding: .45rem 1rem; border: 1px solid var(--line);
  border-radius: var(--radius-pill); background: var(--surface);
  font-size: .88rem; text-decoration: none; white-space: nowrap;
}
.bracket:hover { border-color: var(--ink-3); }
.bracket.is-on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* --- 11. Bộ lọc ---------------------------------------------------------- */
.filters { margin-bottom: 1.5rem; }
.filters__search { display: flex; gap: .6rem; }
.filters__search input {
  flex: 1; min-width: 0;
  padding: .7rem 1.05rem;
  border: 1px solid var(--line); border-radius: var(--radius-pill);
  background: var(--surface);
}
.filters__search input:focus { outline: 2px solid var(--brand); outline-offset: 1px; border-color: transparent; }

.filters__row { display: flex; flex-wrap: wrap; gap: 1.5rem 2.5rem; margin-bottom: 1.2rem; }
.filterset { border: 0; padding: 0; margin: 0; min-width: 0; }
.filterset legend {
  padding: 0 0 .55rem; font-size: .78rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-3); font-weight: 600;
}
.filterset--wide { margin-bottom: 1.5rem; }
.filters__reset { margin-bottom: 1.5rem; font-size: .87rem; }
.filters__reset a { color: var(--ink-3); }

/* --- 12. Mẫu giao diện --------------------------------------------------- */
.theme-card {
  display: flex; flex-direction: column;
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; text-decoration: none; background: var(--surface);
  transition: transform .2s var(--ease), box-shadow .2s var(--ease);
}
.theme-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.theme-card__preview {
  position: relative; aspect-ratio: 4 / 3;
  background: linear-gradient(160deg, var(--c1), color-mix(in srgb, var(--c1) 70%, var(--c2)));
}
.theme-card__bar {
  position: absolute; left: 14%; right: 40%; top: 34%; height: 7%;
  border-radius: 3px; background: var(--c3); opacity: .9;
}
.theme-card__bar--2 { top: 48%; right: 24%; height: 5%; opacity: .5; }
.theme-card__dot {
  position: absolute; left: 14%; top: 14%;
  width: 16%; aspect-ratio: 1; border-radius: 50%; background: var(--c2);
}
.theme-card__body { padding: .85rem 1rem 1.05rem; display: flex; flex-direction: column; gap: .3rem; }
.theme-card__body strong { font-family: var(--font-display); font-size: 1.08rem; font-weight: 500; }
.theme-card__body small { font-size: .81rem; color: var(--ink-3); line-height: 1.45; }

.themes-list { display: flex; flex-direction: column; gap: 2.5rem; margin-bottom: 3.5rem; }
.theme-detail {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.5rem, 4vw, 3rem); align-items: center;
  padding-bottom: 2.5rem; border-bottom: 1px solid var(--line);
  scroll-margin-top: 90px;
}
.theme-detail:nth-child(even) .theme-detail__preview { order: 2; }
.theme-detail__preview {
  aspect-ratio: 4 / 3; border-radius: var(--radius-lg); overflow: hidden;
  box-shadow: var(--shadow-lg);
  background: linear-gradient(165deg, var(--c1), color-mix(in srgb, var(--c1) 65%, var(--c2)));
}
.theme-detail__body h2 { font-family: var(--font-display); font-size: 1.8rem; font-weight: 400; }
.theme-detail__desc { margin: .7rem 0 1.4rem; color: var(--ink-2); }
.theme-detail__meta { display: grid; gap: .8rem; margin-bottom: 1.6rem; }
.theme-detail__meta dt { font-size: .74rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); }
.theme-detail__meta dd { margin: .15rem 0 0; font-size: .93rem; }

@media (max-width: 780px) {
  .theme-detail { grid-template-columns: 1fr; }
  .theme-detail:nth-child(even) .theme-detail__preview { order: 0; }
}

/* Ảnh giả lập bố cục bên trong thẻ xem trước */
.mock { position: relative; display: block; width: 100%; height: 100%; }
.mock__cover  { position: absolute; inset: 0 0 62% 0; background: color-mix(in srgb, var(--c2) 45%, transparent); }
.mock__avatar { position: absolute; left: 8%; top: 26%; width: 15%; aspect-ratio: 1; border-radius: 50%; background: var(--c3); box-shadow: 0 0 0 3px var(--c1); }
.mock__line   { position: absolute; left: 8%; right: 30%; height: 4%; border-radius: 3px; background: var(--c3); opacity: .35; }
.mock__line--title { top: 48%; right: 42%; height: 6.5%; opacity: .85; }
.mock__line:nth-of-type(4) { top: 59%; }
.mock__line--short { top: 66%; right: 55%; }
.mock__card { position: absolute; bottom: 8%; width: 38%; height: 16%; border-radius: 4px; background: var(--c3); opacity: .28; }
.mock__card:nth-of-type(6) { left: 8%; }
.mock__card:nth-of-type(7) { right: 8%; }

.mock--hero .mock__cover { inset: 0 0 40% 0; }
.mock--hero .mock__avatar { left: 42%; top: 22%; }
.mock--hero .mock__line--title { left: 20%; right: 20%; top: 52%; }
.mock--split .mock__cover { inset: 0 55% 0 0; }
.mock--split .mock__avatar { left: 12%; top: 18%; }
.mock--split .mock__line { left: 50%; right: 8%; }
.mock--split .mock__line--title { top: 26%; }
.mock--stack .mock__cover { inset: 0 0 82% 0; }
.mock--stack .mock__avatar { left: 8%; top: 10%; width: 11%; }
.mock--editorial .mock__cover { inset: 0 0 55% 0; }
.mock--editorial .mock__avatar { left: 70%; top: 40%; }
.mock--editorial .mock__line { left: 8%; right: 38%; }

.accents { padding-block: 2rem 3rem; }
.accents__row { display: flex; flex-wrap: wrap; gap: 1.2rem; margin-top: 1.2rem; }
.accents__row li { display: flex; align-items: center; gap: .5rem; font-size: .88rem; }
.swatch { width: 26px; height: 26px; border-radius: 50%; background: var(--sw); box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12); flex: none; }

/* --- 13. Trạng thái rỗng, phân trang, thông báo -------------------------- */
.empty {
  text-align: center; padding: clamp(2.5rem, 8vw, 5rem) 1rem;
  border: 1px dashed var(--line); border-radius: var(--radius-lg);
  background: var(--surface);
}
.empty__icon { font-size: 2.2rem; margin-bottom: .6rem; }
.empty h3 { font-family: var(--font-display); font-size: 1.35rem; font-weight: 400; margin-bottom: .4rem; }
.empty p { color: var(--ink-3); margin-bottom: 1.2rem; }

.pagination {
  display: flex; align-items: center; justify-content: center; gap: 1.2rem;
  margin-block: 2.5rem 3.5rem;
}
.pagination__step {
  padding: .5rem 1.1rem; border: 1px solid var(--line);
  border-radius: var(--radius-pill); text-decoration: none; font-size: .9rem;
  background: var(--surface);
}
.pagination__step:hover { border-color: var(--ink-3); }
.pagination__step.is-disabled { opacity: .38; pointer-events: none; }
.pagination__info { font-size: .88rem; color: var(--ink-3); }

.flash {
  display: flex; align-items: center; gap: .8rem;
  margin-top: 1rem; padding: .8rem 1.1rem;
  border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: .92rem;
}
.flash--success { border-left: 3px solid var(--success); }
.flash--error   { border-left: 3px solid var(--danger); }
.flash--info    { border-left: 3px solid var(--brand); }
.flash span { flex: 1; }
.flash__close { background: none; border: 0; font-size: 1.3rem; line-height: 1; cursor: pointer; color: var(--ink-3); }

.notice {
  padding: .9rem 1.15rem; border-radius: var(--radius);
  background: var(--surface-2); border: 1px solid var(--line);
  font-size: .92rem; margin-bottom: 1.5rem;
}
.notice--warn  { border-left: 3px solid var(--warn); }
.notice--error { border-left: 3px solid var(--danger); }

.badge {
  display: inline-block; padding: .12rem .55rem;
  border-radius: var(--radius-pill); font-size: .72rem; font-weight: 600;
  letter-spacing: .02em; vertical-align: middle;
}
.badge--live  { background: color-mix(in srgb, var(--success) 16%, transparent); color: var(--success); }
.badge--draft { background: var(--surface-2); color: var(--ink-3); border: 1px solid var(--line); }

/* --- 14. CTA và chân trang ----------------------------------------------- */
.cta {
  background: var(--ink); color: var(--bg);
  padding-block: clamp(3rem, 8vw, 5rem); text-align: center;
}
.cta__inner { display: flex; flex-direction: column; align-items: center; gap: 1rem; }
.cta .icon--laurel { width: 2.6rem; height: 2.6rem; color: color-mix(in srgb, var(--warn) 75%, #fff); }
.cta h2 { font-family: var(--font-display); font-size: clamp(1.7rem, 4vw, 2.5rem); font-weight: 400; }
.cta p { color: color-mix(in srgb, var(--bg) 72%, var(--ink)); max-width: 54ch; }
.cta .btn--primary { background: var(--bg); color: var(--ink); }
.cta .btn--primary:hover { background: var(--brand); color: #fff; }

.site-footer { border-top: 1px solid var(--line); background: var(--surface-2); padding-block: 3rem 1.5rem; margin-top: auto; }
.site-footer__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); gap: 2.5rem; }
.site-footer__brand { display: flex; gap: .8rem; align-items: flex-start; }
.site-footer__brand strong { font-family: var(--font-display); font-size: 1.1rem; }
.site-footer__brand span { font-size: .85rem; color: var(--ink-3); }
.site-footer__links { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1.5rem; }
.site-footer__links h3 { font-size: .76rem; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: .7rem; }
.site-footer__links a { display: block; font-size: .89rem; text-decoration: none; color: var(--ink-2); padding-block: .22rem; }
.site-footer__links a:hover { color: var(--brand); }
.site-footer__legal { margin-top: 2.5rem; padding-top: 1.2rem; border-top: 1px solid var(--line); font-size: .82rem; color: var(--ink-3); }

@media (max-width: 720px) { .site-footer__inner { grid-template-columns: 1fr; } }

body.app { display: flex; flex-direction: column; min-height: 100vh; }
body.app > main { flex: 1; }

/* --- 15. Bài viết dạng văn xuôi ------------------------------------------ */
.prose { font-size: 1.06rem; line-height: 1.75; color: var(--ink-2); }
.prose > * + * { margin-top: 1.15em; }
.prose h1 { font-family: var(--font-display); font-size: clamp(1.9rem, 4.5vw, 2.7rem); font-weight: 400; color: var(--ink); margin-top: 0; }
.prose h2 { font-family: var(--font-display); font-size: 1.6rem; font-weight: 500; color: var(--ink); margin-top: 2em; }
.prose h3 { font-size: 1.22rem; color: var(--ink); margin-top: 1.7em; }
.prose .lead { font-size: 1.2rem; color: var(--ink); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose ul li { list-style: disc; margin-block: .35em; }
.prose ol li { list-style: decimal; margin-block: .35em; }
.prose a { color: var(--brand); }
.prose blockquote {
  margin-inline: 0; padding: .3em 0 .3em 1.3em;
  border-left: 3px solid var(--brand);
  font-family: var(--font-display); font-size: 1.15em; font-style: italic; color: var(--ink);
}
.prose img { border-radius: var(--radius); margin-inline: auto; }
.prose figure figcaption { text-align: center; font-size: .85rem; color: var(--ink-3); margin-top: .5rem; }
.prose code {
  font-family: var(--font-mono); font-size: .87em;
  background: var(--surface-2); padding: .15em .4em; border-radius: var(--radius-sm);
}
.prose pre {
  background: var(--surface-2); padding: 1rem 1.15rem;
  border-radius: var(--radius); overflow-x: auto; border: 1px solid var(--line);
}
.prose pre code { background: none; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.prose th, .prose td { padding: .55rem .7rem; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 600; color: var(--ink); }
.prose__cta { margin-top: 2.5rem; }

/* --- 16. Trang đăng nhập / lỗi ------------------------------------------- */
body.bare { display: grid; place-items: center; min-height: 100vh; padding: 2rem 1rem; }
.bare-shell { width: min(100%, 460px); display: flex; flex-direction: column; gap: 1.6rem; align-items: center; }
.bare-logo { display: flex; align-items: center; gap: .6rem; text-decoration: none; font-family: var(--font-display); font-size: 1.2rem; }
.bare-foot { font-size: .85rem; color: var(--ink-3); }
.bare-foot a { color: inherit; }

.authcard {
  width: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  padding: clamp(1.5rem, 5vw, 2.4rem); box-shadow: var(--shadow-lg);
  text-align: center;
}
.authcard__title { font-family: var(--font-display); font-size: 1.6rem; font-weight: 400; }
.authcard__sub { color: var(--ink-3); margin: .6rem 0 1.6rem; font-size: .95rem; }
.authcard .form { text-align: left; }
.authcard__perks { margin-top: 1.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line-2); text-align: left; display: grid; gap: .55rem; }
.authcard__perks li { font-size: .87rem; color: var(--ink-2); padding-left: 1.4rem; position: relative; }
.authcard__perks li::before { content: "✓"; position: absolute; left: 0; color: var(--success); font-weight: 700; }
.authcard__legal { margin-top: 1.4rem; font-size: .78rem; color: var(--ink-3); line-height: 1.5; }
.authcard__actions { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; }
.authcard code { font-family: var(--font-mono); font-size: .85em; background: var(--surface-2); padding: .1em .35em; border-radius: 4px; }
.errcode { font-family: var(--font-display); font-size: 3.6rem; color: var(--brand); line-height: 1; margin-bottom: .3rem; }

/* --- 17. Bảng điều khiển ------------------------------------------------- */
.dash-shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 2.5rem; padding-block: 2rem 4rem; }

.dash-nav { position: sticky; top: 88px; align-self: start; }
.dash-nav__title { font-size: .74rem; letter-spacing: .11em; text-transform: uppercase; color: var(--ink-3); font-weight: 600; margin-bottom: .8rem; }
.dash-nav nav { display: flex; flex-direction: column; gap: .15rem; }
.dash-nav nav a {
  display: flex; align-items: center; gap: .65rem;
  padding: .58rem .8rem; border-radius: var(--radius-sm);
  text-decoration: none; font-size: .93rem; color: var(--ink-2);
}
.dash-nav nav a:hover { background: var(--surface-2); color: var(--ink); }
.dash-nav nav a.is-active { background: var(--ink); color: var(--bg); font-weight: 550; }
.dash-nav__view { display: block; margin-top: 1.2rem; font-size: .85rem; color: var(--brand); text-decoration: none; }

.dash-main { min-width: 0; }
.dash-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.dash-head h1 { font-family: var(--font-display); font-size: clamp(1.6rem, 3.5vw, 2.2rem); font-weight: 400; }
.dash-head p { color: var(--ink-3); font-size: .92rem; margin-top: .3rem; }

@media (max-width: 900px) {
  .dash-shell { grid-template-columns: 1fr; gap: 1.5rem; }
  .dash-nav { position: static; }
  .dash-nav nav { flex-direction: row; overflow-x: auto; gap: .35rem; padding-bottom: .4rem; }
  .dash-nav nav a { white-space: nowrap; }
}

.statgrid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem 1.2rem; }
.stat__value { font-family: var(--font-display); font-size: 1.9rem; line-height: 1.1; }
.stat__label { font-size: .8rem; color: var(--ink-3); margin-top: .25rem; }

.dash-cols { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: 1.5rem; }
@media (max-width: 860px) { .dash-cols { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 1.3rem 1.4rem; margin-bottom: 1.5rem;
}
.panel--flush { padding: 0; overflow: hidden; }
.panel--danger { border-color: color-mix(in srgb, var(--danger) 35%, var(--line)); }
.panel__head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1.1rem; flex-wrap: wrap; }
.panel--flush .panel__head { padding: 1.3rem 1.4rem 0; }
.panel__head h2 { font-size: 1.05rem; font-weight: 600; }
.panel__head a { font-size: .87rem; color: var(--brand); text-decoration: none; }
.panel__hint { font-size: .82rem; color: var(--ink-3); }
.panel__empty { color: var(--ink-3); font-size: .92rem; }
.panel > p + p { margin-top: .7rem; }

.rowlist { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; gap: 1rem; padding: .8rem 0; border-bottom: 1px solid var(--line-2); }
.row:last-child { border-bottom: 0; }
.row__main { min-width: 0; flex: 1; }
.row__title { font-weight: 550; text-decoration: none; }
.row__title:hover { color: var(--brand); }
.row__meta { font-size: .8rem; color: var(--ink-3); margin-top: .2rem; }
.row__action { color: var(--ink-3); }
.row__action:hover { color: var(--brand); }

.checklist { display: flex; flex-direction: column; gap: .55rem; }
.checklist__item { display: flex; align-items: center; gap: .6rem; font-size: .92rem; }
.checklist__mark { width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-2); color: var(--ink-3); font-size: .75rem; flex: none; }
.checklist__item.is-done .checklist__mark { background: color-mix(in srgb, var(--success) 18%, transparent); color: var(--success); }
.checklist__item.is-done { color: var(--ink-3); }
.checklist__item a { color: var(--ink); }

.deflist { display: grid; gap: .9rem; }
.deflist > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: .8rem; align-items: baseline; }
.deflist dt { font-size: .82rem; color: var(--ink-3); }
.deflist dd { margin: 0; font-size: .94rem; display: flex; align-items: center; gap: .45rem; }
@media (max-width: 560px) { .deflist > div { grid-template-columns: 1fr; gap: .15rem; } }

/* --- 18. Bảng ------------------------------------------------------------ */
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th {
  text-align: left; font-size: .74rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-3); font-weight: 600; padding: .8rem 1.4rem; border-bottom: 1px solid var(--line);
}
.table td { padding: .85rem 1.4rem; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.table tr:last-child td { border-bottom: 0; }
.table__title { font-weight: 550; text-decoration: none; }
.table__title:hover { color: var(--brand); }
.table__sub { font-size: .78rem; color: var(--ink-3); margin-top: .15rem; font-family: var(--font-mono); }
.table__actions { display: flex; gap: .8rem; font-size: .85rem; white-space: nowrap; }
.table__actions a { color: var(--ink-2); }
.table .num { font-variant-numeric: tabular-nums; }
.table .muted { color: var(--ink-3); font-size: .85rem; }
@media (max-width: 700px) {
  .table thead { display: none; }
  .table tr { display: grid; gap: .35rem; padding: 1rem 1.2rem; border-bottom: 1px solid var(--line-2); }
  .table td { border: 0; padding: 0; }
}

/* --- 19. Biểu mẫu -------------------------------------------------------- */
.form { max-width: 780px; }
.field { margin-bottom: 1.2rem; }
.field > label { display: block; font-size: .87rem; font-weight: 550; margin-bottom: .4rem; }
.req { color: var(--danger); }

.field input[type="text"], .field input[type="url"], .field input[type="email"],
.field input[type="date"], .field input[type="number"], .field input[type="search"],
.field input[type="password"], .field select, .field textarea, .filters__search input {
  width: 100%; padding: .62rem .85rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: 0; border-color: var(--brand);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 22%, transparent);
}
.field textarea { resize: vertical; min-height: 6rem; line-height: 1.6; }
.field input[type="file"] { width: 100%; font-size: .87rem; padding: .5rem 0; }

.field__prefix { display: flex; align-items: stretch; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.field__prefix span { display: flex; align-items: center; padding: 0 .7rem; background: var(--surface-2); color: var(--ink-3); font-size: .87rem; font-family: var(--font-mono); border-right: 1px solid var(--line); white-space: nowrap; }
.field__prefix input { border: 0 !important; border-radius: 0 !important; box-shadow: none !important; min-width: 0; }
.field__prefix-post {
  border-right: 0 !important; border-left: 1px solid var(--line);
  font-weight: 550; color: var(--ink-2);
}
.field__prefix--stack { flex-direction: column; }
.field__prefix--stack span { border-right: 0; border-bottom: 1px solid var(--line); padding: .35rem .7rem; }

.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; gap: 0; } }

.hint { font-size: .8rem; color: var(--ink-3); margin-top: .35rem; line-height: 1.45; }
.hint--note { margin-top: 1rem; padding: .6rem .8rem; background: var(--surface-2); border-radius: var(--radius-sm); }
.field__err { font-size: .82rem; color: var(--danger); margin-top: .35rem; }

.form__actions { display: flex; gap: .8rem; align-items: center; margin-block: 1.8rem 3rem; flex-wrap: wrap; }
.danger-form { margin-top: 1rem; }

.checkgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(155px, 1fr)); gap: .5rem; }
.checkgrid--tight { grid-template-columns: 1fr; gap: .3rem; }
.checkchip { display: flex; align-items: center; gap: .5rem; padding: .5rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm); cursor: pointer; font-size: .88rem; transition: border-color .15s, background-color .15s; }
.checkchip:hover { border-color: var(--ink-3); }
.checkchip input { accent-color: var(--brand); flex: none; }
.checkchip:has(input:checked) { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 9%, transparent); }
.checkchip--sm { font-size: .84rem; padding: .35rem .55rem; }

.switch { display: flex; align-items: flex-start; gap: .85rem; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch__track { width: 46px; height: 26px; border-radius: 999px; background: var(--line); position: relative; flex: none; transition: background-color .2s var(--ease); margin-top: .15rem; }
.switch__knob { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .2s var(--ease); }
.switch input:checked + .switch__track { background: var(--success); }
.switch input:checked + .switch__track .switch__knob { transform: translateX(20px); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--brand); outline-offset: 2px; }
.switch__label strong { display: block; font-size: .93rem; }
.switch__label small { display: block; font-size: .82rem; color: var(--ink-3); margin-top: .2rem; max-width: 52ch; }

/* Chọn giao diện trong biểu mẫu hồ sơ */
.themepick { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: .7rem; margin-bottom: 1.3rem; }
.themepick__opt input { position: absolute; opacity: 0; }
.themepick__card { display: flex; flex-direction: column; gap: .5rem; padding: .7rem; border: 1px solid var(--line); border-radius: var(--radius); cursor: pointer; font-size: .87rem; }
.themepick__swatch { height: 46px; border-radius: var(--radius-sm); background: linear-gradient(140deg, var(--c1) 40%, var(--c2) 70%, var(--c3)); }
.themepick__opt input:checked + .themepick__card { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 30%, transparent); }
.themepick__opt input:focus-visible + .themepick__card { outline: 2px solid var(--brand); outline-offset: 2px; }

.accentpick { display: flex; flex-wrap: wrap; gap: .6rem; }
.accentpick__opt { cursor: pointer; display: flex; align-items: center; gap: .45rem; }
.accentpick__opt input { position: absolute; opacity: 0; }
.accentpick__opt input:checked + .swatch { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--ink); }
.accentpick__opt input:focus-visible + .swatch { outline: 2px solid var(--brand); outline-offset: 3px; }
.accentpick--lg { gap: 1rem; }
.accentpick--lg .accentpick__opt { flex-direction: column; gap: .35rem; font-size: .78rem; text-align: center; }
.accentpick__name { color: var(--ink-3); }

/* Chọn giao diện ở trang riêng */
.themegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 1.2rem; margin-bottom: 2rem; }
.themebig { display: flex; flex-direction: column; cursor: pointer; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); transition: border-color .2s, box-shadow .2s, transform .2s var(--ease); }
.themebig:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.themebig input { position: absolute; opacity: 0; }
.themebig:has(input:checked) { border-color: var(--brand); box-shadow: 0 0 0 2px color-mix(in srgb, var(--brand) 32%, transparent); }
.themebig__preview { display: block; aspect-ratio: 4 / 3; background: linear-gradient(165deg, var(--c1), color-mix(in srgb, var(--c1) 65%, var(--c2))); }
.themebig__body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; }
.themebig__body strong { font-family: var(--font-display); font-size: 1.1rem; font-weight: 500; }
.themebig__body small { font-size: .82rem; color: var(--ink-3); line-height: 1.45; }
.themebig__vibe { font-size: .74rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brand); margin-top: .35rem; }

/* Ảnh trong bảng điều khiển */
.imgrow { display: grid; grid-template-columns: 1fr 1.6fr; gap: 1.5rem; }
@media (max-width: 720px) { .imgrow { grid-template-columns: 1fr; } }
.imgcell { display: flex; flex-direction: column; gap: .9rem; }
.imgcell__preview { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); display: grid; place-items: center; }
.imgcell__preview--avatar { aspect-ratio: 1; max-width: 180px; }
.imgcell__preview--cover { aspect-ratio: 21 / 9; }
.imgcell__preview img { width: 100%; height: 100%; object-fit: cover; }
.imgcell__blank { color: var(--ink-3); font-size: .85rem; }
.imgcell__body h3 { font-size: .95rem; margin-bottom: .25rem; }
.imgcell__body { display: flex; flex-direction: column; gap: .55rem; align-items: flex-start; }

.mediagrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .8rem; }
.mediaitem { margin: 0; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--surface); }
.mediaitem img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.mediaitem figcaption { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .45rem .6rem; font-size: .74rem; color: var(--ink-3); }
.coverprev { border-radius: var(--radius-sm); margin-bottom: .9rem; aspect-ratio: 21 / 9; object-fit: cover; width: 100%; }

/* Trình soạn thảo */
.editor { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 1.8rem; max-width: none; align-items: start; }
@media (max-width: 980px) { .editor { grid-template-columns: 1fr; } }
.editor__main .field textarea { font-family: var(--font-mono); font-size: .92rem; }
.editor__side { position: sticky; top: 88px; }
@media (max-width: 980px) { .editor__side { position: static; } }
.pubrow { display: flex; flex-direction: column; gap: .6rem; }

.mdbar { display: flex; gap: .3rem; margin-bottom: .4rem; flex-wrap: wrap; }
.mdbar button {
  min-width: 34px; height: 32px; padding: 0 .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); cursor: pointer; font-size: .88rem;
}
.mdbar button:hover { border-color: var(--ink-3); background: var(--surface-2); }

.uploadform { max-width: 560px; }
.owner-bar {
  display: flex; align-items: center; gap: .8rem; flex-wrap: wrap;
  margin-block: 1.2rem; padding: .75rem 1.1rem;
  background: var(--surface-2); border: 1px dashed var(--line);
  border-radius: var(--radius); font-size: .89rem;
}
.owner-bar span { flex: 1; min-width: 200px; }

@media print {
  .site-header, .site-footer, .dash-nav, .btn, .pagination, .flash { display: none !important; }
  body { background: #fff; }
}
