/* ---------------------------------------------------------------
   Article Image Search — design system
   --------------------------------------------------------------- */

:root {
  /* Palette pulled from the actual product photography: deep teal, burnt
     terracotta, warm gold, ink navy — a catalog system, not generic SaaS. */
  --primary: #0f7a72;
  --primary-dark: #0b5950;
  --primary-darker: #083f39;
  --primary-light: #e2f2f0;
  --accent: #c1572e;
  --accent-dark: #a2441f;
  --accent-light: #fbe9e0;
  --gold: #c08a2e;
  --gold-light: #faf0dc;
  --navy: #22304a;
  --bg: #faf6f0;
  --surface: #ffffff;
  --border: #e9e2d6;
  --text: #2a241f;
  --text-muted: #6f6659;
  --text-faint: #a39a8c;
  --success: #4f7a42;
  --success-bg: #eff5e9;
  --success-border: #cfe3c0;
  --danger: #b23a2e;
  --danger-bg: #fbeae6;
  --danger-border: #f0c7bb;
  --radius-lg: 18px;
  --radius-md: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(42, 30, 20, 0.07);
  --shadow-md: 0 6px 20px rgba(42, 30, 20, 0.10);
  --shadow-lg: 0 20px 48px rgba(42, 30, 20, 0.18);
}

* { box-sizing: border-box; min-width: 0; }

html, body { max-width: 100%; overflow-x: hidden; }

body {
  font-family: "Plus Jakarta Sans", "Segoe UI", ui-sans-serif, system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---------- Top bar ---------- */

.topbar {
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar-inner {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 24px;
  height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  font-weight: 800;
  font-size: 17px;
  letter-spacing: -0.01em;
  color: var(--text);
  text-decoration: none;
}
.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--primary) 0%, #157f76 55%, var(--accent) 140%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(15, 122, 114, 0.35);
}
.brand-mark svg { width: 19px; height: 19px; }

.nav-wrap { display: flex; align-items: center; gap: 4px; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s, color 0.15s;
}
.nav a:hover { background: var(--bg); color: var(--text); }
.nav a.active { background: var(--primary-light); color: var(--primary-dark); }
.nav-icon { display: none; }

.nav-account { display: flex; align-items: center; gap: 4px; }
.nav-account .nav-user {
  margin-left: 10px;
  padding-left: 14px;
  border-left: 1px solid var(--border);
  color: var(--text-faint);
  font-size: 13px;
  text-decoration: none;
  border-radius: var(--radius-sm);
  padding-top: 6px; padding-bottom: 6px; padding-right: 8px;
  transition: background 0.15s, color 0.15s;
}
.nav-account .nav-user:hover { color: var(--text); background: var(--bg); }
.nav-account .nav-user.active { color: var(--primary-dark); background: var(--primary-light); }
.nav-account .nav-logout {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: var(--radius-sm);
  color: var(--text-faint);
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.nav-account .nav-logout svg { width: 13px; height: 13px; flex-shrink: 0; }
.nav-account .nav-logout:hover { color: var(--danger); background: var(--danger-bg); }

/* ---------- Layout ---------- */

main.wrap { max-width: 1120px; margin: 0 auto; padding: 44px 24px 80px; }

.page-header { margin-bottom: 30px; }
.page-header .eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 8px;
}
.page-header h1 { margin: 0 0 7px; font-size: 28px; letter-spacing: -0.025em; font-weight: 800; }
.page-header p { margin: 0; color: var(--text-muted); font-size: 15px; }
.page-header code {
  background: var(--primary-light);
  color: var(--primary-dark);
  padding: 1px 6px;
  border-radius: 5px;
  font-size: 13px;
}

.stat-row { display: flex; gap: 14px; margin: 22px 0 8px; flex-wrap: wrap; }
.stat-pill {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 18px;
  font-size: 13.5px;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.stat-pill .stat-icon {
  width: 34px; height: 34px;
  border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary-light);
  color: var(--primary);
  flex-shrink: 0;
}
.stat-pill .stat-icon svg { width: 17px; height: 17px; }
.stat-pill.accent .stat-icon { background: var(--accent-light); color: var(--accent); }
.stat-pill strong { color: var(--text); font-size: 17px; font-weight: 800; display: block; line-height: 1.1; }
.stat-pill span.label { font-size: 12.5px; }

.action-row { display: flex; gap: 10px; margin: 24px 0 0; flex-wrap: wrap; }

/* ---------- Buttons ---------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: #fff;
  text-decoration: none;
  border: none;
  padding: 11px 20px;
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(15, 122, 114, 0.28);
  transition: box-shadow 0.15s, transform 0.08s, background 0.15s;
}
.btn:hover { box-shadow: 0 6px 18px rgba(15, 122, 114, 0.38); transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.btn-secondary:hover { background: var(--bg); box-shadow: var(--shadow-md); }
.btn-block { width: 100%; justify-content: center; }
.btn[disabled] { opacity: 0.6; cursor: not-allowed; }

/* ---------- Cards & forms ---------- */

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 30px;
  max-width: 460px;
  box-shadow: var(--shadow-sm);
}
.card + .card { margin-top: 20px; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.field .hint { font-size: 12.5px; color: var(--text-faint); font-weight: 400; }
.field .hint-inline { font-weight: 400; color: var(--text-faint); font-size: 12px; margin-left: 2px; }
.field input[type="text"], .field input[type="password"] {
  padding: 11px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14.5px;
  font-family: inherit;
  background: var(--bg);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
  width: 100%;
}
.field input[type="text"]:focus, .field input[type="password"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px var(--primary-light);
  background: var(--surface);
}

/* ---------- Dropzone (drag & drop + preview) ---------- */

.dropzone {
  position: relative;
  border: 1.5px dashed #d9cfbc;
  border-radius: var(--radius-md);
  background: var(--bg);
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 20px;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
  overflow: hidden;
}
.dropzone:hover, .dropzone.dragover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.dropzone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.dropzone-content { display: flex; flex-direction: column; align-items: center; gap: 6px; pointer-events: none; }
.dropzone-content[hidden] { display: none; }
.dropzone-content svg { width: 30px; height: 30px; color: var(--text-faint); margin-bottom: 4px; }
.dropzone-content strong { color: var(--primary-dark); font-size: 14px; }
.dropzone-content span { font-size: 12.5px; color: var(--text-faint); }
.dropzone-preview {
  max-width: 100%;
  max-height: 220px;
  border-radius: var(--radius-sm);
  pointer-events: none;
}
.multi-preview-list {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}
.multi-preview-list[hidden] { display: none; }
.multi-preview-item { position: relative; pointer-events: none; }
.multi-preview-thumb {
  width: 64px; height: 64px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  background: var(--surface);
  display: block;
}
.multi-preview-remove {
  position: absolute; top: -7px; right: -7px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--surface);
  font-size: 13px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
  pointer-events: auto;
}
.multi-preview-remove:hover { background: #8f291f; }
.dropzone.dropzone-full { cursor: not-allowed; }
.dropzone.dropzone-full input[type="file"] { cursor: not-allowed; }

/* ---------- Messages ---------- */

.msg {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 18px;
  border: 1px solid transparent;
}
.msg.error { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.msg.ok { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }

/* ---------- Grid / tiles ---------- */

.section-title { font-size: 17px; font-weight: 800; margin: 36px 0 16px; letter-spacing: -0.01em; }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(175px, 1fr));
  gap: 18px;
}
.tile {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
.tile:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: #e3d4bb; }
.tile img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--bg); }
.tile-meta { padding: 11px 13px 13px; display: flex; flex-direction: column; gap: 4px; }
.tile-meta strong { font-size: 14.5px; font-weight: 700; }
.tile-meta .muted { font-size: 12.5px; color: var(--text-muted); }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid var(--success-border);
}

.query-tile .tile-meta { align-items: center; }

.tile-manage-link {
  align-self: flex-start;
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  text-decoration: none;
  margin-top: 2px;
}
.tile-manage-link:hover { text-decoration: underline; }

/* ---------- Gallery two-column layout (catalog + recent-searches sidebar) ---------- */

.gallery-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
  margin-top: 24px;
}
.gallery-main { min-width: 0; }
.gallery-main .section-title { margin-top: 0; }
.gallery-sidebar {
  min-width: 0;
  position: sticky;
  top: 86px; /* clears the sticky topbar */
  margin-top: -40px;
}
.gallery-sidebar .section-title { margin-top: 0; }

.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s;
}
.recent-item:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); border-color: #e3d4bb; }
.recent-item img {
  width: 54px; height: 54px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--bg);
}
.recent-item-meta { display: flex; flex-direction: column; gap: 3px; min-width: 0; padding-top: 1px; }
.recent-item-meta strong { font-size: 13.5px; font-weight: 700; }
.recent-item-meta .muted { font-size: 12px; color: var(--text-muted); }
.recent-item-meta .badge { align-self: flex-start; font-size: 10.5px; padding: 2px 8px; margin-top: 1px; }
.recent-item-time { font-size: 10.5px; color: var(--text-faint); }

@media (max-width: 880px) {
  .gallery-layout { grid-template-columns: 1fr; gap: 8px; }
  .gallery-sidebar { position: static; order: -1; margin-top: 0; }
}

/* ---------- Empty states ---------- */

.empty-state {
  text-align: center;
  padding: 60px 20px;
  border: 1.5px dashed var(--border);
  border-radius: var(--radius-lg);
  color: var(--text-muted);
  background: var(--surface);
}
.empty-state .empty-icon {
  width: 56px; height: 56px;
  margin: 0 auto 16px;
  border-radius: 16px;
  background: var(--primary-light);
  color: var(--primary);
  display: flex; align-items: center; justify-content: center;
}
.empty-state .empty-icon svg { width: 26px; height: 26px; }
.empty-state p { margin: 0 0 16px; font-size: 14.5px; }

/* ---------- Misc ---------- */

.divider { border: none; border-top: 1px solid var(--border); margin: 32px 0; }

/* ---------- Auth (login) ---------- */

.auth-shell {
  min-height: 100vh;
  display: flex;
  background: linear-gradient(160deg, #faf6f0 0%, #f5ede1 55%, #f0e6d6 100%);
}
.auth-visual {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 24px;
  padding: 60px 64px;
  background:
    radial-gradient(circle at 85% 12%, rgba(192,138,46,0.45), transparent 42%),
    radial-gradient(circle at 10% 90%, rgba(193,87,46,0.4), transparent 45%),
    linear-gradient(150deg, var(--navy) 0%, var(--primary-darker) 48%, var(--primary) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.auth-visual::before {
  content: '';
  position: absolute;
  inset: 0;
  /* Subtle chevron/zigzag motif, echoing the striped rug patterns in the catalog */
  background-image: linear-gradient(135deg, rgba(255,255,255,0.07) 25%, transparent 25%, transparent 50%, rgba(255,255,255,0.07) 50%, rgba(255,255,255,0.07) 75%, transparent 75%, transparent);
  background-size: 34px 34px;
  opacity: 0.6;
}
.auth-visual-content { position: relative; max-width: 380px; }
.auth-visual .av-mark {
  width: 52px; height: 52px;
  border-radius: 14px;
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.25);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 28px;
}
.auth-visual .av-mark svg { width: 26px; height: 26px; }
.auth-visual h2 { font-size: 27px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 14px; line-height: 1.25; }
.auth-visual p { font-size: 15px; color: rgba(255,255,255,0.82); line-height: 1.6; margin: 0; }
.auth-visual .av-points { list-style: none; padding: 0; margin: 28px 0 0; display: flex; flex-direction: column; gap: 14px; }
.auth-visual .av-points li { display: flex; align-items: flex-start; gap: 10px; font-size: 13.5px; color: rgba(255,255,255,0.88); }
.auth-visual .av-points svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; color: #f0cb8e; }

.auth-form-side {
  width: 460px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
}
.auth-form-wrap { width: 100%; max-width: 340px; }
.auth-form-wrap .af-mark {
  width: 44px; height: 44px;
  border-radius: 12px;
  background: linear-gradient(145deg, var(--primary), #157f76);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 4px 14px rgba(15, 122, 114, 0.3);
  margin-bottom: 22px;
}
.auth-form-wrap .af-mark svg { width: 22px; height: 22px; }
.auth-form-wrap h1 { font-size: 23px; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 6px; }
.auth-form-wrap > p { font-size: 14.5px; color: var(--text-muted); margin: 0 0 28px; }
.auth-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-md); }

/* ---------- Lightbox ---------- */

.lightbox-trigger { cursor: zoom-in; }

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(24, 18, 12, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.lightbox-overlay.open { opacity: 1; pointer-events: auto; }
.lightbox-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  max-width: min(640px, 92vw);
}
.lightbox-img {
  max-width: 100%;
  max-height: 68vh;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  background: var(--surface);
  display: block;
}
.lightbox-caption {
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 14px 18px;
  width: 100%;
  box-shadow: var(--shadow-md);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.lightbox-caption:empty { display: none; }
.lightbox-caption strong { font-size: 15px; }
.lightbox-caption .muted { font-size: 13px; color: var(--text-muted); }
.lightbox-close {
  position: fixed;
  top: 20px; right: 24px;
  width: 40px; height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: #fff;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.15s;
}
.lightbox-close:hover { background: rgba(255,255,255,0.28); }

body.lightbox-locked { overflow: hidden; }

@media (max-width: 480px) {
  .lightbox-close { top: 12px; right: 12px; width: 36px; height: 36px; font-size: 20px; }
}

/* ---------- Mobile ---------- */

@media (max-width: 640px) {
  .topbar-inner {
    display: grid;
    grid-template-columns: 1fr auto;
    grid-template-areas: "brand account" "navbar navbar";
    align-items: center;
    row-gap: 10px;
    column-gap: 10px;
    height: auto;
    padding: 12px 16px;
  }
  .brand { grid-area: brand; font-size: 15.5px; }
  .nav-wrap { display: contents; }

  .nav { grid-area: navbar; width: 100%; gap: 6px; background: var(--bg); padding: 4px; border-radius: var(--radius-md); }
  .nav a {
    flex: 1;
    flex-direction: column;
    gap: 3px;
    text-align: center;
    padding: 8px 4px;
    font-size: 11.5px;
    border-radius: var(--radius-sm);
  }
  .nav a.active { background: var(--surface); box-shadow: var(--shadow-sm); }
  .nav-icon { display: block; width: 19px; height: 19px; margin: 0 auto; }

  .nav-account { grid-area: account; gap: 6px; }
  .nav-account .nav-user {
    border-left: none; margin-left: 0; padding: 7px 10px;
    font-size: 15px; /* icon only on mobile, username hidden to save space */
    background: var(--bg);
  }
  .nav-account .nav-user-name { display: none; }
  .nav-account .nav-logout { background: var(--bg); width: 34px; height: 34px; }
  .nav-account .nav-logout svg { width: 16px; height: 16px; }

  main.wrap { padding: 28px 16px 56px; }
  .page-header h1 { font-size: 22px; }

  .card { width: 100%; max-width: 100%; padding: 22px; }

  .btn { padding: 11px 16px; font-size: 14px; }
  .action-row { flex-direction: column; }
  .action-row .btn { width: 100%; justify-content: center; }

  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .tile img { height: 120px; }

  .dropzone { min-height: 130px; padding: 16px; }

  .auth-shell { flex-direction: column; }
  .auth-visual { display: none; }
  .auth-form-side { width: 100%; padding: 32px 20px; }
}

@media (max-width: 360px) {
  .nav a { font-size: 12.5px; padding: 9px 2px; }
}

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 14px 24px;
  text-align: center;
  overflow-x: auto;
}
.site-footer p {
  display: inline-block;
  margin: 0;
  font-size: 12px;
  line-height: 1.8;
  color: var(--text-faint);
  white-space: nowrap;
}
.site-footer strong { color: var(--text-muted); font-weight: 700; }
.site-footer a { color: var(--text-faint); text-decoration: none; }
.site-footer a:hover { color: var(--primary); text-decoration: underline; }
.site-footer .sep { margin: 0 8px; color: var(--border); }

@media (max-width: 880px) {
  .site-footer p { white-space: normal; overflow-x: visible; }
  .site-footer .sep { margin: 0 6px; }
}

/* ---------- Article detail (manage / delete images) ---------- */

.back-link { color: inherit; text-decoration: none; }
.back-link:hover { text-decoration: underline; }

.tile-img-wrap { position: relative; }
.tile-img-wrap img { width: 100%; height: 140px; object-fit: cover; display: block; background: var(--bg); }

.tile-delete-form { position: absolute; top: 8px; right: 8px; margin: 0; }
.tile-delete-btn {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  border: none; border-radius: 50%;
  background: rgba(24, 18, 12, 0.55);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.tile-delete-btn svg { width: 15px; height: 15px; }
.tile-delete-btn:hover { background: var(--danger); transform: scale(1.06); }

/* Quick delete on the gallery tile itself, for single-image articles */
.tile-link-row { display: flex; align-items: center; gap: 10px; margin-top: 2px; }
.tile-link-row .tile-manage-link { margin-top: 0; }
.tile-quick-delete-form { margin: 0; }
.tile-delete-link {
  font-size: 12px;
  font-weight: 700;
  color: var(--danger);
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  text-decoration: none;
}
.tile-delete-link:hover { text-decoration: underline; }

/* ---------- Search result (match / no-match banner + compare) ---------- */

.result-banner {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  border-radius: var(--radius-md);
  margin-bottom: 22px;
}
.result-banner-match { background: var(--success-bg); border: 1px solid var(--success-border); }
.result-banner-nomatch { background: var(--bg); border: 1px solid var(--border); }
.result-banner-icon {
  width: 42px; height: 42px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.result-banner-icon svg { width: 22px; height: 22px; }
.result-banner-match .result-banner-icon { background: var(--success); color: #fff; }
.result-banner-nomatch .result-banner-icon { background: var(--text-faint); color: #fff; }
.result-banner h2 { margin: 0 0 2px; font-size: 18px; font-weight: 800; }
.result-banner-match h2 { color: var(--success); }
.result-banner p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

.result-compare {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}
.result-compare-col { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.result-compare-label {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-faint);
}
.result-img-wrap { position: relative; }
.result-compare-img {
  width: 150px; height: 150px;
  object-fit: cover;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  cursor: zoom-in;
  display: block;
  background: var(--bg);
}
.result-check-badge {
  position: absolute; top: -8px; right: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--success);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--surface);
  box-shadow: var(--shadow-sm);
}
.result-check-badge svg { width: 14px; height: 14px; }
.result-compare-arrow { font-size: 22px; color: var(--text-faint); font-weight: 300; }
.result-compare-meta { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.result-compare-meta strong { font-size: 15.5px; font-weight: 700; }

@media (max-width: 560px) {
  .result-compare { gap: 14px; }
  .result-compare-arrow { transform: rotate(90deg); }
  .result-compare-img { width: 130px; height: 130px; }
}

.belonging-strip { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 28px; }
.belonging-thumb {
  width: 90px; height: 90px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm);
  cursor: zoom-in;
  background: var(--bg);
  border: 1px solid var(--border);
}

/* ---------- Image sets (main + belongings) on the manage page ---------- */

.image-set-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 20px;
}
.image-set-card { display: flex; flex-direction: column; gap: 8px; }
.belonging-sub-row { display: flex; flex-wrap: wrap; gap: 6px; }
.belonging-sub-item { position: relative; }
.belonging-sub-item .belonging-thumb { width: 50px; height: 50px; }
.belonging-delete-form { position: absolute; top: -6px; right: -6px; margin: 0; }
.belonging-delete-btn {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--surface);
  font-size: 12px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  padding: 0;
}
.belonging-delete-btn:hover { background: #8f291f; }
.tile-delete-link:hover { text-decoration: underline; }
