html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}

/* Sidebar layout */
.app-shell {
  display: flex;
  min-height: calc(100vh - 60px);
}

.sidebar {
  flex: 0 0 220px;
  background: #f6f7f9;
  border-right: 1px solid #e3e6ea;
  padding: 1.25rem 0.75rem;
}

.sidebar-brand {
  font-weight: 600;
  font-size: 1.15rem;
  padding: 0.25rem 0.75rem 1rem;
  color: #1f2937;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 0.125rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  border-radius: 6px;
  color: #1f2937;
  text-decoration: none;
  font-size: 0.95rem;
}

.sidebar-link:hover,
.sidebar-link:focus {
  background: #e8ecf1;
  color: #111827;
}

.sidebar-link .external-icon {
  opacity: 0.6;
  flex-shrink: 0;
}

.app-main-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.app-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 0.75rem 2rem;
  border-bottom: 1px solid #e3e6ea;
  background: #fff;
}

.app-main {
  flex: 1;
  padding: 1.5rem 2rem;
  min-width: 0;
}

.app-main--full {
  display: block;
  max-width: 60rem;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

.callback-preview {
  background: #f8fafc;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 1rem;
  position: sticky;
  top: 1rem;
}

.callback-preview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.callback-preview-body {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  font-size: 0.85rem;
  margin: 0;
  overflow-x: auto;
}

.callback-preview-body code {
  color: inherit;
  background: transparent;
  padding: 0;
}

/* Spec page (rendered HTML fragment from .docx) */
.spec-doc {
  max-width: 60rem;
  line-height: 1.55;
  color: #1f2937;
}
.spec-doc h1 {
  font-size: 1.6rem;
  margin-top: 2rem;
  padding-top: 0.5rem;
  border-top: 1px solid #e3e6ea;
}
.spec-doc h1:first-of-type { border-top: 0; padding-top: 0; }
.spec-doc h2 { font-size: 1.25rem; margin-top: 1.5rem; }
.spec-doc h3 { font-size: 1.05rem; margin-top: 1.25rem; }
.spec-doc table {
  width: 100% !important;
  border-collapse: collapse;
  margin: 1rem 0;
  font-size: 0.92rem;
}
.spec-doc th, .spec-doc td {
  border: 1px solid #e3e6ea;
  padding: 0.45rem 0.6rem;
  vertical-align: top;
  text-align: left;
}
.spec-doc th { background: #f6f7f9; }
.spec-doc code {
  background: #f1f5f9;
  color: #1e293b;
  padding: 0.1em 0.35em;
  border-radius: 4px;
  font-size: 0.9em;
}
.spec-doc pre, .spec-doc div.sourceCode {
  background: #0f172a;
  color: #e2e8f0;
  padding: 0.85rem 1rem;
  border-radius: 6px;
  overflow-x: auto;
  font-size: 0.85rem;
}
.spec-doc pre code, .spec-doc div.sourceCode code {
  background: transparent;
  color: inherit;
  padding: 0;
}
.spec-doc img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1rem auto;
}
.spec-doc nav#TOC {
  background: #f6f7f9;
  border: 1px solid #e3e6ea;
  border-radius: 8px;
  padding: 1rem 1.25rem;
  margin: 1rem 0 1.5rem;
}
.spec-doc nav#TOC ul { padding-left: 1.25rem; }
.spec-doc nav#TOC > ul { padding-left: 0; list-style: none; }