:root {
  color-scheme: light;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: #17212b;
  background: #dce3e9;
  --ink: #17212b;
  --muted: #586674;
  --line: #d3dbe2;
  --panel: #f8fafb;
  --accent: #275d7a;
  --accent-dark: #174257;
  --ok: #176b48;
  --warn: #9a6413;
  --danger: #a03a36;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
}

body {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  border: 0;
  border-radius: 7px;
  padding: 0.65rem 0.85rem;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
}

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

button:focus-visible,
input:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(39, 93, 122, 0.28);
  outline-offset: 2px;
}

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

.app-shell {
  display: grid;
  grid-template-columns: minmax(620px, 1fr) minmax(390px, 440px);
  width: 100vw;
  height: 100vh;
}

.viewer-region,
#adobe-dc-view {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: #edf1f4;
}

.viewer-placeholder {
  display: grid;
  place-content: center;
  height: 100%;
  max-width: 650px;
  margin: 0 auto;
  padding: 3rem;
  text-align: center;
}

.viewer-placeholder h1 {
  margin: 0.35rem 0 0.75rem;
  font-size: clamp(1.8rem, 3vw, 3.2rem);
  line-height: 1.05;
}

.viewer-placeholder p:last-child {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.diagnostics {
  overflow-y: auto;
  padding: 1.1rem;
  border-left: 1px solid #c6d0d8;
  background: var(--panel);
}

.panel-header,
.section-heading-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.panel-header h2,
.section-heading-row h3 {
  margin: 0;
}

.eyebrow {
  margin: 0;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.result-badge {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 0.32rem 0.62rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.06em;
}

.result-pending {
  color: #6f4b0d;
  background: #f8e6bd;
}

.result-pass {
  color: #fff;
  background: var(--ok);
}

.result-partial {
  color: #fff;
  background: var(--warn);
}

.result-fail {
  color: #fff;
  background: var(--danger);
}

.context-card,
.configuration,
.diagnostics > section,
details {
  margin-top: 1rem;
}

.context-card {
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0.75rem;
  background: #fff;
}

.context-card dl,
.diagnostic-grid {
  margin: 0;
}

.context-card dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.context-card dt,
.diagnostic-grid dt {
  color: var(--muted);
  font-size: 0.69rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.context-card dd,
.diagnostic-grid dd {
  margin: 0.18rem 0 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.78rem;
}

h3 {
  margin: 0 0 0.55rem;
  font-size: 0.92rem;
}

label {
  display: block;
  margin-bottom: 0.35rem;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.45rem;
}

input {
  min-width: 0;
  border: 1px solid #aebac4;
  border-radius: 7px;
  padding: 0.62rem 0.7rem;
  background: #fff;
}

.help-text,
.status-message {
  margin: 0.45rem 0 0;
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.45;
}

.status-message {
  border-left: 3px solid var(--accent);
  padding-left: 0.55rem;
}

.button-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

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

.diagnostic-grid > div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 0.55rem;
  background: #fff;
}

.diagnostic-grid .wide {
  grid-column: 1 / -1;
}

details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

summary {
  cursor: pointer;
  padding: 0.65rem 0.75rem;
  font-size: 0.78rem;
  font-weight: 750;
}

pre {
  max-height: 300px;
  margin: 0;
  overflow: auto;
  border-top: 1px solid var(--line);
  padding: 0.75rem;
  color: #263846;
  background: #f3f6f8;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.quiet-button {
  padding: 0.35rem 0.55rem;
  color: var(--accent);
  background: transparent;
  font-size: 0.74rem;
}

.event-log {
  max-height: 230px;
  margin: 0.5rem 0 0;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.45rem 0.45rem 0.45rem 2rem;
  background: #fff;
  font: 0.72rem/1.45 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

.event-log li {
  padding: 0.25rem 0.15rem;
  border-bottom: 1px solid #edf1f4;
}

.event-log li:last-child {
  border-bottom: 0;
}

code {
  border-radius: 4px;
  padding: 0.08rem 0.25rem;
  background: #e7edf1;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
}

@media (max-width: 980px) {
  body {
    overflow: auto;
  }

  .app-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .viewer-region,
  #adobe-dc-view {
    height: 72vh;
  }

  .diagnostics {
    overflow: visible;
    border-top: 1px solid #c6d0d8;
    border-left: 0;
  }
}
