/* Trang quản trị giao diện V12.5: responsive, không ảnh hưởng dữ liệu truyện. */
.tg-theme-hide-realm .realm-bar{display:none!important}
.tg-theme-hide-sidebar .sidebar{display:none!important}
.tg-theme-hide-sidebar .main-grid{grid-template-columns:minmax(0,1fr)!important}
.tg-theme-hide-footer .tg-footer-v122{display:none!important}
.tg-theme-editor{margin:24px 0;color:var(--white)}
.tg-theme-intro{display:flex;justify-content:space-between;align-items:flex-start;gap:18px;margin-bottom:20px}
.tg-theme-intro h2{font:700 27px Georgia,serif;color:var(--gold);margin:7px 0}
.tg-theme-intro p{margin:0;color:var(--muted);max-width:730px;line-height:1.6}
.tg-theme-eyebrow{color:var(--gold);font-size:11px;font-weight:800;letter-spacing:.13em}
.tg-theme-status{font-size:12px;border:1px solid var(--line);padding:8px 12px;border-radius:30px;white-space:nowrap}
.tg-theme-layout{display:grid;grid-template-columns:minmax(0,1fr) 310px;gap:18px;align-items:start}
.tg-theme-controls{min-width:0}.tg-theme-controls details{background:var(--surface);border:1px solid var(--line);border-radius:12px;margin-bottom:13px;overflow:hidden}
.tg-theme-controls summary{cursor:pointer;padding:16px 18px;font-weight:700;color:var(--gold);font-size:16px}.tg-theme-controls details[open] summary{border-bottom:1px solid var(--line)}
.tg-theme-grid{padding:17px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px}
.tg-theme-control{display:flex;flex-direction:column;gap:9px;font-size:13px;font-weight:600;color:var(--white);min-width:0}
.tg-theme-control select,.tg-theme-control input[type=file]{width:100%;min-width:0;background:var(--surface2);border:1px solid var(--line);padding:11px;border-radius:8px;color:var(--white)}
.tg-theme-control select option{background:#182332;color:#fff}
.tg-theme-control input[type=range]{accent-color:var(--gold);cursor:pointer;width:100%}
.tg-theme-colorbox{display:flex;align-items:center;gap:10px;background:var(--surface2);border-radius:8px;padding:5px 10px;border:1px solid var(--line)}
.tg-theme-colorbox input{width:50px;height:37px;cursor:pointer;background:transparent;border:0;padding:2px}
.tg-theme-colorbox code{font-size:12px;color:var(--muted);font-weight:400}
.tg-theme-toggles{display:flex;flex-direction:column;padding:0 17px 16px;gap:12px}
.tg-theme-check{display:flex;align-items:center;gap:10px;font-size:14px}.tg-theme-check input{accent-color:var(--gold);width:18px;height:18px}
.tg-theme-upload .simple-btn{align-self:flex-start;font-size:12px;padding:8px 11px}
.tg-theme-hint{color:var(--muted);line-height:1.5;font-size:12px;margin:5px 0 0;font-weight:400}
.tg-theme-buttons{display:flex;gap:10px;flex-wrap:wrap;align-items:center;margin:16px 0 4px}
.tg-theme-buttons .gold-btn{margin:0}.tg-theme-message{font-size:13px;color:var(--gold);min-height:25px;margin:12px 0}
.tg-theme-preview{position:sticky;top:105px;background:var(--surface);border:1px solid var(--line);padding:14px;border-radius:12px}
.tg-theme-preview h3{font-size:16px;color:var(--gold);margin:3px 0 15px}
.tg-theme-preview-box{border:1px solid var(--line);overflow:hidden;min-height:290px}
.tg-theme-preview-header{font-weight:750;font-size:11px;padding:12px;border-bottom:1px solid var(--line);color:var(--gold)}
.tg-theme-preview-cover{min-height:174px;padding:22px 16px;background:radial-gradient(circle at 80% 20%,var(--gold2),transparent 75%),var(--surface);display:flex;flex-direction:column;align-items:flex-start;gap:8px}
.tg-theme-preview-cover>span:first-child{font-size:10px;color:var(--gold);letter-spacing:.14em}.tg-theme-preview-cover strong{font:bold 23px Georgia,serif;color:var(--white)}
.tg-theme-preview-cover small{font-size:12px;color:var(--muted)}
.tg-theme-preview-button{background:var(--gold);border-radius:9px;color:#17110a!important;padding:6px 12px;font-size:12px;font-weight:bold}
.tg-theme-preview-box h4{color:var(--gold);margin:13px 14px 5px}.tg-theme-preview-box p{color:var(--muted);font-size:12px;margin:0 14px 14px}
@media(max-width:920px){.tg-theme-layout{grid-template-columns:1fr}.tg-theme-preview{position:static}}
@media(max-width:530px){.tg-theme-grid{grid-template-columns:1fr}.tg-theme-intro{flex-direction:column}.tg-theme-editor{margin-top:10px}.tg-theme-intro h2{font-size:23px}.tg-theme-controls summary{font-size:14px}}

/* V12.9 — unified search, public display-mode toggle, editable footer */
.site-header .search{
  display:flex;align-items:center;gap:9px;min-width:0;padding:0 14px;
  border:1px solid rgba(198,159,92,.44);background:var(--surface2);
  border-radius:999px;box-shadow:none;transition:border-color .2s,box-shadow .2s;
}
.site-header .search:focus-within{
  border-color:var(--gold);box-shadow:0 0 0 1px var(--gold)!important;
}
.site-header .search input,
.site-header .search input:focus,
.site-header .search input:focus-visible{
  width:100%;min-width:0;padding:0;margin:0;border:none!important;background:transparent!important;
  outline:none!important;outline-offset:0!important;box-shadow:none!important;appearance:none;
  color:var(--white)!important;
}
.site-header .search input::placeholder{color:var(--muted);opacity:.9}
.site-header .search-icon{flex:0 0 auto;color:var(--gold);font-size:21px}
.tg-mode-toggle{flex:0 0 auto;display:inline-flex;align-items:center;justify-content:center;gap:6px;
  border:1px solid var(--line);background:var(--surface2);color:var(--gold);
  border-radius:999px;padding:9px 12px;min-height:39px;white-space:nowrap;font-size:12px;font-weight:700}
.tg-mode-toggle:hover{border-color:var(--gold);background:var(--surface)}
.tg-mode-toggle:focus-visible{outline:2px solid var(--gold)!important;outline-offset:3px}
.tg-mode-toggle #tgModeIcon{font-size:17px}
@media(min-width:1101px) and (max-width:1600px){
  .header-inner{gap:10px}
  .nav a{padding-inline:5px;font-size:11px}
  .nav{gap:1px}
  .site-header .search{width:185px;min-width:125px}
  .tg-mode-toggle{padding:9px}
  .tg-mode-toggle #tgModeText{display:none}
}
@media(max-width:1100px){
  .tg-mode-toggle{order:3}
  .site-header .search{min-width:0}
}
@media(max-width:740px){
  .tg-mode-toggle{order:1;margin-left:auto}
  .site-header .search{order:2;width:100%;flex:1 1 100%}
}
/* Contact + social links below the existing footer columns. */
.tg-footer-extra{display:grid;grid-template-columns:1fr 1fr;gap:22px;padding:25px 5px;
 border-top:1px solid var(--line);scroll-margin-top:130px}
.tg-footer-extra h2{margin:0 0 12px;font:bold 15px var(--v12-serif);letter-spacing:.035em;color:var(--gold)}
.tg-footer-extra p{color:var(--muted);font-size:13px;line-height:1.75;margin:0 0 10px}
.tg-contact-details{display:flex;flex-wrap:wrap;flex-direction:column;align-items:flex-start;gap:7px}
.tg-contact-details a{display:inline-block;color:var(--white);font-size:13px;overflow-wrap:anywhere}
.tg-contact-details a:hover{color:var(--gold)}
/* V16.29.35.2 — Equal-size premium footer social cards. Configured links stay unchanged. */
.tg-footer-social{min-width:0}
.tg-social-links{
  display:grid;grid-template-columns:repeat(auto-fill,166px);gap:11px;
  justify-content:start;align-items:stretch;
}
.tg-social-links .tg-social-channel{
  box-sizing:border-box;display:grid;grid-template-columns:34px minmax(0,1fr) 15px;
  align-items:center;gap:9px;width:166px;min-width:0;min-height:52px;
  padding:8px 10px 8px 8px;border:1px solid var(--line);
  border-radius:13px;background:linear-gradient(145deg,var(--surface2),var(--surface));
  color:var(--white);text-decoration:none;font-size:13px;font-weight:700;line-height:1.25;
  box-shadow:0 3px 12px rgba(0,0,0,.11);
  transition:border-color .18s,box-shadow .18s,background-color .18s,transform .18s;
}
.tg-social-links .tg-social-channel>span:nth-child(2){min-width:0;overflow-wrap:anywhere}
.tg-social-links .tg-social-channel:hover{
  transform:translateY(-2px);border-color:var(--gold);color:var(--white);
  box-shadow:0 5px 17px rgba(0,0,0,.19),0 0 0 1px var(--line);
}
.tg-social-links .tg-social-channel:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.tg-social-brand{
  box-sizing:border-box;width:34px;height:34px;min-width:34px;
  border-radius:10px;display:grid;place-items:center;
  box-shadow:inset 0 0 0 1px #ffffff35;
}
.tg-social-brand img{display:block;width:21px;height:21px;object-fit:contain;flex:none}
.tg-social-brand--telegram{background:#279bd3}
.tg-social-brand--facebook{background:#1768dc}
.tg-social-brand--zalo{background:#1267e8}
.tg-social-brand--phone{background:#16865c}
.tg-social-brand--instagram{background:linear-gradient(135deg,#843bd1,#da286b 55%,#f6a34b)}
.tg-social-brand--youtube{background:#d9252b}
.tg-social-brand--tiktok{background:#171c26}
.tg-social-arrow{justify-self:center;align-self:center;font-size:16px;line-height:1;color:var(--gold);margin:0}
.tg-social-links>p{grid-column:1/-1}
@media(max-width:740px){
  .tg-footer-extra{grid-template-columns:1fr;padding:21px 5px}
  .tg-social-links{grid-template-columns:repeat(2,minmax(0,1fr));gap:9px}
  .tg-social-links .tg-social-channel{
    width:100%;grid-template-columns:30px minmax(0,1fr) 13px;
    gap:7px;padding:8px 8px 8px 7px;
  }
  .tg-social-brand{width:30px;height:30px;min-width:30px}
  .tg-social-brand img{width:20px;height:20px}
  .tg-social-arrow{font-size:14px}
}
@media(max-width:300px){.tg-social-links{grid-template-columns:minmax(0,1fr)}}
@media(prefers-reduced-motion:reduce){.tg-social-links .tg-social-channel{transition:none}.tg-social-links .tg-social-channel:hover{transform:none}}

/* Admin editor */
.tg-social-form{display:grid;gap:18px;max-width:100%;margin:22px 0}
.tg-social-form fieldset{min-width:0;margin:0;border:1px solid var(--line);border-radius:14px;
 background:var(--surface);padding:18px}
.tg-social-form legend{font-weight:800;color:var(--gold);font-size:16px;padding:0 8px}
.tg-social-field-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:15px}
.tg-social-field{display:grid;gap:7px;min-width:0;color:var(--white);font-weight:600;font-size:13px}
.tg-social-full{grid-column:1/-1}
.tg-social-field input,.tg-social-field textarea{display:block;width:100%;max-width:100%;min-width:0;
 color:var(--white);background:var(--surface2);border:1px solid var(--line);
 border-radius:9px;padding:11px 12px;font:inherit}
.tg-social-field input:focus-visible,.tg-social-field textarea:focus-visible{outline:2px solid var(--gold);outline-offset:1px}
.tg-social-field input::placeholder,.tg-social-field textarea::placeholder{color:var(--muted)}
.tg-social-form .tg-theme-buttons{margin:0}
@media(max-width:620px){.tg-social-field-grid{grid-template-columns:1fr}.tg-social-form fieldset{padding:13px}}

/* Bright mode, every page including editor, member area and SEO book detail. */
html[data-tg-mode="light"]{color-scheme:light;--v12-shadow:0 12px 30px rgba(58,48,25,.12)}
html[data-tg-mode="light"] body::before{opacity:.08}
html[data-tg-mode="light"] .realm-bar{background:linear-gradient(90deg,#ede6d5,#faf9f3,#ede6d5);border-color:var(--line)}
html[data-tg-mode="light"] .realm-bar-inner,html[data-tg-mode="light"] .realm-bar-inner span:nth-child(2){color:var(--gold)}
html[data-tg-mode="light"] .site-header{background:rgba(253,251,247,.98)!important;box-shadow:0 8px 20px rgba(77,58,32,.1)}
html[data-tg-mode="light"] .nav a{color:var(--white)}
html[data-tg-mode="light"] .nav a:hover,html[data-tg-mode="light"] .nav a.active{color:var(--gold);background:rgba(179,139,80,.09)}
html[data-tg-mode="light"] .nav .member-nav{background:#f0e8d9;border-color:var(--line)}
html[data-tg-mode="light"] .brand,html[data-tg-mode="light"] .brand em{color:var(--gold)}
html[data-tg-mode="light"] .section-title h2,html[data-tg-mode="light"] .sidebar-panel h3,
html[data-tg-mode="light"] .detail-card h1,html[data-tg-mode="light"] .chapter-list h2,
html[data-tg-mode="light"] .reader-head h1,html[data-tg-mode="light"] .tg-search-page h1,
html[data-tg-mode="light"] .tg-rank-page h1,html[data-tg-mode="light"] .tg-ranking-cols h2,
html[data-tg-mode="light"] .admin-heading h1,html[data-tg-mode="light"] .member-art h1,
html[data-tg-mode="light"] .tg-community-shell h2{color:var(--gold);text-shadow:none}
html[data-tg-mode="light"] .featured,html[data-tg-mode="light"] .comic-card,
html[data-tg-mode="light"] .mini-card,html[data-tg-mode="light"] .latest-card,
html[data-tg-mode="light"] .sidebar-panel,html[data-tg-mode="light"] .detail-card,
html[data-tg-mode="light"] .chapter-list,html[data-tg-mode="light"] .member-wrap,
html[data-tg-mode="light"] .member-art,html[data-tg-mode="light"] .reader-gate,
html[data-tg-mode="light"] .member-panel,html[data-tg-mode="light"] .tg-community-shell,
html[data-tg-mode="light"] .tg-comment,html[data-tg-mode="light"] .tg-star,
html[data-tg-mode="light"] .bookshelf-item,html[data-tg-mode="light"] .tg-search-form,
html[data-tg-mode="light"] .tg-ranking-cols section,html[data-tg-mode="light"] .tg-category-form,
html[data-tg-mode="light"] .tg-category-row,html[data-tg-mode="light"] .admin-story-row,
html[data-tg-mode="light"] .banner-admin-row,html[data-tg-mode="light"] .tg-moderation-card,
html[data-tg-mode="light"] .member-profile-form,html[data-tg-mode="light"] .member-security,
html[data-tg-mode="light"] .member-account-v9 .member-profile-field,
html[data-tg-mode="light"] .tg-related-item,html[data-tg-mode="light"] .tg-mega-panel,
html[data-tg-mode="light"] .admin-panel,html[data-tg-mode="light"] .reader-body,
html[data-tg-mode="light"] .tg-theme-controls details,html[data-tg-mode="light"] .tg-theme-preview,
html[data-tg-mode="light"] .tg-footer-v122{background:var(--surface)!important;color:var(--white)!important;border-color:var(--line)!important;box-shadow:var(--v12-shadow)}
html[data-tg-mode="light"] .sidebar-panel{background:var(--surface)!important}
html[data-tg-mode="light"] .mini-card img,html[data-tg-mode="light"] .rank-row img,
html[data-tg-mode="light"] .tg-rank-card img,html[data-tg-mode="light"] .featured img,
html[data-tg-mode="light"] .comic-card img{background:var(--surface2)}
html[data-tg-mode="light"] .card-title,html[data-tg-mode="light"] .comic-card .comic-title,
html[data-tg-mode="light"] .mini-title,html[data-tg-mode="light"] .latest-name,
html[data-tg-mode="light"] .tg-category-row strong,html[data-tg-mode="light"] .tg-rank-card,
html[data-tg-mode="light"] .chapter-row a,html[data-tg-mode="light"] .description,
html[data-tg-mode="light"] .reader-body,html[data-tg-mode="light"] .tg-footer-extra,
html[data-tg-mode="light"] .tg-mega-panel,html[data-tg-mode="light"] .tg-comment{color:var(--white)!important}
html[data-tg-mode="light"] .muted,html[data-tg-mode="light"] .tg-rank-card small,
html[data-tg-mode="light"] .tg-category-row small,html[data-tg-mode="light"] .latest-date{color:var(--muted)!important}
html[data-tg-mode="light"] .genre,html[data-tg-mode="light"] .simple-btn,
html[data-tg-mode="light"] .bookshelf-tab{background:var(--surface2);color:var(--white);border-color:var(--line)}
html[data-tg-mode="light"] .genre:hover,html[data-tg-mode="light"] .genre.current{background:var(--gold);color:#fff}
html[data-tg-mode="light"] .simple-btn:hover{background:#e9d9bc;color:var(--gold)}
html[data-tg-mode="light"] .note{background:#f8f0df;color:var(--gold);border-color:var(--line)}
html[data-tg-mode="light"] .member-form input,html[data-tg-mode="light"] .member-profile-form input,
html[data-tg-mode="light"] .admin-form input,html[data-tg-mode="light"] .admin-form select,
html[data-tg-mode="light"] .admin-form textarea,html[data-tg-mode="light"] .tg-search-form input,
html[data-tg-mode="light"] .tg-search-form select,html[data-tg-mode="light"] .tg-category-form input,
html[data-tg-mode="light"] .tg-comment-form textarea,html[data-tg-mode="light"] .tg-theme-control select,
html[data-tg-mode="light"] .tg-theme-colorbox{background:var(--surface2);border-color:var(--line);color:var(--white)}
html[data-tg-mode="light"] .tg-theme-control select option{background:#fff;color:#24232a}
html[data-tg-mode="light"] .tg-footer-col a,html[data-tg-mode="light"] .tg-footer-about p,
html[data-tg-mode="light"] .tg-footer-bottom p{color:var(--muted)}
html[data-tg-mode="light"] .tg-footer-col a:hover{color:var(--gold)}
html[data-tg-mode="light"] .tg-search-form label,html[data-tg-mode="light"] .tg-category-form label{color:var(--gold)}
html[data-tg-mode="light"] .tg-mega-genre{background:var(--surface2);color:var(--white)}
html[data-tg-mode="light"] .tg-related-item h3{color:var(--gold)}
html[data-tg-mode="light"] .tg-theme-preview-cover{background:var(--surface2)}
html[data-tg-mode="light"] .tg-footer-v122 .tg-footer-extra{background:transparent}
/* Keep the theme toggle visible without forcing header navigation off screen. */
@media(min-width:1101px) and (max-width:1510px){
 .site-header .header-inner{flex-wrap:wrap;column-gap:18px;row-gap:0;padding-block:9px}
 .site-header .brand{order:1}
 .site-header .search{order:2;width:260px;min-width:185px;margin-left:auto}
 .site-header .tg-mode-toggle{order:3}
 .site-header .nav{order:4;flex:1 1 100%;width:100%;justify-content:center;gap:7px;padding:2px 0 0;overflow-x:auto}
 .site-header .nav a{font-size:12px;padding:9px 10px}
 .site-header .nav .member-nav{padding:8px 14px!important}
}
@media(max-width:740px){
 .site-header .tg-mode-toggle{order:1;padding:7px 10px;min-height:35px}
 .site-header .tg-mode-toggle #tgModeText{display:none}
 .site-header .nav{order:3}
}
html[data-tg-mode="light"] .nav .member-nav{color:#6f4a15!important;background:#f2e8d6!important;border-color:rgba(122,86,31,.4)!important}
html[data-tg-mode="light"] .nav .member-nav:hover{background:#e7d6b8!important}
html[data-tg-mode="light"] .tg-footer-secondary{color:var(--gold)!important;border-color:var(--line)}
html[data-tg-mode="light"] .tg-footer-primary{color:#ffffff!important}
@media(min-width:1101px){
 .site-header .header-inner{flex-wrap:wrap;column-gap:18px;row-gap:0;padding-block:9px}
 .site-header .brand{order:1}
 .site-header .search{order:2;width:260px;min-width:185px;margin-left:auto}
 .site-header .tg-mode-toggle{order:3}
 .site-header .nav{order:4;flex:1 1 100%;width:100%;justify-content:center;gap:7px;padding:2px 0 0;overflow-x:auto}
 .site-header .nav a{font-size:12px;padding:9px 10px}
}
@media(min-width:741px) and (max-width:1100px){
 .site-header .nav{order:4;flex:1 1 100%;width:100%}
 .site-header .search{order:2;margin-left:auto}
 .site-header .tg-mode-toggle{order:3}
}
@media(max-width:740px){
 .site-header .nav{order:3;width:100%;flex:1 1 100%}
 .site-header .search{order:2;width:100%;flex:1 1 100%}
}
