:root {
  color-scheme: light;
  --page: #f4f6f8;
  --panel: #ffffff;
  --text: #16202a;
  --muted: #667380;
  --line: #d9e0e7;
  --accent: #2474a6;
  --accent-dark: #165a84;
  --danger-bg: #fff0f0;
  --danger: #9b1c1c;
  --ok-bg: #edf8f2;
  --ok: #146c43;
  --shadow: 0 1px 2px rgba(13, 31, 45, 0.08);
}

* {
  box-sizing: border-box;
}

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

.app-shell {
  width: min(1220px, calc(100% - 32px));
  margin: 24px auto 40px;
}

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

h1,
h2,
p {
  margin: 0;
}

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

h2 {
  font-size: 17px;
}

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

.status-pill {
  border: 1px solid var(--line);
  background: #eef3f7;
  padding: 8px 12px;
  font-size: 13px;
}

.module-form {
  display: grid;
  gap: 14px;
}

.panel,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  padding: 16px;
}

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

.grid-three {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: var(--muted);
}

input,
select,
textarea {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  padding: 8px 10px;
  font: inherit;
}

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

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(36, 116, 166, 0.2);
  border-color: var(--accent);
}

.switch {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

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

.section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.field-table {
  display: grid;
  gap: 8px;
}

.field-head,
.field-row {
  display: grid;
  grid-template-columns: 1.1fr 1.1fr 0.95fr 1.35fr 0.8fr 42px;
  gap: 8px;
  align-items: center;
}

.field-head {
  color: var(--muted);
  font-size: 12px;
  padding: 0 2px;
}

.field-row {
  border: 1px solid var(--line);
  background: #fbfcfd;
  padding: 8px;
}

.checks {
  display: grid;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
}

.checks label {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--text);
}

.checks input {
  width: 16px;
  min-height: 16px;
}

.actions {
  display: flex;
  justify-content: flex-end;
}

button,
.download-button {
  border: 0;
  cursor: pointer;
  font: inherit;
  text-decoration: none;
}

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

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

.secondary-button {
  border: 1px solid var(--line);
  background: #eef3f7;
  color: var(--text);
  padding: 8px 12px;
}

.icon-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--danger);
}

.notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.notice-error {
  background: var(--danger-bg);
  color: var(--danger);
  border-color: #f2c4c4;
}

.notice-ok {
  background: var(--ok-bg);
  color: var(--ok);
  border-color: #bfe8cf;
}

@media (max-width: 900px) {
  .grid-two,
  .grid-three,
  .field-head,
  .field-row {
    grid-template-columns: 1fr;
  }

  .field-head {
    display: none;
  }

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

