:root{
  --bg-0:#070A0F; --bg-1:#0C111B; --panel:#0E1524; --panel-2:#101B2E;
  --text:#E7EAF0; --muted:#AAB3C5;
  --gold:#C7A46A; --copper:#B77A50; --cyan:#6CC7D6; --danger:#B04A4A;
  --line:rgba(199,164,106,0.22);
}

*{box-sizing:border-box}
body{
  margin:0; color:var(--text);
  background: radial-gradient(1200px 700px at 20% 10%, rgba(108,199,214,0.08), transparent 55%),
              radial-gradient(900px 600px at 80% 30%, rgba(199,164,106,0.08), transparent 60%),
              linear-gradient(180deg, var(--bg-0), var(--bg-1));
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

a{color:var(--cyan); text-decoration:none}
a:hover{text-decoration:underline}

.shell{max-width:1100px; margin:0 auto; padding:28px 18px 60px}

.topbar{display:flex; justify-content:space-between; align-items:center; margin-bottom:20px}
.brand{display:flex; align-items:center; gap:12px}
.brand-mark{
  width:42px; height:42px; border-radius:14px; display:grid; place-items:center;
  border:1px solid var(--line); background:rgba(14,21,36,0.7);
  font-family:Cinzel, "EB Garamond", serif; color:var(--gold);
}
.brand-title{font-family:Cinzel, "EB Garamond", serif; font-size:18px}
.brand-sub{color:var(--muted); font-size:12px}

.nameplate{
  display:flex; justify-content:space-between; align-items:flex-start; gap:18px;
  padding:18px 18px 14px; border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,27,46,0.65), rgba(14,21,36,0.65));
  border-radius:16px;
  box-shadow: 0 18px 40px rgba(0,0,0,0.35);
}
.h1{
  font-family: Cinzel, "EB Garamond", serif;
  font-size:32px; line-height:1.1; margin:0;
  letter-spacing:0.4px;
}
.sub{color:var(--muted); margin-top:6px; font-size:14px}
.badges{display:flex; gap:10px; flex-wrap:wrap; justify-content:flex-end}
.badge{
  padding:6px 10px; border-radius:999px;
  border:1px solid rgba(199,164,106,0.28);
  background: rgba(14,21,36,0.55);
  color: var(--text); font-size:12px;
}

.grid{display:grid; gap:14px; margin-top:16px}
.grid.two{grid-template-columns:repeat(2, minmax(0,1fr))}
.grid.three{grid-template-columns:repeat(3, minmax(0,1fr))}
@media (max-width:900px){ .grid.two,.grid.three{grid-template-columns:1fr} }

.card{
  border-radius:16px;
  border:1px solid var(--line);
  background: linear-gradient(180deg, rgba(16,27,46,0.58), rgba(14,21,36,0.58));
  box-shadow: 0 18px 40px rgba(0,0,0,0.30);
  padding:14px 14px 12px;
}
.card-head{display:flex; justify-content:space-between; align-items:center; gap:10px}
.card-title{
  font-family: Cinzel, "EB Garamond", serif;
  font-size:16px; margin:0; letter-spacing:0.3px;
}
.card-actions{display:flex; gap:10px; align-items:center; flex-wrap:wrap}
.divider{
  height:1px; background: linear-gradient(90deg, transparent, rgba(199,164,106,0.35), transparent);
  margin:10px 0 12px;
}
.kv{display:grid; grid-template-columns:1fr auto; gap:8px; padding:6px 0}
.k{color:var(--muted); font-size:13px}
.v{font-weight:600; font-variant-numeric: tabular-nums}

.btn{
  display:inline-flex; align-items:center; gap:8px;
  padding:8px 12px; border-radius:12px;
  border:1px solid rgba(199,164,106,0.28);
  background: rgba(14,21,36,0.55);
  color: var(--text); font-weight:600; font-size:13px;
  cursor:pointer;
}
.btn:hover{border-color:rgba(199,164,106,0.48)}
.btn.danger{border-color:rgba(176,74,74,0.55)}

.note{color:var(--muted); font-size:13px; line-height:1.5}
.note.danger{color:var(--danger)}
.markdown{line-height:1.6}
.markdown h1,.markdown h2,.markdown h3{font-family: Cinzel, "EB Garamond", serif;}

input,textarea,select{
  width:100%;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid rgba(199,164,106,0.22);
  background: rgba(7,10,15,0.55);
  color: var(--text);
}
input:focus,textarea:focus,select:focus{
  outline:none;
  border-color: rgba(108,199,214,0.55);
  box-shadow: 0 0 0 3px rgba(108,199,214,0.12);
}

.stack{display:flex; flex-direction:column; gap:12px}
.field{display:flex; flex-direction:column; gap:6px}
.action-row{display:flex; gap:12px; margin-top:12px; flex-wrap:wrap}
.section-sub{color:var(--gold); font-size:12px; letter-spacing:0.6px; text-transform:uppercase; margin:6px 0}

.character-tile{display:flex; gap:12px; align-items:center}
.tile-icon{
  width:44px; height:44px; border-radius:14px; display:grid; place-items:center;
  border:1px solid var(--line); background:rgba(14,21,36,0.7);
}
.tile-icon img{width:22px; height:22px; opacity:0.85}
.tag-row{display:flex; gap:8px; margin-top:8px; flex-wrap:wrap}

.login-card{max-width:480px; margin:40px auto}
.list-header{margin-bottom:18px}

.panel-row{display:flex; align-items:center; justify-content:space-between; gap:12px; padding:8px 0}
.group-block{margin-bottom:10px}

.inline-search{display:flex; gap:8px; align-items:center}
.inline-search input{min-width:160px}

.icon{width:16px; height:16px; opacity:0.85; margin-right:6px}
.icon-pencil{font-size:12px; color:var(--gold); margin-right:4px}

.edit-row{display:grid; grid-template-columns:1fr auto; gap:10px; align-items:center; margin-bottom:10px}
.edit-row .narrow{max-width:80px}

.muted{color:var(--muted)}

@media print{
  body{background:white; color:black}
  .btn, .topbar{display:none}
  .card, .nameplate{box-shadow:none; border:1px solid #333; background:white}
}
