.tico {
  width: 18px; height: 18px; background: currentColor; display: inline-block;
  -webkit-mask: var(--ico) center / contain no-repeat;
  mask: var(--ico) center / contain no-repeat; flex: 0 0 18px;
}
.tico.sm { width: 16px; height: 16px; flex-basis: 16px; }
.tico.xs { width: 14px; height: 14px; flex-basis: 14px; }

.cat-page { display: flex; flex-direction: column; gap: 8px; height: 100%; min-height: 0; }
.cat-bar { display: flex; align-items: center; gap: 8px; }
.cat-bar .muted { flex: 1; margin: 0; }
.cat-search, .cat-bar select, .ch-pager select, .ch-filters input, .ch-filters select, .series-filter {
  background: #151c2a; border: 1px solid #2a3548; border-radius: 10px;
  padding: 8px 12px; color: #e8eef7;
}
.cat-search { width: 100%; }
.cat-bar select { min-width: 160px; }
.title-catalog { display: flex; flex-wrap: wrap; gap: 12px; overflow: auto; }
.title-cat-card {
  width: 156px; height: 240px; text-align: center; cursor: pointer;
  background: transparent; border: none; padding: 0;
}
.title-cat-card img, .title-cat-card .letter {
  width: 140px; height: 200px; border-radius: 10px; object-fit: cover; margin: 0 auto;
  background: linear-gradient(180deg, var(--cover-from, #2a6a56), var(--cover-to, #1d4d3c));
  display: flex; align-items: center; justify-content: center;
  font-size: 48px; font-weight: 800; color: #dbeafe;
}
button.danger { background: #8b2e3a; border: 1px solid #a33d4a; color: #fff; border-radius: 8px; padding: 6px 12px; font-weight: 700; }
button.danger:hover { background: #a33846; }
.title-cat-card .cap { font-size: 13px; margin-top: 6px; font-weight: 600; }
.title-cat-card.picked { outline: 2px solid #4f6ef7; border-radius: 12px; }
.page-title { font-size: 28px; font-weight: 800; }

.back-link {
  background: transparent; border: none; color: #8b9bb4; font-weight: 600;
  padding: 2px 0; align-self: flex-start; height: 24px; text-align: left;
}
.back-link:hover { color: #e8eef7; }

.main:has(.title-detail) { overflow: hidden; padding: 12px 24px 16px; }
.title-detail { display: flex; flex-direction: column; gap: 12px; height: 100%; min-height: 0; }
.title-header { display: flex; gap: 14px; height: 236px; align-items: flex-start; flex: 0 0 236px; }

.cover-card {
  width: 176px; height: 236px; border-radius: 12px; overflow: hidden; position: relative;
  background: linear-gradient(180deg, #16324a, #0e1c2c); flex: 0 0 176px;
}
.cover-card img, .cover-card .cover-letter {
  width: 176px; height: 236px; object-fit: cover; display: flex; align-items: center; justify-content: center;
  font-size: 72px; font-weight: 800; color: #dbeafe;
}
.cover-card .cover-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 56px;
  background: linear-gradient(transparent, rgba(11,16,28,.6));
}
.cover-card .cover-btn {
  position: absolute; left: 50%; bottom: 10px; transform: translateX(-50%);
  background: rgba(11,16,28,.82); color: #e8eef7; border: none; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; white-space: nowrap; height: 28px;
  display: flex; align-items: center; gap: 6px;
}

.title-info { flex: 1; min-width: 280px; height: 236px; display: flex; flex-direction: column; gap: 6px; padding: 0 4px 0 0; justify-content: flex-start; }
.title-name { font-size: 28px; font-weight: 800; margin: 0; display: flex; align-items: center; gap: 8px; line-height: 1.15; flex: 0 0 auto; }
.title-name .tico { background: #f5c542; width: 18px; height: 18px; }
.title-status {
  border: none; border-radius: 10px; padding: 4px 12px; font-size: 12px; font-weight: 700;
  width: 148px; background: #203b33; color: #81d9b3; min-height: 22px; appearance: none;
}
.title-status[data-state="PAUSED"] { background: #403721; color: #f0c66c; }
.title-status[data-state="ABANDONED"] { background: #442a34; color: #ef969d; }
.title-status[data-state="FROZEN"] { background: #163a4a; color: #7dd3fc; }
.genre-chip {
  display: inline-block; color: #c5d0e0; background: #1e2838; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; font-weight: 600; margin-right: 6px;
}
.title-blurb { color: #8b9bb4; font-size: 13px; max-height: 40px; overflow: hidden; }
.metrics { display: flex; gap: 8px; margin-top: 8px; flex: 0 0 auto; align-self: flex-start; }
.metric {
  background: #1a2333; border-radius: 12px; padding: 8px 10px; min-width: 88px; height: 78px;
  display: flex; flex-direction: column; justify-content: center;
}
.metric .n { font-size: 26px; font-weight: 800; line-height: 1.1; }
.metric .c { color: #8b9bb4; font-size: 11px; white-space: pre-line; }

.team-card {
  width: 380px; height: 236px; background: #151c2a; border: 1px solid #2a3548; border-radius: 14px;
  padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; flex: 0 0 380px;
}
.team-card h3 { margin: 0; font-size: 14px; font-weight: 700; }
.team-head { display: flex; align-items: center; gap: 8px; }
.team-member {
  background: #1a2333; border-radius: 10px; height: 52px; display: flex; align-items: center;
  gap: 8px; padding: 0 12px 0 10px;
}
.team-member .av {
  width: 40px; height: 40px; border-radius: 20px; background: #344969; display: flex;
  align-items: center; justify-content: center; font-weight: 700; overflow: hidden; flex: 0 0 40px;
  color: #e7efff; font-size: 12px;
}
.team-member .av img { width: 40px; height: 40px; object-fit: cover; }
.team-member .nm { font-size: 14px; font-weight: 700; }
.team-member .role { display: flex; align-items: center; gap: 6px; color: #8b9bb4; font-size: 13px; }
.team-rows { display: flex; flex-direction: column; gap: 6px; overflow: auto; }

.title-actions { width: 176px; height: 236px; display: flex; flex-direction: column; gap: 8px; flex: 0 0 176px; }
.btn-title-primary, .btn-title-ghost {
  display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%;
}
.btn-title-primary {
  background: #4f6ef7; color: #fff; border: none; border-radius: 12px; height: 48px;
  font-weight: 700; font-size: 13px;
}
.btn-title-primary:hover { background: #5b79ff; }
.btn-title-ghost {
  background: #1a2333; color: #e8eef7; border: 1px solid #2a3548; border-radius: 12px; height: 42px;
  font-weight: 600; font-size: 13px;
}
.btn-title-ghost:hover { border-color: #4f6ef7; }
.btn-title-ghost .tico, .btn-title-primary .tico { background: currentColor; }

.title-tabs {
  background: #101827; border: 1px solid #2a3548; border-radius: 12px; height: 52px;
  display: flex; padding: 4px; flex: 0 0 52px;
}
.title-tabs button {
  flex: 1; background: transparent; border: none; border-radius: 10px; color: #8b9bb4;
  font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; gap: 8px;
}
.title-tabs button .tico { background: #8b9bb4; }
.title-tabs button.active { background: #1a2744; color: #e8eef7; border-bottom: 2px solid #4f6ef7; }
.title-tabs button.active .tico { background: #e8eef7; }

.title-stack { flex: 1; min-height: 0; display: flex; flex-direction: column; }
#title-tab-series, #title-tab-chapters, #title-tab-history {
  flex: 1; display: flex; flex-direction: column; min-height: 0;
}
.section-head { display: flex; align-items: center; gap: 8px; }
.section-title { font-size: 22px; font-weight: 800; margin: 10px 0 8px; }
.series-filter {
  background: #1a2333; color: #e8eef7; border: 1px solid #2a3548; border-radius: 10px;
  padding: 6px 12px; font-weight: 600; width: 140px;
}
#series-feed { flex: 1; overflow: auto; min-height: 0; display: flex; flex-direction: column; gap: 8px; }

.series-row {
  background: #121926; border: 1px solid #2a3548; border-radius: 14px; min-height: 92px;
  display: flex; align-items: center; gap: 0; padding: 10px 12px; cursor: pointer;
}
.series-row:hover { border-color: #4f6ef7; }
.series-gap { width: 6px; flex: 1 1 6px; max-width: 18px; }
.series-grip { width: 16px; flex: 0 0 16px; display: flex; justify-content: center; color: #5b6b82; }
.series-grip .tico { background: #5b6b82; width: 16px; height: 16px; }
.series-num { font-size: 20px; font-weight: 800; width: 52px; flex: 0 0 52px; }
.series-info { width: 190px; flex: 0 1 190px; min-width: 140px; }
.series-ch { font-size: 15px; font-weight: 800; }
.series-badge { background: #202b40; border-radius: 5px; padding: 9px 11px; font-size: 16px; flex: 0 0 auto; }
.series-prog { flex: 1 1 170px; min-width: 170px; max-width: 290px; display: flex; flex-direction: column; gap: 5px; }
.series-prog .hint { color: #93a4bb; font-size: 12px; }
.ch-progress { height: 24px; background: #334158; border-radius: 5px; overflow: hidden; position: relative; }
.ch-progress > i { display: block; height: 100%; }
.ch-progress > span {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; text-shadow: 0 0 2px #172233;
}
.people-grid { display: flex; gap: 8px; align-items: flex-start; min-width: 154px; max-width: 280px; overflow-x: auto; }
.add-person {
  width: 32px; height: 32px; border-radius: 16px; background: transparent; color: #8b9bb4;
  border: 1px dashed #3d4d64; font-size: 16px; font-weight: 700; padding: 0; margin-top: 6px;
}
.add-person:hover { border-color: #4f6ef7; color: #e8eef7; background: #162033; }
.duebox { min-width: 120px; max-width: 170px; text-align: center; padding-right: 8px; }
.duebox .d { font-size: 20px; }
.duebox .n { font-size: 17px; }
.series-tools { display: flex; gap: 6px; flex: 0 0 auto; }
.work-small {
  width: 28px; height: 28px; padding: 2px; border: 1px solid #33445e; border-radius: 6px;
  background: #1a2639; color: #d7e2f3; display: flex; align-items: center; justify-content: center;
}
.work-small .tico { width: 17px; height: 17px; background: #d7e2f3; }

.title-footer { display: flex; gap: 16px; margin-top: 16px; flex: 0 0 132px; }
.plans-card, .title-progress {
  background: #151c2a; border: 1px solid #2a3548; border-radius: 14px; padding: 14px 18px;
  height: 132px; display: flex; flex-direction: column; gap: 8px;
}
.plans-card { flex: 4; }
.title-progress { flex: 6; }
.plans-card h3, .title-progress h3 {
  margin: 0; font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 8px;
}
.plan-link { background: transparent; border: none; color: #8b9bb4; font-weight: 600; font-size: 12px; padding: 0; }
.plan-link:hover { color: #dbeafe; }
.seg-bar { height: 16px; border-radius: 7px; overflow: hidden; display: flex; background: #344054; }
.seg-bar i { display: block; height: 100%; }
.prog-legend { display: flex; gap: 8px; font-size: 12px; margin-top: 4px; }
.prog-legend > div { flex: 1; }
.prog-legend .cap { font-size: 12px; }
.prog-legend .val { color: #8b9bb4; }
.plan-row { display: flex; align-items: center; gap: 10px; height: 26px; font-size: 13px; }
.plan-row .num { width: 28px; font-weight: 700; }

.ch-filters {
  background: #151c2a; border: 1px solid #2a3548; border-radius: 14px;
  padding: 8px 10px; display: flex; gap: 8px; flex-wrap: nowrap; align-items: center; overflow-x: auto;
}
.ch-filters input, .ch-filters select {
  background: #151c2a; color: #e8eef7; border: 1px solid #2a3548; border-radius: 10px; padding: 8px 12px;
}
.ch-filters input { flex: 2; min-width: 180px; }
.ghost-sm {
  background: #1a2333; color: #e8eef7; border: 1px solid #2a3548; border-radius: 10px;
  padding: 6px 12px; font-weight: 600; display: inline-flex; align-items: center; gap: 6px;
}
.chapter-table { width: 100%; border-collapse: collapse; }
.chapter-table th {
  color: #8b9bb4; font-size: 12px; font-weight: 700; text-align: left;
  padding: 8px 6px; border-bottom: 1px solid #2a3548;
}
.chapter-table td { padding: 8px 6px; border-bottom: 1px solid #243044; }
.ch-scroll { flex: 1; overflow: auto; min-height: 0; }
.ch-pager { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.page-num {
  width: 28px; text-align: center; background: #4f6ef7; color: #fff; border-radius: 6px;
  font-weight: 700; padding: 4px 0;
}

.hist-embed { display: flex; gap: 14px; flex: 1; min-height: 0; }
.hist-left { flex: 1; display: flex; flex-direction: column; min-width: 0; gap: 12px; }
.hist-tabs { background: #151c2a; border: 1px solid #2a3548; border-radius: 14px; padding: 4px 6px; display: flex; gap: 4px; }
.hist-tabs button {
  background: transparent; border: none; color: #8b9bb4; font-weight: 700;
  padding: 8px 14px; font-size: 13px; border-radius: 8px;
}
.hist-tabs button.active { background: #4f6ef7; color: #fff; }
.hist-dock {
  width: 340px; flex: 0 0 340px; background: #151c2a; border: 1px solid #2a3548; border-radius: 14px;
  padding: 14px 16px; overflow: auto;
}
.hist-dock[hidden] { display: none !important; }
.hist-user { display: flex; align-items: center; gap: 8px; }
.hist-user .av, .hist-cover {
  width: 32px; height: 32px; border-radius: 16px; background: #344969; display: flex;
  align-items: center; justify-content: center; font-size: 11px; font-weight: 700; overflow: hidden; flex: 0 0 32px;
}
.hist-cover { border-radius: 6px; width: 28px; height: 36px; flex-basis: 28px; font-size: 14px; }
.hist-cover img { width: 28px; height: 36px; object-fit: cover; }
.date-box { display: flex; align-items: center; gap: 8px; background: #151c2a; border: 1px solid #2a3548; border-radius: 10px; padding: 4px 8px; }
.hist-top { display: flex; align-items: center; gap: 8px; }
.status-pill { display: inline-flex; align-items: center; gap: 6px; border-radius: 13px; padding: 4px 10px; font-size: 12px; font-weight: 700; }
.ch-avatars { display: flex; gap: 4px; }
.kind-chip {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 8px;
  padding: 4px 10px; font-size: 12px; font-weight: 700;
}
.hist-row { cursor: pointer; }
.hist-row.active { background: #1a2744; }

.team-dialog-table { width: 100%; }
.drop-menu {
  position: fixed; background: #1a2333; border: 1px solid #2a3548; border-radius: 8px;
  min-width: 220px; z-index: 40; padding: 6px;
}
.drop-menu button { display: block; width: 100%; text-align: left; background: transparent; border: none; padding: 8px 10px; border-radius: 6px; }
.drop-menu button:hover { background: #162033; }

@media (max-width: 1200px) {
  .title-header { height: auto; flex-wrap: wrap; flex: none; }
  .title-info, .team-card, .title-actions { height: auto; }
  .hist-embed { flex-direction: column; }
  .hist-dock { width: auto; flex: none; }
}

/* Codex: match the native title summary while keeping populated descriptions usable. */
.page-title, .title-name, .metric .n { font-weight: 700; }
.title-info > div:empty { display: none; }
.title-info:has(.title-blurb:empty):not(:has(.genre-chip)) { padding-top: 44px; }
.title-info:has(.title-blurb:empty):not(:has(.genre-chip)) .title-name { margin-bottom: auto; }
.title-info:has(.title-blurb:empty):not(:has(.genre-chip)) .metrics { margin-top: 0; }

@media (min-width: 1101px) and (max-width: 1350px) {
  .title-header .team-card { width: 260px; flex-basis: 260px; }
  .title-info { min-width: 0; }
  .title-info .metrics { width: 100%; }
  .title-info .metric { flex: 1; min-width: 0; padding: 8px 6px; }
  .title-info .metric .c { white-space: normal; overflow-wrap: anywhere; }
  .title-name { font-size: 24px; }
}
