/*
  ToonTap user-draft based layout mockup v0.4b
  ------------------------------------------------------------
  Purpose:
    - Static HTML/CSS mockup generated from user's attached page images and written requirements.
    - This is NOT a direct server patch. It is a server-implementation blueprint.
    - Keep this CSS as the visual contract when converting to GnuBoard theme/skin files.

  Non-negotiable layout rules captured here:
    1) PC layout = main content + sticky right rail. No left rail.
    2) Header menu order = 베스트 / 웹코믹 / 댓글 / 태그.
    3) Top 탐색 menu is removed. 공지 is footer-only.
    4) Thumbnail/list/gallery switch is a real UI concept:
       - thumb: default, 4-column card/masonry-ish list, image visible, height capped.
       - gallery: uniform grid, image ratio normalized.
       - list: text-only rows, no image.
    5) Main page latest update has no pagination and shows latest 32 only.
    6) Board/comment/tag/search pages use pagination. Do not implement infinite scroll as the primary navigation.
    7) Representative category top5 is DISPLAY ONLY. Search must use all tt_post_tag_map + tt_vote_summary tags.
    8) Do not restore ruliweb original image hrefs in server conversion.
*/

:root {
  --tt-bg: #f8f4ff;
  --tt-paper: #ffffff;
  --tt-paper-2: #fbf8ff;
  --tt-text: #19112d;
  --tt-muted: #756b88;
  --tt-line: #e7dcff;
  --tt-line-2: #efe7ff;
  --tt-purple: #7c3df1;
  --tt-purple-2: #9d56f2;
  --tt-pink: #d949a4;
  --tt-yellow: #efe02e;
  --tt-chip: #f1e8ff;
  --tt-chip-text: #7433dc;
  --tt-shadow: 0 20px 55px rgba(71, 34, 125, .12);
  --tt-shadow-soft: 0 12px 36px rgba(80, 42, 130, .08);
  --tt-radius-xl: 26px;
  --tt-radius-lg: 20px;
  --tt-radius-md: 14px;
  --tt-container: 1360px;
  --tt-main: 980px;
  --tt-rail: 320px;
  --tt-header-h: 62px;
}

[data-theme="dark"] {
  --tt-bg: #111020;
  --tt-paper: #1a1729;
  --tt-paper-2: #211c35;
  --tt-text: #f3efff;
  --tt-muted: #b9abc9;
  --tt-line: #372c58;
  --tt-line-2: #2d244a;
  --tt-chip: #2c2446;
  --tt-chip-text: #d7c7ff;
  --tt-shadow: 0 20px 55px rgba(0, 0, 0, .32);
  --tt-shadow-soft: 0 12px 36px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { margin: 0; padding: 0; }
body {
  margin: 0;
  min-width: 320px;
  background:
    radial-gradient(circle at 28% 0%, rgba(142, 78, 255, .14), transparent 35%),
    linear-gradient(180deg, var(--tt-bg), #fff 54%, var(--tt-bg));
  color: var(--tt-text);
  font-family: BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  word-break: keep-all;
}

a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; }
button { cursor: pointer; }

/* ======================= Header ======================= */
.tt-header {
  height: var(--tt-header-h);
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .88);
  border-bottom: 1px solid var(--tt-line-2);
  backdrop-filter: blur(18px);
}
[data-theme="dark"] .tt-header { background: rgba(18, 16, 31, .88); }
.tt-header__inner {
  width: min(var(--tt-container), calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}
.tt-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-size: 20px;
  letter-spacing: -.02em;
  white-space: nowrap;
}
.tt-logo__mark {
  width: 32px;
  height: 32px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--tt-purple), var(--tt-pink));
  box-shadow: 0 10px 25px rgba(124, 61, 241, .25);
}
.tt-nav {
  display: flex;
  align-items: center;
  gap: 2px;
  flex: 0 0 auto;
}
.tt-nav a {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 12px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 14px;
}
.tt-nav a:hover,
.tt-nav a.is-active { background: var(--tt-chip); color: var(--tt-chip-text); }
.tt-header__spacer { flex: 1 1 auto; }
.tt-top-search {
  width: 340px;
  max-width: 34vw;
  height: 36px;
  display: flex;
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--tt-paper-2);
}
.tt-top-search input {
  min-width: 0;
  flex: 1;
  border: 0;
  padding: 0 16px;
  background: transparent;
  color: var(--tt-text);
  outline: none;
  font-size: 13px;
}
.tt-top-search button {
  width: 44px;
  border: 0;
  color: #fff;
  background: var(--tt-purple);
  font-weight: 900;
}
.tt-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.tt-pill-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  color: var(--tt-text);
  font-weight: 800;
  font-size: 13px;
}
.tt-pill-btn--primary {
  border-color: transparent;
  background: linear-gradient(135deg, var(--tt-purple), var(--tt-pink));
  color: #fff;
}
.tt-pill-btn--yellow {
  border-color: rgba(120, 106, 0, .2);
  background: var(--tt-yellow);
  color: #18110e;
}

/* ======================= Layout ======================= */
.tt-wrap {
  width: min(var(--tt-container), calc(100% - 32px));
  margin: 24px auto 0;
}
.tt-layout {
  display: grid;
  grid-template-columns: minmax(0, var(--tt-main)) var(--tt-rail);
  gap: 24px;
  align-items: start;
}
.tt-main { min-width: 0; }
.tt-rail {
  position: sticky;
  top: calc(var(--tt-header-h) + 18px);
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-height: calc(100vh - var(--tt-header-h) - 24px);
  overflow: auto;
  scrollbar-width: thin;
  padding-bottom: 20px;
}
.tt-section,
.tt-card,
.tt-rail-card {
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  border-radius: var(--tt-radius-xl);
  box-shadow: var(--tt-shadow-soft);
}
.tt-section { padding: 24px; margin-bottom: 18px; }
.tt-section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 16px;
}
.tt-section__eyebrow {
  display: block;
  margin-bottom: 4px;
  color: var(--tt-purple);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.tt-section h1,
.tt-section h2,
.tt-page-title h1 {
  margin: 0;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -.04em;
}
.tt-section h2 { font-size: 22px; }
.tt-desc { margin: 6px 0 0; color: var(--tt-muted); font-size: 14px; }
.tt-more { color: var(--tt-purple); font-weight: 900; font-size: 13px; }
.tt-mini-note { color: var(--tt-muted); font-size: 12px; }

/* ======================= Tags / Chips ======================= */
.tt-chip-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  min-height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  background: var(--tt-chip);
  color: var(--tt-chip-text);
  border: 1px solid transparent;
  font-weight: 850;
  font-size: 13px;
  white-space: nowrap;
}
.tt-chip:hover { border-color: rgba(124, 61, 241, .28); }
.tt-chip--selected { background: var(--tt-purple); color: #fff; box-shadow: 0 8px 20px rgba(124, 61, 241, .22); }
.tt-chip--muted { color: var(--tt-muted); background: #f7f2ff; }
[data-theme="dark"] .tt-chip--muted { background: #241d38; }
.tt-chip--danger { color: #bd3475; background: #fff0f7; }
[data-theme="dark"] .tt-chip--danger { color: #ffb1d5; background: #372239; }
.tt-chip--plus { border: 1px dashed rgba(124, 61, 241, .45); background: transparent; }
.tt-chip__count { font-size: 11px; opacity: .75; }

/* ======================= Combo panel ======================= */
.tt-combo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: stretch;
}
.tt-combo-panel {
  padding: 20px;
  border-radius: 24px;
  border: 1px solid var(--tt-line);
  background:
    radial-gradient(circle at 100% 0%, rgba(124, 61, 241, .18), transparent 36%),
    linear-gradient(135deg, #ffffff, #fbf6ff 62%, #f6efff);
  box-shadow: var(--tt-shadow);
}
[data-theme="dark"] .tt-combo-panel {
  background: linear-gradient(135deg, #211a36, #251d3e 62%, #2b2047);
}
.tt-combo-panel__top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}
.tt-combo-panel__title { margin: 0; font-size: 20px; letter-spacing: -.04em; }
.tt-combo-panel__status { color: var(--tt-muted); font-size: 12px; font-weight: 850; }
.tt-combo-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}
.tt-combo-box {
  min-height: 100px;
  padding: 16px;
  border-radius: 16px;
  border: 1px solid var(--tt-line);
  background: rgba(255, 255, 255, .78);
}
[data-theme="dark"] .tt-combo-box { background: rgba(20, 17, 34, .72); }
.tt-combo-box__label { margin-bottom: 12px; font-weight: 900; }
.tt-combo-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}
.tt-combo-actions .tt-pill-btn { min-width: 78px; }
.tt-login-hint {
  margin-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 11px 14px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--tt-line);
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 750;
}
[data-theme="dark"] .tt-login-hint { background: #181325; }

.tt-popular-tags-bar {
  margin-top: 12px;
  padding: 14px 16px;
  border-radius: 18px;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
}
.tt-popular-tags-bar strong { white-space: nowrap; }
.tt-popular-tags-bar .tt-chip-row {
  max-height: 72px;
  overflow: hidden;
}

/* ======================= Rail ======================= */
.tt-rail-card { padding: 18px; }
.tt-rail-card--combo {
  background:
    radial-gradient(circle at 96% 8%, rgba(255,255,255,.32), transparent 28%),
    linear-gradient(135deg, #5b2598, #833df3 62%, #d84ca6);
  color: #fff;
  border-color: transparent;
}
.tt-rail-card__head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
}
.tt-rail-card__head h3 { margin: 0; font-size: 17px; letter-spacing: -.03em; }
.tt-rail-card__head a,
.tt-rail-card__head button { color: var(--tt-purple); background: transparent; border: 0; font-weight: 900; font-size: 13px; }
.tt-rail-card--combo .tt-rail-card__head a { color: #fff; }
.tt-rail-list { list-style: none; margin: 0; padding: 0; }
.tt-rail-list li { border-top: 1px solid var(--tt-line-2); }
.tt-rail-list li:first-child { border-top: 0; }
.tt-rail-list a {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 0;
  font-weight: 850;
  font-size: 13px;
}
.tt-rail-list span { color: var(--tt-muted); font-size: 12px; flex: 0 0 auto; }
.tt-rail-tabs { display: flex; gap: 6px; margin-bottom: 8px; flex-wrap: wrap; }
.tt-rail-tab {
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  background: var(--tt-paper);
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 850;
  color: var(--tt-muted);
}
.tt-rail-tab.is-active { background: var(--tt-purple); color: #fff; border-color: var(--tt-purple); }

/* ======================= Toolbar and view switch ======================= */
.tt-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}
.tt-toolbar__left,
.tt-toolbar__right { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.tt-view-switch {
  display: inline-flex;
  gap: 7px;
  align-items: center;
}
.tt-view-switch__label { font-weight: 850; color: var(--tt-muted); font-size: 13px; }
.tt-view-btn {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  color: var(--tt-text);
  font-weight: 900;
  font-size: 18px;
}
.tt-view-btn.is-active { background: var(--tt-yellow); border-color: rgba(120, 106, 0, .25); color: #1b1600; }
.tt-board-search {
  display: flex;
  gap: 8px;
  align-items: center;
}
.tt-board-search input,
.tt-board-search select,
.tt-tag-search input {
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  color: var(--tt-text);
  border-radius: 999px;
  min-height: 38px;
  padding: 0 14px;
  outline: none;
}
.tt-board-search select { padding-right: 26px; }

/* ======================= Card grids ======================= */
.tt-post-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}
/*
  Server conversion note:
  - Default thumbnail mode must keep 4 columns on desktop.
  - Do not silently reduce to 3 columns.
  - Long webcomic images must be capped at card level; full image is opened in view page.
*/
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+2) .tt-post-card__image { height: 315px; }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+3) .tt-post-card__image { height: 238px; }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+4) .tt-post-card__image { height: 270px; }
.tt-post-grid[data-view="thumb"] .tt-post-card__image { height: 292px; max-height: 360px; }
.tt-post-grid[data-view="gallery"] .tt-post-card__image { height: 215px; }
.tt-post-grid[data-view="gallery"] { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.tt-post-card {
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid var(--tt-line-2);
  background: var(--tt-paper);
  box-shadow: 0 10px 28px rgba(65, 37, 110, .08);
}
.tt-post-card__image {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #a8d9ff, #edc5ff);
}
.tt-post-card__image::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 15%, rgba(255,255,255,.65), transparent 20%),
    linear-gradient(135deg, rgba(255,255,255,.12), rgba(124,61,241,.12));
}
.tt-post-card:nth-child(4n+2) .tt-post-card__image { background: linear-gradient(135deg, #cbf7db, #b8edf3); }
.tt-post-card:nth-child(4n+3) .tt-post-card__image { background: linear-gradient(135deg, #f9c1e9, #f4e5ff); }
.tt-post-card:nth-child(4n+4) .tt-post-card__image { background: linear-gradient(135deg, #e9e0ff, #ffd6ec); }
.tt-post-card__body { padding: 13px; }
.tt-post-card__title {
  margin: 0 0 9px;
  min-height: 38px;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 900;
  letter-spacing: -.025em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tt-post-card__meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  color: var(--tt-muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 8px;
}
.tt-post-card__meta .tt-counts { display: none; } /* Main/list cards hide hit/comment/good by default per user requirement. */
.tt-post-grid[data-view="list"] {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tt-post-grid[data-view="list"] .tt-post-card {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  padding: 0;
  border-radius: 14px;
  box-shadow: none;
}
.tt-post-grid[data-view="list"] .tt-post-card__image,
.tt-post-grid[data-view="list"] .tt-chip-row { display: none; }
.tt-post-grid[data-view="list"] .tt-post-card__body {
  padding: 13px 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 12px;
  align-items: center;
}
.tt-post-grid[data-view="list"] .tt-post-card__title {
  min-height: 0;
  margin: 0;
  -webkit-line-clamp: 1;
}
.tt-post-grid[data-view="list"] .tt-post-card__meta { justify-content: end; margin: 0; }

/* ======================= Page title / board pages ======================= */
.tt-page-title {
  padding: 22px 24px;
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-end;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  border-radius: var(--tt-radius-xl);
  box-shadow: var(--tt-shadow-soft);
}
.tt-page-title__meta { color: var(--tt-muted); font-weight: 750; font-size: 13px; margin-top: 6px; }
.tt-page-title__count { text-align: right; color: var(--tt-purple); font-weight: 950; font-size: 26px; line-height: 1; }
.tt-page-title__count small { display: block; margin-top: 4px; font-size: 12px; color: var(--tt-muted); }
.tt-board-shell {
  padding: 20px;
  border-radius: var(--tt-radius-xl);
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  box-shadow: var(--tt-shadow-soft);
}
.tt-filter-box {
  padding: 16px;
  border-radius: 18px;
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  margin-bottom: 18px;
}
.tt-filter-box__row {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  margin-top: 10px;
}
.tt-filter-box__row:first-child { margin-top: 0; }
.tt-filter-box__label { color: var(--tt-muted); font-weight: 850; font-size: 13px; padding-top: 5px; }

/* ======================= Pagination ======================= */
.tt-pager {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 28px 0 4px;
}
.tt-pager a,
.tt-pager span {
  width: 38px;
  height: 38px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  color: var(--tt-text);
  font-weight: 850;
}
.tt-pager .is-current { background: var(--tt-purple); color: #fff; border-color: var(--tt-purple); }
.tt-pager .tt-pager__wide { width: 46px; }
/*
  Server pager rule requested by user:
    Page group size = 5.
    Page 1~5: show 1 2 3 4 5 >
    Page 6~10: show << < 6 7 8 9 10 >
    Page 283: show << < 281 282 283 284 285 >
    No "last page" button, to avoid expensive last-page calculation on huge boards.
*/

/* ======================= Tag page ======================= */
.tt-tag-info {
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f3e9ff, #fff8fd);
  border: 1px solid var(--tt-line-2);
  margin-bottom: 16px;
}
[data-theme="dark"] .tt-tag-info { background: #211a35; }
.tt-tag-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  gap: 10px;
  margin-bottom: 20px;
}
.tt-tag-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.tt-tag-card {
  min-height: 112px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
}
.tt-tag-card strong { color: var(--tt-purple); font-size: 19px; }
.tt-tag-card span { color: var(--tt-muted); font-weight: 750; }
/* Server note: tags page shows exactly 32 cards per page = 4 columns x 8 rows on desktop. */

/* ======================= Comments page ======================= */
.tt-comment-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.tt-comment-toolbar input {
  min-width: 220px;
  flex: 1;
  border: 1px solid var(--tt-line);
  border-radius: 999px;
  background: var(--tt-paper);
  padding: 0 16px;
  min-height: 42px;
}
.tt-comment-list { display: flex; flex-direction: column; gap: 12px; }
.tt-comment-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--tt-line);
  border-radius: 18px;
  background: var(--tt-paper);
}
.tt-comment-row__text { margin: 0 0 7px; font-weight: 900; font-size: 16px; }
.tt-comment-row__post { color: var(--tt-purple); font-weight: 900; }
.tt-comment-row__side {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 8px;
  color: var(--tt-muted);
  font-weight: 750;
}
.tt-board-pill {
  display: inline-flex;
  padding: 5px 10px;
  border-radius: 999px;
  background: var(--tt-chip);
  color: var(--tt-chip-text);
  font-weight: 900;
}

/* ======================= Search result ======================= */
.tt-search-summary {
  padding: 18px;
  border-radius: 18px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper-2);
  margin-bottom: 16px;
}
.tt-search-summary__grid {
  display: grid;
  grid-template-columns: 80px minmax(0,1fr);
  gap: 10px;
  align-items: start;
  margin-top: 10px;
}
.tt-search-summary__grid:first-child { margin-top: 0; }
.tt-search-summary__label { font-weight: 900; color: var(--tt-muted); }

/* ======================= View page ======================= */
.tt-view-head {
  padding: 22px 24px;
  margin-bottom: 18px;
  border-radius: var(--tt-radius-xl);
  border: 1px solid var(--tt-line-2);
  background: var(--tt-paper);
  box-shadow: var(--tt-shadow-soft);
}
.tt-view-head h1 { margin: 0 0 10px; font-size: 25px; letter-spacing: -.04em; }
.tt-view-meta { display: flex; flex-wrap: wrap; gap: 10px; color: var(--tt-muted); font-size: 13px; font-weight: 750; }
.tt-view-body {
  padding: 22px;
  border-radius: var(--tt-radius-xl);
  background: var(--tt-paper);
  border: 1px solid var(--tt-line-2);
  box-shadow: var(--tt-shadow-soft);
}
.tt-view-image {
  min-height: 760px;
  border-radius: 18px;
  background: linear-gradient(135deg, #d7efff, #ffe2f6 48%, #e8dcff);
  border: 1px solid var(--tt-line);
}
.tt-post-tags-box,
.tt-vote-box,
.tt-related-box {
  margin-top: 18px;
  padding: 18px;
  border-radius: 18px;
  background: var(--tt-paper-2);
  border: 1px solid var(--tt-line);
}
.tt-box-title {
  display: flex;
  align-items: center;
  gap: 8px;
  justify-content: space-between;
  margin-bottom: 12px;
}
.tt-box-title h3 { margin: 0; font-size: 17px; }
.tt-help {
  position: relative;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  border: 1px solid var(--tt-line);
  background: var(--tt-paper);
  color: var(--tt-purple);
  font-weight: 900;
}
.tt-help__tip {
  display: none;
  position: absolute;
  right: 0;
  top: 30px;
  width: 280px;
  z-index: 10;
  padding: 12px;
  border-radius: 14px;
  background: #1e1630;
  color: #fff;
  box-shadow: var(--tt-shadow);
  font-size: 12px;
  font-weight: 750;
  text-align: left;
}
.tt-help:hover .tt-help__tip,
.tt-help.is-open .tt-help__tip { display: block; }
.tt-good-row { display: flex; justify-content: center; gap: 10px; margin-top: 18px; }
.tt-vote-actions { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.tt-related-grid { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 12px; }
.tt-related-grid .tt-post-card__image { height: 160px; }

/* ======================= Footer ======================= */
.tt-footer {
  margin-top: 46px;
  border-top: 1px solid var(--tt-line-2);
  background: rgba(255,255,255,.66);
}
[data-theme="dark"] .tt-footer { background: rgba(18,16,31,.7); }
.tt-footer__inner {
  width: min(var(--tt-container), calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 36px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  color: var(--tt-muted);
}
.tt-footer strong { color: var(--tt-text); display: block; margin-bottom: 6px; }
.tt-footer nav { display: flex; gap: 14px; flex-wrap: wrap; color: var(--tt-text); font-weight: 850; }

/* ======================= Responsive ======================= */
@media (max-width: 1100px) {
  .tt-layout { grid-template-columns: minmax(0, 1fr); }
  .tt-rail { position: static; max-height: none; overflow: visible; display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tt-combo-layout { grid-template-columns: 1fr; }
  .tt-post-grid,
  .tt-post-grid[data-view="gallery"] { grid-template-columns: repeat(3, minmax(0,1fr)); }
  .tt-tag-grid { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
@media (max-width: 780px) {
  body { padding-bottom: 64px; }
  .tt-header { height: auto; }
  .tt-header__inner { min-height: 62px; flex-wrap: wrap; padding: 10px 0; gap: 10px; }
  .tt-nav { order: 4; width: 100%; overflow: auto; }
  .tt-top-search { order: 3; width: 100%; max-width: none; }
  .tt-header__spacer { display: none; }
  .tt-layout { gap: 16px; }
  .tt-wrap { width: min(100% - 20px, var(--tt-container)); margin-top: 14px; }
  .tt-section { padding: 18px; }
  .tt-rail { grid-template-columns: 1fr; }
  .tt-combo-body { grid-template-columns: 1fr; }
  .tt-combo-actions { justify-content: stretch; }
  .tt-combo-actions .tt-pill-btn { flex: 1; }
  .tt-popular-tags-bar { grid-template-columns: 1fr auto; }
  .tt-popular-tags-bar .tt-chip-row { grid-column: 1 / -1; }
  .tt-toolbar { align-items: stretch; flex-direction: column; }
  .tt-board-search { width: 100%; }
  .tt-board-search input { min-width: 0; flex: 1; }
  .tt-post-grid,
  .tt-post-grid[data-view="gallery"] { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tt-tag-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tt-tag-search { grid-template-columns: 1fr 1fr; }
  .tt-tag-search input { grid-column: 1 / -1; }
  .tt-comment-row { grid-template-columns: 1fr; }
  .tt-comment-row__side { align-items: flex-start; }
  .tt-related-grid { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tt-footer__inner { flex-direction: column; }
}
@media (max-width: 460px) {
  .tt-post-grid,
  .tt-post-grid[data-view="gallery"] { grid-template-columns: 1fr; }
  .tt-tag-grid { grid-template-columns: 1fr; }
  .tt-page-title { flex-direction: column; align-items: flex-start; }
  .tt-page-title__count { text-align: left; }
}


/* ======================= v0.4b user correction overrides =======================
  Corrections from user review:
  - recent combo history rail uses bright paper background, not dark/purple gradient.
  - mobile main combo panel is collapsed by default and remembered in localStorage/cookie-equivalent.
  - mobile recent combo history appears directly under the selected combo block.
  - thumbnail mode must show placeholder thumbnail area; gallery is the uniform-height mode.
  - board toolbar must stay one line on PC: search + random + view buttons right-aligned.
  - right rail shows realtime popular directly; daily/monthly/all are moved to view-page bottom sections.
*/
.tt-rail-card--combo{
  background: linear-gradient(135deg, var(--tt-paper), var(--tt-paper-2));
  color: var(--tt-text);
  border-color: var(--tt-line-2);
  box-shadow: var(--tt-shadow-soft);
}
.tt-rail-card--combo .tt-rail-card__head a{ color: var(--tt-purple); }
.tt-rail-card--combo .tt-login-hint{ background: var(--tt-paper); }
.tt-mobile-combo-history{ display:none; }
.tt-combo-toggle{ display:none; }
.tt-post-card__image{ display:block; min-height:160px; }
.tt-post-grid[data-view="thumb"] .tt-post-card__image{ height: clamp(210px, 25vw, 360px); }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+1) .tt-post-card__image{ height: 285px; }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+2) .tt-post-card__image{ height: 330px; }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+3) .tt-post-card__image{ height: 245px; }
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+4) .tt-post-card__image{ height: 305px; }
.tt-post-grid[data-view="gallery"] .tt-post-card__image{ height: 230px !important; }
.tt-post-grid[data-view="list"] .tt-post-card__image{ display:none !important; }
.tt-toolbar--board{ display:flex; align-items:center; justify-content:space-between; gap:12px; flex-wrap:nowrap; }
.tt-toolbar--board .tt-toolbar__left{ flex:0 0 auto; }
.tt-toolbar--board .tt-toolbar__right{ flex:1 1 auto; justify-content:flex-end; flex-wrap:nowrap; }
.tt-toolbar--board .tt-board-search{ flex:0 1 430px; }
.tt-toolbar--board .tt-board-search input{ min-width:0; flex:1 1 auto; }
.tt-toolbar--board .tt-view-switch{ flex:0 0 auto; }
.tt-popular-stack{ display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.tt-popular-column h3{ margin:0 0 10px; font-size:16px; }
.tt-popular-column ol{ margin:0; padding-left:20px; }
.tt-popular-column li{ padding:5px 0; font-weight:850; border-bottom:1px solid var(--tt-line-2); }
.tt-tag-search--name-only{ grid-template-columns:minmax(0,1fr) auto auto auto; }
.tt-tag-search__note{ grid-column:1/-1; color:var(--tt-muted); font-size:12px; font-weight:750; }
@media (max-width:780px){
  .tt-combo-panel{ padding:18px; }
  .tt-combo-panel__top{ cursor:pointer; align-items:flex-start; }
  .tt-combo-toggle{ display:inline-flex; margin-left:auto; }
  .tt-combo-panel:not(.is-open) .tt-combo-body,
  .tt-combo-panel:not(.is-open) .tt-combo-actions{ display:none; }
  .tt-mobile-combo-history{ display:block; margin:12px 0 16px; }
  .tt-rail .tt-rail-card--combo{ display:none; }
  .tt-post-grid,
  .tt-post-grid[data-view="gallery"]{ grid-template-columns:repeat(2,minmax(0,1fr)); }
  .tt-post-grid[data-view="thumb"] .tt-post-card__image{ height: 220px; max-height:260px; }
  .tt-toolbar--board{ flex-direction:column; align-items:stretch; }
  .tt-toolbar--board .tt-toolbar__right{ justify-content:space-between; flex-wrap:wrap; }
  .tt-toolbar--board .tt-board-search{ flex:1 1 100%; order:1; display:grid; grid-template-columns:96px minmax(0,1fr) auto; }
  .tt-toolbar--board .tt-view-switch{ order:2; justify-content:flex-end; }
  .tt-popular-stack{ grid-template-columns:1fr; }
}
@media (max-width:460px){
  .tt-post-grid,
  .tt-post-grid[data-view="gallery"]{ grid-template-columns:repeat(2,minmax(0,1fr)); gap:10px; }
  .tt-post-card__body{ padding:10px; }
  .tt-post-card__title{ font-size:13px; }
}


/* ===== v0.4b server conversion fixes ===== */
.tt-post-card__image{overflow:hidden;position:relative}
.tt-post-card__image img{width:100%;height:100%;object-fit:cover;display:block;position:relative;z-index:1}
.tt-post-card__image:not(:has(img))::after{content:'ToonTap';position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,255,255,.75);font-weight:900;letter-spacing:.06em;z-index:2}
.tt-rail-list a{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 0;border-top:1px solid var(--tt-line-2)}
.tt-rail-list a:first-child{border-top:0}.tt-rail-list span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:800}.tt-rail-list em{flex:0 0 auto;color:var(--tt-muted);font-style:normal;font-size:12px;font-weight:800}
.tt-post-tags,.tt-vote-panel{background:var(--tt-paper);border:1px solid var(--tt-line);border-radius:var(--tt-radius-lg);padding:18px;margin:18px 0}.tt-post-tags__head,.tt-vote-panel__head{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;margin-bottom:12px}.tt-post-tags__head b{font-size:16px}.tt-help{width:22px;height:22px;border-radius:50%;border:1px solid var(--tt-line);background:var(--tt-paper-2);color:var(--tt-purple);font-weight:900;margin-left:6px;position:relative}.tt-help:hover::after,.tt-help.is-open::after{content:attr(data-tt-tooltip);position:absolute;left:0;top:28px;width:280px;background:var(--tt-text);color:var(--tt-paper);padding:10px 12px;border-radius:12px;font-size:12px;line-height:1.45;z-index:20;text-align:left}.tt-vote-status{background:var(--tt-paper-2);border-radius:12px;padding:10px 12px;color:var(--tt-muted);font-weight:800;margin-bottom:10px}.tt-vote-chips{display:flex;flex-wrap:wrap;gap:8px}.tt-vote-chips button{border:1px solid var(--tt-line);background:var(--tt-paper);border-radius:999px;padding:9px 13px;font-weight:850}.tt-vote-chips em{color:var(--tt-purple);font-style:normal}.tt-vote-foot{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:14px;color:var(--tt-muted);font-size:13px}.tt-view-content img{max-width:100%;height:auto}.tt-content-body{background:var(--tt-paper);border:1px solid var(--tt-line-2);border-radius:var(--tt-radius-xl);padding:22px;box-shadow:var(--tt-shadow-soft)}.tt-view-head{background:var(--tt-paper);border:1px solid var(--tt-line-2);border-radius:var(--tt-radius-xl);padding:22px;margin-bottom:18px;box-shadow:var(--tt-shadow-soft)}.tt-view-layout{display:grid;grid-template-columns:minmax(0,1fr) 300px;gap:24px}.tt-view-side{position:sticky;top:calc(var(--tt-header-h) + 18px);align-self:start}.tt-side-card{background:var(--tt-paper);border:1px solid var(--tt-line-2);border-radius:var(--tt-radius-lg);padding:16px;margin-bottom:14px;box-shadow:var(--tt-shadow-soft)}.tt-side-list-btn{display:flex;align-items:center;justify-content:center;border-radius:999px;background:var(--tt-purple);color:#fff!important;padding:10px 12px;font-weight:900}.tt-pager{display:flex;align-items:center;justify-content:center;gap:8px;margin:28px 0}.tt-pager a{width:40px;height:40px;border-radius:50%;display:grid;place-items:center;border:1px solid var(--tt-line);background:var(--tt-paper);font-weight:900}.tt-pager a.is-active{background:var(--tt-purple);color:#fff;border-color:transparent}.tt-page-title{background:var(--tt-paper);border:1px solid var(--tt-line-2);border-radius:var(--tt-radius-xl);padding:24px;margin-bottom:18px}.tt-board-toolbar{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:nowrap;margin-bottom:18px}.tt-board-search{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.tt-board-search select,.tt-board-search input{height:40px;border:1px solid var(--tt-line);border-radius:999px;background:var(--tt-paper);padding:0 14px}.tt-board-search input{min-width:0;flex:1}.tt-tags-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:14px}.tt-tag-tile{min-height:105px;background:var(--tt-paper);border:1px solid var(--tt-line);border-radius:18px;padding:18px;display:flex;flex-direction:column;justify-content:center;gap:6px}.tt-tag-tile b{color:var(--tt-purple);font-size:20px}.tt-tag-tile span{color:var(--tt-muted);font-weight:800}.tt-comment-row{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:14px;background:var(--tt-paper);border:1px solid var(--tt-line);border-radius:18px;padding:16px;margin-bottom:12px}.tt-comment-row strong{display:block;font-size:16px;margin-bottom:6px}.tt-comment-row a{color:var(--tt-purple);font-weight:900}.tt-comment-board{display:inline-flex;border-radius:999px;background:var(--tt-chip);color:var(--tt-chip-text);padding:6px 10px;font-weight:900}.tt-tag-notice{background:var(--tt-paper-2);border:1px solid var(--tt-line);border-radius:18px;padding:16px;margin:12px 0 18px;color:var(--tt-muted);font-weight:750}.tt-tags-sort{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0 18px}.tt-tags-sort a{border:1px solid var(--tt-line);border-radius:999px;padding:9px 14px;font-weight:900;background:var(--tt-paper)}.tt-tags-sort a.is-active{background:linear-gradient(135deg,var(--tt-purple),var(--tt-pink));color:#fff;border-color:transparent}
@media(max-width:980px){.tt-view-layout{grid-template-columns:1fr}.tt-view-side{position:static}.tt-board-toolbar{align-items:stretch;flex-direction:column}.tt-board-search{width:100%}.tt-tags-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* v0.4b server package final CSS guards */
.tt-post-card__image img{width:100%;height:100%;object-fit:cover;display:block}.tt-bottom-nav{display:none}.tt-footer__links{display:flex;gap:14px;flex-wrap:wrap;color:var(--tt-text);font-weight:850}.tt-filter-preview{display:flex;align-items:center;gap:10px;flex-wrap:wrap;border:1px solid var(--tt-line);border-radius:18px;background:var(--tt-paper-2);padding:12px;margin:0 0 16px}.tt-filter-preview div{display:flex;align-items:center;gap:7px;flex-wrap:wrap}.tt-filter-preview b{color:var(--tt-purple)}.tt-filter-preview span{border-radius:999px;background:var(--tt-chip);color:var(--tt-chip-text);padding:6px 9px;font-weight:900}.tt-filter-preview div:nth-child(2) span{background:#fff1f5;color:#d63384}.tt-empty-panel{border:1px dashed var(--tt-line);border-radius:18px;background:var(--tt-paper-2);padding:22px;color:var(--tt-muted);font-weight:800}.tt-login-msg{position:absolute;left:-9999px}.sound_only{position:absolute!important;width:1px;height:1px;margin:-1px;overflow:hidden;clip:rect(0,0,0,0)}.tt-category ul{display:flex;gap:8px;flex-wrap:wrap;margin:0 0 14px;padding:0;list-style:none}.tt-category a,.tt-category li{display:inline-flex;border-radius:999px;background:var(--tt-chip);color:var(--tt-chip-text);padding:8px 12px;font-weight:900}.tt-toolbar__right{display:flex;align-items:center;gap:8px;flex-wrap:nowrap}.tt-view-switch{white-space:nowrap}.tt-rail-list .tt-compact-list{display:block}.tt-comment-toolbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap}.tt-comment-toolbar h1{margin-right:auto}.tt-comment-toolbar input{height:40px;border:1px solid var(--tt-line);border-radius:999px;background:var(--tt-paper);padding:0 14px;min-width:220px}.tt-view-actions{flex-wrap:wrap;justify-content:flex-end}@media(max-width:780px){.tt-bottom-nav{position:fixed;left:0;right:0;bottom:0;z-index:60;display:grid;grid-template-columns:repeat(5,1fr);background:rgba(255,255,255,.94);border-top:1px solid var(--tt-line);backdrop-filter:blur(16px)}[data-theme="dark"] .tt-bottom-nav{background:rgba(18,16,31,.94)}.tt-bottom-nav a{display:flex;flex-direction:column;align-items:center;gap:2px;padding:7px 0 6px;font-size:11px;font-weight:900;color:var(--tt-muted)}.tt-bottom-nav i{font-size:16px;color:var(--tt-purple)}.tt-footer{padding-bottom:74px}.tt-board-toolbar{flex-direction:column;align-items:stretch}.tt-toolbar__right{justify-content:flex-end}.tt-board-search{width:100%;display:grid;grid-template-columns:92px minmax(0,1fr) auto}.tt-comment-toolbar{align-items:stretch}.tt-comment-toolbar h1{width:100%;margin:0}.tt-comment-toolbar input{min-width:0;flex:1}.tt-filter-preview{align-items:flex-start;flex-direction:column}.tt-tags-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.tt-post-tags__head,.tt-vote-panel__head,.tt-vote-foot{flex-direction:column}.tt-help:hover:after,.tt-help.is-open:after{left:auto;right:0;transform:none;width:240px}.tt-post-grid[data-view="thumb"] .tt-post-card__image{height:220px!important;max-height:260px!important}}


/* ===== v0.4b live hotfix guards =====
   These are intentionally appended after old v0.4a rules so they win the cascade.
   Server root cause from diag: board bo_skin was still non-theme `toontap_board`, loading /skin/board/toontap_board instead of /theme/toontap_v04a/... .
   Installer v0.4b sets manga/best bo_skin and bo_mobile_skin to `theme/toontap_board`.
*/
:root{
  --tt-container:1360px;
  --tt-main:980px;
  --tt-rail:320px;
}
.tt-header__inner,.tt-wrap{width:min(var(--tt-container), calc(100% - 32px));}
.tt-layout{grid-template-columns:minmax(0, var(--tt-main)) var(--tt-rail);gap:28px;align-items:start;}
.tt-main{min-width:0;}
.tt-rail{
  position:sticky;
  top:calc(var(--tt-header-h) + 18px);
  display:flex;
  flex-direction:column;
  gap:18px;
  max-height:none!important;
  overflow:visible!important;
  scrollbar-width:auto;
  min-width:0;
  padding-bottom:0;
}
.tt-rail-card{min-width:0;overflow:visible;}
.tt-rail-card .tt-chip-row{min-width:0;max-width:100%;overflow:visible;}
.tt-rail-card .tt-chip{max-width:100%;white-space:normal;overflow-wrap:anywhere;}
.tt-rail-list,.tt-compact-list{min-width:0;overflow:visible;}
.tt-rail-list a,.tt-compact-list a{min-width:0;max-width:100%;}
.tt-rail-list span,.tt-compact-list span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.tt-board-page{width:100%!important;}
.tt-board-toolbar.tt-toolbar--board{display:flex;align-items:center;justify-content:space-between;gap:14px;flex-wrap:nowrap;margin-bottom:18px;}
.tt-board-toolbar.tt-toolbar--board .tt-board-search{display:flex;align-items:center;gap:8px;min-width:0;flex:1 1 auto;order:0;}
.tt-board-toolbar.tt-toolbar--board .tt-toolbar__right{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex:0 0 auto;flex-wrap:nowrap;order:0;}
.tt-board-toolbar.tt-toolbar--board .tt-view-switch{display:inline-flex;align-items:center;gap:7px;flex:0 0 auto;white-space:nowrap;}
.tt-view-btn i{font-size:16px;line-height:1;}
.tt-post-grid{grid-template-columns:repeat(4,minmax(0,1fr));}
.tt-post-grid[data-view="thumb"]{grid-template-columns:repeat(4,minmax(0,1fr));align-items:start;}
.tt-post-grid[data-view="thumb"] .tt-post-card__image{height:292px;max-height:360px;display:block;min-height:170px;}
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+1) .tt-post-card__image{height:285px;}
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+2) .tt-post-card__image{height:330px;}
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+3) .tt-post-card__image{height:245px;}
.tt-post-grid[data-view="thumb"] .tt-post-card:nth-child(4n+4) .tt-post-card__image{height:305px;}
.tt-post-grid[data-view="gallery"]{grid-template-columns:repeat(4,minmax(0,1fr));}
.tt-post-grid[data-view="gallery"] .tt-post-card__image{height:230px!important;}
.tt-post-grid[data-view="list"]{display:flex;flex-direction:column;gap:8px;}
.tt-post-grid[data-view="list"] .tt-post-card__image{display:none!important;}
.tt-post-card__image{position:relative;overflow:hidden;background:linear-gradient(135deg,#a8d9ff,#edc5ff);}
.tt-post-card__image img{width:100%;height:100%;object-fit:cover;display:block;position:relative;z-index:1;}
.tt-post-card__image:not(:has(img))::after{content:'ToonTap';position:absolute;inset:0;display:grid;place-items:center;color:rgba(255,255,255,.78);font-weight:900;letter-spacing:.06em;z-index:2;}
.tt-view-page .tt-layout{grid-template-columns:minmax(0, var(--tt-main)) var(--tt-rail);gap:28px;}
.tt-view-page .tt-rail{position:sticky;top:calc(var(--tt-header-h) + 18px);max-height:none!important;overflow:visible!important;}
.tt-content-body{background:var(--tt-paper);border:1px solid var(--tt-line-2);border-radius:var(--tt-radius-xl);padding:22px;box-shadow:var(--tt-shadow-soft);}
.tt-bottom-popular-section{margin-top:18px;}
.tt-after-discovery__combo{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px;padding:14px 16px;border-radius:18px;background:linear-gradient(135deg,var(--tt-purple),var(--tt-pink));color:#fff;}
.tt-after-discovery__combo div{display:flex;align-items:center;gap:8px;flex-wrap:wrap;}
.tt-after-discovery__combo span{display:inline-flex;border-radius:999px;background:rgba(255,255,255,.18);padding:6px 10px;font-weight:900;}
.tt-after-discovery__combo a{display:inline-flex;border-radius:999px;background:#fff;color:var(--tt-purple);padding:8px 13px;font-weight:900;white-space:nowrap;}
.tt-bottom-popular-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:14px;}
.tt-bottom-popular-card{border:1px solid var(--tt-line);border-radius:18px;background:var(--tt-paper);padding:15px;min-width:0;}
.tt-bottom-popular-card header{margin-bottom:10px;}
.tt-bottom-popular-card h3{margin:0;font-size:16px;letter-spacing:-.03em;}
.tt-bottom-popular-card p{margin:3px 0 0;color:var(--tt-muted);font-size:12px;font-weight:750;}
.tt-bottom-popular-list{display:flex;flex-direction:column;gap:0;}
.tt-bottom-popular-list a{display:grid;grid-template-columns:26px minmax(0,1fr);gap:8px;align-items:center;padding:8px 0;border-top:1px solid var(--tt-line-2);font-weight:850;}
.tt-bottom-popular-list a:first-child{border-top:0;}
.tt-bottom-popular-list em{width:22px;height:22px;border-radius:50%;display:grid;place-items:center;background:var(--tt-chip);color:var(--tt-purple);font-style:normal;font-weight:900;font-size:12px;}
.tt-bottom-popular-list span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
@media (max-width:1200px){
  :root{--tt-main:calc(100vw - 32px - var(--tt-rail) - 24px);--tt-rail:300px;}
  .tt-layout,.tt-view-page .tt-layout{gap:24px;}
}
@media (max-width:980px){
  .tt-layout,.tt-view-page .tt-layout{grid-template-columns:1fr;}
  .tt-rail,.tt-view-page .tt-rail{position:static;max-height:none!important;overflow:visible!important;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));}
  .tt-post-grid,.tt-post-grid[data-view="thumb"],.tt-post-grid[data-view="gallery"]{grid-template-columns:repeat(3,minmax(0,1fr));}
  .tt-bottom-popular-grid{grid-template-columns:1fr;}
}
@media (max-width:780px){
  .tt-rail{grid-template-columns:1fr;}
  .tt-board-toolbar.tt-toolbar--board{flex-direction:column;align-items:stretch;}
  .tt-board-toolbar.tt-toolbar--board .tt-board-search{display:grid;grid-template-columns:92px minmax(0,1fr) auto;width:100%;}
  .tt-board-toolbar.tt-toolbar--board .tt-toolbar__right{justify-content:flex-end;flex-wrap:wrap;}
  .tt-post-grid,.tt-post-grid[data-view="thumb"],.tt-post-grid[data-view="gallery"]{grid-template-columns:repeat(2,minmax(0,1fr));}
  .tt-post-grid[data-view="thumb"] .tt-post-card__image{height:220px!important;max-height:260px!important;}
  .tt-after-discovery__combo{align-items:flex-start;flex-direction:column;}
}
@media (max-width:460px){
  .tt-post-grid,.tt-post-grid[data-view="thumb"],.tt-post-grid[data-view="gallery"]{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
}


/* =========================================================
   v0.4b hotfix1
   - Remove dark-mode gradients that visually broke the site mood.
   - Keep dark mode as a flat dark UI, not a purple/pink wallpaper.
   ========================================================= */
[data-theme="dark"] body {
  background: var(--tt-bg) !important;
}
[data-theme="dark"] .tt-body,
[data-theme="dark"] .tt-wrap {
  background: transparent !important;
}
[data-theme="dark"] .tt-combo-panel,
[data-theme="dark"] .tt-rail-card--combo,
[data-theme="dark"] .tt-tag-info,
[data-theme="dark"] .tt-tag-notice,
[data-theme="dark"] .tt-after-discovery__combo,
[data-theme="dark"] .tt-bottom-popular-card,
[data-theme="dark"] .tt-section,
[data-theme="dark"] .tt-page-title,
[data-theme="dark"] .tt-content-body,
[data-theme="dark"] .tt-view-head,
[data-theme="dark"] .tt-post-tags,
[data-theme="dark"] .tt-vote-panel,
[data-theme="dark"] .tt-side-card {
  background: var(--tt-paper) !important;
  background-image: none !important;
}
[data-theme="dark"] .tt-after-discovery__combo {
  color: var(--tt-text) !important;
}
[data-theme="dark"] .tt-after-discovery__combo span,
[data-theme="dark"] .tt-after-discovery__combo a {
  background: var(--tt-chip) !important;
  color: var(--tt-chip-text) !important;
}


/* v0.4b hotfix1 tag page polish */
.tt-tags-search-note {
  margin: 4px 0 16px;
  color: var(--tt-muted);
  font-weight: 750;
}
.tt-tags-search-note b,
.tt-tags-search-note a { color: var(--tt-purple); font-weight: 900; }
.tt-tag-filter-search { margin-bottom: 14px; }
