:root{
  --bg: #f6f6f6;
  --text:#0b0b0b;
  --muted:#3d3d3d;

  --card:#ffffff;
  --stroke:#0b0b0b;

  --accent:#ffd400;   /* neo brutal yellow */
  --accent2:#7c3aed;  /* purple */
  --accent3:#22c55e;  /* green */
  --danger:#ff4d4d;

  --shadow: 6px 6px 0 var(--stroke);
  --shadow2: 10px 10px 0 var(--stroke);

  --radius: 18px;
  --radius2: 14px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --sans: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
}

*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0;
  font-family: var(--sans);
  color: var(--text);
  background:
    radial-gradient(900px 600px at 15% 10%, rgba(124,58,237,0.18), transparent 60%),
    radial-gradient(900px 600px at 85% 15%, rgba(255,212,0,0.22), transparent 60%),
    radial-gradient(900px 600px at 60% 95%, rgba(34,197,94,0.16), transparent 60%),
    var(--bg);
}

.bg{display:none;} /* not needed in brutal mode */

.container{
  width: min(1180px, 92vw);
  margin: 36px auto 26px;
}

.header{
  display:flex;
  gap:18px;
  align-items:stretch;
  justify-content:space-between;
  margin-bottom: 18px;
}

.brand{
  flex:1;
  display:flex;
  gap:14px;
  align-items:center;
  padding:18px;
  border:3px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow2);
}

.logo{
  width:54px;height:54px;
  border-radius: 16px;
  display:grid;place-items:center;
  font-weight:900;
  letter-spacing: 0.5px;
  border:3px solid var(--stroke);
  background: linear-gradient(135deg, var(--accent), #fff);
  box-shadow: 5px 5px 0 var(--stroke);
}

.brand h1{margin:0 0 3px;font-size:20px}
.brand p{margin:0;color:var(--muted);font-size:13px;font-weight:600}

.api-box{
  width: min(470px, 40vw);
  padding:18px;
  border:3px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow2);
}

.label{
  display:block;
  font-size:12px;
  margin-bottom:8px;
  color: var(--muted);
  font-weight:800;
  text-transform: uppercase;
  letter-spacing: .6px;
}

.api-row{
  display:flex;
  gap:10px;
  align-items:center;
}

.input{
  width:100%;
  border:3px solid var(--stroke);
  border-radius: 14px;
  padding: 12px 12px;
  background: #fff;
  color: var(--text);
  outline:none;
  font-weight:700;
}
.input:focus{
  box-shadow: 0 0 0 5px rgba(255,212,0,0.45);
}

.hint{
  margin-top:10px;
  font-size:12px;
  color: var(--muted);
  font-weight:600;
}

.grid{
  display:grid;
  grid-template-columns: 1fr 1.25fr;
  gap: 18px;
}

.card{
  border:3px solid var(--stroke);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow2);
  padding:18px;
}

.card.output{min-height: 540px}

.card-title{
  display:flex;
  align-items:center;
  justify-content:space-between;
  margin-bottom: 12px;
}
.card-title h2{margin:0;font-size:16px}

.badge{
  font-size:12px;
  padding:6px 10px;
  border-radius: 999px;
  border:3px solid var(--stroke);
  background: var(--accent);
  font-weight:900;
}
.badge.muted{
  background: #fff;
}

.upload-zone{
  border:3px dashed var(--stroke);
  border-radius: 16px;
  padding:18px;
  background: #fff;
  cursor:pointer;
  transition: 150ms ease;
}
.upload-zone:hover{
  transform: translateY(-2px);
  box-shadow: 10px 10px 0 var(--stroke);
}
.upload-zone.dragover{
  background: rgba(255,212,0,0.35);
}

.upload-content{
  display:flex;
  gap:12px;
  align-items:center;
}

.upload-icon{
  width:48px;height:48px;
  border-radius: 16px;
  display:grid;place-items:center;
  border:3px solid var(--stroke);
  background: rgba(124,58,237,0.12);
}
.upload-icon svg{width:26px;height:26px}

.upload-zone h3{margin:0;font-size:14px}
.upload-zone p{margin:4px 0 0;color:var(--muted);font-weight:700;font-size:12px}

.file-info{
  margin-top:12px;
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}
.file-pill{
  border:3px solid var(--stroke);
  background:#fff;
  border-radius: 999px;
  padding:6px 10px;
  font-size:12px;
  font-weight:900;
}

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

.btn{
  border:3px solid var(--stroke);
  border-radius: 16px;
  padding: 12px 14px;
  font-size: 13px;
  font-weight: 900;
  cursor:pointer;
  background:#fff;
  transition: 150ms ease;
  box-shadow: 5px 5px 0 var(--stroke);
}
.btn:hover{
  transform: translate(-2px, -2px);
  box-shadow: 8px 8px 0 var(--stroke);
}
.btn:active{
  transform: translate(1px, 1px);
  box-shadow: 3px 3px 0 var(--stroke);
}
.btn:disabled{
  opacity:.55;
  cursor:not-allowed;
  transform:none;
  box-shadow: 5px 5px 0 var(--stroke);
}

.btn.primary{
  background: var(--accent);
}
.btn.secondary{
  background: rgba(124,58,237,0.12);
}
.btn.ghost{
  background: #fff;
}

.divider{
  height:1px;
  background: rgba(0,0,0,0.12);
  margin: 16px 0;
}

.controls{
  display:flex;
  gap: 12px;
  justify-content: space-between;
  align-items:flex-end;
  margin-top: 6px;
}
.toggle{
  display:flex;gap:10px;align-items:center;
  font-weight:900;
}

/* Switch */
.switch{ position:relative; width:52px; height:30px; display:inline-block; }
.switch input{ display:none; }
.slider{
  position:absolute; inset:0;
  border-radius:999px;
  border:3px solid var(--stroke);
  background:#fff;
}
.slider:before{
  content:"";
  position:absolute;
  width:22px;height:22px;
  border-radius:999px;
  left:4px; top:50%;
  transform: translateY(-50%);
  background: var(--accent2);
  border:3px solid var(--stroke);
}
.switch input:checked + .slider{
  background: rgba(34,197,94,0.25);
}
.switch input:checked + .slider:before{
  left:22px;
  background: var(--accent3);
}

.status{
  margin-top:10px;
  font-size:13px;
  font-weight:900;
}
.status.good{color: var(--accent3)}
.status.bad{color: var(--danger)}
.status.warn{color: #d97706}

.tabs{
  display:flex;
  gap:10px;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--stroke);
  margin-bottom: 12px;
  flex-wrap: wrap;
}
.tab{
  border:3px solid var(--stroke);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight:900;
  cursor:pointer;
  background:#fff;
  box-shadow: 4px 4px 0 var(--stroke);
  transition: 150ms ease;
}
.tab:hover{ transform: translate(-1px,-1px); box-shadow: 6px 6px 0 var(--stroke); }
.tab.active{ background: rgba(255,212,0,0.55); }

.panel{display:none}
.panel.active{display:block}

.code{
  margin:0;
  padding: 16px;
  border-radius: 16px;
  border:3px solid var(--stroke);
  background:#fff;
  max-height: 440px;
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.65;
}

.text-box{
  border-radius: 16px;
  border:3px solid var(--stroke);
  background:#fff;
  padding: 16px;
  max-height: 440px;
  overflow:auto;
  white-space: pre-wrap;
  font-size: 13px;
  line-height: 1.75;
  font-weight:700;
}

.footer{
  margin-top: 18px;
  display:flex;
  gap:10px;
  justify-content:center;
  align-items:center;
  font-weight:900;
  color: rgba(0,0,0,0.55);
}
.dot{
  width:5px;height:5px;
  border-radius:999px;
  background: rgba(0,0,0,0.35);
}

@media (max-width: 980px){
  .header{flex-direction:column}
  .api-box{width:100%}
  .grid{grid-template-columns:1fr}
}


.topbar{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
  margin-bottom:16px;
}

.topbar-left{
  display:flex;
  gap:14px;
  align-items:center;
}

.topbar-title h1{ margin:0; font-size:22px; }
.topbar-title p{ margin:6px 0 0; color: var(--muted); font-weight:700; max-width: 720px; }

.topbar-right{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
  align-items:center;
  justify-content:flex-end;
}

.chip{
  border:3px solid var(--stroke);
  background:#fff;
  border-radius:999px;
  padding:6px 10px;
  font-weight:900;
  font-size:12px;
  box-shadow: 4px 4px 0 var(--stroke);
}

.how{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 18px;
}

.how-card{
  border:3px solid var(--stroke);
  border-radius: var(--radius);
  background:#fff;
  padding:14px 14px;
  display:flex;
  gap:12px;
  align-items:flex-start;
  box-shadow: 6px 6px 0 var(--stroke);
}

.how-step{
  width:36px;height:36px;
  border-radius: 12px;
  border:3px solid var(--stroke);
  display:grid;
  place-items:center;
  font-weight:900;
  background: var(--accent);
}

.how-card h3{ margin:0; font-size:14px; }
.how-card p{ margin:6px 0 0; color: var(--muted); font-weight:700; font-size:12px; }

.layout{
  display:grid;
  grid-template-columns: 0.95fr 1.25fr;
  gap: 18px;
  align-items:start;
}

.left{
  display:flex;
  flex-direction:column;
  gap:18px;
}

.right{
  position: sticky;
  top: 16px;
  height: fit-content;
}

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

.output-actions{
  display:flex;
  gap:10px;
  flex-wrap: wrap;
}

.mini{
  margin:6px 0 0;
  color: var(--muted);
  font-weight:700;
  font-size:12px;
}

@media (max-width: 980px){
  .how{ grid-template-columns:1fr; }
  .layout{ grid-template-columns:1fr; }
  .right{ position: static; }
}
