/* ============================================================================
   Moart 이미지 번역 작업 내역 v2 — 검색영역 고도화 & 리스트 / 갤러리 (5x5) 전환
   ============================================================================ */
.dash-section[data-section="image-translation-history"] .ith-toolbar {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--bg-surface, #ffffff);
  border: 1px solid var(--border-default, #e2e8f0);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.04);
}
.dash-section[data-section="image-translation-history"] .ith-row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.dash-section[data-section="image-translation-history"] .ith-search-box {
  flex: 1 1 240px;
  min-width: 200px;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-default, #cbd5e1);
  background: var(--bg-subtle, #f8fafc);
  color: var(--text-secondary, #64748b);
  box-sizing: border-box;
}
.dash-section[data-section="image-translation-history"] .ith-search-box input {
  width: 100%;
  border: 0;
  outline: none;
  background: transparent;
  color: var(--text-primary, #0f172a);
  font: inherit;
  font-size: 13px;
}
.dash-section[data-section="image-translation-history"] .ith-ctrl {
  height: 38px;
  min-height: 38px;
  line-height: 36px;
  padding: 0 28px 0 10px !important;
  border-radius: 9px;
  border: 1px solid var(--border-default, #cbd5e1);
  background-color: var(--bg-subtle, #f8fafc);
  color: var(--text-primary, #0f172a);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  box-sizing: border-box;
  width: auto !important;
}
.dash-section[data-section="image-translation-history"] .ith-ctrl.is-sm {
  height: 32px;
  min-height: 32px;
  line-height: 30px;
  padding: 0 24px 0 9px !important;
  font-size: 12px;
}
.dash-section[data-section="image-translation-history"] .ith-dates {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-secondary, #64748b);
}
.dash-section[data-section="image-translation-history"] .ith-submit-btns {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.dash-section[data-section="image-translation-history"] .ith-submit-btns .btn {
  height: 38px;
  min-height: 38px;
  padding: 0 16px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.dash-section[data-section="image-translation-history"] .ith-row2 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border-default, #e2e8f0);
}
.dash-section[data-section="image-translation-history"] .ith-row2-left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-section[data-section="image-translation-history"] .ith-quick-dates {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
.dash-section[data-section="image-translation-history"] .ith-chip {
  height: 30px;
  padding: 0 11px;
  border-radius: 999px;
  border: 1px solid var(--border-default, #cbd5e1);
  background: var(--bg-surface, #ffffff);
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.dash-section[data-section="image-translation-history"] .ith-chip.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}
html[data-theme="dark"] .dash-section[data-section="image-translation-history"] .ith-chip.is-active {
  background: #4f46e5;
  border-color: #4f46e5;
}
.dash-section[data-section="image-translation-history"] .ith-del-btn {
  width: auto !important;
  flex: 0 0 auto;
  height: 30px !important;
  min-height: 30px !important;
  padding: 0 12px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  white-space: nowrap;
}

.dash-section[data-section="image-translation-history"] .ith-row2-right {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.dash-section[data-section="image-translation-history"] .ith-count-text {
  font-size: 12.5px;
  color: var(--text-secondary, #475569);
}
.dash-section[data-section="image-translation-history"] .ith-view-switch {
  display: inline-flex;
  align-items: center;
  padding: 3px;
  border-radius: 9px;
  background: var(--bg-subtle, #f1f5f9);
  border: 1px solid var(--border-default, #cbd5e1);
  gap: 3px;
}
.dash-section[data-section="image-translation-history"] .ith-view-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 26px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--text-secondary, #475569);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}
.dash-section[data-section="image-translation-history"] .ith-view-btn.is-active {
  background: #4f46e5;
  color: #ffffff;
}

/* 5x5 갤러리 그리드 */
.ith-gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}
.ith-gallery-grid[hidden],
.translation-list-table-wrap[hidden] {
  display: none !important;
}
.ith-gal-card {
  display: flex;
  flex-direction: column;
  border-radius: 12px;
  border: 1px solid var(--border-default, #e2e8f0);
  background: var(--bg-surface, #ffffff);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.ith-gal-card:hover {
  border-color: #6366f1;
  box-shadow: 0 8px 20px -10px rgba(79, 70, 229, 0.24);
  transform: translateY(-2px);
}
.ith-gal-card.is-selected {
  border-color: #4f46e5;
  box-shadow: 0 0 0 2px rgba(79, 70, 229, 0.22);
}
.ith-gal-thumb-wrap {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--bg-subtle, #f1f5f9);
  overflow: hidden;
}
.ith-gal-thumb-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
}
.ith-gal-thumb-btn img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ith-gal-check {
  position: absolute;
  left: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.2);
  display: grid;
  place-items: center;
  z-index: 2;
  cursor: pointer;
}
.ith-gal-check input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: #4f46e5;
  cursor: pointer;
}
.ith-gal-pts {
  position: absolute;
  right: 7px;
  top: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.9);
  color: #ffffff;
  font-size: 10.5px;
  font-weight: 800;
  z-index: 2;
}
.ith-gal-tag {
  position: absolute;
  left: 7px;
  bottom: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  color: #ffffff;
  font-size: 10px;
  font-weight: 700;
}
.ith-gal-body {
  padding: 10px;
  display: grid;
  gap: 5px;
}
.ith-gal-title {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-primary, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ith-gal-date {
  font-size: 10.5px;
  color: var(--text-secondary, #64748b);
}
.ith-gal-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
  margin-top: 3px;
}
.ith-gal-actions .btn {
  height: 30px;
  min-height: 30px;
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 7px;
  justify-content: center;
  white-space: nowrap;
}

@media (max-width: 1240px) {
  .ith-gallery-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 920px) {
  .ith-gallery-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
  .ith-gallery-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
