:root {
  color-scheme: light;
  --ink: #151713;
  --muted: #656b63;
  --line: #d8dcd3;
  --surface: #ffffff;
  --canvas: #f2f4ee;
  --green: #08743f;
  --green-soft: #e1f2e7;
  --orange: #de5a32;
  --yellow: #e8b52b;
  --red-soft: #f9e3df;
  --shadow: 0 12px 34px rgba(28, 34, 25, 0.08);
  font-family: Inter, Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--canvas);
}

button,
input {
  font: inherit;
}

button,
a,
.upload-zone,
tbody tr {
  -webkit-tap-highlight-color: transparent;
}

.topbar {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 10px clamp(16px, 3vw, 40px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 6px;
  color: white;
  background: var(--ink);
  font-size: 13px;
}

.topbar-status {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.topbar-actions {
  display: flex;
  gap: 14px;
  align-items: center;
}

.topbar-actions form {
  margin: 0;
}

.logout-button {
  min-height: 38px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  cursor: pointer;
  color: var(--ink);
  background: white;
  font-size: 13px;
  font-weight: 800;
}

.logout-button:hover {
  border-color: var(--ink);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px var(--green-soft);
}

.workspace {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  width: min(1500px, 100%);
  margin: 0 auto;
  padding: 20px clamp(16px, 3vw, 40px) 40px;
}

.intake-panel,
.jobs-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.intake-panel {
  align-self: start;
  padding: 24px;
}

.jobs-panel {
  overflow: hidden;
}

.section-heading {
  display: flex;
  gap: 12px;
  align-items: baseline;
  margin-bottom: 24px;
}

.section-heading.compact {
  margin: 0;
}

.section-heading h1,
.section-heading h2 {
  margin: 0;
  font-size: 24px;
  line-height: 1.1;
}

.section-number {
  color: var(--green);
  font-size: 12px;
  font-weight: 900;
}

.field-label {
  display: block;
  margin: 0 0 7px;
  font-size: 13px;
  font-weight: 800;
}

input {
  width: 100%;
  height: 46px;
  margin-bottom: 18px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 5px;
  outline: none;
  color: var(--ink);
  background: #fff;
}

input:focus {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.domain-field {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  height: 46px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 5px;
  overflow: hidden;
}

.domain-field:focus-within {
  border-color: var(--green);
  box-shadow: 0 0 0 3px var(--green-soft);
}

.domain-field input {
  height: 44px;
  margin: 0;
  border: 0;
  box-shadow: none;
}

.domain-field span {
  padding: 0 13px 0 4px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

.upload-zone {
  display: grid;
  min-height: 150px;
  margin: 8px 0 14px;
  padding: 20px;
  place-content: center;
  justify-items: center;
  border: 1px dashed #a8aea3;
  border-radius: 6px;
  cursor: pointer;
  background: #f8f9f5;
  text-align: center;
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: var(--green);
  background: var(--green-soft);
}

.upload-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.upload-zone strong {
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-zone small {
  margin-top: 6px;
  color: var(--muted);
}

.upload-symbol {
  display: grid;
  width: 34px;
  height: 34px;
  margin-bottom: 10px;
  place-items: center;
  border-radius: 50%;
  color: white;
  background: var(--green);
  font-size: 24px;
  line-height: 1;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  border-radius: 5px;
  cursor: pointer;
  font-weight: 800;
}

.primary-button {
  width: 100%;
  border: 1px solid var(--ink);
  color: white;
  background: var(--ink);
}

.primary-button:hover {
  border-color: var(--green);
  background: var(--green);
}

.primary-button.fit {
  width: auto;
  padding: 0 20px;
}

.secondary-button {
  padding: 0 16px;
  border: 1px solid var(--line);
  color: var(--ink);
  background: white;
}

.secondary-button:hover {
  border-color: var(--ink);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.form-message {
  min-height: 18px;
  margin: 10px 0 0;
  color: #9b311f;
  font-size: 13px;
  line-height: 1.35;
}

.jobs-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 22px;
  border-bottom: 1px solid var(--line);
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 13px 18px;
  border-bottom: 1px solid #e7e9e3;
  overflow: hidden;
  text-align: left;
  text-overflow: ellipsis;
  white-space: nowrap;
}

th {
  color: var(--muted);
  background: #fafbf8;
  font-size: 11px;
  text-transform: uppercase;
}

td {
  font-size: 14px;
}

tbody tr {
  cursor: pointer;
}

tbody tr:hover,
tbody tr.selected {
  background: #f1f7f2;
}

.empty-state {
  padding: 48px 20px;
  color: var(--muted);
  text-align: center;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #35533f;
  background: var(--green-soft);
  font-size: 12px;
  font-weight: 800;
}

.status-badge[data-status='failed'] {
  color: #902c1d;
  background: var(--red-soft);
}

.job-detail {
  padding: 22px;
  border-top: 1px solid var(--line);
  background: #fafbf8;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
}

.detail-kicker {
  margin: 0 0 4px;
  color: var(--green);
  font-size: 12px;
  font-weight: 800;
}

.detail-head h2 {
  margin: 0;
  font-size: 25px;
}

.progress-rail {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin: 20px 0;
}

.progress-step {
  min-height: 5px;
  border-radius: 3px;
  background: #dfe2da;
}

.progress-step.done {
  background: var(--green);
}

.progress-step.current {
  background: var(--yellow);
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(360px, 1.2fr);
  gap: 14px;
}

.report-panel,
.preview-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
}

.report-panel {
  padding: 18px;
}

.report-panel h3 {
  margin: 0 0 14px;
  font-size: 16px;
}

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

.metric {
  padding: 10px;
  border-left: 3px solid var(--green);
  background: #f4f6f1;
}

.metric dt {
  color: var(--muted);
  font-size: 11px;
}

.metric dd {
  margin: 3px 0 0;
  font-size: 20px;
  font-weight: 900;
}

.issue-group {
  margin-top: 10px;
  padding: 11px 12px;
  border-radius: 5px;
  background: #f6f7f3;
}

.issue-group.blocker {
  background: var(--red-soft);
}

.issue-group strong {
  display: block;
  margin-bottom: 5px;
  font-size: 12px;
}

.issue-group ul {
  margin: 0;
  padding-left: 18px;
  color: #4e544d;
  font-size: 12px;
  line-height: 1.5;
}

.hash-row {
  margin-top: 14px;
  color: var(--muted);
  font-size: 11px;
}

.hash-row code {
  display: block;
  margin-top: 4px;
  overflow: hidden;
  color: var(--ink);
  text-overflow: ellipsis;
}

.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 16px;
}

.preview-panel {
  overflow: hidden;
}

.preview-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}

.preview-toolbar a {
  color: var(--green);
  font-weight: 800;
}

.preview-panel iframe {
  display: block;
  width: 100%;
  height: 520px;
  border: 0;
  background: white;
}

.login-screen {
  min-height: 100vh;
  background: var(--canvas);
}

.login-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 460px);
  width: min(1180px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  align-items: center;
  gap: clamp(36px, 8vw, 120px);
  padding: 48px 0;
}

.login-intro {
  min-width: 0;
}

.login-intro .brand {
  margin-bottom: clamp(64px, 12vh, 130px);
}

.login-kicker {
  margin: 0 0 14px;
  color: var(--green);
  font-size: 13px;
  font-weight: 900;
  text-transform: uppercase;
}

.login-intro h1 {
  max-width: 720px;
  margin: 0;
  font-size: 112px;
  line-height: 0.82;
  text-transform: uppercase;
}

.login-intro > p:last-child {
  max-width: 560px;
  margin: 30px 0 0;
  color: var(--muted);
  font-size: 19px;
  line-height: 1.45;
}

.login-panel {
  padding: clamp(26px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.login-panel h2 {
  margin: 12px 0 32px;
  font-size: 30px;
}

.login-panel input {
  height: 54px;
  margin-bottom: 16px;
}

.login-panel .primary-button {
  min-height: 52px;
}

.login-username {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  padding: 0;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  overflow: hidden;
  white-space: nowrap;
}

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

  .intake-panel {
    position: static;
  }

  .login-layout {
    grid-template-columns: 1fr;
    gap: 28px;
    width: min(100% - 32px, 640px);
    padding: 32px 0;
  }

  .login-intro .brand {
    margin-bottom: 36px;
  }

  .login-intro h1 {
    font-size: 76px;
  }

  .login-intro > p:last-child {
    margin-top: 20px;
  }
}

@media (max-width: 740px) {
  .topbar-status {
    display: none;
  }

  .workspace {
    padding: 12px;
  }

  .intake-panel,
  .job-detail {
    padding: 17px;
  }

  .jobs-header {
    padding: 16px;
  }

  table {
    min-width: 650px;
  }

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

  .preview-panel iframe {
    height: 440px;
  }

  .login-layout {
    width: min(100% - 24px, 520px);
    padding: 24px 0;
  }

  .login-intro .brand {
    margin-bottom: 42px;
  }

  .login-intro h1 {
    font-size: 58px;
  }

  .login-intro > p:last-child {
    margin-top: 20px;
    font-size: 16px;
  }

  .login-panel {
    padding: 24px;
  }
}
