:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --line: #d9dee3;
  --text: #172026;
  --muted: #63717c;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, "Segoe UI", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

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

.workspace {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: 22px;
  line-height: 1.25;
}

p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.status {
  min-width: 120px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-size: 14px;
  color: var(--muted);
  background: #fafafa;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 16px;
  padding: 20px;
}

textarea {
  width: 100%;
  min-height: 360px;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px;
  font: 14px/1.5 Consolas, "SFMono-Regular", monospace;
  color: var(--text);
}

textarea:focus {
  outline: 2px solid rgba(15, 118, 110, 0.18);
  border-color: var(--accent);
}

.side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button,
.download {
  width: 100%;
  min-height: 42px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

button:disabled,
.download.disabled {
  background: #e5e9ec;
  border-color: #d7dde2;
  color: #7b8790;
  cursor: not-allowed;
  pointer-events: none;
}

dl {
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
}

dl div {
  display: grid;
  grid-template-columns: 70px 1fr;
  border-bottom: 1px solid var(--line);
}

dl div:last-child {
  border-bottom: 0;
}

dt,
dd {
  margin: 0;
  padding: 10px;
  font-size: 14px;
}

dt {
  color: var(--muted);
  background: #f8fafb;
}

.log-wrap {
  border-top: 1px solid var(--line);
  background: #11171d;
  color: #e7edf2;
}

.log-title {
  padding: 10px 14px;
  border-bottom: 1px solid #26323b;
  color: #a9b6c0;
  font-size: 13px;
}

pre {
  margin: 0;
  min-height: 220px;
  max-height: 420px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
  font: 13px/1.45 Consolas, "SFMono-Regular", monospace;
}

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

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

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .status {
    width: 100%;
  }
}
