:root {
  --bg: #f5f8fc;
  --panel: #ffffff;
  --ink: #102033;
  --muted: #607083;
  --line: #d9e4f1;
  --blue: #1769e0;
  --green: #138a55;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  min-height: 72px;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark,
.logo {
  width: 38px;
  height: 38px;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

.layout {
  max-width: 1240px;
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(360px, 0.9fr);
  gap: 18px;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
}

.setup-panel,
.output-panel {
  grid-column: span 2;
}

.section-title {
  margin-bottom: 18px;
}

.section-title p {
  margin: 0 0 6px;
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
}

h1,
h2 {
  margin: 0;
}

h1 {
  font-size: 30px;
}

h2 {
  font-size: 22px;
}

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

label {
  color: var(--muted);
  font-size: 13px;
}

input,
select,
textarea {
  width: 100%;
  margin-top: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 11px 12px;
  color: var(--ink);
  font: inherit;
  background: #fff;
}

textarea {
  height: 250px;
  resize: vertical;
  font-family: Consolas, Monaco, monospace;
  font-size: 13px;
  line-height: 1.45;
}

.demand-form textarea {
  height: 112px;
}

.wide-field {
  grid-column: span 2;
}

button,
.secondary-link {
  border: 0;
  border-radius: 6px;
  padding: 11px 14px;
  background: var(--blue);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

button.secondary,
.secondary-link {
  background: #eaf1fb;
  color: var(--blue);
}

.secondary-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.demand-form button {
  align-self: end;
}

.demand-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.notice {
  display: none;
  margin-top: 12px;
  border: 1px solid #ccebdc;
  border-radius: 6px;
  background: #eaf8f1;
  color: var(--green);
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 700;
}

.notice.show {
  display: block;
}

.demand-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.demand-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.demand-item strong {
  font-size: 14px;
}

.demand-item code {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  background: #eaf8f1;
  color: var(--green);
}

.remove {
  background: #fff2f0;
  color: var(--danger);
  padding: 7px 9px;
}

.actions {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.version-panel {
  border-color: #9cc4ff;
  background: #f7fbff;
}

.version-copy {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

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

.report-grid div {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7fbff;
  padding: 14px;
}

.report-grid strong {
  display: block;
  color: var(--blue);
  font-size: 24px;
  margin-bottom: 5px;
}

.report-grid span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.report-note {
  margin: -4px 0 18px;
  color: var(--muted);
  font-size: 12px;
}

.partner-report {
  margin: 20px 0 14px;
}

.partner-report h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

.partner-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 620px;
  background: #fff;
}

.partner-table th,
.partner-table td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  font-size: 13px;
}

.partner-table th:first-child,
.partner-table td:first-child {
  text-align: left;
}

.partner-table th {
  color: var(--muted);
  background: #f7fbff;
  font-size: 11px;
  text-transform: uppercase;
}

.partner-table tr:last-child td {
  border-bottom: 0;
}

.slot-preview {
  width: 300px;
  height: 250px;
  background: #eef4fb;
  border: 1px dashed #9fb3cc;
  border-radius: 8px;
  display: grid;
  place-items: center;
  text-align: center;
  margin: 0 auto;
  position: relative;
}

.slot-preview .logo {
  position: absolute;
  top: 8px;
  left: 8px;
  width: 28px;
  height: 28px;
}

.slot-preview small {
  display: block;
  margin-top: 7px;
  color: var(--muted);
}

@media (max-width: 860px) {
  .layout,
  .form-grid,
  .demand-form {
    grid-template-columns: 1fr;
  }

  .setup-panel,
  .output-panel,
  .wide-field {
    grid-column: span 1;
  }

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