:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #172033;
  --muted: #5e6a7d;
  --line: #d9dee8;
  --accent: #0f766e;
  --accent-dark: #0b5f59;
  --danger: #b42318;
  --ok: #147d38;
  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);
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.toolbar,
.panel,
.status-grid > div {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 24px;
  line-height: 1.2;
}

h2 {
  font-size: 16px;
  line-height: 1.3;
}

p,
.metric-label,
#previewText {
  color: var(--muted);
}

.panel {
  padding: 18px;
  margin-bottom: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: 150px 1fr;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

label {
  font-weight: 700;
}

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

input {
  height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 84px;
  resize: vertical;
  padding: 10px 12px;
  line-height: 1.35;
}

select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

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

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  font-weight: 600;
  color: var(--text);
}

.check-row input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.domain-input {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 6px;
  overflow: hidden;
  background: #fff;
}

.domain-input input {
  border: 0;
  border-radius: 0;
}

.domain-input span {
  padding: 0 12px;
  color: var(--muted);
  white-space: nowrap;
  border-left: 1px solid var(--line);
}

.actions,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.inner-head {
  margin: 6px 0 14px;
}

.split-actions {
  justify-content: flex-start;
}

button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  color: #fff;
  background: var(--accent);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

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

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

.icon-button,
.small-button {
  min-width: 40px;
  padding: 0 12px;
}

.status-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.status-grid > div {
  padding: 16px;
}

.metric-label {
  display: block;
  font-size: 12px;
  margin-bottom: 6px;
}

.table-wrap {
  overflow-x: auto;
}

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

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  white-space: nowrap;
}

th {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

#logBox {
  min-height: 150px;
  max-height: 260px;
  overflow: auto;
  margin: 12px 0 0;
  padding: 12px;
  border-radius: 6px;
  background: #101828;
  color: #d7f8e9;
  font-size: 13px;
  line-height: 1.5;
}

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

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

@media (max-width: 720px) {
  .toolbar,
  .actions,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

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

  .domain-input {
    grid-template-columns: 1fr;
  }

  .domain-input span {
    height: 34px;
    display: flex;
    align-items: center;
    border-left: 0;
    border-top: 1px solid var(--line);
  }

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