:root {
  --bg: #070816;
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(15, 23, 42, 0.58);
  --glass-strong: rgba(15, 23, 42, 0.82);
  --accent: #8b5cf6;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 15% 10%, rgba(124, 58, 237, .22), transparent 30%),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, .18), transparent 35%),
    linear-gradient(135deg, #050711 0%, #0b1020 50%, #090a15 100%);
  overflow-x: hidden;
}
.bg-orb { position: fixed; border-radius: 999px; filter: blur(34px); opacity: .55; pointer-events: none; }
.orb-a { width: 380px; height: 380px; left: -120px; top: 120px; background: #7c3aed; }
.orb-b { width: 320px; height: 320px; right: -100px; bottom: 80px; background: #0ea5e9; }
.shell { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 64px; }
.hero {
  display: flex; justify-content: space-between; gap: 24px; align-items: flex-end;
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: linear-gradient(135deg, rgba(255,255,255,.11), rgba(255,255,255,.035));
  backdrop-filter: blur(18px);
  box-shadow: 0 24px 90px rgba(0,0,0,.38);
}
.eyebrow { margin: 0 0 10px; color: #a78bfa; text-transform: uppercase; letter-spacing: .18em; font-size: 12px; }
h1 { margin: 0; font-size: clamp(42px, 8vw, 88px); line-height: .9; letter-spacing: -0.06em; }
#portalSubtitle { margin: 18px 0 0; color: var(--muted); font-size: 18px; }
.actions, .panel-row, .dialog-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.btn, .file-btn {
  border: 1px solid var(--line); color: var(--text); background: rgba(255,255,255,.08);
  border-radius: 999px; padding: 11px 16px; cursor: pointer; text-decoration: none; font-weight: 700;
  transition: transform .2s ease, background .2s ease, border-color .2s ease;
}
.btn:hover, .file-btn:hover { transform: translateY(-1px); background: rgba(255,255,255,.14); }
.primary { background: linear-gradient(135deg, #7c3aed, #0ea5e9); border-color: transparent; }
.danger { background: rgba(239, 68, 68, .16); color: #fecaca; }
.ghost { background: rgba(255,255,255,.06); }
.hidden { display: none !important; }
.panel {
  margin-top: 18px; padding: 20px; border: 1px solid var(--line); border-radius: 24px;
  background: rgba(15,23,42,.64); backdrop-filter: blur(16px);
}
.panel-row { margin-bottom: 12px; }
.panel-row:last-child { margin-bottom: 0; }
.panel-row label { flex: 1; min-width: 240px; color: var(--muted); font-size: 13px; }
input, textarea {
  width: 100%; margin-top: 6px; padding: 12px 13px; border-radius: 14px; border: 1px solid var(--line);
  background: rgba(2, 6, 23, .72); color: var(--text); outline: none;
}
.hint { color: #64748b; }
.file-btn input { display: none; }
.category-nav { display: flex; gap: 10px; flex-wrap: wrap; margin: 26px 0; }
.category-pill { padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); background: rgba(255,255,255,.05); cursor:pointer; }
.category-pill.active { color: white; background: rgba(139,92,246,.28); border-color: rgba(167,139,250,.45); }
.cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.card {
  position: relative; min-height: 285px; border-radius: 28px; overflow: hidden; border: 1px solid var(--line);
  background: var(--glass); box-shadow: 0 22px 60px rgba(0,0,0,.34); backdrop-filter: blur(16px);
  cursor: default; transition: transform .2s ease, border-color .2s ease;
}
.card:hover { transform: translateY(-5px); border-color: rgba(255,255,255,.24); }
.card.dragging { opacity: .55; transform: scale(.98); }
.card-media { height: 138px; background: linear-gradient(135deg, var(--card-color), rgba(14,165,233,.25)); display:flex; align-items:center; justify-content:center; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-icon { font-size: 44px; opacity: .92; }
.card-body { padding: 20px; }
.card-meta { display:flex; justify-content:space-between; align-items:center; gap: 10px; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.status { border: 1px solid rgba(255,255,255,.13); padding: 5px 8px; border-radius: 999px; color: white; background: rgba(255,255,255,.07); }
.card h3 { margin: 0 0 8px; font-size: 24px; letter-spacing: -0.04em; }
.card p { min-height: 44px; margin: 0 0 18px; color: var(--muted); line-height: 1.45; }
.card .open { display:inline-flex; }
.edit-tools { position:absolute; right: 14px; top: 14px; display:flex; gap: 8px; }
.icon-btn { width: 36px; height: 36px; border-radius: 999px; border: 1px solid var(--line); background: rgba(2,6,23,.52); color: white; cursor:pointer; }
.dialog { width: min(620px, calc(100% - 28px)); border: 1px solid var(--line); border-radius: 26px; padding: 0; background: var(--glass-strong); color: var(--text); backdrop-filter: blur(18px); }
.dialog::backdrop { background: rgba(0,0,0,.62); }
.dialog form { padding: 24px; display:grid; gap: 14px; }
.dialog h2 { margin: 0 0 4px; }
.spacer { flex: 1; }
@media (max-width: 920px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .hero { align-items:flex-start; flex-direction:column; } }
@media (max-width: 620px) { .cards { grid-template-columns: 1fr; } .shell { width: min(100% - 20px, 1180px); padding-top: 20px; } .hero { padding: 24px; border-radius: 24px; } }
