:root {
  color-scheme: dark;
  --bg: #0f1115;
  --card: #171a21;
  --border: #2c3443;
  --text: #eef2ff;
  --muted: #a9b3c9;
  --accent: #4f8cff;
  --accent-hover: #3d79ea;
}
body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
}
.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 20px 48px;
}

h1 {
  margin: 0 0 8px;
  font-size: 32px;
  line-height: 1.15;
}
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  margin-top: 18px;
}
.tips ul {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.tips li + li {
  margin-top: 8px;
}
.subhead {
  color: var(--muted);
}
.startup-note {
  border-left: 4px solid var(--accent);
}
.startup-note ol {
  margin: 10px 0 0;
  padding-left: 20px;
  color: var(--muted);
}
.startup-note li + li {
  margin-top: 8px;
}
.startup-note code {
  background: #0c0e13;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 2px 6px;
  color: var(--text);
}
label, h2 {
  display: block;
  font-weight: 700;
  margin-bottom: 12px;
}
textarea, pre, input {
  width: 100%;
  box-sizing: border-box;
  background: #0c0e13;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
}
textarea { resize: vertical; }
pre {
  min-height: 220px;
  white-space: pre-wrap;
  word-break: break-word;
}
.actions {
  display: flex;
  gap: 12px;
  margin-top: 14px;
  flex-wrap: wrap;
  align-items: center;
}
.field-grid {
  display: grid;
  grid-template-columns: minmax(240px, 320px);
  gap: 16px;
  margin-bottom: 16px;
}
.field-grid.two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.hint {
  margin: -2px 0 0;
  color: var(--muted);
  font-size: 13px;
}
.blog-load-status {
  margin-top: 12px;
}
.replace-grid {
  margin-top: 14px;
}
button,
.file-button {
  background: var(--accent);
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 10px 14px;
  min-height: 42px;
  font-size: 14px;
  line-height: 1;
  font-family: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
}
button:hover,
.file-button:hover { background: var(--accent-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }
button.secondary,
.file-button.secondary {
  background: transparent;
  border: 1px solid var(--border);
}
button.secondary:hover,
.file-button.secondary:hover {
  background: #1f2430;
}
.hero-actions {
  gap: 16px;
}
/* The upload control is a <label>, which otherwise picks up the label margin and
   content-box sizing, so pin both buttons to the same box. */
.hero-actions > button,
.hero-actions > .file-button {
  box-sizing: border-box;
  width: 230px;
  height: 46px;
  margin: 0;
  text-align: center;
}
select {
  width: 100%;
  box-sizing: border-box;
  background: #0c0e13;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
  appearance: none;
  cursor: pointer;
}
select:focus,
textarea:focus,
input:focus {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
/* Off-screen phone-width render the mobile check measures. */
.mobile-frame {
  position: absolute;
  left: -10000px;
  top: 0;
  width: 375px;
  height: 640px;
  border: 0;
}
.mobile-issues {
  margin: 0 0 12px;
  padding-left: 20px;
}
.mobile-issues:empty {
  display: none;
}
.mobile-summary-ok {
  color: #3fb950;
}
.mobile-summary-fail {
  color: #f85149;
}
button[aria-pressed="true"] {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}
.replace-btn {
  background: #e05d44;
}
.replace-btn:hover:not(:disabled) {
  background: #c74a34;
}
.replace-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

@media (max-width: 760px) {
  .field-grid.two-columns {
    grid-template-columns: 1fr;
  }

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

  button,
  .file-button {
    justify-content: center;
  }
}

.result-banner {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  border-left-width: 6px;
  background: #0c0e13;
}
.result-banner strong { display: block; font-size: 16px; }
.result-banner p { margin: 6px 0 0; color: var(--muted); font-size: 14px; white-space: pre-line; }
.result-banner.working { border-left-color: var(--accent); }
.result-banner.success { border-left-color: #2fbf71; background: #0f2219; }
.result-banner.success strong { color: #5fe39a; }
.result-banner.warning { border-left-color: #e0a526; background: #241d0c; }
.result-banner.warning strong { color: #f3c55b; }
.result-banner.error { border-left-color: #e5484d; background: #2a1012; }
.result-banner.error strong { color: #ff7b80; }
