:root {
  color-scheme: light;
  --bg: #f7f9fb;
  --surface: #ffffff;
  --surface-soft: #eef6f4;
  --border: #cfd8df;
  --text: #17212b;
  --muted: #596b7a;
  --primary: #007c89;
  --primary-dark: #005d66;
  --success: #227a45;
  --danger: #b42318;
  --warning: #9a5b00;
  --focus: #1a73e8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select,
input[type="checkbox"] {
  cursor: pointer;
}

button {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  color: var(--text);
  padding: 8px 12px;
  font-weight: 700;
}

button:hover {
  border-color: var(--primary);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 2px;
}

button.primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

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

button.secondary {
  background: #f4f7f8;
}

button.danger {
  border-color: #f3b8b3;
  color: var(--danger);
}

button.icon {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

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

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

label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: center;
  padding: 16px clamp(16px, 4vw, 40px);
  border-bottom: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.eyebrow {
  margin: 0 0 2px;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.header-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.layout {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(12px, 3vw, 28px) 48px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.tab {
  flex: 0 0 auto;
  min-width: 112px;
}

.tab.active {
  border-color: var(--primary);
  background: var(--surface-soft);
  color: var(--primary-dark);
}

.status {
  min-height: 48px;
  margin: 10px 0 14px;
  border-radius: 6px;
  padding: 10px 12px;
  background: #edf2f7;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.status:empty {
  display: none;
}

.status.success {
  background: #e8f5ed;
  color: var(--success);
}

.status.error {
  background: #fff1f0;
  color: var(--danger);
}

.status.warning {
  background: #fff6e5;
  color: var(--warning);
}

.status a {
  color: inherit;
  font-weight: 800;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin: 18px 0 10px;
}

.section-heading h2 {
  margin: 0;
  font-size: 1.15rem;
}

.item {
  margin: 10px 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  padding: 14px;
}

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

.item-title {
  margin: 0;
  font-size: 1rem;
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

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

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

.full {
  grid-column: 1 / -1;
}

.checkline {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 44px;
  color: var(--text);
}

.checkline input {
  width: 20px;
  min-height: 20px;
}

.paragraph {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #dce4e9;
  border-radius: 6px;
  background: #fbfcfd;
}

.warning-list {
  display: grid;
  gap: 8px;
}

.warning {
  border-left: 4px solid var(--warning);
  background: #fff6e5;
  color: #6f4200;
  padding: 10px 12px;
}

.banner-preview {
  border: 1px solid #f0c36a;
  border-radius: 8px;
  background: #fff7e0;
  color: #3d2b00;
  padding: 12px;
  font-weight: 800;
}

@media (max-width: 760px) {
  .topbar {
    align-items: stretch;
    flex-direction: column;
  }

  .header-actions {
    justify-content: stretch;
  }

  .header-actions button {
    flex: 1 1 130px;
  }

  .grid,
  .grid.three {
    grid-template-columns: 1fr;
  }

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