:root {
  color-scheme: light;
  font-family: "Segoe UI", Arial, sans-serif;
  --blue: #5294EB;
  --blue-dark: #247AC5;
  --ink: #252d42;
  --muted: #526278;
  --line: #e1ebf8;
  --surface: #fdfcfc;
  --page: #f4f7ff;
  --soft-blue: #e1ebf8;
  --success: #247AC5;
  --warning: #252D42;
}

* {
  box-sizing: border-box;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background: var(--page);
  color: var(--ink);
}

button {
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
}

.app-shell {
  width: min(980px, calc(100% - 40px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 30px 0;
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.masthead {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  align-items: start;
  gap: 28px;
}

.brand-column {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
}

.onterris-logo {
  width: 144px;
  height: auto;
  margin-top: 8px;
}

.sentinel-logo {
  width: 170px;
  height: auto;
  display: block;
  background: var(--page);
}

.title-block {
  min-height: 226px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.title-copy {
  margin-top: 14px;
}

h1 {
  margin: 0;
  font-size: clamp(2.7rem, 7vw, 5.25rem);
  line-height: 0.98;
  letter-spacing: 0;
}

.initiative,
.developer {
  margin: 0;
}

.initiative {
  padding-top: 12px;
  font-size: clamp(1rem, 2.2vw, 1.35rem);
  color: var(--ink);
}

.developer {
  padding-top: 6px;
  font-size: clamp(0.82rem, 1.7vw, 0.98rem);
  color: var(--muted);
}

.cloud-panel {
  display: grid;
  gap: 16px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgb(38 54 88 / 10%);
}

.cloud-row {
  display: grid;
  grid-template-columns: minmax(190px, 0.95fr) minmax(220px, 1.25fr) auto;
  align-items: center;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

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

label {
  display: block;
  font-size: 1.05rem;
  font-weight: 700;
}

.cloud-row p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.35;
}

output {
  min-height: 42px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

output.selected {
  color: var(--ink);
  border-color: var(--blue);
  background: var(--page);
}

.cloud-button {
  min-width: 136px;
  padding: 11px 16px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-weight: 700;
}

.cloud-button.secondary {
  min-width: 104px;
  background: var(--surface);
  border: 1px solid var(--line);
}

.button-group {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.cloud-button:hover:not(:disabled) {
  background: var(--page);
}

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

.cloud-badge {
  min-width: 136px;
  padding: 11px 16px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-weight: 700;
  text-align: center;
}

.results-panel {
  display: grid;
  gap: 14px;
  padding: 20px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 18px 50px rgb(38 54 88 / 8%);
}

.results-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.results-heading h2 {
  margin: 0;
  font-size: 1.08rem;
}

#results-count {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 700;
}

.results-list {
  display: grid;
  gap: 10px;
}

.results-list p {
  margin: 0;
  color: var(--muted);
}

.result-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--page);
}

.result-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.result-meta {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.result-status {
  padding: 7px 10px;
  border-radius: 8px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 0.82rem;
  font-weight: 800;
  white-space: nowrap;
}

.result-status.warning {
  background: #fff5d9;
  color: var(--warning);
}

.action-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

#status {
  margin: 0;
  color: var(--muted);
}

#status.ready {
  color: var(--success);
}

#status.warning {
  color: var(--warning);
}

#inspect-button {
  min-width: 145px;
  padding: 15px 28px;
  background: var(--blue);
  color: var(--surface);
  font-size: 1.08rem;
  font-weight: 800;
}

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

#auth-button,
#draft-button {
  min-width: 190px;
  padding: 15px 22px;
  background: var(--soft-blue);
  color: var(--blue-dark);
  font-size: 1.02rem;
  font-weight: 800;
}

#inspect-button:hover,
#auth-button:hover:not(:disabled),
#draft-button:hover:not(:disabled) {
  background: var(--blue-dark);
}

#auth-button:hover:not(:disabled),
#draft-button:hover:not(:disabled) {
  color: var(--surface);
}

#auth-button:disabled,
#draft-button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

@media (max-width: 780px) {
  .app-shell {
    width: min(100% - 28px, 980px);
    padding: 22px 0;
  }

  .masthead {
    grid-template-columns: 1fr;
    justify-items: center;
  }

  .brand-column {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
  }

  .onterris-logo {
    justify-self: start;
  }

  .sentinel-logo {
    width: min(132px, 34vw);
  }

  .title-block {
    min-height: auto;
  }

  .title-copy {
    margin-top: 0;
  }

  .cloud-row {
    grid-template-columns: 1fr;
  }

  .button-group,
  .action-buttons,
  .cloud-button,
  #auth-button,
  #inspect-button,
  #draft-button {
    width: 100%;
  }

  .button-group,
  .action-buttons {
    flex-direction: column;
  }

  .result-item,
  .results-heading {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .results-heading {
    display: grid;
  }

  .result-status {
    width: fit-content;
  }

  .action-bar {
    align-items: stretch;
    flex-direction: column;
  }
}
