:root {
  color-scheme: light;
  --bg: #f5f7f6;
  --panel: #ffffff;
  --ink: #1f2933;
  --muted: #667085;
  --line: #d7dedb;
  --accent: #0f766e;
  --accent-dark: #115e59;
  --soft: #e8f4f1;
  --warn: #fff4e5;
  --danger: #b42318;
  --ok: #047857;
  font-family: Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.75;
}

a {
  color: var(--accent-dark);
}

.page {
  width: min(100%, 940px);
  margin: 0 auto;
  padding: 20px;
}

.embed-page {
  width: 100%;
  max-width: 680px;
  padding: 14px;
}

.hero,
.panel,
.card,
.notice {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.hero {
  padding: 22px;
  margin-bottom: 16px;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(1.45rem, 4vw, 2.1rem);
  line-height: 1.35;
  margin-bottom: 10px;
}

h2 {
  font-size: 1.1rem;
}

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

.notice {
  padding: 14px;
  background: var(--soft);
}

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

.field {
  display: grid;
  gap: 6px;
}

label {
  font-weight: 700;
}

input,
select,
button {
  width: 100%;
  min-height: 46px;
  border-radius: 8px;
  font: inherit;
}

input,
select {
  border: 1px solid var(--line);
  background: #fff;
  padding: 10px 12px;
  color: var(--ink);
}

input:focus,
select:focus,
button:focus {
  outline: 3px solid rgba(15, 118, 110, 0.2);
  outline-offset: 2px;
}

.check-row {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 10px;
  align-items: start;
}

.check-row input {
  width: 20px;
  min-height: 20px;
  margin-top: 6px;
}

button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

.message {
  display: none;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--line);
}

.message.is-visible {
  display: block;
}

.message.success {
  background: #ecfdf3;
  color: var(--ok);
}

.message.error {
  background: #fef3f2;
  color: var(--danger);
}

.grid {
  display: grid;
  gap: 12px;
}

.cards {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card,
.panel {
  padding: 16px;
}

.card ul {
  padding-inline-start: 22px;
  margin: 0;
}

.footer-note {
  margin-top: 18px;
  padding: 14px 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.toolbar {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
  align-items: end;
}

.stats {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  margin: 14px 0;
}

.stat strong {
  display: block;
  font-size: 1.5rem;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1040px;
}

th,
td {
  padding: 10px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

th {
  background: #eef3f1;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--soft);
  white-space: nowrap;
}

.badge.issue {
  background: var(--warn);
  color: #92400e;
}

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

.actions button {
  width: auto;
  min-height: 36px;
  padding: 6px 10px;
}

.message-preview-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf9;
  color: var(--ink);
  font: inherit;
  line-height: 1.8;
}

@media (max-width: 540px) {
  .page {
    padding: 14px;
  }

  .hero,
  .panel,
  .card {
    padding: 14px;
  }
}
