body{
  font-family:Arial, sans-serif;
  background:#f4f6fa;
  margin:0;
}

.app{
  max-width:1100px;
  margin:auto;
  padding:16px;
}

.header{
  background:#1e3a8a;
  color:white;
  padding:18px 22px;
  border-radius:16px;
  margin-bottom:14px;
}

.header h1{
  margin:0;
  font-size:32px;
}

.family{
  margin:10px 0 16px;
  font-size:18px;
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.role-badge{
  display:inline-block;
  font-size:13px;
  background:#dbeafe;
  color:#1d4ed8;
  padding:4px 8px;
  border-radius:999px;
}

.card{
  background:white;
  padding:14px;
  border-radius:16px;
  margin-bottom:14px;
}

.admin-card h2{
  margin:0 0 12px;
  font-size:20px;
}

.admin-grid{
  display:grid;
  grid-template-columns:2fr 1fr 1fr auto;
  gap:10px;
  align-items:end;
}

.admin-grid label{
  display:block;
  font-size:12px;
  color:#6b7280;
  margin-bottom:4px;
}

.admin-grid input{
  width:100%;
  height:38px;
  box-sizing:border-box;
  padding:8px 10px;
  border:1px solid #bbb;
  border-radius:8px;
  font-size:14px;
}

.admin-actions-cell{
  display:flex;
  gap:8px;
  align-items:end;
}

.admin-actions-cell.multi{
  flex-wrap:wrap;
}

.admin-card button,
.admin-inline-form button{
  height:38px;
  border:0;
  border-radius:8px;
  background:#1e3a8a;
  color:white;
  padding:0 12px;
  cursor:pointer;
}

.admin-card button.secondary,
.admin-inline-form button.secondary{
  background:#6b7280;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,td{
  padding:14px 10px;
  border-bottom:1px solid #ddd;
  vertical-align:middle;
}

th{
  font-size:16px;
  text-align:left;
}

td{
  font-size:15px;
}

.col-event{
  font-weight:600;
}

.col-date{
  white-space:nowrap;
}

.check-inline{
  display:inline-flex;
  align-items:center;
  gap:8px;
}

.check{
  width:18px;
  height:18px;
  cursor:pointer;
}

.comment{
  width:93%;
  max-width:240px;
  height:36px;
  font-size:14px;
  padding:6px 10px;
  border-radius:8px;
  border:1px solid #bbb;
}

.comment:disabled{
  background:#f3f4f6;
  color:#9ca3af;
}

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

.helper-chip{
  position:relative;
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:6px 10px;
  border:0;
  border-radius:12px;
  background:#dcfce7;
  color:#14532d;
  font-size:13px;
  cursor:default;
}

.helper-chip.has-comment{
  cursor:pointer;
}

.helper-chip.has-comment:hover{
  background:#c9f7d8;
}

.helper-name{
  display:inline-block;
}

.helper-marker{
  width:7px;
  height:7px;
  border-radius:50%;
  background:#eab308;
  flex:0 0 auto;
}

.helper-chip.has-comment::after{
  content:attr(data-comment);
  position:absolute;
  left:0;
  top:calc(100% + 6px);
  min-width:180px;
  max-width:260px;
  padding:8px 10px;
  border-radius:8px;
  background:#1f2937;
  color:#fff;
  font-size:12px;
  line-height:1.4;
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  z-index:20;
}

.helper-chip.has-comment:hover::after{
  opacity:1;
  visibility:visible;
}

.helper-chip.has-comment.is-open::after{
  opacity:1;
  visibility:visible;
}

.no-helpers{
  color:#6b7280;
  font-size:14px;
}

.col-status{
  color:#6b7280;
  white-space:nowrap;
}

.col-manage{
  white-space:nowrap;
}

.edit-toggle{
  border:0;
  background:none;
  color:#1d4ed8;
  cursor:pointer;
  padding:0;
  font-size:14px;
}

.admin-edit-row td{
  background:#f8fafc;
  padding:12px 10px;
}

.admin-inline-form{
  width:100%;
}

#toast{
  position:fixed;
  top:20px;
  right:20px;
  background:#111;
  color:white;
  padding:8px 12px;
  border-radius:8px;
  display:none;
  z-index:100;
}

@media (min-width: 701px){
  td.col-comment.hide-comment{
    display:table-cell;
  }

  td.col-comment.show-comment{
    display:table-cell;
  }
}

@media (max-width:700px){

  .app{
    padding:10px;
  }

  .header{
    padding:16px;
    border-radius:14px;
  }

  .header h1{
    font-size:24px;
  }

  .family{
    font-size:15px;
  }

  .card{
    padding:10px;
  }

  .admin-grid{
    grid-template-columns:1fr;
  }

  .admin-actions-cell{
    justify-content:flex-start;
  }

  table,
  thead,
  tbody{
    display:block;
  }

  thead{
    display:none;
  }

  tbody{
    display:flex;
    flex-direction:column;
    gap:12px;
  }

  tr.event-row{
    display:grid;
    grid-template-columns:1fr 1fr;
    grid-template-areas:
      "event event"
      "from bis"
      "check check"
      "comment comment"
      "helpers helpers"
      "status status"
      "manage manage";
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:14px;
    padding:14px;
    gap:10px 16px;
  }

  tr.admin-edit-row{
    display:block;
    margin-top:-6px;
  }

  td{
    display:block;
    border:0;
    padding:0;
  }

  .col-event{
    grid-area:event;
    font-size:16px;
    font-weight:700;
    line-height:1.25;
    word-break:break-word;
  }

  .col-date{
    white-space:normal;
    font-size:14px;
    line-height:1.2;
  }

  .col-date[data-label="Von"]{
    grid-area:from;
  }

  .col-date[data-label="Bis"]{
    grid-area:bis;
  }

  .col-date::before{
    display:block;
    font-size:12px;
    color:#6b7280;
    margin-bottom:2px;
  }

  .col-date[data-label="Von"]::before{
    content:"Von";
  }

  .col-date[data-label="Bis"]::before{
    content:"Bis";
  }

  .col-check{
    grid-area:check;
    margin-top:2px;
  }

  .check-inline{
    display:flex;
    align-items:center;
    gap:6px;
    font-size:13px;
  }

  .check{
    width:16px;
    height:16px;
  }

  .col-comment{
    grid-area:comment;
    margin-top:2px;
  }

  .comment{
    width:93%;
    max-width:none;
    height:24px;
    font-size:12px;
    padding:2px 6px;
    border-radius:6px;
    border:1px solid #d1d5db;
  }

  .col-helpers{
    grid-area:helpers;
    margin-top:2px;
    padding-top:10px;
    border-top:1px solid #eee;
  }

  .col-helpers::before{
    content:"Unterstützer";
    font-size:12px;
    color:#6b7280;
    display:block;
    margin-bottom:6px;
  }

  .helpers{
    max-width:none;
    gap:7px;
  }

  .helper-chip{
    font-size:12px;
    padding:6px 10px;
  }

  .helper-chip.has-comment::after{
    min-width:170px;
    max-width:220px;
    font-size:12px;
    padding:8px 10px;
  }

  .col-status{
    grid-area:status;
    font-size:12px;
    color:#6b7280;
  }

  .col-manage{
    grid-area:manage;
  }

  .edit-toggle{
    font-size:13px;
  }

  .hide-comment{
    display:none;
  }

  .show-comment{
    display:block;
  }
}