:root{
  --bg:#0f1724;
  --card:#0b1220;
  --accent:#0ea5a0;
  --muted:#94a3b8;
  --glass:rgba(255,255,255,0.03);
  --radius:12px;
}

*{box-sizing:border-box}
html,body{
  height:100%;
  margin:0;
  font-family:Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial;
  background: linear-gradient(180deg,#071428 0%, #071c2a 100%);
  color:#e6eef6;
  -webkit-font-smoothing:antialiased;
}

.container{
  max-width:980px;
  margin:28px auto;
  padding:20px;
}

header{
  text-align:center;
  margin-bottom:18px;
}
h1{margin:0;font-size:1.6rem}
.subtitle{margin:6px 0 0;color:var(--muted);font-size:0.95rem}

.card{
  background: linear-gradient(180deg, rgba(255,255,255,0.02), rgba(255,255,255,0.01));
  border-radius:var(--radius);
  padding:14px;
  box-shadow: 0 6px 20px rgba(2,6,23,0.5), inset 0 1px 0 rgba(255,255,255,0.02);
  margin-bottom:14px;
}

.controls .row{
  display:flex;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
  flex-wrap:wrap;
}

.btn{
  padding:10px 14px;
  border-radius:10px;
  border:none;
  cursor:pointer;
  font-weight:600;
  background:transparent;
  color:inherit;
  transition:transform .14s ease, box-shadow .14s;
}

.btn.primary{
  background:linear-gradient(90deg,var(--accent),#06b6d4);
  color:#052023;
  box-shadow: 0 6px 18px rgba(14,165,160,0.12);
}
.btn:active{transform:translateY(1px)}

.settings label{
  display:flex;
  flex-direction:column;
  font-size:0.85rem;
  color:var(--muted);
  min-width:110px;
}

.settings input[type="number"], .settings select{
  padding:8px;
  margin-top:6px;
  border-radius:8px;
  border:none;
  background:rgba(255,255,255,0.03);
  color:inherit;
}

.small-stats
{
  display:flex;gap:18px;color:var(--muted);font-size:0.9rem
}

.preview-history
{
  display:grid;
  grid-template-columns:320px 1fr;
  gap:14px;
  align-items:start;
}

.preview-card{
  display:flex;
  gap:12px;
  align-items:center;
  padding:10px;
  border-radius:10px;
  background:var(--glass);
  margin-bottom:8px;
}
.preview-card img{
  width:56px;height:56px;border-radius:12px;object-fit:cover;background:#071428;padding:6px;
}
.title{font-weight:700}
.body{color:var(--muted);font-size:0.95rem;}

.history-list{
  max-height:360px;
  overflow:auto;
  padding:6px;
  display:flex;
  flex-direction:column;
  gap:8px;
}
.history-item{
  display:flex;
  gap:10px;
  align-items:center;
  padding:8px;
  border-radius:10px;
  background:linear-gradient(90deg, rgba(255,255,255,0.01), rgba(255,255,255,0.005));
  border:1px solid rgba(255,255,255,0.02);
}
.history-item img{width:40px;height:40px;border-radius:8px;object-fit:cover}
.history-item .meta{display:flex;flex-direction:column}
.time{font-size:0.78rem;color:var(--muted)}

.legend{display:flex;gap:10px;flex-wrap:wrap}
.legend .chip{display:inline-flex;gap:8px;align-items:center;padding:6px 10px;border-radius:999px;background:rgba(255,255,255,0.02);font-size:0.9rem}
.chip img{width:18px;height:18px;border-radius:4px;}

.switch{position:relative;display:inline-block;width:46px;height:26px}
.switch input{opacity:0;width:0;height:0}
.slider{position:absolute;cursor:pointer;top:0;left:0;right:0;bottom:0;background:rgba(255,255,255,0.09);transition:.2s;border-radius:999px}
.slider:before{position:absolute;content:"";height:20px;width:20px;left:3px;top:3px;background:white;border-radius:50%;transition:.2s}
.switch input:checked + .slider{background:linear-gradient(90deg,var(--accent),#06b6d4)}
.switch input:checked + .slider:before{transform:translateX(20px)}

.muted{color:var(--muted);font-size:0.9rem}

@media (max-width:880px){
  .preview-history{grid-template-columns:1fr; }
  .container{padding:12px}
}
