#bankEditor {
  width: min(680px, calc(100vw - 32px));
  max-width: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 18px;
  background: transparent;
  box-shadow: none;
}

#bankEditor::backdrop {
  background: rgba(17, 37, 33, 0.46);
  backdrop-filter: blur(2px);
}

#bankEditor .bank-editor {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  max-height: calc(100vh - 32px);
  margin: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  box-shadow: 0 28px 72px rgba(16, 46, 40, 0.28);
}

.bank-editor-head,
.bank-editor-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px;
}

.bank-editor-head {
  border-bottom: 1px solid var(--line);
}

.bank-editor-head h2 {
  margin: 5px 0 6px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.25;
}

.bank-editor-head p {
  max-width: 520px;
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.bank-editor-body {
  min-height: 0;
  overflow: auto;
  padding: 20px 24px 24px;
}

.bank-section-title {
  margin: 0 0 16px;
}

.bank-section-title strong,
.bank-section-title span {
  display: block;
}

.bank-section-title strong {
  color: var(--ink);
  font-size: 16px;
}

.bank-section-title span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.bank-form-divider {
  height: 1px;
  margin: 24px 0;
  background: var(--line);
}

.bank-path-fields {
  display: grid;
  gap: 16px;
}

.bank-field,
.bank-subject-fields label,
.bank-access-fields label {
  display: grid;
  gap: 7px;
  margin: 0;
}

.bank-field > span,
.bank-subject-fields label > span,
.bank-access-fields label > span {
  color: var(--ink);
  font-weight: 700;
}

.bank-field small {
  min-height: 19px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bank-field small[data-state="error"] {
  color: #b42318;
}

.bank-combobox {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 40px;
}

.bank-combobox input {
  min-width: 0;
  border-radius: 9px 0 0 9px;
}

.bank-combobox input:disabled {
  cursor: not-allowed;
  color: #95a29e;
  background: #f4f7f6;
}

.bank-combobox-toggle {
  padding: 0;
  border-radius: 0 9px 9px 0;
  color: var(--ink);
  background: #f3f8f7;
  font-size: 20px;
  line-height: 1;
}

.bank-combobox-toggle:hover {
  color: #fff;
  background: var(--primary-dark);
}

.bank-combobox-toggle:disabled {
  color: #95a29e;
  background: #eef2f1;
}

.bank-combobox-menu {
  position: absolute;
  z-index: 40;
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  display: none;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  box-shadow: 0 18px 42px rgba(16, 46, 40, 0.16);
}

.bank-combobox-menu.is-open {
  display: grid;
  gap: 3px;
}

.bank-choice {
  width: 100%;
  padding: 10px 11px;
  border: 0;
  border-radius: 8px;
  color: var(--text);
  text-align: left;
  background: transparent;
  box-shadow: none;
}

.bank-choice:hover,
.bank-choice:focus-visible {
  color: #fff;
  background: var(--primary-dark);
  transform: none;
}

.bank-choice-new {
  color: var(--primary-dark);
  background: var(--soft);
}

.bank-choice-meta,
.bank-choice-empty {
  padding: 9px 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.bank-path-preview {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  border: 1px dashed rgba(21, 152, 134, 0.32);
  border-radius: 12px;
  background: #f8fcfb;
}

.bank-path-preview > strong {
  color: var(--muted);
  font-size: 12px;
}

.bank-path-chip {
  display: inline-flex;
  max-width: 100%;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: #e9f5f2;
  font-size: 12px;
  font-weight: 700;
}

.bank-path-chip[data-mode="new"] {
  color: #925b00;
  background: #fff5df;
}

.bank-path-chip[data-mode="pending"] {
  color: var(--muted);
  background: #eef2f1;
}

.bank-path-separator {
  color: #92a19d;
}

.bank-subject-fields,
.bank-access-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 136px;
  gap: 14px;
}

.bank-access-fields {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.bank-subject-fields .wide,
.bank-access-fields .wide {
  grid-column: 1 / -1;
}

.bank-enabled-toggle {
  display: flex !important;
  align-items: center;
  align-self: end;
  gap: 8px;
  min-height: 42px;
  color: var(--ink);
}

.bank-enabled-toggle input {
  width: auto;
}

.bank-editor-foot {
  align-items: center;
  padding-top: 16px;
  padding-bottom: 18px;
  border-top: 1px solid var(--line);
}

.bank-editor-foot p {
  max-width: 340px;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.bank-editor-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.bank-editor-actions button {
  min-width: 96px;
}

@media (max-width: 680px) {
  #bankEditor {
    width: calc(100vw - 16px);
  }

  #bankEditor .bank-editor {
    max-height: calc(100vh - 16px);
    border-radius: 14px;
  }

  .bank-editor-head,
  .bank-editor-body,
  .bank-editor-foot {
    padding-right: 16px;
    padding-left: 16px;
  }

  .bank-editor-head h2 {
    font-size: 21px;
  }

  .bank-subject-fields,
  .bank-access-fields {
    grid-template-columns: 1fr;
  }

  .bank-subject-fields .wide,
  .bank-access-fields .wide {
    grid-column: auto;
  }

  .bank-editor-foot {
    align-items: stretch;
    flex-direction: column;
  }

  .bank-editor-actions,
  .bank-editor-actions button {
    width: 100%;
  }

  .bank-editor-actions button {
    flex: 1;
  }
}