/* TruyenTranhX (vn_portal) - Layout F: Minimalist Deck Stylesheet */

:root {
  --brandMain: #c2410c;
  --brandHover: #9a3412;
  --brandTint: #fff3eb;
  --pageCanvas: #faf8f5;
  --cardFill: #ffffff;
  --bodyInk: #1c1917;
  --mutedInk: #78716c;
  --hairline: #e7e2da;
  --cornerSm: 6px;
  --maxDeck: 1120px;
  --fontDisplay: 'Fraunces', Georgia, serif;
  --fontBody: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
  --targetMin: 24px;
}

@media (pointer: coarse) {
  :root {
    --targetMin: 44px;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 1rem;
  scroll-padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
}

body.tx-body {
  margin: 0;
  background-color: var(--pageCanvas);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.94rem;
  line-height: 1.62;
  overflow-wrap: break-word;
  display: flex;
  flex-direction: column;
  min-block-size: 100dvh;
}

img,
video {
  max-inline-size: 100%;
  block-size: auto;
  display: block;
}

:where(a, code) {
  overflow-wrap: anywhere;
}

h1,
h2,
h3 {
  font-family: var(--fontDisplay);
  color: var(--bodyInk);
  line-height: 1.24;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin-top: 0;
}

p,
li {
  text-wrap: pretty;
}

a {
  color: var(--brandMain);
  text-decoration: none;
  transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease, opacity 0.16s ease;
}

a:hover {
  color: var(--brandHover);
}

:focus-visible {
  outline: 2px solid var(--brandMain);
  outline-offset: 2px;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], nav a, label:has(input[type="checkbox"], input[type="radio"])) {
  min-block-size: var(--targetMin);
  min-inline-size: var(--targetMin);
}

.hidden {
  display: none !important;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Native Dialog & Age Gate Containment */
dialog:not([open]),
dialog#age-verify-modal:not([open]) {
  display: none !important;
}

dialog:modal,
dialog#age-verify-modal:modal {
  overscroll-behavior: contain;
}

dialog::backdrop,
dialog#age-verify-modal::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
  background: rgba(28, 25, 23, 0.62);
  backdrop-filter: blur(4px);
}

/* Containers & Shared Primitives */
.tx-deck {
  width: min(var(--maxDeck), calc(100% - 2rem));
  margin-inline: auto;
}

.tx-reading-col {
  width: min(900px, calc(100% - 2rem));
  margin-inline: auto;
}

.tx-narrow {
  width: min(720px, calc(100% - 2rem));
  margin-inline: auto;
}

.tx-main {
  flex: 1 0 auto;
  padding-block: 1.5rem 3rem;
}

.tx-ico {
  width: 1.05rem;
  height: 1.05rem;
  flex-shrink: 0;
}

.tx-muted {
  color: var(--mutedInk);
  font-size: 0.87rem;
}

.tx-rule {
  border: 0;
  border-top: 1px solid var(--hairline);
  margin-block: 1.75rem;
}

/* Minimalist Buttons */
.tx-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.42rem;
  min-height: 2.55rem;
  padding: 0.5rem 1.05rem;
  border-radius: var(--cornerSm);
  border: 1px solid transparent;
  font-family: var(--fontBody);
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.tx-btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.tx-btn-solid {
  background-color: var(--brandMain);
  border-color: var(--brandMain);
  color: #ffffff;
}

.tx-btn-solid:hover:not(:disabled) {
  background-color: var(--brandHover);
  border-color: var(--brandHover);
  color: #ffffff;
}

.tx-btn-line {
  background-color: var(--cardFill);
  border-color: var(--hairline);
  color: var(--bodyInk);
}

.tx-btn-line:hover:not(:disabled) {
  border-color: var(--brandMain);
  color: var(--brandMain);
  background-color: var(--brandTint);
}

.tx-btn-ghost {
  background-color: transparent;
  border-color: var(--hairline);
  color: var(--bodyInk);
}

.tx-btn-ghost:hover:not(:disabled),
.tx-btn-ghost[data-on="1"] {
  border-color: var(--brandMain);
  color: var(--brandMain);
  background-color: var(--brandTint);
}

.tx-btn-text {
  background-color: transparent;
  border-color: transparent;
  color: var(--mutedInk);
  padding-inline: 0.55rem;
}

.tx-btn-text:hover:not(:disabled) {
  color: var(--brandMain);
}

.tx-btn-danger {
  background-color: #ffffff;
  border-color: #fca5a5;
  color: #b91c1c;
}

.tx-btn-danger:hover:not(:disabled) {
  background-color: #fef2f2;
  border-color: #dc2626;
  color: #991b1b;
}

.tx-btn-sm {
  min-height: 2.2rem;
  padding: 0.36rem 0.8rem;
  font-size: 0.82rem;
}

.tx-btn-xs {
  min-height: 2rem;
  padding: 0.25rem 0.65rem;
  font-size: 0.8rem;
}

.tx-btn-full {
  width: 100%;
}

/* Text-First Minimalist Top Bar */
.tx-bar {
  position: sticky;
  top: 0;
  z-index: 60;
  background-color: rgba(250, 248, 245, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}

.tx-bar-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  min-height: 3.85rem;
  padding-block: 0.5rem;
}

.tx-mark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  color: var(--bodyInk);
  flex-shrink: 0;
}

.tx-mark:hover {
  color: var(--brandMain);
}

.tx-mark-name {
  font-family: var(--fontDisplay);
  font-size: 1.38rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.tx-nav {
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.tx-nav::-webkit-scrollbar {
  display: none;
}

.tx-nav-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-block: 0.35rem;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--mutedInk);
  white-space: nowrap;
}

.tx-nav-link:hover,
.tx-nav-link[data-on="1"] {
  color: var(--bodyInk);
}

.tx-nav-link[data-on="1"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background-color: var(--brandMain);
}

.tx-bar-search {
  flex: 0 1 250px;
  min-width: 170px;
}

.tx-search-form {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tx-search-input {
  flex: 1 1 auto;
  min-width: 0;
  height: 2.25rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.84rem;
}

.tx-search-input:focus {
  outline: none;
  border-color: var(--brandMain);
}

.tx-search-btn {
  flex-shrink: 0;
  height: 2.25rem;
  padding: 0 0.78rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
}

.tx-search-btn:hover {
  border-color: var(--brandMain);
  color: var(--brandMain);
}

.tx-bar-acct {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.tx-acct-link,
.tx-acct-btn {
  display: inline-flex;
  align-items: center;
  font-family: var(--fontBody);
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--bodyInk);
  background: transparent;
  border: 0;
  padding: 0.3rem 0.2rem;
  cursor: pointer;
  white-space: nowrap;
}

.tx-acct-link:hover,
.tx-acct-link[data-on="1"],
.tx-acct-btn:hover {
  color: var(--brandMain);
}

.tx-acct-reg {
  color: var(--brandMain);
}

.tx-logout-inline {
  margin: 0;
}

.tx-menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  cursor: pointer;
}

.tx-drawer {
  display: none;
  border-top: 1px solid var(--hairline);
  background-color: var(--cardFill);
}

.tx-drawer[data-open="1"],
.tx-drawer.is-open {
  display: block;
}

.tx-drawer-inner {
  padding-block: 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tx-drawer-links {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem 1rem;
}

.tx-drawer-link {
  padding: 0.45rem 0;
  border-bottom: 1px solid var(--hairline);
  color: var(--bodyInk);
  font-size: 0.9rem;
  font-weight: 500;
}

.tx-drawer-link[data-on="1"] {
  color: var(--brandMain);
  font-weight: 700;
}

.tx-drawer-acct {
  display: flex;
  gap: 0.6rem;
}

.tx-drawer-acct > * {
  flex: 1 1 0;
}

.tx-drawer-acct form {
  margin: 0;
  display: flex;
}

.tx-drawer-acct form button {
  width: 100%;
}

@media (max-width: 1020px) {
  .tx-nav {
    display: none;
  }

  .tx-menu-toggle {
    display: inline-flex;
  }
}

/* Mobile Header <= 768px: Two-row flex search with external >=44px submit button */
@media (max-width: 768px) {
  .tx-bar-row {
    flex-wrap: wrap;
    gap: 0.65rem;
    padding-block: 0.6rem;
  }

  .tx-mark {
    order: 1;
  }

  .tx-bar-acct {
    order: 2;
    margin-left: auto;
    gap: 0.5rem;
  }

  .tx-acct-reg {
    display: none;
  }

  .tx-acct-login {
    padding: 0.45rem 0.78rem;
    min-height: 44px;
    border: 1px solid var(--hairline);
    border-radius: var(--cornerSm);
    background-color: var(--cardFill);
  }

  .tx-bar-search {
    order: 3;
    flex: 1 0 100%;
    min-width: 0;
  }

  .tx-search-form {
    gap: 0.5rem;
  }

  .tx-search-input {
    min-height: 44px;
    height: 44px;
    font-size: 1rem;
  }

  .tx-search-btn {
    min-height: 44px;
    height: 44px;
    padding-inline: 1rem;
    background-color: var(--brandMain);
    border-color: var(--brandMain);
    color: #ffffff;
  }
}

/* Home: Manifesto, Underline Category Tabs, Featured Shelf & Bookshelf Grid */
.tx-manifesto {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-manifesto-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.45rem 1rem;
  min-width: 0;
  flex: 1 1 540px;
}

.tx-manifesto-brand {
  margin: 0;
  font-size: clamp(1.35rem, 2.3vw, 1.75rem);
  font-weight: 700;
  color: var(--bodyInk);
}

.tx-manifesto-copy {
  margin: 0;
  font-size: 0.89rem;
  color: var(--mutedInk);
}

.tx-manifesto-age {
  display: inline-block;
  margin-inline-start: 0.35rem;
  color: var(--brandMain);
  font-weight: 600;
  font-size: 0.82rem;
}

.tx-manifesto-total {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mutedInk);
  white-space: nowrap;
}

/* Underline Category Bar */
.tx-tabs {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  overflow-x: auto;
  scrollbar-width: none;
  padding-block: 0.75rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-tabs::-webkit-scrollbar {
  display: none;
}

.tx-tabs-inline {
  margin-top: 1rem;
  margin-bottom: 0;
}

.tx-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0 0.75rem;
  font-size: 0.87rem;
  font-weight: 500;
  color: var(--mutedInk);
  white-space: nowrap;
}

.tx-tab:hover {
  color: var(--bodyInk);
}

.tx-tab[data-on="1"] {
  color: var(--brandMain);
  font-weight: 700;
}

.tx-tab[data-on="1"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: var(--brandMain);
}

/* Section Headers */
.tx-section-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.2rem;
}

.tx-section-title {
  margin: 0;
  font-size: 1.22rem;
  font-weight: 600;
}

.tx-section-sub {
  margin: 0.2rem 0 0;
  font-size: 0.85rem;
  color: var(--mutedInk);
}

.tx-more-link {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--brandMain);
  white-space: nowrap;
}

.tx-page-title {
  margin: 0;
  font-size: clamp(1.4rem, 2.5vw, 1.9rem);
  font-weight: 700;
}

/* 24h Borderless Featured Shelf */
.tx-shelf {
  margin-bottom: 2.5rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-shelf-row {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.5rem 1.35rem;
}

@media (max-width: 900px) {
  .tx-shelf-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.15rem 1rem;
  }
}

/* Borderless <figure class="tx-book"> Card */
.tx-bookshelf {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2rem 1.5rem;
}

@media (max-width: 960px) {
  .tx-bookshelf {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1.6rem 1.15rem;
  }
}

@media (max-width: 640px) {
  .tx-bookshelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1.35rem 0.9rem;
  }
}

.tx-book {
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  min-width: 0;
}

.tx-book-cover {
  position: relative;
  display: block;
  aspect-ratio: 5 / 7;
  border-radius: var(--cornerSm);
  overflow: hidden;
  background-color: #ece6de;
}

.tx-book-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

.tx-book:hover .tx-book-img {
  transform: scale(1.025);
}

.tx-book-pages {
  position: absolute;
  right: 0.45rem;
  bottom: 0.45rem;
  padding: 0.14rem 0.45rem;
  border-radius: 4px;
  background-color: rgba(28, 25, 23, 0.78);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
  line-height: 1.35;
}

.tx-book-cap {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-width: 0;
}

.tx-book-kicker {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.4rem;
  font-size: 0.74rem;
  font-weight: 600;
  color: var(--brandMain);
}

.tx-book-score {
  color: var(--bodyInk);
}

.tx-book-title {
  color: var(--bodyInk);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tx-book-title:hover {
  color: var(--brandMain);
}

.tx-book-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.77rem;
  color: var(--mutedInk);
}

/* Home Bottom Minimalist CTA */
.tx-join {
  margin-top: 2.5rem;
  padding: 1.5rem 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
}

.tx-join-title {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.tx-join-desc {
  margin: 0;
  font-size: 0.87rem;
  color: var(--mutedInk);
}

@media (max-width: 640px) {
  .tx-join {
    flex-direction: column;
    align-items: stretch;
    padding: 1.25rem;
  }

  .tx-join-btn {
    align-self: center;
  }
}

/* Breadcrumb */
.tx-crumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.42rem;
  margin-bottom: 1.35rem;
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-crumb a {
  color: var(--mutedInk);
}

.tx-crumb a:hover {
  color: var(--brandMain);
}

.tx-crumb-now {
  color: var(--bodyInk);
  font-weight: 500;
}

/* Detail Page: Centered Single-Column Editorial Reading Deck (max 900px) */
.tx-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-hero-cover {
  margin: 0 0 1.25rem;
  width: min(300px, 76vw);
}

.tx-hero-frame {
  position: relative;
  display: block;
  border-radius: var(--cornerSm);
  overflow: hidden;
  background-color: #ece6de;
  box-shadow: 0 12px 30px rgba(28, 25, 23, 0.08);
}

.tx-hero-frame img {
  width: 100%;
  height: auto;
}

.tx-hero-kicker {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  margin-bottom: 0.75rem;
}

.tx-hero-kicker-left {
  justify-content: flex-start;
  margin-bottom: 0;
}

.tx-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  color: var(--mutedInk);
  font-size: 0.76rem;
  font-weight: 600;
}

.tx-pill-brand {
  border-color: rgba(194, 65, 12, 0.3);
  background-color: var(--brandTint);
  color: var(--brandMain);
}

.tx-hero-title {
  margin: 0 0 0.4rem;
  font-size: clamp(1.45rem, 2.8vw, 2.05rem);
  font-weight: 700;
  max-width: 28ch;
}

.tx-hero-alt {
  margin: 0 0 1.1rem;
  font-size: 0.88rem;
  color: var(--mutedInk);
  max-width: 60ch;
}

.tx-action-bar {
  margin-top: 0.75rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
}

/* Metadata Strip (<dl class="tx-meta-bar">) & Rating */
.tx-specs-block {
  padding-block: 1.35rem;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
}

.tx-meta-bar {
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.75rem 1.75rem;
}

.tx-meta-cell {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  font-size: 0.84rem;
}

.tx-meta-cell dt {
  color: var(--mutedInk);
  font-weight: 500;
}

.tx-meta-cell dt::after {
  content: ":";
}

.tx-meta-cell dd {
  margin: 0;
  color: var(--bodyInk);
  font-weight: 600;
}

.tx-rating-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
}

.tx-rating-avg-wrap {
  display: flex;
  align-items: baseline;
  gap: 0.55rem;
}

.tx-rating-lbl {
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-rating-avg {
  font-size: 0.92rem;
}

.tx-rating-control {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.tx-stars {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
}

.tx-star {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.1rem;
  height: 2.1rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: #d6cfc7;
  cursor: pointer;
}

.tx-star[data-on="1"],
.tx-star:hover {
  color: var(--brandMain);
}

.tx-rating-mine {
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-rating-mine strong {
  color: var(--brandMain);
}

/* Collapsible Tags Drawer (<details class="tx-tags-drawer">) */
.tx-tags-drawer {
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-tags-summary {
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  padding-block: 0.2rem;
}

.tx-tags-summary::-webkit-details-marker {
  display: none;
}

.tx-tags-heading {
  font-family: var(--fontDisplay);
  font-size: 1.12rem;
  font-weight: 600;
}

.tx-tags-caret {
  width: 0.55rem;
  height: 0.55rem;
  border-right: 1.6px solid var(--mutedInk);
  border-bottom: 1.6px solid var(--mutedInk);
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.tx-tags-drawer[open] .tx-tags-caret {
  transform: rotate(225deg);
}

.tx-tags-body {
  padding-top: 0.85rem;
}

.tx-tags-tools {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 0.5rem;
}

.tx-tags-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 220px;
  overflow: hidden;
}

.tx-tags-grid[data-open="1"] {
  max-height: none;
}

.tx-tag-row {
  display: grid;
  grid-template-columns: 8rem minmax(0, 1fr);
  gap: 0.6rem;
  align-items: baseline;
}

@media (max-width: 560px) {
  .tx-tag-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.3rem;
  }
}

.tx-tag-type {
  font-size: 0.79rem;
  font-weight: 600;
  color: var(--mutedInk);
}

.tx-tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.38rem;
}

.tx-tag-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.35;
}

.tx-tag-chip[data-on="1"] {
  outline: 2px solid var(--brandMain);
  outline-offset: 1px;
}

.tx-tags-bar {
  margin-top: 1rem;
  padding-top: 0.85rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-tags-chosen {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  flex: 1 1 220px;
}

.tx-sel-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.58rem;
  border-radius: 999px;
  background-color: var(--brandTint);
  border: 1px solid var(--brandMain);
  color: var(--brandHover);
  font-size: 0.78rem;
  font-weight: 600;
}

.tx-sel-remove {
  border: 0;
  background: transparent;
  color: var(--brandHover);
  font-weight: 700;
  cursor: pointer;
  padding: 0 0.12rem;
}

/* Detail Thumbnail Pager & Sprite Grid */
.tx-preview {
  margin-block: 1.5rem;
}

.tx-thumb-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.7rem;
  padding-block: 0.85rem;
  border-top: 1px solid var(--hairline);
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1.25rem;
}

.tx-thumb-pager-bottom {
  margin-top: 1.25rem;
  margin-bottom: 0;
}

.tx-thumb-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tx-pager-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.3rem 0.65rem;
  border-radius: var(--cornerSm);
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-size: 0.83rem;
  font-weight: 600;
}

.tx-pager-btn[data-on="1"] {
  background-color: var(--brandMain);
  border-color: var(--brandMain);
  color: #ffffff;
}

.tx-pager-btn[data-disabled="1"] {
  opacity: 0.38;
  pointer-events: none;
}

.tx-thumb-jump {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.tx-jump-label {
  font-size: 0.82rem;
  color: var(--mutedInk);
  font-weight: 600;
}

.tx-jump-input {
  width: 3.9rem;
  min-height: 2.25rem;
  padding: 0.28rem 0.4rem;
  border-radius: var(--cornerSm);
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.88rem;
  text-align: center;
}

.tx-jump-total {
  display: none;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--mutedInk);
}

.tx-pager-info {
  font-size: 0.81rem;
  color: var(--mutedInk);
}

@media (max-width: 640px) {
  .tx-thumb-pager {
    flex-wrap: nowrap;
    justify-content: space-between;
    gap: 0.3rem;
    padding-block: 0.65rem;
  }

  .tx-thumb-links {
    display: contents;
  }

  .tx-pager-first { order: 1; }
  .tx-pager-prev { order: 2; margin-right: auto; }
  .tx-thumb-jump { order: 3; gap: 0.25rem; }
  .tx-pager-next { order: 4; margin-left: auto; }
  .tx-pager-last { order: 5; }

  .tx-pager-label,
  .tx-pager-num,
  .tx-pager-info,
  .tx-jump-label,
  #jump-page-btn,
  .tx-jump-btn {
    display: none !important;
  }

  .tx-jump-total {
    display: inline;
    white-space: nowrap;
  }

  .tx-pager-nav {
    width: 2.25rem;
    min-width: 2.25rem;
    height: 2.25rem;
    min-height: 2.25rem;
    padding: 0;
    overflow: hidden;
  }

  .tx-jump-input {
    width: 3.3rem;
    font-size: 1rem;
  }
}

@media (max-width: 374px) {
  .tx-pager-nav {
    width: 2rem;
    min-width: 2rem;
    height: 2rem;
    min-height: 2rem;
  }
}

.tx-thumb-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
}

.comic-thumbnail {
  width: 200px;
  height: 292px;
  position: relative;
  display: block;
  border-radius: var(--cornerSm);
  border: 1px solid var(--hairline);
  background-color: #ece6de;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: border-color 0.16s ease, transform 0.16s ease;
}

.comic-thumbnail:hover {
  border-color: var(--brandMain);
  transform: translateY(-2px);
}

.tx-thumb-num {
  position: absolute;
  left: 0.4rem;
  bottom: 0.4rem;
  padding: 0.12rem 0.42rem;
  border-radius: 4px;
  background-color: rgba(28, 25, 23, 0.76);
  color: #ffffff;
  font-size: 0.72rem;
  font-weight: 600;
}

/* Related Shelf */
.tx-related {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

.tx-related-shelf {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1.25rem 1rem;
}

@media (max-width: 640px) {
  .tx-related-shelf {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem 0.85rem;
  }
}

/* Comments */
.tx-comments {
  margin-top: 2.25rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--hairline);
}

.tx-comment-form {
  margin-top: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tx-comment-actions {
  display: flex;
  justify-content: flex-end;
}

.tx-comment-list {
  margin-top: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tx-comment-item {
  padding: 1rem 0;
  border-bottom: 1px solid var(--hairline);
}

.tx-comment-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.tx-comment-author {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.tx-comment-time {
  display: block;
  font-size: 0.76rem;
  color: var(--mutedInk);
}

.tx-comment-body {
  margin: 0;
  font-size: 0.9rem;
  white-space: pre-line;
}

.tx-avatar {
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background-color: var(--brandTint);
  color: var(--brandMain);
  font-weight: 700;
  font-size: 0.86rem;
  flex-shrink: 0;
}

.tx-avatar-lg {
  width: 3.2rem;
  height: 3.2rem;
  font-size: 1.2rem;
}

/* Reader Page: Minimalist Immersive Canvas */
.tx-reader-progress {
  position: sticky;
  top: 0;
  z-index: 65;
  height: 3px;
  width: 100%;
  background-color: var(--hairline);
}

.tx-reader-progress-fill {
  height: 100%;
  background-color: var(--brandMain);
  transition: width 0.2s ease;
}

.tx-reader-top {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1.25rem;
}

.tx-reader-head-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
  margin-bottom: 1rem;
}

.tx-reader-back {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mutedInk);
  margin-bottom: 0.3rem;
}

.tx-reader-back:hover {
  color: var(--brandMain);
}

.tx-reader-title {
  margin: 0;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
}

.tx-reader-sub {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-reader-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tx-reader-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-reader-nav-bottom {
  margin-top: 1.25rem;
  padding-top: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.tx-reader-prev,
.tx-reader-next {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.tx-reader-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tx-reader-select {
  min-height: 2.4rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.85rem;
  font-weight: 600;
}

.tx-reader-count {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mutedInk);
}

.tx-rbtn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  min-height: 2.45rem;
  padding: 0.42rem 0.88rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
}

.tx-rbtn:hover {
  border-color: var(--brandMain);
  color: var(--brandMain);
}

.tx-rbtn-main {
  background-color: var(--brandMain);
  border-color: var(--brandMain);
  color: #ffffff;
}

.tx-rbtn-main:hover {
  background-color: var(--brandHover);
  border-color: var(--brandHover);
  color: #ffffff;
}

.tx-rbtn[data-disabled="1"] {
  opacity: 0.38;
  pointer-events: none;
}

.tx-reader-stage {
  margin: 0;
  display: flex;
  justify-content: center;
  background-color: #f0ece6;
  border-radius: var(--cornerSm);
  padding: 0.75rem;
}

.tx-reader-link {
  display: block;
  max-width: 100%;
}

.tx-reader-img {
  max-width: 100%;
  max-height: 92dvh;
  width: auto;
  height: auto;
  margin-inline: auto;
}

@media (max-width: 640px) {
  .tx-reader-tip {
    display: none;
  }

  .tx-reader-tools {
    width: 100%;
  }

  .tx-reader-tools > * {
    flex: 1 1 auto;
    min-height: 2.5rem;
    white-space: nowrap;
  }

  .tx-reader-nav {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-areas:
      "center center"
      "prev next";
    gap: 0.6rem 0.4rem !important;
  }

  .tx-reader-center {
    grid-area: center;
  }

  .tx-reader-prev {
    grid-area: prev;
    display: flex;
    gap: 0.35rem;
  }

  .tx-reader-next {
    grid-area: next;
    display: flex;
    gap: 0.35rem;
  }

  .tx-rbtn-edge {
    width: 2.75rem;
    min-width: 2.75rem;
    height: 2.75rem;
    min-height: 2.75rem;
    padding: 0;
    flex: 0 0 2.75rem;
  }

  .tx-rbtn-lbl {
    display: none;
  }

  .tx-rbtn:not(.tx-rbtn-edge) {
    flex: 1 1 auto;
    min-height: 2.75rem;
    white-space: nowrap;
  }

  .tx-reader-stage {
    padding: 0.25rem;
  }
}

/* Search & Directory */
.tx-search-box {
  padding-bottom: 1.5rem;
  margin-bottom: 1.5rem;
}

.tx-count-meta {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--mutedInk);
}

.tx-inline-search {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin-top: 0.85rem;
}

.tx-inline-input {
  flex: 1 1 260px;
}

.tx-dir-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-bottom: 1.1rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-dir-desc {
  margin: 0.35rem 0 0;
  font-size: 0.89rem;
  color: var(--mutedInk);
  max-width: 64ch;
}

.tx-dir-counter {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  color: var(--mutedInk);
  font-size: 0.86rem;
}

.tx-dir-counter strong {
  font-family: var(--fontDisplay);
  font-size: 1.45rem;
  color: var(--bodyInk);
}

.tx-dir-bar {
  padding-block: 1rem;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 1.25rem;
}

.tx-dir-controls {
  margin-top: 0.9rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-alpha-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.65rem;
}

.tx-alpha-lbl {
  font-size: 0.81rem;
  font-weight: 600;
  color: var(--mutedInk);
}

.tx-alpha-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--mutedInk);
  padding: 0.22rem 0.45rem;
  border-radius: var(--cornerSm);
}

.tx-alpha-link:hover {
  color: var(--bodyInk);
}

.tx-alpha-link[data-on="1"] {
  color: var(--brandMain);
  background-color: var(--brandTint);
}

.tx-dir-sort {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.tx-sort-select {
  width: auto;
  min-width: 11rem;
}

/* Clean Multi-Column Hairline Directory List */
.tx-dir-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 2rem;
}

@media (max-width: 860px) {
  .tx-dir-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 1.25rem;
  }
}

@media (max-width: 520px) {
  .tx-dir-list {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tx-dir-row {
  border-bottom: 1px solid var(--hairline);
}

.tx-dir-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.68rem 0.15rem;
  color: var(--bodyInk);
}

.tx-dir-link:hover {
  color: var(--brandMain);
}

.tx-dir-name {
  font-size: 0.9rem;
  font-weight: 500;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tx-dir-count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--mutedInk);
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}

/* Download Page */
.tx-advisory-line {
  padding: 0.55rem 0.85rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  font-size: 0.81rem;
  color: var(--mutedInk);
  margin-bottom: 1rem;
}

.tx-dl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-dl-work {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding-block: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-dl-cover {
  width: 92px;
  flex-shrink: 0;
  border-radius: var(--cornerSm);
  overflow: hidden;
  background-color: #ece6de;
}

.tx-dl-work-title {
  margin: 0 0 0.3rem;
  font-size: 1.15rem;
}

.tx-dl-work-alt {
  margin: 0 0 0.6rem;
  font-size: 0.84rem;
  color: var(--mutedInk);
}

.tx-dl-task {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.tx-dl-task-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-dl-status {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.3rem 0.75rem;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  font-size: 0.8rem;
  font-weight: 600;
}

.tx-dl-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background-color: var(--brandMain);
}

.tx-dl-status[data-state="ready"] .tx-dl-dot {
  background-color: #166534;
}

.tx-dl-status[data-state="queued"] .tx-dl-dot {
  background-color: #b45309;
}

.tx-dl-status[data-state="failed"] .tx-dl-dot {
  background-color: #b91c1c;
}

.tx-dl-meter {
  padding: 1rem 1.15rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
}

.tx-dl-meter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.65rem;
}

.tx-dl-stage {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tx-dl-stage-text {
  font-size: 0.86rem;
}

.tx-dl-percent {
  font-size: 1.05rem;
  color: var(--brandMain);
  font-variant-numeric: tabular-nums;
}

.tx-dl-track {
  height: 6px;
  border-radius: 999px;
  background-color: var(--hairline);
  overflow: hidden;
}

.tx-dl-fill {
  height: 100%;
  background-color: var(--brandMain);
  transition: width 0.25s ease;
}

.tx-dl-fill[data-done="1"] {
  background-color: #166534;
}

.tx-dl-marks {
  margin-top: 0.5rem;
  display: flex;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.72rem;
  color: var(--mutedInk);
}

.tx-dl-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.75rem;
}

@media (max-width: 720px) {
  .tx-dl-steps {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.tx-dl-step {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  padding: 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
}

.tx-dl-step[data-step-state="active"] {
  border-color: var(--brandMain);
}

.tx-dl-step[data-step-state="done"] {
  border-color: #bbf7d0;
}

.tx-dl-badge {
  width: 1.6rem;
  height: 1.6rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  font-size: 0.76rem;
  font-weight: 700;
  border: 1px solid var(--hairline);
  color: var(--mutedInk);
  flex-shrink: 0;
}

.tx-dl-step[data-step-state="active"] .tx-dl-badge {
  background-color: var(--brandMain);
  border-color: var(--brandMain);
  color: #ffffff;
}

.tx-dl-step[data-step-state="done"] .tx-dl-badge {
  background-color: #166534;
  border-color: #166534;
  color: #ffffff;
}

.tx-dl-step-t {
  display: block;
  font-size: 0.82rem;
}

.tx-dl-step-d {
  display: block;
  font-size: 0.75rem;
  color: var(--mutedInk);
}

.tx-dl-alert {
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-radius: var(--cornerSm);
  border: 1px solid #f59e0b;
  background-color: #fffbeb;
}

.tx-dl-alert[data-tone="err"] {
  border-color: #f87171;
  background-color: #fef2f2;
}

.tx-dl-alert-ico {
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background-color: #b45309;
  color: #ffffff;
  font-weight: 700;
  font-size: 0.82rem;
  flex-shrink: 0;
}

.tx-dl-alert[data-tone="err"] .tx-dl-alert-ico {
  background-color: #b91c1c;
}

.tx-dl-alert-body {
  flex: 1 1 auto;
}

.tx-dl-alert-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.tx-dl-alert-msg {
  margin: 0.3rem 0 0.65rem;
  font-size: 0.86rem;
}

.tx-dl-alert-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.tx-dl-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  align-items: start;
}

@media (max-width: 720px) {
  .tx-dl-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tx-dl-action-col {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tx-dl-hint {
  margin: 0.55rem 0 0;
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-dl-hint[data-verified="1"] {
  color: var(--brandHover);
  font-weight: 600;
}

.tx-dl-perks {
  margin: 0;
  padding-left: 1.15rem;
  font-size: 0.82rem;
  color: var(--mutedInk);
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.tx-dl-term {
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  overflow: hidden;
  background-color: #1c1917;
  color: #e7e2da;
}

.tx-dl-term-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.55rem 0.85rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.76rem;
}

.tx-dl-live {
  color: #86efac;
  font-weight: 700;
}

.tx-dl-term-body {
  padding: 0.75rem 0.85rem;
  max-height: 220px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.77rem;
  line-height: 1.55;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tx-dl-term-time {
  color: #a8a29e;
  margin-right: 0.4rem;
}

.tx-dl-term-msg[data-tone="info"] { color: #fdba74; }
.tx-dl-term-msg[data-tone="ok"] { color: #86efac; }
.tx-dl-term-msg[data-tone="warn"] { color: #fcd34d; }

.tx-dl-notes {
  padding-top: 1.5rem;
}

.tx-dl-notes-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem 1.5rem;
}

@media (max-width: 640px) {
  .tx-dl-notes-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.tx-dl-note strong {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 0.25rem;
}

.tx-dl-note p {
  margin: 0;
  font-size: 0.84rem;
  color: var(--mutedInk);
}

/* Forms, Contact, Legal & Auth */
.tx-narrow-head {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tx-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tx-label {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--bodyInk);
}

.tx-req {
  color: #dc2626;
}

.tx-control {
  width: 100%;
  min-height: 2.55rem;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-family: var(--fontBody);
  font-size: 0.9rem;
}

.tx-control:focus {
  outline: none;
  border-color: var(--brandMain);
}

.tx-control[aria-invalid="true"],
.tx-control:user-invalid,
.tx-control.user-invalid-fallback {
  border-color: #dc2626;
}

.tx-err-hint {
  display: none;
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
}

.tx-control:user-invalid + .tx-err-hint,
.tx-control.user-invalid-fallback + .tx-err-hint {
  display: block;
}

.tx-err-msg {
  font-size: 0.8rem;
  font-weight: 600;
  color: #dc2626;
}

.tx-err-list {
  margin: 0.35rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.84rem;
}

.tx-alert {
  padding: 0.8rem 1rem;
  border-radius: var(--cornerSm);
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  font-size: 0.87rem;
  margin-bottom: 1rem;
}

.tx-alert[data-tone="ok"] {
  border-color: #86efac;
  background-color: #f0fdf4;
  color: #166534;
}

.tx-alert[data-tone="err"] {
  border-color: #fca5a5;
  background-color: #fef2f2;
  color: #b91c1c;
}

.tx-result-lead {
  margin: 0 0 0.35rem;
  font-weight: 700;
}

/* Legal Document */
.tx-legal-doc {
  padding-block: 0.5rem 1.5rem;
}

.tx-legal-intro {
  margin: 0.65rem 0 1.5rem;
  color: var(--mutedInk);
  font-size: 0.94rem;
}

.tx-legal-sec {
  padding-block: 1.15rem;
  border-top: 1px solid var(--hairline);
}

.tx-legal-h {
  font-size: 1.12rem;
  margin: 0 0 0.6rem;
}

.tx-legal-list {
  margin: 0;
  padding-left: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  font-size: 0.9rem;
}

/* Auth Pages */
.tx-auth {
  width: min(460px, calc(100% - 2rem));
  margin: 1.5rem auto;
}

.tx-auth-box {
  padding: 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
}

.tx-auth-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-bottom: 0.9rem;
  margin-bottom: 1.15rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-auth-title {
  margin: 0;
  font-size: 1.35rem;
}

.tx-auth-hint,
.tx-auth-body {
  margin: 0 0 1rem;
  font-size: 0.87rem;
  color: var(--mutedInk);
}

.tx-auth-remember label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: var(--mutedInk);
  cursor: pointer;
}

.tx-auth-remember input[type="checkbox"] {
  width: 1rem;
  height: 1rem;
  accent-color: var(--brandMain);
}

.tx-auth-foot {
  margin-top: 0.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--hairline);
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.tx-auth-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.84rem;
}

.tx-auth-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tx-auth-actions > * {
  flex: 1 1 auto;
}

/* User Favorites Page */
.tx-fav-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid var(--hairline);
}

.tx-fav-user {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.tx-fav-stats {
  list-style: none;
  margin: 0.35rem 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 1.2rem;
  font-size: 0.84rem;
  color: var(--mutedInk);
}

.tx-fav-tabs {
  display: flex;
  gap: 1.25rem;
  border-bottom: 1px solid var(--hairline);
  margin-block: 1rem 1.25rem;
}

.tx-fav-tab {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0.6rem 0;
  font-family: var(--fontBody);
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--mutedInk);
  cursor: pointer;
}

.tx-fav-tab.active {
  color: var(--brandMain);
}

.tx-fav-tab.active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1px;
  height: 2px;
  background-color: var(--brandMain);
}

.tx-fav-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.tx-fav-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.tx-fav-actions form {
  margin: 0;
}

.tx-capacity {
  padding: 0.9rem 1.1rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  margin-bottom: 1.5rem;
}

.tx-capacity-head {
  display: flex;
  justify-content: space-between;
  font-size: 0.84rem;
  margin-bottom: 0.5rem;
}

.tx-capacity-track {
  height: 6px;
  border-radius: 999px;
  background-color: var(--hairline);
  overflow: hidden;
}

.tx-capacity-fill {
  height: 100%;
  background-color: var(--brandMain);
}

.tx-capacity-note {
  margin: 0.45rem 0 0;
  font-size: 0.8rem;
  color: var(--mutedInk);
}

.tx-remove-btn {
  border: 0;
  background: transparent;
  padding: 0.15rem 0.25rem;
  font-family: var(--fontBody);
  font-size: 0.78rem;
  font-weight: 600;
  color: #b91c1c;
  cursor: pointer;
}

.tx-remove-btn:hover {
  text-decoration: underline;
}

.tx-fav-cmeta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.85rem;
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-fav-modal {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background-color: rgba(28, 25, 23, 0.58);
}

.tx-fav-modal.show {
  display: flex;
}

.tx-fav-modal-box {
  width: min(420px, 100%);
  padding: 1.5rem;
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  border: 1px solid var(--hairline);
  text-align: center;
}

/* Native <dialog> Modals */
.tx-dialog {
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: var(--cornerSm);
  background: transparent;
  width: min(480px, calc(100vw - 2rem));
  max-width: calc(100vw - 2rem);
  max-height: calc(100dvh - 2rem);
  overflow: auto;
}

.tx-dialog-result-wrap {
  width: min(400px, calc(100vw - 2rem));
}

.tx-dialog-box {
  background-color: var(--cardFill);
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  padding: 1.4rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tx-dialog-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.tx-dialog-title {
  margin: 0;
  font-size: 1.2rem;
}

.tx-dialog-sub {
  margin: 0.25rem 0 0;
  font-size: 0.82rem;
  color: var(--mutedInk);
}

.tx-dialog-x {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 0;
  background: transparent;
  color: var(--mutedInk);
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.tx-dialog-x:hover {
  color: var(--bodyInk);
}

.tx-dialog-fields {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.tx-dialog-alert {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.65rem 0.85rem;
  border-radius: var(--cornerSm);
  font-size: 0.84rem;
  font-weight: 600;
  color: #ffffff;
}

.tx-dialog-alert[data-tone="warn"] {
  display: flex;
  background-color: #92400e;
}

.tx-dialog-alert[data-tone="err"] {
  display: flex;
  background-color: #b91c1c;
}

.tx-dialog-foot {
  display: flex;
  justify-content: flex-end;
  gap: 0.55rem;
}

.tx-dialog-result {
  position: relative;
  align-items: center;
  text-align: center;
  padding: 1.75rem 1.5rem;
}

.tx-dialog-result .tx-dialog-x {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
}

.tx-result-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  background-color: #166534;
}

.tx-dialog-result.is-error .tx-result-icon {
  background-color: #b91c1c;
}

.tx-result-text {
  margin: 0;
  font-size: 0.88rem;
  color: var(--mutedInk);
}

.tx-share-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

/* Top-Layer Popover Toast */
.tx-toast {
  position: fixed;
  inset: auto;
  top: auto;
  right: auto;
  left: 50%;
  bottom: calc(2rem + env(safe-area-inset-bottom, 0px));
  margin: 0;
  border: 0;
  z-index: 10000;
  display: none;
  align-items: center;
  gap: 0.55rem;
  width: max-content;
  max-width: min(440px, calc(100vw - 2rem));
  padding: 0.72rem 1.1rem;
  border-radius: var(--cornerSm);
  background-color: var(--bodyInk);
  color: #ffffff;
  font-size: 0.87rem;
  font-weight: 600;
  line-height: 1.38;
  box-shadow: 0 12px 28px rgba(28, 25, 23, 0.28);
  opacity: 0;
  transform: translateX(-50%);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.2s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

@media (prefers-reduced-motion: no-preference) {
  .tx-toast {
    transform: translateX(-50%) translateY(10px);
  }
}

.tx-toast:is(:popover-open, .\:popover-open, .active) {
  display: inline-flex;
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@starting-style {
  .tx-toast:is(:popover-open, .\:popover-open, .active) {
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  @starting-style {
    .tx-toast:is(:popover-open, .\:popover-open, .active) {
      transform: translateX(-50%) translateY(10px);
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  .tx-toast {
    transition-duration: 0.1s;
  }
}

.tx-toast-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-block-size: 24px;
  min-inline-size: 24px;
  margin-inline-start: 0.25rem;
  padding: 0 0.2rem;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: inherit;
  font-size: 1.05rem;
  line-height: 1;
  opacity: 0.82;
  cursor: pointer;
}

.tx-toast-close:hover {
  opacity: 1;
}

.tx-toast.toast-success { background-color: #166534; }
.tx-toast.toast-error { background-color: #b91c1c; }
.tx-toast.toast-warning { background-color: #92400e; }

/* Empty & Error States */
.tx-empty {
  grid-column: 1 / -1;
  padding: 2.5rem 1.25rem;
  text-align: center;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  color: var(--mutedInk);
}

.tx-err-body {
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
}

.tx-err-main {
  width: min(460px, 100%);
}

.tx-err-card {
  padding: 2.25rem 1.75rem;
  border: 1px solid var(--hairline);
  border-radius: var(--cornerSm);
  background-color: var(--cardFill);
  text-align: center;
}

.tx-err-code {
  display: inline-block;
  font-family: var(--fontDisplay);
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--brandMain);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.tx-err-title {
  font-size: 1.35rem;
  margin-bottom: 0.5rem;
}

.tx-err-copy {
  margin: 0 0 1.35rem;
  color: var(--mutedInk);
  font-size: 0.9rem;
}

/* Centered Single-Column Hairline Footer */
.tx-foot {
  margin-top: auto;
  border-top: 1px solid var(--hairline);
  background-color: var(--pageCanvas);
  padding-block: 2.25rem 1.75rem;
}

.tx-foot-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.95rem;
}

.tx-foot-brand {
  font-family: var(--fontDisplay);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--bodyInk);
}

.tx-foot-desc {
  margin: 0;
  max-width: 62ch;
  font-size: 0.84rem;
  color: var(--mutedInk);
}

.tx-foot-links,
.tx-foot-legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem 1.15rem;
  font-size: 0.83rem;
}

.tx-foot-links a,
.tx-foot-legal a {
  color: var(--mutedInk);
}

.tx-foot-links a:hover,
.tx-foot-legal a:hover {
  color: var(--brandMain);
}

.tx-foot-legal {
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
  width: min(640px, 100%);
}

.tx-foot-advisory {
  margin: 0;
  max-width: 66ch;
  font-size: 0.77rem;
  color: var(--mutedInk);
}

.tx-foot-meta {
  margin: 0;
  padding-top: 0.75rem;
  border-top: 1px solid var(--hairline);
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.4rem 1.25rem;
  font-size: 0.78rem;
  color: var(--mutedInk);
}

.tx-foot-seal {
  color: var(--brandHover);
  font-weight: 600;
}

/* Shared Component Styling: <x-site.pagination /> */
.ep-pagination {
  margin-top: 2rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
}

.ep-page-item {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  min-height: 2.4rem;
  padding: 0.35rem 0.72rem;
  border-radius: var(--cornerSm);
  border: 1px solid var(--hairline);
  background-color: var(--cardFill);
  color: var(--bodyInk);
  font-size: 0.85rem;
  font-weight: 600;
  text-decoration: none;
}

.ep-page-item:hover:not(.disabled):not(.active) {
  border-color: var(--brandMain);
  background-color: var(--brandTint);
  color: var(--brandHover);
}

.ep-page-item.active {
  background-color: var(--brandMain);
  border-color: var(--brandMain);
  color: #ffffff;
}

.ep-page-item.disabled {
  opacity: 0.4;
  pointer-events: none;
}

.ep-page-nav-icon {
  display: none;
}

.ep-page-nav-svg {
  width: 1.05rem;
  height: 1.05rem;
}

@media (max-width: 640px) {
  .ep-pagination {
    flex-wrap: nowrap;
    justify-content: safe center;
    overflow-x: auto;
    scrollbar-width: none;
    gap: 0.28rem;
    padding-bottom: 0.15rem;
  }

  .ep-pagination::-webkit-scrollbar {
    display: none;
  }

  .ep-page-item-prev { order: 0; }
  .ep-page-item-num { order: 1; }
  .ep-page-item-next { order: 2; }

  .ep-page-nav-label {
    display: none !important;
  }

  .ep-page-nav-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .ep-page-item-nav {
    width: 2.5rem;
    min-width: 2.5rem;
    height: 2.5rem;
    min-height: 2.5rem;
    padding: 0;
    flex-shrink: 0;
  }

  .ep-page-item-far {
    display: none !important;
  }

  .ep-page-item-dots {
    min-width: 1.15rem;
    width: 1.15rem;
    padding: 0;
    border-color: transparent;
    background: transparent;
  }
}

@media (max-width: 374px) {
  .ep-page-item,
  .ep-page-item-nav {
    min-width: 2.25rem;
    width: 2.25rem;
    min-height: 2.25rem;
    height: 2.25rem;
    padding: 0;
    font-size: 0.8rem;
  }

  .ep-page-item-dots {
    min-width: 0.9rem;
    width: 0.9rem;
  }
}

/* Shared Component Styling: Ad Slots */
.site-ad-slot.site-ad-banner-320x50 {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-block: 1.15rem;
  min-height: 50px;
}

.site-ad-banner-320x50__inner {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  overflow: hidden;
}

.site-ad-slot.site-ad-banner-320x50.is-placeholder .site-ad-banner-320x50__inner {
  width: 320px;
  min-height: 50px;
  border-radius: var(--cornerSm);
  border: 1px dashed var(--hairline);
  background-color: var(--brandTint);
  color: var(--mutedInk);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.site-ad-social-bar.is-placeholder {
  position: fixed;
  left: 1rem;
  bottom: calc(0.75rem + env(safe-area-inset-bottom, 0px));
  z-index: 8000;
  padding: 0.35rem 0.75rem;
  border-radius: 999px;
  border: 1px dashed var(--hairline);
  background-color: var(--cardFill);
  color: var(--mutedInk);
  font-size: 0.72rem;
  font-weight: 600;
}
