:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --panel: #ffffff;
  --text: #151922;
  --muted: #637083;
  --line: #d9e0ea;
  --accent: #146c5f;
  --accent-strong: #0f5148;
  --danger: #b42318;
  --ok: #166534;
  --warn: #9a6700;
}

* {
  box-sizing: border-box;
}

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

.shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.panel {
  width: min(980px, 100%);
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 28px;
  box-shadow: 0 18px 46px rgba(20, 28, 40, 0.08);
}

.copy {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 28px;
  border-right: 1px solid var(--line);
  padding-right: 28px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 32px;
  line-height: 1.18;
  letter-spacing: 0;
}

.lead {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.6;
}

.rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  color: var(--muted);
  font-size: 13px;
}

.digest-preview {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fbfdfc;
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.preview-head strong {
  color: var(--accent);
}

.digest-preview table {
  width: 100%;
  border-collapse: collapse;
}

.digest-preview th,
.digest-preview td {
  padding: 9px 12px;
  border-bottom: 1px solid #edf1f4;
  text-align: left;
  font-size: 14px;
}

.digest-preview th {
  color: var(--muted);
  font-weight: 700;
  background: #f6faf9;
}

.digest-preview tr:last-child td {
  border-bottom: 0;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

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

::placeholder {
  color: #98a3b0;
}

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

input:focus,
textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(20, 108, 95, 0.13);
}

.consent {
  display: grid;
  grid-template-columns: 18px 1fr;
  gap: 10px;
  align-items: start;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

.trap {
  display: none !important;
  position: absolute !important;
  left: -10000px !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

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

button {
  border: 0;
  border-radius: 7px;
  background: var(--accent);
  color: #fff;
  padding: 12px 18px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  min-width: 112px;
}

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

button:disabled {
  background: #9aa7b6;
  cursor: not-allowed;
}

.status {
  margin: 0;
  min-height: 22px;
  color: var(--muted);
  font-size: 14px;
}

.status[data-tone="ok"] {
  color: var(--ok);
}

.status[data-tone="danger"] {
  color: var(--danger);
}

.status[data-tone="warn"] {
  color: var(--warn);
}

@media (max-width: 780px) {
  .shell {
    align-items: stretch;
    padding: 14px;
  }

  .panel {
    grid-template-columns: 1fr;
    padding: 20px;
    gap: 22px;
  }

  .copy {
    border-right: 0;
    border-bottom: 1px solid var(--line);
    padding-right: 0;
    padding-bottom: 20px;
  }

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

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

  button {
    width: 100%;
  }
}
