/* PortfolioV5 shared controls — buttons / selects / form states */
:where(button, input, select, textarea) { font: inherit; }
:where(button, a, input, select, textarea):focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 78%, white 8%);
  outline-offset: 2px;
}

/* PortfolioV5 button language */
.btn, .primary-btn, .secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  min-height: 42px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s, transform .2s, box-shadow .2s;
}
.btn, .secondary-btn {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.04);
  color: var(--text);
}
.btn:hover, .secondary-btn:hover {
  border-color: color-mix(in srgb, var(--accent) 32%, var(--line));
  background: color-mix(in srgb, var(--accent) 8%, rgba(255,255,255,.04));
  transform: translateY(-1px);
}
.btn.primary, .primary-btn {
  border: 0;
  color: #fff;
  background: linear-gradient(135deg,var(--accent),var(--accent2));
  box-shadow: none;
}
.btn.primary:hover, .primary-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 25px color-mix(in srgb,var(--accent) 20%,transparent);
}
.btn:disabled, .primary-btn:disabled, .secondary-btn:disabled {
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Exact PortfolioV5 custom select */
.select-shell { position: relative; min-width: 0; }
.select-shell > select {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  width: 1px !important;
  height: 1px !important;
  inset: auto !important;
}
.select-button {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--panel2, var(--panel));
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  font-weight: 700;
}
.select-button:hover, .select-shell.open .select-button {
  border-color: rgba(107,121,236,.55);
  background: rgba(107,121,236,.07);
}
.select-options {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 180px;
  max-height: 260px;
  overflow: auto;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 16px 44px rgba(0,0,0,.55);
  z-index: 1500;
}
.select-shell.open { z-index: 1500; }
.select-shell.open .select-options { display: grid; gap: 3px; }
.select-option {
  border: 0;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
  border-radius: 7px;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}
.select-option:hover, .select-option.active {
  background: rgba(107,121,236,.16);
  color: #fff;
}
html[data-theme="light"] .select-option:hover,
html[data-theme="light"] .select-option.active { color: var(--text); }
.select-option:disabled { opacity: .38; cursor: not-allowed; }
.select-arrow { font-size: 11px; color: var(--muted); transition: transform .2s; }
.select-shell.open .select-arrow { transform: rotate(180deg); }

/* Portfolio-like checks */
.check-row input[type="checkbox"] {
  appearance: none;
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  display: grid;
  place-content: center;
  border: 1px solid color-mix(in srgb,var(--text) 24%,transparent);
  border-radius: 4px;
  background: var(--panel2, var(--panel));
  cursor: pointer;
}
.check-row input[type="checkbox"]:checked { background: var(--accent); border-color: var(--accent); }
.check-row input[type="checkbox"]:checked::after { content: "✓"; color: #fff; font-size: 10px; font-weight: 900; }

@media (max-width: 640px) {
  .select-options { max-height: min(260px, 46vh); }
}
