:root {
  --bg: #1a1a1c;
  --bg-2: #232326;
  --panel: #2c2c2e;
  --panel-2: #3a3a3c;
  --text: #f5f5f7;
  --muted: #9b9ba0;
  --accent: #0a84ff;
  --accent-2: #5e5ce6;
  --error: #ff453a;
  --warn: #ffb340;
  --success: #30d158;
  --border: #3a3a3c;

  --folder-front: #f1c34a;
  --folder-front-2: #e0a830;
  --folder-back: #d4a32a;
  --folder-back-2: #b88a1f;
  --folder-edge: #8c6810;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -20%, rgba(94,92,230,0.08), transparent 70%),
    radial-gradient(900px 400px at -10% 100%, rgba(10,132,255,0.06), transparent 70%),
    var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.topbar {
  display: flex;
  gap: 4px;
  padding: 10px 16px;
  background: rgba(26,26,28,0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; z-index: 10;
}
.nav-item {
  color: var(--text);
  text-decoration: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}
.nav-item:hover { background: var(--panel-2); }
.nav-item.active { background: var(--accent); color: white; }

main { padding: 24px; max-width: 1200px; margin: 0 auto; }

@media (max-width: 640px) {
  main { padding: 16px; }
}

h1 { font-size: 28px; margin: 0 0 4px; letter-spacing: -0.02em; }
h2 { font-size: 18px; margin-top: 0; }
.muted { color: var(--muted); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.9em; }
.error { color: var(--error); }

.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin: 16px 0;
}
.card.narrow { max-width: 460px; margin: 40px auto; }

.upload-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-weight: 500; font-size: 14px; }
.field.checkbox { flex-direction: row; align-items: center; gap: 10px; }
.field small { color: var(--muted); font-size: 12px; }

input[type=file], textarea, input[type=email], input[type=text],
input[type=password] {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  font-size: 14px;
  font-family: inherit;
  width: 100%;
}
input[type=email]:focus, input[type=text]:focus,
input[type=password]:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(10,132,255,0.18);
}

/* ===== Artifact actions (download / share) ===== */
.artifact-actions {
  display: flex;
  gap: 6px;
  margin-left: auto;
}
.art-btn {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 999px;
  width: 30px;
  height: 30px;
  padding: 0;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s ease, border-color 0.15s ease, transform 0.1s;
}
.art-btn:hover { background: var(--panel); border-color: var(--accent); }
.art-btn:active { transform: scale(0.94); }
.art-btn svg {
  width: 15px; height: 15px;
  stroke: currentColor; fill: none;
  stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
}
.art-btn.primary-share {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}
.art-btn.primary-share:hover { filter: brightness(1.1); }

.toast {
  position: fixed;
  bottom: 28px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 100;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== Login page ===== */
.signin-shell {
  min-height: calc(100vh - 80px);
  display: grid;
  place-items: center;
  padding: 24px 16px;
}
.signin-card {
  width: 100%;
  max-width: 400px;
  background:
    radial-gradient(600px 200px at 50% -40%, rgba(94,92,230,0.18), transparent 70%),
    var(--panel);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 36px 32px 32px;
  box-shadow: 0 20px 50px -20px rgba(0,0,0,0.6);
  text-align: left;
}
.signin-mark {
  width: 56px; height: 56px; border-radius: 14px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: white; font-weight: 700; font-size: 22px; letter-spacing: 0.04em;
  margin: 0 auto 18px;
  box-shadow: 0 8px 24px -6px rgba(10,132,255,0.45);
}
.signin-card h1 {
  font-size: 24px;
  text-align: center;
  margin: 0 0 6px;
}
.signin-sub {
  text-align: center;
  margin: 0 0 24px;
  font-size: 14px;
}
.signin-form { display: flex; flex-direction: column; gap: 14px; }
.signin-form button.primary { width: 100%; padding: 13px; font-size: 15px; }
.signin-foot {
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  margin-top: 18px;
}
.signin-foot a { color: var(--muted); text-decoration: underline; }
.signin-error {
  background: rgba(255,69,58,0.12);
  border: 1px solid rgba(255,69,58,0.35);
  color: #ffa39c;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 13px;
  margin: 0 0 16px;
}
textarea { resize: vertical; }
input[type=range] { accent-color: var(--accent); }

button.primary, a.primary {
  background: var(--accent);
  color: white;
  border: none;
  padding: 11px 20px;
  border-radius: 10px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
  text-align: center;
}
button.primary:hover, a.primary:hover { filter: brightness(1.1); }

.status-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .status-grid { grid-template-columns: 1fr; } }

.qr { background: white; padding: 12px; border-radius: 12px; max-width: 280px; }
.link { display: block; word-break: break-all; margin-top: 8px; font-size: 12px; color: var(--muted); }

.progress {
  height: 8px;
  background: var(--panel-2);
  border-radius: 4px;
  overflow: hidden;
  margin: 12px 0;
}
.bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  transition: width 0.4s ease;
}

/* ===== Gallery header ===== */

.gallery-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin: 8px 0 24px;
  gap: 16px;
}
.gallery-header p { margin: 0; font-size: 13px; }

/* ===== Folder grid ===== */

.folder-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 36px 18px;
  padding: 8px 0 32px;
}

@media (max-width: 720px) {
  .folder-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 28px 12px;
  }
}

.folder-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: var(--text);
  padding: 8px 4px 12px;
  border-radius: 14px;
  transition: transform 0.18s ease, background 0.18s ease;
  position: relative;
}
.folder-tile:hover { background: rgba(255,255,255,0.04); }
.folder-tile:hover .folder-photo {
  transform: translateX(-50%) rotate(-3deg) translateY(-6px);
}
.folder-tile:hover .folder-front {
  transform: translateY(2px);
}

/* The folder is built from layered divs:
   1. .folder-back   — full height, with .folder-tab on top
   2. .folder-photo  — tucked between back and front
   3. .folder-front  — covers lower portion, holds the sticker label */
.folder-art {
  position: relative;
  width: 100%;
  max-width: 200px;
  aspect-ratio: 5 / 4.6;
}

.folder-tab {
  position: absolute;
  top: 14%;
  left: 8%;
  width: 38%;
  height: 11%;
  background: linear-gradient(180deg, var(--folder-back) 0%, var(--folder-back-2) 100%);
  border-radius: 6px 10px 0 0;
  z-index: 1;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.25);
}

.folder-back {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 78%;
  background: linear-gradient(180deg, var(--folder-back) 0%, var(--folder-back-2) 100%);
  border-radius: 4px 4px 8px 8px;
  z-index: 1;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.15) inset,
    0 -2px 0 var(--folder-edge) inset,
    0 8px 18px rgba(0,0,0,0.45);
}

.folder-photo {
  position: absolute;
  top: 5%;
  left: 50%;
  transform: translateX(-50%) rotate(-2deg);
  width: 64%;
  height: 70%;
  object-fit: cover;
  object-position: center 20%;
  background: white;
  padding: 2.5%;
  padding-bottom: 7%;
  border-radius: 2px;
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 2;
  transition: transform 0.22s ease;
}

.folder-front {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60%;
  background:
    linear-gradient(180deg, var(--folder-front) 0%, var(--folder-front-2) 100%);
  border-radius: 4px 14px 8px 8px;
  z-index: 3;
  box-shadow:
    inset 0 2px 0 rgba(255,255,255,0.4),
    inset 0 -2px 0 rgba(0,0,0,0.15),
    0 6px 14px rgba(0,0,0,0.35);
  transition: transform 0.18s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
}
.folder-front::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255,255,255,0.04) 0 2px,
      transparent 2px 6px
    );
  border-radius: inherit;
  pointer-events: none;
}

.folder-sticker {
  background: rgba(255,255,255,0.92);
  color: #2a2208;
  border-radius: 4px;
  padding: 4px 8px;
  width: 80%;
  text-align: center;
  box-shadow: 0 1px 2px rgba(0,0,0,0.2), inset 0 0 0 1px rgba(0,0,0,0.05);
  transform: rotate(-0.5deg);
}
.sticker-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.sticker-id {
  font-size: 9px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #6b5418;
  margin-top: 1px;
}

.folder-status {
  position: absolute;
  top: 8%;
  right: 6%;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  font-weight: 700;
  color: white;
  z-index: 4;
  box-shadow: 0 2px 6px rgba(0,0,0,0.4);
}
.folder-status.status-running,
.folder-status.status-queued {
  background: var(--warn);
  animation: pulse 1.4s ease-in-out infinite;
}
.folder-status.status-error { background: var(--error); }

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,179,64,0.5), 0 2px 6px rgba(0,0,0,0.4); }
  50% { box-shadow: 0 0 0 6px rgba(255,179,64,0), 0 2px 6px rgba(0,0,0,0.4); }
}

.folder-video-badge {
  position: absolute;
  bottom: 6%;
  right: 6%;
  background: rgba(0,0,0,0.75);
  color: white;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  z-index: 4;
}

.folder-caption {
  margin-top: 10px;
  text-align: center;
  width: 100%;
  padding: 0 4px;
}
.folder-name {
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.folder-sub {
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.folder-wrapper {
  position: relative;
  display: flex;
}
.folder-wrapper .folder-tile { flex: 1; }

.folder-delete {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.1);
  background: rgba(0,0,0,0.55);
  color: rgba(255,255,255,0.85);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  opacity: 0;
  transition: opacity 0.15s ease, background 0.15s ease, transform 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}
.folder-wrapper:hover .folder-delete,
.folder-delete:focus-visible { opacity: 1; }
.folder-delete:hover {
  background: var(--error);
  border-color: var(--error);
  color: white;
  transform: scale(1.05);
}
.folder-delete:disabled { opacity: 0.4; cursor: wait; }

@media (hover: none) {
  .folder-delete { opacity: 0.85; }
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: var(--panel);
  border-radius: 14px;
  border: 1px dashed var(--border);
}
.empty-icon { font-size: 48px; margin-bottom: 8px; }

/* ===== Job focus view ===== */

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 16px;
  font-size: 14px;
  padding: 6px 10px 6px 4px;
  border-radius: 8px;
  margin-left: -4px;
}
.back-link:hover { background: rgba(10,132,255,0.1); }
.back-arrow { font-size: 22px; line-height: 1; margin-top: -2px; }

.focus-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  gap: 12px;
}
.focus-toolbar .back-link { margin-bottom: 0; }

.danger-btn {
  background: transparent;
  color: var(--error);
  border: 1px solid rgba(255,69,58,0.4);
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}
.danger-btn:hover {
  background: var(--error);
  color: white;
  border-color: var(--error);
}
.danger-btn:disabled { opacity: 0.5; cursor: wait; }

.job-header { margin-bottom: 20px; }
.job-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.chip {
  background: var(--panel);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  color: var(--muted);
}
.chip.status { font-weight: 500; }
.chip.status-done { background: rgba(48,209,88,0.15); color: var(--success); border-color: rgba(48,209,88,0.3); }
.chip.status-running, .chip.status-queued { background: rgba(255,179,64,0.15); color: var(--warn); border-color: rgba(255,179,64,0.3); }
.chip.status-error { background: rgba(255,69,58,0.15); color: var(--error); border-color: rgba(255,69,58,0.3); }
.chip.chip-email {
  background: rgba(94,92,230,0.12);
  color: var(--text);
  border-color: rgba(94,92,230,0.35);
  text-decoration: none;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
}
.chip.chip-email:hover { background: rgba(94,92,230,0.22); }
.chip.chip-email span { opacity: 0.7; margin-right: 2px; }

.folder-email {
  font-size: 10.5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

/* ===== Admin emails table ===== */
.email-table-wrap {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin: 16px 0;
}
.email-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.email-table th, .email-table td {
  padding: 12px 16px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
.email-table th {
  background: var(--panel-2);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.email-table tbody tr:last-child td { border-bottom: 0; }
.email-table tbody tr:hover { background: rgba(255,255,255,0.03); }
.email-table a { color: var(--text); text-decoration: none; }
.email-table a:hover { color: var(--accent); }
.email-table .mono { color: var(--muted); }
@media (max-width: 720px) {
  .email-table th, .email-table td { padding: 10px 12px; font-size: 13px; }
  .email-table th:nth-child(3),
  .email-table td:nth-child(3) { display: none; }
}

.custom-prompt {
  margin: 12px 0 0;
  padding: 10px 14px;
  background: var(--panel);
  border-left: 3px solid var(--accent);
  border-radius: 4px 8px 8px 4px;
  font-style: italic;
  color: var(--muted);
  font-size: 14px;
}

.artifacts {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  margin-top: 20px;
}
.artifacts .artifact.wide { grid-column: 1 / -1; }

.artifact {
  margin: 0;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.artifact-frame {
  position: relative;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 16/9;
  overflow: hidden;
}
.artifact.wide .artifact-frame { aspect-ratio: 16/9; }
.artifact-frame img,
.artifact-frame video {
  max-width: 100%;
  max-height: 100%;
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.artifact-frame .placeholder {
  color: var(--muted);
  padding: 40px 20px;
  text-align: center;
  font-size: 14px;
}
.artifact figcaption {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  font-size: 13px;
}
.caption-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--panel-2);
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}
.caption-label { color: var(--text); font-weight: 500; }

@media (max-width: 720px) {
  .artifacts { grid-template-columns: 1fr; gap: 12px; }
  h1 { font-size: 22px; }
  .gallery-header { margin-bottom: 16px; }
}

/* ===== Input page ===== */

.input-page { max-width: 560px; margin: 0 auto; padding-bottom: 200px; }

.file-field { gap: 8px; }
.file-drop {
  position: relative;
  border: 1.5px dashed var(--border);
  border-radius: 12px;
  background: var(--panel-2);
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.file-drop:hover { border-color: var(--accent); background: rgba(10,132,255,0.05); }
.file-drop input[type=file] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.file-hint {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  pointer-events: none;
  padding: 20px;
}
.file-icon { font-size: 36px; margin-bottom: 8px; }
#file-preview {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  background: black;
}

.slider-scale {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-top: -2px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

button.primary[disabled] { opacity: 0.5; cursor: not-allowed; }

/* ===== Toggle switch ===== */

.toggle-field {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.toggle-title { font-size: 14px; font-weight: 500; }

.toggle-switch {
  position: relative;
  display: inline-block;
  width: 48px;
  height: 28px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}
.toggle-track {
  position: absolute;
  inset: 0;
  background: #4a4a4d;
  border-radius: 999px;
  transition: background 0.2s ease;
}
.toggle-track::before {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  top: 3px;
  left: 3px;
  background: white;
  border-radius: 50%;
  transition: transform 0.22s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 2px 4px rgba(0,0,0,0.3);
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track::before { transform: translateX(20px); }
.toggle-switch input:focus-visible + .toggle-track { box-shadow: 0 0 0 3px rgba(10,132,255,0.35); }

/* ===== Video options panel ===== */

.video-options {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  animation: fade-down 0.2s ease;
}
@keyframes fade-down {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ===== Segmented control ===== */

.segmented {
  display: flex;
  gap: 4px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 3px;
}
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented label > span {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 8px 6px;
  border-radius: 7px;
  font-size: 13px;
  color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease;
}
.segmented label > span strong { font-size: 14px; font-weight: 600; }
.segmented label > span small { font-size: 10px; }
.segmented input:checked + span {
  background: var(--accent);
  color: white;
}
.segmented input:checked + span small { color: rgba(255,255,255,0.85); }

/* ===== Bottom processing bar ===== */

[hidden] { display: none !important; }

.processing-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  max-width: 720px;
  margin: 0 auto;
  background: rgba(44,44,46,0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px 16px 14px 14px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 14px;
  align-items: center;
  box-shadow: 0 16px 40px rgba(0,0,0,0.55);
  z-index: 100;
  animation: slide-up 0.25s ease;
  cursor: pointer;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
.processing-bar:hover { border-color: rgba(10,132,255,0.4); }
.processing-bar:active { transform: scale(0.995); }
@keyframes slide-up {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}
.proc-close {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 24px;
  height: 24px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  border-radius: 50%;
}
.proc-close:hover { background: rgba(255,255,255,0.08); color: var(--text); }

.proc-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.proc-qr img {
  width: 88px;
  height: 88px;
  background: white;
  padding: 4px;
  border-radius: 8px;
  display: block;
}
.proc-qr-label { font-size: 10px; }

.proc-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
  padding-right: 20px;
}
.proc-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.proc-row strong {
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.proc-series { font-size: 12px; }
.proc-actions { font-size: 13px; }
.proc-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}
.proc-link:hover { text-decoration: underline; }

.proc-error {
  font-size: 12px;
  color: var(--error);
  background: rgba(255,69,58,0.1);
  border: 1px solid rgba(255,69,58,0.25);
  padding: 6px 10px;
  border-radius: 6px;
  line-height: 1.35;
  max-height: 80px;
  overflow-y: auto;
}

@media (max-width: 520px) {
  .processing-bar {
    bottom: 8px;
    left: 8px;
    right: 8px;
    padding: 12px;
    gap: 12px;
  }
  .proc-qr img { width: 72px; height: 72px; }
  .proc-info { padding-right: 24px; }
}
