/* Command palette + tweaks panel */

.palette-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(6px);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: 100;
  padding-top: 14vh;
  animation: fadeIn 0.12s ease;
}
.palette-backdrop.open { display: flex; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: translateY(-6px) scale(0.985); } to { opacity: 1; transform: none; } }

.palette {
  width: min(640px, 92vw);
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 14px;
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: popIn 0.16s ease;
  display: flex;
  flex-direction: column;
  max-height: 70vh;
}

.palette-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--ink-2);
}
.palette-head svg { width: 16px; height: 16px; }

.palette-input {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink-0);
  outline: none;
  font-family: var(--font-sans);
  font-size: 15px;
  padding: 2px 0;
}
.palette-input::placeholder { color: var(--ink-3); }

.palette-esc {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 2px 5px;
  background: var(--bg-3);
  color: var(--ink-2);
  border-radius: 3px;
}

.palette-results {
  flex: 1;
  overflow-y: auto;
  padding: 4px 0 6px;
}

.palette-group { padding: 6px 6px; }
.palette-group-label {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--ink-3);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 6px 12px 4px;
}

.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin: 0 6px;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink-1);
}
.palette-item.sel {
  background: var(--bg-2);
  color: var(--ink-0);
}
.palette-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: var(--ink-2);
  flex-shrink: 0;
}
.palette-item.sel .palette-icon { color: var(--accent); }
.palette-icon svg { width: 15px; height: 15px; }

.palette-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.palette-sub {
  font-size: 11px;
  color: var(--ink-3);
  font-family: var(--font-mono);
}

.palette-item .k {
  font-family: var(--font-mono);
  font-size: 10px;
  padding: 1px 5px;
  background: var(--bg-3);
  color: var(--ink-2);
  border-radius: 3px;
}

.palette-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  border-top: 1px solid var(--line);
  font-size: 11px;
  color: var(--ink-2);
  font-family: var(--font-mono);
  background: var(--bg-0);
}
.palette-foot .k {
  font-family: var(--font-mono);
  font-size: 9px;
  padding: 1px 4px;
  background: var(--bg-3);
  color: var(--ink-2);
  border-radius: 3px;
  margin-right: 2px;
}

/* Tweaks panel */
.tweaks-panel {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 280px;
  background: var(--bg-1);
  border: 1px solid var(--line-2);
  border-radius: 12px;
  box-shadow: var(--shadow-pop);
  z-index: 90;
  display: none;
  flex-direction: column;
  overflow: hidden;
}
.tweaks-panel.open { display: flex; animation: popIn 0.16s ease; }

.tweaks-head {
  display: flex;
  align-items: center;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--line);
}
.tweaks-head .eyebrow { flex: 1; }
.tweaks-close {
  background: transparent;
  border: 0;
  color: var(--ink-3);
  cursor: pointer;
  padding: 2px;
  display: grid;
  place-items: center;
}
.tweaks-close:hover { color: var(--ink-0); }
.tweaks-close svg { width: 14px; height: 14px; }

.tweaks-body { padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.tw-section { display: flex; flex-direction: column; gap: 6px; }
.tw-label {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.tw-seg {
  display: flex;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 2px;
  gap: 2px;
}
.tw-seg button {
  flex: 1;
  background: transparent;
  border: 0;
  color: var(--ink-2);
  font-family: var(--font-sans);
  font-size: 11.5px;
  padding: 5px 6px;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.12s;
}
.tw-seg button:hover { color: var(--ink-0); }
.tw-seg button.on {
  background: var(--bg-0);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--line-2);
}

.tweaks-foot {
  padding: 10px 14px;
  border-top: 1px solid var(--line);
  background: var(--bg-0);
}
