/* ==========================================================================
   Avezz — Universal Pack / Folder View (1:1 UI/pack.html)
   Used by Pack/PackList.php, Text/Book.php, Text/Wiki.php, Text/Course.php,
   and Table/Table.php (Dataset).
   ========================================================================== */

.pack-page {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 18px 64px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pack-page .line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pack-page .line-clamp-3 {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pack-page .line-clamp-6 {
  display: -webkit-box;
  -webkit-line-clamp: 6;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ==========================================================================
   PACK HERO CARD
   ========================================================================== */
.pack-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(250px, 360px) 1fr;
}

.pack-hero--no-cover {
  grid-template-columns: 1fr;
}

.pack-cover {
  position: relative;
  min-height: 230px;
  background: var(--pk-grad, linear-gradient(135deg, #1e293b, #312e81));
  overflow: hidden;
}

.pack-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.5s ease;
}

.pack-hero:hover .pack-cover img {
  transform: scale(1.03);
}

.pack-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, transparent 45%, rgba(0, 0, 0, 0.55) 100%);
  pointer-events: none;
}

.pack-cover-badges {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.frosted-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.pack-cover-count {
  position: absolute;
  bottom: 12px;
  left: 12px;
}

.pack-body {
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 13px;
  min-width: 0;
}

.pack-head-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.pack-title-col {
  min-width: 0;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-title {
  font-size: clamp(21px, 2.6vw, 26px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--text);
}

.pack-desc {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 1.55;
  max-width: 68ch;
}

.pack-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.pack-author {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-weight: 600;
  text-decoration: none;
}

.pack-author:hover {
  color: var(--accent);
}

.pk-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-alt);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  display: inline-grid;
  place-items: center;
  position: relative;
  overflow: hidden;
  flex-shrink: 0;
}

.pk-avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.pk-avatar-sm {
  width: 22px;
  height: 22px;
  font-size: 9.5px;
}

.pack-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pack-tag-pill {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--surface-alt);
  border: 1px solid var(--border);
  text-decoration: none;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.pack-tag-pill:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pack-actions {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pack-actions-left {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

/* Bigger Square Hero Social Buttons (UI/pack.html) */
.pk-hero-socials {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.pk-social-btn {
  min-height: 52px;
  min-width: 58px;
  padding: 6px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  cursor: pointer;
  text-decoration: none;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.pk-social-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  line-height: 1;
}

.pk-social-label {
  font-size: 10.5px;
  font-weight: 600;
  line-height: 1.1;
  color: var(--text-secondary);
}

.pk-social-btn.active .pk-social-label {
  color: inherit;
}

.pk-social-btn .icon {
  width: 18px;
  height: 18px;
}

.pk-social-btn:hover {
  background: var(--surface-hover);
  border-color: var(--border-strong);
}

.pk-social-btn:active {
  transform: scale(0.97);
}

.pk-social-btn.like.active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.pk-social-btn.deslike.active {
  background: var(--negative-bg);
  color: var(--negative);
  border-color: color-mix(in srgb, var(--negative) 38%, transparent);
}

.pk-social-btn.share.active {
  background: var(--pending-bg);
  color: var(--star);
  border-color: color-mix(in srgb, var(--star) 45%, transparent);
}

/* Inline Multi-Image Drop Panel directly below Hero Card (Gallery) */
.pk-gallery-drop-panel {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 14px;
}

.pk-dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 16px 18px;
  border-radius: 12px;
  border: 1.5px dashed var(--border-strong, var(--border));
  background: var(--surface-subtle, var(--surface-alt));
  color: var(--text);
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pk-dropzone:hover,
.pk-dropzone.is-dragover {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.pk-dropzone-icon {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  display: inline-grid;
  place-items: center;
  color: var(--accent);
  flex-shrink: 0;
}

.pk-dropzone-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pk-dropzone-title {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
}

.pk-dropzone-hint {
  font-size: 12px;
  color: var(--text-secondary);
}

.pk-drop-queue {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}

.pk-drop-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
}

.pk-drop-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 8px;
  background: var(--surface);
  display: block;
}

.pk-drop-remove {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 0;
  background: rgba(15, 23, 42, 0.72);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.pk-drop-remove:hover {
  background: var(--negative);
}

.pk-drop-card .input {
  height: 32px;
  font-size: 12.5px;
  padding: 0 8px;
}

.pk-drop-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 8px;
  border-top: 1px solid var(--border);
}

.pk-drop-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Inline Collapsible Comments Panel (below Hero / Drop Panel) */
.pk-comments-panel {
  width: 100%;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.pk-social-btn[data-pk-open-comments].active {
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 40%, transparent);
}

.pk-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  font-weight: 700;
}

.pk-sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pk-sheet-close:hover {
  background: var(--surface-muted);
  color: var(--text);
}

.pk-sheet-list {
  max-height: 460px;
  overflow-y: auto;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pk-sheet-list .disc-tree {
  width: 100%;
}

.pk-sheet-empty {
  font-size: 13px;
  color: var(--text-secondary);
  text-align: center;
  padding: 20px 8px;
}

.pk-sheet-input-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.pk-sheet-input {
  flex: 1;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 13px;
  outline: 0;
}

.pk-sheet-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.pk-sheet-send {
  height: 36px;
  padding: 0 15px;
  border-radius: 999px;
  border: 0;
  background: var(--accent);
  color: #ffffff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}

.pk-sheet-send:hover {
  background: var(--accent-hover);
}

@media (max-width: 720px) {
  .pk-comments-sheet {
    top: auto;
    left: 0;
    right: 0;
    bottom: 0;
    max-width: none;
    height: 75dvh;
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    transform: translateY(100%);
  }
  .pk-comments-sheet.open {
    transform: translateY(0);
  }
}

/* Course Resume Widget inside Hero */
.course-hero-resume {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-subtle);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.course-hero-resume-meta {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 12px;
  color: var(--text-secondary);
}

.course-hero-resume-meta strong {
  font-size: 13px;
  color: var(--text);
  font-weight: 700;
}

/* Edit Pack Drawer */
.pack-edit-drawer {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  padding: 20px 22px;
}

.pack-edit-drawer.hide {
  display: none;
}

.pack-edit-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.pack-edit-full {
  grid-column: 1 / -1;
}

/* ==========================================================================
   CONTROL BAR
   ========================================================================== */
.control-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 10px 12px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 10px;
}

.control-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

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

.control-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.pk-search-box {
  position: relative;
  flex: 1 1 140px;
  max-width: 220px;
  display: flex;
  align-items: center;
}

.pk-search-box .pk-search-ic {
  position: absolute;
  left: 10px;
  color: var(--text-tertiary);
  pointer-events: none;
  display: inline-flex;
}

.pk-search-input {
  width: 100%;
  height: 34px;
  padding: 0 28px 0 32px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--text);
  font-size: 12.5px;
  outline: none;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.pk-search-input:focus {
  border-color: var(--accent);
  background: var(--surface);
}

.pk-search-clear {
  position: absolute;
  right: 6px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  border: 0;
  background: transparent;
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.pk-search-clear:hover {
  background: var(--surface-hover);
  color: var(--text);
}

.pk-item-count {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
  flex-shrink: 0;
}

.pk-per-page {
  height: 34px;
  padding: 0 8px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  outline: none;
  cursor: pointer;
}

.pk-segment {
  display: inline-flex;
  align-items: center;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.pk-seg-btn {
  height: 28px;
  padding: 0 10px;
  border-radius: 7px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.pk-seg-btn:hover {
  color: var(--text);
}

.pk-seg-btn[aria-pressed="true"] {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
}

/* Order Banner */
.order-banner {
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 32%, transparent);
  border-radius: 14px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 12.5px;
}

.order-banner.hide {
  display: none;
}

.order-banner-left {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--text);
  flex-wrap: wrap;
}

.order-banner-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.dirty-dot {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
}

.order-cap-pill {
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
}

/* Pagination */
.pagination-center {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 2px 0;
}

.page-nav {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 4px;
  box-shadow: var(--shadow);
}

.page-nav.inline-nav {
  background: var(--surface-alt);
  box-shadow: none;
  padding: 3px;
  border-radius: 10px;
}

.page-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 8px;
  border-radius: 8px;
  border: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.page-btn:hover:not(:disabled) {
  background: var(--surface-hover);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-btn[aria-current="page"] {
  background: var(--pill-active-bg);
  color: var(--pill-active-text);
}

.page-ellipsis {
  padding: 0 4px;
  color: var(--text-tertiary);
  font-weight: 700;
}

/* ==========================================================================
   ITEMS LAYOUTS — GRID / LIST / MINI / ORDER
   ========================================================================== */
.pack-items.items-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  align-items: stretch;
}

.pack-items.items-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.pack-items.items-order {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pack-items.items-mini {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.pack-item-slot.is-hidden {
  display: none !important;
}

/* Mode visibility toggles on each rendered item slot */
.pack-items.items-grid .pk-view-list,
.pack-items.items-grid .pk-view-mini,
.pack-items.items-grid .pk-view-order {
  display: none;
}

.pack-items.items-list .pk-view-grid,
.pack-items.items-list .pk-view-mini,
.pack-items.items-list .pk-view-order {
  display: none;
}

.pack-items.items-mini .pk-view-grid,
.pack-items.items-mini .pk-view-list,
.pack-items.items-mini .pk-view-order {
  display: none;
}

.pack-items.items-order .pk-view-grid,
.pack-items.items-order .pk-view-list,
.pack-items.items-order .pk-view-mini {
  display: none;
}

/* ==========================================================================
   CARD A: IMAGE-FOCUS CARD (4:5 dark poster card)
   ========================================================================== */
.card-img-focus {
  position: relative;
  background: #0b0d12;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 18px 36px -14px rgba(15, 23, 42, 0.35);
  aspect-ratio: 4 / 5;
  min-height: 390px;
  display: flex;
  flex-direction: column;
}

.card-img-focus .cif-media {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.92;
  transition: transform 0.55s ease, opacity 0.25s ease;
}

.card-img-focus:hover .cif-media {
  transform: scale(1.04);
  opacity: 1;
}

.cif-link-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.cif-top {
  position: relative;
  z-index: 2;
  padding: 14px 14px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.68) 0%, transparent 100%);
  pointer-events: none;
}

.cif-user {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  pointer-events: auto;
  text-decoration: none;
}

.cif-handle {
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cif-bottom {
  position: relative;
  z-index: 2;
  margin-top: auto;
  padding: 40px 16px 14px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.45) 60%, transparent 100%);
  display: flex;
  flex-direction: column;
  gap: 6px;
  pointer-events: none;
}

.cif-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.cif-tag {
  font-size: 10.5px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.8);
}

.cif-title {
  color: #fff;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.25;
}

.cif-caption {
  color: rgba(255, 255, 255, 0.84);
  font-size: 12.5px;
  line-height: 1.4;
}

.cif-socials {
  margin-top: 4px;
  pointer-events: auto;
}

/* ==========================================================================
   CARD B: TEXT-FOCUS CARD (Grid)
   ========================================================================== */
.card-txt-focus {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  min-height: 360px;
  height: 100%;
  transition: transform 0.2s ease, border-color 0.2s ease;
  overflow: visible;
}

.card-txt-focus.has-open-menu,
.card-list.has-open-menu {
  position: relative;
  z-index: 40;
}

.card-txt-focus:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--border));
}

.ctf-media-wrap {
  position: relative;
  height: 165px;
  background: var(--surface-alt);
  border-radius: 17px 17px 0 0;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}

.ctf-media-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.card-txt-focus:hover .ctf-media-wrap img {
  transform: scale(1.04);
}

.ctf-cat-badge {
  position: absolute;
  bottom: 8px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10.5px;
  font-weight: 700;
}

.ctf-body {
  padding: 15px 16px 13px;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 8px;
  min-width: 0;
}

.ctf-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
}

.card-txt-focus--no-img .ctf-main {
  justify-content: center;
  gap: 12px;
  padding: 14px 4px;
}

.ctf-title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
  color: var(--text);
  text-decoration: none;
}

.card-txt-focus--no-img .ctf-title {
  font-size: 21px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}

.ctf-title:hover {
  color: var(--accent);
}

.ctf-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.card-txt-focus--no-img .ctf-desc {
  font-size: 14.5px;
  line-height: 1.6;
}

.c2-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
  min-width: 0;
}

.c2-footer.c2-inline {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  gap: 8px;
}

.c2-footer .action-group {
  flex-shrink: 0;
  gap: 8px;
  margin-left: auto;
}

.c2-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 1 1 auto;
  min-width: 0;
  text-decoration: none;
}

.c2-handle {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   CARD C: LIST CARD (Image on Left)
   ========================================================================== */
.card-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  display: flex;
  min-height: 184px;
  overflow: visible;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.card-list:hover {
  box-shadow: var(--shadow-card);
  border-color: color-mix(in srgb, var(--accent) 30%, var(--border));
}

.cl-media {
  width: 32%;
  min-width: 200px;
  max-width: 290px;
  position: relative;
  background: var(--surface-alt);
  border-radius: 17px 0 0 17px;
  overflow: hidden;
  flex-shrink: 0;
  display: block;
}

.cl-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.card-list:hover .cl-media img {
  transform: scale(1.04);
}

.cl-focus-pill {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 8px;
  border-radius: 7px;
  background: rgba(15, 23, 42, 0.68);
  backdrop-filter: blur(6px);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.cl-content {
  flex: 1;
  min-width: 0;
  padding: 16px 18px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cl-cats {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.cl-cat-tag {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 3px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-secondary);
}

.cl-title {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
  text-decoration: none;
}

.cl-title:hover {
  color: var(--accent);
}

.cl-desc {
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text-secondary);
}

/* ==========================================================================
   CARD D: EDIT ORDER ROW (Drag & Drop Sidebar)
   ========================================================================== */
.card-order {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  display: flex;
  align-items: stretch;
  min-height: 74px;
  cursor: grab;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
}

.card-order:hover {
  border-color: color-mix(in srgb, var(--accent) 45%, var(--border));
}

.card-order:active {
  cursor: grabbing;
}

.card-order.is-dragging {
  opacity: 0.42;
}

.card-order.drop-before {
  box-shadow: 0 -3px 0 0 var(--accent), var(--shadow);
}

.card-order.drop-after {
  box-shadow: 0 3px 0 0 var(--accent), var(--shadow);
}

.order-sidebar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 10px;
  background: var(--surface-alt);
  border-right: 1px solid var(--border);
  border-radius: 13px 0 0 13px;
  flex-shrink: 0;
}

.drag-grip {
  color: var(--text-tertiary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 4px 2px;
  cursor: grab;
}

.order-badge {
  min-width: 30px;
  height: 24px;
  padding: 0 6px;
  border-radius: 7px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 11.5px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.order-arrows {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.order-arrow-btn {
  width: 24px;
  height: 22px;
  border-radius: 6px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.12s ease, border-color 0.12s ease;
}

.order-arrow-btn:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
}

.order-arrow-btn:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.order-body {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.order-thumb {
  width: 60px;
  height: 48px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-alt);
}

.order-info {
  flex: 1;
  min-width: 0;
}

.order-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.order-meta {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.order-remove-btn {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  border: 0;
  background: transparent;
  color: var(--text-secondary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}

.order-remove-btn:hover {
  color: var(--negative);
  background: var(--negative-bg);
}

/* ==========================================================================
   CARD E: MINI MODE (Compact Row)
   ========================================================================== */
.card-mini {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 13px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s ease, background 0.15s ease;
}

.card-mini:hover {
  border-color: color-mix(in srgb, var(--accent) 40%, var(--border));
  background: var(--surface-alt);
}

.mini-idx {
  width: 24px;
  font-size: 11px;
  font-weight: 800;
  color: var(--text-tertiary);
  text-align: center;
  flex-shrink: 0;
}

.mini-thumb {
  width: 44px;
  height: 44px;
  border-radius: 9px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--surface-alt);
}

.mini-info {
  flex: 1;
  min-width: 0;
}

.mini-title {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 2px;
}

.mini-sub {
  font-size: 11.5px;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-focus-dot {
  font-size: 9.5px;
  font-weight: 800;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* Empty & Parent Packs */
.pack-empty {
  background: var(--surface);
  border: 1px dashed var(--border-strong);
  border-radius: 18px;
  padding: 48px 20px;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.pack-empty.hide {
  display: none;
}

.pack-comments-wrap {
  margin-top: 8px;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1060px) {
  .control-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }
  .control-center {
    order: 3;
    width: 100%;
    padding-top: 6px;
    border-top: 1px solid var(--border);
  }
}

@media (max-width: 980px) {
  .pack-items.items-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .pack-hero {
    grid-template-columns: 1fr;
  }
  .pack-cover {
    aspect-ratio: 16 / 9;
    min-height: 190px;
  }
  .pack-edit-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .pack-page {
    padding: 14px 12px 56px;
  }
  .pack-items.items-grid {
    grid-template-columns: 1fr;
  }
  .pack-items.items-mini {
    grid-template-columns: 1fr;
  }
  .card-list {
    flex-direction: column;
  }
  .cl-media {
    width: 100%;
    max-width: none;
    min-width: 0;
    height: 185px;
  }
  .cl-content {
    padding: 14px;
  }
}
