:root{
  /* DESERT THEME (default) */
  --bg:#f7ecda;
  --bg2:#f1e0c4;
  --txt:#3a2a18;
  --muted:#8b7255;

  --gold:#d8a341;
  --gold2:#c28a2a;
  --gold3:#e0b96a;
  --honey:#c88f4a;
  --amber:#b0702d;

  --glass: rgba(255,255,255,.18);
  --stroke: rgba(105,78,43,.18);
  --shadow: 0 22px 70px rgba(123,91,54,.40);
  --shadow-gold: 0 18px 55px rgba(210,160,80,.45);

  --panel: rgba(255,252,245,.94);
  --panel-dark: rgba(247,234,211,.98);
}

*{box-sizing:border-box}
html,body{height:100%}

body{
  margin:0;
  /* Tam ekran arka plan resmi */
  background: url("/static/background.jpg") no-repeat center center fixed;
  background-size: cover;
  color:var(--txt);
  font-family: "Segoe UI Variable","Segoe UI",system-ui,-apple-system,Arial;

  /* ESKİ: overflow:hidden; */
  overflow-x: hidden;
  overflow-y: auto;
  position: relative;
}

#bg{
  /* Önceki partikül arka planı kapat – çöl/piramit arka planını gizliyordu */
  display:none;
}

/* Soft desert horizon */
body::before,
body::after{
  content:"";
  position:fixed;
  z-index:0;
  pointer-events:none;
}

/* Horizon line */
body::before{
  left:0;
  right:0;
  bottom:22vh;
  height:120px;
  background:
    radial-gradient(circle at 20% 0%, rgba(255,210,140,.85), transparent 65%),
    radial-gradient(circle at 80% 20%, rgba(255,196,120,.65), transparent 65%);
  opacity:.75;
}

/* Background silhouettes */
body::after{
  left:0;
  right:0;
  bottom:0;
  height:34vh;
  background:
    radial-gradient(180% 120% at 50% 130%, rgba(160,124,70,.85), rgba(107,80,44,.95)),
    linear-gradient(to top, rgba(132,101,55,.88), transparent 55%);
  -webkit-mask:
    radial-gradient(circle at 10% 10%, transparent 0, transparent 18%, black 19%, black 100%);
  mask:
    radial-gradient(circle at 10% 10%, transparent 0, transparent 18%, black 19%, black 100%);
  clip-path:polygon(0% 100%, 0% 45%, 18% 45%, 32% 10%, 46% 45%, 65% 45%, 80% 16%, 94% 45%,100% 45%,100% 100%);
  opacity:.95;
}

@media (max-width:980px){
  body::after{
    height:28vh;
    opacity:.9;
  }
}


.wrap{
  position:relative;
  z-index:1;
  max-width:1180px;
  margin:0 auto;
  padding:18px 18px 26px;
}

.hero{
  display:flex;
  justify-content:center;
  margin: 4px 0 14px;
}
.hero-pill{
  padding:12px 22px;
  border-radius:999px;
  border:1px solid rgba(210,160,80,.55);
  background: linear-gradient(135deg, #f9dfb4, #f3c982);
  box-shadow: 0 14px 40px rgba(163,115,47,.45);
  font-weight:900;
  letter-spacing:1.4px;
  color: #5b3b16;
}

body.light-theme .hero-pill {
  border-color: rgba(212,165,116,.40);
  background: linear-gradient(135deg, rgba(212,165,116,.18), rgba(184,134,11,.10));
  box-shadow: 0 18px 60px rgba(212,165,116,.10), var(--shadow);
  color: var(--gold3);
}

body.blue-theme .hero-pill {
  border-color: rgba(74,158,255,.40);
  background: linear-gradient(135deg, rgba(74,158,255,.18), rgba(45,127,255,.10));
  box-shadow: 0 18px 60px rgba(74,158,255,.10), var(--shadow);
  color: var(--gold3);
}

.sponsor-bar{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  padding:18px 20px 22px;
  margin:10px 0 12px;
  border-radius:999px;
  background: rgba(255,252,245,0.9);
  border:1px solid rgba(210,160,80,.35);
  box-shadow: 0 10px 28px rgba(163,115,47,.28);
}
.sponsor-label{
  font-size:12px;
  font-weight:600;
  letter-spacing:.6px;
  text-transform:uppercase;
  color:var(--muted);
}
.sponsor-logos{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  width:100%;
}
.sponsor-slot{
  flex:1;
  display:flex;
  align-items:center;
}
.sponsor-left{
  justify-content:flex-start;
}
.sponsor-center{
  justify-content:center;
}
.sponsor-right{
  justify-content:flex-end;
}
.sponsor-logo{
  height:120px;
  max-width:260px;
  object-fit:contain;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,.16));
}


.grid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:18px;
}

.card{
  background: var(--panel);
  border-radius:20px;
  padding:16px;
  box-shadow: var(--shadow), 0 0 0 1px rgba(255,191,47,.08);
  backdrop-filter: blur(20px);
  border:1px solid rgba(179,136,77,.35);
  position:relative;
  overflow:hidden;
  min-height: 240px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover{
  border-color: rgba(255,191,47,.20);
  box-shadow: var(--shadow), var(--shadow-gold), 0 0 0 1px rgba(255,191,47,.15);
  transform: translateY(-2px);
}

.card-gold{
  outline: 2px solid rgba(210,160,80,.65);
  outline-offset: -1px;
  background: linear-gradient(145deg, #fdf5e7, #f3e0c3);
}

.card::before{
  content:"";
  position:absolute;
  inset:-40px;
  background:
    radial-gradient(600px 220px at 20% 10%, rgba(255,191,47,.12), transparent 55%),
    radial-gradient(520px 200px at 80% 18%, rgba(255,159,10,.10), transparent 55%),
    radial-gradient(620px 260px at 50% 120%, rgba(212,165,116,.08), transparent 60%);
  pointer-events:none;
  animation: shimmer 8s ease-in-out infinite;
}

@keyframes shimmer {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  position:relative;
  z-index:1;
  margin-bottom:10px;
}

.card-title{
  font-weight:900;
  color: var(--gold3);
  letter-spacing:.3px;
  font-size:14px;
}

.tag{
  font-size:12px;
  color: var(--muted);
  padding:6px 10px;
  border-radius:999px;
  border:1px solid rgba(255,191,47,.25);
  background: rgba(0,0,0,.28);
}

/* UPLOAD LAYOUT */
.upload-body{
  display:grid;
  grid-template-columns: 92px 1fr;
  gap:12px;
  position:relative;
  z-index:1;
}
.upload-icon{
  display:flex;
  align-items:flex-start;
  justify-content:center;
}
.icon-box{
  width:78px;height:78px;
  border-radius:20px;
  border:2px solid rgba(255,191,47,.40);
  background: linear-gradient(135deg, rgba(0,0,0,.45), rgba(5,4,3,.35));
  display:grid;
  place-items:center;
  font-size:28px;
  color: var(--gold3);
  box-shadow: 0 20px 50px rgba(255,191,47,.12), inset 0 1px 0 rgba(255,191,47,.2);
  position: relative;
  overflow: hidden;
}

.icon-box::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 30% 30%, var(--gold), transparent 70%);
  background: radial-gradient(circle at 30% 30%, rgba(255,191,47,.15), transparent 70%);
  pointer-events: none;
}

body.light-theme .icon-box::before {
  background: radial-gradient(circle at 30% 30%, rgba(212,165,116,.15), transparent 70%);
}

body.blue-theme .icon-box::before {
  background: radial-gradient(circle at 30% 30%, rgba(74,158,255,.15), transparent 70%);
}

.dropzone{
  display:block;
  border-radius:18px;
  border:2px solid rgba(255,191,47,.20);
  background: linear-gradient(135deg, rgba(0,0,0,.35), rgba(5,4,3,.25));
  padding:16px;
  cursor:pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.dropzone::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  background: linear-gradient(135deg, rgba(255,191,47,.08), rgba(255,159,10,.04));
  opacity: 0;
  transition: opacity 0.3s;
}

body.light-theme .dropzone::before {
  background: linear-gradient(135deg, rgba(212,165,116,.08), rgba(184,134,11,.04));
}

body.blue-theme .dropzone::before {
  background: linear-gradient(135deg, rgba(74,158,255,.08), rgba(45,127,255,.04));
}

.dropzone:hover::before {
  opacity: 1;
}

.dropzone:hover{
  border-color: rgba(255,191,47,.40);
  background: linear-gradient(135deg, rgba(0,0,0,.45), rgba(5,4,3,.35));
  box-shadow: 0 8px 24px rgba(255,191,47,.15), inset 0 1px 0 rgba(255,191,47,.1);
  transform: translateY(-2px);
}

.dropzone.drag{
  border-color: rgba(255,159,10,.85);
  background: linear-gradient(135deg, rgba(255,159,10,.12), rgba(255,191,47,.08));
  box-shadow: 0 12px 32px rgba(255,159,10,.25);
}
.dropzone input{display:none}
.dz-title{font-weight:900}
.dz-sub{color:var(--muted); font-size:12px; margin-top:3px}
.dz-line{
  height:1px;
  background: rgba(255,255,255,.08);
  margin:10px 0;
}
.dz-meta{
  display:grid;
  grid-template-columns: auto 1fr;
  gap:6px 10px;
  font-size:12px;
}
.dz-meta .k{color: var(--muted)}
.dz-meta .v{color: var(--txt); opacity:.92}

/* STATUS */
.status{
  margin-top:10px;
  display:grid;
  gap:8px;
}
.srow{
  display:flex;
  align-items:center;
  gap:10px;
  padding:12px 14px;
  border-radius:999px;
  background: linear-gradient(135deg, rgba(0,0,0,.35), rgba(5,4,3,.25));
  border: 1.5px solid rgba(255,191,47,.15);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.srow::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,191,47,.05), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.srow:hover::before {
  opacity: 1;
}

.srow:hover {
  border-color: rgba(255,191,47,.30);
  background: linear-gradient(135deg, rgba(0,0,0,.45), rgba(5,4,3,.35));
  transform: translateX(4px);
}
.sdot{
  width:12px;height:12px;
  border-radius:999px;
  border:2px solid rgba(255,255,255,.25);
  box-shadow: 0 0 8px currentColor;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
}

.sdot::after {
  content: "";
  position: absolute;
  inset: -2px;
  border-radius: 999px;
  background: currentColor;
  opacity: 0;
  animation: pulse-dot 2s ease-in-out infinite;
}

.s-wait{
  background: rgba(255,255,255,.12);
  border-color: rgba(255,255,255,.30);
}

.s-ok{
  background: rgba(80,255,140,.70);
  border-color: rgba(80,255,140,.90);
  box-shadow: 0 0 12px rgba(80,255,140,.5);
}

.s-busy{
  background: rgba(255,191,47,.75);
  border-color: rgba(255,191,47,.95);
  box-shadow: 0 0 12px rgba(255,191,47,.5);
  animation: pulse-busy 1.5s ease-in-out infinite;
}

.s-bad{
  background: rgba(255,70,70,.70);
  border-color: rgba(255,70,70,.90);
  box-shadow: 0 0 12px rgba(255,70,70,.5);
}

@keyframes pulse-dot {
  0%, 100% { opacity: 0; transform: scale(1); }
  50% { opacity: 0.3; transform: scale(1.5); }
}

@keyframes pulse-busy {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.6; }
}

.stext{font-size:12px; color:var(--muted)}
.stext .k{color: var(--muted)}
.stext .v{color: var(--txt); margin-left:6px; font-weight:800}

/* BUTTONS */
.actions{
  margin-top:10px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.btn{
  padding:10px 16px;
  border-radius:999px;
  border:1px solid rgba(255,191,47,.25);
  background: rgba(5,4,3,.45);
  color: var(--txt);
  cursor:pointer;
  font-weight:900;
  letter-spacing:.2px;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.btn::before{
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,191,47,.1), rgba(255,159,10,.05));
  opacity: 0;
  transition: opacity 0.25s;
}

.btn:hover::before{
  opacity: 1;
}

.btn:hover{
  border-color: rgba(255,191,47,.55);
  transform: translateY(-1px);
  box-shadow: 0 8px 20px rgba(255,191,47,.15);
}

.btn:active{
  transform: translateY(0);
}

.btn:disabled{opacity:.45; cursor:not-allowed; transform: none !important;}
.btn-honey{
  background: linear-gradient(135deg, rgba(255,191,47,.22), rgba(255,159,10,.14));
  border-color: rgba(255,191,47,.45);
  box-shadow: 0 4px 15px rgba(255,191,47,.12);
}

.btn-honey:hover{
  background: linear-gradient(135deg, rgba(255,191,47,.28), rgba(255,159,10,.18));
  box-shadow: 0 8px 25px rgba(255,191,47,.20);
}
.btn-ghost{
  border-color: rgba(255,255,255,.10);
  color: var(--muted);
}
.btn-wide{
  margin-left:auto;
  min-width: 120px;
}

.analysis-actions{
  margin-top:16px;
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
  position:relative;
  z-index:1;
}

.tool-btn{
  min-height:44px;
  border:1.5px solid rgba(124,88,38,.26);
  border-radius:18px;
  background: linear-gradient(135deg, rgba(255,247,232,.92), rgba(230,203,157,.78));
  color:#604316;
  box-shadow: 0 8px 24px rgba(113,78,28,.16), inset 0 1px 0 rgba(255,255,255,.55);
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:9px 12px;
  font-weight:950;
  font-size:12px;
  line-height:1.1;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

.tool-btn:hover{
  transform: translateY(-1px);
  border-color: rgba(198,138,39,.56);
  background: linear-gradient(135deg, #fff6df, #efc977);
  box-shadow: 0 12px 30px rgba(154,104,28,.24), inset 0 1px 0 rgba(255,255,255,.70);
}

.tool-btn:active{
  transform: translateY(0);
}

.tool-btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  filter:saturate(.65);
  transform:none;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.45);
}

.tool-btn.is-active{
  border-color: rgba(198,138,39,.78);
  background: linear-gradient(135deg, #ffe4a5, #d69b37);
  box-shadow: 0 12px 34px rgba(198,138,39,.28), inset 0 1px 0 rgba(255,255,255,.62);
}

.tool-btn-primary{
  background: linear-gradient(135deg, #fff0bd, #e5ae4b);
  border-color: rgba(198,138,39,.52);
}

.tool-icon{
  width:28px;
  height:24px;
  border-radius:9px;
  display:inline-grid;
  place-items:center;
  flex:0 0 auto;
  background: rgba(78,50,12,.10);
  color:#6a4712;
  font-size:10px;
  font-weight:1000;
  letter-spacing:.2px;
}

.tool-empty,
.tool-error{
  padding:14px;
  border-radius:16px;
  border:1px dashed rgba(198,138,39,.34);
  color:var(--muted);
  background: rgba(255,255,255,.30);
}

.tool-error{
  border-style:solid;
  color:#8a2f20;
  background:rgba(166,61,53,.08);
}

.history-list{
  display:grid;
  gap:10px;
  max-height:400px;
  overflow-y:auto;
}

.history-item{
  display:grid;
  gap:5px;
  padding:12px;
  border-radius:16px;
  border:1px solid rgba(198,138,39,.22);
  background:rgba(255,255,255,.34);
}

.history-time{
  font-size:11px;
  color:var(--muted);
  font-weight:800;
}

.history-main{
  display:flex;
  justify-content:space-between;
  gap:10px;
  align-items:center;
  font-size:12px;
}

.stats-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:12px;
  margin-top:10px;
}

.stat-tile{
  padding:14px;
  border-radius:16px;
  border:1px solid rgba(198,138,39,.22);
  background:rgba(255,255,255,.34);
}

.stat-value{
  color:#7b5216;
  font-size:24px;
  font-weight:1000;
  line-height:1;
  overflow:hidden;
  text-overflow:ellipsis;
}

.stat-label{
  margin-top:7px;
  color:var(--muted);
  font-size:11px;
  font-weight:850;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.comparison-table,
.matrix-table{
  width:100%;
  border-collapse:separate;
  border-spacing:0 7px;
  font-size:12px;
}

.matrix-fit{
  width:100%;
  overflow:hidden;
  margin-top:12px;
}

#cardMatrix{
  grid-column:1 / -1;
}

.matrix-legend{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
  margin-top:10px;
}

.matrix-key{
  display:grid;
  grid-template-columns:34px minmax(0, 1fr);
  gap:8px;
  align-items:center;
  padding:9px 10px;
  border-radius:14px;
  border:1px solid rgba(198,138,39,.20);
  background:rgba(255,255,255,.38);
}

.matrix-key span{
  width:28px;
  height:28px;
  border-radius:10px;
  display:grid;
  place-items:center;
  background:linear-gradient(135deg, #ffe4a5, #d69b37);
  color:#5a390b;
  font-weight:1000;
  font-size:12px;
}

.matrix-key strong{
  min-width:0;
  color:#5d3e12;
  font-size:12px;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.matrix-key small{
  grid-column:2;
  color:var(--muted);
  font-size:10px;
  line-height:1.2;
  overflow-wrap:anywhere;
}

.matrix-table{
  table-layout:fixed;
  border-spacing:0 5px;
  font-size:12px;
}

.comparison-table th,
.matrix-table th{
  padding:8px 10px;
  color:#7b5216;
  font-size:11px;
  text-align:left;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.comparison-table td,
.matrix-table td{
  padding:10px;
  background:rgba(255,255,255,.36);
  border-top:1px solid rgba(198,138,39,.18);
  border-bottom:1px solid rgba(198,138,39,.18);
}

.matrix-table th,
.matrix-table td{
  padding:8px 6px;
  text-align:center;
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  line-height:1.15;
}

.matrix-table td.matrix-score {
  background: rgba(198,138,39,var(--matrix-alpha, .12));
}

.matrix-table th:first-child,
.matrix-table td:first-child{
  width:220px;
  text-align:left;
}

.matrix-table th:not(:first-child),
.matrix-table td:not(:first-child){
  width:calc((100% - 220px) / 10);
}

.matrix-axis{
  display:grid;
  gap:4px;
  justify-items:center;
  min-height:46px;
  align-content:center;
}

.matrix-axis b{
  display:grid;
  place-items:center;
  width:24px;
  height:22px;
  border-radius:8px;
  background:rgba(198,138,39,.18);
  color:#5a390b;
  font-size:12px;
}

.matrix-axis small{
  max-width:100%;
  color:#7a551d;
  font-size:9px;
  font-weight:850;
  line-height:1.12;
  text-transform:none;
  letter-spacing:0;
}

.matrix-row-name{
  display:grid;
  grid-template-columns:30px minmax(0, 1fr);
  gap:8px;
  align-items:center;
}

.matrix-row-name span{
  width:24px;
  height:24px;
  border-radius:8px;
  display:grid;
  place-items:center;
  background:rgba(198,138,39,.18);
  color:#5a390b;
  font-weight:1000;
}

.matrix-row-name strong{
  min-width:0;
  color:#4c3512;
  font-size:11px;
  line-height:1.22;
  overflow-wrap:anywhere;
}

.comparison-table td:first-child,
.matrix-table td:first-child{
  border-left:1px solid rgba(198,138,39,.18);
  border-radius:14px 0 0 14px;
  font-weight:950;
}

.comparison-table td:last-child,
.matrix-table td:last-child{
  border-right:1px solid rgba(198,138,39,.18);
  border-radius:0 14px 14px 0;
}

.score-pill{
  display:inline-flex;
  min-width:54px;
  justify-content:center;
  border-radius:999px;
  padding:5px 8px;
  background:rgba(198,138,39,.16);
  color:#6d4711;
  font-weight:1000;
}

/* TOPK GUI */
.opt{
  margin-top:12px;
  padding:14px;
  border-radius:18px;
  border:1.5px solid rgba(255,191,47,.20);
  background: linear-gradient(135deg, rgba(0,0,0,.40), rgba(5,4,3,.30));
  box-shadow: 0 4px 16px rgba(0,0,0,.3), inset 0 1px 0 rgba(255,191,47,.08);
  position: relative;
  overflow: hidden;
}

.opt::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top, rgba(255,191,47,.06), transparent 70%);
  pointer-events: none;
}
.opt-h{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}
.opt-title{
  font-weight:900;
  color: var(--gold3);
  font-size:12px;
  letter-spacing:.2px;
}
.opt-val{
  font-size:12px;
  color: var(--muted);
}
.seg{
  display:flex;
  gap:8px;
  padding:6px;
  border-radius:999px;
  border:1px solid rgba(255,191,47,.18);
  background: rgba(0,0,0,.22);
}
.seg-item{
  flex:1;
  padding:10px 0;
  border-radius:999px;
  border:1px solid rgba(255,255,255,.08);
  background: rgba(0,0,0,.20);
  color: var(--muted);
  font-weight:1000;
  cursor:pointer;
}
.seg-item:hover{
  border-color: rgba(255,191,47,.25);
  color: var(--txt);
}
.seg-item.is-on{
  background: linear-gradient(135deg, rgba(255,191,47,.20), rgba(255,159,10,.12));
  border-color: rgba(255,191,47,.45);
  color: var(--gold3);
  box-shadow: 0 10px 30px rgba(255,191,47,.06);
}

.hint{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
}

/* RESULT PILL */
.result-pill{
  margin-top:12px;
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  padding:14px 18px;
  border-radius:18px;
  border:2px solid rgba(255,191,47,.35);
  background: linear-gradient(135deg, rgba(255,191,47,.15), rgba(255,159,10,.10));
  color: var(--gold3);
  font-weight:900;
  box-shadow: 0 8px 24px rgba(255,191,47,.15), inset 0 1px 0 rgba(255,191,47,.2);
  position: relative;
  overflow: hidden;
}

.result-pill::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,191,47,.1), transparent);
  animation: result-shimmer 3s ease-in-out infinite;
}

@keyframes result-shimmer {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}
.rp-right{color: var(--gold3); opacity:.95}
.rp-left{color: var(--gold3)}

/* ERROR */
.err{
  margin-top:10px;
  font-size:12px;
  color:#ffd1d1;
  border:1px solid rgba(255,70,70,.4);
  background:rgba(255,70,70,.08);
  padding:10px 12px;
  border-radius:14px;
}
.hidden{display:none}

/* INFO PANEL */
.kv{
  display:grid;
  gap:10px;
  position:relative;
  z-index:1;
}
.kv-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:14px;
  padding:10px 12px;
  border-radius:999px;
  background: rgba(0,0,0,.22);
  border: 1px solid rgba(255,255,255,.08);
}
.kv-row .k{color: var(--muted); font-size:12px}
.kv-row .v{color: var(--txt); font-size:12px; font-weight:900}

.spark-wrap{
  margin-top:12px;
  position:relative;
  z-index:1;
  padding:10px;
  border-radius:16px;
  background: rgba(0,0,0,.22);
  border:1px solid rgba(255,255,255,.08);
}
#spark{width:100%; height:auto; display:block}

.footnote{
  margin-top:10px;
  color: var(--muted);
  font-size:12px;
  position:relative;
  z-index:1;
}

/* PHOTO */
.photo-box{
  position:relative;
  z-index:1;
  border-radius:20px;
  border:2.5px solid rgba(255,191,47,.40);
  background: linear-gradient(135deg, rgba(0,0,0,.40), rgba(5,4,3,.30));
  box-shadow: 0 12px 40px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,191,47,.1);

  /* yükseklik kontrolü: ekrana göre ayarlanır */
  height: clamp(260px, 38vh, 420px);

  display:flex;
  align-items:center;
  justify-content:center;
  overflow:hidden;
}

.photo-box img{
  width: 100%;
  height: 100%;
  display:none;

  /* kadraja sığdır, taşma yok */
  object-fit: contain;

  border-radius:16px;
  filter: drop-shadow(0 18px 28px rgba(0,0,0,.45));
}

.photo-empty{
  position:absolute;
  color: var(--muted);
  font-size:12px;
}

/* Eşleşen paranın referans fotoğrafları (1 ve 2) */
.reference-photos{
  position:relative;
  z-index:1;
}
.reference-photos-title{
  font-size:12px;
  font-weight:700;
  color:var(--gold3);
  margin-bottom:10px;
  letter-spacing:.3px;
}
.reference-photos-grid{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:12px;
}
.reference-photo-slot{
  border-radius:14px;
  border:1.5px solid rgba(255,191,47,.25);
  background: linear-gradient(135deg, rgba(0,0,0,.35), rgba(5,4,3,.25));
  padding:10px;
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}
.reference-photo-label{
  font-size:11px;
  font-weight:900;
  color:var(--muted);
}
.reference-photo-img{
  width:100%;
  max-height:140px;
  object-fit:contain;
  border-radius:10px;
  display:block;
}

/* PROPS */
.props{
  display:grid;
  gap:10px;
  position:relative;
  z-index:1;
}
.p-row{
  display:flex;
  flex-direction:column;           /* Etiket üstte, değer altta */
  align-items:flex-start;
  gap:4px;
  padding:10px 12px;
  border-radius:14px;
  background: linear-gradient(135deg, rgba(0,0,0,.40), rgba(5,4,3,.28));
  border: 1.5px solid rgba(255,191,47,.18);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.p-row::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,191,47,.05), transparent);
  opacity: 0;
  transition: opacity 0.25s;
}

.p-row:hover::before {
  opacity: 1;
}

.p-row:hover {
  border-color: rgba(255,191,47,.32);
  background: linear-gradient(135deg, rgba(0,0,0,.48), rgba(5,4,3,.35));
  transform: translateX(3px);
}
.p-row .k{
  color: var(--gold3);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:.4px;
}
.p-row .v{
  color: var(--txt);
  font-size:12px;
  font-weight:500;
  line-height:1.4;
  width:100%;
  max-width:100%;
  margin-left:0;
  text-align:left;
  overflow-wrap:anywhere;
}

.divider{
  margin:12px 0;
  height:1px;
  background: rgba(255,255,255,.08);
  position:relative;
  z-index:1;
}

.rank-title{
  color: var(--gold3);
  font-weight:1000;
  font-size:12px;
  letter-spacing:.2px;
  margin-bottom:10px;
  position:relative;
  z-index:1;
}
.rank{
  display:grid;
  gap:10px;
  position:relative;
  z-index:1;
}
.rank-item{
  display:flex;
  justify-content:space-between;
  gap:12px;
  padding:12px 14px;
  border-radius:18px;
  background: linear-gradient(135deg, rgba(0,0,0,.35), rgba(5,4,3,.25));
  border: 1.5px solid rgba(255,191,47,.15);
  position: relative;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-item::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,191,47,.08), transparent);
  opacity: 0;
  transition: opacity 0.3s;
}
.rank-left{display:grid; gap:2px}
.rank-name{font-weight:1000; font-size:12px}
.rank-id{font-size:11px; color: var(--muted)}
.rank-score{font-size:12px; font-weight:1000; color: var(--gold3)}

/* DROPDOWN / SELECT STYLES - SİYAH-SARI TEMA */
select, .select-style {
  width: 100%;
  padding: 12px 40px 12px 14px;
  background: rgba(0,0,0,.85) !important;
  border: 1.5px solid rgba(255,191,47,.35) !important;
  border-radius: 14px !important;
  color: var(--gold3) !important;
  font-family: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 14 14'%3E%3Cpath fill='%23ffbf2f' d='M7 10L2 5h10z'/%3E%3C/svg%3E") !important;
  background-repeat: no-repeat !important;
  background-position: right 14px center !important;
  background-size: 14px !important;
  box-shadow: 0 4px 12px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,191,47,.1);
}

select:hover, .select-style:hover {
  border-color: rgba(255,191,47,.55) !important;
  background: rgba(0,0,0,.92) !important;
  box-shadow: 0 6px 20px rgba(255,191,47,.20), inset 0 1px 0 rgba(255,191,47,.15);
  transform: translateY(-1px);
}

select:focus, .select-style:focus {
  outline: none;
  border-color: rgba(255,191,47,.70) !important;
  background: rgba(0,0,0,.95) !important;
  box-shadow: 0 0 0 3px rgba(255,191,47,.20), 0 8px 24px rgba(255,191,47,.25), inset 0 1px 0 rgba(255,191,47,.2);
}

/* DROPDOWN OPTIONS - SİYAH ARKA PLAN, SARI YAZI */
select option, .select-style option {
  background: rgba(0,0,0,.98) !important;
  color: var(--gold3) !important;
  padding: 14px 16px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  border: none !important;
  margin: 2px 0 !important;
}

select option:hover, .select-style option:hover,
select option:focus, .select-style option:focus {
  background: rgba(255,191,47,.25) !important;
  color: #fff !important;
}

select option:checked, .select-style option:checked,
select option[selected], .select-style option[selected] {
  background: linear-gradient(135deg, rgba(255,191,47,.30), rgba(255,159,10,.20)) !important;
  color: #fff !important;
  font-weight: 900 !important;
}

/* RANGE INPUT STYLES - Enhanced with visible track */
input[type="range"] {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, rgba(255,191,47,.15) 0%, rgba(255,191,47,.15) 50%, rgba(5,4,3,.65) 50%, rgba(5,4,3,.65) 100%);
  background-size: 100% 100%;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  margin: 8px 0;
  border: 1px solid rgba(255,191,47,.20);
  box-shadow: inset 0 1px 3px rgba(0,0,0,.3);
}

input[type="range"]::-webkit-slider-runnable-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(5,4,3,.65);
  border: 1px solid rgba(255,191,47,.20);
}

input[type="range"]::-moz-range-track {
  width: 100%;
  height: 8px;
  border-radius: 4px;
  background: rgba(5,4,3,.65);
  border: 1px solid rgba(255,191,47,.20);
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: 3px solid rgba(255,191,47,.50);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,191,47,.40), 0 0 0 2px rgba(255,191,47,.15);
  transition: all 0.2s;
  margin-top: -7px;
}

input[type="range"]::-webkit-slider-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(255,191,47,.40);
}

input[type="range"]::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border: 3px solid rgba(255,191,47,.50);
  cursor: pointer;
  box-shadow: 0 3px 10px rgba(255,191,47,.40), 0 0 0 2px rgba(255,191,47,.15);
  transition: all 0.2s;
}

input[type="range"]::-moz-range-thumb:hover {
  transform: scale(1.15);
  box-shadow: 0 4px 12px rgba(255,191,47,.40);
}

/* SMOOTH ANIMATIONS */
* {
  transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.card, .btn, .seg-item, .rank-item {
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.rank-item:hover {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  background: linear-gradient(135deg, rgba(255,191,47,.15), rgba(255,159,10,.08));
  border-color: var(--gold);
  border-color: rgba(255,191,47,.40);
  transform: translateX(6px);
  box-shadow: 0 6px 20px rgba(255,191,47,.15);
}

body.light-theme .rank-item:hover {
  background: linear-gradient(135deg, rgba(212,165,116,.20), rgba(184,134,11,.12));
  border-color: rgba(212,165,116,.40);
  box-shadow: 0 6px 20px rgba(212,165,116,.18);
}

body.blue-theme .rank-item:hover {
  background: linear-gradient(135deg, rgba(74,158,255,.20), rgba(45,127,255,.12));
  border-color: rgba(74,158,255,.40);
  box-shadow: 0 6px 20px rgba(74,158,255,.18);
}

.rank-item:hover::before {
  opacity: 1;
}

.seg-item {
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.seg-item.is-on {
  animation: pulse-gold 2s ease-in-out infinite;
}

@keyframes pulse-gold {
  0%, 100% {
    box-shadow: 0 10px 30px rgba(255,191,47,.06);
  }
  50% {
    box-shadow: 0 10px 35px rgba(255,191,47,.12);
  }
}

/* ENHANCED DROPZONE */
.dropzone{
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.dropzone:hover{
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(255,191,47,.08);
}

.dropzone.drag{
  animation: drag-pulse 1s ease-in-out infinite;
}

@keyframes drag-pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255,159,10,.4);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255,159,10,.0);
  }
}

/* ENHANCED ICON BOX */
.icon-box{
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.icon-box:hover{
  transform: scale(1.05) rotate(5deg);
  box-shadow: 0 20px 45px rgba(255,191,47,.12);
}

/* LIGHT THEME - Gray tones instead of pure white */
body.light-theme {
  --bg: #e8e6e3;
  --txt: #2a2520;
  --muted: #6b6458;
  --panel: rgba(240,238,235,.90);
  --panel-dark: rgba(235,233,230,.95);
  --gold: #d4a020;
  --gold2: #b8860b;
  --gold3: #c9a850;
}

body.light-theme .card {
  background: var(--panel);
  border-color: rgba(212,165,116,.30);
  box-shadow: 0 8px 32px rgba(0,0,0,.12);
}

body.light-theme .card-gold {
  background: linear-gradient(135deg, rgba(240,238,235,.95), rgba(235,233,230,.98));
  outline-color: rgba(212,165,116,.50);
}

body.light-theme .hero-pill {
  border-color: rgba(212,165,116,.40);
  background: linear-gradient(135deg, rgba(212,165,116,.18), rgba(184,134,11,.10));
  box-shadow: 0 18px 60px rgba(212,165,116,.10), var(--shadow);
  color: var(--gold3);
}

body.light-theme select,
body.light-theme .select-style {
  background: rgba(240,238,235,.95) !important;
  border-color: rgba(212,165,116,.35) !important;
  color: #6b5430 !important;
}

body.light-theme select option,
body.light-theme .select-style option {
  background: rgba(245,243,240,.98) !important;
  color: #6b5430 !important;
}

body.light-theme .btn {
  background: rgba(240,238,235,.70);
  color: var(--txt);
  border-color: rgba(212,165,116,.25);
}

body.light-theme .btn-honey {
  background: linear-gradient(135deg, rgba(212,165,116,.30), rgba(184,134,11,.22));
}

body.light-theme .srow,
body.light-theme .p-row,
body.light-theme .rank-item {
  background: rgba(240,238,235,.60);
  border-color: rgba(212,165,116,.25);
}

body.light-theme input[type="range"] {
  background: linear-gradient(to right, rgba(212,165,116,.20) 0%, rgba(212,165,116,.20) 50%, rgba(200,195,190,.70) 50%, rgba(200,195,190,.70) 100%);
  border-color: rgba(212,165,116,.30);
}

body.light-theme input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(200,195,190,.70);
  border-color: rgba(212,165,116,.30);
}

body.light-theme input[type="range"]::-moz-range-track {
  background: rgba(200,195,190,.70);
  border-color: rgba(212,165,116,.30);
}

body.light-theme input[type="range"]::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-color: rgba(212,165,116,.50);
}

body.light-theme input[type="range"]::-moz-range-thumb {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-color: rgba(212,165,116,.50);
}

/* BLUE THEME - Dark/Light blue mix */
body.blue-theme {
  --bg: #0a1628;
  --txt: #e8f0f8;
  --muted: #8ba3c4;
  --panel: rgba(15,30,50,.88);
  --panel-dark: rgba(10,20,35,.92);
  --gold: #4a9eff;
  --gold2: #2d7fff;
  --gold3: #6bb3ff;
  --honey: #5a9eff;
  --amber: #3d7fff;
}

body.blue-theme .card {
  background: var(--panel);
  border-color: rgba(74,158,255,.25);
  box-shadow: 0 8px 32px rgba(0,0,0,.4), 0 0 0 1px rgba(74,158,255,.12);
}

body.blue-theme .card:hover {
  border-color: rgba(74,158,255,.35);
  box-shadow: 0 12px 40px rgba(74,158,255,.15), 0 0 0 1px rgba(74,158,255,.20);
}

body.blue-theme .card-gold {
  outline-color: rgba(74,158,255,.45);
  background: linear-gradient(135deg, rgba(15,30,50,.92), rgba(10,20,35,.95));
}

body.blue-theme .hero-pill {
  border-color: rgba(74,158,255,.40);
  background: linear-gradient(135deg, rgba(74,158,255,.18), rgba(45,127,255,.10));
  box-shadow: 0 18px 60px rgba(74,158,255,.10), var(--shadow);
  color: var(--gold3);
}

body.blue-theme select,
body.blue-theme .select-style {
  background: rgba(15,30,50,.85) !important;
  border-color: rgba(74,158,255,.35) !important;
  color: #a8c5e8 !important;
}

body.blue-theme select option,
body.blue-theme .select-style option {
  background: rgba(20,40,65,.95) !important;
  color: #a8c5e8 !important;
}

body.blue-theme .btn {
  background: rgba(15,30,50,.60);
  border-color: rgba(74,158,255,.30);
  color: var(--txt);
}

body.blue-theme .btn-honey {
  background: linear-gradient(135deg, rgba(74,158,255,.25), rgba(45,127,255,.18));
}

body.blue-theme input[type="range"] {
  background: linear-gradient(to right, rgba(74,158,255,.20) 0%, rgba(74,158,255,.20) 50%, rgba(10,20,35,.70) 50%, rgba(10,20,35,.70) 100%);
  border-color: rgba(74,158,255,.25);
}

body.blue-theme input[type="range"]::-webkit-slider-thumb {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-color: rgba(74,158,255,.50);
  box-shadow: 0 3px 10px rgba(74,158,255,.40), 0 0 0 2px rgba(74,158,255,.20);
}

body.blue-theme input[type="range"]::-moz-range-thumb {
  background: linear-gradient(135deg, var(--gold), var(--gold2));
  border-color: rgba(74,158,255,.50);
  box-shadow: 0 3px 10px rgba(74,158,255,.40), 0 0 0 2px rgba(74,158,255,.20);
}

body.blue-theme input[type="range"]::-webkit-slider-runnable-track {
  background: rgba(10,20,35,.70);
  border-color: rgba(74,158,255,.25);
}

body.blue-theme input[type="range"]::-moz-range-track {
  background: rgba(10,20,35,.70);
  border-color: rgba(74,158,255,.25);
}

body.light-theme .tool-btn {
  color: #4a3720;
  background: linear-gradient(135deg, rgba(248,245,239,.96), rgba(231,206,162,.82));
  border-color: rgba(184,134,11,.28);
  box-shadow: 0 10px 28px rgba(154,104,28,.10), inset 0 1px 0 rgba(255,255,255,.70);
}

body.light-theme .tool-btn:hover,
body.light-theme .tool-btn.is-active,
body.light-theme .tool-btn-primary {
  color: #342414;
  background: linear-gradient(135deg, #fff4d6, #e3b65a);
  border-color: rgba(184,134,11,.52);
}

body.light-theme .tool-empty,
body.light-theme .tool-error,
body.light-theme .history-item,
body.light-theme .stat-tile,
body.light-theme .matrix-key,
body.light-theme .comparison-table td,
body.light-theme .matrix-table td {
  color: #2a2520;
  background: rgba(248,246,242,.72);
  border-color: rgba(184,134,11,.22);
}

body.light-theme .tool-icon,
body.light-theme .score-pill,
body.light-theme .matrix-key span,
body.light-theme .matrix-axis b,
body.light-theme .matrix-row-name span {
  color: #4a3212;
  background: rgba(184,134,11,.18);
}

body.light-theme .comparison-table th,
body.light-theme .matrix-table th,
body.light-theme .matrix-key strong,
body.light-theme .matrix-axis small,
body.light-theme .matrix-row-name strong,
body.light-theme .stat-value {
  color: #654719;
}

body.light-theme .matrix-table td.matrix-score {
  background: rgba(184,134,11,var(--matrix-alpha, .12));
}

body.light-theme .matrix-key small {
  color: #776b5e;
}

body.light-theme .p-row:hover {
  background: rgba(248,246,242,.82);
}

body.blue-theme .tool-btn {
  color: #e8f0f8;
  background: linear-gradient(135deg, rgba(28,57,91,.92), rgba(12,31,55,.88));
  border-color: rgba(74,158,255,.28);
  box-shadow: 0 12px 30px rgba(3,12,25,.26), inset 0 1px 0 rgba(255,255,255,.08);
}

body.blue-theme .tool-btn:hover,
body.blue-theme .tool-btn.is-active,
body.blue-theme .tool-btn-primary {
  color: #f2f8ff;
  background: linear-gradient(135deg, rgba(74,158,255,.38), rgba(45,127,255,.26));
  border-color: rgba(107,179,255,.52);
  box-shadow: 0 12px 34px rgba(45,127,255,.18), inset 0 1px 0 rgba(255,255,255,.14);
}

body.blue-theme .tool-empty,
body.blue-theme .tool-error,
body.blue-theme .history-item,
body.blue-theme .stat-tile,
body.blue-theme .matrix-key,
body.blue-theme .comparison-table td,
body.blue-theme .matrix-table td {
  color: #e8f0f8;
  background: rgba(15,30,50,.64);
  border-color: rgba(74,158,255,.22);
}

body.blue-theme .tool-icon,
body.blue-theme .score-pill,
body.blue-theme .matrix-key span,
body.blue-theme .matrix-axis b,
body.blue-theme .matrix-row-name span {
  color: #e8f0f8;
  background: rgba(74,158,255,.20);
}

body.blue-theme .comparison-table th,
body.blue-theme .matrix-table th,
body.blue-theme .matrix-key strong,
body.blue-theme .matrix-axis small,
body.blue-theme .matrix-row-name strong,
body.blue-theme .stat-value {
  color: #a8c5e8;
}

body.blue-theme .matrix-table td.matrix-score {
  background: rgba(74,158,255,var(--matrix-alpha, .12));
}

body.blue-theme .matrix-key small {
  color: #8ba3c4;
}

body.blue-theme .p-row:hover {
  background: linear-gradient(135deg, rgba(16,34,57,.82), rgba(10,20,35,.70));
}

@media (max-width: 980px){
  body{overflow:auto}
  #bg{position:absolute}
  .grid{grid-template-columns:1fr}
  .analysis-actions{grid-template-columns:repeat(2, minmax(0, 1fr))}
  .stats-grid{grid-template-columns:1fr}
  .matrix-legend{grid-template-columns:1fr}
}

@media (max-width: 720px){
  body:not(.tech-page){
    background-attachment: scroll;
  }

  body:not(.tech-page)::before,
  body:not(.tech-page)::after{
    opacity:.35;
  }

  .wrap{
    width:100%;
    max-width:none;
    padding:10px 10px 18px;
  }

  .hero-with-logos{
    flex-direction:column;
    align-items:stretch;
    gap:10px;
    margin:0 0 12px;
  }

  .hero-pill{
    align-self:center;
    max-width:100%;
    padding:10px 16px;
    font-size:15px;
    letter-spacing:.8px;
    text-align:center;
  }

  .coin-top-actions{
    position:static !important;
    inset:auto !important;
    width:100%;
    display:grid !important;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px !important;
    align-items:stretch !important;
  }

  .coin-top-actions .btn,
  .coin-top-actions a{
    width:100%;
    min-width:0 !important;
    min-height:38px;
    justify-content:center;
    padding:7px 8px !important;
    border-radius:12px;
    font-size:11px !important;
    white-space:normal;
    line-height:1.15;
    text-align:center;
  }

  .grid{
    gap:12px;
  }

  .card{
    min-width:0;
    min-height:auto;
    padding:12px;
    border-radius:16px;
  }

  .card:hover,
  .dropzone:hover,
  .srow:hover,
  .p-row:hover,
  select:hover,
  .select-style:hover{
    transform:none;
  }

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

  .tag{
    max-width:100%;
    white-space:normal;
  }

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

  .upload-icon{
    display:none;
  }

  .upload-main,
  .dropzone,
  .opt,
  .result-pill,
  .photo-box,
  .kv,
  .props,
  .rank,
  .history-list,
  #matrixContent,
  #comparisonTable,
  #metadataContent,
  #statsContent{
    min-width:0;
    max-width:100%;
  }

  .dropzone{
    padding:13px;
    border-radius:16px;
  }

  .actions{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:8px;
  }

  .actions .btn{
    width:100%;
    min-width:0;
    padding:10px 8px;
    white-space:normal;
    line-height:1.15;
  }

  .btn-wide{
    margin-left:0;
    grid-column:1 / -1;
  }

  .seg{
    gap:5px;
    padding:5px;
  }

  .seg-item{
    min-width:0;
    padding:9px 0;
  }

  .opt-h,
  .result-pill,
  .history-main,
  .rank-item,
  .kv-row{
    align-items:flex-start;
    flex-direction:column;
  }

  .result-pill,
  .rank-item,
  .kv-row{
    gap:6px;
  }

  .photo-box{
    height:clamp(210px, 48vh, 330px);
    border-radius:16px;
  }

  .reference-photos-grid{
    gap:8px;
  }

  #imageEditTools > div[style*="grid-template-columns"],
  #comparisonBox > div[style*="grid-template-columns"]{
    grid-template-columns:1fr !important;
  }

  #comparisonTable,
  #matrixContent{
    overflow-x:auto;
    -webkit-overflow-scrolling:touch;
  }

  .comparison-table{
    min-width:560px;
  }

  .matrix-fit{
    overflow-x:auto;
  }

  .matrix-table{
    min-width:720px;
  }

  .matrix-table th:first-child,
  .matrix-table td:first-child{
    width:150px;
  }

  .matrix-table th:not(:first-child),
  .matrix-table td:not(:first-child){
    width:56px;
  }
}

@media (max-width: 430px){
  .wrap{
    padding:8px 8px 16px;
  }

  .coin-top-actions{
    grid-template-columns:1fr 1fr;
  }

  .card{
    padding:10px;
    border-radius:14px;
  }

  .actions,
  .analysis-actions{
    grid-template-columns:1fr;
  }

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

  .tool-btn{
    min-height:42px;
    border-radius:14px;
  }

  .photo-box{
    height:240px;
  }
}

/* Nümizma-TECH landing and SCAN-TECH entry pages */
body.tech-page {
  min-height: 100%;
  overflow-x: hidden;
  color: #f8efe3;
  background:
    linear-gradient(120deg, rgba(23,19,15,.92), rgba(64,47,34,.82)),
    url("/static/background.jpg") center / cover fixed no-repeat;
}

body.tech-page::before,
body.tech-page::after {
  display: none;
}

.tech-shell {
  position: relative;
  z-index: 1;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0 56px;
}

.tech-nav {
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 0;
}

.tech-brand,
.tech-link,
.tech-product-card,
.tech-cta,
.tech-play {
  color: inherit;
  text-decoration: none;
}

.tech-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 950;
  font-size: 18px;
}

.tech-brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(226, 185, 106, .44);
  background: rgba(12, 10, 8, .54);
  color: #ffd98d;
  font-size: 13px;
  font-weight: 950;
}

.tech-nav-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.tech-link {
  min-height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border: 1px solid rgba(255, 222, 161, .26);
  border-radius: 8px;
  background: rgba(255,255,255,.08);
  color: #ffdda2;
  font-weight: 850;
  font-size: 13px;
}

.tech-hero {
  min-height: 520px;
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(360px, .98fr);
  align-items: center;
  gap: 34px;
  padding: 46px 0 34px;
}

.tech-hero-copy {
  min-width: 0;
}

.tech-hero-copy h1 {
  max-width: 820px;
}

.tech-hero-copy p {
  max-width: 700px;
}

.tech-kicker,
.tech-section-head span,
.tech-product-tag {
  color: #ffd98d;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.tech-hero h1,
.scan-hero h1 {
  margin: 14px 0 18px;
  color: #fff8ed;
  font-size: 46px;
  line-height: 1.05;
  font-weight: 980;
}

.tech-hero p,
.scan-hero p {
  max-width: 650px;
  margin: 0;
  color: rgba(255,246,232,.82);
  font-size: 17px;
  line-height: 1.72;
}

.tech-hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tech-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
}

.tech-summary-grid div {
  min-width: 0;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .22);
  background: rgba(255,255,255,.08);
}

.tech-summary-grid span {
  display: block;
  margin-bottom: 5px;
  color: #ffd98d;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.tech-summary-grid strong {
  display: block;
  color: #fff8ed;
  font-size: 13px;
  line-height: 1.28;
}

.tech-hero-visual {
  position: relative;
  min-height: 440px;
  display: grid;
  align-content: center;
  gap: 12px;
}

.tech-team-head {
  display: grid;
  gap: 5px;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .24);
  background: rgba(14, 11, 8, .48);
}

.tech-team-head span {
  color: #ffd98d;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.tech-team-head strong {
  color: #fff8ed;
  font-size: 18px;
  line-height: 1.25;
}

.tech-photo-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.tech-photo-slot {
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .26);
  background: rgba(255,255,255,.08);
  box-shadow: 0 24px 70px rgba(0,0,0,.22);
}

.tech-photo-wide {
  grid-column: 1 / -1;
}

.tech-photo-slot img {
  width: 100%;
  height: 190px;
  display: block;
  object-fit: cover;
  background: rgba(255,255,255,.12);
}

.tech-photo-wide img {
  height: 180px;
}

.tech-photo-slot figcaption {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
}

.tech-photo-slot strong {
  color: #fff8ed;
  font-size: 13px;
}

.tech-photo-slot span {
  color: rgba(255,246,232,.68);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.tech-coin-stack {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  transform: rotate(-2deg);
}

.tech-coin-stack img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  padding: 14px;
  border-radius: 8px;
  border: 1px solid rgba(255, 224, 169, .30);
  background: rgba(255,255,255,.88);
  box-shadow: 0 24px 70px rgba(0,0,0,.28);
}

.tech-coin-stack img:nth-child(1) {
  grid-row: span 2;
}

.tech-scan-card {
  position: absolute;
  right: 8px;
  bottom: 18px;
  width: min(260px, 58%);
  display: grid;
  gap: 7px;
  padding: 16px;
  border-radius: 8px;
  border: 1px solid rgba(255, 220, 157, .36);
  background: rgba(27, 20, 14, .84);
  box-shadow: 0 18px 50px rgba(0,0,0,.34);
}

.tech-scan-card strong {
  color: #fff3db;
  font-size: 18px;
}

.tech-scan-card span {
  color: rgba(255,246,232,.78);
  font-size: 13px;
}

.tech-band,
.tech-media-section,
.tech-products,
.scan-hero {
  margin-top: 24px;
  padding: 30px 0;
}

.tech-section-head {
  max-width: 760px;
  margin-bottom: 18px;
}

.tech-section-head h2 {
  margin: 8px 0 0;
  color: #fff4df;
  font-size: 30px;
  line-height: 1.18;
}

.tech-info-grid,
.tech-product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.tech-info-grid-four {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tech-info-item,
.tech-product-card {
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .22);
  background: rgba(255,255,255,.08);
}

.tech-info-item {
  padding: 18px;
}

.tech-info-item span {
  color: #e8b85a;
  font-weight: 950;
  font-size: 12px;
}

.tech-info-item h3,
.tech-product-card h3 {
  margin: 8px 0;
  color: #fff8ee;
  font-size: 20px;
}

.tech-info-item p,
.tech-product-card p {
  margin: 0;
  color: rgba(255,246,232,.78);
  line-height: 1.55;
  font-size: 14px;
}

.tech-story-section,
.tech-duo-section,
.tech-flow-section,
.tech-impact-section,
.scan-roadmap {
  margin-top: 24px;
  padding: 30px 0;
}

.tech-story-section {
  display: grid;
  grid-template-columns: minmax(0, 1.18fr) minmax(280px, .82fr);
  gap: 18px;
  align-items: start;
}

.tech-story-copy p {
  margin: 0 0 14px;
  color: rgba(255,246,232,.80);
  font-size: 15px;
  line-height: 1.72;
}

.tech-proof-list {
  display: grid;
  gap: 10px;
}

.tech-proof-list div,
.tech-flow-grid article,
.tech-impact-grid div {
  min-width: 0;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .22);
  background: rgba(255,255,255,.08);
}

.tech-proof-list div {
  display: grid;
  gap: 5px;
  padding: 15px;
}

.tech-proof-list strong {
  color: #fff8ed;
  font-size: 16px;
}

.tech-proof-list span {
  color: rgba(255,246,232,.72);
  font-size: 13px;
  line-height: 1.45;
}

.tech-flow-grid,
.tech-impact-grid {
  display: grid;
  gap: 12px;
}

.tech-flow-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tech-impact-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tech-flow-grid article,
.tech-impact-grid div {
  padding: 18px;
}

.tech-flow-grid article > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd98d, #d18f29);
  color: #2d1c0e;
  font-weight: 950;
}

.tech-flow-grid h3,
.tech-impact-grid h3 {
  margin: 12px 0 8px;
  color: #fff8ed;
  font-size: 18px;
}

.tech-flow-grid p,
.tech-impact-grid p {
  margin: 0;
  color: rgba(255,246,232,.76);
  font-size: 14px;
  line-height: 1.55;
}

.tech-media-section {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, .7fr);
  gap: 14px;
}

.tech-video-frame {
  min-height: 360px;
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 22px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .25);
  background:
    linear-gradient(180deg, rgba(0,0,0,.10), rgba(0,0,0,.64)),
    url("/static/background.jpg") center / cover no-repeat;
}

.tech-play {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, #ffd98d, #d18f29);
  color: #2d1c0e;
  font-weight: 950;
}

.tech-video-frame strong,
.tech-video-frame span {
  display: block;
}

.tech-video-frame strong {
  color: #fff8ed;
  font-size: 22px;
}

.tech-video-frame span {
  margin-top: 6px;
  color: rgba(255,246,232,.76);
}

.tech-media-side {
  display: grid;
  gap: 14px;
}

.tech-media-side figure {
  margin: 0;
  min-width: 0;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid rgba(255, 222, 161, .22);
  background: rgba(255,255,255,.09);
}

.tech-media-side img {
  width: 100%;
  height: 170px;
  display: block;
  object-fit: contain;
  background: rgba(255,255,255,.86);
}

.tech-media-side figcaption {
  padding: 10px 12px;
  color: rgba(255,246,232,.82);
  font-size: 13px;
  font-weight: 800;
}

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

.tech-product-card {
  display: grid;
  gap: 10px;
  padding: 22px;
  min-height: 230px;
  align-content: start;
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}

.tech-product-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 217, 141, .54);
  background: rgba(255,255,255,.12);
}

.tech-product-primary {
  background: linear-gradient(135deg, rgba(255, 217, 141, .22), rgba(255,255,255,.08));
}

.tech-product-card strong,
.tech-cta {
  width: fit-content;
  margin-top: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 14px;
  border-radius: 8px;
  background: linear-gradient(135deg, #ffd98d, #d18f29);
  color: #2d1c0e;
  font-size: 14px;
  font-weight: 950;
}

.scan-hero {
  min-height: 600px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, .82fr);
  gap: 30px;
  align-items: center;
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.tech-cta-ghost {
  color: #ffdda2;
  background: rgba(255,255,255,.08);
  border: 1px solid rgba(255, 222, 161, .30);
}

.scan-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.scan-preview div {
  min-height: 150px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .26);
  background: rgba(255,255,255,.08);
  color: #ffdda2;
  font-weight: 950;
}

@media (max-width: 900px) {
  .tech-shell {
    width: min(100% - 20px, 720px);
    padding-top: 10px;
  }

  .tech-nav {
    align-items: stretch;
    flex-direction: column;
  }

  .tech-nav-actions {
    justify-content: stretch;
  }

  .tech-link {
    flex: 1;
  }

  .tech-hero,
  .tech-media-section,
  .scan-hero {
    grid-template-columns: 1fr;
  }

  .tech-hero {
    min-height: auto;
    padding-top: 26px;
  }

  .tech-hero h1,
  .scan-hero h1 {
    font-size: 33px;
  }

  .tech-hero p,
  .scan-hero p {
    font-size: 15px;
  }

  .tech-hero-visual {
    min-height: 330px;
  }

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

  .tech-photo-wide {
    grid-column: auto;
  }

  .tech-info-grid,
  .tech-product-grid,
  .tech-summary-grid,
  .tech-flow-grid,
  .tech-impact-grid {
    grid-template-columns: 1fr;
  }

  .tech-story-section {
    grid-template-columns: 1fr;
  }

  .tech-video-frame {
    min-height: 280px;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .tech-hero h1,
  .scan-hero h1 {
    font-size: 28px;
  }

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

  .tech-coin-stack,
  .tech-photo-grid {
    gap: 8px;
  }

  .tech-coin-stack img {
    padding: 8px;
  }

  .tech-photo-slot img,
  .tech-photo-wide img {
    height: 170px;
  }

  .tech-scan-card {
    position: static;
    width: 100%;
    margin-top: 10px;
  }

  .tech-hero-visual {
    min-height: auto;
  }

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

/* SCAN-TECH active workbench */
.scan-workbench-page {
  background:
    radial-gradient(circle at 18% 12%, rgba(255, 217, 141, .18), transparent 34%),
    linear-gradient(125deg, rgba(18,15,12,.96), rgba(51,38,28,.92)),
    url("/static/background.jpg") center / cover fixed no-repeat;
}

.scan-shell {
  width: min(1280px, calc(100% - 28px));
}

.scan-workbench-hero {
  min-height: 210px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 18px;
  align-items: end;
  padding: 34px 0 22px;
}

.scan-title-block h1 {
  max-width: 900px;
  margin: 12px 0 0;
  color: #fff8ed;
  font-size: 39px;
  line-height: 1.08;
  font-weight: 980;
}

.scan-live-status,
.scan-panel {
  min-width: 0;
  border: 1px solid rgba(255, 222, 161, .23);
  border-radius: 8px;
  background: rgba(18, 14, 10, .72);
  box-shadow: 0 24px 70px rgba(0,0,0,.24);
}

.scan-live-status {
  display: grid;
  gap: 6px;
  padding: 16px;
}

.scan-live-status strong,
.scan-panel-head strong {
  color: #fff5df;
  font-weight: 950;
}

.scan-live-status span,
.scan-panel-head span {
  color: #ffd98d;
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.scan-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, .8fr);
  gap: 14px;
}

.scan-panel {
  padding: 16px;
}

.scan-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.scan-video-stage {
  position: relative;
  height: clamp(320px, 46vw, 560px);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .20);
  background:
    linear-gradient(135deg, rgba(255,255,255,.05), rgba(255,255,255,.01)),
    #100c09;
}

.scan-video-stage video {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scan-reticle {
  position: absolute;
  inset: 12%;
  border: 1px dashed rgba(255, 217, 141, .58);
  border-radius: 50%;
  pointer-events: none;
}

.scan-reticle::before,
.scan-reticle::after,
.scan-reticle span::before,
.scan-reticle span::after {
  content: "";
  position: absolute;
  background: rgba(255, 217, 141, .42);
}

.scan-reticle::before {
  left: 50%;
  top: -18px;
  width: 1px;
  height: calc(100% + 36px);
}

.scan-reticle::after {
  top: 50%;
  left: -18px;
  width: calc(100% + 36px);
  height: 1px;
}

.scan-reticle span::before {
  left: calc(50% - 32px);
  top: calc(50% - 32px);
  width: 64px;
  height: 1px;
}

.scan-reticle span::after {
  left: calc(50% - 1px);
  top: calc(50% - 32px);
  width: 1px;
  height: 64px;
}

.scan-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.scan-camera-actions,
.scan-main-actions,
.scan-model-actions {
  margin-top: 12px;
}

.scan-btn {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255, 222, 161, .24);
  border-radius: 8px;
  padding: 9px 13px;
  color: #ffe6b5;
  background: rgba(255,255,255,.08);
  font-weight: 950;
  cursor: pointer;
  transition: transform .18s ease, border-color .18s ease, background .18s ease, opacity .18s ease;
}

.scan-btn:hover {
  transform: translateY(-1px);
  border-color: rgba(255, 217, 141, .56);
  background: rgba(255,255,255,.12);
}

.scan-btn.is-active {
  color: #2d1c0e;
  border-color: rgba(255, 217, 141, .72);
  background: linear-gradient(135deg, #ffd98d, #d18f29);
}

.scan-btn:disabled {
  opacity: .45;
  cursor: not-allowed;
  transform: none;
}

.scan-btn-primary {
  color: #2d1c0e;
  border-color: rgba(255, 217, 141, .72);
  background: linear-gradient(135deg, #ffd98d, #d18f29);
}

.scan-btn-danger {
  color: #ffe2db;
  border-color: rgba(255, 117, 89, .42);
  background: rgba(180, 53, 34, .25);
}

.scan-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.scan-settings-grid label {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .18);
  background: rgba(255,255,255,.06);
}

.scan-settings-grid label span,
.scan-stand-box span,
.scan-model-facts span {
  color: rgba(255,246,232,.68);
  font-size: 11px;
  font-weight: 850;
}

.scan-settings-grid input,
.scan-settings-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(255, 222, 161, .24);
  border-radius: 8px;
  padding: 8px 10px;
  color: #fff6e7;
  background: rgba(0,0,0,.28);
  font: inherit;
  font-weight: 850;
}

.scan-settings-grid select option {
  color: #1b120b;
}

.scan-stand-box {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .18);
  background: rgba(255,255,255,.06);
}

.scan-stand-box div:first-child,
.scan-model-facts div {
  display: grid;
  gap: 5px;
}

.scan-stand-box strong,
.scan-model-facts strong {
  color: #fff5df;
  font-size: 14px;
  overflow-wrap: anywhere;
}

.scan-progress-wrap {
  margin-top: 14px;
}

.scan-progress-info {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #fff1d2;
  font-weight: 950;
  margin-bottom: 8px;
}

.scan-progress {
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(255, 222, 161, .20);
  background: rgba(0,0,0,.32);
}

.scan-progress span {
  width: 0;
  height: 100%;
  display: block;
  border-radius: inherit;
  background: linear-gradient(90deg, #ffd98d, #d18f29);
  transition: width .2s ease;
}

.scan-frames-panel {
  margin-top: 14px;
}

.scan-frame-strip {
  min-height: 126px;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 118px;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.scan-frame-thumb {
  position: relative;
  min-width: 0;
  height: 118px;
  overflow: hidden;
  border: 1px solid rgba(255, 222, 161, .22);
  border-radius: 8px;
  padding: 0;
  background: rgba(255,255,255,.06);
  cursor: pointer;
}

.scan-frame-thumb img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.scan-frame-thumb span,
.scan-frame-thumb strong {
  position: absolute;
  bottom: 6px;
  min-width: 28px;
  min-height: 24px;
  display: grid;
  place-items: center;
  padding: 3px 6px;
  border-radius: 8px;
  color: #24170b;
  background: rgba(255, 217, 141, .92);
  font-size: 11px;
  font-weight: 950;
}

.scan-frame-thumb span {
  left: 6px;
}

.scan-frame-thumb strong {
  right: 6px;
}

.scan-model-layout {
  display: grid;
  grid-template-columns: minmax(280px, .42fr) minmax(0, 1fr);
  gap: 14px;
  margin-top: 14px;
}

.scan-model-facts {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 14px;
}

.scan-model-facts div {
  padding: 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .18);
  background: rgba(255,255,255,.06);
}

.scan-model-stage {
  height: clamp(360px, 45vw, 580px);
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid rgba(255, 222, 161, .20);
  background:
    radial-gradient(circle at 50% 42%, rgba(255, 217, 141, .18), transparent 34%),
    #110d0a;
}

.scan-model-stage canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

@media (max-width: 980px) {
  .scan-workbench-hero,
  .scan-workbench-grid,
  .scan-model-layout {
    grid-template-columns: 1fr;
  }

  .scan-title-block h1 {
    font-size: 31px;
  }

  .scan-video-stage,
  .scan-model-stage {
    height: clamp(300px, 62vw, 460px);
  }
}

@media (max-width: 620px) {
  .scan-shell {
    width: min(100% - 18px, 620px);
  }

  .scan-title-block h1 {
    font-size: 26px;
  }

  .scan-panel {
    padding: 12px;
  }

  .scan-settings-grid,
  .scan-stand-box {
    grid-template-columns: 1fr;
  }

  .scan-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .scan-btn {
    width: 100%;
  }

  .scan-frame-strip {
    grid-auto-columns: 104px;
  }
}

/* Coin-TECH refreshed to match the Nümizma-TECH dark interface */
body.coin-page {
  --txt:#fff8ed;
  --muted:rgba(255,246,232,.68);
  --gold:#ffd98d;
  --gold2:#d18f29;
  --gold3:#ffd98d;
  --honey:#d18f29;
  --amber:#b87724;
  --stroke:rgba(255,222,161,.22);
  --panel:rgba(18,14,10,.72);
  --panel-dark:rgba(24,18,13,.86);
  --shadow:0 24px 70px rgba(0,0,0,.24);
  --shadow-gold:0 18px 50px rgba(209,143,41,.16);
  min-height:100%;
  overflow-x:hidden;
  color:#f8efe3;
  background:
    linear-gradient(120deg, rgba(23,19,15,.94), rgba(64,47,34,.84)),
    url("/static/background.jpg") center / cover fixed no-repeat;
}

body.coin-page::before,
body.coin-page::after {
  display:none;
}

body.coin-page .wrap {
  width:min(1280px, calc(100% - 28px));
  max-width:none;
  padding:22px 0 56px;
}

body.coin-page .hero-with-logos {
  min-height:62px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
  margin:0 0 18px;
}

body.coin-page .hero-pill {
  border-radius:8px;
  border:1px solid rgba(226,185,106,.44);
  background:rgba(12,10,8,.54);
  box-shadow:none;
  color:#ffd98d;
  font-size:18px;
  letter-spacing:0;
  padding:10px 14px;
}

body.coin-page .coin-top-actions {
  position:static !important;
  display:flex !important;
  justify-content:flex-end;
  flex-wrap:wrap;
  gap:8px !important;
  align-items:center !important;
}

body.coin-page .coin-top-actions .btn,
body.coin-page .coin-top-actions a {
  min-height:36px;
  border-radius:8px !important;
  padding:8px 12px !important;
  font-size:13px !important;
  color:#ffdda2 !important;
  border:1px solid rgba(255,222,161,.26);
  background:rgba(255,255,255,.08);
}

body.coin-page .grid {
  grid-template-columns:minmax(0, 1.02fr) minmax(0, .98fr);
  gap:14px;
}

body.coin-page .card,
body.coin-page .card-gold {
  min-width:0;
  border-radius:8px;
  border:1px solid rgba(255,222,161,.23);
  outline:0;
  background:rgba(18,14,10,.72);
  box-shadow:0 24px 70px rgba(0,0,0,.24);
  color:#f8efe3;
  backdrop-filter:blur(14px);
}

body.coin-page .card:hover {
  transform:none;
  border-color:rgba(255,217,141,.42);
  box-shadow:0 24px 70px rgba(0,0,0,.28), 0 18px 50px rgba(209,143,41,.10);
}

body.coin-page .card::before {
  display:none;
}

body.coin-page .card-title {
  color:#ffd98d;
  font-size:13px;
  text-transform:uppercase;
  letter-spacing:.02em;
}

body.coin-page .tag {
  border-radius:8px;
  border-color:rgba(255,222,161,.22);
  background:rgba(255,255,255,.08);
  color:rgba(255,246,232,.72);
}

body.coin-page .dropzone,
body.coin-page .opt,
body.coin-page .srow,
body.coin-page .result-pill,
body.coin-page .photo-box,
body.coin-page .kv-row,
body.coin-page .p-row,
body.coin-page .rank-item,
body.coin-page .reference-photo-slot,
body.coin-page .stat-tile,
body.coin-page .history-item,
body.coin-page .matrix-key,
body.coin-page .tool-empty,
body.coin-page .comparison-table td,
body.coin-page .matrix-table td {
  border-radius:8px;
  border-color:rgba(255,222,161,.18);
  background:rgba(255,255,255,.07);
  color:#fff8ed;
  box-shadow:none;
}

body.coin-page .dropzone {
  border-style:dashed;
  border-width:1.5px;
}

body.coin-page .dropzone:hover,
body.coin-page .srow:hover,
body.coin-page .p-row:hover,
body.coin-page .rank-item:hover {
  transform:none;
  border-color:rgba(255,217,141,.42);
  background:rgba(255,255,255,.10);
}

body.coin-page .btn,
body.coin-page .seg-item,
body.coin-page .tool-btn,
body.coin-page select,
body.coin-page .select-style {
  border-radius:8px;
}

body.coin-page .btn {
  min-height:42px;
  color:#ffe6b5;
  border-color:rgba(255,222,161,.24);
  background:rgba(255,255,255,.08);
}

body.coin-page .btn-honey,
body.coin-page .tool-btn-primary {
  color:#2d1c0e;
  border-color:rgba(255,217,141,.72);
  background:linear-gradient(135deg, #ffd98d, #d18f29);
}

body.coin-page .btn-ghost {
  color:#ffdda2;
  background:rgba(255,255,255,.07);
}

body.coin-page .tool-btn {
  color:#ffe6b5;
  border-color:rgba(255,222,161,.24);
  background:rgba(255,255,255,.08);
}

body.coin-page .tool-btn:hover,
body.coin-page .tool-btn.is-active {
  color:#2d1c0e;
  border-color:rgba(255,217,141,.62);
  background:linear-gradient(135deg, #ffd98d, #d18f29);
}

body.coin-page .icon-box,
body.coin-page .tool-icon,
body.coin-page .score-pill,
body.coin-page .matrix-key span,
body.coin-page .matrix-axis b,
body.coin-page .matrix-row-name span {
  border-radius:8px;
  color:#2d1c0e;
  background:linear-gradient(135deg, #ffd98d, #d18f29);
  border-color:rgba(255,217,141,.42);
}

body.coin-page .kv-row .k,
body.coin-page .p-row .k,
body.coin-page .rank-id,
body.coin-page .dz-sub,
body.coin-page .hint,
body.coin-page .footnote,
body.coin-page .matrix-key small {
  color:rgba(255,246,232,.66);
}

body.coin-page .kv-row .v,
body.coin-page .p-row .v,
body.coin-page .rank-name,
body.coin-page .matrix-key strong,
body.coin-page .matrix-row-name strong,
body.coin-page .stat-value {
  color:#fff8ed;
}

body.coin-page .photo-box {
  height:clamp(300px, 35vw, 440px);
  background:
    radial-gradient(circle at 50% 45%, rgba(255,217,141,.12), transparent 36%),
    rgba(0,0,0,.25);
}

body.coin-page .photo-empty {
  color:rgba(255,246,232,.62);
}

body.coin-page select,
body.coin-page .select-style,
body.coin-page input[type="range"] {
  color:#fff8ed;
  border-color:rgba(255,222,161,.24);
  background:rgba(0,0,0,.26);
}

body.coin-page select option,
body.coin-page .select-style option {
  color:#1b120b;
  background:#f7e5bd;
}

body.coin-page .seg {
  border-color:rgba(255,222,161,.18);
  background:rgba(0,0,0,.22);
}

body.coin-page .seg-item {
  color:rgba(255,246,232,.68);
  border-color:rgba(255,222,161,.16);
  background:rgba(255,255,255,.06);
}

body.coin-page .seg-item.is-on {
  color:#2d1c0e;
  border-color:rgba(255,217,141,.62);
  background:linear-gradient(135deg, #ffd98d, #d18f29);
}

body.coin-page .recognize-action {
  margin-top:12px;
  display:grid;
}

body.coin-page .reference-photo-img,
body.coin-page #comparisonOriginal,
body.coin-page #comparisonRef,
body.coin-page #cameraVideo {
  border-color:rgba(255,222,161,.20) !important;
  background:#0f0b08 !important;
}

body.coin-page #cameraModeLabel {
  color:rgba(255,246,232,.68) !important;
}

body.coin-page #cardMatrix,
body.coin-page #cardComparison,
body.coin-page #cardMetadata,
body.coin-page #cardValueHistory {
  grid-column:1 / -1;
}

/* SCAN-TECH compact/mobile tuning */
.scan-workbench-page .tech-brand-mark {
  color:#2d1c0e;
  background:linear-gradient(135deg, #ffd98d, #d18f29);
}

.scan-mode-picker {
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:10px;
  margin-top:12px;
}

.scan-mode-choice {
  min-width:0;
  min-height:86px;
  display:grid;
  align-content:center;
  gap:6px;
  border:1px solid rgba(255,222,161,.20);
  border-radius:8px;
  padding:12px;
  color:#fff1d2;
  background:rgba(255,255,255,.06);
  text-align:left;
  cursor:pointer;
}

.scan-mode-choice strong {
  color:#fff8ed;
  font-size:15px;
}

.scan-mode-choice span {
  color:rgba(255,246,232,.66);
  font-size:12px;
  line-height:1.35;
}

.scan-mode-choice.is-active {
  border-color:rgba(255,217,141,.70);
  background:linear-gradient(135deg, rgba(255,217,141,.24), rgba(255,255,255,.08));
}

@media (max-width: 980px) {
  body.coin-page .grid {
    grid-template-columns:1fr;
  }

  body.coin-page .hero-with-logos {
    align-items:stretch;
    flex-direction:column;
  }

  body.coin-page .hero-pill {
    width:100%;
    text-align:center;
  }

  body.coin-page .coin-top-actions {
    display:grid !important;
    grid-template-columns:repeat(4, minmax(0, 1fr));
  }

  body.coin-page .coin-top-actions .btn,
  body.coin-page .coin-top-actions a {
    width:100%;
    min-width:0 !important;
    white-space:normal;
    line-height:1.15;
  }
}

@media (max-width: 720px) {
  body.coin-page {
    background-attachment:scroll;
  }

  body.coin-page .wrap {
    width:min(100% - 18px, 620px);
    padding:10px 0 28px;
  }

  body.coin-page .coin-top-actions {
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  body.coin-page .grid {
    gap:10px;
  }

  body.coin-page #cardUpload { order:1; }
  body.coin-page #cardPhoto { order:2; }
  body.coin-page #cardProps { order:3; }
  body.coin-page #card3D { order:4; }
  body.coin-page #cardInfo { order:5; }
  body.coin-page #cardHistory { order:6; }
  body.coin-page #cardStats { order:7; }
  body.coin-page #cardComparison { order:8; }
  body.coin-page #cardMatrix { order:9; }
  body.coin-page #cardMetadata { order:10; }
  body.coin-page #cardValueHistory { order:11; }

  body.coin-page .card {
    padding:12px;
  }

  body.coin-page .card-head {
    align-items:flex-start;
    gap:8px;
  }

  body.coin-page .upload-body {
    grid-template-columns:1fr;
  }

  body.coin-page .actions,
  body.coin-page .analysis-actions {
    grid-template-columns:repeat(2, minmax(0, 1fr));
  }

  body.coin-page .btn-wide {
    grid-column:1 / -1;
  }

  body.coin-page .photo-box {
    height:clamp(250px, 70vw, 360px);
  }

  body.coin-page .p-row,
  body.coin-page .kv-row,
  body.coin-page .rank-item {
    align-items:stretch;
    flex-direction:column;
  }

  body.coin-page .result-pill {
    align-items:stretch;
    flex-direction:column;
  }

  .scan-workbench-page {
    background-attachment:scroll;
  }

  .scan-workbench-hero {
    min-height:auto;
    gap:10px;
    padding:18px 0 12px;
  }

  .scan-title-block h1 {
    font-size:24px;
    line-height:1.12;
  }

  .scan-live-status {
    padding:12px;
  }

  .scan-video-stage {
    height:clamp(300px, 92vw, 460px);
  }

  .scan-mode-picker {
    grid-template-columns:1fr;
  }

  .scan-mode-choice {
    min-height:72px;
  }

  .scan-panel-head {
    align-items:flex-start;
    flex-direction:column;
    gap:5px;
  }
}

@media (max-width: 430px) {
  body.coin-page .coin-top-actions {
    grid-template-columns:1fr 1fr;
  }

  body.coin-page .actions,
  body.coin-page .analysis-actions {
    grid-template-columns:1fr;
  }

  .scan-title-block h1 {
    font-size:22px;
  }

  .scan-frame-strip {
    grid-auto-columns:96px;
  }
}
