:root {
  color-scheme: light;
  --bg: #f4f6f8;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #5d6875;
  --line: #d9e0e7;
  --accent: #1769aa;
  --accent-strong: #0f4f83;
  --focus: #f4c542;
  --good: #146c43;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
}

.app-shell {
  width: 100%;
  min-height: 100vh;
  padding: 28px;
}

.workspace {
  max-width: 1120px;
  margin: 0 auto;
}

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 0 0 18px;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.15;
  letter-spacing: 0;
}

.topbar p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 15px;
}

.status-pill {
  min-width: 108px;
  text-align: center;
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 999px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--muted);
}

.status-pill.busy {
  color: #6f4e00;
  border-color: #e3c56d;
  background: #fff8df;
}

.status-pill.done {
  color: var(--good);
  border-color: #a5d6b8;
  background: #effaf3;
}

.status-pill.error {
  color: #9d1c1c;
  border-color: #e4a6a6;
  background: #fff0f0;
}

.editor,
.result-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px;
  box-shadow: 0 10px 28px rgba(27, 39, 51, 0.06);
}

.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

label {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

label span {
  font-size: 13px;
  font-weight: 700;
  color: #2b3744;
}

label em {
  color: var(--muted);
  font-style: normal;
  font-weight: 500;
}

input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 13px;
  font: inherit;
  color: var(--text);
  background: #fff;
  outline: none;
}

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(23, 105, 170, 0.14);
}

.jd-field {
  margin-bottom: 18px;
}

textarea {
  min-height: 420px;
  resize: vertical;
  line-height: 1.48;
}

.actions {
  display: flex;
  gap: 12px;
  align-items: center;
}

button,
.download {
  appearance: none;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 11px 16px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
}

button,
.download.primary {
  background: var(--accent);
  color: #fff;
}

button:hover,
.download.primary:hover {
  background: var(--accent-strong);
}

button.secondary,
.download {
  background: #fff;
  color: var(--accent);
}

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

.result-panel {
  margin-top: 18px;
}

.result-panel h2 {
  margin: 0;
  font-size: 19px;
}

.result-panel p {
  margin: 7px 0 16px;
  color: var(--muted);
}

.download-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

@media (max-width: 720px) {
  .app-shell {
    padding: 18px;
  }

  .topbar,
  .field-grid {
    display: grid;
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 330px;
  }

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

  button,
  .download {
    width: 100%;
    text-align: center;
  }
}
