*{
  box-sizing:border-box;
}

:root{
  --bg:#0f1115;
  --bg2:#171a21;
  --panel:#1b1f28;
  --panel2:#202531;
  --text:#f3f5f8;
  --muted:#b5bdc9;
  --line:rgba(255,255,255,.08);
  --gold:#d4af37;
  --accent:#8ab4ff;
  --shadow:0 18px 50px rgba(0,0,0,.35);
  --radius:18px;
}

html,body{
  margin:0;
  padding:0;
  background:var(--bg);
  color:var(--text);
  font-family:Arial, Helvetica, sans-serif;
}

body{
  min-height:100vh;
}

img{
  max-width:100%;
}

#hero{
  background:
    radial-gradient(circle at top left, rgba(212,175,55,.18), transparent 35%),
    radial-gradient(circle at top right, rgba(138,180,255,.12), transparent 30%),
    linear-gradient(135deg, #101319 0%, #151922 50%, #0f1115 100%);
  padding:42px 20px 24px;
  border-bottom:1px solid var(--line);
}

.hero-inner{
  max-width:1400px;
  margin:0 auto;
  display:grid;
  grid-template-columns:1.2fr .8fr;
  gap:28px;
  align-items:stretch;
}

.hero-copy{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.hero-badge{
  display:inline-block;
  align-self:flex-start;
  padding:9px 14px;
  border-radius:999px;
  background:rgba(212,175,55,.14);
  color:#f0d98c;
  border:1px solid rgba(212,175,55,.28);
  font-size:13px;
  font-weight:bold;
  letter-spacing:.3px;
  margin-bottom:16px;
}

#konkurs_nazwa{
  margin:0 0 12px 0;
  font-size:46px;
  line-height:1.08;
}

#konkurs_opis{
  margin:0;
  max-width:880px;
  color:var(--muted);
  line-height:1.6;
  font-size:17px;
}

.stats{
  display:grid;
  grid-template-columns:repeat(4, minmax(0,1fr));
  gap:16px;
  margin-top:26px;
}

.stat-card{
  background:rgba(255,255,255,.04);
  border:1px solid var(--line);
  border-radius:16px;
  padding:18px 16px;
  box-shadow:var(--shadow);
}

.stat-card span{
  display:block;
  font-size:34px;
  font-weight:bold;
  line-height:1;
  margin-bottom:8px;
}

.stat-card small{
  display:block;
  color:var(--muted);
  font-size:14px;
  line-height:1.35;
}

.hero-highlight{
  min-height:360px;
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border:1px solid var(--line);
  border-radius:22px;
  overflow:hidden;
  box-shadow:var(--shadow);
}

.hero-highlight-empty{
  height:100%;
  min-height:360px;
  display:flex;
  align-items:center;
  justify-content:center;
  color:var(--muted);
  padding:24px;
  text-align:center;
}

.hero-highlight-card{
  height:100%;
  display:flex;
  flex-direction:column;
}

.hero-highlight-img{
  width:100%;
  height:250px;
  object-fit:cover;
  display:block;
  background:#252a35;
  cursor:pointer;
}

.hero-highlight-body{
  padding:20px;
}

.hero-highlight-kicker{
  display:inline-block;
  margin-bottom:10px;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(212,175,55,.16);
  color:#f4da8a;
  font-weight:bold;
  font-size:13px;
}

.hero-highlight-body h3{
  margin:0 0 8px 0;
  font-size:28px;
  line-height:1.2;
}

.hero-highlight-body p{
  margin:6px 0;
  color:var(--muted);
  line-height:1.45;
}

.page-wrap{
  max-width:1400px;
  margin:0 auto;
  padding:0 20px 40px;
}

.results-section{
  padding-top:32px;
}

.section-head{
  display:flex;
  align-items:end;
  justify-content:space-between;
  gap:20px;
  margin-bottom:18px;
  border-bottom:1px solid var(--line);
  padding-bottom:12px;
}

.section-head h2{
  margin:0;
  font-size:32px;
  line-height:1.2;
}

.section-head p{
  margin:0;
  color:var(--muted);
  font-size:15px;
  text-align:right;
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(280px,1fr));
  gap:22px;
}

.card{
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.025));
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  box-shadow:var(--shadow);
  transition:transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card:hover{
  transform:translateY(-4px);
  box-shadow:0 22px 55px rgba(0,0,0,.42);
  border-color:rgba(255,255,255,.14);
}

.card-image-wrap{
  position:relative;
  background:#252a35;
}

.card-image{
  width:100%;
  height:220px;
  object-fit:cover;
  display:block;
  cursor:pointer;
}

.card-badge{
  position:absolute;
  left:14px;
  top:14px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:bold;
  background:rgba(0,0,0,.55);
  color:#fff;
  backdrop-filter:blur(4px);
}

.card.card-main .card-badge{
  background:rgba(212,175,55,.92);
  color:#111;
}

.card-body{
  padding:16px 16px 18px;
}

.card-body h3{
  margin:0 0 10px 0;
  font-size:20px;
  line-height:1.25;
}

.card-meta{
  display:grid;
  gap:6px;
}

.card-meta p{
  margin:0;
  color:var(--muted);
  font-size:14px;
  line-height:1.45;
}

.card-meta strong{
  color:#fff;
}

#slider_section{
  padding:28px 20px 6px;
}

#slider{
  max-width:1400px;
  margin:0 auto;
}

.wyniki-slider{
  position:relative;
  overflow:hidden;
  border-radius:22px;
  background:var(--panel);
  border:1px solid var(--line);
  box-shadow:var(--shadow);
}

.wyniki-slider-track{
  display:flex;
  width:100%;
  transition:transform .45s ease;
}
.wyniki-slide{
  min-width:100%;
  display:grid;
  grid-template-columns:1fr .75fr;
  background:linear-gradient(135deg, rgba(255,255,255,.03), rgba(255,255,255,.015));
}

.wyniki-slide-image-wrap{
  min-height:280px;
  max-height:280px;
  background:#252a35;
}

.wyniki-slide-caption{
  padding:18px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.wyniki-slide-caption h3{
  margin:0 0 10px 0;
  font-size:24px;
  line-height:1.2;
}

.wyniki-slide-caption p{
  margin:4px 0;
  color:var(--muted);
  font-size:15px;
  line-height:1.35;
}

.wyniki-slide-badge{
  display:inline-block;
  align-self:flex-start;
  margin-bottom:12px;
  padding:8px 14px;
  border-radius:999px;
  background:rgba(212,175,55,.92);
  color:#111;
  font-weight:bold;
  font-size:13px;
}

.wyniki-slide-caption h3{
  margin:0 0 12px 0;
  font-size:34px;
  line-height:1.15;
}

.wyniki-slide-caption p{
  margin:6px 0;
  color:var(--muted);
  font-size:17px;
  line-height:1.45;
}

.wyniki-slider-btn{
  position:absolute;
  top:50%;
  transform:translateY(-50%);
  width:40px;
  height:40px;
  border:none;
  border-radius:50%;
  background:rgba(0,0,0,.5);
  color:#fff;
  font-size:24px;
  line-height:1;
  cursor:pointer;
  z-index:5;
}

.wyniki-slider-btn.prev{ left:14px; }
.wyniki-slider-btn.next{ right:14px; }

.wyniki-slider-dots{
  position:absolute;
  left:0;
  right:0;
  bottom:14px;
  display:flex;
  justify-content:center;
  gap:10px;
  z-index:5;
}

.wyniki-slider-dot{
  width:12px;
  height:12px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,.4);
  cursor:pointer;
}

.wyniki-slider-dot.active{
  background:#fff;
}

.empty-note{
  padding:14px 2px;
  color:var(--muted);
  font-style:italic;
}

#lightbox{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,.92);
  display:none;
  align-items:center;
  justify-content:center;
  padding:28px;
  z-index:9999;
}

#lightbox_img{
  max-width:92vw;
  max-height:90vh;
  border-radius:10px;
  box-shadow:0 20px 60px rgba(0,0,0,.5);
}

#lightbox_close{
  position:absolute;
  top:18px;
  right:18px;
  width:48px;
  height:48px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,.12);
  color:#fff;
  font-size:34px;
  cursor:pointer;
}

@media (max-width: 1100px){
  .hero-inner{
    grid-template-columns:1fr;
  }

  .stats{
    grid-template-columns:repeat(2, minmax(0,1fr));
  }
}

@media (max-width: 900px){
  #konkurs_nazwa{
    font-size:34px;
  }

  .wyniki-slide{
    grid-template-columns:1fr;
  }

.wyniki-slide-image-wrap{
  min-height:220px;
  max-height:220px;
}

  .wyniki-slide-caption h3{
    font-size:26px;
  }

  .section-head{
    flex-direction:column;
    align-items:flex-start;
  }

  .section-head p{
    text-align:left;
  }
}

@media (max-width: 640px){
  #hero{
    padding:30px 16px 18px;
  }

  #slider_section{
    padding:18px 16px 4px;
  }

  .page-wrap{
    padding:0 16px 30px;
  }

  .stats{
    grid-template-columns:1fr;
  }

  .grid{
    grid-template-columns:1fr;
  }

  .section-head h2{
    font-size:26px;
  }

  .card-image{
    height:220px;
  }
}
#konkurs_nazwa_wrap{
  margin:0 0 12px 0;
}

#toggle_view_link{
  color:var(--text);
  text-decoration:none;
  font-size:46px;
  line-height:1.08;
  font-weight:bold;
  cursor:pointer;
  border-bottom:1px dashed rgba(255,255,255,.25);
}

#toggle_view_link:hover{
  color:#f0d98c;
  border-bottom-color:#f0d98c;
}

.table-wrap{
  overflow:auto;
  border:1px solid var(--line);
  border-radius:16px;
  background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  box-shadow:var(--shadow);
}

.results-table{
  width:100%;
  border-collapse:collapse;
  min-width:760px;
}

.results-table th,
.results-table td{
  padding:14px 16px;
  text-align:left;
  border-bottom:1px solid var(--line);
}

.results-table th{
  background:rgba(255,255,255,.04);
  color:#fff;
  font-size:14px;
}

.results-table td{
  color:var(--muted);
  font-size:14px;
}


.table-photo-cell{
  width:72px;
  text-align:center;
}

.photo-btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  min-width:36px;
  height:36px;
  padding:0 10px;
  border:1px solid rgba(255,255,255,.14);
  border-radius:10px;
  background:rgba(255,255,255,.06);
  color:#fff;
  font-size:18px;
  line-height:1;
  cursor:pointer;
  transition:transform .15s ease, background .15s ease, border-color .15s ease;
}

.photo-btn:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.24);
  transform:translateY(-1px);
}

.no-photo{
  color:#999;
}

.results-table tr:hover td{
  background:rgba(255,255,255,.03);
}

.view-hidden{
  display:none !important;
}

@media (max-width: 900px){
  #toggle_view_link{
    font-size:34px;
  }

.hero-topbar{
  display:flex;
  align-items:center;
  gap:12px;
  margin-bottom:16px;
}

.hero-badge{
  display:inline-block;
  align-self:flex-start;
  padding:9px 14px;
  border-radius:999px;
  background:rgba(212,175,55,.14);
  color:#f0d98c;
  border:1px solid rgba(212,175,55,.28);
  font-size:13px;
  font-weight:bold;
  letter-spacing:.3px;
  margin-bottom:0;
}

.hero-badge-btn{
  cursor:pointer;
  transition:all .2s ease;
}

.hero-badge-btn:hover{
  background:rgba(212,175,55,.22);
  border-color:rgba(212,175,55,.45);
  transform:translateY(-1px);
}

.view-toggle-icon{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  height:40px;
  min-width:40px;
  padding:0 12px;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
  transition:all .2s ease;
}

.view-toggle-icon:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.26);
  transform:translateY(-1px);
}

.view-toggle-icon .icon-cards,
.view-toggle-icon .icon-table{
  font-size:15px;
  line-height:1;
}

#konkurs_nazwa_wrap{
  margin:0 0 12px 0;
}

#konkurs_nazwa_text{
  display:inline-block;
  color:var(--text);
  font-size:46px;
  line-height:1.08;
  font-weight:bold;
  text-decoration:none;
}

.view-mode-table .icon-table,
.view-mode-cards .icon-cards{
  color:#f0d98c;
}

@media (max-width: 900px){
  #konkurs_nazwa_text{
    font-size:34px;
  }

  .hero-topbar{
    flex-wrap:wrap;
  }
}}
.kat-id{
  opacity:.6;
  font-size:.9em;
  margin-left:6px;
}
.contest-title{
  display:flex;
  align-items:center;
  gap:16px;
}

.contest-logo{
  height:54px;
  width:auto;
  object-fit:contain;
}

@media (max-width: 900px){
  .contest-logo{
    height:40px;
  }
}

.hero-logo-bg{
  position:absolute;
  left:120px;
  top:40px;
  width:520px;
  height:520px;

  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;

  opacity:.08;
  pointer-events:none;
  z-index:0;

  filter: grayscale(1) brightness(1.4);

  mask-image: radial-gradient(circle, rgba(0,0,0,1) 38%, rgba(0,0,0,0) 72%);
  -webkit-mask-image: radial-gradient(circle, rgba(0,0,0,1) 38%, rgba(0,0,0,0) 72%);
}

#hero{
  position:relative;
  overflow:hidden;
}

.hero-inner{
  position:relative;
  z-index:1;
}
@media (max-width: 900px){
  .hero-logo-bg{
    left:20px;
    top:80px;
    width:260px;
    height:260px;
    opacity:.06;
  }
}

.results-table th[data-sort]{
  cursor:pointer;
  user-select:none;
  position:relative;
}

.results-table th[data-sort]::after{
  content:"⇅";
  font-size:11px;
  opacity:.4;
  margin-left:6px;
}

.results-table th.sort-asc::after{
  content:"▲";
  opacity:.9;
}

.results-table th.sort-desc::after{
  content:"▼";
  opacity:.9;
}
.table-toolbar{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:14px;
  flex-wrap:wrap;
}

.table-search-input{
  flex:1 1 320px;
  min-width:260px;
  height:44px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:#fff;
  padding:0 14px;
  font-size:14px;
  outline:none;
}

.table-search-input::placeholder{
  color:rgba(255,255,255,.45);
}

.table-search-input:focus{
  border-color:rgba(212,175,55,.45);
  box-shadow:0 0 0 3px rgba(212,175,55,.08);
}

.table-search-clear{
  height:44px;
  padding:0 16px;
  border-radius:12px;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#fff;
  cursor:pointer;
  transition:all .2s ease;
}

.table-search-clear:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.24);
}

.results-table tr.table-row-hidden{
  display:none;
}
.table-material-filter{
  height:44px;
  min-width:220px;
  border-radius:12px;
  border:1px solid var(--line);
  background:rgba(255,255,255,.05);
  color:#fff;
  padding:0 14px;
  font-size:14px;
  outline:none;
}

.table-material-filter:focus{
  border-color:rgba(212,175,55,.45);
  box-shadow:0 0 0 3px rgba(212,175,55,.08);
}

.table-material-filter option{
  background:#1b1f28;
  color:#fff;
}

.card-actions{
  margin-top:14px;
  display:flex;
  justify-content:flex-start;
}

.diploma-btn{
  appearance:none;
  border:1px solid rgba(138,180,255,.45);
  background:rgba(138,180,255,.12);
  color:#dce9ff;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:bold;
  cursor:pointer;
}

.diploma-btn:hover{
  background:rgba(138,180,255,.2);
}

.diploma-btn-small{
  padding:6px 10px;
  font-size:11px;
}

.muted-inline{
  color:var(--muted);
}

.pdf-preview-modal{
  position:fixed;
  inset:0;
  display:none;
  align-items:center;
  justify-content:center;
  padding:12px;
  background:rgba(0,0,0,.78);
  z-index:10000;
}

.pdf-preview-dialog{
  width:min(1200px, calc(100vw - 24px));
  height:calc(100vh - 24px);
  background:#111723;
  border:1px solid rgba(255,255,255,.14);
  border-radius:18px;
  overflow:hidden;
  display:flex;
  flex-direction:column;
  box-shadow:0 24px 70px rgba(0,0,0,.55);
}

.pdf-preview-header{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  padding:14px 18px;
  border-bottom:1px solid rgba(255,255,255,.08);
  background:rgba(15,23,42,.96);
}

.pdf-preview-header strong{
  font-size:16px;
}

.pdf-preview-header button{
  width:42px;
  height:42px;
  border:none;
  border-radius:50%;
  background:rgba(255,255,255,.1);
  color:#fff;
  font-size:28px;
  cursor:pointer;
}

.pdf-preview-body{
  position:relative;
  flex:1;
  background:#fff;
}

.pdf-preview-loader{
  position:absolute;
  inset:0;
  display:flex;
  align-items:center;
  justify-content:center;
  background:rgba(11,16,32,.72);
  color:#fff;
  font-weight:bold;
  z-index:2;
}

#pdf_preview_iframe{
  width:100%;
  height:100%;
  border:0;
  background:#fff;
}

@media (max-width: 640px){
  .pdf-preview-modal{
    padding:6px;
  }

  .pdf-preview-dialog{
    width:calc(100vw - 12px);
    height:calc(100vh - 12px);
    border-radius:14px;
  }

  .pdf-preview-header{
    padding:10px 12px;
  }
}


.diploma-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  white-space:nowrap;
}

.diploma-btn-disabled{
  opacity:.65;
  cursor:default;
  border-style:dashed;
}

.card-actions .diploma-btn{
  min-height:38px;
}


.icon-btn{
  appearance:none;
  border:1px solid rgba(255,255,255,.14);
  background:rgba(255,255,255,.06);
  color:#fff;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:bold;
  cursor:pointer;
}

.icon-btn:hover{
  background:rgba(255,255,255,.12);
  border-color:rgba(255,255,255,.24);
}

@media (max-width: 760px){
  .table-wrap{
    overflow:visible;
    background:transparent;
    border:none;
    box-shadow:none;
  }

  .results-table{
    min-width:0;
    border-collapse:separate;
    border-spacing:0 12px;
  }

  .results-table thead{
    display:none;
  }

  .results-table tbody,
  .results-table tr,
  .results-table td{
    display:block;
    width:100%;
  }

  .results-table tr.results-table-row{
    border:1px solid var(--line);
    border-radius:18px;
    background:linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
    box-shadow:var(--shadow);
    overflow:hidden;
    padding:14px;
  }

  .results-table tr.results-table-row td{
    border-bottom:none;
    padding:0;
    text-align:left;
    background:transparent;
  }

  .results-table tr:hover td{
    background:transparent;
  }

  .results-table tr.results-table-row .col-award{
    font-size:15px;
    line-height:1.35;
    color:#fff;
    font-weight:bold;
    margin-bottom:10px;
  }

  .results-table tr.results-table-row .col-model{
    font-size:22px;
    line-height:1.2;
    color:#fff;
    font-weight:bold;
    margin-bottom:8px;
  }

  .results-table tr.results-table-row .col-author{
    color:#d7deea;
    font-size:15px;
    margin-bottom:10px;
  }

  .results-table tr.results-table-row .col-kat-id,
  .results-table tr.results-table-row .col-category,
  .results-table tr.results-table-row .col-material{
    font-size:13px;
    line-height:1.4;
    color:var(--muted);
    margin-bottom:6px;
  }

  .results-table tr.results-table-row .col-kat-id::before,
  .results-table tr.results-table-row .col-category::before,
  .results-table tr.results-table-row .col-material::before{
    content:attr(data-label) ": ";
    color:#fff;
    font-weight:bold;
  }

  .results-table tr.results-table-row .col-photo,
  .results-table tr.results-table-row .col-diploma{
    display:inline-flex;
    width:auto;
    margin-top:10px;
    margin-right:8px;
    vertical-align:top;
  }

  .results-table tr.results-table-row .icon-btn,
  .results-table tr.results-table-row .diploma-btn{
    padding:8px 12px;
    font-size:12px;
  }

  .table-toolbar{
    gap:10px;
  }

  .table-search-input,
  .table-material-filter,
  .table-search-clear{
    width:100%;
    min-width:0;
    flex:1 1 100%;
  }
}

/* ===== XScale branding ===== */
.xscaleTop{max-width:1400px;margin:18px auto 0;padding:10px 12px;border:1px solid var(--line);background:rgba(255,255,255,.055);border-radius:18px;box-shadow:0 10px 34px rgba(0,0,0,.18);display:flex;align-items:center;justify-content:space-between;gap:14px}
.xscaleBrand{display:flex;align-items:center;gap:10px;min-width:0;text-decoration:none;color:var(--text)}.xscaleBrand img{width:42px;height:42px;object-fit:contain;border-radius:10px;background:rgba(255,255,255,.06);border:1px solid var(--line);padding:3px;flex:0 0 auto}
.xscaleBrandName{display:block;font-weight:950;letter-spacing:.2px;line-height:1.1}.xscaleBrandSub{display:block;font-size:12px;color:var(--muted);line-height:1.2;margin-top:2px}.xscaleArchiveLink{display:inline-flex;align-items:center;gap:6px;color:var(--text);text-decoration:none;background:rgba(255,255,255,.08);border:1px solid var(--line);border-radius:999px;padding:8px 12px;font-size:13px;font-weight:800;white-space:nowrap}
.xscaleFooter{max-width:1400px;margin:8px auto 26px;padding:16px 20px;color:var(--muted);font-size:12px;text-align:center}.xscaleFooter a{color:var(--accent);font-weight:700;text-decoration:none}@media(max-width:720px){.xscaleTop{margin:12px 12px 0;align-items:flex-start;flex-direction:column}.xscaleArchiveLink{width:100%;justify-content:center}}

/* XScale public results layout fixes */
#slider_section{
  padding-left:0;
  padding-right:0;
}
#slider_section .slider-page-wrap{
  padding-top:28px;
  padding-bottom:6px;
}
#slider_section .section-head{
  margin-left:0;
  margin-right:0;
}
.pdf-preview-modal{
  padding:24px;
}
.pdf-preview-dialog{
  width:min(1180px, calc(100vw - 48px));
  max-height:calc(100vh - 48px);
}
.pdf-preview-header button,
#pdf_preview_close,
#lightbox_close{
  display:inline-flex;
  align-items:center;
  justify-content:center;
}


/* XScale global controls + light theme for results */
.xscaleTopActions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.xscaleControls{display:inline-flex;align-items:center;gap:8px}
.xscaleControls .theme-btn,.xscaleControls .langBtn{border:1px solid var(--line);background:rgba(255,255,255,.08);color:var(--text);border-radius:999px;padding:8px 11px;font-weight:900;cursor:pointer;line-height:1}
.xscaleControls .theme-btn:hover,.xscaleControls .langBtn:hover,.xscaleArchiveLink:hover{filter:brightness(1.08)}
body.light-theme{--bg:#eef4ff;--bg2:#f8fbff;--panel:#ffffff;--panel2:#f3f7ff;--text:#0f172a;--muted:#475569;--line:rgba(15,23,42,.13);--gold:#a16207;--accent:#1d4ed8;--shadow:0 18px 50px rgba(30,64,175,.14);background:linear-gradient(135deg,#f8fbff 0%,#dbeafe 52%,#bfdbfe 100%);}
body.light-theme .xscaleTop,body.light-theme .stat-card,body.light-theme .result-card,body.light-theme .hero-highlight,body.light-theme .table-wrap,body.light-theme .pdf-preview-dialog{background:rgba(255,255,255,.78);}
body.light-theme header{background:linear-gradient(135deg,rgba(255,255,255,.72),rgba(219,234,254,.62));}
body.light-theme .hero-badge,body.light-theme .hero-badge-btn,body.light-theme .xscaleArchiveLink,body.light-theme .xscaleControls .theme-btn,body.light-theme .xscaleControls .langBtn{background:rgba(255,255,255,.88);color:#0f172a;}
@media(max-width:720px){.xscaleTopActions{width:100%;justify-content:space-between}.xscaleTopActions .xscaleArchiveLink{width:auto;flex:1}.xscaleControls{margin-left:auto}}


/* XScale light theme hardening */
body.light-theme {
  --bg:#eef4ff;
  --bg2:#f8fbff;
  --panel:#ffffff;
  --panel2:#f3f7ff;
  --text:#0f172a;
  --muted:#334155;
  --line:rgba(15,23,42,.14);
  --gold:#9a6700;
  --accent:#1d4ed8;
  --shadow:0 18px 45px rgba(30,64,175,.13);
  background:linear-gradient(135deg,#f8fbff 0%,#e0ecff 50%,#c7dbff 100%) !important;
  color:var(--text) !important;
}
body.light-theme #hero{
  background:radial-gradient(circle at top left, rgba(37,99,235,.13), transparent 35%),radial-gradient(circle at top right, rgba(212,175,55,.12), transparent 30%),linear-gradient(135deg,#f8fbff 0%,#eaf2ff 54%,#d7e6ff 100%) !important;
  border-bottom-color:rgba(15,23,42,.12);
}
body.light-theme .xscaleTop,
body.light-theme .stat-card,
body.light-theme .result-card,
body.light-theme .card,
body.light-theme .hero-highlight,
body.light-theme .table-wrap,
body.light-theme .pdf-preview-dialog,
body.light-theme .filters,
body.light-theme .toolbar,
body.light-theme .section-head{
  background:rgba(255,255,255,.82) !important;
  color:var(--text) !important;
  border-color:rgba(15,23,42,.12) !important;
  box-shadow:var(--shadow);
}
body.light-theme .hero-highlight-card,
body.light-theme .card-body,
body.light-theme .result-body{
  background:transparent !important;
  color:var(--text) !important;
}
body.light-theme #konkurs_nazwa,
body.light-theme .section-head h2,
body.light-theme .hero-highlight-body h3,
body.light-theme .card-body h3,
body.light-theme .result-card h3,
body.light-theme .xscaleBrandName{
  color:#0f172a !important;
  text-shadow:none !important;
}
body.light-theme #konkurs_opis,
body.light-theme .section-head p,
body.light-theme .hero-highlight-body p,
body.light-theme .card-body p,
body.light-theme .result-card p,
body.light-theme .stat-card small,
body.light-theme .xscaleBrandSub{
  color:#334155 !important;
}
body.light-theme .hero-badge,
body.light-theme .hero-badge-btn,
body.light-theme .xscaleArchiveLink,
body.light-theme .xscaleControls .theme-btn,
body.light-theme .xscaleControls .langBtn,
body.light-theme .hero-highlight-kicker,
body.light-theme .badge,
body.light-theme .award-badge{
  background:rgba(255,255,255,.92) !important;
  color:#0f172a !important;
  border-color:rgba(15,23,42,.14) !important;
  text-shadow:none !important;
}
body.light-theme .hero-highlight-kicker,
body.light-theme .badge,
body.light-theme .award-badge{
  background:rgba(234,179,8,.18) !important;
  color:#713f12 !important;
}
body.light-theme input,
body.light-theme select,
body.light-theme textarea{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:rgba(15,23,42,.18) !important;
}
body.light-theme table,
body.light-theme th,
body.light-theme td{
  color:#0f172a !important;
  border-color:rgba(15,23,42,.12) !important;
}
body.light-theme thead th{
  background:#eaf2ff !important;
}
body.light-theme a{ color:#1d4ed8; }

/* =====================================================================
   XScale results final polish: match shared navy theme + readable light mode
   ===================================================================== */
:root,
html[data-theme="dark"]{
  --bg:#0b1220;
  --bg2:#071e31;
  --panel:#111827;
  --panel2:#1e293b;
  --text:#f8fafc;
  --muted:#b6c7e5;
  --line:rgba(255,255,255,.13);
  --gold:#f7d046;
  --accent:#67d4ff;
  --shadow:0 18px 50px rgba(0,0,0,.28);
}

html[data-theme="dark"] body,
body:not(.light-theme){
  background:linear-gradient(135deg,#161b33 0%,#071e31 100%) fixed !important;
  color:var(--text) !important;
}

html[data-theme="dark"] #hero,
body:not(.light-theme) #hero{
  background:
    radial-gradient(circle at top left, rgba(247,208,70,.16), transparent 35%),
    radial-gradient(circle at top right, rgba(103,212,255,.13), transparent 30%),
    linear-gradient(135deg,#111827 0%,#0f172a 56%,#0b1220 100%) !important;
  border-bottom-color:var(--line) !important;
}

html[data-theme="dark"] .xscaleTop,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .card,
html[data-theme="dark"] .hero-highlight,
html[data-theme="dark"] .wyniki-slider,
html[data-theme="dark"] .table-wrap,
html[data-theme="dark"] .section-head,
body:not(.light-theme) .xscaleTop,
body:not(.light-theme) .stat-card,
body:not(.light-theme) .card,
body:not(.light-theme) .hero-highlight,
body:not(.light-theme) .wyniki-slider,
body:not(.light-theme) .table-wrap,
body:not(.light-theme) .section-head{
  background:rgba(17,24,39,.88) !important;
  border-color:var(--line) !important;
  color:var(--text) !important;
  box-shadow:var(--shadow) !important;
}

/* Slider heading was full-width, which pushed helper text too far to the right. */
#slider_section{
  max-width:1400px !important;
  margin:0 auto !important;
  padding:28px 20px 6px !important;
}
#slider_section .section-head{
  width:100% !important;
  max-width:1400px !important;
  margin:0 0 18px 0 !important;
  padding:0 0 12px 0 !important;
  background:transparent !important;
  box-shadow:none !important;
}
#slider_section .section-head h2,
#slider_section .section-head p{
  white-space:normal !important;
}

/* Light mode: keep the same blue/white visual language as the registration pages. */
html[data-theme="light"],
body.light-theme{
  --bg:#eef5ff;
  --bg2:#dff4fb;
  --panel:#ffffff;
  --panel2:#f1f5f9;
  --text:#0f172a;
  --muted:#475569;
  --line:rgba(15,23,42,.14);
  --gold:#b7791f;
  --accent:#0284c7;
  --shadow:0 18px 50px rgba(15,23,42,.14);
}

html[data-theme="light"] body,
body.light-theme{
  background:linear-gradient(135deg,#f8fbff 0%,#eef5ff 55%,#dff4fb 100%) fixed !important;
  color:var(--text) !important;
}

html[data-theme="light"] #hero,
body.light-theme #hero{
  background:
    radial-gradient(circle at top left, rgba(2,132,199,.10), transparent 35%),
    radial-gradient(circle at top right, rgba(183,121,31,.10), transparent 30%),
    linear-gradient(135deg,#f8fbff 0%,#eef5ff 55%,#dff4fb 100%) !important;
  border-bottom-color:var(--line) !important;
}

html[data-theme="light"] .xscaleTop,
html[data-theme="light"] .stat-card,
html[data-theme="light"] .card,
html[data-theme="light"] .hero-highlight,
html[data-theme="light"] .wyniki-slider,
html[data-theme="light"] .table-wrap,
html[data-theme="light"] .section-head,
html[data-theme="light"] .table-toolbar,
body.light-theme .xscaleTop,
body.light-theme .stat-card,
body.light-theme .card,
body.light-theme .hero-highlight,
body.light-theme .wyniki-slider,
body.light-theme .table-wrap,
body.light-theme .section-head,
body.light-theme .table-toolbar{
  background:rgba(255,255,255,.92) !important;
  border-color:var(--line) !important;
  color:var(--text) !important;
  box-shadow:var(--shadow) !important;
}

html[data-theme="light"] .section-head,
body.light-theme .section-head{
  box-shadow:none !important;
  border-left:0 !important;
  border-right:0 !important;
  border-top:0 !important;
}

html[data-theme="light"] #slider_section .section-head,
body.light-theme #slider_section .section-head{
  background:transparent !important;
  box-shadow:none !important;
}

html[data-theme="light"] #konkurs_nazwa_text,
html[data-theme="light"] .section-head h2,
html[data-theme="light"] .hero-highlight-body h3,
html[data-theme="light"] .wyniki-slide-caption h3,
html[data-theme="light"] .card-body h3,
html[data-theme="light"] .stat-card span,
body.light-theme #konkurs_nazwa_text,
body.light-theme .section-head h2,
body.light-theme .hero-highlight-body h3,
body.light-theme .wyniki-slide-caption h3,
body.light-theme .card-body h3,
body.light-theme .stat-card span{
  color:#0b1220 !important;
  text-shadow:none !important;
}

html[data-theme="light"] #konkurs_opis,
html[data-theme="light"] .section-head p,
html[data-theme="light"] .hero-highlight-body p,
html[data-theme="light"] .wyniki-slide-caption p,
html[data-theme="light"] .card-meta p,
html[data-theme="light"] .stat-card small,
body.light-theme #konkurs_opis,
body.light-theme .section-head p,
body.light-theme .hero-highlight-body p,
body.light-theme .wyniki-slide-caption p,
body.light-theme .card-meta p,
body.light-theme .stat-card small{
  color:var(--muted) !important;
}

/* Buttons/inputs must stay visible in light mode, including disabled export/preview buttons. */
html[data-theme="light"] .hero-badge,
html[data-theme="light"] .hero-badge-btn,
html[data-theme="light"] .view-toggle-icon,
html[data-theme="light"] .xscaleArchiveLink,
html[data-theme="light"] .xscaleControls .theme-btn,
html[data-theme="light"] .xscaleControls .langBtn,
html[data-theme="light"] .table-search-clear,
html[data-theme="light"] .photo-btn,
html[data-theme="light"] .icon-btn,
html[data-theme="light"] .diploma-btn,
body.light-theme .hero-badge,
body.light-theme .hero-badge-btn,
body.light-theme .view-toggle-icon,
body.light-theme .xscaleArchiveLink,
body.light-theme .xscaleControls .theme-btn,
body.light-theme .xscaleControls .langBtn,
body.light-theme .table-search-clear,
body.light-theme .photo-btn,
body.light-theme .icon-btn,
body.light-theme .diploma-btn{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:rgba(15,23,42,.18) !important;
  opacity:1 !important;
  box-shadow:0 4px 16px rgba(15,23,42,.08) !important;
}

html[data-theme="light"] .hero-badge,
html[data-theme="light"] .hero-badge-btn,
html[data-theme="light"] .hero-highlight-kicker,
html[data-theme="light"] .wyniki-slide-badge,
html[data-theme="light"] .card-badge,
body.light-theme .hero-badge,
body.light-theme .hero-badge-btn,
body.light-theme .hero-highlight-kicker,
body.light-theme .wyniki-slide-badge,
body.light-theme .card-badge{
  background:#fff7d6 !important;
  color:#713f12 !important;
  border-color:rgba(183,121,31,.25) !important;
}

html[data-theme="light"] .table-search-input,
html[data-theme="light"] .table-material-filter,
body.light-theme .table-search-input,
body.light-theme .table-material-filter{
  background:#ffffff !important;
  color:#0f172a !important;
  border-color:rgba(15,23,42,.18) !important;
}
html[data-theme="light"] .table-search-input::placeholder,
body.light-theme .table-search-input::placeholder{
  color:#64748b !important;
}
html[data-theme="light"] .results-table th,
body.light-theme .results-table th{
  background:#eaf2ff !important;
  color:#0f172a !important;
}
html[data-theme="light"] .results-table td,
body.light-theme .results-table td{
  color:#0f172a !important;
  border-color:rgba(15,23,42,.12) !important;
}
html[data-theme="light"] .results-table tr:hover td,
body.light-theme .results-table tr:hover td{
  background:#f8fbff !important;
}

html[data-theme="light"] button:disabled,
html[data-theme="light"] .diploma-btn-disabled,
body.light-theme button:disabled,
body.light-theme .diploma-btn-disabled{
  opacity:.72 !important;
  background:#f1f5f9 !important;
  color:#475569 !important;
  border-color:rgba(15,23,42,.16) !important;
}


/* === GLOBAL THEME FIX === */

body {
    transition: background 0.2s ease, color 0.2s ease;
}

body.dark {
    background: radial-gradient(circle at top, #0f1c2e, #0b1220);
    color: #e5e7eb;
}

body.light {
    background: #f5f7fb;
    color: #1a2a44;
}

.card, .panel, .box, .modal-content {
    border-radius: 12px;
}

body.dark .card, 
body.dark .panel,
body.dark .box,
body.dark .modal-content {
    background: #0f1c2e;
    color: #e5e7eb;
}

body.light .card, 
body.light .panel,
body.light .box,
body.light .modal-content {
    background: #ffffff;
    color: #1a2a44;
    border: 1px solid #e3e6ef;
}

button {
    transition: all 0.2s ease;
}

body.dark button {
    background: #1f2a44;
    color: #e5e7eb;
    border: 1px solid #2c3a5c;
}

body.light button {
    background: #ffffff;
    color: #1a2a44;
    border: 1px solid #d0d7e2;
}

body.light button:hover {
    background: #eef2f7;
}

.modal {
    backdrop-filter: blur(6px);
}

body.light .modal {
    background: rgba(255,255,255,0.7);
}

body.dark .modal {
    background: rgba(0,0,0,0.6);
}

/* XScale fix: labels in result cards/slider must be visible in light mode */
html[data-theme="light"] .hero-highlight-body strong,
html[data-theme="light"] .wyniki-slide-caption strong,
html[data-theme="light"] .card-meta strong,
body.light-theme .hero-highlight-body strong,
body.light-theme .wyniki-slide-caption strong,
body.light-theme .card-meta strong,
body.light .hero-highlight-body strong,
body.light .wyniki-slide-caption strong,
body.light .card-meta strong{
  color:#0f172a !important;
  font-weight:800 !important;
}

html[data-theme="light"] .card-meta p,
html[data-theme="light"] .hero-highlight-body p,
html[data-theme="light"] .wyniki-slide-caption p,
body.light-theme .card-meta p,
body.light-theme .hero-highlight-body p,
body.light-theme .wyniki-slide-caption p,
body.light .card-meta p,
body.light .hero-highlight-body p,
body.light .wyniki-slide-caption p{
  color:#334155 !important;
}

html[data-theme="light"] .kat-id,
body.light-theme .kat-id,
body.light .kat-id{
  color:#64748b !important;
  opacity:1 !important;
}

/* Grupowanie wyróżnień według kategorii wiekowej w widoku galerii. */
#wyroznienia.grid.age-grouped-results{
  display:block;
}

.age-result-group{
  margin:0 0 28px;
}

.age-result-group:last-child{
  margin-bottom:0;
}

.age-result-group-title{
  margin:0 0 14px;
  padding:10px 14px;
  border-radius:14px;
  background:rgba(255,255,255,.06);
  border:1px solid var(--line);
  color:var(--text);
  font-size:20px;
  font-weight:800;
}

.age-result-group-grid{
  margin:0;
}

html[data-theme="light"] .age-result-group-title,
body.light-theme .age-result-group-title{
  background:rgba(255,255,255,.92);
  color:#111827;
  border-color:rgba(15,23,42,.12);
}

/* Plansza przejściowa w sliderze wyników, np. Młodzik / Plastik. */
.wyniki-slide-separator{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:280px;
  text-align:center;
  background:linear-gradient(135deg, rgba(212,175,55,.16), rgba(255,255,255,.035));
}

.wyniki-slide-separator-inner{
  padding:42px 24px;
}

.wyniki-slide-separator-subtitle{
  margin:10px 0 6px;
  color:var(--muted);
  font-size:24px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}

.wyniki-slide-separator h3{
  margin:0;
  color:var(--text);
  font-size:54px;
  line-height:1.05;
  text-transform:uppercase;
  letter-spacing:.04em;
}

html[data-theme="light"] .wyniki-slide-separator,
body.light-theme .wyniki-slide-separator{
  background:linear-gradient(135deg, rgba(212,175,55,.22), rgba(255,255,255,.92));
}

/* Wyniki: karta modelu */
.model-card-btn{
  appearance:none;
  border:1px solid rgba(212,175,55,.45);
  background:rgba(212,175,55,.14);
  color:#fff3c7;
  border-radius:999px;
  padding:8px 12px;
  font-size:12px;
  font-weight:bold;
  cursor:pointer;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:6px;
  text-decoration:none;
  white-space:nowrap;
}
.model-card-btn:hover{
  background:rgba(212,175,55,.24);
  border-color:rgba(212,175,55,.7);
}
.model-card-btn-small{
  padding:6px 10px;
  font-size:11px;
}
.wyniki-slide-actions{
  margin-top:16px;
}
.model-card-btn-slide{
  font-size:14px;
  padding:10px 16px;
}
.card-actions{
  gap:8px;
  flex-wrap:wrap;
}
.table-photo-cell,
.col-card,
.col-diploma{
  white-space:nowrap;
}

@media (max-width: 900px){
  .results-table tr.results-table-row .col-age,
  .results-table tr.results-table-row .col-card{
    font-size:13px;
    line-height:1.4;
    color:var(--muted);
    margin-bottom:6px;
  }
  .results-table tr.results-table-row .col-age::before{
    content:attr(data-label) ": ";
    color:#fff;
    font-weight:bold;
  }
  .results-table tr.results-table-row .col-card{
    display:inline-flex;
    width:auto;
    margin-top:10px;
    margin-right:8px;
    vertical-align:top;
  }
}

html[data-theme="light"] .model-card-btn,
body.light-theme .model-card-btn{
  color:#5d4300;
  border-color:rgba(145,105,0,.38);
  background:rgba(212,175,55,.2);
}
html[data-theme="light"] .model-card-btn:hover,
body.light-theme .model-card-btn:hover{
  background:rgba(212,175,55,.32);
  border-color:rgba(145,105,0,.58);
}
