* {
  box-sizing: border-box;
}
body {
  font-family: system-ui, sans-serif;
  margin: 0;
  color: #1a1a1a;
  background: #fafaf7;
}
.wrap {
  max-width: 50rem;
  margin: 12vh auto;
  padding: 0 1rem;
}
h1 {
  font-size: 1.6rem;
}
form {
  display: grid;
  gap: 1rem;
  margin-top: 1.5rem;
}
form.inline-form {
  display: inline-block;
  margin-block-start: 0;
}
label {
  display: grid;
  gap: 0.35rem;
  font-size: 0.95rem;
}
label.check {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}
input[type="text"],
input[type="email"],
input:not([type]) {
  padding: 0.55rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 6px;
}
button {
  padding: 0.65rem 1.2rem;
  min-height: 44px;
  font-size: 1rem;
  border: 0;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff;
  cursor: pointer;
  width: fit-content;
  white-space: nowrap;
}
button.danger {
  background: #b3261e;
}
:focus-visible {
  outline: 2px solid #1a1a1a;
  outline-offset: 2px;
}
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.topbar h1 {
  margin: 0 0 1rem;
}
.app {
  display: grid;
  grid-template-columns: 8rem 1fr;
  gap: 1.5rem;
}
.side {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.side a {
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  color: #1a1a1a;
  text-decoration: none;
}
.side a:hover,
.side a[aria-current] {
  background: #f2f1ec;
}
.side a[aria-current] {
  font-weight: 600;
}
button.ghost {
  background: none;
  border: 1px solid #999;
  color: #1a1a1a;
  padding: 0.2rem 0.4rem;
  font-size: 0.8rem;
  min-height: 0;
}
.brand {
  margin: 0 0 1.5rem;
}
.brand a {
  font-weight: 600;
  color: #1a1a1a;
  text-decoration: none;
}
a.btn {
  display: inline-block;
  padding: 0.65rem 1.2rem;
  min-height: 44px;
  font-size: 1rem;
  border-radius: 6px;
  background: #1a1a1a;
  color: #fff;
  text-decoration: none;
}
a.btn:hover {
  color: #fff;
}
.alert {
  padding: 0.6rem 0.9rem;
  border-left: 3px solid #1a1a1a;
  background: #f2f1ec;
}
.alert[role="alert"] {
  border-left-color: #b3261e;
  background: #fdf0ef;
}
.card {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin-top: 1rem;
  background: #fff;
}
.chip {
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  border: 1px solid #ccc;
  border-radius: 999px;
  white-space: nowrap;
}
.badge {
  font-size: 0.8rem;
  color: #666;
}
.empty {
  color: #666;
}
.sites li {
  display: flex;
  flex-wrap: wrap;
  gap: 0.15rem 0.75rem;
  align-items: baseline;
}
.sites .live {
  word-break: break-all;
}
.err {
  color: #b3261e;
}
.ok {
  color: #1e7e34;
}
.muted {
  color: #666;
}
#substatus {
  margin: 0;
  min-height: 1.2em;
  font-size: 0.9rem;
}
/* Loading state */
body:has(.htmx-request) {
  cursor: progress;
  pointer-events: none;
}
button:disabled {
  opacity: 0.5;
  position: relative;
}
.htmx-request button:disabled::after {
  content: "";
  display: inline-block;
  width: 1ch;
  height: 1ch;
  margin-inline-start: 0.5ch;
  vertical-align: middle;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 1s ease-in-out infinite;
  -webkit-animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}
@-webkit-keyframes spin {
  to {
    -webkit-transform: rotate(360deg);
  }
}

/* Stage tabs — ordered progression, active underlined */
.tabs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.25rem;
  list-style: none;
  margin: 1.5rem 0 0;
  padding: 0;
  font-size: 0.95rem;
}
.tabs a[aria-current] {
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.3em;
}
.stage {
  margin-top: 1.5rem;
}
.stage h2 {
  font-size: 1.15rem;
}
.inline {
  display: inline;
}
.link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #15c;
  text-decoration: underline;
  cursor: pointer;
  min-height: 0;
}

/* Build-log disclosure — under the status card, outside its poll root */
.log-box {
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  margin-top: 1rem;
  background: #fff;
}
.log-box summary {
  cursor: pointer;
}
.log-box.failed {
  border-left: 3px solid #b3261e;
}
.log-box.failed summary {
  color: #b3261e;
  font-weight: 600;
}
pre.log {
  margin: 0.75rem 0;
  padding: 0.75rem;
  max-height: 60vh;
  overflow: auto;
  font-size: 0.8rem;
  line-height: 1.35;
  background: #f6f5f1;
  border-radius: 6px;
  white-space: pre-wrap;
  word-break: break-all;
}
