:root{
  --bg:#0b1220; --card:#111b2e; --text:#e9eefc; --muted:#a9b6d6;
  --line:rgba(233,238,252,.14); --shadow:0 10px 30px rgba(0,0,0,.35);
  --radius:18px;
}
*{box-sizing:border-box}
body{
  margin:0; font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,sans-serif;
  background: radial-gradient(1200px 800px at 20% 0%, #1a2a52 0%, var(--bg) 55%);
  color:var(--text);
}
.wrap{max-width:1100px;margin:0 auto;padding:18px}
h1{margin:8px 0 6px;font-size:28px}
.sub{margin:0;color:var(--muted)}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:14px;align-items:start}
.card{
  grid-column:span 6; background:rgba(17,27,46,.92); border:1px solid var(--line);
  border-radius:var(--radius); box-shadow:var(--shadow); padding:16px;
}
.card h2{margin:0 0 12px;font-size:18px}
.label{display:block;font-size:12px;color:var(--muted);margin:10px 0 6px}
input,select,textarea{
  width:100%; padding:10px 12px; border-radius:12px; border:1px solid var(--line);
  background:rgba(9,14,26,.8); color:var(--text); outline:none
}
textarea{resize:vertical;min-height:90px}
.row{display:flex;gap:10px;margin-top:12px;flex-wrap:wrap;align-items:center}
button{
  border:1px solid var(--line); border-radius:12px; padding:10px 12px;
  background:transparent; color:var(--text); cursor:pointer
}
button:disabled{opacity:.45;cursor:not-allowed}
.primary{background:rgba(76,121,255,.18);border-color:rgba(76,121,255,.45)}
.secondary{background:rgba(0,196,154,.14);border-color:rgba(0,196,154,.45)}
.ghost{background:rgba(233,238,252,.06)}
.tiny{font-size:12px}
.muted{color:var(--muted)}

.story{grid-column:span 12}
.storyBox{
  border-radius:14px; border:1px solid var(--line);
  background:rgba(9,14,26,.55); padding:12px;
}
.sentence{
  display:flex; gap:10px; padding:10px; border-radius:12px;
  border:1px solid rgba(233,238,252,.10);
  margin-bottom:10px; background:rgba(255,255,255,.02);
}
.badge{
  width:28px; height:28px; border-radius:9px;
  display:flex; align-items:center; justify-content:center;
  font-weight:800;
  background:#4dabf7; color:#0b1220;
  flex:0 0 auto;
}
.meta{font-size:12px;color:var(--muted);margin-bottom:2px}
.text{line-height:1.45}
.me{
  display:flex; gap:8px; align-items:center;
  padding:8px 10px; border-radius:12px; border:1px dashed var(--line);
}
@media(max-width:900px){ .card{grid-column:span 12} }

#adminPanel {
  border-style: dashed;
}

.analysisBox{
  margin-top:12px;
  padding:12px;
  border-radius:12px;
  border:1px solid rgba(233,238,252,.14);
  background:rgba(9,14,26,.55);
}

/* Split Layout: oben 2 Spalten, unten Story groß */
.layout{
  display:flex;
  flex-direction:column;
  gap:14px;
  min-height: calc(100vh - 120px);
}

/* obere zwei Cards nebeneinander (wie bisher), aber ohne 12er-grid */
.topGrid{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap:14px;
  align-items:start;
}

/* unteres Story-Panel soll wachsen */
.storyPanel{
  flex: 1 1 auto;
  min-height: 0; /* wichtig fürs Scrollen */
}

/* Storybox hoch und scrollbar */
.storyBoxTall{
  height: calc(100vh - 420px);
  overflow:auto;
}

/* Mobile: Cards untereinander */
@media(max-width:900px){
  .topGrid{ grid-template-columns: 1fr; }
  .storyBoxTall{ height: 55vh; }
}

/* Header im Story-Panel hübsch nebeneinander */
.storyHeader{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:10px;
  margin-bottom:10px;
}