/* ===== Accordion =====
   .acc-head button [aria-expanded] + .acc-body(.closed) > .acc-inner. The body animates its height with a
   0fr/1fr grid row and turns invisible once closed, so folded controls can't be tabbed to. */
.acc-head {
  display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0;
  border: 0; border-radius: 9px; background: transparent; color: var(--text-2);
  padding: 7px 10px; text-align: left; font-weight: 700; font-size: 13px;
}
.acc-head:hover { background: var(--panel-2); color: var(--text); }
.acc-head:focus-visible { outline: 2px solid var(--blue); outline-offset: -2px; }
.acc-head .lead { width: 16px; height: 16px; color: var(--muted); }
.acc-sum { flex: 1 1 auto; min-width: 0; text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--muted); font-weight: 500; font-size: 12px; }
.acc-sum.set { color: var(--orange-2); }
[aria-expanded="true"] > .acc-sum { visibility: hidden; }
.chev { width: 16px; height: 16px; color: var(--muted); transition: transform .18s ease; }
.acc-head > .chev { margin-left: auto; }
[aria-expanded="true"] > .chev { transform: rotate(90deg); }
.acc-body { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .2s ease, visibility 0s; }
.acc-body.closed { grid-template-rows: 0fr; visibility: hidden; transition: grid-template-rows .2s ease, visibility 0s .2s; }
.acc-inner { min-height: 0; overflow: hidden; }

/* ===== Modal ===== */
.modal-back {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(3, 8, 18, .72); backdrop-filter: blur(3px);
  display: grid; place-items: center; padding: 16px;
  animation: fade .15s ease-out;
}
@keyframes fade { from { opacity: 0; } }
.modal {
  width: min(1100px, 100%); max-height: calc(100dvh - 32px);
  display: flex; flex-direction: column;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6); overflow: hidden;
}
.modal.sm { width: min(560px, 100%); }
.modal-head { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.modal-head h2 { margin: 0; font: 700 26px/1 var(--font-display); letter-spacing: .03em; }
.modal-head .close { margin-left: auto; }
.modal-body { overflow-y: auto; padding: 16px; }
.modal-foot { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; padding: 12px 16px; border-top: 1px solid var(--line); }

.section-label { font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 4px 0 -4px; }

/* Manager */
.pb-list { display: flex; flex-direction: column; gap: 8px; }
.pb-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 11px; background: var(--bg-2); }
.pb-row.active { border-color: var(--orange); }
.pb-row .pb-name { font: 700 18px/1.1 var(--font-display); }
.pb-row .pb-sub { font-size: 12px; color: var(--muted); }
.pb-row .grow { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.form-grid label, .form-col label { display: flex; flex-direction: column; gap: 4px; font-size: 11px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.form-grid input, .form-grid select, .form-grid textarea, .form-col input, .form-col textarea, .form-col select { text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 14px; color: var(--text); }
.form-col { display: flex; flex-direction: column; gap: 10px; }
.divider { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }

.storage-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: 13px; color: var(--text-2); }
.storage-info .ok { color: var(--ok); font-weight: 600; }
.storage-info .warn { color: var(--warn); font-weight: 600; }

.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 8px 14px; align-items: center; font-size: 13.5px; color: var(--text-2); }

@media (max-width: 900px) {
  .form-grid { grid-template-columns: 1fr; }
}
