:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --panel: #ffffff;
  --text: #1f2933;
  --muted: #61717d;
  --line: #d7dee3;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #9f1239;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 28px;
}

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

h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0 0 6px;
}

h2 {
  font-size: 15px;
  margin: 0 0 12px;
}

p {
  color: var(--muted);
  margin: 0;
}

.workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 20px;
  padding-top: 22px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

label span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
}

input,
select,
textarea {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}

textarea {
  min-height: 92px;
  resize: vertical;
}

.nits-row {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding-top: 18px;
}

.toggle {
  align-items: center;
  display: flex;
  gap: 10px;
}

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

.toggle span {
  color: var(--text);
  font-size: 14px;
  margin: 0;
  text-transform: none;
}

button,
.file-button {
  align-items: center;
  background: var(--accent);
  border: 0;
  border-radius: 6px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-weight: 700;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
}

button {
  width: 100%;
}

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

.actions {
  display: grid;
  gap: 12px;
  grid-template-columns: 220px 1fr;
  margin-top: 18px;
}

.secondary-button {
  background: #ffffff;
  border: 1px solid var(--accent);
  color: var(--accent-dark);
}

.secondary-button:hover {
  background: #e7f3f1;
}

.file-button input {
  display: none;
}

.file-button span {
  color: #fff;
  font-size: 14px;
  margin: 0;
  text-transform: none;
}

dl {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 8px 10px;
  margin: 0 0 22px;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.result-box {
  border: 1px dashed var(--line);
  border-radius: 6px;
  color: var(--muted);
  padding: 14px;
}

.result-box a {
  color: var(--accent-dark);
  display: block;
  font-weight: 700;
  margin-top: 8px;
}

.preview-table {
  border-collapse: collapse;
  font-size: 12px;
  margin-top: 10px;
  width: 100%;
}

.preview-table th,
.preview-table td {
  border-bottom: 1px solid var(--line);
  padding: 7px 6px;
  text-align: left;
  vertical-align: top;
}

.preview-table th:nth-child(4),
.preview-table th:nth-child(5),
.preview-table td:nth-child(4),
.preview-table td:nth-child(5) {
  text-align: right;
}

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

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

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

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

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