:root{
  --bg:#0b0f17;
  --card:#121a28;
  --muted:#7f8aa3;
  --text:#eaf0ff;
  --accent:#7c5cff;
  --accent2:#00e5ff;
  --danger:#ff4d6d;
  --ok:#2ee59d;
  --border:rgba(255,255,255,.08);
  --shadow: 0 10px 30px rgba(0,0,0,.35);
  --radius:16px;
  --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 Neue", Arial, "Noto Sans", "Liberation Sans", sans-serif;
}
*{box-sizing:border-box}
body{
  margin:0; background: radial-gradient(1000px 500px at 10% 0%, rgba(124,92,255,.25), transparent),
                     radial-gradient(1000px 500px at 90% 20%, rgba(0,229,255,.18), transparent),
                     var(--bg);
  color:var(--text); font-family:var(--sans);
  min-height:100vh;
}
a{color:inherit; text-decoration:none}
.wrap{max-width:1100px; margin:0 auto; padding:28px;}
header{
  display:flex; gap:14px; align-items:flex-end; justify-content:space-between;
  margin-bottom:18px;
}
.title h1{margin:0; font-size:28px; letter-spacing:.2px;}
.title p{margin:6px 0 0; color:var(--muted); line-height:1.4}
.chip{
  font-family:var(--mono); font-size:12px; color:var(--muted);
  border:1px solid var(--border); padding:8px 10px; border-radius:999px;
  background: rgba(255,255,255,.03);
  display:inline-flex; gap:10px; align-items:center;
}
.grid{
  display:grid; grid-template-columns: 320px 1fr; gap:16px;
  align-items:start;
}
.card{
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border:1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow:hidden;
}
.card .hd{
  padding:14px 16px;
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  border-bottom:1px solid var(--border);
  background: rgba(255,255,255,.02);
}
.card .bd{padding:16px}
.btn{
  appearance:none; border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  color:var(--text);
  padding:10px 12px; border-radius:12px;
  cursor:pointer; font-weight:600;
  transition: transform .05s ease, background .2s ease, border-color .2s ease;
  display:inline-flex; gap:8px; align-items:center;
  user-select:none;
  white-space:nowrap;
}
.btn:hover{background: rgba(255,255,255,.07); border-color:rgba(255,255,255,.14)}
.btn:active{transform: translateY(1px)}
.btn.primary{
  border-color: rgba(124,92,255,.45);
  background: linear-gradient(180deg, rgba(124,92,255,.25), rgba(124,92,255,.12));
}
.btn.danger{
  border-color: rgba(255,77,109,.35);
  background: linear-gradient(180deg, rgba(255,77,109,.22), rgba(255,77,109,.10));
}
.btn.small{padding:7px 10px; border-radius:10px; font-size:12px}
.row{display:flex; gap:10px; align-items:center}
.field{display:flex; flex-direction:column; gap:6px; margin:0 0 12px}
label{font-size:12px; color:var(--muted)}
input[type="text"], input[type="password"], textarea{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.2);
  color:var(--text);
  outline:none;
}
textarea{min-height:110px; resize:vertical}
.list{display:flex; flex-direction:column; gap:8px}
.item{
  padding:10px 12px; border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  display:flex; justify-content:space-between; align-items:center; gap:10px;
}
.item.active{
  border-color: rgba(124,92,255,.45);
  background: rgba(124,92,255,.12);
}
.muted{color:var(--muted)}
.note{
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  border-radius:14px;
  padding:12px 12px;
  display:flex; gap:12px; justify-content:space-between; align-items:flex-start;
}
.note.dragging{opacity:.6}
.note .meta{font-size:12px; color:var(--muted); font-family:var(--mono)}
.note .text{white-space:pre-wrap; line-height:1.45}
.flash{
  margin:0 0 14px;
  padding:12px 14px;
  border-radius:14px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.03);
  display:flex; justify-content:space-between; gap:10px; align-items:center;
}
.flash.ok{border-color: rgba(46,229,157,.35); background: rgba(46,229,157,.10)}
.flash.err{border-color: rgba(255,77,109,.35); background: rgba(255,77,109,.10)}

/* Inline code styling */
code{
  font-family: var(--mono);
  font-size: 0.95em;
  line-height: 1.35;
  padding: 2px 6px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: rgba(255,255,255,.06);
  box-shadow: 0 6px 16px rgba(0,0,0,.22);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.pre{
  margin: 10px 0 0;
  padding: 10px 12px;
  border:1px solid var(--border);
  background: rgba(0,0,0,.2);
  border-radius: 12px;
  overflow:auto;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--text);
  white-space: pre;
}
.pre code{
  padding:0; border:0; background:transparent; box-shadow:none; border-radius:0;
  white-space: pre; overflow-wrap: normal;
}

/* Drag handle */
.drag-handle{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  width:28px;
  height:28px;
  border-radius:10px;
  border:1px solid var(--border);
  background: rgba(255,255,255,.04);
  cursor: grab;
  font-family: var(--mono);
  color: var(--muted);
  user-select:none;
}
.drag-handle:active{cursor:grabbing}
.toast{
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 9999;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(8px);
  color: var(--text);
  box-shadow: var(--shadow);
  font-family: var(--mono);
  font-size: 12px;
  max-width: min(520px, calc(100vw - 32px));
}

@media (max-width: 900px){
  .grid{grid-template-columns:1fr}
  header{align-items:flex-start; flex-direction:column}
}
