:root {
  --bg: #f7f7f2;
  --surface: #ffffff;
  --ink: #232622;
  --muted: #6b7168;
  --line: #d9ddd2;
  --accent: #0f766e;
  --accent-dark: #0b4f49;
  --warning: #a16207;
  --danger: #b42318;
  --success: #1f7a4d;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
  text-decoration: none;
}

.shell {
  width: min(1120px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 18px;
}

.panel,
.progress-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.notice {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px 14px;
  background: var(--surface);
}

.notice.warning {
  border-color: #e7ca83;
  background: #fff9e8;
  color: var(--warning);
}

.notice span {
  color: var(--ink);
  font-weight: 700;
}

.progress-panel {
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.progress-summary {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.lead {
  margin: 12px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.muted {
  color: var(--muted);
}

.run-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.strong {
  font-weight: 800;
}

.right {
  text-align: right;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.inline-form {
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 14px;
  background: var(--surface);
  color: var(--ink);
  font-weight: 800;
  cursor: pointer;
  text-align: center;
}

.button.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #ffffff;
}

.button.ghost {
  background: #fbfcf8;
}

.button.danger {
  border-color: #efb4ae;
  background: #fff7f6;
  color: var(--danger);
}

.button.warning {
  border-color: #e7ca83;
  background: #fff9e8;
  color: var(--warning);
}

.button:hover {
  border-color: var(--accent-dark);
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 8px;
  padding: 0 9px;
  background: #eef0e8;
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
}

.badge.active {
  background: #d8f1ee;
  color: var(--accent-dark);
}

.badge.success {
  background: #dff2e7;
  color: var(--success);
}

.badge.warning {
  background: #f8edcf;
  color: var(--warning);
}

.badge.danger {
  background: #f9dedb;
  color: var(--danger);
}

.table-wrap {
  max-width: 100%;
  overflow-x: hidden;
}

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

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
  overflow-wrap: anywhere;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

tr:last-child td {
  border-bottom: 0;
}

.empty-state {
  min-height: 120px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

.settings-form {
  display: grid;
  gap: 18px;
}

.field {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.text-input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: #fbfcf8;
  color: var(--ink);
  font: inherit;
  font-weight: 700;
}

.text-input:focus {
  border-color: var(--accent);
  outline: 3px solid #d8f1ee;
}

.compact-input {
  min-width: 0;
  min-height: 34px;
  padding: 0 9px;
  font-size: 13px;
}

.small-button {
  min-height: 34px;
  padding: 0 10px;
  font-size: 12px;
}

.rename-form {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 520px;
  margin-top: 8px;
}

.rename-form .compact-input {
  flex: 1 1 180px;
}

.rename-toggle {
  margin-top: 8px;
}

.run-id {
  overflow-wrap: anywhere;
}

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

.reports-col-request {
  width: 58%;
}

.reports-col-status {
  width: 9%;
}

.reports-col-duration {
  width: 7%;
}

.reports-col-cost {
  width: 5%;
}

.reports-col-end {
  width: 9%;
}

.reports-col-actions {
  width: 12%;
}

.reports-table .row-actions {
  align-items: flex-end;
  flex-direction: column;
}

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

.mode-choice {
  display: flex;
  gap: 10px;
  min-height: 86px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcf8;
  cursor: pointer;
}

.mode-choice input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.mode-choice strong,
.mode-choice small {
  display: block;
}

.mode-choice small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.angle-field {
  margin-top: 12px;
}

.report-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.report-facts span {
  max-width: 100%;
  overflow-wrap: anywhere;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 4px 8px;
  background: #fbfcf8;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.report-facts strong {
  color: var(--ink);
}

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.choice-grid.compact {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.choice {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fbfcf8;
  font-weight: 800;
}

.choice input {
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.extra-pages {
  display: grid;
  gap: 10px;
}

.extra-page-row {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) minmax(120px, .7fr) minmax(220px, 2fr) auto;
  gap: 10px;
  align-items: end;
}

.extra-page-row .field {
  min-width: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
}

.auth-panel {
  width: min(100%, 420px);
}

.auth-panel h1 {
  margin-bottom: 18px;
}

.form-error {
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.meter-block {
  margin-top: 18px;
}

.stepper {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 8px;
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
}

.stepper li {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.stepper span {
  display: block;
  height: 6px;
  margin-bottom: 7px;
  border-radius: 8px;
  background: #e4e8dc;
}

.stepper strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stepper li.done {
  color: var(--success);
}

.stepper li.done span {
  background: var(--success);
}

.stepper li.current {
  color: var(--accent-dark);
}

.stepper li.current span {
  background: var(--accent);
  box-shadow: 0 0 0 3px #d8f1ee;
}

.stepper li.failed {
  color: var(--danger);
}

.stepper li.failed span {
  background: var(--danger);
}

.meter-label {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 8px;
  background: #e4e8dc;
}

.meter div {
  height: 100%;
  width: 0;
  border-radius: 8px;
  background: var(--accent);
  transition: width .25s ease;
}

.activity-block {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid #dbe7e4;
  border-radius: 8px;
  background: #f5fbfa;
}

.activity-label {
  margin-bottom: 6px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.activity-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.activity-list li {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  border: 1px solid #cfe3df;
  border-radius: 8px;
  padding: 6px 9px;
  background: #ffffff;
  color: var(--ink);
  font-weight: 800;
}

.timeline {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline li {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.timeline li:last-child {
  border-bottom: 0;
}

.timeline p {
  margin: 3px 0;
}

.timeline small,
.time {
  color: var(--muted);
  font-size: 12px;
}

.hidden {
  display: none !important;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding-top: 20px;
  }

  .page-header,
  .progress-summary,
  .notice {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .mode-grid,
  .choice-grid,
  .choice-grid.compact,
  .extra-page-row {
    grid-template-columns: 1fr;
  }

  .extra-page-row .extra-page-remove {
    justify-self: start;
  }

  .right {
    text-align: left;
  }

  .row-actions {
    justify-content: flex-start;
  }

  .rename-form {
    align-items: stretch;
    flex-direction: column;
  }

  .reports-table,
  .reports-table thead,
  .reports-table tbody,
  .reports-table tr,
  .reports-table th,
  .reports-table td {
    display: block;
    width: 100%;
  }

  .reports-table thead {
    display: none;
  }

  .reports-table tr {
    border-bottom: 1px solid var(--line);
    padding: 14px 0;
  }

  .reports-table tr:last-child {
    border-bottom: 0;
  }

  .reports-table td {
    border-bottom: 0;
    padding: 4px 0;
  }
}
