:root {
  color-scheme: light;
  --ink: #1b1d22;
  --muted: #626a73;
  --line: #d9dde3;
  --paper: #f6f7f9;
  --panel: #ffffff;
  --accent: #1f6feb;
  --accent-dark: #174ea6;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  padding: 20px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}

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

h1 {
  font-size: 28px;
  line-height: 1.1;
}

h2 {
  font-size: 18px;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

.eyebrow {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.subhead {
  margin-top: 6px;
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: 260px minmax(360px, 1fr) 320px;
  gap: 16px;
  padding: 16px;
}

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

.panel {
  padding: 14px;
}

.document-buttons {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.doc-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 48px;
  padding: 8px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: left;
  font: inherit;
}

.doc-button.active {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

.doc-number {
  font-weight: 700;
}

.viewer-panel {
  overflow: hidden;
}

.viewer-header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

iframe {
  display: block;
  width: 100%;
  height: calc(100vh - 142px);
  min-height: 640px;
  border: 0;
  background: #f0f2f5;
}

label {
  display: grid;
  gap: 5px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

input,
textarea {
  width: 100%;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 14px/1.35 Arial, Helvetica, sans-serif;
}

textarea {
  resize: vertical;
}

.actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

button,
.button,
.manifest-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 38px;
  padding: 8px 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-decoration: none;
  font: 700 13px/1.2 Arial, Helvetica, sans-serif;
}

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

.primary:active,
.primary:hover {
  background: var(--accent-dark);
}

.summary {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

pre {
  overflow: auto;
  min-height: 160px;
  max-height: 260px;
  margin: 0;
  padding: 10px;
  white-space: pre-wrap;
  background: #f8f9fb;
  border: 1px solid var(--line);
  border-radius: 6px;
  font: 12px/1.4 Consolas, monospace;
}

footer {
  padding: 12px 16px 20px;
  color: var(--muted);
  font-size: 12px;
}

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

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

  iframe {
    height: 62vh;
    min-height: 520px;
  }
}

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

  .document-buttons,
  .actions {
    grid-template-columns: 1fr;
  }
}
