
    html { scroll-behavior: smooth; }
    .glass { backdrop-filter: blur(18px); background: rgba(255,255,255,.82); }
    .hide-scrollbar::-webkit-scrollbar { display: none; }
    .hide-scrollbar { -ms-overflow-style: none; scrollbar-width: none; }
    .fit-card { overflow: visible; }
    .fit-table { width: 100%; table-layout: fixed; border-collapse: collapse; font-size: clamp(8px, .78vw, 11px); }
    .fit-table th, .fit-table td { padding: .25rem; word-break: break-word; vertical-align: middle; }
    .fit-table input, .fit-table select { min-width: 0; width: 100%; padding: .3rem .2rem; font-size: clamp(9px, .85vw, 12px); border-radius: .5rem; }
    .voli-matrix .team-col { width: 10%; }
    .voli-matrix .match-col { width: 17%; }
    .voli-matrix .rank-col { width: 7%; }
    .mini-set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2px; }
    .mini-set-pair { display: grid; grid-template-columns: 1fr; gap: 2px; }
    @media (max-width: 900px) {
      .fit-table { font-size: 8px; }
      .fit-table th, .fit-table td { padding: .15rem; }
      .fit-table input { padding: .22rem .1rem; font-size: 9px; }
    }
  

/* ===== PATCH WARNA INPUT / SELECT AGAR TULISAN TERLIHAT DI KOLOM PUTIH ===== */
input,
select,
textarea,
.editable,
.scoreInput {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

input::placeholder,
textarea::placeholder {
  color: #64748b !important;
  -webkit-text-fill-color: #64748b !important;
}

select option,
datalist option {
  color: #0f172a !important;
  background: #ffffff !important;
}

input[readonly] {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a !important;
}

/* PATCH v3: teks di kolom putih/input/select wajib gelap supaya tidak putih di atas putih */
input, select, textarea, option,
.bg-white, .bg-white\/95, .bg-slate-50, .bg-slate-100,
table td, table th {
  color: #0f172a;
}
button.bg-white, .bg-white button:not(.bg-blue-600):not(.bg-rose-600):not(.bg-emerald-600):not(.bg-slate-950) {
  color: #0f172a;
}
.text-white input, .text-white select, .text-white textarea,
#tabContent-scoreboard select, #tabContent-scoreboard option,
#tabContent-anggota input, #tabContent-anggota textarea {
  color: #0f172a !important;
  -webkit-text-fill-color: #0f172a;
}
#drawGroupsPreview .bg-white,
#spinName,
#scoreboardPanel .bg-white,
#scoreboardPanel button.bg-white {
  color: #0f172a !important;
}
input::placeholder, textarea::placeholder { color: #64748b !important; }
button.bg-blue-600, button.bg-rose-600, button.bg-emerald-600, button.bg-slate-950, button.bg-amber-600 { color: white !important; }
.hidden { display: none !important; }

/* Patch final: kolom putih wajib teks gelap dan input/dropdown jelas */
input, select, textarea, option,
.bg-white input, .bg-white select, .bg-white textarea,
#tabContent-scoreboard select, #tabContent-scoreboard option {
  color: #020617 !important;
}
input::placeholder, textarea::placeholder { color: #64748b !important; }

/* ===== PORLAPAN STABLE HOTFIX 18-06: header compact + anti blink ===== */
body > header {
  min-height: 54px !important;
}
body > header > div > div:first-child {
  min-height: 54px !important;
  padding-top: .35rem !important;
  padding-bottom: .35rem !important;
  gap: .5rem !important;
}
body > header button,
body > header a {
  line-height: 1.1 !important;
}
body > header img {
  max-height: 38px !important;
}
#globalCompactStatusHost {
  gap: .35rem !important;
  align-items: center !important;
  min-height: 0 !important;
}
#editStatus,
#autosaveStatus,
#badmintonAutosaveStatus {
  margin: 0 !important;
  min-height: 0 !important;
  padding: .35rem .75rem !important;
  border-radius: 999px !important;
  font-size: .75rem !important;
  line-height: 1.1 !important;
  white-space: nowrap !important;
}
#globalLoginBtn,
#globalLogoutBtn {
  padding: .55rem 1rem !important;
  min-height: 0 !important;
}
#competitionPage > button {
  margin-bottom: 1rem !important;
}
.fit-table select[data-schedule-team-select="1"] {
  cursor: pointer;
  background-color: #fff !important;
  color: #020617 !important;
  -webkit-text-fill-color: #020617 !important;
}
@media (min-width: 1024px) {
  body > header > div > div:first-child {
    flex-direction: row !important;
  }
}
@media (max-width: 768px) {
  body > header > div > div:first-child {
    min-height: 50px !important;
  }
  #editStatus,
  #autosaveStatus,
  #badmintonAutosaveStatus {
    font-size: .68rem !important;
    padding: .3rem .55rem !important;
  }
}

/* === PORLAPAN V7 COMPACT HEADER + NO BLINK FIX === */
header.porlapan-v7-compact-header .min-h-16{min-height:56px!important;padding-top:8px!important;padding-bottom:8px!important;}
header.porlapan-v7-compact-header img[alt="Logo Cluster"]{padding:3px!important;}
header.porlapan-v7-compact-header h1{font-size:1.05rem!important;line-height:1.15!important;}
header.porlapan-v7-compact-header p{line-height:1.1!important;}
header.porlapan-v7-compact-header button{transition:none!important;}
#globalCompactStatusHost>*{font-size:.72rem!important;padding:.35rem .65rem!important;line-height:1.1!important;min-height:0!important;margin:0!important;}
#competitionPage .tabContent{animation:none!important;}
select[data-v7-schedule],input[data-v7-schedule]{transition:border-color .12s ease, box-shadow .12s ease!important;}
select[data-v7-schedule]:focus,input[data-v7-schedule]:focus{box-shadow:0 0 0 3px rgba(37,99,235,.12)!important;}

/* ===== PORLAPAN RESPONSIVE DEVICE FINAL FIX 2026-06-19 ===== */
:root {
  --porlapan-safe-pad: clamp(10px, 3vw, 32px);
  --porlapan-radius-mobile: 1.35rem;
}

*, *::before, *::after { box-sizing: border-box; }
html, body {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}
body { overscroll-behavior-x: none; }
img, svg, video, canvas, iframe { max-width: 100%; }

body > main,
main.mx-auto,
#homePage,
#competitionPage,
#k3Page,
#badmintonPage,
.tabContent,
.tab-content {
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
}

body > main.mx-auto {
  padding-left: var(--porlapan-safe-pad) !important;
  padding-right: var(--porlapan-safe-pad) !important;
}

.grid, .flex,
.grid > *, .flex > *,
#competitionPage > *, #k3Page > *, #homePage > *, #badmintonPage > * {
  min-width: 0 !important;
}

.rounded-3xl,
.rounded-\[2rem\],
.rounded-\[1\.7rem\],
.shadow-soft,
.tabContent > div,
.tab-content > div {
  max-width: 100% !important;
  min-width: 0 !important;
}

/* Tabel tidak lagi melebar keluar layar. Semua tabel bisa discroll horizontal di HP/tablet. */
.fit-card,
.porlapan-responsive-table-wrap,
.overflow-x-auto,
.overflow-auto {
  display: block !important;
  width: 100% !important;
  max-width: 100% !important;
  min-width: 0 !important;
  overflow-x: auto !important;
  overflow-y: hidden !important;
  -webkit-overflow-scrolling: touch !important;
  scrollbar-width: thin;
  overscroll-behavior-inline: contain;
}

.fit-card::-webkit-scrollbar,
.porlapan-responsive-table-wrap::-webkit-scrollbar,
.overflow-x-auto::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar { height: 8px; }
.fit-card::-webkit-scrollbar-thumb,
.porlapan-responsive-table-wrap::-webkit-scrollbar-thumb,
.overflow-x-auto::-webkit-scrollbar-thumb,
.overflow-auto::-webkit-scrollbar-thumb {
  background: rgba(100,116,139,.45);
  border-radius: 999px;
}

.fit-table,
.porlapan-responsive-table,
table[class*="min-w-"] {
  border-collapse: collapse !important;
  width: max-content !important;
  min-width: 100% !important;
  max-width: none !important;
}

.fit-table th,
.fit-table td,
.porlapan-responsive-table th,
.porlapan-responsive-table td {
  vertical-align: middle !important;
  white-space: normal;
}

.fit-table input,
.fit-table select,
.fit-table textarea,
.porlapan-responsive-table input,
.porlapan-responsive-table select,
.porlapan-responsive-table textarea {
  max-width: 100% !important;
}

/* Header + tab stabil untuk layar sempit. */
body > header { max-width: 100vw !important; overflow-x: hidden !important; }
body > header > div { max-width: 100% !important; padding-left: var(--porlapan-safe-pad) !important; padding-right: var(--porlapan-safe-pad) !important; }
body > header h1, body > header p { overflow-wrap: anywhere; }
#globalCompactStatusHost { max-width: 100% !important; overflow-x: auto !important; padding-bottom: 2px; }
#competitionPage .tabBtn,
#badmintonPage button[id^="btab-"],
body > header button,
body > header a { white-space: nowrap !important; }

/* Form dan tombol tidak boleh menekan card melewati layar. */
input, select, textarea, button { max-width: 100% !important; }
.scoreInput {
  width: clamp(4.5rem, 23vw, 7rem) !important;
  min-width: 0 !important;
  border-radius: 1rem !important;
  border: 1px solid #cbd5e1 !important;
  background: #fff !important;
  padding: .75rem .5rem !important;
  text-align: center !important;
  font-weight: 900 !important;
}

/* Papan skor dan flowchart tetap masuk layar. */
#tabContent-scoreboard .grid,
#standardKnockoutGrid,
#caturFlowchart,
#caturFlowchartBox,
#drawGroupsPreview,
#memberList { max-width: 100% !important; min-width: 0 !important; }

@media (max-width: 1024px) {
  #competitionPage .rounded-\[2rem\],
  #k3Page .rounded-\[2rem\],
  #badmintonPage .rounded-\[2rem\] { border-radius: 1.5rem !important; }
  #competitionSubtitle { max-width: 100% !important; }
}

@media (max-width: 768px) {
  :root { --porlapan-safe-pad: 10px; }
  body > main.mx-auto { padding-top: 1rem !important; padding-bottom: 1rem !important; }

  body > header > div > div:first-child {
    gap: .55rem !important;
    padding-top: .55rem !important;
    padding-bottom: .55rem !important;
  }
  body > header img { max-height: 34px !important; }
  body > header h1 { font-size: clamp(.95rem, 5vw, 1.25rem) !important; line-height: 1.1 !important; }
  body > header p { font-size: .75rem !important; }
  #globalLoginBtn, #globalLogoutBtn, body > header button {
    padding: .58rem .78rem !important;
    font-size: .82rem !important;
  }

  #competitionTitle,
  #k3Page h2 { font-size: clamp(1.8rem, 8vw, 2.45rem) !important; line-height: 1.05 !important; }
  #competitionPage .p-4,
  #competitionPage .sm\:p-8,
  #k3Page .p-4,
  #k3Page .sm\:p-8 { padding: .85rem !important; }

  #competitionPage .tabBtn,
  #badmintonPage button[id^="btab-"] {
    padding: .58rem .85rem !important;
    font-size: .82rem !important;
  }

  .fit-table,
  .porlapan-responsive-table {
    font-size: 10px !important;
    line-height: 1.25 !important;
  }
  .fit-table th, .fit-table td,
  .porlapan-responsive-table th, .porlapan-responsive-table td {
    padding: .35rem .42rem !important;
  }
  .fit-table input,
  .fit-table select,
  .porlapan-responsive-table input,
  .porlapan-responsive-table select {
    min-width: 4.2rem !important;
    padding: .45rem .35rem !important;
    font-size: 11px !important;
    border-radius: .65rem !important;
  }
  .mini-set-grid { min-width: 13.5rem !important; }
  .mini-set-pair input { min-width: 3rem !important; }

  .fit-card,
  .porlapan-responsive-table-wrap,
  .overflow-x-auto {
    border-radius: .9rem;
  }

  .rounded-3xl { border-radius: 1.15rem !important; }
  .rounded-\[2rem\] { border-radius: var(--porlapan-radius-mobile) !important; }
}

@media (max-width: 480px) {
  :root { --porlapan-safe-pad: 8px; }
  #competitionPage .tabBtn,
  #badmintonPage button[id^="btab-"] { font-size: .76rem !important; }
  .fit-table,
  .porlapan-responsive-table { font-size: 9px !important; }
  .fit-table th, .fit-table td,
  .porlapan-responsive-table th, .porlapan-responsive-table td { padding: .28rem .32rem !important; }
  .fit-table input,
  .fit-table select,
  .porlapan-responsive-table input,
  .porlapan-responsive-table select {
    min-width: 3.7rem !important;
    font-size: 10px !important;
  }
  .porlapan-responsive-table-wrap,
  .fit-card {
    margin-left: -.15rem;
    margin-right: -.15rem;
    width: calc(100% + .3rem) !important;
  }
}
