/* ── RESET ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg-app:      #EAECEF;
  --bg-panel:    #F0F1F4;
  --bg-work:     #F4F5F7;
  --bg-card:     #FFFFFF;

  --blue:        #2563EB;
  --blue-hover:  #1D4ED8;
  --blue-light:  #EEF4FF;
  --green:       #059669;
  --green-light: #ECFDF5;
  --red:         #DC2626;
  --red-light:   #FEF2F2;

  --border:      #D1D5DB;
  --border-mid:  #C3C9D2;

  --text:        #1E293B;
  --text-muted:  #64748B;
  --text-light:  #94A3B8;

  --topbar-h:    52px;
  --panel-w:     250px;
}

html, body {
  height: 100%;
  font-family: 'Segoe UI', 'Inter', system-ui, sans-serif;
  background: var(--bg-app);
  color: var(--text);
  overflow: hidden;
}

/* ── TOPBAR ───────────────────────────────────────────────────────────────── */
.topbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--topbar-h);
  background: #F4F5F7;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  z-index: 100;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.topbar-logo { display: flex; align-items: center; gap: 10px; }

.logo-mark {
  width: 32px; height: 32px;
  background: var(--blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: #fff;
}

.logo-text { font-size: 16px; font-weight: 700; letter-spacing: 0.5px; }

.topbar-date { font-size: 12px; color: var(--text-muted); }

/* ── LAYOUT ───────────────────────────────────────────────────────────────── */
.hub {
  display: grid;
  grid-template-columns: var(--panel-w) 1fr 30%;
  height: calc(100vh - var(--topbar-h));
  margin-top: var(--topbar-h);
  overflow: hidden;
}

/* ── LEFT PANEL ───────────────────────────────────────────────────────────── */
.panel-left {
  background: var(--bg-panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.panel-header {
  flex-shrink: 0;
  padding: 14px 16px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.panel-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.add-op-btn {
  width: 22px; height: 22px;
  border: 1px solid var(--border-mid);
  border-radius: 5px;
  background: var(--bg-card);
  color: var(--text-muted);
  font-size: 13px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.15s;
}

.add-op-btn:hover { border-color: var(--blue); color: var(--blue); }

.op-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 8px 0;
}

.op-list::-webkit-scrollbar { width: 4px; }
.op-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.op-btn {
  width: 100%;
  background: none;
  border: none;
  border-left: 3px solid transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 14px;
  text-align: left;
  color: var(--text-muted);
  transition: background 0.15s;
  font-family: inherit;
}

.op-btn:hover { background: rgba(37,99,235,0.05); color: var(--text); }

.op-item.active .op-btn {
  background: rgba(37,99,235,0.09);
  border-left-color: var(--blue);
  color: var(--text);
}

.op-icon {
  width: 30px; height: 30px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  flex-shrink: 0;
}

.op-item.active .op-icon { border-color: var(--blue); background: var(--blue-light); }

.op-text { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }

.op-name {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
}

.op-desc {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.op-assets-dot {
  display: flex;
  gap: 3px;
  flex-shrink: 0;
}

.asset-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
}

.asset-dot.prompt { background: var(--blue); }
.asset-dot.tpl    { background: var(--green); }

.panel-footer {
  flex-shrink: 0;
  padding: 12px 14px;
  border-top: 1px solid var(--border);
}

.settings-btn {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  transition: all 0.15s;
  font-family: inherit;
}

.settings-btn:hover { border-color: var(--blue); color: var(--blue); }

.settings-icon { font-size: 14px; }

/* ── WORKSPACE ────────────────────────────────────────────────────────────── */
.workspace {
  background: var(--bg-work);
  overflow-y: auto;
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 900px;
  min-height: 0;   /* critical: lets this scroll internally instead of the
                       whole .hub grid clipping content at higher browser zoom */
}
.workspace > * {
  flex-shrink: 0;   /* content keeps its natural size; the column scrolls,
                        nothing silently squishes (verified this matters via
                        the layout mockup testing) */
}

.workspace::-webkit-scrollbar { width: 5px; }
.workspace::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

/* Operation banner */
.op-banner {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}

.op-banner-icon {
  width: 44px; height: 44px;
  background: var(--blue-light);
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.op-banner-info { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.op-banner-title { font-size: 15px; font-weight: 700; }

.op-banner-sub { font-size: 11px; color: var(--text-muted); }

.op-banner-assets {
  display: flex;
  gap: 6px;
  flex-shrink: 0;
}

.asset-chip {
  font-size: 10px;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  letter-spacing: 0.3px;
}

.asset-chip.prompt { background: var(--blue-light); color: var(--blue); }
.asset-chip.tpl    { background: var(--green-light); color: var(--green); }
.asset-chip.none   { background: #F1F3F6; color: var(--text-light); }

/* Drop zone */
.drop-zone {
  border: 2px dashed var(--border-mid);
  border-radius: 14px;
  background: var(--bg-card);
  cursor: pointer;
  min-height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.drop-zone:hover, .drop-zone.dragover {
  border-color: var(--blue);
  background: var(--blue-light);
}

.drop-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 26px;
  text-align: center;
}

.drop-icon { color: var(--blue); opacity: 0.75; }

.drop-title { font-size: 15px; font-weight: 600; }

.drop-sub { font-size: 11px; color: var(--text-muted); }

.drop-browse {
  margin-top: 4px;
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 7px 18px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.drop-browse:hover { border-color: var(--blue); color: var(--blue); }

/* File chip */
.file-chip {
  background: var(--green-light);
  border: 1px solid rgba(5,150,105,0.25);
  border-radius: 9px;
  padding: 10px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-chip-icon { font-size: 18px; }

.file-chip-name {
  flex: 1;
  font-size: 12px;
  font-weight: 600;
  color: var(--green);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-chip-size { font-size: 10px; color: var(--text-muted); }

.file-chip-x {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  padding: 2px 6px;
  transition: color 0.15s;
}

.file-chip-x:hover { color: var(--red); }

/* Run */
.run-btn {
  background: var(--blue);
  border: none;
  border-radius: 9px;
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  padding: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: all 0.15s;
  box-shadow: 0 2px 8px rgba(37,99,235,0.25);
  font-family: inherit;
}

.run-btn:hover:not(:disabled) { background: var(--blue-hover); transform: translateY(-1px); }
.run-btn:disabled { opacity: 0.35; cursor: not-allowed; box-shadow: none; }

/* Feed */
.feed-wrap {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  min-height: 160px;
  max-height: 340px;
  overflow: hidden;
}

.feed-header {
  flex-shrink: 0;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.clear-btn {
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-muted);
  font-size: 10px;
  font-weight: 600;
  padding: 3px 9px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}

.clear-btn:hover { border-color: var(--red); color: var(--red); }

.feed {
  flex: 1;
  overflow-y: auto;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.feed::-webkit-scrollbar { width: 4px; }
.feed::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.feed-msg {
  font-size: 11px;
  color: var(--text-muted);
  padding: 7px 11px;
  border-radius: 6px;
  background: #F5F6F8;
  border-left: 3px solid var(--border-mid);
  animation: fadeIn 0.2s ease;
  font-variant-numeric: tabular-nums;
}

.feed-msg.success { border-left-color: var(--green); background: var(--green-light); color: var(--green); }
.feed-msg.error   { border-left-color: var(--red);   background: var(--red-light);   color: var(--red); }
.feed-msg.info    { border-left-color: var(--blue);  background: var(--blue-light);  color: var(--blue); }

@keyframes fadeIn { from { opacity: 0; transform: translateY(5px); } to { opacity: 1; transform: none; } }

/* ── SETTINGS MODAL ───────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(30,41,59,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
}

.modal {
  background: var(--bg-card);
  border-radius: 14px;
  width: 100%;
  max-width: 860px;
  max-height: 88vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,0.25);
}

.modal-header {
  flex-shrink: 0;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title { font-size: 14px; font-weight: 700; }

.modal-x {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 15px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all 0.15s;
}

.modal-x:hover { background: var(--red-light); color: var(--red); }

.modal-body {
  flex: 1;
  display: grid;
  grid-template-columns: 240px 1fr;
  overflow: hidden;
  min-height: 400px;
}

/* Settings — operations list */
.settings-list-col {
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  background: var(--bg-panel);
  overflow: hidden;
}

.settings-list-header {
  flex-shrink: 0;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}

.mini-btn {
  background: var(--blue);
  border: none;
  border-radius: 5px;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 4px 9px;
  cursor: pointer;
  letter-spacing: 0.3px;
  font-family: inherit;
}

.mini-btn:hover { background: var(--blue-hover); }

.settings-op-list {
  list-style: none;
  flex: 1;
  overflow-y: auto;
  padding: 6px 0;
}

.settings-op-list::-webkit-scrollbar { width: 4px; }
.settings-op-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.settings-op-item {
  padding: 9px 14px;
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  border-left: 3px solid transparent;
  transition: all 0.12s;
}

.settings-op-item:hover { background: rgba(37,99,235,0.05); color: var(--text); }

.settings-op-item.selected {
  background: rgba(37,99,235,0.09);
  border-left-color: var(--blue);
  color: var(--text);
}

.settings-op-item .s-icon { font-size: 14px; }

/* Settings — editor */
.settings-editor {
  overflow-y: auto;
  padding: 18px 20px;
}

.settings-editor::-webkit-scrollbar { width: 5px; }
.settings-editor::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.editor-empty {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: var(--text-light);
  font-size: 13px;
  line-height: 1.6;
}

.editor-form { display: flex; flex-direction: column; gap: 14px; }

.form-row { display: flex; gap: 12px; }

.form-row-split .form-field:first-child { flex: 1; }

.form-field { display: flex; flex-direction: column; gap: 5px; flex: 1; }

.form-field-icon { flex: 0 0 80px; }

.form-field label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.form-field input[type="text"],
.form-field textarea {
  background: #FAFBFC;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 13px;
  color: var(--text);
  outline: none;
  font-family: inherit;
  transition: all 0.15s;
  resize: vertical;
}

.form-field input:focus,
.form-field textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: #fff;
}

.form-field textarea { line-height: 1.5; font-size: 12px; }

/* Template zone */
.tpl-zone {
  border: 1.5px dashed var(--border-mid);
  border-radius: 8px;
  padding: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.15s;
  background: #FAFBFC;
}

.tpl-zone:hover { border-color: var(--green); color: var(--green); background: var(--green-light); }

.tpl-list { list-style: none; display: flex; flex-direction: column; gap: 5px; margin-top: 7px; }

.tpl-item {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--green-light);
  border: 1px solid rgba(5,150,105,0.2);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 600;
  color: var(--green);
}

.tpl-item span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.tpl-item button {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 11px;
  padding: 1px 4px;
}

.tpl-item button:hover { color: var(--red); }

/* Editor actions */
.editor-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.editor-actions-right { display: flex; gap: 8px; }

.btn-primary {
  background: var(--blue);
  border: none;
  border-radius: 7px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
}

.btn-primary:hover { background: var(--blue-hover); }

.btn-ghost {
  background: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-ghost:hover { border-color: var(--text-muted); color: var(--text); }

.btn-sm { padding: 6px 12px; font-size: 11px; }

.btn-danger {
  background: none;
  border: 1px solid rgba(220,38,38,0.3);
  border-radius: 7px;
  color: var(--red);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.btn-danger:hover { background: var(--red-light); }

.modal-footer {
  flex-shrink: 0;
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg-panel);
}

.modal-footer-note {
  margin-left: auto;
  font-size: 10px;
  color: var(--text-light);
}

/* ── ADMIN MODE ───────────────────────────────────────────────────────────── */
.admin-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 4px 10px;
  border-radius: 20px;
  background: var(--green-light);
  color: var(--green);
  border: 1px solid rgba(5,150,105,0.3);
}

.modal-header-right { display: flex; align-items: center; gap: 10px; }

.admin-toggle {
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
}

.admin-toggle:hover { border-color: var(--blue); color: var(--blue); }

.admin-toggle.unlocked {
  background: var(--green-light);
  border-color: rgba(5,150,105,0.3);
  color: var(--green);
}

.admin-notice {
  flex-shrink: 0;
  padding: 9px 20px;
  background: #FFF8E6;
  border-bottom: 1px solid #F0E3B8;
  font-size: 11px;
  color: #8A6D1A;
}

.admin-notice.hidden { display: none; }

/* View-only: disable admin controls */
body:not(.is-admin) .admin-only {
  opacity: 0.4;
  pointer-events: none;
}

body:not(.is-admin) .editor-form input,
body:not(.is-admin) .editor-form textarea {
  pointer-events: none;
  background: #F1F3F6;
  color: var(--text-muted);
}

/* ── OUTPUT FILES ─────────────────────────────────────────────────────────── */
.outputs-wrap {
  background: var(--bg-card);
  border: 1px solid rgba(5,150,105,0.3);
  border-radius: 12px;
  overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.outputs-wrap .feed-header {
  background: var(--green-light);
  border-bottom: 1px solid rgba(5,150,105,0.2);
}

.outputs-wrap .panel-label { color: var(--green); }

.outputs-list {
  list-style: none;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  overflow-y: auto;
  max-height: 480px;
}

.output-item {
  display: flex;
  align-items: center;
  gap: 14px;
  background: #FAFBFC;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 16px 18px;
  animation: fadeIn 0.25s ease;
}

.output-item-icon { font-size: 26px; }

.output-item-info { flex: 1; display: flex; flex-direction: column; gap: 1px; overflow: hidden; }

.output-item-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.output-item-meta { font-size: 12px; color: var(--text-muted); }

.output-dl {
  background: var(--green);
  border: none;
  border-radius: 6px;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 6px 14px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.15s;
  flex-shrink: 0;
}

.output-dl:hover { background: #047857; }

/* ── LOGIN SCREEN ─────────────────────────────────────────────────────────── */
.login-screen {
  position: fixed; inset: 0;
  background: var(--bg-app, #EAECEF);
  display: flex; align-items: center; justify-content: center;
  z-index: 500;
}

.login-card {
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: 14px;
  padding: 34px 36px;
  width: 100%; max-width: 360px;
  display: flex; flex-direction: column; gap: 12px;
  box-shadow: 0 8px 30px rgba(0,0,0,0.08);
  text-align: center;
}

.login-logo { display: flex; justify-content: center; margin-bottom: 4px; }
.login-logo .logo-mark { width: 44px; height: 44px; font-size: 20px; }

.login-title { font-size: 19px; font-weight: 700; color: #1E293B; }
.login-sub   { font-size: 12px; color: #64748B; margin-bottom: 8px; }

.login-input {
  background: #FAFBFC;
  border: 1px solid #D1D5DB;
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 13px;
  color: #1E293B;
  outline: none;
  transition: all 0.15s;
}

.login-input:focus {
  border-color: #2563EB;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  background: #fff;
}

.login-btn {
  background: #2563EB;
  border: none; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 12px; cursor: pointer;
  letter-spacing: 0.5px;
  transition: background 0.15s;
  margin-top: 4px;
}

.login-btn:hover:not(:disabled) { background: #1D4ED8; }
.login-btn:disabled { opacity: 0.5; cursor: wait; }

.login-error { font-size: 11px; color: #DC2626; min-height: 14px; }

/* ── ADMIN BADGE (topbar) ─────────────────────────────────────────────────── */
.admin-badge {
  font-size: 10px; font-weight: 700; letter-spacing: 1px;
  padding: 4px 10px; border-radius: 20px;
  background: #ECFDF5; color: #059669;
  border: 1px solid rgba(5,150,105,0.3);
}

/* ── OUTPUT FILES ─────────────────────────────────────────────────────────── */
.outputs-wrap {
  background: #fff;
  border: 1px solid rgba(5,150,105,0.3);
  border-radius: 12px; overflow: hidden;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.outputs-wrap .feed-header {
  background: #ECFDF5;
  border-bottom: 1px solid rgba(5,150,105,0.2);
}

.outputs-wrap .panel-label { color: #059669; }

.outputs-list { list-style: none; padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; overflow-y: auto; max-height: 480px; }

.output-item {
  display: flex; align-items: center; gap: 14px;
  background: #FAFBFC; border: 1px solid #D1D5DB;
  border-radius: 10px; padding: 16px 18px;
  animation: fadeIn 0.25s ease;
}

.output-item-icon { font-size: 26px; }
.output-item-info { flex: 1; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.output-item-name { font-size: 15px; font-weight: 700; color: #1E293B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.output-item-meta { font-size: 12px; color: #64748B; }

.output-dl {
  background: #059669; border: none; border-radius: 8px;
  color: #fff; font-size: 13px; font-weight: 700;
  padding: 10px 20px; cursor: pointer;
  transition: background 0.15s; flex-shrink: 0;
  font-family: inherit;
}

.output-dl:hover { background: #047857; }

/* ── STEPS STRIP ──────────────────────────────────────────────────────────── */
.steps-strip {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid #D1D5DB;
  border-radius: 10px;
  padding: 10px 16px;
}

.step { display: flex; align-items: center; gap: 8px; }

.step-num {
  width: 22px; height: 22px;
  border-radius: 50%;
  background: #E8EAEE;
  color: #64748B;
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.2s;
}

.step-label { font-size: 11px; font-weight: 600; color: #94A3B8; transition: color 0.2s; }

.step-sep { color: #C3C9D2; font-size: 12px; }

.step.active .step-num { background: #2563EB; color: #fff; }
.step.active .step-label { color: #1E293B; }

.step.done .step-num { background: #059669; color: #fff; }
.step.done .step-num::before { content: "✓"; }
.step.done .step-num { font-size: 0; }
.step.done .step-num::before { font-size: 11px; }
.step.done .step-label { color: #059669; }

/* ── INPUT SLOTS (multi-file) ─────────────────────────────────────────────── */
.input-slots { display: flex; flex-direction: column; gap: 10px; }

.slot {
  border: 2px dashed #C3C9D2;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 68px;
}

.slot:hover, .slot.dragover { border-color: #2563EB; background: #EEF4FF; }

.slot.filled {
  border-style: solid;
  border-color: rgba(5,150,105,0.4);
  background: #ECFDF5;
  cursor: default;
}

.slot-icon {
  width: 38px; height: 38px;
  border-radius: 9px;
  background: #EEF4FF;
  display: flex; align-items: center; justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
  color: #2563EB;
}

.slot.filled .slot-icon { background: rgba(5,150,105,0.12); }

.slot-info { flex: 1; display: flex; flex-direction: column; gap: 2px; overflow: hidden; }

.slot-label { font-size: 13px; font-weight: 700; color: #1E293B; }

.slot-sub { font-size: 11px; color: #64748B; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.slot.filled .slot-sub { color: #059669; font-weight: 600; }

.slot-status {
  font-size: 10px; font-weight: 700; letter-spacing: 0.5px;
  padding: 4px 10px; border-radius: 20px;
  background: #F1F3F6; color: #94A3B8;
  flex-shrink: 0;
}

.slot.filled .slot-status { background: rgba(5,150,105,0.12); color: #059669; }

.slot-x {
  background: none; border: none;
  color: #64748B; cursor: pointer;
  font-size: 13px; padding: 4px 7px;
  border-radius: 5px; flex-shrink: 0;
  transition: color 0.15s;
}

.slot-x:hover { color: #DC2626; }


/* ── RIGHT PANEL: INSTRUCTIONS (30%) ─────────────────────────────────────── */
.panel-right {
  background: #FFFDF5;
  border-left: 1px solid #E5DFC8;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
}

.instructions-section {
  flex-shrink: 0;      /* capped -- doesn't stretch to fill the whole column */
  max-height: 62%;      /* extended down closer to the Start Processing button */
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  border-bottom: 2px solid #E5DFC8;
}
.instructions-section::-webkit-scrollbar { width: 5px; }
.instructions-section::-webkit-scrollbar-thumb { background: #E5DFC8; border-radius: 4px; }

.panel-right .panel-header {
  border-bottom: 1px solid #E5DFC8;
  background: #FFF9E8;
}

.panel-right .panel-label { color: #8A6D1A; }

.instructions-body {
  flex: 1;
  overflow-y: visible;   /* the .instructions-section wrapper handles scrolling now */
  padding: 16px 20px;
  font-size: 13px;
  line-height: 1.65;
  color: #3B3B2E;
}

.instructions-body::-webkit-scrollbar { width: 5px; }
.instructions-body::-webkit-scrollbar-thumb { background: #E5DFC8; border-radius: 4px; }

.instructions-empty { color: #A8A183; font-size: 12px; font-style: italic; }

.instructions-body h3 {
  font-size: 15px; font-weight: 700; color: #1E293B;
  margin: 14px 0 6px;
}
.instructions-body h3:first-child { margin-top: 0; }

.instructions-body h4 {
  font-size: 13px; font-weight: 700; color: #3B3B2E;
  margin: 12px 0 4px;
}

.instructions-body p { margin: 0 0 8px; }

.instructions-body ul, .instructions-body ol { margin: 0 0 10px 20px; }
.instructions-body li { margin-bottom: 4px; }

.instructions-body .step-badge {
  display: inline-block;
  background: #2563EB; color: #fff;
  font-size: 10px; font-weight: 800;
  padding: 2px 9px; border-radius: 20px;
  margin-right: 6px; letter-spacing: 0.5px;
}

.instructions-body strong { color: #1E293B; }

.instructions-body code {
  background: #F1EFE2; border-radius: 4px;
  padding: 1px 5px; font-size: 12px;
}

/* ── LOADED FILES LIST (universal multi-file) ────────────────────────────── */
.loaded-files {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.loaded-files:empty { display: none; }

.lf-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #ECFDF5;
  border: 1px solid rgba(5,150,105,0.25);
  border-radius: 8px;
  padding: 8px 13px;
  animation: fadeIn 0.2s ease;
}

.lf-num {
  width: 20px; height: 20px;
  border-radius: 50%;
  background: rgba(5,150,105,0.15);
  color: #059669;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.lf-name {
  flex: 1;
  font-size: 12px; font-weight: 600; color: #059669;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.lf-size { font-size: 10px; color: #64748B; flex-shrink: 0; }

.lf-x {
  background: none; border: none;
  color: #64748B; cursor: pointer;
  font-size: 12px; padding: 2px 6px;
  transition: color 0.15s; flex-shrink: 0;
}

.lf-x:hover { color: #DC2626; }

.lf-counter {
  font-size: 10px;
  color: #64748B;
  text-align: right;
  padding: 2px 4px;
}

/* Narrow screens: stack instructions below */
@media (max-width: 1100px) {
  .hub { grid-template-columns: var(--panel-w) 1fr; }
  .panel-right { display: none; }
}

/* ── REFRESH BUTTON ───────────────────────────────────────────────────────── */
.refresh-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
}
.refresh-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* ── STRONGER ACTIVE OPERATION BUTTON (item 3) ───────────────────────────── */
.op-item.active .op-btn {
  background: var(--blue) !important;
  border-left-color: #1D4ED8 !important;
}
.op-item.active .op-name  { color: #fff !important; }
.op-item.active .op-desc  { color: rgba(255,255,255,0.8) !important; }
.op-item.active .op-icon  {
  background: rgba(255,255,255,0.18) !important;
  border-color: rgba(255,255,255,0.4) !important;
}

/* ── EMPTY STATE: no operation chosen yet -- left notice / right drop preview ── */
#drop-inner-empty { display: none; }
.drop-zone.no-op #drop-inner-ready { display: none; }
.drop-zone.no-op #drop-inner-empty { display: flex; }
.drop-zone.no-op { cursor: default; background: #F5F6F8; }

#drop-inner-empty {
  width: 100%;
  flex-direction: row;      /* override .drop-inner's column default -- left/right split */
  align-items: stretch;
  padding: 0;
  gap: 0;
}

.empty-notice {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  text-align: center;
}
.empty-notice-icon {
  font-size: 30px;
  margin-bottom: 8px;
  animation: point-left 1.4s ease-in-out infinite;
}
@keyframes point-left { 0%,100% { transform: translateX(0); } 50% { transform: translateX(-6px); } }
.empty-notice-title { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.empty-notice-sub { font-size: 11.5px; color: var(--text-muted); max-width: 220px; }

.empty-divider {
  width: 1px;
  background: var(--border-mid);
  margin: 24px 0;
}

.empty-drop-preview {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 20px;
  opacity: 0.55;
}
.empty-drop-label { font-size: 13px; font-weight: 600; color: var(--text-light); margin-top: 6px; }
.empty-drop-sub { font-size: 10.5px; color: var(--text-light); margin-top: 2px; }

/* ── PROCESSING LOCK BANNER -- styled as a genuine attention/warning notice ── */
.processing-banner {
  background: #FFFBEB;
  border: 1.5px solid #F59E0B;
  border-left: 6px solid #D97706;
  border-radius: 10px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: 0 3px 12px rgba(217,119,6,0.15);
  position: sticky;   /* stays visible at the top of the workspace as it
                          scrolls, instead of scrolling out of view */
  top: 0;
  z-index: 60;
  flex-shrink: 0;     /* never gets squeezed smaller by the flex layout */
}
.processing-timer {
  flex-shrink: 0;
  font-family: 'Consolas', monospace;
  font-size: 15px;
  font-weight: 700;
  color: #92400E;
  background: rgba(217,119,6,0.12);
  border-radius: 8px;
  padding: 6px 12px;
  min-width: 52px;
  text-align: center;
}
.processing-icon {
  font-size: 26px;
  flex-shrink: 0;
  animation: attention-pulse 1.3s ease-in-out infinite;
}
@keyframes attention-pulse { 0%,100% { opacity: 1; transform: scale(1); } 50% { opacity: 0.55; transform: scale(1.12); } }
.processing-spinner {
  width: 22px; height: 22px;
  border: 3px solid rgba(217,119,6,0.25);
  border-top-color: #D97706;
  border-radius: 50%;
  flex-shrink: 0;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.processing-text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.processing-title {
  font-size: 13.5px; font-weight: 800; color: #92400E;
  letter-spacing: 0.2px; text-transform: uppercase;
}
.processing-sub { font-size: 12px; color: #B45309; font-weight: 500; }

/* ── DISABLED-DURING-PROCESSING LOCK (item 5) ────────────────────────────── */
body.is-processing .op-btn,
body.is-processing .settings-btn,
body.is-processing .add-op-btn,
body.is-processing .refresh-btn {
  pointer-events: none;
  opacity: 0.45;
  cursor: not-allowed;
}
body.is-processing .drop-zone { pointer-events: none; opacity: 0.55; }

/* ── REVISION UI (Option C) — proper dropdown accordion under the file ──── */
.output-item {
  display: block;         /* row + drawer must stack vertically, not side-by-side */
  padding: 0;              /* the row owns the padding now, not the li itself */
  overflow: hidden;        /* clips the drawer cleanly + keeps rounded corners */
}
.output-item-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 18px;
}
.revision-btn {
  background: none;
  border: 1px solid var(--border-mid);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  padding: 6px 12px;
  cursor: pointer;
  transition: all 0.15s;
  font-family: inherit;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
}
.revision-btn:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }
.revision-btn .chev {
  display: inline-block;
  font-size: 9px;
  transition: transform 0.2s ease;
}
.revision-btn.open .chev { transform: rotate(180deg); }
.revision-btn.open { border-color: var(--blue); color: var(--blue); background: var(--blue-light); }

/* Accordion wrapper — smoothly expands/collapses, visually docked under the row */
.revision-drawer {
  width: 100%;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.25s ease;
  background: #F8FAFF;
  border-top: 1px solid var(--border);
}
.revision-drawer.open { max-height: 220px; }

.revision-box {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
  position: relative;
}
.revision-box::before {
  /* small connector arrow pointing up to the button that opened this drawer */
  content: "";
  position: absolute;
  top: -7px; right: 34px;
  width: 12px; height: 12px;
  background: #F8FAFF;
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}
.revision-label {
  font-size: 10.5px; font-weight: 700; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--blue);
}
.revision-box textarea {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 9px 11px;
  font-size: 12.5px;
  color: var(--text);
  font-family: inherit;
  resize: vertical;
  min-height: 56px;
}
.revision-box textarea:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.revision-actions { display: flex; gap: 8px; justify-content: flex-end; }
.revision-submit {
  background: var(--blue);
  border: none; border-radius: 6px;
  color: #fff; font-size: 11.5px; font-weight: 700;
  padding: 7px 16px; cursor: pointer;
  font-family: inherit;
}
.revision-submit:hover { background: var(--blue-hover); }
.revision-cancel {
  background: none; border: 1px solid var(--border);
  border-radius: 6px; color: var(--text-muted);
  font-size: 11.5px; font-weight: 600;
  padding: 7px 14px; cursor: pointer;
  font-family: inherit;
}
.revision-tag {
  font-size: 10px; font-weight: 700; letter-spacing: 0.4px;
  background: var(--blue-light); color: var(--blue);
  padding: 3px 9px; border-radius: 20px;
  margin-top: 4px; display: inline-block;
}

/* ── BOARD BADGE (sidebar header) ────────────────────────────────────────── */
.panel-header { display: flex; align-items: center; justify-content: space-between; }
.board-badge {
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.4px;
  background: #EEF4FF; color: var(--blue);
  padding: 3px 9px; border-radius: 20px;
}

/* ── CREATE NEW TASK BUTTON ───────────────────────────────────────────────── */
.create-task-btn {
  width: 100%;
  background: var(--blue);
  border: none;
  border-radius: 8px;
  padding: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 8px;
  transition: background 0.15s;
  font-family: inherit;
}
.create-task-btn:hover { background: var(--blue-hover); }

/* ── WIZARD MODAL ─────────────────────────────────────────────────────────── */
.wizard-modal { max-width: 620px; }

.wizard-steps {
  display: flex;
  align-items: center;
  padding: 16px 24px 6px;
  gap: 4px;
}
.wizard-step-dot {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: #E8EAEE;
  color: var(--text-muted);
  font-size: 11px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  position: relative;
  flex-shrink: 0;
}
.wizard-step-dot span {
  position: absolute;
  top: 32px; left: 50%; transform: translateX(-50%);
  font-size: 9px; font-weight: 600; color: var(--text-light);
  white-space: nowrap;
}
.wizard-step-dot.active { background: var(--blue); color: #fff; }
.wizard-step-dot.active span { color: var(--blue); }
.wizard-step-dot.done { background: var(--green); color: #fff; }
.wizard-step-line { flex: 1; height: 2px; background: #E8EAEE; }

.wizard-body { padding: 30px 24px 20px; min-height: 220px; }
.wizard-pane { display: none; flex-direction: column; gap: 14px; }
.wizard-pane.active { display: flex; }

.wizard-hint { font-size: 12px; color: var(--text-muted); margin: 0; }
.wizard-hint b { color: var(--text); }

.wizard-drop { padding: 20px; text-align: center; cursor: pointer; }

.wizard-preview {
  background: var(--green-light);
  border: 1px solid rgba(5,150,105,0.25);
  border-radius: 9px;
  padding: 12px 14px;
}
.wizard-preview-label { font-size: 11px; font-weight: 700; color: var(--green); margin-bottom: 6px; }
.wizard-preview-text {
  font-size: 11.5px; color: var(--text);
  max-height: 140px; overflow-y: auto;
  white-space: pre-wrap; line-height: 1.5;
}

.wizard-checks { display: flex; gap: 16px; }
.wizard-checks label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); cursor: pointer; }

.wizard-review {
  background: #FAFBFC;
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 14px 16px;
  font-size: 12px;
  line-height: 1.8;
}
.wizard-review b { color: var(--text); }

.wizard-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 6px;
}

/* ── DROP PAIR: manual drop (left) + auto-collect placeholder (right) ────── */
.drop-pair {
  display: flex;
  gap: 14px;
  position: relative;
}
.drop-pair-or {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: 34px; height: 34px;
  border-radius: 50%;
  background: #fff;
  border: 1px solid var(--border-mid);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--text-light);
  letter-spacing: 0.5px;
  z-index: 5;
}
.drop-pair .drop-zone {
  flex: 1;
  min-height: 190px;
  margin: 0;
}
.drop-zone-auto {
  cursor: pointer;
}
.drop-zone-auto:hover {
  border-color: var(--blue);
  background: var(--blue-light);
}
.drop-icon-muted { opacity: 0.55; }

@media (max-width: 900px) {
  .drop-pair { flex-direction: column; }
}

/* ── CREW & ACCESS MATRIX ─────────────────────────────────────────────────── */
.crew-btn {
  width: 100%;
  background: #fff;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  padding: 9px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 8px;
  transition: all 0.15s;
  font-family: inherit;
}
.crew-btn:hover { border-color: var(--blue); color: var(--blue); }

.crew-modal { max-width: 640px; }
.crew-body { padding: 20px 24px 24px; }
.crew-body h2.sub {
  font-size: 12px; font-weight: 700; letter-spacing: 0.5px; text-transform: uppercase;
  color: var(--text-muted); margin: 18px 0 10px;
}

.crew-list { list-style: none; display: flex; flex-direction: column; gap: 7px; margin-bottom: 10px; }
.crew-item {
  display: flex; align-items: center; gap: 10px;
  background: #FAFBFC; border: 1px solid var(--border);
  border-radius: 8px; padding: 9px 13px;
}
.crew-item .role-tag {
  font-size: 9px; font-weight: 800; letter-spacing: 0.4px;
  padding: 2px 8px; border-radius: 20px;
}
.crew-item.is-admin .role-tag { background: var(--blue-light); color: var(--blue); }
.crew-item.is-crew .role-tag { background: var(--green-light); color: var(--green); }
.crew-item .email { flex: 1; font-size: 12.5px; font-weight: 600; color: var(--text); }
.crew-item .remove-btn {
  background: none; border: none; color: var(--text-muted);
  cursor: pointer; font-size: 12px; padding: 2px 6px;
}
.crew-item .remove-btn:hover { color: var(--red); }

.crew-add-row { display: flex; gap: 8px; margin-top: 6px; }
.crew-add-row input {
  flex: 1; background: #FAFBFC; border: 1px solid var(--border);
  border-radius: 7px; padding: 8px 11px; font-size: 12px; color: var(--text);
}
.crew-add-row input:focus { border-color: var(--blue); outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.crew-cap-note { font-size: 10.5px; color: var(--text-light); margin-top: 6px; }

.matrix-wrap { overflow-x: auto; margin-top: 10px; }
.access-matrix { width: 100%; border-collapse: collapse; font-size: 12px; }
.access-matrix th, .access-matrix td {
  padding: 9px 12px; text-align: center; border-bottom: 1px solid var(--border);
}
.access-matrix th { font-size: 10.5px; color: var(--text-muted); font-weight: 700; }
.access-matrix td:first-child, .access-matrix th:first-child {
  text-align: left; font-weight: 600; color: var(--text); white-space: nowrap;
}
.access-matrix input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; accent-color: var(--blue); }

/* ── BOARD TITLE BAR (top of workspace) ──────────────────────────────────── */
.board-title-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 16px;
}
.board-title-icon { font-size: 16px; }
.board-title-text { font-size: 14px; font-weight: 800; color: var(--text); flex: 1; }
.back-to-tower-btn {
  font-size: 11px; font-weight: 700; color: var(--blue);
  text-decoration: none; padding: 6px 12px;
  border: 1px solid var(--blue); border-radius: 7px;
  transition: all 0.15s;
}
.back-to-tower-btn:hover { background: var(--blue-light); }

/* ── OP LIST: three-dot task menu (admin-only) ───────────────────────────── */
.op-item {
  display: flex;
  align-items: stretch;
}
.op-item .op-btn { flex: 1; }

.op-menu-wrap {
  position: relative;
  display: flex;
  align-items: center;
  padding-right: 8px;
}
.op-menu-btn {
  background: none;
  border: none;
  color: var(--text-light);
  font-size: 16px;
  font-weight: 700;
  width: 26px; height: 26px;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.15s;
}
.op-menu-btn:hover { background: rgba(0,0,0,0.06); color: var(--text-muted); }
.op-item.active .op-menu-btn { color: rgba(255,255,255,0.7); }
.op-item.active .op-menu-btn:hover { background: rgba(255,255,255,0.15); color: #fff; }

.op-menu-dropdown {
  position: absolute;
  top: 100%; right: 6px;
  z-index: 50;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
  min-width: 150px;
  overflow: hidden;
  margin-top: 2px;
}
.op-menu-item {
  display: block;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 9px 13px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  font-family: inherit;
}
.op-menu-item:hover { background: #F5F6F8; }
.op-menu-item.danger { color: var(--red); }
.op-menu-item.danger:hover { background: var(--red-light); }

/* ── OUTPUT FILES: now lives in panel-right, below instructions ──────────── */
/* More specific selector deliberately overrides the older .outputs-wrap
   rules (which had a leftover 260px min-height / 480px max-height meant for
   its old spot in the center column) -- here it must be fully unrestricted. */
.panel-right .outputs-wrap {
  flex: 1;
  min-height: 0;
  max-height: none;
  margin: 0;
  border: none;
  border-radius: 0;
  overflow-y: auto;
}
.panel-right .outputs-list {
  max-height: none;
  overflow-y: visible;   /* the parent .outputs-wrap now owns the scrolling */
}

/* ── VISUAL OUTPUT (center column, below Start Processing) ──────────────── */
/* Hidden by default -- only appears if a run actually produces an image,
   same "hidden until there's something to show" pattern as Output Files.
   Multiple images stack vertically and grow the card (confirmed: the whole
   center column already scrolls, so this never needs its own scrollbar). */
.visual-output-placeholder {
  flex-shrink: 0;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.visual-output-list {
  padding: 16px 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.visual-output-default {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding: 30px 18px;
  opacity: 0.75;
}
.visual-output-default-text {
  font-size: 12px;
  color: var(--text-light);
  font-style: italic;
}
.visual-output-image {
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--border);
  display: block;
}

/* ── OUTPUT ITEM: filename gets its own full-width line ──────────────────── */
/* Deliberately placed last so it wins over the older duplicate .output-item
   rules above -- those were designed for the wider center column and
   truncated long filenames ("S..", "W.") once Output Files moved into the
   narrower right column. This fixes that directly. */
.panel-right .output-item-row {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  padding: 14px 16px;
}
.panel-right .output-item-top {
  display: flex;
  align-items: center;
  gap: 8px;
}
.panel-right .output-item-icon { font-size: 16px; flex-shrink: 0; }
.panel-right .output-item-meta { font-size: 10.5px; color: var(--text-muted); }
.panel-right .output-item-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  white-space: normal;      /* wraps instead of truncating */
  overflow: visible;
  text-overflow: unset;
  overflow-wrap: break-word;
  word-break: break-word;
  line-height: 1.4;
}
.panel-right .output-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.panel-right .output-item-actions .output-dl,
.panel-right .output-item-actions .revision-btn {
  flex: 1;
  min-width: 0;
  justify-content: center;
  text-align: center;
}

/* ── RECENT REPORTS / ALARMS ──────────────────────────────────────────────── */
.reports-body { padding: 18px 24px 24px; max-height: 60vh; overflow-y: auto; }
.report-entry {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.report-entry-top { display: flex; justify-content: space-between; align-items: center; font-size: 12px; }
.report-entry-date { color: var(--text-muted); font-size: 11px; }
.report-alert {
  margin-top: 8px;
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  border-radius: 7px;
  padding: 8px 11px;
  font-size: 12px;
  color: #991B1B;
  font-weight: 600;
}
.report-files { margin-top: 8px; display: flex; flex-direction: column; gap: 4px; }
.report-file-link {
  font-size: 11.5px;
  color: var(--blue);
  text-decoration: none;
}
.report-file-link:hover { text-decoration: underline; }

/* ── COMMUNICATIONS ───────────────────────────────────────────────────────── */
.comms-body { padding: 18px 24px 24px; display: flex; flex-direction: column; gap: 14px; }
.comms-body code {
  background: #F1F3F6;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 11px;
}

/* ── FILE PREVIEW POPUP (hover-to-peek on image files) ────────────────────── */
/* Appended to document.body by JS, not nested in any file-row container --
   deliberately, so it's never at risk of being clipped by a parent's
   overflow:hidden (several file-list containers have that set for the
   unrelated purpose of clipping the revision drawer). */
.file-preview-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(255,255,255,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  pointer-events: none;
}
.file-preview-popup {
  position: fixed;
  z-index: 9999;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
  max-width: 470px;
  pointer-events: none;
}
.file-preview-popup img {
  display: block;
  max-width: 450px;
  max-height: 450px;
  border-radius: 6px;
}
