.hero-bg {
  background: 
    linear-gradient(to bottom, transparent 0%, transparent 60%, var(--bs-body-bg) 100%),
    radial-gradient(1200px 400px at 10% -10%, rgba(34,211,238,.25), transparent),
    radial-gradient(800px 300px at 90% -20%, rgba(107,92,255,.25), transparent);
  background-repeat: no-repeat;
  background-attachment: fixed;
}

h3:not(.popover-header), h4 {
	margin-top: 1.3em;
}

h5 {
	margin-top: 1em;
}

.fs-medium {
	font-size: 0.7rem;
}

#tidy_response h1, #chat-container h1 {
	font-size: 1.4rem;
}

#tidy_response h2, #chat-container h2 {
	font-size: 1.3rem;
}

#tidy_response h3, #chat-container h3 {
	font-size: 1.2rem;
}

#tidy_response h4, #chat-container h4 {
	font-size: 1.1rem;
}

#tidy_response li, #chat-container li {
	margin-bottom: 5px;
}

#tidy_response li > p, #chat-container li > p {
	margin-bottom: 0;
}

#tidy_response table, #chat-container table {
	margin-bottom: 20px;
}

#tidy_response table tr:nth-child(even), #tidy_response table th, #chat-container table tr:nth-child(even), #chat-container table th {
	background-color: var(--bs-secondary-bg);
}

#tidy_response table th, #tidy_response table td, #chat-container table th, #chat-container table td {
	padding: 5px;
}

.hide {
	display: none;
}

.label {
	color: var(--bs-secondary-color);
	font-size: .875rem;
}

.navbar-expand-lg {
	align-items: end;
}
.navbar-nav > li > a  {
    padding: 0;
    margin: 0 0 3px 0;
    vertical-align: bottom;
}
.nav-item {
	margin-top: 9px;
	padding-bottom: 6px;
	border-bottom: 1px solid transparent;
	box-sizing: border-box;
}

.hidden {
	display: none;
}

.z-5 {
	z-index: 5 !important;
}

/* Loading spinner on disabled buttons. Not in the multitrack editor, where "disabled" only means "not available" (.multitrack-card, see below). */
button[disabled]:not(#send-btn):not(.no-spinner):not(.multitrack-card *):after {
	content: " ";
	display: inline-block;
	width: 15px;
	height: 15px;
	margin-left: 10px;
	margin-bottom: -2px;
	border-radius: 50%;
	border: 2px solid #fff;
	border-color: #fff transparent #fff transparent;
	animation: lds-dual-ring 2s linear infinite;
	box-sizing: border-box;
}


/* chat button */
button#send-btn .loading-spinner {
	display: none; /* Standard: Spinner verstecken */
}

button#send-btn:disabled .send-icon {
	display: none;  /* Icon nur zeigen, wenn nicht disabled */
}

button#send-btn:disabled .loading-spinner {
	display: inline-block;
	width: 15px;
	height: 15px;
	border-radius: 50%;
	border: 2px solid #fff;
	border-color: #fff transparent #fff transparent;
	animation: lds-dual-ring 2s linear infinite;
	box-sizing: border-box;
	vertical-align: middle;
}


@keyframes pulse {
	0% {
	  opacity: 1;
	}
	50% {
	  opacity: 0.5;
	}
	100% {
	  opacity: 1;
	}
}

.inactive {
	opacity: 0.4;
	cursor: default;
}

.disabled {
	animation: pulse 1.0s infinite ease-in-out;
	color: hotpink;
}

.think {
	font-size: .875em;
	font-style: italic;
}

.think p {
	margin-bottom: 0.5rem;
}

.form-group {
	position: relative;
	z-index: 0;
}

.dropdown {
	position: relative;
	/*z-index: 2; */
	animation: dropdownFadeIn 0.2s ease-in-out;
}

/* Smooth transition when context menu becomes visible */
@keyframes dropdownFadeIn {
    from {opacity: 0;} to {opacity: 1;}
}

.response-container {
	position: relative;
	margin-bottom: 5px;
	word-wrap: break-word;
}

.response-text-container,
.response-image-container {
	min-height: 38px;
	padding-right: 44px;
	width: auto;
}
.response-image-container {
	margin-left: 24px;
	border: none;
}
.response-container input[type="radio"],
.response-container input[type="checkbox"] {
	position: absolute;
	top: 6px;
}

.clipboard-button {
	background-size: auto 15px;
	background-repeat: no-repeat;
	background-position: center;
	width: 26px;
	height: 26px;
	position: absolute;
	right: 6px;
	top: 6px;
	padding: 0;
	box-sizing: border-box;
	border: 0;
}
.clipboard-button.paste {
	top: 30px;
}
.clipboard-button.close {
	top: 30px;
	background-image: url(../img/x-solid.svg);
}

div.highlight {
	padding: 20px;
	border-radius: 6px;
}

.link-unstyled {
	color: inherit;
	text-decoration: inherit;
}

.audio-entry {
	display: flex;
	align-items: center;
	gap: 10px;
}
.audio-entry.hidden {
	display: none;
}
.audio-entry .title {
	flex: 1;
}
.audio-entry .duration {
	font-family: var(--bs-font-monospace);
	font-size: .8em;
}
.audio-entry img {
	width: 15px;
	height: 15px;
}
.audio-entry:hover {
	cursor: pointer;
}

/* Images in llm output */
img.img-result {
	max-width: 60%;
	margin: 10px 10px 10px 0;
}

/* Smaller image variant for tool-call previews (e.g. scrape_webpage), added to img-result */
img.img-scrape-pill {
	max-width: 10%;
}

/* Reset img-result styling when nested inside a .card (any depth) */
.card img.img-result {
	max-width: 100%;
	margin: 0;
}

/* Plots */
.plot {
	margin-bottom: 1rem;
}

.plot-thumb{
	width: 180px;
	height: auto;
}

.generated-image-landscape {
	width: 100%;
}
.generated-image-portrait {
	width: 60%;
}
.generated-image-square {
	width: 100%;
}

img[class*="generated-image-"] {
  border: 1px solid #e0e0e0;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* ============================================================================
   META POST PREVIEW CARD (inline in chat + inside the tool-expansion pill)
   ============================================================================ */

/* Custom placeholder tag written by the LLM (see connectors/meta/functions.py
   get_meta_post_preview) while the message is still streaming. Replaced with
   the actual card markup by main.js insertMetaPostPreviews() once streaming
   completes (see chat.js onComplete). Rendered as a static gray skeleton with
   a centered image icon. */

meta-post-preview {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 420px;
	min-height: 220px;
	margin: 0.5rem 0;
	border-radius: 0.5rem;
	background-color: var(--bs-secondary-bg);
}

meta-post-preview::before {
	content: "\f42a"; /* bi-image codepoint, see icons.getbootstrap.com/icons/image */
	font-family: "bootstrap-icons" !important;
	font-style: normal;
	font-weight: normal;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--bs-secondary-color);
}

/* Animation assistant: placeholder while streaming (replaced by static/js/utils/animation_player.js) and the card. */

animation-player {
	display: flex;
	align-items: center;
	justify-content: center;
	max-width: 420px;
	min-height: 160px;
	margin: 0.5rem 0;
	border-radius: 0.5rem;
	background-color: var(--bs-secondary-bg);
}

animation-player::before {
	content: "\f3c3"; /* bi-film */
	font-family: "bootstrap-icons" !important;
	font-style: normal;
	font-weight: normal;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--bs-secondary-color);
}

.animation-card {
	max-width: 660px;
}

.animation-card-header .animation-title {
	min-width: 0;
	flex: 1 1 auto;
}

.animation-card-icons {
	flex: 0 0 auto;
	white-space: nowrap;
}

.animation-card-icons .bi {
	cursor: pointer;
}

.animation-card-icons .animation-icon-busy {
	opacity: 0.5;
	pointer-events: none;
}

.animation-media {
	min-height: 0;
}

.animation-video,
.animation-placeholder,
.animation-stage {
	display: block;
	width: 100%;
	background: #000;
	border-radius: 0.375rem;
}

.animation-placeholder {
	border: 0;
	color: rgba(255, 255, 255, 0.75);
	font-size: 3rem;
	cursor: pointer;
}

.animation-placeholder:hover,
.animation-placeholder:focus-visible {
	color: #fff;
}

.animation-stage {
	position: relative;
	overflow: hidden;
}

.animation-frame {
	position: absolute;
	top: 0;
	left: 0;
	border: 0;
	background: #fff;
	transform-origin: top left;
	pointer-events: none;
}

.animation-stage-status {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: none;
}

.animation-stage-status[hidden],
.animation-errors[hidden],
.animation-hint[hidden] {
	display: none !important;
}

.animation-errors {
	margin-top: 0.25rem;
	overflow-wrap: anywhere;
}

.animation-scrubber {
	min-width: 60px;
}

.animation-time {
	font-variant-numeric: tabular-nums;
}

.animation-skeleton-media {
	height: 200px;
	border-radius: 0.375rem;
}

.animation-modal .animation-stage {
	margin-left: auto;
	margin-right: auto;
}

/* Multitrack editor (static/js/utils/multitrack_editor.js) */
multitrack-player::before {
	content: "\f465"; /* bi-layout-three-columns */
	font-family: "bootstrap-icons" !important;
	font-style: normal;
	font-weight: normal;
	font-size: 2.5rem;
	line-height: 1;
	color: var(--bs-secondary-color);
}

.multitrack-card {
	max-width: 960px;
}

.multitrack-title {
	min-width: 0;
	flex: 1 1 auto;
}

.multitrack-header {
	position: relative;
}

.multitrack-public-toggle {
	flex: 0 0 auto;
}

.multitrack-public-toggle[hidden] {
	display: none !important;
}

.multitrack-public-busy {
	opacity: 0.5;
	cursor: progress;
}

.multitrack-time {
	font-variant-numeric: tabular-nums;
	min-width: 6.5rem;
}

.multitrack-toolbar-gap {
	width: 0.5rem;
}

.multitrack-zoom {
	width: 110px;
	margin: 0;
}

.multitrack-status {
	min-width: 0;
}

.multitrack-render-bar {
	height: 6px;
	margin-bottom: 0.25rem;
}

.multitrack-render-text {
	min-height: 1.2em;
}

.multitrack-versions {
	position: absolute;
	top: calc(100% + 0.25rem);
	right: 0;
	z-index: 20;
	width: min(420px, 100%);
	max-height: 260px;
	overflow-y: auto;
}

.multitrack-versions[hidden],
.multitrack-banner[hidden],
.multitrack-render-progress[hidden],
.multitrack-render-bar[hidden],
.multitrack-empty[hidden],
.multitrack-info[hidden],
.multitrack-warnings[hidden],
.multitrack-wave[hidden] {
	display: none !important;
}

.multitrack-scroll {
	position: relative;
	overflow: auto;
	max-height: 440px;
	border: 1px solid var(--bs-border-color);
	border-radius: 0.375rem;
	background: var(--bs-body-bg);
}

.multitrack-canvas {
	position: relative;
	min-width: 100%;
}

.multitrack-ruler-row,
.multitrack-row {
	display: flex;
	flex-wrap: nowrap;
}

.multitrack-ruler-row {
	position: sticky;
	top: 0;
	z-index: 4;
	background: var(--bs-tertiary-bg);
	border-bottom: 1px solid var(--bs-border-color);
}

.multitrack-corner,
.multitrack-head {
	position: sticky;
	left: 0;
	z-index: 3;
	flex: 0 0 auto;
	background: var(--bs-tertiary-bg);
	border-right: 1px solid var(--bs-border-color);
}

.multitrack-corner {
	z-index: 5;
}

.multitrack-ruler {
	position: relative;
	flex: 0 0 auto;
	cursor: pointer;
	user-select: none;
}

.multitrack-tick {
	position: absolute;
	bottom: 0;
	height: 6px;
	border-left: 1px solid var(--bs-secondary-color);
	opacity: 0.6;
	pointer-events: none;
}

.multitrack-tick.major {
	height: 14px;
	opacity: 1;
}

.multitrack-tick-label {
	position: absolute;
	left: 3px;
	bottom: 10px;
	font-size: 0.7rem;
	line-height: 1;
	white-space: nowrap;
	color: var(--bs-secondary-color);
	font-variant-numeric: tabular-nums;
}

.multitrack-row {
	border-bottom: 1px solid var(--bs-border-color);
}

.multitrack-head {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	padding: 4px 6px 4px 8px;
	border-left: 4px solid var(--bs-secondary);
}

.multitrack-track-name {
	min-width: 0;
}

.multitrack-controls .btn {
	width: 26px;
	height: 24px;
	padding: 0;
	font-size: 0.7rem;
	line-height: 1;
}

.multitrack-level {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
}

.multitrack-level-label {
	font-size: 0.7rem;
	line-height: 1;
	color: var(--bs-secondary-color);
	font-variant-numeric: tabular-nums;
}

.multitrack-lane {
	position: relative;
	z-index: 0; /* own stacking context: handles, envelopes etc. of a lane stay below the sticky head */
	flex: 0 0 auto;
	overflow: hidden;
}

.multitrack-row-muted .multitrack-lane {
	opacity: 0.55;
}

.multitrack-clip {
	position: absolute;
	top: 2px;
	bottom: 2px;
	overflow: hidden;
	border-radius: 0.25rem;
	border: 1px solid var(--mt-color, var(--bs-secondary));
	background: var(--bs-secondary-bg);
	background: color-mix(in srgb, var(--mt-color, var(--bs-secondary)) 22%, var(--bs-body-bg));
	cursor: pointer;
	user-select: none;
}

.multitrack-clip.selected {
	outline: 2px solid var(--bs-primary);
	outline-offset: -1px;
	z-index: 1;
}

.multitrack-clip.inaudible {
	opacity: 0.6;
}

.multitrack-clip.missing {
	background: repeating-linear-gradient(135deg, var(--bs-secondary-bg), var(--bs-secondary-bg) 6px, var(--bs-tertiary-bg) 6px, var(--bs-tertiary-bg) 12px);
	border-style: dashed;
}

.multitrack-wave {
	position: absolute;
	top: 2px;
	pointer-events: none;
}

.multitrack-clip-label {
	position: absolute;
	top: 0;
	left: 4px;
	right: 4px;
	font-size: 0.7rem;
	line-height: 1.3;
	pointer-events: none;
	text-shadow: 0 0 2px var(--bs-body-bg);
}

.multitrack-playhead {
	position: absolute;
	top: 0;
	bottom: 0;
	left: 0;
	width: 0;
	border-left: 2px solid var(--bs-danger);
	z-index: 2;
	pointer-events: none;
	will-change: transform;
}

.multitrack-empty {
	padding: 1rem;
	text-align: center;
	position: sticky;
	left: 0;
}

.multitrack-skeleton-media {
	height: 160px;
	border-radius: 0.375rem;
}

.multitrack-card:focus-visible {
	outline: 2px solid var(--bs-primary-border-subtle, #4a90e280);
}

.multitrack-card.multitrack-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 1056;
	max-width: none;
	border-radius: 0;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.multitrack-card.multitrack-fullscreen .multitrack-body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	min-height: 0;
}

.multitrack-card.multitrack-fullscreen .multitrack-scroll {
	flex: 1 1 auto;
	max-height: none;
	min-height: 0;
}

body.multitrack-fullscreen-open {
	overflow: hidden;
}

/* Multitrack editor: editing (static/js/utils/multitrack_gestures.js, multitrack_envelope.js, multitrack_transcript.js) */
.multitrack-handle[hidden],
.multitrack-fade-shape[hidden],
.multitrack-range[hidden],
.multitrack-gap-button[hidden],
.multitrack-tip[hidden],
.multitrack-snapline[hidden],
.multitrack-rubber[hidden],
.multitrack-transcript[hidden],
.multitrack-grip[hidden],
.multitrack-track-menu-wrap[hidden],
.multitrack-duck-role[hidden],
.multitrack-duck-depth[hidden],
.multitrack-duck-info[hidden] {
	display: none !important;
}

.multitrack-tool-range .multitrack-clip {
	cursor: crosshair;
}

.multitrack-handle {
	position: absolute;
	z-index: 3;
}

.multitrack-handle-trim-left,
.multitrack-handle-trim-right {
	top: 0;
	bottom: 0;
	width: 6px;
	cursor: ew-resize;
}

.multitrack-handle-trim-left {
	left: 0;
}

.multitrack-handle-trim-right {
	right: 0;
}

.multitrack-handle-trim-left:hover,
.multitrack-handle-trim-right:hover {
	background: var(--mt-color, var(--bs-secondary));
	opacity: 0.5;
}

.multitrack-handle-fade-in,
.multitrack-handle-fade-out {
	top: 0;
	width: 10px;
	height: 10px;
	cursor: ew-resize;
	border: 1px solid var(--mt-color, var(--bs-secondary));
	border-radius: 2px;
	background: var(--bs-body-bg);
}

.multitrack-handle-gain {
	top: 0;
	width: 20px;
	height: 6px;
	cursor: ns-resize;
	border: 1px solid var(--mt-color, var(--bs-secondary));
	border-radius: 0 0 3px 3px;
	background: var(--bs-body-bg);
}

.multitrack-fade-shape {
	position: absolute;
	top: 0;
	height: 100%;
	pointer-events: none;
	background: color-mix(in srgb, var(--bs-body-bg) 60%, transparent);
}

.multitrack-fade-shape-in {
	left: 0;
	clip-path: polygon(0 0, 100% 0, 0 100%);
}

.multitrack-fade-shape-out {
	right: 0;
	clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.multitrack-ghost {
	opacity: 0.6;
	pointer-events: none;
	border-style: dashed;
	z-index: 2; /* above the lanes (z-index 0), below the head (3) */
}

.multitrack-tip {
	position: absolute;
	z-index: 10;
	padding: 1px 6px;
	border-radius: 0.25rem;
	font-size: 0.75rem;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	pointer-events: none;
	color: var(--bs-body-bg);
	background: var(--bs-emphasis-color);
}

.multitrack-snapline {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 0;
	z-index: 2;
	pointer-events: none;
	border-left: 1px dashed var(--bs-primary);
}

.multitrack-rubber {
	position: absolute;
	z-index: 2;
	pointer-events: none;
	border: 1px solid var(--bs-primary);
	background: rgba(var(--bs-primary-rgb), 0.15);
}

.multitrack-range {
	position: absolute;
	top: 2px;
	bottom: 2px;
	z-index: 2;
	pointer-events: none;
	border-left: 1px solid var(--bs-danger);
	border-right: 1px solid var(--bs-danger);
	background: rgba(var(--bs-danger-rgb), 0.2);
}

.multitrack-gap-button {
	position: absolute;
	top: 18px;
	z-index: 5;
	width: 28px;
	height: 28px;
	padding: 0;
	line-height: 1;
}

.multitrack-envelope {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 4;
	cursor: crosshair;
}

.multitrack-envelope-line {
	fill: none;
	stroke: var(--bs-warning);
	stroke-width: 2;
	pointer-events: none;
}

.multitrack-envelope-zero {
	stroke: var(--bs-secondary-color);
	stroke-dasharray: 2 3;
	opacity: 0.6;
	pointer-events: none;
}

.multitrack-envelope-duck {
	fill: none;
	stroke: var(--bs-info);
	stroke-width: 1.5;
	stroke-dasharray: 4 3;
	pointer-events: none;
}

.multitrack-envelope-point {
	fill: var(--bs-body-bg);
	stroke: var(--bs-warning);
	stroke-width: 2;
	cursor: grab;
}

.multitrack-envelope-point.selected {
	fill: var(--bs-warning);
}

.multitrack-head-top {
	min-width: 0;
}

.multitrack-grip {
	cursor: grab;
	color: var(--bs-secondary-color);
	touch-action: none;
}

.multitrack-color {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
}

.multitrack-rename {
	min-width: 0;
	height: 20px;
	padding: 0 4px;
}

.multitrack-menu-button {
	line-height: 1;
	color: var(--bs-secondary-color);
}

.multitrack-head-info {
	min-width: 0;
}

.multitrack-duck-role {
	font-size: 0.75rem;
	line-height: 1;
	color: var(--bs-secondary-color);
}

/* The sticky heads of the following tracks would cover the open menu (every head is its own stacking context). */
.multitrack-row-menu-open .multitrack-head {
	z-index: 6;
}

.multitrack-track-menu {
	min-width: 15rem;
}

.multitrack-duck-depth {
	font-variant-numeric: tabular-nums;
}

.multitrack-duck-slider {
	margin: 0;
}

.multitrack-row-selected .multitrack-head {
	background: var(--bs-secondary-bg);
}

.multitrack-transcript-body {
	position: relative;
	max-height: 200px;
	border: 1px solid var(--bs-border-color);
	border-radius: 0.375rem;
}

.meta-post-preview-card {
	width: 100%;
	margin: 0.5rem 0;
}

.meta-post-preview-card .meta-post-preview-thumb {
	width: 100%;
	object-fit: cover;
}

.meta-post-preview-card .meta-post-preview-thumb-fallback {
	width: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--bs-secondary-bg);
	color: var(--bs-secondary-color);
	font-size: 2.5rem;
}

.meta-post-preview-card .meta-post-preview-caption {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.meta-post-preview-card .meta-post-preview-metric {
	background: var(--bs-tertiary-bg);
	border: 1px solid var(--bs-border-color);
	border-radius: 0.375rem;
}

.meta-post-preview-thumb,
.meta-post-preview-thumb-fallback {
    height: 180px; /* Standard: gestapelt */
    object-fit: cover;
}

@media (min-width: 768px) {
    .meta-post-preview-thumb,
    .meta-post-preview-thumb-fallback {
        height: 100%; /* füllt die col-Höhe neben den Infos */
        min-height: 160px;
    }
}

@media (prefers-color-scheme: light) {
	div.highlight {
		color: var(--bs-body-bg);
	}
}

.plot-sm {
	width: 100%;
	margin-bottom: 1rem;
}

.plot {
	width: 100%;
	margin-bottom: 1rem;
}

@media (min-width: 992px) {
	.nav-item.active {
		border-bottom: 1px solid var(--bs-nav-link-color);
	}

	.plot-sm {
		width: 80%;
		margin-bottom: 1rem;
	}

	.plot-thumb{
		width: 400px;
		height: auto;
	}

	.generated-image-landscape {
		width: 70%;
	}
	.generated-image-portrait {
		width: 30%;
	}
	.generated-image-square {
		width: 40%;
	}
	
}

/* ============================================================
   Custom modal size: .modal-xxl
   Scales up across all Bootstrap breakpoints.
   Values are aligned with Bootstrap's container widths to
   ensure horizontal margin on all screen sizes.
   ============================================================ */

/* md and up (≥768px): replaces Bootstrap's narrow default */
@media (min-width: 768px) {
    .modal-xxl {
        --bs-modal-width: 700px;
    }
}

/* lg and up (≥992px) */
@media (min-width: 992px) {
    .modal-xxl {
        --bs-modal-width: 900px;
    }
}

/* xl and up (≥1200px) */
@media (min-width: 1200px) {
    .modal-xxl {
        --bs-modal-width: 1100px;
    }
}

/* xxl and up (≥1400px - Bootstrap standard breakpoint) */
@media (min-width: 1400px) {
    .modal-xxl {
        --bs-modal-width: 1300px;
    }
}

/* Custom wide breakpoint (≥1600px) */
@media (min-width: 1600px) {
    .modal-xxl {
        --bs-modal-width: 1500px;
    }
}


@keyframes lds-dual-ring {
	0% {
		transform: rotate(0deg);
	}
	100% {
		transform: rotate(360deg);
	}
}

/* Voice and audio cards */
.provider-Microsoft {
	--bs-card-bg: #dff0fb;
	--bs-card-color: #002b80;
}

.provider-Elevenlabs {
	--bs-card-bg: #dfffea;
	--bs-card-color: #004d26;
}

.provider-Google {
	--bs-card-bg: #faccff80;
	--bs-card-color: #32004d;
}

.provider-unknown {
	--bs-card-bg: #dfe6ed;
}

.provider-alert {
	--bs-card-bg: #ffa5a5;
}

.audiotype-bed {
	--bs-card-bg: #fffbea;
}

.audiotype-bub {
	--bs-card-bg: #e7dfff;
}

.audiotype-unknown {
	--bs-card-bg: #dfe6ed;
}

.audio-card {
	background-color: #f9fafb;
}

/* Dark Mode */
@media (prefers-color-scheme: dark) {
	.provider-Microsoft {
		--bs-card-bg: #003366;
		--bs-card-color: #cce0ff;
	}

	.provider-Elevenlabs {
		--bs-card-bg: #004d26;
		--bs-card-color: #ccffdd;
	}

	.provider-Google {
		--bs-card-bg: #32004d;
		--bs-card-color: #f0ccff;
	}

	.provider-unknown {
		--bs-card-bg: #434b53;
	}

	.provider-alert {
		--bs-card-bg: #b32424;
	}

	.audiotype-bed {
		--bs-card-bg: #423a28;
	}

	.audiotype-bub {
		--bs-card-bg: #372b50;
	}

	.audiotype-unknown {
		--bs-card-bg: #434b53;
	}

	.audio-card {
		background-color: #141414;
	}

	.transcript-word:hover {
		background-color: rgba(255, 255, 255, 0.1);
	}

	.transcript-word-active {
		background-color: rgba(255, 193, 7, 0.35);
	}
}

.cards.row {
	margin-right: 0;
	margin-left: 0;
}

.card-body {
    padding: 0.8rem 0.8rem;
}

.voice-card {
    min-width: 0;
}

.voice-card .card {
    height: 100%;
}

.voice-card .card-body {
    min-width: 0;
}

.voice-card .card-title,
.voice-card .card-subtitle {
    overflow-wrap: anywhere;
    word-break: break-word;
}

.profile-pic {
    width: 63px;
    height: 63px;
    border-radius: 50%;
}
 
.profile-pic-large {
    width: 230px;
    height: 230px;
    border-radius: 50%;
}

/* voiceDetailModal: voice settings next to the voice properties on large screens */
@media (min-width: 992px) {
    .voice-settings-column {
        border-left: var(--bs-border-width, 1px) solid var(--bs-border-color, #dee2e6);
        padding-left: 1.5rem;
    }
}
 
.card-title {
    display: -webkit-box;
    -webkit-line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
	line-height: 1.3;
	margin-top: 0;
	font-size: 1.1rem;
}
 
.card-subtitle {
	height: 2.7em;
	line-height: 1.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.card-description {
	height: 2.7em;
	line-height: 1.3em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-style: italic;
}

.audio-chip-subtitle {
	line-height: 1.3em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.audio-chip-description {
	line-height: 1.3em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	text-overflow: ellipsis;
	font-style: italic;
}

.dict-search {
	font-weight: 500;
	line-height: 0.9rem;
	margin-bottom: 0;
}

.dict-substitution {
	font-size: .875em;
	margin-bottom: 0;
}

@keyframes spin {
	from { transform: rotate(0deg); }
	to { transform: rotate(360deg); }
}

.spin {
	animation: spin 2s infinite linear;
	transform-origin: 50% 51%;
}

.play-button {
	color: var(--bs-secondary);
}

.play-button:hover {
	color: var(--bs-secondary-text-emphasis);
}

.icon-disabled {
	opacity: 0.5;
}

/* Transcript cards */
.dialogue-description {
	font-style: italic;
}

.card-body .badge-pill.badge-directive{
	background-color: #fbda9c;
	color: #333;
	vertical-align: text-bottom;
	line-height: 0.9;
}

.card-body .badge-pill.badge-style{
	background-color: #cfe5fb;
	color: #333;
	font-style: italic;
	vertical-align: middle;
}

.card-body .badge-pill.badge-break{
	background-color: #b9e6df;
	color: #333;
	vertical-align: middle;
	margin: 0 0.15em;
	line-height: 0.9;
}

/* Interactive transcript player */
.transcript-player-wrapper {
	overflow: hidden;
}

.transcript-waveform {
	cursor: pointer;
	border: 1px solid rgba(108, 117, 125, .5);
	border-radius: 4px;
}

.transcript-minimap {
	border: 1px solid rgba(108, 117, 125, .5);
	border-radius: 4px;
}

.transcript-interactive-text {
	max-height: 300px;
	overflow-y: auto;
	padding: 0.5rem;
}

.transcript-word {
	cursor: pointer;
	padding: 1px 2px;
	border-radius: 3px;
	transition: background-color 0.15s ease;
}

.transcript-word:hover {
	background-color: rgba(0, 0, 0, 0.08);
}

.transcript-word-active {
	background-color: rgba(255, 193, 7, 0.4);
}

.speaker-pill {
	font-size: 0.8em;
}

/* Voiceover mix ("Hörfolge"): original passages dimmed */
.transcript-word-original {
	opacity: 0.55;
}

.transcript-word-original.transcript-word-active {
	opacity: 1;
}

.transcript-track-pill {
	cursor: pointer;
}

.transcript-track-pill-original {
	background-color: transparent;
	color: var(--bs-secondary-color);
	border: 1px solid var(--bs-border-color);
}

.chip {
  display: inline-block;
  padding: 0 16px;
  height: 32px;
  font-size: 0.95em;
  line-height: 32px;
  border-radius: 16px;
  background: var(--bs-card-bg);
  color: var(--bs-card-color);
}

.chip img {
  float: left;
  margin: 0 10px 0 -16px;
  height: 32px;
  width: 32px;
  border-radius: 50%;
}

.small-chip {
  display: inline-block;
  padding: 0 8px;
  height: 25px;
  font-size: 0.9em;
  border-radius: 12px;
  background: var(--bs-card-bg);
  color: var(--bs-card-color);
}

/* Voice picker: filter buttons and chips */
.voices-filter-btn {
	white-space: nowrap;
}

.voices-filter-btn.voices-filter-provider {
	background-color: var(--bs-card-bg);
	color: var(--bs-card-color);
	border: 1px solid var(--bs-card-color);
	opacity: 1;
}

.voices-filter-btn.voices-filter-provider:hover {
	filter: brightness(0.95);
	color: var(--bs-card-color);
}

.voices-filter-btn.voices-filter-provider.active {
	box-shadow: 0 0 0 2px var(--bs-card-color);
	font-weight: 600;
}

.voices-filter-group.has-active .voices-filter-provider:not(.active) {
	opacity: 0.55;
}

.voices-filter-btn.voices-filter-gender.active {
	background-color: var(--bs-primary);
	border-color: var(--bs-primary);
	color: #fff;
}

/* Provider group and gender group in one row, gender group wraps on small screens */
@media (max-width: 575.98px) {
	.voices-filter-group-gender {
		width: 100%;
	}
}

#voicesFilterButtons .voices-filter-group-provider + .voices-filter-group-gender {
	margin-left: 0.5rem;
}

@media (max-width: 575.98px) {
	#voicesFilterButtons .voices-filter-group-provider + .voices-filter-group-gender {
		margin-left: 0;
	}
}

.voice-chip {
	white-space: nowrap;
	cursor: pointer;
}

.voice-chip-remove {
	background: transparent;
	border: 0;
	color: inherit;
	opacity: 0.7;
	padding: 0 4px 0 8px;
	line-height: inherit;
	font-size: 0.8em;
}

.voice-chip-remove:hover,
.voice-chip-remove:focus-visible {
	opacity: 1;
}

/* Small screen, smartphone */
@media screen and (max-width: 1259px) {
	.card-title {
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
		font-size: 1.0rem;
		line-height: 1.3;
		margin-top: 0;
	}

	.card-icon-group {
		min-width: 100px;
	}
	
}

/* Padding to get last message above the chat input area */
#chat-container {
    padding-bottom: calc(var(--chat-input-height) + env(safe-area-inset-bottom, 0px)) !important;
    scroll-behavior: smooth;
}

.chat-scroll-spacer {
    height: 85vh;
    width: 100%;
    display: block;
    pointer-events: none;
}

/* Hide chat below input area */
#chat-input-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 10px;
    background-color: var(--bs-body-bg);
    z-index: -1;
    pointer-events: none;
}

/* Chat input area shadow styling */
.chat-input-area {
    box-shadow: 0 -2px 5px rgba(0, 0, 0, 0.1);
}

/* Workflow tree */
.offcanvas-large {
	width: 500px !important;
}

.icon-placeholder {
    display: inline-block;
    width: 1.25em; /* Matches the clock icon width */
    height: 1em;   /* matches icon height, if needed */
    vertical-align: middle;
}

/* Workflow editor */
/* Inactive dragable cards */
.draggable-card.inactive {
	opacity: 0.65;
	filter: grayscale(100%);
	transform: scale(0.98);
}

.workflow-header {
	background-color: var(--bs-body-bg);
	border-radius: 6px;
}

/* Dark Mode */
[data-bs-theme="dark"] .draggable-card.inactive {
	opacity: 0.55;
}

.draggable-card {
	cursor: move;
	margin-bottom: 10px;
	border: 1px solid #ddd;
	padding: 15px;
	background: var(--bs-body-bg);
	transition: all 0.3s ease;
}
.drag-handle {
	cursor: move;
	color: #666;
	margin-right: 10px;
}
.step-container {
	border: 2px dashed #ccc;
	padding: 15px;
	margin: 10px 0;
	min-height: 100px;
}
.parallel-container {
	border: 2px solid;
	padding: 15px;
	margin: 10px 0;
	background-color: var(--bs-body-bg);
	position: relative; /* For proper handle positioning */
}
.dragover {
	background-color: #e9ecef;
	border: 2px dashed #007bff;
}
.json-preview {
	background: var(--bs-body-bg);
	padding: 15px;
	border-radius: 5px;
	font-family: monospace;
	white-space: pre-wrap;
}
.container-actions {
	position: absolute;
	right: 10px;
	top: 10px;
}
/* Container drag handle */
.container-drag-handle {
	position: absolute;
	left: 10px;
	top: 10px;
	cursor: move;
	color: #666;
	padding: 5px;
}
.property-row {
	margin-bottom: 10px;
}

.step-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 15px;
}

.properties-container {
	margin-top: 10px;
	padding: 10px;
	background-color: var(--bs-tertiary-bg);
	border-radius: 5px;
	transition: height 0.2s ease-in-out;
}

/* Style for the properties toggle section */
.properties-header {
	padding: 0.5rem 0;
	cursor: pointer;
}

.properties-header:hover {
	background-color: rgba(0,0,0,0.05);
}

/* Rotate icon when properties are expanded */
.properties-header.expanded .toggle-icon {
	transform: rotate(90deg);
}

.toggle-icon {
	transition: transform 0.2s ease-in-out;
}

.no-border {
	border: none;
}

/* Custom styles for the image upload area */
.image-preview-container {
	width: 100%;
	height: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
	position: relative;
}

.delete-button {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 10;
	display: none;
}

.upload-icon {
	font-size: 3rem;
	color: #6c757d;
	margin-bottom: 1rem;
}

.file-input {
	display: none;
}


/* MASK */

.inpaintMaskCanvas {
	display: none; 
    touch-action: none;
    pointer-events: auto;
    background: transparent;
    opacity: 0.6;
    cursor: crosshair;
	position: absolute; 
	left: 0; 
	top: 0; 
	z-index: 5;
}

.mask-toolbar {
	display: none; 
	flex-direction: row;
    justify-content: center;
    align-items: center;
    width: 100%;
    gap: 5px;
    position: static;
}

.mask-toolbar input[type="range"] {
    vertical-align: middle;
}

/* External APIs */
.action-icons {
    display: flex;
    flex-direction: row;
    gap: 8px;
    flex-wrap: nowrap;
    align-items: center;
    white-space: nowrap;
}

/* Required styles for AnimatedContainer */
.animated-container {
    transition: none; /* Prevent CSS transitions from interfering */
}
 
.animated-container .expanding {
    transform-origin: top;
}
 
.animated-container .shrinking {
    transform-origin: top;
}
 
/* Optional: Smooth container height changes when not animating */
.animated-container:not(.animating) {
    transition: min-height 0.2s ease;
}

/* TTS Audio Uploader */
.upload-input { display: none; }

/* file-upload */
.fu-dropzone, .fu-dropzone-overlay {
	border: 2px dashed #aaa; 
	min-height: 44px; 
	display: flex; 
	flex-direction: column;
	align-items: center; 
	justify-content: center; 
	cursor: pointer; 
	background: rgba(var(--bs-primary-rgb), 0.1);
	border-radius: 7px; 
}

.fu-dropzone.highlight {
	background: rgba(var(--bs-primary-rgb), 0.4); 
	border-color: var(--bs-primary-border-subtle, #4a90e280);
}

.fu-dropzone-overlay-message {
	color: var(--bs-secondary-color, #6c757d);
	background: rgba(var(--bs-tertiary-bg-rgb), 0.7); 
	border: 2px dashed #aaa; 
	border-radius: 7px; 
	text-align: center;
	max-width: 80%;
}

.fu-dropzone-overlay {
	position: fixed; 
	top: 0;
	left: 0;
	right: 0;
	bottom: 0; 
	z-index: 2000; 
	opacity: 0; 
	pointer-events: none; 
	transition: opacity .25s;
}

.fu-dropzone-overlay.show {
	opacity: 1; 
	pointer-events: all;
}

.fu-files-bar {
    display: flex;
    flex-wrap: wrap;
    gap: .75rem;
    margin-bottom: .5rem;
    background: transparent;
	position: relative;
}
 
.fu-files-bar:empty {
    display: none !important;
}
.fu-thumb-card.card {
    transition: box-shadow .13s, transform .13s, border-color .13s;
    border-radius: var(--bs-border-radius);
    border: 1.5px solid var(--bs-border-color, #dee2e6);
    background: var(--bs-card-bg, #fff);
    box-shadow: 0 2px 6px rgba(0,0,0,.045) !important;
    cursor: pointer;
    width: 106px;
    aspect-ratio: 1;
    min-width: 90px;
    user-select: none;
    position: relative;
    overflow: hidden;
}
.fu-thumb-card:hover, .fu-thumb-card:focus-within {
    transform: scale(1.08);
    box-shadow: 0 6px 16px var(--bs-secondary-bg, rgba(100,100,120,.18));
    z-index: 5;
    border-color: var(--bs-primary-border-subtle, #4a90e280);
}
.fu-thumb-img {
    width: 100%; height: 100%; min-width: 90px; min-height: 90px;
    object-fit: cover; background: var(--bs-tertiary-bg,#f4f4f4);
    border-radius: var(--bs-border-radius);
}
.fu-remove-btn {
    opacity: 0;
    z-index: 20;
    transition: background 0.15s, box-shadow 0.15s;
}
.fu-remove-btn:hover, .fu-remove-btn:focus {
    background: var(--bs-danger-bg-subtle);
    color: var(--bs-danger);
}

@media (pointer: coarse) {
  .fu-remove-btn {
    opacity: 1;
  }
}

.fu-thumb-card:hover .fu-remove-btn,
.fu-thumb-card:focus-within .fu-remove-btn {
    opacity: 1;
}

.fu-file-icon {
    font-size: 1.8rem !important;
    color: var(--bs-secondary-color, #6c757d) !important;
}
.card-body {
    background: transparent !important;
}
.fu-thumb-info {
    width: 100%;
    min-height: 2em;
}

.fu-thumb-card {
    transition: transform 220ms cubic-bezier(.4,2,.6,1), box-shadow 0.2s;
    cursor: grab;
    z-index: 1;
    will-change: transform;
    backface-visibility: hidden;
}

.fu-thumb-card.dragging {
    opacity: 0.3;
    z-index: 3;
}

.fu-thumb-card.dragging-active {
    box-shadow: 0 4px 20px rgba(60,60,60,0.2);
    opacity: 0.6;
	z-index: 100;
	cursor: grabbing !important;
    transform: scale(0.95);
    transition: opacity 100ms ease, transform 100ms ease;
}

.fu-thumb-ghost {
	position: fixed;
	opacity: 0.65;
	pointer-events: none;
	z-index: 9999;
	box-shadow: 0 12px 48px 0 rgba(0,0,0,0.38);
	border-radius: 8px;
	transition: none !important;
    transform: rotate(3deg) scale(1.02);
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.3));
}

/* Prevent image flickering during reorder */
.fu-thumb-card img {
    image-rendering: optimizeQuality;
    backface-visibility: hidden;
}
 
.fu-thumb-card:hover:not(.dragging-active) {
    transform: translateY(-2px);
    transition: transform 150ms ease;
}

/* Article modal */
article h1 {
	font-size: 1.4rem;
}

article h2{
	font-size: 1.3rem;
}

article h3{
	font-size: 1.2rem;
}

/* History */
.history-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f8f9fa;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
 
.history-thumbnail[src] {
    opacity: 1;
}

/* Smooth transition when replacing loading spinner in transcript card */
.card-body > div {
    transition: opacity 0.3s ease-in-out;
}

/* Calculate chat input height dynamically */
:root {
	--top-offset-height: 150px;
	--chat-input-height: 70px;
}

/* Initial Chat message */
.initial-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
	min-height: calc(100dvh - var(--top-offset-height) - var(--chat-input-height));
	padding-bottom: var(--chat-input-height);
    transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.welcome-section {
    margin-bottom: 1rem;
}

.initial-container-chat-active {
    justify-content: flex-start;
    min-height: auto;
    padding-bottom: 0;
}

.chat-width {
    max-width: 1000px;
}

#chat-input-container {
	transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Chat styles */

.chat-box-shadow {
    box-shadow: 0 0 0.5rem rgba(0, 0, 0, 0.1);
}

.border-radius-2 {
	border-radius: 0.5rem;
}

.message {
	margin-bottom: 2rem;
	animation: fadeIn 0.3s;
}

@keyframes fadeIn {
	from { opacity: 0; transform: translateY(10px); }
	to { opacity: 1; transform: translateY(0); }
}

/* Chat input on small screens */
@media (max-width: 768px) {
	.container-chat-input{
		padding-left: 0;
		padding-right: 0;
	}

	.border-radius-2 {
		border-radius: 0;
	}
}

/* Smaller buttons on medium screens */
@media (min-width: 768px) {
    .btn-sm-md {
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
        border-radius: 0.25rem;
    }
}

.message-user {
	display: flex;
	justify-self: end;
	justify-content: flex-end;
	max-width: 90%;
	border-radius: 1rem;
	border-bottom-right-radius: 0.1rem;
	padding: 0.75rem;
	scroll-margin-top: 8px;
}

.message-content {
	max-width: 100%;
    overflow-wrap: break-word;
}

.message-content img:not([class], .chip img) {
    max-width: 40%;
    margin: 10px 10px 10px 0;
}

#input-area {
	background: white;
	padding: 1rem;
	border-radius: 0.5rem;
	box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Button fadein/out */
.fade-button {
	opacity: 1;
	transition: opacity 0.3s ease-in-out;
}

.fade-button.fade-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Typing indicator container */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 8px 0;
}

/* Typing indicator dots */
.typing-indicator span {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--bs-secondary);
    animation: typing-bounce 1.4s infinite ease-in-out;
}

/* Delay animation for each dot */
.typing-indicator span:nth-child(1) {
    animation-delay: 0s;
}

.typing-indicator span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-indicator span:nth-child(3) {
    animation-delay: 0.4s;
}

/* Bounce animation for typing dots */
@keyframes typing-bounce {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.7;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

pre {
	position: relative; /* Absolute positioning of copy button */
	border-radius: 0.5rem;
}

/* Copy button - icon only, positioned inside code block */
.copy-code-button {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	background-color: transparent;
	border: none;
	color: #fff; /* Always white for dark code theme */
	cursor: pointer;
	transition: all 0.2s ease-in-out;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 0.25rem;
	opacity: 0.6;
}

.copy-code-button:hover {
	opacity: 1;
	transform: scale(1.1);
}

.copy-code-button:active {
	transform: scale(0.95);
}

.copy-code-button:focus {
	outline: 2px solid var(--bs-primary-border-subtle, #4a90e280);
	outline-offset: 2px;
	opacity: 1;
}

.copy-code-button:focus:not(:focus-visible) {
	outline: none;
}

.copy-code-button.copied {
	opacity: 1;
	color: #28a745; /* Success green color */
}

.copy-code-button i {
	font-size: 1.125rem;
	pointer-events: none; /* Prevent icon from intercepting clicks */
}

/* Ensure code blocks are scrollable */
pre code {
	display: block;
	overflow-x: auto;
}

/* Card copy text: Preserve whitespace and line breaks in the card body */
.card-copy-text {
    font-family: inherit;
	font-size: 1em;
    white-space: pre-wrap;
    word-break: break-word;
}

pre.card-copy-text p {
	margin-bottom: 0;
}

.action-card.card-body {
	border-radius: var(--bs-card-border-radius);
    background: var(--bs-tertiary-bg) !important;
}

/* ─── Cost Pills ──────────────────────────────────────────────────── */

/* Shared fade transition for both pill containers */
.chat-pills-container {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.chat-pills-container.pills-visible {
    opacity: 1;
}

/* Desktop pill container: fixed, positioned left of the centred chat input.
   Hidden on small screens; JS sets display:flex when pills should appear. */
.chat-pills-desktop-container {
    position: fixed;
    left: 10px;
    bottom: calc(var(--chat-input-height, 100px) + 0px);
    width: 84px;
    flex-direction: column;
    gap: 8px;
    z-index: 10;
}

/* Hide desktop pills below xl breakpoint (< 1200px) */
@media (max-width: 1199.98px) {
    .chat-pills-desktop-container {
        display: none !important;
    }
}

/* Mobile pill bar: displayed inside chat-input-wrapper, above the input box.
   Hidden on desktop; JS sets display:flex when pills should appear. */
.chat-pills-mobile-container {
    flex-wrap: wrap;
    gap: 6px;
	padding-bottom: 8px;
    background-color: var(--bs-body-bg);
}

/* Hide mobile pills at xl+ */
@media (min-width: 1200px) {
    .chat-pills-mobile-container {
        display: none !important;
    }
}

/* ── Desktop pill card ── */
.chat-pill-desktop {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 8px 6px;
    border-radius: 14px;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    font-size: 0.7rem;
    line-height: 1.3;
    text-align: center;
    cursor: default;
    user-select: none;
    width: 100%; /* fills the 84px container → equal width for both pills */
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.chat-pill-desktop:hover,
.chat-pill-desktop:focus-visible {
    transform: scale(1.05);
    box-shadow: 0 3px 12px rgba(0,0,0,0.12);
    outline: none;
}

/* Warning states */
.chat-pill-desktop.pill-warn {
    background-color: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    color: var(--bs-warning-text-emphasis);
}

.chat-pill-desktop.pill-high {
    background-color: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
    color: var(--bs-danger-text-emphasis);
}

/* Hidden individual pill (when only one of the two should be shown) */
.chat-pill-desktop.pill-item-hidden {
    display: none;
}

/* ── Desktop pill internals ── */
.chat-pill-icon {
    font-size: 0.8rem;
}

.chat-pill-main {
    font-weight: 700;
    font-size: 0.78rem;
    line-height: 1.1;
}

.chat-pill-main-sm {
    font-size: 0.68rem;
    font-weight: 500;
}

.chat-pill-label {
    font-size: 0.62rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    opacity: 0.75;
}

/* Context-window usage bar inside desktop chat pill */
.chat-pill-token-bar-wrap {
    width: 100%;
    height: 3px;
    background-color: var(--bs-border-color);
    border-radius: 2px;
    overflow: hidden;
    margin-top: 3px;
}

.chat-pill-token-bar-fill {
    height: 100%;
    border-radius: 2px;
    background-color: var(--bs-success);
    transition: width 0.5s ease, background-color 0.5s ease;
}

/* ── Mobile inline pill ── */
.chat-pill-mobile {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid var(--bs-border-color);
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-secondary-color);
    cursor: default;
    user-select: none;
}

.chat-pill-mobile.pill-warn {
    background-color: var(--bs-warning-bg-subtle);
    border-color: var(--bs-warning-border-subtle);
    color: var(--bs-warning-text-emphasis);
}

.chat-pill-mobile.pill-high {
    background-color: var(--bs-danger-bg-subtle);
    border-color: var(--bs-danger-border-subtle);
    color: var(--bs-danger-text-emphasis);
}

/* Mini token bar inside mobile chat pill */
.chat-pill-mini-bar-wrap {
    width: 28px;
    height: 3px;
    background-color: var(--bs-border-color);
    border-radius: 2px;
    overflow: hidden;
    flex-shrink: 0;
}

.chat-pill-mini-bar-fill {
    height: 100%;
    border-radius: 2px;
    background-color: var(--bs-success);
    transition: width 0.5s ease, background-color 0.5s ease;
}

.chat-pill-mini-label {
    font-size: 0.68rem;
    opacity: 0.8;
}

.popover-kv {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: .5rem;
  row-gap: .125rem;
}

.popover-kv .hint {
  grid-column: 1 / -1;
}

/* Animation templates page (js/pages/animation_templates*) */
.atpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1rem;
}

.atpl-card {
  overflow: hidden;
  background: var(--bs-body-bg);
  border-color: var(--bs-border-color);
  transition: box-shadow .15s ease, border-color .15s ease;
}

.atpl-card:hover,
.atpl-card:focus-within {
  border-color: var(--bs-primary);
  box-shadow: 0 .25rem .75rem rgba(0, 0, 0, .12);
}

.atpl-poster {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: var(--bs-tertiary-bg);
  overflow: hidden;
}

.atpl-poster-image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.atpl-poster-placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  color: var(--bs-secondary-color);
}

.atpl-poster-badges {
  position: absolute;
  top: .5rem;
  left: .5rem;
  z-index: 1;
}

.atpl-card-title {
  overflow-wrap: anywhere;
}

.atpl-card-description {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.atpl-tags {
  display: flex;
  flex-wrap: wrap;
  gap: .25rem;
}

.atpl-dl {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1rem;
  row-gap: .25rem;
  font-size: .9rem;
}

.atpl-dl dt {
  font-weight: 500;
  color: var(--bs-secondary-color);
}

.atpl-dl dd {
  min-width: 0;
  overflow-wrap: anywhere;
}

.atpl-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: .5rem;
}

.atpl-swatch {
  display: flex;
  flex-direction: column;
  gap: .125rem;
  min-width: 0;
}

.atpl-swatch-color {
  display: block;
  height: 2.25rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
  background-color: var(--bs-tertiary-bg);
}

.atpl-swatch-name {
  font-size: .8rem;
  overflow-wrap: anywhere;
}

.atpl-assets li + li {
  margin-top: .375rem;
}

.atpl-config {
  max-height: 22rem;
  overflow: auto;
  padding: .75rem;
  font-size: .8rem;
  background: var(--bs-tertiary-bg);
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
}

.atpl-markdown {
  overflow-wrap: anywhere;
}

.atpl-markdown > :last-child {
  margin-bottom: 0;
}

.atpl-markdown pre,
.atpl-markdown table {
  max-width: 100%;
  overflow: auto;
}

.atpl-markdown-plain {
  white-space: pre-wrap;
}

/* The chat limits the card (.animation-card, 660px); on the template page it fills the column like the panels below. */
.atpl-player .animation-card {
  max-width: none;
}

.atpl-guidelines-input {
  font-family: var(--bs-font-monospace);
  font-size: .85rem;
}

.atpl-guidelines-preview {
  min-height: 12rem;
  max-height: 28rem;
  overflow: auto;
  padding: .75rem;
  border: 1px solid var(--bs-border-color);
  border-radius: .375rem;
}

.atpl-font-checks {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: .25rem .75rem;
  max-height: 10rem;
  overflow: auto;
}
