:root {
  color-scheme: light;
  --bg: #f7f8f5;
  --surface: #ffffff;
  --surface-muted: #eef2ec;
  --ink: #18211c;
  --muted: #5a665f;
  --line: #d9ded7;
  --accent: #19675d;
  --accent-strong: #124b44;
  --accent-soft: #dcefed;
  --danger-soft: #f8e5df;
  --danger: #8d3322;
  --shadow: 0 12px 36px rgba(24, 33, 28, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}

button {
  cursor: pointer;
  font: inherit;
}

.shell {
  width: min(1240px, calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0 40px;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 18px;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 8px 0 20px;
  border-bottom: 1px solid var(--line);
}

.eyebrow,
.label {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 3.25rem);
  line-height: 1;
}

h2 {
  font-size: 1.15rem;
  line-height: 1.25;
}

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

.primary-button,
.secondary-link {
  min-height: 44px;
  border-radius: 6px;
  padding: 0 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  text-decoration: none;
}

.primary-button {
  border: 0;
  background: var(--accent);
  color: #ffffff;
}

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

.secondary-link {
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--accent);
}

.secondary-link:hover {
  border-color: var(--accent);
  color: var(--accent-strong);
}

.status-panel {
  min-height: 74px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 20px;
  box-shadow: var(--shadow);
}

.status-panel p {
  margin: 0;
  color: var(--muted);
}

.status-panel.is-error {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.status-panel.is-error p {
  color: var(--danger);
  font-weight: 700;
}

.viewer-shell {
  min-height: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
}

.viewer-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-muted);
}

iframe {
  width: 100%;
  height: 100%;
  min-height: 520px;
  border: 0;
  background: #ffffff;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 720px) {
  .shell {
    width: min(100% - 24px, 1240px);
    padding: 20px 0 28px;
  }

  .topbar,
  .viewer-toolbar {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .actions {
    justify-content: flex-start;
  }

  .primary-button,
  .secondary-link {
    width: 100%;
  }

  .viewer-shell {
    grid-template-rows: auto minmax(460px, 1fr);
  }

  iframe {
    min-height: 460px;
  }
}
