:root {
  /* Pantheon Labs website aligned palette: warm black + orange action color. */
  --bg: #070605;
  --bg-soft: #0d0a08;
  --topbar: #14100d;
  --card: #100d0b;
  --card-2: #080706;
  --border: #26201c;
  --border-2: #342a24;
  --text: #fff7ef;
  --muted: #a9a09a;
  --muted-2: #7f7670;
  --tab: #17120f;
  --primary: #f45a0a;
  --primary-hover: #ff6a18;
  --secondary: #24201d;
  --secondary-hover: #302a26;
  --danger: #dc2626;
  --success: #22c55e;
  --accent: #f45a0a;
  --shadow: rgba(0, 0, 0, .35);
  font-family: "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at 28% 0%, rgba(244, 90, 10, .08), transparent 32%),
    linear-gradient(180deg, #080706 0%, #050403 100%);
  color: var(--text);
  font-size: 10.5pt;
}

.app-shell {
  width: min(1280px, calc(100% - 36px));
  margin: 0 auto;
  padding: 18px 0 24px;
}

.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.brand-box {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.app-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex: 0 0 auto;
  filter: drop-shadow(0 8px 18px rgba(244, 90, 10, .22));
}

.title-box { min-width: 0; }

.title-box h1 {
  margin: 0;
  font-size: 22pt;
  font-weight: 750;
  color: #ffffff;
  letter-spacing: -0.03em;
}

.title-box p,
.muted,
.drop-subtitle,
.license-status small {
  color: var(--muted);
  margin: 4px 0 0;
}

.license-status {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  text-align: right;
}

.license-status strong {
  color: var(--text);
  display: block;
  font-weight: 650;
}

.dot {
  width: 11px;
  height: 11px;
  border-radius: 99px;
  background: #f59e0b;
  box-shadow: 0 0 16px #f59e0b;
}
.dot.ok { background: var(--success); box-shadow: 0 0 16px var(--success); }
.dot.bad { background: #ef4444; box-shadow: 0 0 16px #ef4444; }
.dot.warn { background: #f59e0b; box-shadow: 0 0 16px #f59e0b; }

.tabs {
  display: flex;
  align-items: end;
  gap: 6px;
  margin-bottom: 12px;
}

.tab {
  background: var(--tab);
  color: var(--muted);
  padding: 10px 17px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-weight: 700;
  cursor: pointer;
}

.tab:hover { color: #fff; border-color: #4a3428; }
.tab.active {
  background: var(--primary);
  border-color: var(--primary);
  color: #ffffff;
  box-shadow: 0 8px 24px rgba(244, 90, 10, .18);
}

.view { display: none; background: transparent; }
.view.active { display: block; }

.two-column {
  display: grid;
  grid-template-columns: 2fr 3fr;
  gap: 18px;
}

.left-stack,
.right-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.card,
.drop-card {
  background: linear-gradient(180deg, #100d0b 0%, #0b0908 100%);
  border: 1px solid var(--border);
  border-radius: 14px;
  box-shadow: 0 12px 35px var(--shadow);
}

.card { padding: 14px; }

.drop-card {
  min-height: 110px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
  position: relative;
  z-index: 1;
}

.drop-card:hover {
  border-color: var(--primary);
  background: linear-gradient(180deg, #17100c 0%, #0d0907 100%);
  transform: none;
  box-shadow: inset 0 0 0 1px var(--primary), 0 12px 35px var(--shadow);
}

.drop-card.wide { margin-bottom: 12px; }

.drop-title {
  font-size: 14pt;
  font-weight: 750;
  color: #fff;
  margin-bottom: 6px;
}

label,
.section-label {
  display: block;
  color: var(--text);
  margin: 0 0 7px;
  font-weight: 650;
}

.inline-label {
  margin-top: 12px;
  color: var(--muted);
  font-weight: 500;
}

input,
textarea,
select {
  width: 100%;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  color: var(--text);
  padding: 8px;
  font: inherit;
  outline: none;
}

textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.45;
}
#logs { min-height: 340px; }

input::placeholder,
textarea::placeholder { color: var(--muted-2); }

input:focus,
textarea:focus,
select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(244, 90, 10, .16);
}

input[readonly],
textarea[readonly] { color: #d6cdc5; }

.path-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.button-row {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}
.button-row.compact { margin-top: 0; }
.action-row { margin-top: 4px; }
.spacer { flex: 1; }

button {
  background: var(--primary);
  border: 0;
  border-radius: 9px;
  padding: 9px 14px;
  color: white;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(244, 90, 10, .16);
}
button:hover { background: var(--primary-hover); }
button.secondary {
  background: var(--secondary);
  color: #ffffff;
  box-shadow: none;
}
button.secondary:hover { background: var(--secondary-hover); }
button.danger { background: var(--danger); box-shadow: none; }
button.danger:hover { background: #b91c1c; }
button:disabled {
  background: #2a2521;
  color: var(--muted-2);
  cursor: not-allowed;
  box-shadow: none;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  margin: 0;
  font-weight: 500;
}
.check input { width: auto; accent-color: var(--primary); }

.table-wrap {
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: auto;
  box-shadow: 0 12px 35px var(--shadow);
}
.table-tall { min-height: 180px; max-height: 255px; }
.table-medium { min-height: 145px; max-height: 215px; }
.bulk-table-wrap { min-height: 420px; max-height: 520px; }

table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}
#bulk-table {
  width: 1830px;
  min-width: 1830px;
}

th {
  background: #19130f;
  color: var(--text);
  border: 0;
  padding: 8px;
  text-align: left;
  position: sticky;
  top: 0;
  z-index: 1;
}

td {
  border-top: 1px solid #241c17;
  padding: 7px 8px;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

tr:hover td { background: rgba(244, 90, 10, .035); }
.use-col { width: 42px; text-align: center; }
td.center { text-align: center; }
td.empty { text-align: center; color: var(--muted); padding: 22px; }
td select { padding: 5px; }

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 7px;
  border-radius: 999px;
  font-size: 9pt;
  font-weight: 800;
  background: #24201d;
  color: #d8d0c8;
}
.status-pill.ready { background: #064e3b; color: #a7f3d0; }
.status-pill.partial { background: #78350f; color: #fde68a; }
.status-pill.skip { background: #7f1d1d; color: #fecaca; }

.logs-status-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.progress-wrap {
  width: 100%;
  height: 20px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: 10px;
}
.progress-bar {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--primary), #ff8a3d);
  transition: width .2s ease;
}
.report-path { color: var(--muted); overflow-wrap: anywhere; }

@media (max-width: 1000px) {
  .two-column { grid-template-columns: 1fr; }
  .app-header,
  .logs-status-row { flex-direction: column; align-items: stretch; text-align: left; }
  .license-status { text-align: left; }
  .path-row { grid-template-columns: 1fr; }
}

/* UI polish 06: wider operator workspace + source summary + manual table column resizing */
.app-shell {
  width: min(1500px, calc(100% - 36px));
}

.source-summary-card {
  margin-top: 2px;
}
.summary-title {
  color: #ffffff;
  font-size: 11pt;
  font-weight: 750;
  margin-bottom: 10px;
}
.summary-grid {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 8px 12px;
  align-items: start;
}
.summary-grid span {
  color: var(--muted);
  font-weight: 600;
}
.summary-grid strong {
  color: #fff7ef;
  font-weight: 650;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.table-wrap {
  resize: vertical;
}

table.resizable-table th {
  position: sticky;
  top: 0;
  user-select: none;
}

.col-resizer {
  position: absolute;
  top: 0;
  right: -3px;
  width: 7px;
  height: 100%;
  cursor: col-resize;
  z-index: 5;
}

.col-resizer::after {
  content: "";
  position: absolute;
  top: 20%;
  bottom: 20%;
  left: 3px;
  width: 1px;
  background: rgba(244, 90, 10, .35);
  opacity: 0;
  transition: opacity .12s ease;
}

th:hover .col-resizer::after,
.col-resizer.active::after {
  opacity: 1;
}

body.resizing-columns {
  cursor: col-resize;
  user-select: none;
}

@media (min-width: 1200px) {
  .two-column {
    grid-template-columns: minmax(430px, 0.9fr) minmax(680px, 1.35fr);
  }
}


@media (max-width: 760px) {
  .app-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .app-logo {
    width: 34px;
    height: 34px;
  }
}

/* Bulk Queue final polish 10 */
.bulk-summary-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(180deg, #100d0b 0%, #0b0908 100%);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  padding: 10px 14px;
  margin: 0 0 10px;
  font-weight: 650;
}
.bulk-summary-bar strong { color: var(--text); }
.bulk-summary-bar .summary-ready { color: #a7f3d0; }
.bulk-summary-bar .summary-partial { color: #fde68a; }
.bulk-summary-bar .summary-skip { color: #fecaca; }
.status-col { width: 88px; }
.missing-col { width: 90px; }
.missing-text { color: var(--muted); font-weight: 650; }
.missing-text.has-missing { color: #fde68a; }
#bulk-table td:nth-child(4),
#bulk-table td:nth-child(6) {
  overflow: hidden;
  text-overflow: ellipsis;
}
#bulk-table .status-pill {
  min-width: 68px;
  justify-content: center;
}
#bulk-table th:nth-child(1), #bulk-table td:nth-child(1) { width: 42px; }
#bulk-table th:nth-child(2), #bulk-table td:nth-child(2) { width: 88px; }
#bulk-table th:nth-child(5), #bulk-table td:nth-child(5) { width: 90px; }
#bulk-table th:nth-child(6), #bulk-table td:nth-child(6) { min-width: 220px; }

/* Bulk viewport fit 12: keep action buttons above Windows taskbar and reduce oversized vertical spacing */
html, body {
  height: 100%;
}
body {
  overflow: hidden;
}
.app-shell {
  height: 100vh;
  padding: 12px 0 10px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.app-header {
  margin-bottom: 10px;
  padding-bottom: 10px;
  flex: 0 0 auto;
}
.app-logo {
  width: 36px;
  height: 36px;
}
.title-box h1 {
  font-size: 20pt;
}
.title-box p,
.muted,
.drop-subtitle,
.license-status small {
  margin-top: 3px;
}
.tabs {
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.tab {
  padding: 9px 16px;
}
.view {
  min-height: 0;
}
.view.active {
  min-height: 0;
}
#view-bulk.view.active {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}
#view-bulk .drop-card.wide {
  min-height: 90px;
  padding: 14px 18px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
#view-bulk .card {
  padding: 12px 14px;
  flex: 0 0 auto;
}
#view-bulk .bulk-summary-bar {
  padding: 8px 14px;
  margin-bottom: 8px;
  flex: 0 0 auto;
}
#view-bulk .bulk-table-wrap {
  flex: 1 1 auto;
  min-height: 220px;
  max-height: none;
  resize: none;
}
#view-bulk .action-row {
  flex: 0 0 auto;
  margin-top: 8px;
  padding-bottom: 0;
}
#view-bulk button {
  padding-top: 8px;
  padding-bottom: 8px;
}
#bulk-table th,
#bulk-table td {
  padding-top: 7px;
  padding-bottom: 7px;
}

@media (max-height: 760px) {
  .app-shell {
    padding-top: 8px;
    padding-bottom: 8px;
  }
  .app-header {
    margin-bottom: 8px;
    padding-bottom: 8px;
  }
  .app-logo {
    width: 32px;
    height: 32px;
  }
  .title-box h1 {
    font-size: 18pt;
  }
  .title-box p {
    font-size: 9.5pt;
  }
  .tab {
    padding: 8px 14px;
  }
  #view-bulk .drop-card.wide {
    min-height: 78px;
    padding: 12px 16px;
  }
  .drop-title {
    font-size: 12.5pt;
    margin-bottom: 4px;
  }
}


/* Phase 2 license activation panel */
.license-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(520px, 1.6fr);
  gap: 12px;
  align-items: center;
  background: linear-gradient(180deg, #100d0b 0%, #0b0908 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
  flex: 0 0 auto;
}
.license-panel.ok {
  border-color: rgba(34, 197, 94, .45);
}
.license-panel-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.license-panel-text strong {
  color: #fff;
  font-size: 10.5pt;
}
.license-panel-text span {
  color: var(--muted);
  overflow-wrap: anywhere;
}
.license-panel.ok .license-panel-text span {
  color: #a7f3d0;
}
.license-panel-actions {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(190px, 1fr) auto auto auto;
  gap: 8px;
  align-items: center;
}
.license-panel-actions input {
  min-width: 0;
}
.license-panel-actions button {
  padding: 8px 12px;
  white-space: nowrap;
}
@media (max-width: 1050px) {
  .license-panel,
  .license-panel-actions {
    grid-template-columns: 1fr;
  }
}

/* License Management 20: move activation into a startup/modal workflow */
.header-right {
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: right;
}
button.small {
  padding: 8px 12px;
  font-size: 9.5pt;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .68);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 1000;
}
.modal-backdrop.hidden { display: none; }
.modal-card {
  width: min(760px, 96vw);
  background: linear-gradient(180deg, #100d0b 0%, #080706 100%);
  border: 1px solid var(--border-2);
  border-radius: 16px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, .58);
  padding: 18px;
}
.modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.modal-header h2 {
  margin: 0;
  font-size: 17pt;
  color: #fff;
}
.modal-header p {
  margin: 5px 0 0;
  color: var(--muted);
}
.icon-button {
  min-width: 42px;
  padding: 7px 12px;
  font-size: 18pt;
  line-height: 1;
}
.license-dialog-state {
  border: 1px solid var(--border);
  background: #0a0807;
  border-radius: 12px;
  color: var(--muted);
  padding: 12px;
  margin-bottom: 14px;
}
.license-dialog-state.ok {
  color: #b6f7d0;
  border-color: rgba(34, 197, 94, .55);
}
.license-dialog-state.warn {
  color: #fde68a;
  border-color: rgba(245, 158, 11, .55);
}
.license-dialog-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 10px;
  align-items: center;
}
.modal-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.modal-note {
  color: var(--muted);
}
.requires-license.locked {
  opacity: .56;
}

/* Logs 20: keep final report reachable above Windows taskbar */
#view-logs {
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 90px;
}
#job-summary-box {
  min-height: 105px;
  height: 125px;
}
#logs {
  min-height: 220px;
  height: 260px;
}
#report-box {
  min-height: 150px;
  height: 190px;
}

@media (max-width: 1000px) {
  .header-right { flex-direction: column; align-items: stretch; text-align: left; }
  .license-dialog-row { grid-template-columns: 1fr; }
}


/* Scroll and report action polish 21 */
.view.active {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding-right: 4px;
  padding-bottom: 86px;
}
#view-quick.view.active,
#view-logs.view.active {
  display: block;
}
#view-bulk.view.active {
  display: flex;
  overflow: hidden;
  padding-bottom: 0;
}
#view-logs {
  max-height: none;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 110px;
}
#view-logs .action-row {
  padding-bottom: 16px;
}
.table-wrap {
  max-width: 100%;
  overflow: auto;
}
#sub-table,
#audio-table,
#bulk-table {
  max-width: none;
}
#job-summary-box,
#logs,
#report-box {
  overflow: auto;
}
#report-box {
  min-height: 170px;
}
@media (max-height: 760px) {
  #job-summary-box { height: 100px; min-height: 90px; }
  #logs { height: 210px; min-height: 190px; }
  #report-box { height: 170px; min-height: 150px; }
}
