:root {
  --bg: #0d1117; --panel: #161b22; --panel-2: #1c2230; --border: #30363d;
  --text: #e6edf3; --muted: #8b949e; --accent: #2f81f7; --ok: #3fb950; --err: #f85149;
  --radius: 12px;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'Inter', system-ui, sans-serif; background: var(--bg); color: var(--text); display: flex; min-height: 100vh; }
a { color: var(--accent); text-decoration: none; }

/* Sidebar */
.sidebar { width: 240px; background: var(--panel); border-right: 1px solid var(--border); padding: 22px 14px;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; flex-shrink: 0; }
.brand { font-size: 1.25rem; font-weight: 800; padding: 0 8px 18px; }
.brand span { background: linear-gradient(120deg, #2f81f7, #3fb950); -webkit-background-clip: text; background-clip: text; color: transparent; }
.menu { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.menu button { display: flex; align-items: center; gap: 10px; background: none; border: none; color: var(--muted);
  padding: 10px 12px; border-radius: 8px; font-size: .92rem; font-weight: 500; cursor: pointer; text-align: left; transition: .15s; font-family: inherit; }
.menu button:hover { background: var(--panel-2); color: var(--text); }
.menu button.active { background: var(--accent); color: #fff; }
.sidebar__foot { color: var(--muted); font-size: .82rem; padding: 14px 8px 0; border-top: 1px solid var(--border); }

/* Main */
.main { flex: 1; padding: 40px; max-width: 900px; }
.menu-toggle { display: none; background: var(--panel); border: 1px solid var(--border); color: var(--text);
  font-size: 1.3rem; border-radius: 8px; padding: 6px 12px; margin-bottom: 18px; cursor: pointer; }

.tool { animation: fade .25s; }
@keyframes fade { from { opacity: 0; transform: translateY(8px); } }
.tool__head { margin-bottom: 22px; }
.tool__head h1 { font-size: 1.7rem; font-weight: 800; display: flex; align-items: center; gap: 10px; }
.tool__head p { color: var(--muted); margin-top: 6px; }

.field { margin-bottom: 16px; }
.field label { display: block; color: var(--muted); font-size: .85rem; margin-bottom: 7px; font-weight: 600; }
textarea, input, select { width: 100%; background: var(--panel); border: 1px solid var(--border); color: var(--text);
  border-radius: 10px; padding: 12px 14px; font-family: 'JetBrains Mono', monospace; font-size: .92rem; outline: none; resize: vertical; transition: border-color .2s; }
textarea:focus, input:focus, select:focus { border-color: var(--accent); }
textarea { min-height: 130px; }

.btns { display: flex; gap: 10px; flex-wrap: wrap; margin: 4px 0 16px; }
.btn { background: var(--panel-2); border: 1px solid var(--border); color: var(--text); padding: 9px 18px;
  border-radius: 9px; font-weight: 600; font-size: .88rem; cursor: pointer; transition: .15s; font-family: inherit; }
.btn:hover { background: #283143; border-color: var(--accent); }
.btn--primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--primary:hover { filter: brightness(1.1); }

.result { background: var(--panel); border: 1px solid var(--border); border-radius: 10px; padding: 14px;
  font-family: 'JetBrains Mono', monospace; font-size: .9rem; white-space: pre-wrap; word-break: break-word; min-height: 50px; }
.result--ok { border-color: var(--ok); }
.result--err { border-color: var(--err); color: var(--err); }
.note { color: var(--muted); font-size: .82rem; margin-top: 8px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.swatch { height: 60px; border-radius: 10px; border: 1px solid var(--border); margin-top: 10px; }

/* Toast */
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%) translateY(80px);
  background: var(--ok); color: #fff; padding: 11px 22px; border-radius: 30px; font-weight: 600; font-size: .9rem;
  opacity: 0; transition: .3s; z-index: 100; }
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }

@media (max-width: 760px) {
  body { flex-direction: column; }
  .sidebar { position: fixed; left: 0; top: 0; transform: translateX(-100%); transition: .3s; z-index: 50; }
  .sidebar.open { transform: translateX(0); }
  .main { padding: 22px; }
  .menu-toggle { display: block; }
  .grid2 { grid-template-columns: 1fr; }
}
