:root {
  --bg: #f4efe6;
  --card: rgba(255, 252, 247, 0.92);
  --ink: #1e1b16;
  --muted: #6f6658;
  --line: rgba(30, 27, 22, 0.12);
  --accent: #0f766e;
  --accent-deep: #114a48;
  --warn: #b45309;
  --fail: #b42318;
  --ok: #12704a;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Iowan Old Style", "Palatino Linotype", serif;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(15, 118, 110, 0.15), transparent 28rem),
    linear-gradient(180deg, #faf7f1 0%, var(--bg) 100%);
}

a {
  color: inherit;
}

.shell-header,
.shell-main {
  width: min(1120px, calc(100vw - 2rem));
  margin: 0 auto;
}

.shell-header {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 2rem;
  padding: 2rem 0 1rem;
}

.shell-header h1,
.hero h2,
.panel h2,
.panel h3 {
  margin: 0;
  font-weight: 600;
}

.shell-nav {
  display: flex;
  gap: 1rem;
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.shell-nav a {
  text-decoration: none;
  color: var(--muted);
}

.shell-main {
  display: grid;
  gap: 1rem;
  padding-bottom: 2rem;
}

.hero,
.panel,
.ready-panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  box-shadow: 0 18px 50px rgba(30, 27, 22, 0.06);
}

.hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.4rem;
  padding: clamp(1.25rem, 3vw, 2rem);
  align-items: start;
}

.hero > div,
.hero .run-form {
  min-width: 0;
}

.hero h2 {
  max-width: 46rem;
  font-size: clamp(2.2rem, 4vw, 3.6rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}

.hero .lede {
  max-width: 52rem;
}

.panel {
  padding: 1.25rem;
}

.ready-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.25rem;
  border-color: rgba(18, 112, 74, 0.28);
  background:
    linear-gradient(135deg, rgba(18, 112, 74, 0.12), rgba(255, 252, 247, 0.94) 42%),
    var(--card);
}

.ready-panel h3 {
  margin: 0 0 0.45rem;
}

.ready-url {
  display: block;
  max-width: min(44rem, 100%);
  color: var(--accent-deep);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  overflow-wrap: anywhere;
}

.panel-header,
.action-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
}

.eyebrow {
  margin: 0 0 0.35rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.lede {
  color: var(--muted);
  line-height: 1.6;
}

.primary-button,
.secondary-button,
.primary-link {
  border: 0;
  border-radius: 999px;
  padding: 0.85rem 1.2rem;
  font: inherit;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.primary-button,
.primary-link {
  background: var(--accent);
  color: white;
}

.secondary-button {
  background: rgba(15, 118, 110, 0.08);
  color: var(--accent-deep);
}

.compact-button {
  white-space: nowrap;
}

.stats-grid,
.step-grid {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.step-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.stat-card,
.step-card {
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid var(--line);
  border-radius: 1rem;
  padding: 1rem;
  min-width: 0;
}

.stat-card span,
.step-card p {
  color: var(--muted);
}

.stat-card strong {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.recording-name {
  margin-top: 0.15rem;
}

.path-text {
  display: block;
  max-width: 100%;
  margin-top: 0.45rem;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.76rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  text-transform: capitalize;
}

.status-completed {
  color: var(--ok);
}

.status-running,
.status-pending {
  color: var(--warn);
}

.status-failed {
  color: var(--fail);
}

.progress-block {
  display: grid;
  gap: 0.45rem;
  margin: 0.8rem 0;
}

.progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.85rem;
}

.progress-meta strong {
  color: var(--ink);
}

.progress-track {
  height: 0.55rem;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(17, 74, 72, 0.1);
}

.progress-fill {
  height: 100%;
  min-width: 0.25rem;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent-deep), var(--accent));
  transition: width 220ms ease;
}

.table-scroll {
  margin-top: 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

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

.table-scroll .run-table {
  margin-top: 0;
}

.run-table th,
.run-table td {
  text-align: left;
  padding: 0.8rem 0.4rem;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.run-table th {
  white-space: nowrap;
}

.run-table td {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.code-panel pre {
  overflow-x: auto;
  padding: 1rem;
  border-radius: 1rem;
  background: #1f2328;
  color: #f7f5f2;
  font-size: 0.9rem;
  white-space: pre-wrap;
}

.theme-list,
.event-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  padding: 0;
  list-style: none;
}

.theme-list span,
.event-list li {
  border-radius: 999px;
  background: rgba(17, 74, 72, 0.08);
  padding: 0.45rem 0.8rem;
}

.event-list {
  flex-direction: column;
}

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

.form-help {
  margin: 0;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
  font-size: 0.86rem;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.settings-form {
  display: grid;
  gap: 1rem;
  margin-top: 1rem;
}

.compact-form {
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--line);
}

.run-form,
.settings-form label,
.settings-field {
  display: grid;
  gap: 0.4rem;
  color: var(--muted);
  font-family: "Avenir Next", "Helvetica Neue", sans-serif;
}

.run-form {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: end;
  width: 100%;
  min-width: 0;
  max-width: 62rem;
}

.field-with-action {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: end;
}

.field-with-action label {
  min-width: 0;
}

.run-form label:first-child,
.run-form .full-width-field,
.run-form .form-help,
.run-form .primary-button {
  grid-column: 1 / -1;
}

.settings-field > span {
  display: block;
}

.settings-form input,
.settings-form textarea,
.run-form input,
.run-form textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  padding: 0.85rem 1rem;
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink);
  font: inherit;
}

.settings-form textarea,
.run-form textarea {
  min-height: 7rem;
  resize: vertical;
  line-height: 1.45;
}

.checkbox-list {
  display: grid;
  gap: 0.55rem;
}

.checkbox-row {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: start;
  gap: 0.6rem !important;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--line);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.55);
}

.checkbox-row input {
  width: auto;
  margin-top: 0.2rem;
}

.checkbox-row small {
  color: var(--muted);
}

@media (max-width: 780px) {
  .hero,
  .run-form,
  .field-with-action {
    grid-template-columns: 1fr;
  }

  .shell-header {
    align-items: start;
    flex-direction: column;
  }
}
