/*
 * TwistedPad base.css — the small slice of Bootstrap 5.3.8 the site pages actually use.
 *
 * Bootstrap's CSS (232KB, render-blocking) is now loaded ONLY on the editor (/editor/).
 * Every other page (header.php + header_admin.php) loads this file before app.css instead.
 *
 * How this was built: a headless-Chrome pass over every page (logged out / free / pro / admin,
 * 1366px + 375px) collected every class in the DOM after JS ran and every Bootstrap rule whose
 * selector matched something. This file re-implements exactly those rules, with Bootstrap's
 * --bs-* variables resolved to their literal values, and was checked against screenshots and
 * computed styles (including :hover/:focus/:active/:disabled states) of the Bootstrap version.
 *
 * Rules app.css already fully overrides (a, .container, .text-danger, .text-muted, .small, ...)
 * are left out. Values here are Bootstrap's defaults on purpose: app.css loads afterwards and
 * styles on top, exactly as it did over Bootstrap.
 *
 * Need another Bootstrap class on a non-editor page? Add it here (copy the value from
 * bootstrap.css 5.3.8) rather than bringing the whole framework back.
 */

/* ===== Reboot (element defaults) ===== */
*, ::before, ::after { box-sizing: border-box; }

@media (prefers-reduced-motion: no-preference) {
  :root { scroll-behavior: smooth; }
}

body {
  margin: 0;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  margin-top: 0;
  margin-bottom: .5rem;
  font-weight: 500;
  line-height: 1.2;
  color: inherit;
}
/* Fluid heading sizes; fixed from 1200px up */
h1, .h1 { font-size: calc(1.375rem + 1.5vw); }
h2, .h2 { font-size: calc(1.325rem + .9vw); }
h3, .h3 { font-size: calc(1.3rem + .6vw); }
h4, .h4 { font-size: calc(1.275rem + .3vw); }
h5, .h5 { font-size: 1.25rem; }
h6, .h6 { font-size: 1rem; }
@media (min-width: 1200px) {
  h1, .h1 { font-size: 2.5rem; }
  h2, .h2 { font-size: 2rem; }
  h3, .h3 { font-size: 1.75rem; }
  h4, .h4 { font-size: 1.5rem; }
}

p { margin-top: 0; margin-bottom: 1rem; }

ol, ul { padding-left: 2rem; }
ol, ul, dl { margin-top: 0; margin-bottom: 1rem; }
ol ol, ul ul, ol ul, ul ol { margin-bottom: 0; }
dt { font-weight: 700; }
dd { margin-bottom: .5rem; margin-left: 0; }

b, strong { font-weight: bolder; }
small { font-size: .875em; }

hr { margin: 1rem 0; color: inherit; border: 0; border-top: 1px solid; opacity: .25; }

code, pre {
  font-family: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 1em;
}
pre { display: block; margin-top: 0; margin-bottom: 1rem; overflow: auto; font-size: .875em; }
pre code { font-size: inherit; color: inherit; word-break: normal; }
code { font-size: .875em; color: #d63384; word-wrap: break-word; }

img, svg { vertical-align: middle; }

table { caption-side: bottom; border-collapse: collapse; }
th { text-align: inherit; text-align: -webkit-match-parent; }
thead, tbody, tfoot, tr, td, th { border-color: inherit; border-style: solid; border-width: 0; }

label { display: inline-block; }
button { border-radius: 0; }
button:focus:not(:focus-visible) { outline: 0; }
input, button, select, optgroup, textarea { margin: 0; font-family: inherit; font-size: inherit; line-height: inherit; }
button, select { text-transform: none; }
[role="button"] { cursor: pointer; }
select { word-wrap: normal; }
select:disabled { opacity: 1; }
button, [type="button"], [type="reset"], [type="submit"] { -webkit-appearance: button; }
button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) { cursor: pointer; }
::-moz-focus-inner { padding: 0; border-style: none; }
textarea { resize: vertical; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: .5rem; font-size: calc(1.275rem + .3vw); line-height: inherit; }
@media (min-width: 1200px) { legend { font-size: 1.5rem; } }
legend + * { clear: left; }
::-webkit-datetime-edit-fields-wrapper, ::-webkit-datetime-edit-text, ::-webkit-datetime-edit-minute,
::-webkit-datetime-edit-hour-field, ::-webkit-datetime-edit-day-field, ::-webkit-datetime-edit-month-field,
::-webkit-datetime-edit-year-field { padding: 0; }
::-webkit-inner-spin-button { height: auto; }
[type="search"] { -webkit-appearance: textfield; outline-offset: -2px; }
[type="search"]::-webkit-search-cancel-button { cursor: pointer; filter: grayscale(1); }
::-webkit-search-decoration { -webkit-appearance: none; }
::-webkit-color-swatch-wrapper { padding: 0; }
::file-selector-button { font: inherit; -webkit-appearance: button; }
iframe { border: 0; }
summary { display: list-item; cursor: pointer; }
[hidden] { display: none !important; }

/* ===== Grid (row / col-*) — used by api-docs, shared-with-me, webhook, docs, login, password-reset ===== */
.row {
  --bs-gutter-x: 1.5rem;
  --bs-gutter-y: 0;
  display: flex;
  flex-wrap: wrap;
  margin-top: calc(-1 * var(--bs-gutter-y));
  margin-right: calc(-.5 * var(--bs-gutter-x));
  margin-left: calc(-.5 * var(--bs-gutter-x));
}
.row > * {
  flex-shrink: 0;
  width: 100%;
  max-width: 100%;
  padding-right: calc(var(--bs-gutter-x) * .5);
  padding-left: calc(var(--bs-gutter-x) * .5);
  margin-top: var(--bs-gutter-y);
}
.col-6 { flex: 0 0 auto; width: 50%; }
.g-3 { --bs-gutter-x: 1rem; --bs-gutter-y: 1rem; }
.g-4 { --bs-gutter-x: 1.5rem; --bs-gutter-y: 1.5rem; }
@media (min-width: 768px) {
  .col-md-3 { flex: 0 0 auto; width: 25%; }
  .col-md-4 { flex: 0 0 auto; width: 33.33333333%; }
  .col-md-6 { flex: 0 0 auto; width: 50%; }
  .col-md-8 { flex: 0 0 auto; width: 66.66666667%; }
}
@media (min-width: 992px) {
  .col-lg-4 { flex: 0 0 auto; width: 33.33333333%; }
}

/* ===== Components (only the properties app.css doesn't already set) ===== */

/* .card: app.css paints it; Bootstrap made it a flex column */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-width: 0;
  word-wrap: break-word;
}

/* .badge: app.css paints it */
.badge {
  display: inline-block;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
  vertical-align: baseline;
}
.badge:empty { display: none; }

.alert { position: relative; }

/* .btn: app.css paints it. The state rules below reproduce what Bootstrap did to a plain .btn
   (no .btn-primary etc. variant, so most --bs-btn-hover/active-* vars were undefined -> "unset";
   only the hover border colour was defined, as transparent). */
.btn {
  display: inline-block;
  padding: .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  text-align: center;
  text-decoration: none;
  vertical-align: middle;
  cursor: pointer;
  user-select: none;
  border: 1px solid transparent;
  border-radius: .375rem;
  background-color: transparent;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.btn:hover,
.btn:focus-visible,
.btn:first-child:active,
:not(.btn-check) + .btn:active { color: unset; background-color: unset; border-color: unset; }
.btn:hover,
.btn:focus-visible { border-color: transparent; }
.btn:focus-visible { outline: 0; box-shadow: unset; }
.btn:first-child:active:focus-visible,
:not(.btn-check) + .btn:active:focus-visible { box-shadow: unset; }
.btn:disabled, .btn.disabled, fieldset:disabled .btn {
  color: unset;
  pointer-events: none;
  background-color: unset;
  border-color: unset;
  opacity: .65;
}
@media (prefers-reduced-motion: reduce) { .btn { transition: none; } }

/* .table */
.table { width: 100%; margin-bottom: 1rem; vertical-align: top; border-color: #dee2e6; }
.table > :not(caption) > * > * {
  padding: .5rem .5rem;
  color: #000;
  background-color: #fff;
  border-bottom-width: 1px;
  box-shadow: inset 0 0 0 9999px transparent;
}
.table > tbody { vertical-align: inherit; }
.table > thead { vertical-align: bottom; }
.table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }

/* ===== Forms ===== */
.form-label { margin-bottom: .5rem; }
.form-text { margin-top: .25rem; font-size: .875em; color: rgba(33, 37, 41, .75); }

.form-control {
  display: block;
  width: 100%;
  padding: .375rem .75rem;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
  color: #212529;
  appearance: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #dee2e6;
  border-radius: .375rem;
  transition: border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control[type="file"] { overflow: hidden; }
.form-control[type="file"]:not(:disabled):not([readonly]) { cursor: pointer; }
.form-control:focus {
  color: #212529;
  background-color: #fff;
  border-color: #86b7fe;
  outline: 0;
  box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25);
}
.form-control::-webkit-date-and-time-value { min-width: 85px; height: 1.5em; margin: 0; }
.form-control::-webkit-datetime-edit { display: block; padding: 0; }
.form-control::placeholder { color: rgba(33, 37, 41, .75); opacity: 1; }
.form-control:disabled { background-color: #e9ecef; opacity: 1; }
.form-control::file-selector-button {
  padding: .375rem .75rem;
  margin: -.375rem -.75rem;
  margin-inline-end: .75rem;
  color: #212529;
  background-color: #f8f9fa;
  pointer-events: none;
  border-color: inherit;
  border-style: solid;
  border-width: 0;
  border-inline-end-width: 1px;
  border-radius: 0;
  transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out, box-shadow .15s ease-in-out;
}
.form-control:hover:not(:disabled):not([readonly])::file-selector-button { background-color: #e9ecef; }
textarea.form-control { min-height: calc(1.5em + .75rem + 2px); }
@media (prefers-reduced-motion: reduce) {
  .form-control, .form-control::file-selector-button { transition: none; }
}

/* Checkbox (webhook.php) */
.form-check { display: block; min-height: 1.5rem; padding-left: 1.5em; margin-bottom: .125rem; }
.form-check .form-check-input { float: left; margin-left: -1.5em; }
.form-check-input {
  flex-shrink: 0;
  width: 1em;
  height: 1em;
  margin-top: .25em;
  vertical-align: top;
  appearance: none;
  background-color: #fff;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  border: 1px solid #dee2e6;
  print-color-adjust: exact;
}
.form-check-input[type="checkbox"] { border-radius: .25em; }
.form-check-input[type="radio"] { border-radius: 50%; }
.form-check-input:active { filter: brightness(90%); }
.form-check-input:focus { border-color: #86b7fe; outline: 0; box-shadow: 0 0 0 .25rem rgba(13, 110, 253, .25); }
.form-check-input:checked { background-color: #0d6efd; border-color: #0d6efd; }
.form-check-input:checked[type="checkbox"] {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='m6 10 3 3 6-6'/%3e%3c/svg%3e");
}
.form-check-input[type="checkbox"]:indeterminate {
  background-color: #0d6efd;
  border-color: #0d6efd;
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='3' d='M6 10h8'/%3e%3c/svg%3e");
}
.form-check-input:disabled { pointer-events: none; filter: none; opacity: .5; }
.form-check-input:disabled ~ .form-check-label,
.form-check-input[disabled] ~ .form-check-label { cursor: default; opacity: .5; }

/* ===== Helpers ===== */
.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== Utilities (the ones used outside the editor) ===== */
.d-none { display: none !important; }
.d-flex { display: flex !important; }
.d-grid { display: grid !important; }
.w-100 { width: 100% !important; }
.h-100 { height: 100% !important; }
.flex-wrap { flex-wrap: wrap !important; }
.flex-grow-1 { flex-grow: 1 !important; }
.justify-content-between { justify-content: space-between !important; }
.align-items-start { align-items: flex-start !important; }
.align-items-center { align-items: center !important; }
.gap-1 { gap: .25rem !important; }
.gap-2 { gap: .5rem !important; }
.gap-3 { gap: 1rem !important; }
.mt-2 { margin-top: .5rem !important; }
.mt-3 { margin-top: 1rem !important; }
.mt-4 { margin-top: 1.5rem !important; }
.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: .25rem !important; }
.mb-2 { margin-bottom: .5rem !important; }
.mb-3 { margin-bottom: 1rem !important; }
.mb-4 { margin-bottom: 1.5rem !important; }
.ms-1 { margin-left: .25rem !important; }
.p-0 { padding: 0 !important; }
.p-3 { padding: 1rem !important; }
.pb-0 { padding-bottom: 0 !important; }
.py-4 { padding-top: 1.5rem !important; padding-bottom: 1.5rem !important; }
.py-5 { padding-top: 3rem !important; padding-bottom: 3rem !important; }
.text-center { text-align: center !important; }
