:root {
  color-scheme: light;
  --ink: #1f2329;
  --muted: #68707a;
  --line: #d9dde2;
  --soft: #f4f5f6;
  --panel: #ffffff;
  --accent: #e86f35;
  --accent-dark: #bb4c1e;
  --terminal: #16191d;
  --terminal-muted: #aeb8b4;
  --success: #24734b;
  --danger: #b64237;
  font-family: Arial, Helvetica, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  background: var(--soft);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-size: 16px;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(232, 111, 53, 0.38);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.skip-link {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 10;
  padding: 8px 12px;
  color: #fff;
  background: var(--ink);
  transform: translateY(-120%);
}

.skip-link:focus {
  transform: translateY(0);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent-dark);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.auth-view {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.auth-card {
  width: min(100%, 420px);
  padding: 32px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(31, 35, 41, 0.07);
}

.auth-card h1,
.site-header h1,
.page-intro h2,
.section-heading h3 {
  margin: 0;
  line-height: 1.15;
}

.auth-card h1 {
  font-size: clamp(1.7rem, 4vw, 2.1rem);
}

.auth-copy,
.page-intro p,
.field-help,
.empty-copy {
  color: var(--muted);
}

.auth-copy {
  margin: 12px 0 24px;
}

.login-form {
  display: grid;
  gap: 8px;
}

.login-form label {
  margin-top: 8px;
  font-size: 0.86rem;
  font-weight: 700;
}

.login-form input,
.file-input {
  width: 100%;
  min-height: 44px;
  padding: 9px 11px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c0c8;
  border-radius: 5px;
}

.primary-button,
.secondary-button,
.run-button,
.text-button {
  min-height: 42px;
  border-radius: 5px;
  font-weight: 700;
}

.primary-button {
  margin-top: 12px;
  padding: 9px 16px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
}

.primary-button:hover:not(:disabled) {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.secondary-button,
.text-button {
  padding: 7px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
}

.secondary-button:hover,
.text-button:hover {
  border-color: #aeb5bc;
  background: var(--soft);
}

.text-button {
  min-height: 34px;
  color: var(--accent-dark);
  font-size: 0.86rem;
}

.form-error,
.terminal-error {
  margin: 8px 0 0;
  color: var(--danger);
  font-size: 0.9rem;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 22px max(24px, calc((100vw - 900px) / 2));
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

.site-header h1 {
  font-size: 1.28rem;
}

.brand-lockup {
  display: flex;
  align-items: baseline;
  gap: 12px;
}

.brand-name {
  margin: 0;
  color: var(--ink);
  font-size: 1.05rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.brand-product {
  color: var(--muted);
  font-size: 0.9rem;
}

.header-actions,
.connection-status {
  display: flex;
  align-items: center;
  gap: 10px;
}

.connection-status {
  color: var(--muted);
  font-size: 0.84rem;
  white-space: nowrap;
}

.status-dot {
  width: 8px;
  height: 8px;
  background: #b5bbc1;
  border-radius: 50%;
}

.connection-status.is-online .status-dot {
  background: var(--success);
}

.connection-status.is-offline .status-dot {
  background: var(--danger);
}

.simple-shell {
  width: min(100% - 32px, 900px);
  margin: 0 auto;
  padding: 42px 0 64px;
}

.page-intro {
  margin-bottom: 24px;
}

.page-intro h2 {
  max-width: 680px;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
}

.page-intro p:last-child {
  margin: 10px 0 0;
}

.simple-panel {
  margin-top: 16px;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.section-heading > div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.section-heading h3 {
  font-size: 1.1rem;
}

.step-number {
  display: inline-grid;
  width: 24px;
  height: 24px;
  place-items: center;
  color: #fff;
  background: var(--accent);
  border-radius: 50%;
  font-size: 0.78rem;
  font-weight: 700;
}

.step-number-dark {
  color: var(--terminal);
  background: #c7d0cb;
}

.section-note {
  color: var(--muted);
  font-size: 0.82rem;
}

.file-picker {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 12px;
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.file-picker-label {
  display: grid;
  gap: 3px;
}

.file-picker-title {
  font-weight: 700;
}

.file-picker-help,
.field-help {
  font-size: 0.84rem;
}

.file-picker-help {
  color: var(--muted);
}

.file-input {
  width: min(100%, 270px);
  min-height: 36px;
  padding: 5px 6px;
  background: #fff;
  font-size: 0.82rem;
}

.selected-file {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.selected-file > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.selected-file strong,
.selected-file span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-file span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
}

.file-icon {
  flex: 0 0 auto;
  padding: 4px 6px;
  color: var(--accent-dark);
  background: #fff2eb;
  border: 1px solid #f2c5b0;
  border-radius: 4px;
  font-size: 0.63rem;
  font-weight: 700;
  letter-spacing: 0.05em;
}

.simple-panel > .primary-button {
  margin-top: 14px;
}

.field-help {
  margin: 10px 0 0;
}

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

.run-button {
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c0c8;
}

.run-button:hover:not(:disabled) {
  color: var(--accent-dark);
  border-color: var(--accent);
  background: #fff8f4;
}

.terminal-panel {
  color: #f4f6f4;
  background: var(--terminal);
  border-color: var(--terminal);
}

.terminal-panel .section-heading {
  margin-bottom: 14px;
}

.terminal-panel .section-heading h3 {
  color: #fff;
}

.terminal-state {
  color: var(--terminal-muted);
  font-size: 0.82rem;
}

.terminal-empty,
.terminal-meta {
  color: var(--terminal-muted);
  font-size: 0.82rem;
}

.terminal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.terminal-output {
  min-height: 210px;
  max-height: 420px;
  margin: 14px 0 0;
  padding: 14px;
  overflow: auto;
  color: #dce7df;
  background: #0d0f11;
  border: 1px solid #30373a;
  border-radius: 5px;
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  font-size: 0.82rem;
  line-height: 1.55;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.terminal-error {
  margin-bottom: 0;
}

.progress-track {
  height: 6px;
  overflow: hidden;
  background: #353d3d;
  border-radius: 999px;
}

.progress-bar {
  width: 0;
  height: 100%;
  background: var(--accent);
  border-radius: inherit;
  transition: width 180ms ease;
}

.artifacts-panel {
  margin-bottom: 0;
}

.artifact-list {
  display: grid;
  gap: 8px;
}

.artifact-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
}

.artifact-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.artifact-kind {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.78rem;
}

.empty-copy {
  margin: 0;
  font-size: 0.88rem;
}

.page-message {
  margin-top: 16px;
  padding: 10px 12px;
  color: var(--accent-dark);
  background: #fff2eb;
  border: 1px solid #f2c5b0;
  border-radius: 5px;
  font-size: 0.9rem;
}

.page-message-error {
  color: var(--danger);
  background: #fff1f0;
  border-color: #e2b0ab;
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    padding: 18px 16px;
  }

  .header-actions {
    justify-content: space-between;
    width: 100%;
  }

  .simple-shell {
    width: min(100% - 24px, 900px);
    padding-top: 28px;
  }

  .simple-panel {
    padding: 18px;
  }

  .file-picker,
  .run-buttons {
    grid-template-columns: 1fr;
  }

  .file-picker {
    gap: 10px;
  }

  .file-input {
    width: 100%;
  }

  .section-heading {
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
