/* ----------------------------------------------------------------------------
 * Grok Documentary Panel — refined minimalism.
 * System-font everywhere; depth comes from precise spacing, subtle gradients,
 * and dot-indicator status pills. No third-party fonts, no bundle.
 * -------------------------------------------------------------------------- */

:root {
  /* Surfaces */
  --bg:        #f5f5f7;
  --surface:   #ffffff;
  --surface-2: #fafafc;
  --surface-3: #f0f0f3;

  /* Text */
  --text:   #1d1d1f;
  --text-2: #6e6e73;
  --text-3: #86868b;

  /* Borders */
  --border:        #e5e5ea;
  --border-2:      #d2d2d7;
  --border-strong: #c6c6cc;

  /* Brand & accents */
  --primary:       #0071e3;
  --primary-hover: #0058b8;
  --primary-soft:  #e8f1fc;

  --accent-violet: #5856d6;
  --accent-violet-hover: #3d3bb8;
  --accent-fuchsia: #af52de;

  /* Status (each: bg + text) */
  --ok-bg: #d7f0d8;     --ok-fg: #146c2e;
  --warn-bg: #ffe5b4;   --warn-fg: #8a4b00;
  --pending-bg: #fff4d6; --pending-fg: #5a3e00;
  --err-bg: #fce8e6;    --err-fg: #a8201a;
  --idle-bg: #e7e7ec;   --idle-fg: #5e5e63;

  /* Type */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

  /* Radii */
  --r-sm: 6px;
  --r:    10px;
  --r-lg: 14px;
  --r-xl: 18px;

  /* Shadows */
  --sh-1: 0 1px 2px rgba(15, 17, 21, 0.04), 0 0 0 1px rgba(15, 17, 21, 0.04);
  --sh-2: 0 6px 24px -8px rgba(15, 17, 21, 0.10), 0 1px 3px rgba(15, 17, 21, 0.06);
  --sh-hover: 0 14px 40px -10px rgba(15, 17, 21, 0.14), 0 4px 8px rgba(15, 17, 21, 0.05);

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box }
html, body { margin: 0; padding: 0 }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-size: 14px;
  line-height: 1.5;
}

a { color: var(--primary); text-decoration: none }
a:hover { text-decoration: underline }

/* ----- Header ------------------------------------------------------------- */
.app-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--border);
}
.app-header h1 {
  font-size: 17px; font-weight: 600; margin: 0;
  letter-spacing: -0.01em;
}
.app-header h1 a { color: inherit }
.app-header h1 a:hover { text-decoration: none }
.header-right {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}

/* ----- Status chips in header -------------------------------------------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
  white-space: nowrap;
}
.chip.ok    { background: var(--ok-bg);    color: var(--ok-fg);    border-color: transparent }
.chip.bad   { background: var(--err-bg);   color: var(--err-fg);   border-color: transparent }
.chip.warn  { background: var(--warn-bg);  color: var(--warn-fg);  border-color: transparent }
.chip a { color: inherit; font-weight: 600 }

/* User banner inside header */
.user-banner {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px;
  padding: 4px 4px 4px 12px;
  border-radius: 999px;
  background: var(--surface-3);
}
.user-banner .user-name { font-weight: 600; color: var(--text) }
.role-badge {
  display: inline-block; padding: 1px 7px; border-radius: 4px;
  background: linear-gradient(180deg, var(--accent-violet), var(--accent-violet-hover));
  color: white; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.scope-toggle {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
  cursor: pointer; user-select: none;
  padding: 0 8px;
}
.scope-toggle input { accent-color: var(--primary) }
.btn-logout {
  background: white; border: 1px solid var(--border-2);
  padding: 4px 10px; border-radius: 999px;
  cursor: pointer; font: inherit; font-size: 12px;
  color: var(--text); transition: all 0.15s var(--ease);
}
.btn-logout:hover { background: var(--err-bg); color: var(--err-fg); border-color: transparent }

/* ----- Layout ------------------------------------------------------------- */
main {
  max-width: 1080px; margin: 0 auto; padding: 28px 24px 64px;
  display: grid; gap: 24px;
}
.section-title {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  margin: 4px 4px 0;
}
.section-title h2 {
  margin: 0; font-size: 13px; font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.08em;
}
.section-title .actions { display: flex; gap: 8px; align-items: center }

/* ----- Cards (generic surface) ------------------------------------------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 24px;
  box-shadow: var(--sh-1);
}

/* ----- Form primitives ---------------------------------------------------- */
label.field-label {
  display: block; margin: 14px 0 6px;
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  text-transform: uppercase; letter-spacing: 0.06em;
}
input[type=text], input[type=password], select, textarea {
  width: 100%;
  padding: 10px 12px;
  font: inherit; font-size: 14px;
  color: var(--text);
  background: white;
  border: 1px solid var(--border-2);
  border-radius: var(--r);
  transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}
textarea { min-height: 84px; resize: vertical; line-height: 1.5 }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 113, 227, 0.18);
}

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 10px 16px;
  font: inherit; font-size: 14px; font-weight: 600;
  border-radius: var(--r);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s var(--ease);
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary); color: white;
}
.btn-primary:hover { background: var(--primary-hover) }
.btn-primary:disabled { background: #aeaeb2; cursor: not-allowed }
.btn-secondary {
  background: white; color: var(--primary);
  border: 1px dashed var(--primary);
}
.btn-secondary:hover { background: var(--primary-soft) }
.btn-ghost {
  background: transparent; color: var(--text);
  border: 1px solid var(--border-2);
}
.btn-ghost:hover { background: var(--surface-3) }
.btn-danger {
  background: transparent; color: var(--err-fg); border: 1px solid var(--err-fg);
}
.btn-danger:hover { background: var(--err-fg); color: white }

.btn-block { width: 100%; margin-top: 16px }

/* ----- Status pill (dot + label) ----------------------------------------- */
.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 9px 3px 7px;
  border-radius: 999px;
  font-size: 11px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.05em;
  background: var(--idle-bg); color: var(--idle-fg);
}
.status-pill::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; opacity: 0.85;
}
.status-pill.s-queued, .status-pill.s-approved { background: var(--idle-bg); color: var(--idle-fg) }
.status-pill.s-generating_image,
.status-pill.s-generating_video,
.status-pill.s-polling_video,
.status-pill.s-downloading,
.status-pill.s-uploading_video { background: var(--warn-bg); color: var(--warn-fg) }
.status-pill.s-generating_image::before,
.status-pill.s-generating_video::before,
.status-pill.s-polling_video::before,
.status-pill.s-downloading::before,
.status-pill.s-uploading_video::before { animation: pulse 1.4s ease-in-out infinite }
@keyframes pulse { 50% { opacity: 0.35 } }
.status-pill.s-awaiting_approval { background: var(--pending-bg); color: var(--pending-fg) }
.status-pill.s-done  { background: var(--ok-bg);  color: var(--ok-fg) }
.status-pill.s-error { background: var(--err-bg); color: var(--err-fg) }

/* ===========================================================================
 * Auth pages (login, register)
 * Centered card with subtle "film perforation" decoration along top/bottom
 * to nod at the documentary/cinema motif without looking thematic.
 * ========================================================================== */
body.auth-page {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background:
    radial-gradient(60% 50% at 50% 0%, rgba(0,113,227,0.06), transparent 70%),
    radial-gradient(50% 40% at 50% 100%, rgba(88,86,214,0.05), transparent 70%),
    var(--bg);
}
.auth-card {
  position: relative;
  width: 360px;
  padding: 32px 28px 28px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-2);
}
/* Film perforations top/bottom (subtle, very small dots) */
.auth-card::before, .auth-card::after {
  content: "";
  position: absolute; left: 12px; right: 12px; height: 4px;
  background-image: radial-gradient(circle, var(--border-strong) 1.5px, transparent 1.6px);
  background-size: 12px 4px;
  background-repeat: repeat-x;
  opacity: 0.5;
}
.auth-card::before { top: 10px }
.auth-card::after  { bottom: 10px }
.auth-card .auth-emoji {
  font-size: 28px; margin-bottom: 6px;
  display: block;
}
.auth-card h1 {
  font-size: 20px; font-weight: 600; margin: 0 0 4px;
  letter-spacing: -0.015em;
}
.auth-card .auth-sub {
  font-size: 13px; color: var(--text-2); margin: 0 0 8px;
}
.auth-card .auth-foot {
  margin-top: 18px; padding-top: 16px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-2); text-align: center;
}
.auth-status {
  margin-top: 14px; padding: 10px 12px;
  border-radius: var(--r); font-size: 13px;
  display: none;
}
.auth-status.show { display: block }
.auth-status.err { background: var(--err-bg); color: var(--err-fg) }
.auth-status.ok  { background: var(--ok-bg);  color: var(--ok-fg) }

/* ===========================================================================
 * Dashboard
 * ========================================================================== */
.toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
}
.toolbar h2 {
  font-size: 22px; font-weight: 600; margin: 0;
  letter-spacing: -0.01em;
}
.toolbar .toolbar-meta { font-size: 13px; color: var(--text-2) }

/* Collapsible new-batch form */
details.new-batch {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  transition: box-shadow 0.2s var(--ease);
}
details.new-batch[open] { box-shadow: var(--sh-2) }
details.new-batch > summary {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px;
  cursor: pointer; user-select: none;
  list-style: none;
  font-size: 14px; font-weight: 600;
}
details.new-batch > summary::-webkit-details-marker { display: none }
details.new-batch > summary::after {
  content: "+"; font-weight: 400; font-size: 22px; color: var(--text-2);
  width: 28px; height: 28px; display: inline-flex;
  align-items: center; justify-content: center;
  border-radius: 50%; background: var(--surface-3);
  transition: transform 0.2s var(--ease), background 0.2s var(--ease);
}
details.new-batch[open] > summary::after {
  transform: rotate(45deg); background: var(--err-bg); color: var(--err-fg);
}
details.new-batch .new-batch-body {
  padding: 4px 24px 24px;
  border-top: 1px solid var(--border);
}

/* Batch grid */
.batch-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
}
.batch-card {
  position: relative;
  display: flex; flex-direction: column; gap: 12px;
  padding: 18px 20px 16px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  cursor: pointer;
  transition: transform 0.18s var(--ease), box-shadow 0.18s var(--ease), border-color 0.18s var(--ease);
  text-decoration: none; color: inherit;
}
.batch-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--sh-hover);
  border-color: var(--border-2);
  text-decoration: none;
}
.batch-card .bc-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 10px;
}
.batch-card .bc-title {
  font-size: 15px; font-weight: 600; line-height: 1.35;
  letter-spacing: -0.005em;
  margin: 0;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.batch-card .bc-aspect {
  font-size: 11px; font-weight: 600;
  padding: 3px 7px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-2);
  flex-shrink: 0;
}
.batch-card .bc-progress {
  height: 4px; border-radius: 999px; overflow: hidden;
  background: var(--surface-3);
}
.batch-card .bc-progress > div {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--accent-violet));
  transition: width 0.6s var(--ease);
}
.batch-card .bc-meta {
  display: flex; flex-wrap: wrap; gap: 6px 10px;
  font-size: 12px; color: var(--text-2);
  align-items: center;
}
.batch-card .bc-meta .dot {
  width: 3px; height: 3px; border-radius: 50%;
  background: var(--border-strong);
}
.batch-card .bc-foot {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto; padding-top: 8px;
  border-top: 1px solid var(--border);
  font-size: 11px; color: var(--text-3);
}
.batch-card .bc-key {
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.batch-card .bc-user-badge {
  display: inline-block; margin-left: 6px;
  padding: 1px 6px; border-radius: 4px;
  background: var(--accent-violet); color: white;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em;
}

/* Empty state */
.empty {
  text-align: center; padding: 48px 24px;
  color: var(--text-3);
  background: var(--surface);
  border: 1px dashed var(--border-2);
  border-radius: var(--r-lg);
}
.empty .empty-emoji { font-size: 32px; margin-bottom: 8px }

/* Skeleton card */
.skeleton-card {
  height: 152px;
  background: linear-gradient(90deg,
    var(--surface) 0%,
    var(--surface-3) 40%,
    var(--surface-3) 60%,
    var(--surface) 100%);
  background-size: 200% 100%;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  animation: shimmer 1.4s linear infinite;
}
@keyframes shimmer { from { background-position: 100% 0 } to { background-position: -100% 0 } }

/* ===========================================================================
 * Batch detail page
 * ========================================================================== */
.breadcrumb {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; color: var(--text-2);
  margin-bottom: 12px;
}
.breadcrumb a { color: var(--text-2) }
.breadcrumb a:hover { color: var(--text); text-decoration: none }
.breadcrumb .current { color: var(--text); font-weight: 600 }

.batch-detail-head {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 16px;
}
.batch-detail-head h2 {
  font-size: 28px; font-weight: 600; line-height: 1.15;
  margin: 0; letter-spacing: -0.02em;
}
.batch-detail-head .meta-line {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 13px; color: var(--text-2);
  margin-top: 6px;
}

.merge-stack { display: grid; gap: 10px }
.merge-row {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 12px 16px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r);
  font-size: 13px;
}
.merge-row.ok      { background: linear-gradient(180deg, var(--ok-bg), var(--ok-bg)); border-color: transparent; color: var(--ok-fg) }
.merge-row.pending { background: linear-gradient(180deg, var(--pending-bg), var(--pending-bg)); border-color: transparent; color: var(--pending-fg) }
.merge-row.err     { background: linear-gradient(180deg, var(--err-bg), var(--err-bg)); border-color: transparent; color: var(--err-fg) }
.merge-row .label-strong { font-weight: 600 }
.merge-row .spacer { flex: 1 }
.transition-select {
  font: inherit; font-size: 12px;
  padding: 5px 10px; border-radius: var(--r-sm);
  border: 1px solid var(--border-2); background: white;
}
.btn-merge      { background: var(--accent-violet);  color: white; padding: 6px 12px; font-size: 12px; border-radius: var(--r-sm); border: none; cursor: pointer; font-weight: 600 }
.btn-merge:hover{ background: var(--accent-violet-hover) }
.btn-merge-fade { background: var(--accent-fuchsia) }
.btn-merge-fade:hover { background: #8c3eb1 }

/* Item rows */
.item-list { display: grid; gap: 10px }
.item {
  display: grid; grid-template-columns: 168px 1fr; gap: 14px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  transition: border-color 0.15s var(--ease);
}
.item:hover { border-color: var(--border-2) }
.item-thumb {
  width: 168px; height: 110px;
  background: var(--surface-3);
  border-radius: var(--r-sm);
  display: flex; align-items: center; justify-content: center;
  color: var(--text-3); font-size: 12px;
  overflow: hidden;
}
.item-thumb img { width: 100%; height: 100%; object-fit: cover }
.item-body { display: flex; flex-direction: column; gap: 6px; min-width: 0 }
.item-prompt {
  font-size: 13px; line-height: 1.5; color: var(--text);
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-prompt strong { font-weight: 600; margin-right: 4px }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 12px; color: var(--text-2) }
.item .actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px }
.error-msg {
  margin-top: 4px; font-size: 12px; color: var(--err-fg);
  background: var(--err-bg); padding: 6px 10px; border-radius: var(--r-sm);
}
.drive-link {
  font-size: 12px; color: var(--primary); text-decoration: none;
  display: inline-flex; align-items: center; gap: 4px;
}
.drive-link::before { content: "↗"; font-size: 10px }
.drive-link:hover { text-decoration: underline }

.mode-badge {
  display: inline-block; padding: 1px 7px;
  background: var(--surface-3); color: var(--text-2);
  border-radius: 4px; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.action-btn {
  font: inherit; font-size: 12px; font-weight: 600;
  padding: 6px 11px; border-radius: var(--r-sm);
  border: none; cursor: pointer;
  transition: filter 0.15s var(--ease);
}
.action-btn:hover { filter: brightness(0.95) }
.action-btn.approve { background: #34c759; color: white }
.action-btn.regen   { background: #ff9500; color: white }
.action-btn.upload  { background: var(--accent-violet); color: white }
.action-btn.retry   { background: var(--primary); color: white }

/* ===========================================================================
 * New-batch form internals (re-used by dashboard)
 * ========================================================================== */
.prompt-row {
  position: relative;
  background: var(--surface-2);
  padding: 14px 16px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 10px;
}
.prompt-num {
  font-size: 11px; font-weight: 700;
  color: var(--text-3);
  text-transform: uppercase; letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.remove-btn {
  position: absolute; top: 10px; right: 10px;
  background: transparent; color: var(--err-fg);
  border: 1px solid var(--err-fg);
  padding: 3px 9px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 11px;
  font-family: inherit;
}
.remove-btn:hover { background: var(--err-fg); color: white }
.ref-row, .base-images-row {
  margin-top: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-2);
}
.base-images-row {
  background: var(--surface-2);
  padding: 12px 14px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  margin-bottom: 8px;
}
.ref-label {
  display: inline-flex; align-items: center; gap: 6px;
  cursor: pointer;
  padding: 5px 11px;
  border: 1px dashed var(--border-strong);
  border-radius: var(--r-sm);
  background: white;
  transition: all 0.15s var(--ease);
}
.ref-label:hover { border-color: var(--accent-violet); color: var(--accent-violet) }
.ref-label input[type=file] { display: none }
.ref-name { color: var(--text); font-weight: 500 }
.ref-clear {
  background: transparent; border: 1px solid var(--err-fg);
  color: var(--err-fg);
  padding: 2px 8px; border-radius: var(--r-sm);
  cursor: pointer; font-size: 11px; font-family: inherit;
}

/* ----- File-picker thumbnail previews (form) ----------------------------- */
.ref-previews {
  display: flex; flex-wrap: wrap; gap: 6px;
  width: 100%;
  margin-top: 4px;
}
.ref-preview {
  position: relative;
  width: 64px; height: 64px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface-3);
}
.ref-preview img { width: 100%; height: 100%; object-fit: cover; display: block }
.ref-preview-remove {
  position: absolute; top: 2px; right: 2px;
  width: 18px; height: 18px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: rgba(15, 17, 21, 0.72);
  color: white; font-size: 11px; line-height: 1;
  border: none; cursor: pointer; font-family: inherit;
  transition: background 0.15s var(--ease), transform 0.15s var(--ease);
  padding: 0;
}
.ref-preview-remove:hover { background: var(--err-fg); transform: scale(1.08) }
.ref-count-summary {
  font-size: 11px; font-weight: 600; color: var(--text-2);
  align-self: center;
  padding: 2px 7px; border-radius: 999px;
  background: var(--surface-3);
}

/* ----- Multi-image item thumbnail (batch detail) ------------------------- */
.thumb-multi {
  display: grid; gap: 2px;
  width: 100%; height: 100%;
  position: relative;
}
.thumb-multi img { width: 100%; height: 100%; object-fit: cover; display: block }
.thumb-multi[data-count="2"] { grid-template-columns: 1fr 1fr }
.thumb-multi[data-count="3"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.thumb-multi[data-count="3"] img:nth-child(1) { grid-row: 1 / -1 }
.thumb-multi[data-count="4"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.thumb-multi[data-count="5"], .thumb-multi[data-count="6"], .thumb-multi[data-count="7"],
.thumb-multi[data-count="8"], .thumb-multi[data-count="9"] {
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
}
.thumb-more {
  position: absolute; right: 0; bottom: 0;
  width: calc(50% - 1px); height: calc(50% - 1px);
  display: flex; align-items: center; justify-content: center;
  background: rgba(15, 17, 21, 0.62);
  color: white; font-size: 14px; font-weight: 700;
  letter-spacing: 0.04em;
}

/* ----- Base-images strip on batch detail --------------------------------- */
.base-strip {
  display: flex; gap: 8px;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  overflow-x: auto;
  align-items: center;
}
.base-strip-title {
  flex-shrink: 0;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.06em; color: var(--text-2);
  margin-right: 4px;
}
.base-strip a {
  flex-shrink: 0;
  width: 56px; height: 56px;
  border-radius: var(--r-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
  transition: transform 0.15s var(--ease);
}
.base-strip a:hover { transform: translateY(-1px); border-color: var(--border-strong) }
.base-strip img { width: 100%; height: 100%; object-fit: cover; display: block }

/* Inline status badges shared with dashboard */
#status {
  margin-top: 14px; padding: 12px 14px;
  border-radius: var(--r); display: none;
  font-size: 13px;
}
#status.ok  { background: var(--ok-bg);  color: var(--ok-fg);  display: block }
#status.err { background: var(--err-bg); color: var(--err-fg); display: block }

/* ===========================================================================
 * Responsive tweaks
 * ========================================================================== */
@media (max-width: 640px) {
  .app-header { padding: 12px 16px }
  main { padding: 20px 16px 48px }
  .item { grid-template-columns: 1fr }
  .item-thumb { width: 100%; height: 200px }
  .auth-card { width: calc(100% - 32px); margin: 16px }
  .batch-detail-head h2 { font-size: 22px }
}
