/* Văn bản của bạn's list in design system v3 (texts-redesign.md, design A): the heading and the text being read over
   both columns, the filters at the left, the ways to add a text and the cards at the right; on a phone one column. */

.ct-page.is-tab_user_media .ct-scroll {
  background: var(--bg);
  color: var(--text);
}

.ct-page.is-tab_user_media .ct-columns {
  padding: 0 32px 32px;
}

/* The top: the heading, then the hero card. */
.ut-top {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 0 32px 24px;
}

.ut-caption-part {
  white-space: nowrap;
}

/* The text being read: what it is beside the mascot, then the bar and "Đọc tiếp" under both. */
.ut-hero {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px 20px 20px;
}

.ut-hero-top {
  display: flex;
  align-items: center;
  gap: 16px;
}

.ut-hero-text {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
}

.ut-hero-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  white-space: nowrap;
}

.ut-hero-source {
  overflow: hidden;
  color: var(--accent-soft);
  font: 600 12px/16px var(--font);
  text-overflow: ellipsis;
}

.ut-hero-title {
  margin: 6px 0 0;
  overflow: hidden;
  color: var(--text);
  font: 700 20px/28px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ut-hero-preview {
  margin: 2px 0 0;
  overflow: hidden;
  color: var(--text-muted);
  font: 400 14px/22px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ut-hero-mascot {
  --mascot-px: 88px;
  margin: -8px -6px -8px 0;
}

.ut-hero-bottom {
  display: flex;
  align-items: center;
  gap: 20px;
}

.ut-hero-progress {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.ut-hero-caption {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-muted);
  font: 500 12px/16px var(--font);
}

.ut-hero-percent {
  color: var(--text);
  font-size: 15px;
  line-height: 1;
  white-space: nowrap;
}

.ut-hero-go {
  padding: 0 28px;
}

/* The list could not be had: its code in small words, "Thử lại" under the card's words. */
.ut-failure-code {
  margin: 8px 0 0;
  color: var(--text-tertiary);
  font: var(--type-caption);
}

.ut-failure-retry {
  align-self: flex-start;
}

/* Nothing kept yet: the way in, then a card for each way to add a text. */
.ut-hero.is-empty {
  padding: 24px 24px 24px 28px;
}

.ut-hero.is-empty .ut-hero-mascot {
  --mascot-px: 96px;
}

.ut-empty-title {
  margin: 0;
  font: 700 22px/30px var(--font);
  text-wrap: balance;
}

.ut-empty-body {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--text-muted);
  font: 400 15px/24px var(--font);
  text-wrap: pretty;
}

.ut-add-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.ut-add-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  padding: 20px;
}

.ut-add-card h3 {
  margin: 4px 0 0;
  font: 700 16px/22px var(--font);
}

.ut-add-card p {
  margin: 0;
  color: var(--text-muted);
  font: 400 13px/20px var(--font);
  text-wrap: balance;
}

.ut-add-card .btn-text {
  margin-top: auto;
}

/* The filters: the search, the order, the origins with their counts. */
@media (min-width: 901px) {
  .ut-panel {
    padding: 0;
  }
}

.ut-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.ut-panel .ct-search {
  height: 44px;
  border: 1px solid var(--field-border);
  border-radius: var(--radius-md);
  background: var(--surface);
}

.ut-panel .ct-search:hover {
  border-color: var(--field-border);
}

.ut-panel .ct-search:focus-within {
  border: 1px solid var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent);
}

.ut-panel .ct-search-label {
  display: none;
}

.ut-panel .ct-search-icon {
  order: -1;
  margin: 0 0 0 14px;
  color: var(--text-tertiary);
}

.ut-panel .ct-search-input {
  padding: 0 14px 0 10px;
  color: var(--text);
  font-size: 14px;
}

.ut-panel .ct-search-input::placeholder,
.ut-panel .ct-search-input:focus::placeholder {
  color: var(--text-tertiary);
}

.ut-origins {
  overflow: hidden;
}

.ut-origins-head {
  display: flex;
  align-items: center;
  min-height: 36px;
  margin: 0;
  padding: 8px 16px;
  background: var(--surface-soft);
  color: var(--text-label);
  font: 600 12px/16px var(--font);
}

.ut-origin {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 8px 12px 8px 16px;
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--text);
  font: 500 14px/20px var(--font);
  text-align: left;
  cursor: pointer;
}

.ut-origin:hover {
  background: var(--surface-soft);
}

.ut-origin[aria-pressed="true"] {
  background: var(--tonal);
}

.ut-origin[aria-pressed="true"] .ut-origin-name {
  color: var(--tonal-text);
  font-weight: 600;
}

.ut-origin-count {
  margin-left: auto;
  color: var(--text-muted);
  font: 600 13px/1 var(--font);
}

/* Over the list: the ways to add a text, then the list's heading. */
.ut-list-top {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 12px;
}

.ut-adds {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 4px;
}

.ut-add {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  min-height: 72px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.ut-add:hover {
  background: var(--surface-soft);
}

.ut-add:disabled {
  cursor: progress;
}

.ut-add-words {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ut-add-words b {
  font: 600 15px/20px var(--font);
  white-space: nowrap;
}

.ut-add-words span {
  color: var(--text-muted);
  font: 400 13px/18px var(--font);
  text-wrap: balance;
}

.ut-add-go {
  flex: none;
  margin-left: auto;
  color: var(--text-tertiary);
}

.ut-find {
  display: none;
  margin-left: auto;
}

/* A text's card; its title's link covers the card, the ⋯ button above it. */
.ct-cards.is-tab_user_media {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 12px;
}

.ut-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
  padding: 12px 8px 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--elevation-1);
}

.ut-card:hover {
  border-color: var(--chip-edge);
}

.ut-card:has(.ut-card-link:focus-visible) {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.ut-card-top {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.ut-card-who {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.ut-card-title {
  margin: 0;
  overflow: hidden;
  font: 700 17px/24px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ut-card-link {
  color: var(--text);
  text-decoration: none;
}

.ut-card-link:focus-visible {
  outline: 0;
}

.ut-card-link::after {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  content: "";
}

.ut-card-more {
  position: relative;
  z-index: 1;
}

.ut-state {
  overflow: hidden;
  color: var(--text-muted);
  font: 500 13px/18px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ut-state.is-reading {
  color: var(--yellow-tag-text);
}

.ut-state.is-read {
  color: var(--success);
}

.ut-state-when {
  display: none;
}

.ut-card-preview {
  display: -webkit-box;
  min-height: 72px;
  margin: 0;
  padding-right: 6px;
  overflow: hidden;
  color: var(--text-label);
  font: 400 14px/24px var(--font);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.ut-card-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin-top: auto;
  padding: 10px 6px 0 0;
  border-top: 1px solid var(--line);
}

.ut-card-when {
  margin-left: auto;
  color: var(--text-muted);
  font: 500 12px/16px var(--font);
  white-space: nowrap;
}

/* A title or opening words in Chinese take the Chinese face (v3 type.chinese). */
:is(.ut-card-title, .ut-card-preview, .ut-hero-title, .ut-hero-preview, .ut-sheet-name b):lang(zh) {
  font-family: var(--font-zh);
}

/* The menu's sheet on a phone: the text it acts on. */
.ut-sheet-name {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.ut-sheet-name b {
  overflow: hidden;
  color: var(--text);
  font: 700 16px/22px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ut-sheet-name span {
  overflow: hidden;
  color: var(--text-muted);
  font: 400 12px/16px var(--font);
  white-space: nowrap;
  text-overflow: ellipsis;
}

/* Small windows: the filters in the drawer, opened from the list's heading. */
@media (max-width: 900px) {
  .ct-page.is-tab_user_media .ct-filters {
    background: var(--surface);
  }

  .ut-find {
    display: inline-flex;
  }

  .ut-add-words span,
  .ut-add-go {
    display: none;
  }

  .ut-add-cards {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* A phone: one column at 16 px margins, the hero's button the whole width, the cards as rows. */
@media (max-width: 600px) {
  .ut-top {
    padding: 0 16px 16px;
  }


  .ct-page.is-tab_user_media .ct-columns {
    padding: 0 16px 24px;
  }

  .ut-hero {
    gap: 12px;
    padding: 14px 16px 16px;
  }

  .ut-hero-title {
    font-size: 18px;
    line-height: 26px;
  }

  .ut-hero-mascot {
    --mascot-px: 80px;
    margin: -6px -6px -6px 0;
  }

  .ut-hero-bottom {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .ut-hero.is-empty {
    padding: 20px 16px 20px 20px;
  }

  .ut-hero.is-empty .ut-hero-top {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .ut-hero.is-empty .ut-hero-text {
    display: contents;
  }

  .ut-empty-title {
    flex: 1 1 0%;
    min-width: 0;
    font-size: 20px;
    line-height: 28px;
  }

  .ut-empty-body {
    flex: 1 1 100%;
    order: 3;
    margin: 0;
  }

  .ut-hero.is-empty .ut-hero-mascot {
    --mascot-px: 80px;
  }

  .ut-failure-retry {
    align-self: stretch;
  }

  .ut-hero.is-empty .ut-failure-code {
    flex: 1 1 100%;
    order: 4;
    margin: 0;
  }

  .ut-hero-go {
    width: 100%;
  }

  .ut-adds {
    padding: 8px 4px;
  }

  .ut-add {
    flex-direction: column;
    justify-content: center;
    gap: 6px;
    min-height: 88px;
    padding: 8px 4px;
    text-align: center;
  }

  .ut-add-words b {
    font: 500 12px/16px var(--font);
    white-space: normal;
  }

  .ct-cards.is-tab_user_media {
    gap: 0;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    background: var(--surface);
  }

  .ut-card {
    justify-content: center;
    min-height: 64px;
    padding: 8px 4px 8px 16px;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .ut-card + .ut-card {
    border-top: 1px solid var(--line);
  }

  .ut-card:hover {
    border-color: var(--line);
  }

  .ut-card-title {
    font-size: 16px;
    line-height: 22px;
  }

  .ut-card-preview,
  .ut-card-foot {
    display: none;
  }

  .ut-state {
    flex-shrink: 0;
    overflow: visible;
  }

  .ut-state-when {
    display: block;
    color: var(--text-tertiary);
    font: var(--type-caption);
  }

  .ut-section .ds-section-sub {
    display: none;
  }
}
