:root {
  --bg: #f4efe7;
  --bg-deep: #e1d5c4;
  --surface: rgba(255, 250, 242, 0.8);
  --surface-strong: #fffaf2;
  --ink: #1f1b16;
  --muted: #665d53;
  --line: rgba(62, 47, 28, 0.14);
  --accent: #bb3e03;
  --accent-soft: #ffd7c2;
  --accent-ink: #7c2500;
  --ok: #146c43;
  --warn: #b65a16;
  --error: #b42318;
  --shadow: 0 24px 70px rgba(38, 24, 9, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(255, 214, 176, 0.85), transparent 32%),
    radial-gradient(circle at right 18%, rgba(197, 233, 208, 0.7), transparent 26%),
    linear-gradient(180deg, var(--bg) 0%, #efe3d1 100%);
  color: var(--ink);
  font-family: "Space Grotesk", system-ui, sans-serif;
}

.page-shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 32px 0 56px;
}

.hero {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 24px;
  margin-bottom: 28px;
}

.hero-copy,
.panel,
.status-card {
  backdrop-filter: blur(12px);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero-copy {
  border-radius: 34px;
  padding: 30px;
}

.eyebrow,
.status-label,
.panel-note,
.user-meta,
.meta-pill,
.job-meta,
.progress-meta,
.empty-state,
.toggle-row,
.separator span,
.link-button,
.toast {
  font-family: "IBM Plex Mono", monospace;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--accent-ink);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(2.4rem, 4vw, 4.6rem);
  line-height: 0.96;
  max-width: 11ch;
}

.hero-text {
  margin-top: 18px;
  max-width: 52ch;
  color: var(--muted);
  line-height: 1.6;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.meta-pill {
  border-radius: 999px;
  padding: 9px 12px;
  background: rgba(255, 250, 242, 0.7);
  border: 1px solid var(--line);
  font-size: 0.77rem;
}

.status-panel {
  display: grid;
  gap: 16px;
}

.status-card {
  border-radius: 24px;
  padding: 20px;
}

.usage-card {
  align-content: start;
}

.status-label {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.status-value {
  margin-top: 10px;
  font-size: 1.35rem;
  font-weight: 700;
}

.usage-title {
  margin-top: 10px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
}

.usage-list {
  margin: 14px 0 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.55;
}

.status-footnote {
  margin: -6px 2px 0;
  color: var(--warn);
  font-size: 0.74rem;
  font-family: "IBM Plex Mono", monospace;
}

.grid {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 24px;
}

.jobs-panel {
  grid-column: 1 / -1;
}

.panel {
  border-radius: var(--radius);
  padding: 24px;
}

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

.panel-note {
  color: var(--muted);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.promo-panel {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.promo-head {
  margin-bottom: 10px;
}

.promo-form {
  display: grid;
  gap: 10px;
}

.promo-input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  align-items: center;
}

.promo-badge {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 16px;
  border: 1px solid rgba(187, 62, 3, 0.18);
  background: rgba(255, 255, 255, 0.72);
}

.promo-badge-wrap {
  display: grid;
  gap: 10px;
}

.promo-remove-icon {
  margin-left: auto;
  width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(55, 37, 17, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  line-height: 1;
}

.promo-remove-icon:hover:not(:disabled) {
  color: var(--accent-ink);
  border-color: rgba(187, 62, 3, 0.24);
}

.promo-remove-icon:disabled {
  opacity: 0.6;
  cursor: wait;
}

.promo-badge-code {
  font-weight: 700;
  letter-spacing: 0.04em;
}

.promo-badge-meta,
.promo-feedback {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.76rem;
}

.promo-badge-meta {
  color: var(--muted);
}

.promo-feedback {
  display: block;
}

.promo-feedback.is-success {
  color: var(--ok);
}

.promo-feedback.is-error {
  color: var(--error);
}

.stack {
  display: grid;
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
}

label > span {
  font-size: 0.95rem;
  font-weight: 500;
}

input,
select,
button {
  font: inherit;
}

input,
select {
  width: 100%;
  border: 1px solid rgba(55, 37, 17, 0.14);
  background: rgba(255, 255, 255, 0.82);
  color: var(--ink);
  border-radius: 16px;
  padding: 14px 16px;
  min-height: 52px;
}

select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 48px;
}

label.language-field {
  gap: 10px;
}

.language-select-shell {
  position: relative;
}

.language-select-shell::after {
  content: "⌄";
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-54%);
  color: var(--accent-ink);
  pointer-events: none;
  font-size: 1.15rem;
  line-height: 1;
}

.language-select {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.94) 0%, rgba(255, 250, 242, 0.9) 100%);
  border-color: rgba(187, 62, 3, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.5);
}

.language-select:focus {
  outline: 2px solid rgba(187, 62, 3, 0.28);
  border-color: var(--accent);
}

input:focus,
select:focus {
  outline: 2px solid rgba(187, 62, 3, 0.32);
  border-color: var(--accent);
}

button {
  cursor: pointer;
}

button[type="submit"],
.ghost-button,
.danger-button,
.job-downloads a {
  border-radius: 16px;
  border: none;
  min-height: 52px;
  padding: 0 18px;
  transition: transform 140ms ease, opacity 140ms ease, background 140ms ease;
}

button[type="submit"] {
  background: linear-gradient(135deg, #cc4d12 0%, #8e2c00 100%);
  color: #fffaf2;
  font-weight: 700;
}

button:hover,
.job-downloads a:hover {
  transform: translateY(-1px);
}

.ghost-button {
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  color: var(--ink);
}

.danger-button {
  background: linear-gradient(135deg, var(--warn) 0%, #7c3a0a 100%);
  color: #fffaf2;
  font-weight: 700;
}

.danger-button.armed {
  background: linear-gradient(135deg, var(--error) 0%, #6b0c07 100%);
}

.link-button {
  background: none;
  border: none;
  padding: 0;
  color: var(--accent-ink);
  text-decoration: underline;
  min-height: auto;
}

.load-more-row {
  display: flex;
  justify-content: center;
  padding: 24px 0 8px;
}

.load-more-btn {
  font-family: "IBM Plex Mono", monospace;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: transparent;
  border: 1px solid rgba(124, 37, 0, 0.28);
  border-radius: 20px;
  padding: 7px 28px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.load-more-btn:hover {
  background: var(--accent-soft);
  border-color: rgba(124, 37, 0, 0.5);
  color: var(--accent-ink);
}

.load-more-btn:active {
  background: #ffbfa0;
}

.toggle-row {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 0.82rem;
}

.auth-helper {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.54);
}

.separator {
  position: relative;
  text-align: center;
}

.separator::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  border-top: 1px solid var(--line);
}

.separator span {
  position: relative;
  padding: 0 12px;
  background: var(--surface-strong);
  color: var(--muted);
  font-size: 0.78rem;
}

.toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
}

.toggle-card {
  display: flex;
  gap: 10px;
  align-items: center;
  min-height: 54px;
  border-radius: 16px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.66);
  border: 1px solid var(--line);
  transition: background 140ms ease, border-color 140ms ease, box-shadow 140ms ease,
    transform 140ms ease;
}

.diagram-toggle-card {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  column-gap: 10px;
}

.diagram-toggle-card > input {
  margin-top: 4px;
}

.toggle-card input {
  width: 18px;
  height: 18px;
  min-height: auto;
  padding: 0;
}

.toggle-card.is-selected {
  background: linear-gradient(180deg, rgba(255, 215, 194, 0.95) 0%, rgba(255, 242, 232, 0.96) 100%);
  border-color: rgba(187, 62, 3, 0.3);
  box-shadow: inset 0 0 0 1px rgba(187, 62, 3, 0.12);
  transform: translateY(-1px);
}

.toggle-card.is-selected span {
  color: var(--accent-ink);
}

.toggle-card:focus-within {
  outline: 2px solid rgba(187, 62, 3, 0.22);
  outline-offset: 2px;
}

.toggle-card-diagram-copy {
  width: 100%;
  min-width: 0;
  display: grid;
  gap: 8px;
}

.toggle-card.is-disabled {
  opacity: 0.58;
  filter: saturate(0.8);
}

.diagram-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.diagram-card-head output {
  font-family: "IBM Plex Mono", monospace;
  color: var(--accent-ink);
  font-size: 0.78rem;
}

.diagram-density-slider {
  width: 100%;
  display: block;
  height: 18px;
  min-height: 18px;
  padding: 0;
  accent-color: var(--accent);
  margin: 0;
  min-width: 0;
  justify-self: stretch;
}

.toggle-card .diagram-density-slider {
  width: 100%;
  height: 18px;
  min-height: 18px;
}

.job-list {
  display: grid;
  gap: 16px;
}

.job-list.scrollable {
  max-height: 72vh;
  overflow-y: auto;
  padding-right: 6px;
}

.job-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 18px;
  background: rgba(255, 255, 255, 0.62);
  min-width: 0;
  overflow-x: hidden;
}

.job-card.compact {
  padding: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
}

.job-compact-row {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 14px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  min-width: 0;
  border-radius: 12px 0 0 12px;
}

.job-compact-row:hover {
  background: rgba(0, 0, 0, 0.03);
  transform: none;
}

.job-compact-icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
}

.job-compact-icon.ok   { color: var(--ok); }
.job-compact-icon.error { color: var(--error); }
.job-compact-icon.warn  { color: var(--warn); }

.compact-pct {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
}

.job-compact-title {
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--ink);
  min-width: 0;
}

.job-card.compact .job-delete-icon {
  position: static;
  flex-shrink: 0;
  margin-right: 8px;
  border: none;
  background: none;
}

.job-card.expanded {
  padding-right: 44px;
  cursor: default;
}

.job-delete-icon {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  padding: 0;
  min-height: 0;
  font-size: 0.9rem;
}

.job-delete-glyph {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.job-delete-icon:hover {
  transform: none;
  background: rgba(255, 215, 194, 0.9);
}

.job-delete-icon.is-processing {
  color: var(--accent-ink);
  background: rgba(255, 244, 233, 0.96);
  border-color: rgba(187, 62, 3, 0.18);
}

.job-delete-icon.is-processing .job-delete-glyph {
  animation: processingWiggle 1.8s ease-in-out infinite;
}

.job-delete-icon[disabled] {
  opacity: 0.78;
  cursor: not-allowed;
}

.job-delete-icon[disabled]:hover {
  background: rgba(255, 244, 233, 0.96);
}

@keyframes processingWiggle {
  0%, 100% {
    transform: translateY(0) scale(1);
  }
  35% {
    transform: translateY(-1px) scale(1.08) rotate(-4deg);
  }
  70% {
    transform: translateY(0) scale(0.98) rotate(4deg);
  }
}

.job-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: flex-start;
}

.job-top > div:first-child {
  min-width: 0;
}

.job-title-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
  flex-wrap: nowrap;
}

.job-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1.1rem;
  font-weight: 700;
}

.job-title-editable {
  cursor: pointer;
}

.job-title-editable:hover {
  text-decoration: underline;
  text-decoration-style: dotted;
  text-underline-offset: 3px;
}

.job-title-row .job-rename {
  opacity: 0;
  transition: opacity 0.15s;
}

.job-title-row:hover .job-rename,
.job-title-row:focus-within .job-rename {
  opacity: 1;
}

.icon-button {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--muted);
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  flex-shrink: 0;
}

.icon-button:hover {
  color: var(--fg);
  background: rgba(0, 0, 0, 0.06);
}

.pw-field {
  position: relative;
}

.pw-field input {
  padding-right: 48px;
}

/* Suppress browser-native password reveal buttons so our custom toggle shows */
.pw-field input::-webkit-credentials-auto-fill-button,
.pw-field input::-webkit-contacts-auto-fill-button,
.pw-field input::-webkit-strong-password-auto-fill-button {
  display: none !important;
  visibility: hidden;
}
.pw-field input::-ms-reveal,
.pw-field input::-ms-clear {
  display: none;
}

.pw-toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  min-height: auto;
}

.pw-toggle:hover {
  color: var(--accent-ink);
  transform: translateY(-50%); /* keep vertically centred — overrides global button:hover lift */
}

.eye-slash {
  transition: stroke-dashoffset 180ms ease;
}

.pw-toggle[aria-pressed="true"] .eye-slash {
  stroke-dashoffset: 0;
}

.pw-hint {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.5;
}

.pw-hint em {
  font-style: normal;
  font-family: "IBM Plex Mono", monospace;
}

.pw-strength {
  margin-top: 6px;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  min-height: 1.2em;
  transition: color 0.2s;
}

.pw-strength.strength-weak   { color: #ef4444; }
.pw-strength.strength-ok     { color: #f59e0b; }
.pw-strength.strength-good   { color: #3b82f6; }
.pw-strength.strength-strong { color: #22c55e; }

.label-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.forgot-pw-link {
  font-size: 0.75rem;
  color: var(--muted);
  text-decoration: none;
}

.forgot-pw-link:hover {
  text-decoration: underline;
}

.job-title-input {
  flex: 1 1 auto;
  width: auto;
  max-width: 100%;
  min-width: 0;
  min-height: unset;
  font-size: 1.1rem;
  font-weight: 700;
  font-family: inherit;
  color: inherit;
  background: transparent;
  border: none;
  border-bottom: 2px solid var(--accent);
  border-radius: 0;
  padding: 0;
  margin: 0;
  line-height: inherit;
}

.job-title-input:focus {
  outline: none;
  border-color: var(--accent);
}

.job-source-link {
  margin-top: 6px;
  font-size: 0.82rem;
  line-height: 1.45;
}

.job-source-link a {
  color: var(--accent-ink);
  text-decoration: underline;
  text-underline-offset: 2px;
  word-break: break-word;
}

.job-summary {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.76rem;
  line-height: 1.5;
}

.job-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.job-badge {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 250, 242, 0.9);
  border: 1px solid var(--line);
  font-size: 0.78rem;
}

.job-status {
  min-width: 120px;
  text-align: right;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.job-meta {
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.6;
}

.upload-progress-track {
  width: 100%;
  height: 10px;
  background: rgba(49, 32, 12, 0.08);
  border-radius: 999px;
  overflow: hidden;
}

.upload-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e57324 0%, #bb3e03 100%);
  transition: width 120ms ease;
}

.upload-progress-label {
  display: block;
  margin-top: 8px;
  font-size: 0.82rem;
  color: var(--muted);
  text-align: center;
}

#upload-progress-wrap {
  width: 100%;
}

.upload-error-banner {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 14px;
  background: #fef2f2;
  border: 1px solid #fca5a5;
  border-radius: 8px;
  font-size: 0.85rem;
  color: #991b1b;
  line-height: 1.45;
}

.upload-error-banner span {
  flex: 1;
}

.upload-error-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 0 2px;
  cursor: pointer;
  font-size: 0.9rem;
  color: #b91c1c;
  line-height: 1;
  opacity: 0.7;
}

.upload-error-dismiss:hover {
  opacity: 1;
}

.progress-track {
  width: 100%;
  height: 10px;
  background: rgba(49, 32, 12, 0.08);
  border-radius: 999px;
  overflow: hidden;
  margin-top: 14px;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #e57324 0%, #bb3e03 100%);
  transition: width 260ms ease;
}

.progress-meta {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
}

.job-actions {
  margin-top: 10px;
  display: flex;
  gap: 14px;
  align-items: center;
}

.job-toggle {
  font-size: 0.76rem;
}

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

.job-details {
  margin-top: 4px;
}

.job-downloads {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.download-group {
  margin-top: 16px;
}

.download-group-label {
  color: var(--muted);
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-family: "IBM Plex Mono", monospace;
  margin-bottom: 10px;
}

.download-group-sample .download-group-label {
  color: #9a4b14;
}

.download-link,
.job-downloads a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-width: 140px;
  max-width: 100%;
  border-radius: 14px;
  padding: 10px 14px;
  border: 1px solid transparent;
  font-weight: 500;
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

.sample-download {
  background: var(--accent-soft);
  color: var(--accent-ink);
  border: 1px solid rgba(187, 62, 3, 0.16);
  box-shadow: 0 8px 24px rgba(187, 62, 3, 0.1);
}

.full-download {
  background: linear-gradient(135deg, #cc4d12 0%, #8e2c00 100%);
  color: #fffaf2;
  border: none;
  box-shadow: 0 10px 24px rgba(142, 44, 0, 0.18);
  font-weight: 700;
}

.sample-download:hover {
  background: #ffd0b5;
  border-color: rgba(187, 62, 3, 0.24);
}

.full-download:hover {
  background: linear-gradient(135deg, #d65618 0%, #9a3202 100%);
}

.unlock-panel {
  margin-top: 16px;
}

.unlock-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.unlock-button {
  min-width: 140px;
  max-width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: normal;
  text-align: center;
}

.payment-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.cards-icon {
  filter: saturate(1.05);
}

.paypal-icon {
  color: #00457c;
}

.ghost-button .paypal-icon {
  color: #0070ba;
}

.toast {
  position: fixed;
  right: 18px;
  bottom: 18px;
  max-width: min(420px, calc(100vw - 36px));
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(31, 27, 22, 0.92);
  color: #fffaf2;
  box-shadow: var(--shadow);
  font-size: 0.84rem;
  line-height: 1.5;
  z-index: 20;
  transition: opacity 0.2s ease;
}

.toast.error {
  /* Reset corner placement — errors appear centred on screen */
  right: auto;
  bottom: auto;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(480px, calc(100vw - 40px));
  max-width: none;

  padding: 28px 28px 24px;
  border-radius: 20px;

  background: rgba(42, 32, 24, 0.93);
  border: 1px solid rgba(180, 35, 24, 0.5);
  color: #fffaf2;
  cursor: pointer;

  box-shadow:
    0 0 0 9999px rgba(24, 18, 12, 0.55),  /* dim page behind */
    0 24px 60px rgba(0, 0, 0, 0.4);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(24, 18, 12, 0.5);
  backdrop-filter: blur(6px);
  z-index: 40;
}

.modal-card {
  width: min(460px, calc(100vw - 40px));
  border-radius: 24px;
  padding: 24px;
  background: var(--surface-strong);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.modal-text {
  margin-top: 14px;
  color: var(--muted);
  line-height: 1.7;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 22px;
}

.hidden {
  display: none !important;
}

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

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

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

@media (max-width: 960px) {
  .hero,
  .grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 640px) {
  .page-shell {
    width: min(100vw - 18px, 100%);
    padding-top: 14px;
  }

  .hero-copy,
  .panel,
  .status-card {
    padding: 18px;
    border-radius: 20px;
  }

  h1 {
    max-width: none;
  }

  .job-top,
  .progress-meta,
  .panel-head {
    display: grid;
  }

  .job-status {
    text-align: left;
    min-width: auto;
  }

  .job-card {
    padding: 16px;
    padding-right: 42px;
  }

  .job-summary {
    overflow-wrap: anywhere;
  }

  .job-badges {
    gap: 6px;
  }

  .job-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .job-downloads,
  .unlock-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .download-link,
  .job-downloads a,
  .unlock-button {
    min-width: 0;
    width: 100%;
  }

  .job-title {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .job-title-row {
    align-items: flex-start;
  }
}
