:root{
  --bg:#0e0f13;
  --card:#161820;
  --border:rgba(255,255,255,0.08);
  --text:#f1f1f1;
  --muted:#9aa0a6;
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family:system-ui, sans-serif;
  background:var(--bg);
  color:var(--text);
}

.topbar{
  display:flex;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--border);
}

.actions{display:flex;gap:8px}

.icon-top-btn{
  width:34px;height:34px;
  border-radius:10px;
  border:1px solid var(--border);
  background:#1b1e26;
  color:#fff;
  cursor:pointer;
}
.icon-top-btn.primary{background:#2a5cff}

main{padding:16px}

.masonry{
  column-count:3;
  column-gap:16px;
}
@media(max-width:900px){.masonry{column-count:2}}
@media(max-width:600px){.masonry{column-count:1}}

.tile{
  break-inside:avoid;
  background:var(--card);
  border-radius:14px;
  margin-bottom:16px;
  border:1px solid var(--border);
}

.tile-body{
  padding:14px;
  white-space:pre-wrap;
}

.tile-footer{
  padding:10px 14px 14px;
  display:flex;
  flex-direction:column;
  gap:10px;
  font-size:12px;
  color:var(--muted);
}

.tile-footer-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
}

.tile-meta{
  display:flex;
  gap:6px;
  flex-wrap:wrap;
}

.badge{
  padding:3px 8px;
  border-radius:999px;
  background:rgba(255,255,255,0.1);
  font-size:11px;
}

.small-btn{
  background:#2a5cff;
  border:none;
  color:#fff;
  padding:6px 10px;
  border-radius:8px;
  cursor:pointer;
  font-size:12px;
}
.small-btn:hover{background:#3b6dff}

.overlay{
  position:fixed;
  inset:0;
  background:rgba(0,0,0,0.6);
  display:flex;
  align-items:center;
  justify-content:center;
}
.hidden{display:none}

.modal{
  background:#14161d;
  border-radius:16px;
  width:420px;
  max-width:90%;
  border:1px solid var(--border);
}

.modal-header{
  display:flex;
  justify-content:space-between;
  padding:14px;
  border-bottom:1px solid var(--border);
}

.modal-body{padding:14px}

.icon-btn{
  background:none;border:none;color:#fff;font-size:18px;cursor:pointer
}

.label{font-size:13px;margin-bottom:4px;display:block}

textarea,input{
  width:100%;
  background:#0f1117;
  border:1px solid var(--border);
  color:#fff;
  padding:8px;
  border-radius:8px;
}

.field-block{margin-top:12px}

.btn{
  background:#333;
  border:none;
  color:#fff;
  padding:8px 12px;
  border-radius:8px;
  cursor:pointer;
}
.btn.primary{background:#2a5cff}

.modal-footer{
  display:flex;
  justify-content:flex-end;
  gap:8px;
  margin-top:12px;
}

.hint{font-size:11px;color:var(--muted);margin-top:4px}

.form-msg{
  margin-top:10px;
  font-size:12px;
}


/* Fade when an encrypted tile becomes readable */
@keyframes tileReveal {
  from {
    opacity: 0;
    transform: translateY(2px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.tile-text{
  white-space: pre-wrap;
  word-break: break-word;
  line-height: 1.35;
}
.tile-text.decrypted {
  animation: tileReveal 2000ms ease-out;
}
