.bank-image-tool {
  --bank-image-ink: #24453e;
  --bank-image-line: #d8e6e0;
  --bank-image-muted: #587069;
  color: var(--bank-image-ink);
}

.bank-image-upload {
  display: grid;
  justify-items: center;
  gap: 12px;
  max-width: 980px;
  padding: clamp(30px, 7vw, 90px) 18px;
  border: 1px dashed #9dbfb4;
  border-radius: 12px;
  background: #f3faf7;
  text-align: center;
}
.bank-image-upload h2 { margin: 0; font-size: 21px; }
.bank-image-upload p { margin: 0 0 3px; color: var(--bank-image-muted); line-height: 1.65; }

.bank-image-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  padding: 13px 16px;
  border: 1px solid var(--bank-image-line);
  border-radius: 10px;
  background: #fff;
  margin-bottom: 14px;
}
.bank-image-file { min-width: 0; display: grid; gap: 3px; }
.bank-image-file strong { overflow-wrap: anywhere; font-size: 14px; }
.bank-image-file small { color: var(--bank-image-muted); }
.bank-image-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; }
.bank-image-actions .btn,
.bank-image-preview-bar .btn { white-space: nowrap; }
.bank-image-format { display: flex; align-items: center; gap: 5px; font-size: 12px; }
.bank-image-format select { min-height: 32px; padding: 4px 5px; }
.bank-image-tool .btn[aria-pressed="true"] {
  background: #e2f4ec;
  border-color: #8cb9a9;
  color: #185d4c;
}

.bank-image-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(245px, 290px); gap: 14px; }
.bank-image-preview,
.bank-image-controls {
  min-width: 0;
  border: 1px solid var(--bank-image-line);
  border-radius: 10px;
  background: #fff;
}
.bank-image-preview-bar {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 11px;
  border-bottom: 1px solid var(--bank-image-line);
}
.bank-image-viewport {
  overflow: auto;
  max-height: min(64vh, 760px);
  min-height: 120px;
  padding: 12px;
  border-radius: 0 0 9px 9px;
  background: #e9eef1;
}
.bank-image-picture {
  position: relative;
  width: min(var(--bank-image-width), 100%);
  margin-inline: auto;
  background: repeating-conic-gradient(#fff 0% 25%, #edf0ef 0% 50%) 0 0 / 14px 14px;
}
.bank-image-picture.is-full-size { width: var(--bank-image-width); }
.bank-image-picture[data-mode="add"],
.bank-image-picture[data-mode="protect"] { cursor: crosshair; touch-action: none; }
.bank-image-picture[data-mode="pan"] { cursor: grab; touch-action: none; }
.bank-image-picture[data-mode="pan"]:active { cursor: grabbing; }
.bank-image-picture img { display: block; width: 100%; height: auto; user-select: none; }
.bank-image-picture .bank-image-mask { position: absolute; inset: 0; pointer-events: none; }
.bank-image-boxes { position: absolute; inset: 0; pointer-events: none; }
.bank-image-box,
.bank-image-drag {
  position: absolute;
  border: 1px dashed #7297b7;
  background: transparent;
  padding: 0;
}
.bank-image-box { pointer-events: auto; }
.bank-image-picture[data-mode="pan"] .bank-image-box,
.bank-image-tool[aria-busy="true"] .bank-image-box { pointer-events: none; }
.bank-image-box.is-low { border-color: #75828c; }
.bank-image-box.is-protection,
.bank-image-picture[data-mode="protect"] .bank-image-drag { border-style: dotted; }
.bank-image-box:hover,
.bank-image-box:focus-visible,
.bank-image-box[aria-current="true"],
.bank-image-drag { border-color: #446781; }
.bank-image-box[aria-current="true"] { border-width: 2px; }
.bank-image-drag { pointer-events: none; }
.bank-image-picture[data-space="true"] { cursor: grab; }
.bank-image-picture[data-space="true"] .bank-image-box { pointer-events: none; }
.bank-image-zoom-label,
.bank-image-canvas-hint { color: var(--bank-image-muted); font-size: 12px; }
.bank-image-canvas-hint { margin: 0; padding: 6px 11px 0; }

.bank-image-controls { padding: 15px; align-self: start; }
.bank-image-controls h2 { margin: 0 0 10px; font-size: 16px; }
.bank-image-tip,
.bank-image-original { margin: 0 0 12px; color: var(--bank-image-muted); line-height: 1.65; overflow-wrap: anywhere; }
.bank-image-controls form { display: grid; gap: 12px; align-items: start; }
.bank-image-controls form label { display: grid; gap: 5px; min-width: 0; }
.bank-image-controls form input,
.bank-image-controls form select { width: 100%; min-width: 0; min-height: 32px; }
.bank-image-controls input[type="color"] { padding: 4px; }
.bank-image-controls form .btn { justify-self: start; }
.bank-image-adjustment summary { cursor: pointer; color: #286456; }
.bank-image-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 10px; }
.bank-image-fields input,
.bank-image-fields select { padding-inline: 6px; }
.bank-image-fields .btn { align-self: end; }
.bank-image-mask-toggle { margin-top: 8px; }
.bank-image-region-list { margin-top: 16px; }
.bank-image-region-heading { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; margin-bottom: 6px; }
.bank-image-region-list h3 { flex: 1 0 auto; font-size: 13px; margin: 0; }
.bank-image-region-list h3 span { font-weight: 400; color: var(--bank-image-muted); margin-left: 4px; }
.bank-image-region-list ol { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; max-height: 210px; overflow: auto; }
.bank-image-region-list li { min-width: 0; }
.bank-image-region-list ol button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 8px;
  padding: 7px 8px;
  border: 0;
  border-radius: 5px;
  background: #f1f7f4;
  color: var(--bank-image-ink);
  text-align: left;
}
.bank-image-region-list ol button span { overflow-wrap: anywhere; }
.bank-image-region-list ol button small { white-space: nowrap; color: #327263; }
.bank-image-region-list ol button small.is-low { color: #a47027; }
.bank-image-region-list ol button:hover,
.bank-image-region-list ol button[aria-current="true"] { background: #dceee6; }

.bank-image-status { margin: 0 0 10px; color: #286456; line-height: 1.65; white-space: pre-line; }
.bank-image-help {
  width: min(440px, calc(100vw - 32px));
  border: 0;
  border-radius: 12px;
  padding: 18px 20px 16px;
  color: var(--bank-image-ink);
}
.bank-image-help::backdrop { background: #17332c66; }
.bank-image-help h2 { margin: 0 0 10px; font-size: 18px; }
.bank-image-help ol { margin: 0 0 10px; padding-left: 1.3em; line-height: 1.65; }
.bank-image-help p { margin: 0 0 14px; color: var(--bank-image-muted); line-height: 1.65; }
.bank-image-leave {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: grid;
  place-items: center;
  padding: 16px;
  background: #17332c66;
}
.bank-image-leave-dialog {
  width: min(420px, 100%);
  padding: 18px 20px 16px;
  border-radius: 12px;
  background: #fff;
  color: var(--bank-image-ink);
}
.bank-image-leave-dialog h2 { margin: 0 0 8px; font-size: 18px; }
.bank-image-leave-dialog p { margin: 0 0 14px; line-height: 1.65; }
.bank-image-upload:not([hidden]) + .bank-image-status { margin-top: 10px; }
.bank-image-status.is-error { color: #a43e37; }
.bank-image-status:empty { display: none; }

@media (max-width: 1050px) {
  .bank-image-grid { grid-template-columns: minmax(0, 1fr); }
  .bank-image-controls { align-self: auto; }
  .bank-image-fields { max-width: 420px; }
}
@media (max-width: 500px) {
  .bank-image-toolbar { padding: 11px; }
  .bank-image-viewport { padding: 6px; }
}
