.mg-card,
.mg-message {
  --mg-forest: #283a57;
  --mg-line: #dedbd4;
  --mg-muted: #64645e;
  min-width: 0;
  color: var(--mg-forest);
  border: 1px solid var(--mg-line);
  border-radius: 22px;
  background: #fff;
}

.mg-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.36fr) minmax(295px, 1fr);
  align-items: start;
  gap: clamp(16px, 2.4vw, 32px);
}
.mg-stack { display: grid; gap: 20px; min-width: 0; }
.mg-rows { list-style: none; margin: 0; padding: 0; }
.mg-card h2, .mg-message h2 { color: inherit; margin: 0; font-size: clamp(1.3rem, 2vw, 1.55rem); font-weight: 650; letter-spacing: -.045em; }
.mg-cardhead { display: flex; align-items: center; gap: 12px; padding: 23px 24px 19px; border-bottom: 1px solid var(--mg-line); }
.mg-count { border-radius: 8px; background: #f7efe5; color: #484c54; font-size: .82rem; padding: 3px 8px; font-variant-numeric: tabular-nums; }
.mg-identity { display: flex; align-items: center; min-width: 0; gap: 12px; }
.mg-file-icon, .mg-avatar, .mg-form-icon, .mg-cover-icon, .mg-empty-icon {
  display: inline-flex; flex: none; align-items: center; justify-content: center;
  width: 43px; height: 45px; border-radius: 13px; background: #f8eee5; color: #374a64;
}
.mg-avatar { text-transform: uppercase; height: 41px; width: 41px; border-radius: 50%; font-weight: 650; }
.mg-avatar-own { background: #ff842f; color: #283a57; }
.mg-label { min-width: 0; display: grid; gap: 3px; }
.mg-label strong { font-weight: 625; overflow-wrap: anywhere; font-size: 1rem; letter-spacing: -.02em; }
.mg-label small, .mg-size, .mg-date { color: var(--mg-muted); font-size: .875rem; overflow-wrap: anywhere; }
.mg-size { white-space: nowrap; text-align: right; }
.mg-row, .mg-person {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 17px 24px;
}
.mg-row + .mg-row, .mg-person + .mg-person, .mg-recipient + .mg-recipient { border-top: 1px solid var(--mg-line); }
.mg-label small, .mg-detail-meta { line-height: 1.5; }
.mg-cover {
  position: relative; isolation: isolate; overflow: hidden;
  border-radius: 21px 21px 0 0; color: #fff; background: #283a57;
}
.mg-team-cover-art { position: absolute; z-index: -1; inset: 0; background: linear-gradient(90deg, #283a57 4%, #283a57ef 27%, #283a57a8 46%, transparent 76%), var(--transfer-tint), var(--transfer-art) right 56% / cover no-repeat; background-blend-mode: normal, color, normal; }
.mg-cover-content { padding: clamp(23px, 3.2vw, 38px); }
.mg-cover-icon { height: 40px; width: 40px; border-radius: 12px; color: #ffb083; background: #ffb0831a; border: 1px solid #ffb08348; margin-bottom: 26px; }
.mg-cover h2 { font-size: clamp(2.15rem, 4vw, 3.3rem); color: #fffcf2; font-weight: 600; line-height: 1; letter-spacing: -.065em; }
.mg-cover p { margin: 10px 0 0; color: #eee9df; font-size: .94rem; }
.mg-person { flex-wrap: wrap; padding: 22px 24px; }
.mg-person .mg-identity { flex: 1 1 125px; }
.mg-member-actions { display: flex; gap: 5px; }
.mg-role, .mg-state {
  display: inline-flex; align-items: center; gap: 5px; width: max-content;
  border-radius: 99px; padding: 4px 10px; white-space: nowrap;
  color: #47556b; background: #f0efea; font-size: .82rem; font-weight: 600; line-height: 1.55;
}
.mg-role[data-role="admin"] { color: #355326; background: #f9ebe0; }
.mg-state[data-state="Actief"] { color: #29532b; background: #e4f6d5; }
.mg-state[data-state="Concept"] { color: #765523; background: #f9f0d7; }
.mg-state[data-state="Ingetrokken"] { color: #894c44; background: #f9ede7; }
.mg-invite { padding: clamp(22px, 2.8vw, 32px); }
.mg-form-icon { position: relative; width: 39px; height: 39px; border: 1px solid #f7e7db; background: #f6f2ec; margin-bottom: 16px; }
.mg-form-icon b { position: absolute; right: 5px; bottom: 4px; background: #f6f2ec; font-size: .85rem; line-height: 1; }
.mg-formhead p { margin: 7px 0 0; line-height: 1.5; color: var(--mg-muted); font-size: .95rem; }
.mg-form { margin-top: 24px; display: grid; gap: 15px; }
.mg-form input, .mg-form select, .mg-search input, .mg-role-picker select { font: inherit; }
.mg-form .field { font-weight: 600; font-size: .9rem; }
.mg-form .field input, .mg-form .field select {
  display: block; width: 100%; padding: 11px 12px; border-radius: 9px; border: 1px solid #d8d5ce;
  background-color: #fcfbf8; color: var(--mg-forest); font-weight: 450;
}
.mg-form .btn { width: 100%; margin-top: 4px; }
.mg-role-help { margin: -7px 0 0; font-size: .85rem; line-height: 1.5; color: var(--mg-muted); }
.mg-form + .notice:not(:empty), .mg-access .notice:not(:empty) { margin-top: 15px; }
.mg-detail-meta { display: flex; gap: 15px; align-items: center; flex-wrap: wrap; margin-bottom: 20px; }
.mg-detail-meta > span:not(.mg-state), .mg-minihead { display: inline-flex; gap: 7px; align-items: center; font-size: .9rem; color: #465671; }
.mg-detail { grid-template-columns: minmax(0, 1fr) minmax(315px, 1.08fr); }
.mg-recipient { padding: 20px 24px; }
.mg-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 13px; }
.mg-controls .btn.small, .mg-role-picker, .mg-icon-button { min-height: 36px; }
.mg-role-picker {
  display: inline-flex; align-items: center; gap: 5px; min-width: 0; padding-left: 9px; font-size: .85rem;
  border: 1px solid var(--mg-line); border-radius: 9px; color: var(--mg-forest); background: #f8f6f2;
}
.mg-role-picker select { min-width: 0; border: 0; font-size: .85rem; background: transparent; padding: 5px; color: inherit; }
.mg-icon-button {
  display: inline-grid; place-items: center; width: 36px; border-radius: 8px; font: inherit;
  color: var(--mg-forest); background: #fff; border: 1px solid var(--mg-line); cursor: pointer;
}
.mg-icon-button:hover { background: #f0efea; }
.mg-danger { color: #803c32; }
.mg-danger:hover { background: #faeee8; }
.mg-resume, .mg-foot { padding: 16px 24px; display: flex; gap: 10px; flex-wrap: wrap; border-top: 1px solid var(--mg-line); }
.mg-foot { justify-content: flex-end; }
.mg-resume { flex-direction: column; align-items: start; }
.mg-access .notice:not(:empty), .mg-hint { margin: 14px 24px 20px; }
.mg-hint { color: #755528; font-size: .875rem; }
.mg-message { background: #f0efea; padding: 23px 24px; }
.mg-minihead { gap: 8px; }
.mg-minihead h2 { font-size: 1rem; letter-spacing: -.02em; }
.mg-message p { margin: 9px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }
.mg-toolbar { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 18px 22px; gap: 12px; }
.mg-switches { display: flex; gap: 3px; flex-wrap: wrap; padding: 4px; border-radius: 12px; background: #f0efea; }
.mg-filter { font: inherit; font-size: .88rem; font-weight: 570; color: #64645e; background: transparent; border: 0; border-radius: 9px; padding: 7px 12px; cursor: pointer; }
.mg-filter[aria-pressed="true"] { color: #fff; background: #283a57; }
.mg-search { display: flex; align-items: center; gap: 8px; padding: 8px 11px; border: 1px solid #e1ded7; border-radius: 10px; color: #64645e; min-width: 0; }
.mg-search input { font-size: .9rem; width: 145px; color: var(--mg-forest); border: 0; background: transparent; min-width: 0; }
.mg-search input:focus { outline: none; }
.mg-search:focus-within { outline: 2px solid #a53b09; outline-offset: 2px; }
.mg-columns, .mg-transfer { display: grid; grid-template-columns: minmax(0,1.9fr) minmax(90px,.7fr) minmax(88px,.45fr) 18px; align-items: center; gap: 18px; padding: 14px 24px; }
.mg-columns { background: #f9f6f1; color: var(--mg-muted); font-size: .81rem; font-weight: 550; border-block: 1px solid var(--mg-line); }
.mg-transfer { padding-block: 18px; color: inherit; text-decoration: none; }
.mg-transfer + .mg-transfer { border-top: 1px solid var(--mg-line); }
.mg-transfer:last-child { border-radius: 0 0 21px 21px; }
.mg-transfer:hover { background: #fdfbf7; }
.mg-transfer:hover .mg-chevron { color: var(--mg-forest); transform: translateX(2px); }
.mg-chevron { color: #717680; display: grid; justify-items: end; transition: transform .18s ease; }
.mg-empty { display: grid; place-items: center; text-align: center; gap: 12px; padding: clamp(34px,6vw,68px) 20px; }
.mg-empty-icon { width: 62px; height: 62px; border-radius: 19px; color: #3d527a; background: #f9ede2; }
.mg-empty h2 { font-size: 1.6rem; }
.mg-empty p { max-width: 330px; color: var(--mg-muted); font-size: .94rem; margin: 0; }
.mg-empty .btn { margin-top: 4px; }

@media (max-width: 800px) {
  .mg-grid { grid-template-columns: 1fr; }
  .mg-invite { max-width: none; }
  .mg-cover-icon { margin-bottom: 13px; }
}
@media (max-width: 620px) {
  .mg-toolbar, .mg-columns, .mg-transfer, .mg-cardhead, .mg-row, .mg-person, .mg-recipient, .mg-foot { padding-inline: 16px; }
  .mg-toolbar { flex-direction: column; align-items: stretch; }
  .mg-switches { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mg-filter { padding: 7px 2px; }
  .mg-search input { width: 100%; }
  .mg-columns, .mg-transfer { grid-template-columns: minmax(0, 1fr) auto; gap: 9px; }
  .mg-columns > :nth-child(2), .mg-columns > :last-child, .mg-date, .mg-chevron { display: none; }
  .mg-identity { gap: 9px; }
  .mg-file-icon { width: 34px; height: 38px; border-radius: 10px; }
  .mg-label strong { font-size: .95rem; }
  .mg-label small { font-size: .8rem; }
  .mg-state { font-size: .77rem; padding: 4px 7px; }
  .mg-team .mg-role { font-size: .8rem; }
}
