/* Semantic checkbox/radio controls must not inherit text-field padding or width. */
:root {
  --choice-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3.2 3.2L13 4.5' fill='none' stroke='%231c2444' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --choice-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.2' fill='%231c2444'/%3E%3C/svg%3E");
}
html[data-theme=light] {
  --choice-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m3 8 3.2 3.2L13 4.5' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  --choice-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='3.2' fill='white'/%3E%3C/svg%3E");
}
html input:is([type=checkbox],[type=radio]),
html[data-theme] input:is([type=checkbox],[type=radio]) {
  -webkit-appearance: none;
  appearance: none;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  min-width: 18px;
  min-height: 18px;
  max-width: 18px;
  max-height: 18px;
  flex: 0 0 18px;
  margin: 0;
  padding: 0;
  display: inline-block;
  vertical-align: middle;
  cursor: pointer;
  border: 1.5px solid color-mix(in srgb, var(--muted) 65%, var(--border));
  border-radius: 5px;
  background-color: var(--control, #111620);
  background-image: none;
  background-position: center;
  background-repeat: no-repeat;
  background-size: 14px 14px;
  box-shadow: inset 0 1px 1px rgb(0 5 25 / 4%);
  outline: none;
  transition: border-color 140ms, background-color 140ms, box-shadow 140ms;
}
html input:is([type=checkbox],[type=radio])::after,
html[data-theme] input:is([type=checkbox],[type=radio])::after {
  content: none;
  display: none;
}
html input[type=radio], html[data-theme] input[type=radio] { border-radius: 50%; }
html input:is([type=checkbox],[type=radio]):hover:not(:disabled),
html[data-theme] input:is([type=checkbox],[type=radio]):hover:not(:disabled) {
  border-color: var(--accent);
}
html input:is([type=checkbox],[type=radio]):checked,
html[data-theme] input:is([type=checkbox],[type=radio]):checked {
  background-color: var(--accent);
  border-color: var(--accent);
  box-shadow: none;
}
html input[type=checkbox]:checked,
html[data-theme] input[type=checkbox]:checked { background-image: var(--choice-check); }
html input[type=radio]:checked,
html[data-theme] input[type=radio]:checked { background-image: var(--choice-dot); }
html input:is([type=checkbox],[type=radio]):focus-visible,
html[data-theme] input:is([type=checkbox],[type=radio]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  box-shadow: none;
}
html input:is([type=checkbox],[type=radio]):disabled,
html[data-theme] input:is([type=checkbox],[type=radio]):disabled {
  opacity: .48;
  cursor: not-allowed;
}
label:has(> input:is([type=checkbox],[type=radio])) {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  line-height: 1.6;
  cursor: pointer;
}
.reference-chips { gap: 8px; }
html[data-theme] .reference-chips .ref-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
  min-height: 38px;
  margin: 0;
  padding: 6px 8px;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  background: var(--control, #111620);
  box-shadow: inset 0 1px 0 var(--glass-shine, #ffffff0a);
  transition: border-color 140ms, background-color 140ms, box-shadow 140ms;
}
html[data-theme] .reference-chips .ref-chip:hover {
  border-color: color-mix(in srgb, var(--accent) 65%, var(--border));
}
html[data-theme] .reference-chips .ref-chip:has(input:checked) {
  border-color: var(--accent);
  color: var(--text);
  background: color-mix(in srgb, var(--accent) 13%, var(--raised, #1d2330));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 12%, transparent);
}
html[data-theme] .reference-chips .ref-chip:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
html[data-theme] .reference-chips .ref-chip input:focus-visible { outline: none; }
html[data-theme] .reference-chips .ref-chip:has(input:disabled) { cursor: not-allowed; opacity: .55; }
.reference-chips .ref-chip img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  border-radius: 5px;
  object-fit: cover;
  object-position: 50% 28%;
}
.reference-chips .ref-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 1.5;
}
html[data-theme] .radio-cards .radio-card { min-height: 48px; margin: 0; }
html[data-theme] .radio-card:has(input:focus-visible) {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}
html[data-theme] .radio-card input:focus-visible { outline: none; }
.export-shot-options label { align-items: flex-start; }
.export-shot-options label input { margin-top: 1px; }
.proposal-item label { min-height: 28px; }
.asset-card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--subtle, #b6a1ff08);
}
.asset-card .asset-card-actions :is(a,button) {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-height: 34px;
  margin: 0;
  padding: 5px 9px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
  text-align: center;
  white-space: nowrap;
  cursor: pointer;
}
.asset-card .asset-card-actions .icon { width: 14px; height: 14px; }
.asset-card .asset-card-actions .asset-card-delete { color: var(--red); }
.asset-card .asset-card-actions :is(a,button):hover {
  background: var(--control, #111620);
  border-color: var(--border);
}
.asset-card .asset-card-actions .asset-card-delete:hover {
  background: color-mix(in srgb, var(--red) 10%, transparent);
  border-color: color-mix(in srgb, var(--red) 40%, var(--border));
}
.asset-card .asset-card-actions :is(a,button):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.asset-delete-summary {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--control, #111620);
}
.asset-delete-summary :is(img,video) {
  width: 60px;
  height: 60px;
  flex: 0 0 60px;
  object-fit: cover;
  border-radius: 7px;
}
.asset-delete-summary > div { flex: 1; min-width: 0; }
.asset-delete-summary h3 { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.asset-delete-summary p { margin-top: 4px; font-size: 11px; color: var(--muted); line-height: 1.7; }
.asset-usage-list {
  display: grid;
  gap: 9px;
  max-height: 210px;
  overflow-y: auto;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--control, #111620);
  scrollbar-width: thin;
}
.asset-usage-list > label { margin: 0 0 2px; font-size: 11px; color: var(--muted); }
.asset-usage-list > div {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--text);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.asset-usage-list .icon { flex-shrink: 0; width: 15px; height: 15px; margin-top: 2px; color: var(--muted); }
html[data-theme] .modal-foot .btn.primary.danger {
  color: #391b28;
  background: var(--red);
  border-color: var(--red);
  box-shadow: inset 0 1px 0 #ffffff30;
}
html[data-theme=light] .modal-foot .btn.primary.danger { color: #fff; }
html[data-theme] .modal-foot .btn.primary.danger:hover { filter: brightness(1.05); }
@media (max-width:899px) {
  html[data-theme] .reference-chips .ref-chip { min-height: 42px; padding: 8px 10px; }
  .export-shot-options label { min-height: 32px; }
  .asset-card-actions { padding: 8px; gap: 4px; }
  .asset-card .asset-card-actions :is(a,button) { min-height: 36px; padding: 5px 7px; }
}
@media (prefers-reduced-motion:reduce) {
  html input:is([type=checkbox],[type=radio]),
  html[data-theme] .reference-chips .ref-chip { transition: none; }
}
