:root {
  color-scheme: light;
  --bg: #f2f5f7;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --text: #13202b;
  --muted: #667381;
  --line: #d9e2ea;
  --deep: #031525;
  --deep-2: #0d1115;
  --palmetto-blue: #0d477d;
  --palmetto-cyan: #43bee8;
  --danger: #b42318;
  --ok: #087443;
  --focus: rgba(67, 190, 232, .34);
  --shadow: 0 18px 46px rgba(3, 21, 37, .12);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
}

body {
  margin: 0;
  min-height: 100svh;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-header {
  min-height: 92px;
  color: var(--deep);
  background: #fff;
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(3, 21, 37, .08);
}

.app-header__inner {
  width: min(1180px, calc(100% - 40px));
  min-height: 92px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
}

.brand {
  width: 245px;
  display: inline-flex;
  align-items: center;
}

.brand img,
.login-logo {
  width: 100%;
  height: auto;
  display: block;
}

.app-title {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.app-title span,
.admin-name {
  color: var(--palmetto-blue);
  font-size: 12px;
  font-weight: 720;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-title strong {
  overflow-wrap: anywhere;
  font-size: 18px;
  line-height: 1.2;
  font-weight: 760;
}

.logout-form {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.shell {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
  padding: 36px 0 56px;
}

.workspace {
  display: grid;
  gap: 20px;
}

.intro {
  display: grid;
  gap: 10px;
  padding: 4px 0 8px;
}

.eyebrow,
.label {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.app-page .eyebrow {
  color: var(--palmetto-blue);
}

h1 {
  margin: 0;
  font-size: 36px;
  line-height: 1.1;
  font-weight: 760;
}

.lead {
  margin: 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.55;
}

.upload-form,
.status-panel,
.recent-panel,
.result-area,
.login-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.upload-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: end;
  padding: 22px;
}

.file-field,
.text-field {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 720;
}

input[type="file"],
.text-field input {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

button,
.download-link {
  min-height: 44px;
  border-radius: 8px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: var(--palmetto-blue);
  color: #fff;
  font: inherit;
  font-weight: 760;
  text-decoration: none;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

button:hover,
.download-link:hover {
  background: #0a3865;
}

button:disabled {
  cursor: wait;
  opacity: .74;
}

.header-button {
  min-height: 42px;
  border: 1px solid var(--palmetto-blue);
  background: #fff;
  color: var(--palmetto-blue);
}

.header-button:hover {
  background: var(--palmetto-blue);
  color: #fff;
}

input:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: 4px solid var(--focus);
  outline-offset: 2px;
}

.status-panel {
  display: grid;
  grid-template-columns: minmax(150px, .8fr) minmax(0, 1.1fr) minmax(0, 1.1fr) minmax(0, 1.2fr);
  gap: 18px;
  padding: 20px 22px;
}

.recent-panel {
  display: grid;
  gap: 14px;
  padding: 18px 22px;
}

.recent-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.ghost-button {
  min-height: auto;
  padding: 0;
  background: transparent;
  color: var(--palmetto-blue);
}

.ghost-button:hover {
  background: transparent;
  color: #0a3865;
}

.recent-empty {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.recent-jobs {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.recent-job {
  width: 100%;
  min-height: 58px;
  justify-content: flex-start;
  padding: 10px 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.recent-job:hover,
.recent-job.active {
  border-color: var(--palmetto-blue);
  background: #eef7fb;
}

.recent-title,
.recent-meta {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.recent-title {
  font-size: 14px;
  font-weight: 760;
}

.recent-meta {
  margin-top: 4px;
  color: var(--muted);
  font: 12px/1.35 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.status-text,
.mono {
  margin: 6px 0 0;
  font-size: 15px;
  line-height: 1.4;
}

.mono {
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

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

.status-text.error,
.form-error {
  color: var(--danger);
}

.result-area {
  display: grid;
  gap: 0;
  overflow: hidden;
}

.result-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.result-meta {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.download-link.disabled {
  pointer-events: none;
  background: #e4eaf0;
  color: #788391;
}

pre {
  min-height: 240px;
  max-height: 520px;
  margin: 0;
  padding: 22px;
  overflow: auto;
  white-space: pre-wrap;
  color: #26313b;
  font: 14px/1.65 ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

.login-page {
  display: grid;
  place-items: center;
  padding: 28px 16px;
  background: var(--deep);
}

.login-shell {
  width: min(100%, 420px);
}

.login-panel {
  display: grid;
  gap: 18px;
  padding: 28px;
}

.login-logo {
  width: 260px;
  filter: none;
}

.login-panel h1 {
  font-size: 30px;
}

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

.form-error {
  margin: 0;
  font-size: 14px;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .app-header__inner {
    width: min(100% - 24px, 1180px);
    min-height: 128px;
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 18px 0;
  }

  .brand {
    width: 164px;
  }

  .logout-form {
    width: 100%;
    justify-content: space-between;
  }

  .shell {
    width: min(100% - 24px, 980px);
    padding: 28px 0 44px;
  }

  h1 {
    font-size: 30px;
  }

  .upload-form,
  .status-panel {
    grid-template-columns: 1fr;
  }

  .upload-form,
  .status-panel,
  .recent-panel,
  .result-heading,
  pre {
    padding: 16px;
  }

  button,
  .download-link {
    width: 100%;
  }

  .result-heading {
    align-items: stretch;
    flex-direction: column;
  }
}
