/* Profiles: quick switcher in the route strip + manager in Setup → Profiles. */
.profile-menu {
  position: relative;
  margin-left: auto;
  margin-right: 14px;
  min-width: 0;
}
.profile-menu summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  min-height: 30px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  max-width: 280px;
}
.profile-menu summary::-webkit-details-marker {
  display: none;
}
.profile-menu summary::after {
  content: "▾";
  color: var(--faint);
  font-size: 10px;
}
.profile-menu summary:hover,
.profile-menu[open] summary {
  border-color: var(--accent);
}
.profile-label {
  color: var(--muted);
  font: 10px var(--mono);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.profile-name {
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  min-width: 0;
}
.profile-dirty {
  width: 7px;
  height: 7px;
  flex: none;
  border-radius: 50%;
  background: var(--accent);
}
.profile-dirty[hidden] {
  display: none;
}
.profile-popover {
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  right: 0;
  width: min(300px, calc(100vw - 28px));
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 8px 22px var(--shadow);
  display: grid;
  gap: 8px;
}
.profile-quick {
  display: grid;
  gap: 2px;
  max-height: min(320px, 50vh);
  overflow-y: auto;
}
.profile-option {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  border: 0;
  border-radius: 5px;
  background: transparent;
  padding: 8px 9px;
  font-size: 13px;
}
.profile-option:hover {
  background: var(--selection);
}
.profile-option[aria-current="true"] {
  background: var(--selection);
  color: var(--accent);
}
.profile-option[aria-current="true"] .profile-option-name::before {
  content: "● ";
}
.profile-option-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.profile-option-meta {
  color: var(--muted);
  font: 10px var(--mono);
  white-space: nowrap;
}
.profile-quick-form {
  display: flex;
  gap: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}
.profile-quick-form input {
  flex: 1;
  min-width: 0;
}
.profile-quick-form button {
  white-space: nowrap;
  font-size: 11px;
}
#profile-quick-save[hidden] {
  display: none;
}
#profile-manage {
  justify-self: start;
  font-size: 11px;
}
.profile-save-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: end;
  gap: 10px 14px;
  margin-bottom: 14px;
}
.profile-save-form .check-field {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  min-height: 34px;
  white-space: nowrap;
}
.profile-list {
  display: grid;
  margin-bottom: 14px;
  border-top: 1px solid var(--line);
}
.profile-row {
  display: grid;
  grid-template-columns: minmax(140px, 1fr) auto auto;
  grid-template-areas:
    "name kit controls"
    "meta actions actions";
  align-items: center;
  gap: 6px 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.profile-row[data-active="true"] {
  box-shadow: inset 3px 0 0 var(--accent);
  padding-left: 10px;
}
.profile-row-name {
  grid-area: name;
  font-weight: 600;
  min-width: 0;
}
.profile-row-meta {
  grid-area: meta;
  color: var(--muted);
  font: 10px var(--mono);
}
.profile-row[data-error="true"] .profile-row-meta {
  color: var(--error);
}
.profile-row .check-field {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  white-space: nowrap;
}
.profile-row .check-field:nth-of-type(1) {
  grid-area: kit;
}
.profile-row .check-field:nth-of-type(2) {
  grid-area: controls;
}
.profile-row-actions {
  grid-area: actions;
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}
.profile-row-actions button {
  font-size: 11px;
  padding: 4px 9px;
}
@media (max-width: 700px) {
  .profile-save-form {
    grid-template-columns: 1fr 1fr;
  }
  .profile-save-form label:first-child {
    grid-column: 1 / -1;
  }
  .profile-row {
    grid-template-columns: 1fr 1fr;
    grid-template-areas:
      "name name"
      "kit controls"
      "meta meta"
      "actions actions";
  }
  .profile-row-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}
@media (max-width: 560px) {
  .route-strip {
    flex-wrap: wrap;
  }
  .profile-menu {
    order: 3;
    flex: 1 0 100%;
    margin: 0 0 6px;
  }
  .profile-menu summary {
    max-width: none;
  }
  .profile-popover {
    left: 0;
    right: auto;
  }
}
.profile-preferences {
  margin-top: 26px !important;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
#panel-settings > .micro {
  margin-bottom: 0;
}
.song-head {
  margin-top: 18px;
}
.song-sections {
  display: grid;
  gap: 4px;
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
  counter-reset: section;
}
.song-sections li {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr) auto auto auto;
  align-items: center;
  gap: 6px;
  counter-increment: section;
}
.song-sections li::before {
  content: counter(section);
  color: var(--muted);
  font: 11px var(--mono);
  text-align: center;
}
.song-sections li[data-current="true"]::before {
  content: "▸" counter(section);
  color: var(--accent);
}
.song-sections button {
  min-width: 30px;
  padding: 3px 6px;
  font-size: 11px;
}
.song-add {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.song-add select {
  flex: 1;
  min-width: 0;
}
.section-strip {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-right: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 1px;
}
.section-strip[hidden] {
  display: none;
}
.section-strip .icon-button {
  min-width: 26px;
  min-height: 28px;
  font-size: 16px;
}
#section-name {
  font-size: 11px;
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.section-strip[data-pending="true"] #section-name {
  color: var(--accent);
}
@media (max-width: 560px) {
  .section-strip {
    order: 4;
    margin: 0 0 6px;
  }
}
.song-head .check-field,
.section-head .check-field {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  white-space: nowrap;
}
