.brand-panel {
  border: 1px solid #d5d9d0;
  border-radius: 12px;
  background: #fcfbf8;
  color: #48534f;
  font: inherit;
}
.brand-panel [hidden] { display: none; }
.brand-panel summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 48px;
  padding: 10px 15px;
  border-radius: 11px;
  list-style: none;
  cursor: pointer;
}
.brand-panel summary::-webkit-details-marker { display: none; }
.brand-heading { flex: none; color: #263b39; font-size: .875rem; font-weight: 600; }
.brand-saved {
  overflow: hidden;
  margin-left: auto;
  font-size: .75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-panel summary svg {
  width: 14px; height: 14px; flex: none;
  fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round;
}
.brand-panel[open] > summary svg { transform: rotate(180deg); }
.brand-panel form { display: grid; gap: 13px; padding: 2px 15px 15px; }
.brand-panel .brand-field { display: grid; min-width: 0; gap: 5px; font-size: 13px; font-weight: 550; }
.brand-panel .brand-field[hidden] { display: none; }
.brand-panel select, .brand-panel input[type="text"],
.brand-panel .brand-file-button, .brand-panel button {
  min-height: 40px;
  padding: 8px 11px;
  border: 1px solid #cbd1c8;
  border-radius: 6px;
  background: #fdfcf9;
  color: #263b39;
  font: inherit;
  line-height: 1.4;
}
.brand-panel select, .brand-panel input[type="text"] { width: 100%; min-width: 0; font-size: 14px; font-weight: 450; }
.brand-panel .brand-file-button {
  position: relative; justify-self: start; display: inline-grid; place-items: center; overflow: hidden;
}
.brand-panel .brand-file-button input {
  position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer;
}
.brand-panel .brand-file-button:focus-within { outline: 2px solid #426345; outline-offset: 2px; }
.brand-panel .brand-file p, .brand-panel .brand-notice, .brand-panel .brand-fire-note {
  color: #48534f; font-size: 12px; line-height: 1.5;
}
.brand-panel .brand-fire-note { margin: 0; }
.brand-panel .brand-file p { margin: 5px 0 0; }
.brand-panel .brand-notice:empty { display: none; }
.brand-panel .brand-swatch {
  margin-top: 8px; padding: 10px 12px; border-radius: 6px; background: var(--ed-paper, #1b302a);
}
.brand-panel .brand-swatch img {
  display: block; max-width: 100%; width: auto; height: auto; max-height: 52px;
}
.brand-panel .brand-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.brand-panel button { font-size: 13px; font-weight: 600; cursor: pointer; }
.brand-panel .brand-apply { border-color: #426345; background: #426345; color: #fff; }
.brand-panel .brand-apply:enabled:hover { background: #345139; }
.brand-panel .brand-apply:disabled { opacity: .6; cursor: default; }
.brand-panel .brand-revert { border-color: transparent; background: transparent; font-weight: 500; }
.brand-panel .brand-revert:hover { background: #edf0e8; }
.theme-current { display: inline-flex; align-items: center; gap: 6px; color: #48534f; }
.theme-strip {
  display: block;
  background: linear-gradient(90deg, var(--ed-paper) 0 53%, var(--ed-ink) 53% 75%, var(--ed-accent) 75% 100%);
  border: 1px solid #263b392c;
  border-radius: 3px;
}
.theme-current .theme-strip { flex: none; width: 28px; height: 12px; }
.theme-picker { min-width: 0; margin: 0; border: 0; padding: 0 14px 14px; }
.theme-picker legend { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.theme-picker #theme-hint, .theme-picker .theme-notice { margin: 0; color: #48534f; font-size: 12px; line-height: 1.4; }
.theme-group { margin-top: 12px; }
.theme-group h3 { margin: 0 0 6px; color: #48534f; font-size: 12px; font-weight: 600; }
.theme-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.theme-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-content: center;
  align-items: center;
  gap: 5px 4px;
  min-height: 43px;
  padding: 6px 8px;
  border: 1px solid #d5d9d0;
  border-radius: 6px;
  background: #fdfcf9;
  color: #263b39;
  font-size: 12px;
  line-height: 1.22;
  cursor: pointer;
}
.theme-choice:hover { border-color: #9aaa97; }
.theme-choice:has(:checked) { border-color: #799573; background: #edf2e7; font-weight: 650; }
.theme-choice:has(:focus-visible) { outline: 2px solid #426345; outline-offset: 2px; }
.theme-choice .theme-strip { grid-column: 1 / -1; grid-row: 1; height: 7px; }
.theme-choice span { grid-column: 1; grid-row: 2; overflow-wrap: anywhere; }
.theme-choice input { grid-column: 2; grid-row: 2; margin: 0; accent-color: #426345; }
.theme-picker .theme-notice:not(:empty) { margin-top: 9px; }
@media (max-width: 700px) {
  .brand-panel select, .brand-panel input[type="text"] { font-size: 16px; }
  .brand-panel button, .brand-panel .brand-file-button { min-height: 44px; }
  .theme-choice { min-height: 44px; }
}
