:root {
  --background: #f5f5f7;
  --card: #ffffff;
  --text: #111111;
  --secondary: #6e6e73;
  --accent: #0a84ff;
  --border: #e5e5ea;
  --success-bg: #e9f9ef;
  --success-text: #147a3f;
  --processing-bg: #e9f2ff;
  --processing-text: #0f62d8;
  --queued-bg: #fff8e1;
  --queued-text: #8a6700;
  --failed-bg: #ffecec;
  --failed-text: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--background);
  color: var(--text);
  font-family: Inter, system-ui, -apple-system, sans-serif;
  line-height: 1.45;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(245, 245, 247, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  color: var(--text);
  text-decoration: none;
  font-size: 18px;
  font-weight: 650;
}

.nav {
  display: flex;
  gap: 16px;
}

.hidden {
  display: none;
}

.md\:table-cell {
  display: table-cell;
}

.nav a,
.text-link {
  color: var(--secondary);
  text-decoration: none;
}

.nav a:hover,
.text-link:hover {
  color: var(--accent);
}

.page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 46px 24px 72px;
}

.hero {
  margin-bottom: 34px;
}

.hero h1 {
  margin: 0;
  font-size: 60px;
  letter-spacing: -0.03em;
}

.hero.compact h1 {
  font-size: 38px;
}

.hero-subtitle {
  margin-top: 12px;
  font-size: 22px;
  color: var(--secondary);
  max-width: 820px;
}

.breadcrumbs {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--secondary);
  font-size: 13px;
  margin-bottom: 14px;
}

.dashboard-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(250px, 0.85fr);
  gap: 18px;
  align-items: stretch;
}

.dashboard-main,
.dashboard-side {
  display: grid;
  gap: 18px;
  height: 100%;
}

.dashboard-main .upload-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.dashboard-side {
  display: flex;
  flex-direction: column;
}

.dashboard-side .stats-grid {
  flex: 0 0 auto;
}

.dashboard-side .calendar-card {
  flex: 1 1 auto;
  min-height: 430px;
  display: flex;
  flex-direction: column;
}

.dashboard-journal {
  margin-top: 10px;
}

.live-cta-card {
  margin-top: -6px;
}

.live-cta-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.06);
  padding: 32px;
  margin-bottom: 24px;
}

.card h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.download-link {
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
}

.download-link:hover {
  text-decoration: underline;
}

.muted,
.empty {
  color: var(--secondary);
}

.small {
  font-size: 14px;
}

.field-label {
  color: var(--secondary);
  font-size: 14px;
}

.upload-card form {
  display: grid;
  gap: 12px;
  align-content: start;
}

.upload-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
}

.upload-note {
  margin: 0;
  color: var(--secondary);
  font-size: 12px;
}

.upload-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  flex: 1 1 auto;
}

.upload-layout-status {
  grid-template-columns: minmax(320px, 0.95fr) minmax(0, 1.25fr);
}

.upload-form-panel {
  display: grid;
  gap: 16px;
  align-content: start;
}

.upload-help {
  border: 1px solid #edf0f5;
  border-radius: 14px;
  background: #fbfcff;
  padding: 16px;
}

.upload-help-title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 650;
}

.upload-help ul {
  margin: 0;
  padding-left: 18px;
  color: var(--secondary);
  font-size: 14px;
  display: grid;
  gap: 8px;
}

.upload-error-state {
  text-align: left;
  border-color: #ffd5d5;
  background: #fff9f9;
}

.upload-status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  box-sizing: border-box;
  padding: 0;
  overflow: hidden;
  margin-bottom: 0;
}

.upload-status-shell {
  display: grid;
  gap: 22px;
  padding: 30px 32px 32px;
  min-height: 100%;
  width: 100%;
  background:
    radial-gradient(circle at top right, rgba(13, 110, 253, 0.14), transparent 30%),
    radial-gradient(circle at bottom left, rgba(56, 189, 248, 0.1), transparent 26%),
    linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
}

.upload-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.upload-status-copy {
  display: grid;
  gap: 8px;
  max-width: 620px;
}

.upload-state-meta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-state-meta p {
  margin: 0;
}

.upload-status-copy .field-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.upload-state-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.upload-state-description {
  margin: 0;
  color: #526173;
  font-size: 15px;
  line-height: 1.55;
}

.upload-status-side {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 16px;
}

.upload-timer-wrap {
  min-width: 220px;
}

.upload-status-container {
  display: flex;
  justify-content: center;
  align-items: flex-start;
  flex-direction: column;
  width: 100%;
  gap: 18px;
}

.upload-steps-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: nowrap;
  width: 100%;
  gap: 10px;
  box-sizing: border-box;
}

.upload-steps {
  display: flex;
  justify-content: center;
  gap: 20px;
  flex-wrap: wrap;
  width: min(100%, 980px);
  margin-inline: auto;
}

.upload-step {
  flex: 1 1 auto;
  max-width: 200px;
  text-align: center;
}

.upload-steps .live-phase-item {
  max-width: 200px;
}

.upload-progress-panel {
  display: grid;
  gap: 10px;
  padding: 18px 20px;
  border: 1px solid #e6ebf4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
  width: min(100%, 980px);
  margin-inline: auto;
}

.upload-progress-shell-tall {
  height: 12px;
  margin-top: 0;
}

.upload-progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.upload-progress-copy p {
  margin: 0;
}

.upload-status-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.upload-status-grid p:last-child {
  margin-bottom: 0;
}

.info-banner {
  padding: 16px 24px;
}

.success-banner {
  border-color: #cdeed7;
  background: #f4fcf6;
  color: var(--success-text);
}

.error-banner {
  border-color: #ffd5d5;
  background: #fff7f7;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.detail-card {
  margin-bottom: 0;
}

.detail-card-wide {
  grid-column: 1 / -1;
}

.media-preview {
  margin-top: 14px;
  border-top: 1px solid #f0f1f5;
  padding-top: 12px;
}

.media-preview audio {
  width: 100%;
}

.video-preview {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: #000;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 18px;
}

.result-actions {
  margin-top: 10px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 0;
}

.stat-card {
  margin-bottom: 0;
  padding: 20px 22px;
}

.stat-title {
  margin: 0;
  color: var(--secondary);
  font-size: 13px;
}

.stat-value {
  margin: 8px 0 0;
  font-size: 32px;
  font-weight: 650;
  letter-spacing: -0.02em;
}

.calendar-card {
  margin-bottom: 24px;
  padding: 22px 20px 18px;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 6px;
}

.calendar-weekdays {
  margin-bottom: 8px;
}

.calendar-weekdays span {
  color: var(--secondary);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.calendar-day {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-height: 56px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px;
  text-decoration: none;
  color: var(--text);
  background: #fff;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.calendar-day:hover {
  border-color: #cfd4dc;
  transform: translateY(-1px);
}

.calendar-day.today {
  border-color: #b8d6ff;
  background: #f6faff;
}

.calendar-day.muted-day {
  opacity: 0.45;
}

.day-number {
  font-size: 12px;
  font-weight: 600;
}

.day-count {
  font-size: 11px;
  color: var(--secondary);
}

.jobs-filters {
  display: grid;
  gap: 14px;
  margin-bottom: 18px;
}

.status-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-pill {
  border: 1px solid var(--border);
  color: var(--secondary);
  text-decoration: none;
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  transition: all 0.15s ease;
}

.filter-pill:hover {
  border-color: #cfd4dc;
  color: var(--text);
}

.filter-pill.active {
  background: #eef5ff;
  border-color: #cfe2ff;
  color: #0b63ce;
}

.search-row {
  display: flex;
  gap: 10px;
}

.search-row input[type="text"] {
  flex: 1;
}

.search-row input[type="date"] {
  min-width: 170px;
}

input,
select,
button {
  font: inherit;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: #fff;
  padding: 10px 12px;
}

button {
  width: fit-content;
  background: var(--accent);
  color: white;
  border-radius: 10px;
  padding: 10px 18px;
  border: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

button:hover {
  background: #0776e8;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.25);
  transform: translateY(-1px);
}

button:disabled,
.primary-btn:disabled,
.secondary-btn:disabled {
  opacity: 1;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
  background: #d9dee8;
  color: #5f6b7a;
  border: 1px solid #c8d0dc;
}

.button-disabled-look,
.button-disabled-look:hover {
  background: #d9dee8;
  color: #5f6b7a;
  border: 1px solid #c8d0dc;
  box-shadow: none;
  transform: none;
}

.primary-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-btn:hover {
  background: #0776e8;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.25);
  transform: translateY(-1px);
}

.primary-btn:focus-visible {
  outline: 2px solid #9ec9ff;
  outline-offset: 2px;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.btn:focus-visible {
  outline: 2px solid #9ec9ff;
  outline-offset: 2px;
}

.btn-outline-primary {
  background: #fff;
  color: var(--accent);
  border: 1px solid var(--accent);
}

.btn-outline-primary:hover {
  background: #f4f9ff;
  color: #0776e8;
  border-color: #0776e8;
  box-shadow: 0 4px 16px rgba(10, 132, 255, 0.12);
  transform: translateY(-1px);
}

.secondary-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  background: #eef1f6;
  color: #4b5565;
  border: 1px solid #d9dee8;
  border-radius: 10px;
  padding: 10px 18px;
  font-weight: 600;
  cursor: pointer;
}

.secondary-btn:hover {
  background: #e5eaf3;
  transform: none;
  box-shadow: none;
}

.danger-btn {
  background: #fff1f1;
  color: #b42318;
  border: 1px solid #f2c4c0;
}

.danger-btn:hover {
  background: #ffe5e3;
  color: #991b1b;
}

.file-input-ui {
  border: 2px dashed #cfd3da;
  border-radius: 14px;
  padding: 22px 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.file-input-ui:hover,
.file-input-ui.is-dragover {
  border-color: var(--accent);
  background: #f6faff;
  transform: translateY(-1px);
}

.file-input-ui input[type="file"] {
  display: none;
}

.file-input-title {
  font-weight: 600;
}

.dropzone-icon {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #d2e3ff;
  background: #eef5ff;
  color: var(--accent);
  font-weight: 700;
}

.file-input-hint {
  color: var(--secondary);
  font-size: 14px;
}

.file-name {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

table {
  width: 100%;
  border-collapse: collapse;
}

.jobs-table {
  table-layout: fixed;
}

th,
td {
  text-align: left;
  padding: 12px 10px;
  border-bottom: 1px solid #f0f1f5;
  vertical-align: middle;
}

th {
  color: var(--secondary);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.id-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.job-number-link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}

.job-number-link:hover {
  text-decoration: underline;
}

.file-link {
  color: inherit;
  text-decoration: none;
  display: inline-flex;
  flex-direction: column;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.file-link:hover .file-name-wrap {
  text-decoration: underline;
}

.file-col-cell {
  min-width: 0;
}

.file-name-wrap {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  line-height: 1.35;
  max-width: 100%;
}

.file-meta {
  color: var(--secondary);
  font-size: 12px;
  line-height: 1.2;
}

.ellipsis-cell {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.jobs-journal-table td {
  padding-top: 10px;
  padding-bottom: 10px;
}

.jobs-journal-table th:nth-child(1),
.jobs-journal-table td:nth-child(1) {
  width: 130px;
}

.jobs-journal-table th:nth-child(2),
.jobs-journal-table td:nth-child(2) {
  width: 40%;
}

.jobs-journal-table th:nth-child(3),
.jobs-journal-table td:nth-child(3) {
  width: 23%;
}

.job-name-col {
  color: var(--secondary);
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.job-num-cell {
  white-space: nowrap;
}

.job-num-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.quick-toggle-btn {
  width: 24px;
  height: 24px;
  border: 1px solid #d8deeb;
  border-radius: 8px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #f7f9fc;
  color: #566073;
  box-shadow: none;
  transform: none;
  cursor: pointer;
}

.quick-toggle-btn:hover {
  background: #eef3fb;
  color: #2f3c55;
  box-shadow: none;
  transform: none;
}

.quick-toggle-btn span {
  line-height: 1;
  font-size: 16px;
}

.job-expand-btn {
  display: none;
  background: transparent;
}

.error-summary-cell {
  max-width: 220px;
}

.error-summary-text {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #a43a31;
}

.job-number-link:hover {
  color: #007bff;
  background: transparent;
  text-decoration: underline;
  cursor: pointer;
}

.table-scrollable-block {
  max-height: 100px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  padding: 8px;
  background: #fafbff;
  font-size: 12px;
}

.protocol-preview-block {
  margin-top: 10px;
  max-height: 200px;
  overflow-y: auto;
  overflow-x: auto;
  word-break: break-word;
}

.error-scrollable {
  color: #a43a31;
}

.job-detail-row td {
  background: #fbfcff;
  border-bottom: 1px solid #e9ecf2;
}

.job-detail-panel {
  border: 1px solid #edf0f5;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.quick-actions {
  display: flex;
  gap: 10px;
  width: 100%;
}

.quick-action-btn {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  text-align: center;
}

.quick-action-form {
  flex: 1 1 0;
  display: flex;
}

.open-card-btn {
  background: #0a84ff;
  border-color: #0a84ff;
  font-weight: 700;
}

.open-card-btn:hover {
  background: #0674e4;
}

.muted-btn {
  background: #f0f2f6;
  color: var(--secondary);
  border: 1px solid #dfe3ea;
  cursor: not-allowed;
}

.muted-btn:hover {
  transform: none;
  box-shadow: none;
  background: #f0f2f6;
}

.quick-detail-link {
  margin-top: 10px;
}

.result-badges {
  display: inline-flex;
  gap: 6px;
  flex-wrap: wrap;
}

.result-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6e7ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #135dc6;
  background: #f2f8ff;
}

.result-pill-link {
  display: inline-flex;
  align-items: center;
  border: 1px solid #d6e7ff;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 11px;
  color: #135dc6;
  background: #f2f8ff;
  text-decoration: none;
}

.result-pill-link:hover {
  background: #e9f3ff;
  border-color: #c7ddff;
  transform: none;
  box-shadow: none;
}

.live-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 600;
}

.badge-completed {
  background: var(--success-bg);
  color: var(--success-text);
}

.badge-processing {
  background: var(--processing-bg);
  color: var(--processing-text);
}

.badge-queued {
  background: var(--queued-bg);
  color: var(--queued-text);
}

.badge-failed {
  background: var(--failed-bg);
  color: var(--failed-text);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: 14px;
  padding: 28px;
  text-align: center;
  background: #fcfcff;
}

.empty-title {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
}

.empty-subtitle {
  margin: 10px 0 0;
  color: var(--secondary);
}

.calendar-empty-state {
  margin-top: 8px;
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  background: #fafafa;
}

.long-text-block {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  max-height: 400px;
  overflow-y: auto;
}

.long-text-block pre {
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-x: auto;
  margin: 0;
}

.prompt-form {
  display: grid;
  gap: 10px;
}

.prompt-editor {
  width: 100%;
  min-height: 120px;
  resize: vertical;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.prompt-actions {
  display: flex;
  justify-content: flex-start;
}

.chat-window {
  border: 1px solid #e8ecf3;
  border-radius: 12px;
  padding: 12px;
  background: #fbfcff;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
  display: grid;
  gap: 10px;
}

.chat-shell {
  display: grid;
  gap: 12px;
}

.chat-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.chat-version-indicator {
  margin: 0;
}

.chat-message {
  border-radius: 10px;
  padding: 10px 12px;
}

.chat-pending {
  border-style: dashed;
}

.chat-error {
  border-color: #f0b7b2;
  background: #fff5f4;
}

.chat-user {
  background: #eef5ff;
  border: 1px solid #dbe8ff;
}

.chat-assistant {
  background: #f7f8fb;
  border: 1px solid #e4e7ef;
}

.chat-role {
  margin: 0 0 6px;
  font-size: 12px;
  color: var(--secondary);
}

.chat-version-tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3856b8;
}

.chat-content {
  margin: 0;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
}

.chat-form {
  margin-top: 12px;
  display: grid;
  gap: 10px;
}

.chat-form textarea {
  width: 100%;
  resize: vertical;
  min-height: 90px;
}

.prompt-editor,
.chat-form textarea {
  border: 1px solid #b7c7df;
  background: #f8fbff;
  border-radius: 8px;
  padding: 12px 14px;
  color: #1f2937;
  line-height: 1.45;
  overflow-y: auto;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.prompt-editor::placeholder,
.chat-form textarea::placeholder {
  color: #6b7280;
  opacity: 1;
}

.prompt-editor:hover,
.chat-form textarea:hover {
  border-color: #7ea2d8;
  background: #f5f9ff;
}

.prompt-editor:focus,
.chat-form textarea:focus {
  outline: none;
  border-color: #0a84ff;
  box-shadow: 0 0 0 3px rgba(10, 132, 255, 0.15);
  background: #f8fbff;
}

.chat-actions {
  display: flex;
  justify-content: flex-start;
}

.chat-input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.chat-input-row .primary-btn {
  height: 44px;
  white-space: nowrap;
}

.chat-clear-form {
  margin-top: 10px;
}

.error-cell-content {
  max-height: 100px;
  overflow-y: auto;
  overflow-x: auto;
  white-space: pre-wrap;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: #a43a31;
  line-height: 1.35;
}

.loading-text {
  font-weight: 600;
}

.protocol-progress-card {
  display: grid;
  gap: 10px;
}

.protocol-progress-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.protocol-progress-stats {
  color: var(--secondary);
  font-size: 13px;
  font-weight: 600;
}

.table-inline-progress {
  display: grid;
  gap: 4px;
  margin-top: 8px;
  max-width: 180px;
}

.error {
  color: #b42318;
  font-weight: 600;
}

.error-short {
  color: #a43a31;
}

.error-block {
  border-color: #ffd5d5;
  background: #fffaf9;
}

.error-pre {
  border: 1px solid #ffd5d5;
  background: #fff;
  color: #8f1f1f;
  white-space: pre-wrap;
  word-break: break-word;
}

.live-form {
  display: grid;
  gap: 12px;
}

.live-hero {
  position: relative;
}

.live-hero-eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #ebf3ff;
  color: #0f62d8;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.live-session-card {
  display: grid;
  grid-template-columns: minmax(260px, 0.92fr) minmax(0, 1.08fr);
  gap: 22px;
  align-items: start;
}

.live-session-copy {
  display: grid;
  gap: 10px;
}

.live-session-copy h2 {
  margin-bottom: 0;
}

.live-session-note {
  margin: 0;
  max-width: 540px;
}

.live-flow-hint {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.live-flow-hint span {
  display: inline-flex;
  align-items: center;
  padding: 8px 12px;
  border-radius: 999px;
  background: #f3f6fb;
  border: 1px solid #e1e7f0;
  color: #5a6b7f;
  font-size: 13px;
  font-weight: 600;
}

.live-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.live-stop-btn {
  min-width: 250px;
}

.live-status-card {
  padding: 0;
  overflow: hidden;
}

.live-status-shell {
  display: grid;
  gap: 22px;
  padding: 30px 32px 32px;
  background:
    radial-gradient(circle at top right, rgba(10, 132, 255, 0.16), transparent 28%),
    linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.live-status-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 18px;
}

.live-status-copy {
  display: grid;
  gap: 8px;
  max-width: 700px;
}

.live-status-copy .field-label {
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.live-state-title {
  margin: 0;
  font-size: 32px;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.live-state-description {
  margin: 0;
  max-width: 680px;
  color: var(--secondary);
  font-size: 16px;
}

.live-phase-strip {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.live-phase-item {
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border-radius: 18px;
  border: 1px solid #e4eaf3;
  background: rgba(255, 255, 255, 0.78);
  color: #607083;
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.live-phase-item strong {
  font-size: 15px;
  color: #223042;
}

.live-phase-item span:last-child {
  font-size: 12px;
  line-height: 1.35;
}

.live-phase-step {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #eef3f8;
  color: #607083;
  font-size: 12px;
  font-weight: 700;
}

.live-phase-item.is-active {
  border-color: #b9cff0;
  background: #edf5ff;
  box-shadow: 0 14px 30px rgba(26, 78, 146, 0.08);
  transform: translateY(-1px);
}

.live-phase-item.is-active .live-phase-step {
  background: #0a84ff;
  color: #fff;
}

.live-phase-item.is-complete {
  border-color: #cfe7d6;
  background: #eef8f1;
}

.live-phase-item.is-complete .live-phase-step {
  background: #22a559;
  color: #fff;
}

.live-phase-item.is-error {
  border-color: #efc1bc;
  background: #fff1ef;
}

.live-phase-item.is-error .live-phase-step {
  background: #c53929;
  color: #fff;
}

.live-status-side {
  min-width: 220px;
  display: grid;
  justify-items: end;
  gap: 16px;
}

.live-session-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 999px;
  font-weight: 700;
}

.live-session-badge__icon {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
}

.live-session-badge--ready {
  background: #eef3f8;
  color: #516273;
}

.live-session-badge--ready .live-session-badge__icon {
  background: #8ca0b3;
}

.live-session-badge--recording {
  background: #fff3f2;
  color: #bf1d18;
}

.live-session-badge--recording .live-session-badge__icon {
  background: #d92d20;
  box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.45);
  animation: livePulse 1.4s infinite;
}

.live-session-badge--completed {
  background: #eaf8ee;
  color: #147a3f;
}

.live-session-badge--completed .live-session-badge__icon {
  background: #22a559;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.95);
}

.live-session-badge--processing {
  background: #fff4db;
  color: #9b6400;
}

.live-session-badge--processing .live-session-badge__icon {
  background: #f0a500;
  animation: liveProcessingPulse 1.8s ease-in-out infinite;
}

.live-session-badge--error {
  background: #fdecec;
  color: #9f1c1c;
}

.live-session-badge--error .live-session-badge__icon {
  background: #c53929;
  border-radius: 3px;
}

.live-timer-wrap {
  display: grid;
  gap: 4px;
  justify-items: end;
  padding: 14px 16px;
  min-width: 200px;
  border: 1px solid #e5ebf3;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.86);
  box-shadow: 0 12px 32px rgba(32, 54, 84, 0.08);
}

.live-timer-wrap strong {
  font-size: 34px;
  letter-spacing: 0.06em;
}

.live-timer-caption {
  color: #7b8795;
  font-size: 12px;
}

.live-activity-shell,
.live-progress-shell {
  min-height: 58px;
  border-radius: 14px;
  background: #fff8ea;
  border: 1px solid #f0ddb4;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.live-progress-indeterminate {
  width: 100%;
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #d92d20 0%, #ff756a 100%);
  animation: liveProgress 1.2s linear infinite;
}

.live-progress-label {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  color: #7a5600;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.live-activity-shell[data-mode="hidden"],
.live-progress-shell[data-mode="processing"] {
  color: #7a5600;
}

.live-activity-shell[data-mode="processing"] .live-progress-indeterminate,
.live-progress-shell[data-mode="processing"] .live-progress-indeterminate {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid rgba(240, 165, 0, 0.24);
  border-top-color: #f0a500;
  animation: liveSpinner 0.9s linear infinite;
}

.live-status-grid {
  align-items: start;
  padding: 18px 20px;
  border: 1px solid #e6ebf4;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.88);
}

.live-status-badge-slot {
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.live-transcript-block {
  min-height: 220px;
}

.live-result-slot {
  margin-top: 8px;
  min-height: 42px;
  display: flex;
  align-items: center;
}

.live-result-button {
  width: fit-content;
  max-width: 100%;
}

.live-result-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.live-session-message {
  margin: 0;
  min-height: 24px;
}

@keyframes livePulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 45, 32, 0.45);
  }
  70% {
    box-shadow: 0 0 0 10px rgba(217, 45, 32, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 45, 32, 0);
  }
}

@keyframes liveProgress {
  0% {
    transform: translateX(-120%);
  }
  100% {
    transform: translateX(320%);
  }
}

@keyframes liveProcessingPulse {
  0% {
    opacity: 0.65;
    transform: scale(0.9);
  }
  50% {
    opacity: 1;
    transform: scale(1);
  }
  100% {
    opacity: 0.65;
    transform: scale(0.9);
  }
}

@keyframes liveSpinner {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}

@media (max-width: 1040px) {
  .dashboard-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .topbar-inner,
  .page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero h1 {
    font-size: 40px;
  }

  .hero-subtitle {
    font-size: 18px;
  }

  .card {
    padding: 22px;
  }

  .search-row {
    flex-direction: column;
  }

  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-layout {
    grid-template-columns: 1fr;
  }

  .upload-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-cta-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-session-card {
    grid-template-columns: 1fr;
  }

  .live-phase-strip {
    grid-template-columns: 1fr;
  }

  .live-status-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .live-status-shell {
    padding: 24px 22px;
  }

  .live-status-side {
    width: 100%;
    justify-items: flex-start;
  }

  .live-timer-wrap {
    width: 100%;
    justify-items: flex-start;
  }

  .live-stop-btn {
    min-width: 0;
    width: 100%;
  }

  .live-state-title {
    font-size: 28px;
  }

  .upload-layout {
    grid-template-columns: 1fr;
  }

  .calendar-grid {
    gap: 6px;
  }

  .calendar-day {
    min-height: 48px;
    padding: 6px;
  }

  .jobs-journal-table th:nth-child(2),
  .jobs-journal-table td:nth-child(2) {
    width: auto;
  }

  .quick-actions {
    flex-direction: column;
  }

  .chat-input-row {
    grid-template-columns: 1fr;
  }

  .detail-grid {
    grid-template-columns: 1fr;
  }

  .summary-grid {
    grid-template-columns: 1fr;
  }

  .btn,
  .live-result-button {
    width: 100%;
  }

  .md\:table-cell {
    display: none;
  }

  .upload-layout,
  .upload-layout-status,
  .upload-status-head {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .upload-status-shell {
    padding: 24px 22px;
  }

  .upload-status-side {
    width: 100%;
    justify-items: flex-start;
  }

  .upload-timer-wrap {
    width: 100%;
    min-width: 0;
  }

  .upload-progress-copy {
    flex-direction: column;
  align-items: flex-start;
  }

  .upload-steps-container,
  .upload-phase-strip,
  .upload-progress-panel {
    width: 100%;
  }

  .upload-steps .live-phase-item {
    max-width: none;
  }
}

.upload-session-card {
  margin-top: 20px;
  border: 1px solid rgba(73, 118, 255, 0.14);
  background: linear-gradient(180deg, rgba(73, 118, 255, 0.05), rgba(24, 32, 56, 0.02));
}

.upload-session-head,
.upload-session-status-row,
.table-upload-progress,
.file-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.upload-progress-shell {
  width: 100%;
  height: 10px;
  margin-top: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(24, 32, 56, 0.12);
}

.upload-progress-shell.compact {
  height: 8px;
  margin-top: 6px;
}

.upload-progress-bar {
  height: 100%;
  width: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, #3f7cff, #38bdf8);
  transition: width 0.2s ease, background 0.2s ease;
}

.upload-progress-bar.is-complete {
  background: linear-gradient(90deg, #10b981, #34d399);
}

.table-upload-progress {
  flex-direction: column;
  align-items: flex-start;
  margin-top: 8px;
}
