* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  background: #f4f4f5;
  color: #111827;
}

.layout {
  display: grid;
  grid-template-columns: 380px 380px;
  gap: 12px;
  max-width: 760px;
  margin: 0 auto;
  padding: 12px;
}

.panel {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  padding: 12px;
}

h1, h2 {
  margin: 8px 0;
  font-size: 18px;
}

h2 { margin-top: 14px; }

.muted {
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 13px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 10px;
}

label {
  font-size: 12px;
  color: #4b5563;
}

input, select, textarea, button {
  font: inherit;
}

input, select, textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
  background: #fff;
  color: #111827;
}

textarea {
  width: 100%;
  resize: vertical;
  margin-top: 8px;
}

.row {
  display: flex;
  gap: 8px;
}

.row.wrap {
  flex-wrap: wrap;
}

.grow { flex: 1; }

.btn {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px 10px;
  min-height: 36px;
  background: #f9fafb;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

#share-output {
  width: 100%;
  margin-top: 8px;
}

.bando-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 8px;
}

.bando-item {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 12px;
  background: #f3f4f6;
}

.bando-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.bando-head strong {
  font-size: 15px;
}

.bando-head-main {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  flex-wrap: nowrap;
}

.bando-name-field {
  flex: 1;
}

.bando-name {
  width: 100%;
  min-height: 36px;
  border: 1px solid #9ca3af;
  background: #ffffff;
  font-weight: 700;
}

.bando-move-row {
  display: flex;
  gap: 8px;
  margin-bottom: 6px;
}

.bando-move-row .btn {
  flex: 1;
}

.bando-icon-btn {
  min-width: 36px;
  min-height: 36px;
  padding: 0;
  font-size: 16px;
}

.bando-toggle-main {
  min-width: 36px;
  min-height: 36px;
  font-size: 16px;
}

.bando-delete-section {
  margin-top: 12px;
}

.bando-remove-danger {
  width: 100%;
  border-color: #dc2626;
  background: #ef4444;
  color: #ffffff;
  font-weight: 700;
}

.bando-insert-row {
  display: flex;
  justify-content: center;
  margin: 4px 0 2px;
}

.bando-insert-between {
  width: 100%;
  border-style: dashed;
}

.bando-head-size {
  margin-bottom: 0;
}

.bando-size-compact {
  min-width: 88px;
  max-width: 100px;
  min-height: 36px;
  padding: 6px 8px;
}

.bando-section {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #dfe3ea;
}

.bando-section-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #374151;
  margin-bottom: 6px;
}

.bando-item .row.wrap {
  gap: 10px;
  align-items: flex-end;
  margin-top: 6px;
  padding-top: 0;
  border-top: 0;
}

.bando-item .field {
  margin-bottom: 0;
}

.bando-item .field.grow {
  min-width: 80px;
  flex: 1 1 80px;
}

.bando-item label {
  font-size: 12px;
  font-weight: 600;
  color: #374151;
}

.bando-item input,
.bando-item select,
.bando-item textarea {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border-radius: 8px;
}

.bando-item .bando-text {
  margin-top: 0;
  min-height: 92px;
  line-height: 1.35;
}

.bando-item input.bando-bg-value[type="color"] {
  width: 100%;
  min-height: 36px;
  height: 36px;
  padding: 2px;
  cursor: pointer;
}

.bando-img-row {
  display: flex;
  align-items: center;
  width: 100%;
}

.bando-bg-btn {
  width: 100%;
}

.bando-img-name {
  display: block;
  width: 100%;
  margin-top: 6px;
  font-size: 12px;
  color: #6b7280;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 640px) {
  .bando-head {
    align-items: flex-start;
    flex-direction: column;
  }
  .bando-head-main {
    width: 100%;
    justify-content: space-between;
    flex-direction: column;
    align-items: stretch;
  }
}

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