/* ============================================================
   Build version chip (header subtitle) + version modal
   ============================================================ */

/* Compact chip — placed in the header right under the tagline. Always
   visible regardless of login state. Click → opens the modal. */
#build-version-line {
  display: inline-block;
  margin: 0 0 0 0;
  padding: 0;
  font-size: 11px;
  font-family: ui-monospace, Menlo, monospace;
  color: rgba(255, 255, 255, 0.75);
  background: transparent;
  border: 0;
  cursor: pointer;
  text-decoration: none;
  line-height: 1.4;
  user-select: text;
  transition: color 0.15s, text-decoration-color 0.15s;
}

#build-version-line:hover,
#build-version-line:focus-visible {
  color: #fff;
  text-decoration: underline;
  outline: none;
}

#build-version-line[hidden] {
  display: none;
}

#build-version-line.is-loading {
  cursor: default;
  color: rgba(255, 255, 255, 0.5);
}

#build-version-line.is-loading:hover {
  text-decoration: none;
}

/* Tag shown next to the chip when the build is a local-dev placeholder
   (sha/branch resolved to "local-dev" because git was unavailable at
   build time). Renders a small pill so the user can tell at a glance. */
.build-version__dev-tag {
  display: inline-block;
  margin-left: 6px;
  padding: 0 6px;
  font-size: 9px;
  font-family: ui-monospace, Menlo, monospace;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  vertical-align: 1px;
}

/* ── Modal overlay ────────────────────────────────────────────── */
.version-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 300;
  padding: 16px;
  animation: version-fade 0.12s ease-out;
}

@keyframes version-fade {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.version-modal {
  background: var(--card-bg, #fff);
  color: var(--text, #1a1a1a);
  border-radius: var(--radius-lg, 18px);
  box-shadow: var(--shadow-lg, 0 8px 24px rgba(0, 0, 0, 0.2));
  width: 100%;
  max-width: 520px;
  max-height: calc(100vh - 32px);
  overflow: auto;
  padding: 20px 22px 18px;
  position: relative;
  animation: version-pop 0.14s ease-out;
}

@keyframes version-pop {
  from { transform: scale(0.96); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.version-modal__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: var(--text-soft, #6b6b6b);
  font-size: 22px;
  line-height: 1;
  border-radius: 8px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.version-modal__close:hover,
.version-modal__close:focus-visible {
  background: var(--accent-light, #fde6e9);
  color: var(--accent, #c8102e);
  outline: none;
}

.version-modal__title {
  font-size: 17px;
  font-weight: 600;
  margin: 0 0 14px;
  padding-right: 32px;
}

.version-modal__section {
  margin: 0 0 14px;
}

.version-modal__section-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-soft, #6b6b6b);
  margin: 0 0 6px;
}

.version-modal table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.version-modal table th,
.version-modal table td {
  text-align: left;
  vertical-align: top;
  padding: 5px 8px 5px 0;
  border-bottom: 1px solid var(--border, #e6e0dd);
}

.version-modal table tr:last-child th,
.version-modal table tr:last-child td {
  border-bottom: 0;
}

.version-modal table th {
  width: 110px;
  color: var(--text-soft, #6b6b6b);
  font-weight: 500;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
}

.version-modal table td {
  word-break: break-all;
  font-family: ui-monospace, Menlo, monospace;
  font-size: 12px;
}

.version-modal__section--empty td {
  color: var(--text-soft, #6b6b6b);
  font-style: italic;
  font-family: inherit;
  font-size: 13px;
}

.version-modal__copy {
  width: 100%;
  margin-top: 6px;
  padding: 10px 14px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  background: var(--accent, #c8102e);
  border: 0;
  border-radius: var(--radius, 12px);
  cursor: pointer;
  transition: background 0.15s;
}

.version-modal__copy:hover,
.version-modal__copy:focus-visible {
  background: var(--accent-dark, #8b0a1e);
  outline: none;
}

.version-modal__copy.is-copied {
  background: var(--success, #0a8a4a);
}

@media (max-width: 480px) {
  #build-version-line {
    display: block;
    margin-top: 2px;
  }

  .version-modal {
    padding: 16px 16px 14px;
  }

  .version-modal table th {
    width: 90px;
  }
}
