:root {
  color-scheme: light;
  --ink: #171a18;
  --ink-soft: #343a36;
  --cream: #f1eee5;
  --paper: #faf8f2;
  --white: #fffefb;
  --line: #d9d5ca;
  --line-dark: #414742;
  --muted: #6e746f;
  --muted-light: #aeb5af;
  --sage: #8da597;
  --sage-dark: #355f4d;
  --mint: #cae5d7;
  --amber: #bb7d2f;
  --amber-soft: #f1dfc4;
  --danger: #a74437;
  --danger-soft: #f2d9d4;
  --blue: #3f6575;
  --shadow: 0 16px 45px rgba(28, 31, 28, 0.08);
  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 20px;
  --sidebar: 258px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--cream);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  font-size: 15px;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
}

button,
input,
select,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: inherit;
}

h1,
h2,
h3,
p,
dl,
dd {
  margin: 0;
}

h1 {
  max-width: 760px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.4rem, 5vw, 4.55rem);
  font-weight: 500;
  letter-spacing: -0.055em;
  line-height: 0.97;
}

h2 {
  font-size: 1.05rem;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 8px;
  left: 8px;
  padding: 10px 14px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  font-weight: 700;
}

.skip-link:focus {
  transform: translateY(0);
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  min-height: 74px;
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(23, 26, 24, 0.97);
  color: var(--white);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid var(--line-dark);
  border-radius: 50%;
  color: var(--mint);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.2rem;
  font-style: italic;
}

.brand > span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand strong {
  letter-spacing: -0.01em;
}

.brand small {
  margin-top: 4px;
  color: var(--muted-light);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.runtime-badge,
.docs-link,
.api-settings > summary {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line-dark);
  border-radius: 999px;
  color: #d8ded9;
  font-size: 0.78rem;
  font-weight: 650;
}

.runtime-badge {
  padding: 0 13px;
}

.docs-link {
  padding: 0 14px;
  text-decoration: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.docs-link:hover {
  border-color: #737c76;
  background: rgba(255, 255, 255, 0.06);
}

.api-settings {
  position: relative;
}

.api-settings > summary {
  padding: 0 14px;
  color: #d8ded9;
  cursor: pointer;
  list-style: none;
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.api-settings > summary::-webkit-details-marker {
  display: none;
}

.api-settings > summary::after {
  content: "⌄";
  margin-left: 8px;
  color: var(--sage);
}

.api-settings[open] > summary,
.api-settings > summary:hover {
  border-color: #737c76;
  background: rgba(255, 255, 255, 0.06);
}

.settings-popover {
  position: absolute;
  z-index: 25;
  top: calc(100% + 12px);
  right: 0;
  width: min(330px, calc(100vw - 28px));
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(10, 12, 11, 0.3);
}

.settings-popover::before {
  content: "";
  position: absolute;
  top: -6px;
  right: 27px;
  width: 10px;
  height: 10px;
  transform: rotate(45deg);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: var(--paper);
}

.settings-popover h2 {
  margin-top: 7px;
}

.settings-popover > p:not(.eyebrow) {
  margin: 6px 0 17px;
  color: var(--muted);
  font-size: 0.72rem;
}

.settings-actions {
  display: grid;
  grid-template-columns: 0.65fr 1fr;
  gap: 7px;
  margin-top: 12px;
}

.settings-actions .secondary-button,
.settings-actions .primary-button {
  min-height: 40px;
}

.settings-state {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.65rem;
  text-align: center;
}

.status-dot,
.job-status-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #87c7a9;
  box-shadow: 0 0 0 4px rgba(135, 199, 169, 0.12);
}

.app-shell {
  display: grid;
  min-height: calc(100vh - 74px);
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 74px;
  display: flex;
  height: calc(100vh - 74px);
  flex-direction: column;
  padding: 30px 18px 22px;
  border-right: 1px solid var(--line);
  background: #e9e5da;
}

.eyebrow {
  color: var(--sage-dark);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.sidebar-intro {
  padding: 0 10px 24px;
}

.sidebar-intro > p:last-child {
  max-width: 190px;
  margin-top: 9px;
  color: var(--muted);
  font-size: 0.82rem;
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.tab-button {
  position: relative;
  display: grid;
  width: 100%;
  min-height: 66px;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: center;
  gap: 7px;
  padding: 10px 11px;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  text-align: left;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

.tab-button:hover {
  border-color: var(--line);
  background: rgba(255, 254, 251, 0.52);
}

.tab-button.is-active {
  border-color: #2a2f2b;
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 9px 22px rgba(28, 31, 28, 0.12);
}

.tab-index {
  align-self: start;
  padding-top: 3px;
  color: var(--muted);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.67rem;
}

.tab-button.is-active .tab-index {
  color: var(--sage);
}

.tab-button > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.tab-button strong {
  font-size: 0.86rem;
}

.tab-button small {
  margin-top: 3px;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.69rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tab-button.is-active small {
  color: var(--muted-light);
}

.queue-count {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  border-radius: 999px;
  background: #dcd8cd;
  color: var(--ink-soft);
  font-size: 0.68rem;
  font-weight: 800;
}

.tab-button.is-active .queue-count {
  background: var(--sage-dark);
  color: var(--white);
}

.sidebar-note {
  display: grid;
  margin-top: auto;
  grid-template-columns: 24px 1fr;
  gap: 8px;
  padding: 15px 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.sidebar-note > span {
  color: var(--sage-dark);
  font-size: 1.05rem;
}

.sidebar-note strong {
  color: var(--ink-soft);
  font-size: 0.75rem;
}

.sidebar-note p {
  margin-top: 4px;
  font-size: 0.69rem;
}

.workspace {
  min-width: 0;
  padding: clamp(34px, 5vw, 70px) clamp(22px, 6vw, 88px) 90px;
}

.tab-panel {
  width: min(1180px, 100%);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 36px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--line);
}

.page-heading .eyebrow {
  margin-bottom: 14px;
}

.lede {
  max-width: 680px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 1rem;
}

.heading-metric {
  display: flex;
  min-width: 155px;
  flex-direction: column;
  align-items: flex-end;
  padding-bottom: 3px;
  color: var(--muted);
  font-size: 0.72rem;
}

.heading-metric strong {
  margin-top: 5px;
  color: var(--ink);
  font-size: 0.8rem;
}

.mode-switch {
  display: inline-flex;
  margin: 26px 0 28px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #e6e2d7;
}

.mode-button {
  min-height: 37px;
  padding: 0 16px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.mode-button.is-active {
  background: var(--white);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(28, 31, 28, 0.07);
}

.workflow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 296px;
  align-items: start;
  gap: 22px;
}

.workflow-main {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 14px;
}

.form-card {
  padding: clamp(20px, 3vw, 30px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.7) inset;
}

.card-heading {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 13px;
  margin-bottom: 24px;
}

.card-heading p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.78rem;
}

.step-number {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sage-dark);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.68rem;
  font-weight: 700;
}

.dropzone {
  position: relative;
  min-height: 196px;
  overflow: hidden;
  border: 1px dashed #aaa99f;
  border-radius: 11px;
  background:
    linear-gradient(rgba(250, 248, 242, 0.86), rgba(250, 248, 242, 0.86)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(53, 95, 77, 0.04) 8px,
      rgba(53, 95, 77, 0.04) 9px
    );
  transition:
    border-color 160ms ease,
    background 160ms ease;
}

.dropzone:hover,
.dropzone.is-dragging {
  border-color: var(--sage-dark);
  background:
    linear-gradient(rgba(235, 241, 235, 0.92), rgba(235, 241, 235, 0.92)),
    repeating-linear-gradient(
      -45deg,
      transparent,
      transparent 8px,
      rgba(53, 95, 77, 0.06) 8px,
      rgba(53, 95, 77, 0.06) 9px
    );
}

.dropzone:focus-within {
  outline: 3px solid rgba(53, 95, 77, 0.23);
  outline-offset: 2px;
}

.dropzone > input[type="file"] {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
  opacity: 0;
}

.dropzone-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 25px;
  text-align: center;
  pointer-events: none;
}

.upload-glyph {
  display: grid;
  width: 39px;
  height: 39px;
  margin-bottom: 14px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--white);
  color: var(--sage-dark);
  font-size: 1.1rem;
}

.dropzone-empty strong {
  font-size: 0.88rem;
}

.dropzone-empty > span:not(.upload-glyph) {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.76rem;
}

.dropzone-empty small {
  margin-top: 13px;
  color: #8b8e89;
  font-size: 0.66rem;
}

.selected-file {
  position: absolute;
  z-index: 3;
  inset: 0;
  grid-template-columns: 152px minmax(0, 1fr) 36px;
  align-items: center;
  gap: 20px;
  padding: 20px;
  background: var(--paper);
}

.selected-file:not([hidden]) {
  display: grid;
}

.file-preview {
  display: grid;
  width: 152px;
  height: 154px;
  overflow: hidden;
  place-items: center;
  border-radius: 9px;
  background: #272c29;
  color: var(--muted-light);
}

.file-preview img,
.file-preview video {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.file-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.file-copy strong {
  overflow: hidden;
  font-size: 0.86rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.file-copy span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.72rem;
}

.icon-button {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 1.15rem;
  line-height: 1;
  transition:
    color 160ms ease,
    border-color 160ms ease,
    background 160ms ease;
}

.icon-button:hover {
  border-color: #9d9f99;
  background: var(--white);
  color: var(--ink);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.field + .field {
  margin-top: 18px;
}

.field-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink-soft);
  font-size: 0.76rem;
  font-weight: 750;
}

.field-label small {
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #c9c6bc;
  border-radius: var(--radius-sm);
  outline: 0;
  background: var(--white);
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

input,
select {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  min-height: 110px;
  padding: 11px 12px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.75rem;
  line-height: 1.55;
}

input::placeholder,
textarea::placeholder {
  color: #a4a5a0;
}

input:focus-visible,
select:focus-visible,
textarea:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(53, 95, 77, 0.25);
  outline-offset: 2px;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--sage-dark);
  box-shadow: 0 0 0 3px rgba(53, 95, 77, 0.09);
}

input[aria-invalid="true"],
textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.input-with-action {
  display: flex;
}

.input-with-action input {
  border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.field-action {
  min-width: 92px;
  border: 1px solid #c9c6bc;
  border-left: 0;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: #e9e6dc;
  color: var(--ink-soft);
  font-size: 0.72rem;
  font-weight: 750;
}

.field-action:hover {
  background: #dfdbcf;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field-grid .field + .field {
  margin-top: 0;
}

.field-hint {
  color: var(--muted);
  font-size: 0.67rem;
}

.field-error {
  min-height: 0;
  color: var(--danger);
  font-size: 0.69rem;
  font-weight: 650;
}

.field-error:empty {
  display: none;
}

.advanced-fields {
  margin-top: 19px;
  border-top: 1px solid var(--line);
}

.advanced-fields summary {
  padding: 17px 0 3px;
  color: var(--ink-soft);
  cursor: pointer;
  font-size: 0.73rem;
  font-weight: 750;
}

.advanced-fields[open] summary {
  margin-bottom: 14px;
}

.submit-card {
  position: sticky;
  top: 100px;
  padding: 26px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: var(--shadow);
}

.submit-card .eyebrow {
  color: var(--sage);
}

.submit-card h2 {
  margin-top: 9px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.7rem;
  font-weight: 500;
}

.summary-list {
  margin: 24px 0;
  border-top: 1px solid var(--line-dark);
}

.summary-list > div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line-dark);
  font-size: 0.72rem;
}

.summary-list dt {
  color: var(--muted-light);
}

.summary-list dd {
  max-width: 150px;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 15px;
  border-radius: var(--radius-sm);
  font-weight: 750;
  transition:
    transform 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.primary-button {
  width: 100%;
  padding: 0 16px;
  border: 1px solid var(--mint);
  background: var(--mint);
  color: #183329;
}

.primary-button:hover:not(:disabled) {
  transform: translateY(-1px);
  background: #d8ede3;
}

.primary-button:disabled,
.secondary-button:disabled {
  cursor: wait;
  opacity: 0.58;
}

.primary-button.is-loading span:first-child::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  vertical-align: -2px;
  animation: spin 650ms linear infinite;
}

.secondary-button {
  width: auto;
  padding: 0 17px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
  font-size: 0.78rem;
}

.secondary-button:hover:not(:disabled) {
  border-color: #a4a39c;
  background: var(--white);
}

.submit-note {
  margin-top: 14px;
  color: var(--muted-light);
  font-size: 0.68rem;
  text-align: center;
}

.remote-workflow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.remote-card {
  min-width: 0;
}

.remote-submit {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px 24px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}

.remote-submit > div {
  display: flex;
  flex-direction: column;
}

.remote-submit strong {
  font-size: 0.86rem;
}

.remote-submit span {
  margin-top: 3px;
  color: var(--muted-light);
  font-size: 0.7rem;
}

.remote-submit .primary-button {
  width: auto;
  min-width: 220px;
}

.inspection-note {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 16px;
  padding: 26px;
  border: 1px solid #b9c7be;
  border-radius: var(--radius);
  background: #e4ebe4;
}

.inspection-glyph {
  display: grid;
  width: 43px;
  height: 43px;
  place-items: center;
  border-radius: 50%;
  background: var(--sage-dark);
  color: var(--white);
  font-size: 1.2rem;
}

.inspection-note p {
  max-width: 630px;
  margin-top: 7px;
  color: #54635a;
  font-size: 0.77rem;
}

.inspection-note ul {
  display: flex;
  grid-column: 2;
  flex-wrap: wrap;
  gap: 7px;
  margin: 3px 0 0;
  padding: 0;
  list-style: none;
}

.inspection-note li {
  padding: 5px 9px;
  border: 1px solid #b9c7be;
  border-radius: 999px;
  color: #3e594c;
  font-size: 0.66rem;
  font-weight: 700;
}

.remote-extract-form {
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.75fr);
}

.remote-info-card {
  display: flex;
  flex-direction: column;
  padding: 28px;
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
}

.remote-info-card .eyebrow {
  color: var(--sage);
}

.remote-info-card h2 {
  margin-top: 10px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
  font-weight: 500;
}

.remote-info-card > p:not(.eyebrow) {
  margin: 12px 0 26px;
  color: var(--muted-light);
  font-size: 0.76rem;
}

.remote-info-card .primary-button {
  margin-top: auto;
}

.jobs-heading {
  align-items: center;
}

.jobs-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 27px 0 18px;
}

.search-field {
  position: relative;
  display: flex;
  width: min(390px, 100%);
  align-items: center;
}

.search-field > span:not(.visually-hidden) {
  position: absolute;
  left: 13px;
  color: var(--muted);
  pointer-events: none;
}

.search-field input {
  padding-left: 37px;
  background: var(--paper);
}

.filter-group {
  display: flex;
  gap: 4px;
}

.filter-button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 0.71rem;
  font-weight: 700;
}

.filter-button:hover {
  background: rgba(255, 255, 255, 0.45);
}

.filter-button.is-active {
  border-color: var(--ink);
  background: var(--ink);
  color: var(--white);
}

.jobs-layout {
  display: grid;
  grid-template-columns: minmax(340px, 0.9fr) minmax(400px, 1.1fr);
  align-items: start;
  gap: 17px;
}

.jobs-list-card,
.job-detail-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.list-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 19px 21px;
  border-bottom: 1px solid var(--line);
}

.list-heading span {
  color: var(--muted);
  font-size: 0.68rem;
}

.jobs-list {
  max-height: 610px;
  overflow-y: auto;
}

.job-list-item {
  display: grid;
  width: 100%;
  grid-template-columns: 35px minmax(0, 1fr) auto;
  align-items: center;
  gap: 11px;
  padding: 16px 19px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  transition: background 160ms ease;
}

.job-list-item:last-child {
  border-bottom: 0;
}

.job-list-item:hover,
.job-list-item.is-selected {
  background: #eeebe2;
}

.job-kind-icon {
  display: grid;
  width: 33px;
  height: 33px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--white);
  color: var(--sage-dark);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 0.92rem;
}

.job-list-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.job-list-copy strong {
  overflow: hidden;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.job-list-copy span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.67rem;
}

.status-pill {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border-radius: 999px;
  background: #e0ddd4;
  color: var(--muted);
  font-size: 0.61rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-pill[data-status="running"],
.status-pill[data-status="processing"] {
  background: var(--amber-soft);
  color: #76501e;
}

.status-pill[data-status="queued"],
.status-pill[data-status="pending"] {
  background: #dbe6ea;
  color: var(--blue);
}

.status-pill[data-status="completed"],
.status-pill[data-status="succeeded"],
.status-pill[data-status="success"] {
  background: var(--mint);
  color: var(--sage-dark);
}

.status-pill[data-status="failed"],
.status-pill[data-status="error"],
.status-pill[data-status="cancelled"] {
  background: var(--danger-soft);
  color: var(--danger);
}

.job-detail-card {
  position: sticky;
  top: 100px;
  min-height: 350px;
}

.empty-state {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 35px;
  color: var(--muted);
  text-align: center;
}

.empty-glyph {
  display: grid;
  width: 47px;
  height: 47px;
  margin-bottom: 15px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--sage-dark);
  font-size: 1.1rem;
}

.empty-state strong {
  color: var(--ink-soft);
  font-size: 0.86rem;
}

.empty-state p {
  max-width: 270px;
  margin-top: 6px;
  font-size: 0.72rem;
}

.detail-empty {
  min-height: 350px;
}

.loading-list {
  display: flex;
  min-height: 280px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 12px;
  color: var(--muted);
  font-size: 0.73rem;
}

.spinner {
  width: 26px;
  height: 26px;
  border: 2px solid var(--line);
  border-right-color: var(--sage-dark);
  border-radius: 50%;
  animation: spin 700ms linear infinite;
}

.detail-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 22px 24px 19px;
  border-bottom: 1px solid var(--line);
}

.detail-header .eyebrow {
  margin-bottom: 7px;
}

.detail-title {
  max-width: 420px;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.79rem;
}

.detail-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 20px 24px 24px;
}

.progress-block {
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.progress-copy {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-bottom: 9px;
  font-size: 0.7rem;
}

.progress-copy span {
  color: var(--muted);
}

.progress-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e3e0d7;
}

.progress-bar {
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--sage-dark);
  transition: width 350ms ease;
}

.progress-bar.is-indeterminate {
  width: 36%;
  animation: indeterminate 1.2s ease-in-out infinite;
}

.validation-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.validation-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
}

.validation-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.validation-value {
  display: block;
  margin-top: 7px;
  overflow-wrap: anywhere;
  color: var(--ink);
  font-size: 0.76rem;
  font-weight: 700;
}

.validation-icon {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 50%;
  background: #e0ddd4;
  color: var(--muted);
  font-size: 0.62rem;
}

.validation-icon.is-valid {
  background: var(--mint);
  color: var(--sage-dark);
}

.validation-icon.is-invalid {
  background: var(--danger-soft);
  color: var(--danger);
}

.result-preview {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #282d2a;
}

.result-preview img,
.result-preview video {
  display: block;
  width: 100%;
  max-height: 310px;
  object-fit: contain;
  background: #282d2a;
}

.artifact-loading {
  display: flex;
  min-height: 120px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  color: var(--muted);
  font-size: 0.7rem;
}

.artifact-error {
  padding: 13px;
  border: 1px solid #dbb3ac;
  border-radius: 9px;
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.7rem;
}

.result-actions {
  display: flex;
  gap: 8px;
}

.result-actions > * {
  flex: 1;
}

.download-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: var(--radius-sm);
  background: var(--ink);
  color: var(--white);
  font-size: 0.73rem;
  font-weight: 750;
  text-decoration: none;
}

.download-button:hover {
  background: #2b302d;
}

.json-disclosure {
  border-top: 1px solid var(--line);
}

.json-disclosure summary {
  padding: 13px 0 3px;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.7rem;
  font-weight: 700;
}

.json-view {
  max-height: 260px;
  overflow: auto;
  margin: 10px 0 0;
  padding: 12px;
  border-radius: 8px;
  background: #252a27;
  color: #dce5df;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.66rem;
  line-height: 1.55;
  white-space: pre-wrap;
  word-break: break-word;
}

.error-panel {
  padding: 15px;
  border: 1px solid #dbb3ac;
  border-radius: 10px;
  background: var(--danger-soft);
  color: #76352c;
}

.error-panel strong {
  font-size: 0.78rem;
}

.error-panel p {
  margin-top: 5px;
  font-size: 0.71rem;
}

.job-drawer {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  width: min(390px, calc(100vw - 44px));
  overflow: hidden;
  border: 1px solid var(--line-dark);
  border-radius: var(--radius);
  background: var(--ink);
  color: var(--white);
  box-shadow: 0 22px 65px rgba(14, 16, 14, 0.32);
}

.job-drawer:not([hidden]) {
  animation: drawer-in 240ms ease both;
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 17px 10px;
}

.drawer-header > div {
  display: flex;
  align-items: center;
  gap: 9px;
}

.drawer-header .eyebrow {
  color: var(--sage);
}

.drawer-header .icon-button {
  border-color: var(--line-dark);
  color: var(--muted-light);
}

.drawer-content-inner {
  padding: 2px 18px 19px;
}

.drawer-job-id {
  display: block;
  overflow: hidden;
  color: var(--muted-light);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.67rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.drawer-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  margin-top: 7px;
}

.drawer-status-row strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.4rem;
  font-weight: 500;
  text-transform: capitalize;
}

.drawer-percent {
  color: var(--mint);
  font-size: 0.78rem;
  font-weight: 700;
}

.job-drawer .progress-track {
  margin-top: 13px;
  background: var(--line-dark);
}

.drawer-message {
  margin-top: 10px;
  color: var(--muted-light);
  font-size: 0.71rem;
}

.drawer-action {
  display: flex;
  width: 100%;
  min-height: 38px;
  align-items: center;
  justify-content: space-between;
  margin-top: 15px;
  padding: 0 12px;
  border: 1px solid var(--line-dark);
  border-radius: 7px;
  background: transparent;
  color: var(--white);
  font-size: 0.71rem;
  font-weight: 700;
}

.drawer-action:hover {
  border-color: #737c76;
  background: rgba(255, 255, 255, 0.05);
}

.toast-region {
  position: fixed;
  z-index: 50;
  top: 90px;
  right: 22px;
  display: flex;
  width: min(360px, calc(100vw - 44px));
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 9px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--white);
  box-shadow: var(--shadow);
  color: var(--ink);
  animation: toast-in 220ms ease both;
}

.toast-icon {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  border-radius: 50%;
  background: var(--mint);
  color: var(--sage-dark);
  font-size: 0.7rem;
  font-weight: 900;
}

.toast.is-error .toast-icon {
  background: var(--danger-soft);
  color: var(--danger);
}

.toast strong {
  display: block;
  font-size: 0.75rem;
}

.toast p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 0.68rem;
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(1px, 1px, 1px, 1px) !important;
  clip-path: inset(50%) !important;
  white-space: nowrap !important;
}

[hidden] {
  display: none !important;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@keyframes indeterminate {
  0% {
    transform: translateX(-120%);
  }
  50% {
    transform: translateX(95%);
  }
  100% {
    transform: translateX(300%);
  }
}

@keyframes drawer-in {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
}

@keyframes toast-in {
  from {
    transform: translateY(-8px);
    opacity: 0;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar: 92px;
  }

  .sidebar {
    padding-inline: 10px;
  }

  .sidebar-intro,
  .sidebar-note,
  .tab-button small,
  .tab-button strong,
  .tab-index,
  .queue-count {
    display: none;
  }

  .tab-button {
    display: grid;
    min-height: 64px;
    place-items: center;
    padding: 8px;
  }

  .tab-button > span:nth-child(2)::before {
    color: currentColor;
    font-size: 0.71rem;
    font-weight: 800;
  }

  .tab-button[data-tab="embed"] > span:nth-child(2)::before {
    content: "EMBED";
  }

  .tab-button[data-tab="extract"] > span:nth-child(2)::before {
    content: "READ";
  }

  .tab-button[data-tab="jobs"] > span:nth-child(2)::before {
    content: "JOBS";
  }

  .workflow {
    grid-template-columns: minmax(0, 1fr);
  }

  .submit-card {
    position: static;
  }

  .remote-workflow,
  .remote-extract-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .jobs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-detail-card {
    position: static;
  }
}

@media (max-width: 720px) {
  .topbar {
    min-height: 64px;
    padding: 0 16px;
  }

  .brand small,
  .runtime-badge {
    display: none;
  }

  .docs-link {
    min-height: 34px;
  }

  .api-settings > summary {
    min-height: 34px;
    padding-inline: 11px;
    font-size: 0.7rem;
  }

  .app-shell {
    display: block;
    min-height: calc(100vh - 64px);
  }

  .sidebar {
    position: sticky;
    z-index: 15;
    top: 64px;
    display: block;
    width: 100%;
    height: auto;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .tab-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .tab-button {
    min-height: 44px;
    border-radius: 8px;
  }

  .workspace {
    padding: 32px 16px 78px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 19px;
  }

  .heading-metric {
    align-items: flex-start;
  }

  h1 {
    font-size: clamp(2.25rem, 12vw, 3.25rem);
  }

  .mode-switch {
    display: grid;
    width: 100%;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .field-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .selected-file {
    grid-template-columns: 88px minmax(0, 1fr) 34px;
    gap: 12px;
    padding: 14px;
  }

  .file-preview {
    width: 88px;
    height: 116px;
  }

  .remote-submit {
    align-items: stretch;
    flex-direction: column;
  }

  .remote-submit .primary-button {
    width: 100%;
    min-width: 0;
  }

  .jobs-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search-field {
    width: 100%;
  }

  .filter-group {
    overflow-x: auto;
    padding-bottom: 3px;
  }

  .validation-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-drawer {
    right: 12px;
    bottom: 12px;
    width: calc(100vw - 24px);
  }

  .toast-region {
    top: 76px;
    right: 12px;
    width: calc(100vw - 24px);
  }
}

@media (max-width: 430px) {
  .brand-mark {
    width: 31px;
    height: 31px;
  }

  .brand strong {
    font-size: 0.86rem;
  }

  .docs-link {
    padding-inline: 11px;
    font-size: 0.7rem;
  }

  .form-card,
  .submit-card,
  .remote-info-card {
    padding: 20px;
  }

  .card-heading {
    grid-template-columns: 29px minmax(0, 1fr);
    gap: 10px;
  }

  .step-number {
    width: 28px;
    height: 28px;
  }

  .input-with-action {
    flex-direction: column;
    gap: 7px;
  }

  .input-with-action input,
  .field-action {
    width: 100%;
    min-height: 42px;
    border: 1px solid #c9c6bc;
    border-radius: var(--radius-sm);
  }

  .jobs-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .job-list-item {
    grid-template-columns: 33px minmax(0, 1fr);
  }

  .job-list-item .status-pill {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

@media (forced-colors: active) {
  .status-dot,
  .job-status-dot,
  .validation-icon {
    border: 1px solid currentColor;
  }
}
