.app-shell:has(> .selected-sources-sidebar:not([hidden])) { grid-template-columns: auto minmax(0, 1fr) 340px; }
.app-shell.debug-open:has(> .selected-sources-sidebar:not([hidden])) { grid-template-columns: auto minmax(0, 1fr) 340px 360px; }
.selected-sources-sidebar[hidden], .selected-sources-toggle[hidden], .selected-sources-panel [hidden] { display: none !important; }
.selected-sources-sidebar { min-width: 0; width: min(340px, 100%); height: 100vh; position: sticky; top: 0; z-index: 20; }
.selected-sources-panel { display: flex; flex-direction: column; gap: 18px; width: 100%; height: 100%; overflow-y: auto; border-left: 1px solid #dededb; background: #fbfaf9; padding: 24px 20px 28px; color: #242424; box-shadow: -10px 0 30px rgb(20 20 20 / 5%); }
.selected-sources-backdrop { display: none; }
.selected-sources-header, .selected-sources-title-row, .selected-sources-result-header, .selected-sources-selection-footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.selected-sources-heading-group { min-width: 0; }
.selected-sources-eyebrow { margin: 0 0 5px; color: #8b513b; font-family: var(--font-display, sans-serif); font-size: 10px; font-weight: 700; letter-spacing: .12em; }
.selected-sources-title { margin: 0; font-family: var(--font-display, sans-serif); font-size: 19px; font-weight: 650; }
.selected-sources-count { display: inline-grid; min-width: 24px; height: 24px; place-items: center; border-radius: 7px; background: #f2e7e0; color: #8a3b19; font-size: 12px; font-weight: 700; }
.selected-sources-close, .selected-sources-clear, .selected-sources-remove, .selected-sources-copy { border: 0; background: transparent; color: #8a3b19; font: inherit; font-size: 12px; font-weight: 650; cursor: pointer; }
.selected-sources-close { min-width: 44px; min-height: 36px; }
.selected-sources-intro, .selected-sources-empty { margin: 0; color: #62625e; font-size: 12px; line-height: 1.5; }
.selected-sources-list { display: grid; gap: 15px; }
.selected-sources-group-title, .selected-sources-section-title { margin: 0 0 9px; font-family: var(--font-display, sans-serif); font-size: 13px; font-weight: 700; }
.selected-sources-items { display: grid; gap: 7px; margin: 0; padding: 0; list-style: none; }
.selected-sources-item { display: flex; align-items: start; justify-content: space-between; gap: 8px; min-width: 0; border: 1px solid #e5e1dc; border-radius: 8px; background: #fff; padding: 10px; }
.selected-sources-item-details { display: grid; gap: 3px; min-width: 0; }
.selected-sources-item-title { color: #252525; font-size: 12px; font-weight: 650; line-height: 1.35; overflow-wrap: anywhere; }
.selected-sources-item-subtitle { color: #686660; font-size: 11px; line-height: 1.35; }
.selected-sources-remove { flex: 0 0 auto; min-height: 26px; }
.selected-sources-actions { display: grid; gap: 9px; border-top: 1px solid #e5e1dc; padding-top: 16px; }
.selected-sources-actions .selected-sources-section-title { margin-bottom: 2px; }
.selected-sources-action { width: 100%; min-height: 39px; border: 1px solid #d9cbc2; border-radius: 8px; background: #fff; padding: 8px 10px; color: #883a19; font: inherit; font-size: 12px; font-weight: 700; text-align: center; cursor: pointer; }
.selected-sources-action-primary { border-color: #af4e28; background: #af4e28; color: #fff; }
.selected-sources-draft-actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }
.selected-sources-action:disabled, .selected-sources-clear:disabled, .selected-sources-remove:disabled { opacity: .5; cursor: not-allowed; }
.selected-sources-context-label { margin-top: 5px; font-size: 12px; font-weight: 650; line-height: 1.4; }
.selected-sources-context, .selected-sources-result-text { width: 100%; min-width: 0; resize: vertical; border: 1px solid #d8d5d0; border-radius: 8px; background: #fff; padding: 10px; color: #252525; font: inherit; font-size: 12px; line-height: 1.5; }
.selected-sources-result-text[readonly] { background: #faf9f7; }
.selected-sources-hint { margin: -3px 0 0; color: #6d6a65; font-size: 11px; line-height: 1.45; }
.selected-sources-status, .selected-sources-error { margin: 0; border-radius: 7px; padding: 9px 10px; font-size: 12px; line-height: 1.4; }
.selected-sources-status { background: #f1ede6; color: #5d4b36; }
.selected-sources-error { background: #fff0ed; color: #962b20; }
.selected-sources-result { display: grid; gap: 8px; border-top: 1px solid #e5e1dc; padding-top: 15px; }
.selected-sources-result .selected-sources-section-title { margin: 0; }
.selected-sources-toggle { justify-self: end; min-height: 36px; border: 1px solid #d9cbc2; border-radius: 8px; background: #fff; padding: 7px 11px; color: #883a19; font: inherit; font-size: 12px; font-weight: 700; cursor: pointer; }
.selected-sources-panel :is(button, textarea):focus-visible, .selected-sources-toggle:focus-visible { outline: 2px solid #b4461a; outline-offset: 2px; }
@media (max-width: 920px) {
	.app-shell:has(> .selected-sources-sidebar:not([hidden])), .app-shell.debug-open:has(> .selected-sources-sidebar:not([hidden])) { grid-template-columns: 1fr; }
	.selected-sources-sidebar { position: fixed; inset: 0; width: 100%; height: 100dvh; z-index: 60; }
	.selected-sources-backdrop { display: block; position: absolute; inset: 0; width: 100%; height: 100%; border: 0; background: rgb(18 18 18 / 45%); cursor: pointer; }
	.selected-sources-panel { position: absolute; top: 0; right: 0; width: min(380px, calc(100% - 28px)); height: 100%; padding: 20px 16px 28px; box-shadow: -16px 0 45px rgb(0 0 0 / 18%); }
}
@media (prefers-reduced-motion: no-preference) {
	.selected-sources-panel { scroll-behavior: smooth; }
}
