:root{
  --bg:#0f1220; --panel:#171b2e; --muted:#9aa3b2; --text:#e6e9f2;
  --brand:#43b3ff; --accent:#6cf0c2; --danger:#ff7a7a; --ok:#79d88e;
  --border:#22263c;
}
*{box-sizing:border-box}
html,body{height:100%}
body{
  margin:0; background:linear-gradient(180deg,#0e1120,#0b0e1d);
  color:var(--text); font:14px/1.45 system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,"Helvetica Neue",Arial,"Noto Sans",sans-serif;
}
header{
  position:sticky; top:0; z-index:10; backdrop-filter: blur(6px);
  background:rgba(15,18,32,.75); border-bottom:1px solid var(--border);
}
.wrap{
    /*max-width:1200px; */
    background:var(--bg);
    margin:0 auto; padding:12px 16px}
h1{margin:0; font-size:20px; letter-spacing:.2px}
nav.tabs{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
nav.tabs button{
  background:#12162a; border:1px solid var(--border); color:var(--text);
  padding:8px 10px; border-radius:8px; cursor:pointer;
}
nav.tabs button.active{border-color:var(--brand); box-shadow:0 0 0 2px rgba(67,179,255,.2) inset}
main{display:grid; grid-template-columns:1fr 280px; gap:16px; padding:16px}
@media (max-width:1000px){ main{grid-template-columns:1fr} .ad-vertical{display:none}}
section.tool{
  display:none; background:var(--panel); border:1px solid var(--border);
  border-radius:12px; padding:12px;
}
section.tool.active{display:block}
h2{margin:6px 0 12px 0; font-size:18px}
.row{display:grid; grid-template-columns: 2fr 3fr;  box-sizing: border-box; gap:12px;}
@media (max-width:900px){ .row{grid-template-columns:1fr} }
textarea, input[type="text"], input[type="number"], select{
  width:100%; background:#0f1325; border:1px solid var(--border);
  border-radius:10px; padding:10px; color:var(--text); min-height:280px;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
}
input[type="text"], input[type="number"], select{min-height:unset}
.btns{display:flex; gap:8px; flex-wrap:wrap; margin:8px 0}
button.btn{
  background:linear-gradient(180deg,#1e2444,#151a33);
  border:1px solid var(--border); color:var(--text);
  padding:8px 12px; border-radius:8px; cursor:pointer;
}
button.btn.primary{border-color:var(--brand)}
.out{
  background:#0f1325; border:1px solid var(--border); border-radius:10px; padding:10px; min-height:280px; max-height:500px; min-width:500px; overflow:auto;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace; white-space:pre-wrap; word-break:break-word;
}
.pill{display:inline-flex; align-items:center; gap:6px; padding:4px 8px; border-radius:999px; border:1px solid var(--border); background:#10142a; color:var(--muted); font-size:12px}
.ok{color:var(--ok)} .err{color:var(--danger)}
.ad-horizontal{
  margin:10px 0; background:#0b0f1f; border:1px dashed #2a2f4a;
  border-radius:10px;
   padding:8px; text-align:center;
  color:#8ea0c2; font-size:12px;
}
.ad-vertical{
  position:sticky; top:80px; height:600px; background:#0b0f1f; border:1px dashed #2a2f4a; 
  border-radius:10px; 
  padding:8px;
  display:flex; align-items:center; justify-content:center; color:#8ea0c2; text-align:center;
}
.kvs{display:grid; grid-template-columns:1fr auto; gap:6px; border-bottom:1px solid var(--border); padding:4px 0}
.drop{
  border:2px dashed #3850a6; border-radius:12px; padding:18px; text-align:center; color:var(--muted); background:#0d1226;
}
.drop.drag{background:#0f1a3f}
footer{
  margin-top:10px; border-top:1px solid var(--border); background:#0e1121;
}
.small{padding: 2px 10px; font-size:12px; color:var(--muted)}
.copy{
  float:right; font-size:12px; cursor:pointer; color:var(--accent);
}

/* Theme toggle styles */
.theme-toggle {
  background: var(--panel);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 6px 10px;
  border-radius: 6px;
  cursor: pointer;
}

/* Light theme variables */
body.light-theme {
  --bg: #f8f9fa;
  --panel: #ffffff;
  --muted: #6c757d;
  --text: #212529;
  --brand: #007bff;
  --accent: #28a745;
  --danger: #dc3545;
  --ok: #28a745;
  --border: #dee2e6;
}

body.light-theme {
  background: linear-gradient(180deg, #f8f9fa, #e9ecef);
}

body.light-theme header {
  background: rgba(248, 249, 250, 0.9);
}

body.light-theme nav.tabs button {
  background: #ffffff;
}

body.light-theme section.tool {
  background: #ffffff;
}

body.light-theme textarea,
body.light-theme input[type="text"],
body.light-theme input[type="number"],
body.light-theme select {
  background: #f8f9fa;
}

body.light-theme .out {
  background: #f8f9fa;
}

body.light-theme button.btn {
  background: linear-gradient(180deg, #ffffff, #f8f9fa);
  border-color: #dee2e6;
  color: #212529;
}

body.light-theme button.btn:hover {
  background: linear-gradient(180deg, #f8f9fa, #e9ecef);
}

body.light-theme button.btn.primary {
  border-color: #007bff;
  background: linear-gradient(180deg, #007bff, #0056b3);
  color: #ffffff;
}

body.light-theme button.btn.primary:hover {
  background: linear-gradient(180deg, #0056b3, #004085);
}

body.light-theme .ad-horizontal,
body.light-theme .ad-vertical {
  background: #e9ecef;
  border-color: #adb5bd;
  color: #6c757d;
}

body.light-theme footer {
  background: #f8f9fa;
  border-top-color: #dee2e6;
}

body.light-theme .drop {
  background: #f8f9fa;
  border-color: #007bff;
  color: #6c757d;
}

body.light-theme .drop.drag {
  background: #e3f2fd;
}

/* Tool cards for home page */
.tool-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
  text-decoration: none;
  display: block;
  color: inherit;
}

.tool-card:hover {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(67,179,255,.1);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}

.tool-card h3 {
  margin: 0 0 10px 0;
  color: var(--brand);
  font-size: 16px;
}

.tool-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.4;
}

/* Light theme tool cards */
body.light-theme .tool-card {
  background: #ffffff;
  border-color: #dee2e6;
}

body.light-theme .tool-card:hover {
  border-color: #007bff;
  box-shadow: 0 0 0 2px rgba(0,123,255,.1);
}

body.light-theme .pill {
  background: #f8f9fa;
  border-color: #dee2e6;
  color: #6c757d;
}

body.light-theme .pill .ok {
  color: #28a745;
}

body.light-theme .pill .err {
  color: #dc3545;
} 