/* Background rule for this drawer: it sits inside a .section card, so it stays
   on --bg-secondary like every other panel on the page, and NOTHING else uses
   --bg-tertiary. That grey belongs to .textInput - painting a panel with it too
   makes the inputs vanish into their own background. */
.drawer {
  background: var(--bg-secondary);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md, 8px);
  overflow: hidden;
}

.trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  background: transparent;
  border: none;
  text-align: left;
  cursor: pointer;
  color: var(--text-primary);
}

.trigger:hover {
  background: var(--bg-hover);
}

.chevron {
  flex-shrink: 0;
  color: var(--text-secondary);
  transition: transform 0.15s ease;
}

.chevronOpen {
  transform: rotate(180deg);
}

.title {
  font-size: 14px;
  font-weight: 600;
}

.spacer {
  flex: 1;
}

.count {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
}

.chip {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 4px;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.chipRequired {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
}

.chipConditional {
  background: var(--status-info-bg);
  color: var(--status-info-text);
}

.chipOptional {
  background: var(--bg-hover);
  color: var(--text-secondary);
}

/* Closed state: one pill per source, so the drawer still answers what is set
   and what is not without opening 19 fields to find out. */
.summary {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 0 12px 10px 34px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  font-weight: 500;
  padding: 2px 7px;
  border-radius: 10px;
  border: 1px solid transparent;
  white-space: nowrap;
}

.pillSet {
  background: rgba(34, 197, 94, 0.12);
  border-color: rgba(34, 197, 94, 0.3);
  color: #4ade80;
}

.pillMissing {
  background: rgba(245, 158, 11, 0.12);
  border-color: rgba(245, 158, 11, 0.3);
  color: #f59e0b;
}

.pillIdle {
  background: transparent;
  border-color: var(--border-default);
  color: var(--text-secondary);
}

.pillCount {
  opacity: 0.75;
  font-variant-numeric: tabular-nums;
}

.panel {
  border-top: 1px solid var(--border-default);
}

.intro {
  margin: 0;
  padding: 9px 12px 0;
  font-size: 11px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px 12px;
}

.card {
  border: 1px solid var(--border-default);
  border-radius: 6px;
  overflow: hidden;
}

/* A source with several keys is ONE set of credentials, not several unrelated
   tokens that happen to sit next to each other: the heavier edge and the head
   strip are what say so. */
.cardGroup {
  border-color: var(--border-strong);
  border-left-width: 3px;
}

.cardHead {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border-strong);
}

.cardName {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.row {
  display: grid;
  grid-template-columns: minmax(200px, 1fr) minmax(210px, 1.15fr);
  align-items: stretch;
}

.row + .row {
  border-top: 1px solid var(--border-subtle);
}

.rowLabel {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 7px 10px;
  min-width: 0;
}

.rowTop {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.rowName {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-primary);
}

.rowHint {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.rowLink {
  color: var(--accent-primary);
  white-space: nowrap;
}

.rowValue {
  display: flex;
  align-items: center;
  padding: 7px 10px;
  min-width: 0;
  border-left: 1px solid var(--border-subtle);
}

.inputWrap {
  position: relative;
  width: 100%;
}

/* .textInput is --bg-tertiary and every surface behind it here is not, which is
   the whole reason the panel does not use that grey. */
.inputWrap input {
  width: 100%;
  padding-right: 30px;
}

.reveal {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  padding: 2px;
  background: none;
  border: none;
  color: var(--text-tertiary);
  cursor: pointer;
}

.reveal:hover {
  color: var(--text-primary);
}

/* Two columns of 200px+ do not fit a phone, and a squeezed hint column is worse
   than a stacked one. */
@media (max-width: 720px) {
  .row {
    grid-template-columns: 1fr;
  }

  .rowValue {
    border-left: none;
    padding-top: 0;
  }

  .summary {
    padding-left: 12px;
  }
}
