@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;700&family=Inter:wght@400;500&display=swap");

:root{
  --bg: #fff;
  --card: #f2f2f2;
  --text: #333;
  --muted: #666;
  --title: #000;
  --shadow: rgba(0,0,0,.15);

  --serif: "Playfair Display", Georgia, serif;
  --sans: "Inter", -apple-system, sans-serif;
}

*{ box-sizing:border-box; margin:0; padding:0; }

body{
  font-family: var(--sans);
  background: var(--bg);
  color: var(--text);
  display:flex;
  justify-content:center;
  align-items:flex-start;
  padding: 2rem 0;
}

main{
  width:100%;
  max-width:1400px;
  padding: 0 3rem;
  display:grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 2.5rem;
}

.column{
  display:flex;
  flex-direction:column;
  gap: 2rem;
}

h1{
  font-family: var(--serif);
  font-size: 2.2rem;
  color: var(--title);
  margin-bottom: .5rem;
}

.intro-text{
  font-size: 1rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.box{
  background: var(--card);
  padding: 2rem;
  box-shadow: 10px 10px 0 var(--shadow);
}

.box h3{
  font-family: var(--serif);
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

input[type="range"]{
  width:100%;
  margin: 1rem 0;
  cursor:pointer;
}

input[type="file"]{ display:none; }

.file-upload-label{
  display:block;
  width:100%;
  padding: .8rem 1.5rem;
  text-align:center;
  font-weight:500;
  font-size:.9rem;
  background:#e0e0e0;
  color:#000;
  border:1px solid #ccc;
  cursor:pointer;
}

#preview{
  display:none;
  max-width:100%;
  max-height:300px;
  object-fit:contain;
  margin: 1.5rem auto 0;
  border:1px solid #ddd;
}

#label-container{
  margin-top:1rem;
  height:15rem;
  overflow:hidden;
}

.probability-item{ margin-bottom:1.2rem; }

.probability-info{
  display:flex;
  justify-content:space-between;
  font-size:.9rem;
  margin-bottom:.4rem;
}

.probability-bar-container{
  height:8px;
  background:#ddd;
}

.probability-bar{
  height:100%;
  width:0%;
  background:#333;
  transition: width .4s ease-out;
}

.result-row{
  margin-bottom:1rem;
  font-size:1.1rem;
  padding-bottom:.5rem;
  border-bottom:1px dashed #ccc;
}

.result-row b{
  font-family: var(--serif);
  margin-right:.5rem;
}

.ok{ color:#2e7d32; font-weight:700; }
.warn{ color:#c62828; font-weight:700; }

.gallery-thumb{
  width:100%;
  height:60px;
  object-fit:cover;
  border:1px solid #ddd;
  cursor:pointer;
  transition: transform .2s, border-color .2s;
}

.gallery-thumb:hover{
  transform: scale(1.05);
  border-color:#000;
  position:relative;
  z-index:10;
}

.category-btn{
  flex:1;
  min-width:100px;
  padding:.5rem 1rem;
  font: 500 .85rem/1 var(--sans);
  background: var(--card);
  border:1px solid #ccc;
  cursor:pointer;
  transition: background .2s, color .2s, border-color .2s;
}

.category-btn:hover{ background:#e0e0e0; }

.category-btn.active{
  background:#333;
  color:#fff;
  border-color:#333;
}

#confusion-table th,
#confusion-table td,
#report-table th,
#report-table td{
  border:1px solid #ccc;
  padding:8px;
  text-align:center;
}

#confusion-table th,
#report-table th{
  background:#eee;
  font-family: var(--serif);
  font-weight:700;
}

.matrix-label-y,
.report-label-x{
  background:#eee;
  font-weight:700;
  width:120px;
  text-align:left;
  padding-left:15px;
}

.matrix-cell,
.report-cell{
  width:80px;
  transition: background-color .3s;
}

.report-summary-row{
  background:#f9f9f9;
  font-weight:500;
}

#run-validation{
  border:1px solid #000;
  transition: background .2s, color .2s;
}

#run-validation:hover{
  background:#000;
  color:#fff;
}

@media (max-height: 850px){
  main{ padding: 0 2rem; gap: 1.5rem; }
  .box{ padding: 1.5rem; }
  #preview{ max-height:200px; }
  h1{ font-size:1.8rem; }
  .column{ gap:1.2rem; }
}
