:root {
  color-scheme: light;
  --page: #f5f7fb;
  --surface: #ffffff;
  --ink: #172033;
  --muted: #647084;
  --line: #dce3ee;
  --accent: #1769e0;
  --accent-dark: #0f4fa8;
  --danger: #b42318;
  --success: #147a55;
  --shadow: 0 20px 50px rgba(23, 32, 51, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--page);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.5;
}

button,
input {
  font: inherit;
}

.shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 460px);
}

.intro {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 42px clamp(28px, 6vw, 76px);
}

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

.mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
}

.hero {
  max-width: 720px;
}

h1 {
  margin: 0;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1;
  letter-spacing: 0;
}

.lead {
  max-width: 620px;
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 19px;
}

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

.signal {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 16px;
}

.signal strong {
  display: block;
  margin-bottom: 6px;
}

.signal span {
  color: var(--muted);
  font-size: 14px;
}

.panel-wrap {
  display: flex;
  align-items: center;
  min-height: 100vh;
  padding: 28px;
  background: #eef2f7;
}

.panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: 28px;
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
}

h2 {
  margin: 0 0 6px;
  font-size: 24px;
  letter-spacing: 0;
}

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

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: #edf7f3;
  color: var(--success);
  font-size: 13px;
  font-weight: 800;
  white-space: nowrap;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 16px;
}

label {
  color: #394557;
  font-size: 14px;
  font-weight: 800;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 13px;
  background: #fff;
  color: var(--ink);
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(23, 105, 224, 0.18);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border: 0;
  border-radius: 6px;
  padding: 0 16px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

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

button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

button.secondary:hover {
  background: #f8fafc;
}

button.danger {
  background: var(--danger);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.session {
  display: none;
  margin-top: 24px;
  border-top: 1px solid var(--line);
  padding-top: 22px;
}

.session.visible {
  display: block;
}

.session-grid {
  display: grid;
  gap: 10px;
  margin: 16px 0 0;
}

.document-action {
  display: grid;
  gap: 16px;
  margin-top: 22px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  padding: 20px 0;
}

.document-action h3 {
  margin: 0 0 4px;
  font-size: 17px;
  letter-spacing: 0;
}

.inline-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.compact-field {
  margin: 0;
}

.inline-form button {
  min-height: 46px;
}

.row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.row span:first-child {
  color: var(--muted);
}

.message {
  min-height: 22px;
  margin-top: 16px;
  color: var(--muted);
  font-size: 14px;
}

.message.error {
  color: var(--danger);
  font-weight: 800;
}

.message.ok {
  color: var(--success);
  font-weight: 800;
}

pre {
  max-height: 220px;
  margin: 16px 0 0;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #101827;
  color: #d9e4f5;
  padding: 12px;
  font-size: 13px;
  white-space: pre-wrap;
}

@media (max-width: 880px) {
  .shell {
    grid-template-columns: 1fr;
  }

  .intro {
    min-height: auto;
    padding: 28px 20px 12px;
  }

  .panel-wrap {
    min-height: auto;
    padding: 20px;
  }

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

@media (max-width: 560px) {
  .inline-form {
    grid-template-columns: 1fr;
  }
}
