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;
}
/* Update155: Compact QR panels for HOME and team pages. */
.jk-home-qr { max-width: 370px; }
.jk-qr-thumb {
  display: block;
  width: 104px;
  height: 104px;
  padding: 5px;
  background: #fff;
  color: #46544c;
  cursor: zoom-in;
  overflow: hidden;
  flex-shrink: 0;
}
.jk-qr-thumb svg { width: 100%; height: 100%; display: block; }
.jk-qr-thumb:focus-visible { outline: 3px solid #227dc5; outline-offset: 2px; }
.jk-qr-id { font-size: .75rem; font-variant-numeric: tabular-nums; }
.jk-qr-dialog {
  width: min(92vw, 370px);
  max-width: 370px;
  max-height: 90vh;
  border: 1px solid #adb5bd;
  border-radius: .75rem;
  padding: 1.25rem;
  color: #212529;
  background: #fff;
  box-shadow: 0 16px 45px rgba(0,0,0,.2);
}
.jk-qr-dialog::backdrop { background: rgba(0,0,0,.62); }
.jk-qr-dialog-code {
  width: min(70vw, 288px);
  height: min(70vw, 288px);
  max-width: 288px;
  max-height: 288px;
  background: white;
  margin: 1rem auto;
}
.jk-qr-dialog-code svg { width: 100%; height: 100%; display: block; }
@media (min-width: 992px) {
  .jk-home-qr { max-width: 180px; }
  .jk-qr-thumb-home { width: 144px; height: 144px; }
  .jk-qr-thumb-team { width: 128px; height: 128px; }
}

/* Update157: PC QR is on-demand in the navigation instead of on HOME. */
.jk-qr-thumb-nav { width:188px; height:188px; }

/* Mobile-width audit (iPhone 320-430px): shrink content instead of horizontal scrolling. */
.jk-break-email { overflow-wrap:anywhere; word-break:break-word; }
.jk-password-field { position:relative; width:100%; min-width:0; }
.jk-password-field .form-control { width:100%; min-width:0; padding-right:3.25rem; }
.jk-password-peek {
  position:absolute; right:.3rem; top:50%; transform:translateY(-50%);
  display:flex; align-items:center; justify-content:center;
  width:2.65rem; height:2.65rem; padding:0; border:0;
  border-radius:.4rem; color:var(--bs-secondary-color); background:transparent;
  touch-action:none; -webkit-user-select:none; user-select:none;
}
.jk-password-peek:focus-visible { outline:2px solid var(--bs-primary); outline-offset:-2px; }
.jk-password-peek:active { background:var(--bs-tertiary-bg); color:var(--bs-body-color); }
.jk-mobile-answer-member { display:flex; gap:.35rem; align-items:center; justify-content:space-between; padding:.3rem 0; border-top:1px solid var(--bs-border-color); flex-wrap:wrap; min-width:0; }
.jk-mobile-answer-name { min-width:0; overflow-wrap:anywhere; }
.jk-mobile-answer-member > * { max-width:100%; }
.jk-mobile-answer-list summary { cursor:pointer; overflow-wrap:anywhere; }

@media (max-width:767.98px) {
  /* Safari zooms focused inputs when computed size is below 16px. */
  input.form-control, select.form-select, textarea.form-control,
  .form-control-sm, .form-select-sm { font-size:16px; }
  main, .card, .card-body,
  .row > *, .col, .table-responsive, .jk-register-page > * {
    min-width:0; max-width:100%;
  }
  input, select, textarea, img, video, canvas, svg { max-width:100%; }
  .card-body > *, .d-flex > *, .d-inline-flex > *, .jk-entry-panel { min-width:0; }
  input[type=file] { min-width:0; width:100%; }
  .form-control, .form-select, .input-group { min-width:0; max-width:100%; }
  .alert, .card-body, main p, main li { overflow-wrap:anywhere; }
  /* Only responsive tables intentionally opted in here become mobile cards. */
  .jk-mobile-cards { overflow-x:visible; }
  .jk-mobile-cards > table, .jk-mobile-cards > table > tbody { display:block; width:100%; max-width:100%; }
  .jk-mobile-cards > table > thead { display:none; }
  .jk-mobile-cards > table > tbody > tr { display:block; min-width:0; padding:.35rem .55rem; margin:0 0 .45rem; border:1px solid var(--bs-border-color); border-radius:.45rem; }
  .jk-mobile-cards > table > tbody > tr > td,
  .jk-mobile-cards > table > tbody > tr > th {
    display:grid; grid-template-columns:minmax(0,6.1rem) minmax(0,1fr); gap:.35rem;
    align-items:start; text-align:left!important; min-width:0!important; max-width:100%; width:auto!important;
    white-space:normal!important; overflow-wrap:anywhere; border:0;
    padding:.28rem .15rem; background:transparent;
  }
  .jk-mobile-cards > table > tbody > tr > td::before {
    content:attr(data-label); font-weight:600; color:var(--bs-secondary-color); font-size:.82rem;
  }
  .jk-mobile-cards > table > tbody > tr > td:not([data-label]) { display:block; }
  .jk-mobile-cards .jk-user-actions { min-width:0; max-width:100%; gap:.3rem; }
  .jk-mobile-cards .jk-user-actions .btn { white-space:normal!important; }
  .jk-mobile-cards > table > tbody > tr.jk-card-heading { padding:.25rem .5rem; background:var(--bs-tertiary-bg); }
  .jk-mobile-cards > table > tbody > tr.jk-card-heading > th { display:block; }
  .jk-rules-table > table > tbody > tr > td:first-child { display:block; }
  .jk-rules-table > table > tbody > tr > td:first-child::before { display:none; }
  .jk-rules-table .d-inline-flex { flex-wrap:wrap; }
  .jk-rules-table > table > tbody > tr > td:last-child { grid-template-columns:minmax(0,6.1rem) minmax(0,1fr); }
  .jk-rules-table > table > tbody > tr > td:last-child[style] { min-width:0!important; }
  .jk-detail-responsive { overflow-x:visible; }
  .jk-detail-responsive > table { width:100%; max-width:100%; table-layout:fixed; }
  .jk-detail-responsive > table th { width:7.5rem!important; padding:.35rem; font-size:.82rem; overflow-wrap:anywhere; }
  .jk-detail-responsive > table td { min-width:0; overflow-wrap:anywhere; word-break:break-word; padding:.35rem; }
  /* Small screens do not have room for the PC table/desktop matrix widths. */
  .tournament-admin .admin-responses.d-none { display:none!important; }
}
@media (max-width:360px) {
  .jk-mobile-cards > table > tbody > tr > td { grid-template-columns:minmax(0,5.1rem) minmax(0,1fr); }
  .jk-mobile-cards > table > tbody > tr > td::before { font-size:.78rem; }
}
