.ai-going-social {
	--ags-cyan: var(--wp--preset--color--accent-1, #00f6ff);
	--ags-magenta: var(--wp--preset--color--accent-2, #ff00ff);
	--ags-preview-max-height: min(360px, 50vh);
	--ags-canvas-aspect: 1200 / 630;
	margin-inline: auto;
	padding: clamp(1rem, 3vw, 1.5rem);
	background: #0b0b0b;
	border-radius: 8px;
	color: #fff;
	box-sizing: border-box;
	width: 100%;
}

.ai-going-social--width-narrow {
	max-width: 720px;
}

.ai-going-social--width-medium {
	max-width: 960px;
}

.ai-going-social--width-wide {
	max-width: min(1200px, 100%);
}

.ai-going-social--width-full {
	max-width: none;
}

.alignwide > .ai-going-social,
.ai-going-social.alignwide {
	max-width: var(--wp--style--global--wide-size, 1200px);
}

.alignfull > .ai-going-social,
.ai-going-social.alignfull {
	max-width: none;
}

.ai-going-social__inner {
	position: relative;
}

.ai-going-social__layout {
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
}

.ai-going-social__panel {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	min-width: 0;
}

.ai-going-social__consent-dialog {
	position: absolute;
	inset: 0;
	z-index: 25;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 1rem;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: rgba(4, 4, 8, 0.42);
	backdrop-filter: blur(3px);
	-webkit-backdrop-filter: blur(3px);
}

.ai-going-social__consent-dialog.is-hidden {
	display: none;
}

.ai-going-social__consent-dialog-card {
	width: min(100%, 26rem);
	padding: clamp(1.1rem, 3vw, 1.5rem);
	background: #0f0f14;
	border: 2px solid var(--ags-cyan);
	border-radius: 12px;
	box-shadow:
		0 0 0 1px rgba(255, 0, 255, 0.25),
		0 12px 40px rgba(0, 0, 0, 0.55),
		0 0 28px rgba(0, 246, 255, 0.15);
}

.ai-going-social__consent-title {
	margin: 0 0 0.75rem;
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #fff;
}

.ai-going-social__privacy-note {
	margin: 0 0 1rem;
	font-size: 0.9rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.88);
}

.ai-going-social__consent-label {
	display: flex;
	align-items: flex-start;
	gap: 0.75rem;
	font-size: 0.9rem;
	line-height: 1.5;
	cursor: pointer;
	color: #fff;
}

.ai-going-social__consent-text {
	flex: 1;
	min-width: 0;
}

.ai-going-social__consent-input {
	margin-top: 0.15rem;
	flex-shrink: 0;
	width: 1.25rem;
	height: 1.25rem;
	accent-color: var(--ags-cyan);
}

.ai-going-social--consent-open .ai-going-social__preview {
	min-height: min(18rem, 52vh);
}

.ai-going-social--consent-open .ai-going-social__canvas {
	filter: brightness(0.72);
}

.ai-going-social--consent-open .ai-going-social__profile-fields,
.ai-going-social--consent-open .ai-going-social__tools {
	opacity: 0.55;
}

.ai-going-social__tools.is-disabled {
	opacity: 0.45;
}

.ai-going-social__tools.is-disabled .ai-going-social__controls {
	pointer-events: none;
}

.ai-going-social__tools {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.ai-going-social__profile-fields {
	display: grid;
	gap: 0.75rem;
	margin-bottom: 0.25rem;
}

.ai-going-social__field {
	display: grid;
	gap: 0.35rem;
}

.ai-going-social__field-label {
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.75);
}

.ai-going-social__name,
.ai-going-social__org,
.ai-going-social__format-select {
	width: 100%;
	min-height: 2.5rem;
	padding: 0.5rem 0.75rem;
	border-radius: 6px;
	border: 1px solid rgba(255, 255, 255, 0.25);
	background: rgba(255, 255, 255, 0.06);
	color: #fff;
	font-family: inherit;
	font-size: 0.9rem;
	box-sizing: border-box;
}

.ai-going-social__format-field {
	margin: 0;
}

.ai-going-social__format-select {
	max-width: 100%;
	cursor: pointer;
}

.ai-going-social__format-select:focus {
	outline: 2px solid var(--ags-cyan);
	outline-offset: 1px;
	border-color: var(--ags-cyan);
}

.ai-going-social__format-select option {
	background: #111;
	color: #fff;
}

.ai-going-social__name:focus,
.ai-going-social__org:focus {
	outline: 2px solid var(--ags-cyan);
	outline-offset: 1px;
	border-color: var(--ags-cyan);
}

.ai-going-social__name[aria-invalid='true'],
.ai-going-social__org[aria-invalid='true'] {
	border-color: #ff6b6b;
	outline-color: #ff6b6b;
}

.ai-going-social--format-landscape {
	--ags-canvas-aspect: 1200 / 630;
}

.ai-going-social--format-square {
	--ags-canvas-aspect: 1 / 1;
}

.ai-going-social--format-story,
.ai-going-social--format-vertical {
	--ags-canvas-aspect: 1080 / 1920;
}

.ai-going-social__preview {
	position: relative;
	display: flex;
	justify-content: center;
	align-items: center;
	min-height: 12rem;
	width: 100%;
	background: #0a0a0a;
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 8px;
	overflow: hidden;
	line-height: 0;
	touch-action: manipulation;
}

.ai-going-social__preview.is-live {
	border-color: rgba(0, 246, 255, 0.45);
	box-shadow: 0 0 0 1px rgba(255, 0, 255, 0.25);
}

.ai-going-social__video {
	position: absolute;
	inset: 0;
	z-index: 4;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0;
	pointer-events: none;
	transform: scaleX(-1);
	background: #0a0a0a;
}

.ai-going-social--camera-video-preview:not(.ai-going-social--consent-open) .ai-going-social__video {
	opacity: 1;
}

.ai-going-social--camera-video-preview .ai-going-social__canvas {
	opacity: 0;
}

.ai-going-social__preview::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 4px;
	background: linear-gradient(to right, var(--ags-magenta), var(--ags-cyan));
	pointer-events: none;
}

/* Kun visning på siden — canvas tegnes fortsatt i full oppløsning (nedlasting uendret). */
.ai-going-social__canvas {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: var(--ags-preview-max-height);
}

.ai-going-social--format-story,
.ai-going-social--format-vertical {
	--ags-preview-max-height: min(520px, 70vh);
}

.ai-going-social--format-story .ai-going-social__preview,
.ai-going-social--format-vertical .ai-going-social__preview {
	min-height: 16rem;
}

.ai-going-social--format-story .ai-going-social__canvas,
.ai-going-social--format-vertical .ai-going-social__canvas {
	width: min(100%, 290px);
	margin-inline: auto;
}

.ai-going-social__controls {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	align-items: stretch;
}

.ai-going-social__btn {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 2.5rem;
	min-height: 2.5rem;
	max-height: 2.5rem;
	padding: 0 1.1rem;
	margin: 0;
	border-radius: 9999px;
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	border: 2px solid transparent;
	appearance: none;
	-webkit-appearance: none;
	transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}

.ai-going-social__btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

.ai-going-social__btn--primary {
	background: var(--ags-magenta);
	color: #000;
	border-color: var(--ags-magenta);
}

.ai-going-social__btn--primary:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 0 16px rgba(255, 0, 255, 0.5);
}

.ai-going-social__btn--secondary {
	background: transparent;
	color: #fff;
	border-color: var(--ags-cyan);
}

.ai-going-social__btn--secondary:hover:not(:disabled) {
	background: rgba(0, 246, 255, 0.12);
}

.ai-going-social__btn--download {
	background: #fff;
	color: #000;
	border-color: #fff;
}

.ai-going-social__btn--download:hover:not(:disabled) {
	transform: translateY(-1px);
	box-shadow: 0 0 14px rgba(255, 255, 255, 0.35);
}

.ai-going-social__btn--upload {
	position: relative;
	overflow: hidden;
	background: transparent;
	color: #fff;
	border-color: rgba(255, 255, 255, 0.35);
}

.ai-going-social__btn--upload:hover {
	border-color: #fff;
	background: rgba(255, 255, 255, 0.08);
	transform: none;
	box-shadow: none;
}

.ai-going-social__upload-text {
	pointer-events: none;
}

.ai-going-social__file,
.ai-going-social__capture-file {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	border: 0;
}

.ai-going-social__status:not([hidden]):not(.is-error) {
	color: rgba(0, 246, 255, 0.9);
}

.ai-going-social__status {
	margin: 0;
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.75);
}

.ai-going-social__status.is-error {
	color: #ffb4b4;
}

.ai-going-social--editor {
	padding: 1.25rem;
	border: 1px dashed rgba(0, 0, 0, 0.2);
	border-radius: 8px;
	background: #f5f5f5;
}

.ai-going-social--editor .ai-going-social__hint {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
	opacity: 0.8;
}

.ai-going-social--editor .ai-going-social__preview--editor {
	aspect-ratio: var(--ags-canvas-aspect, 1200 / 630);
	width: 100%;
	max-width: 100%;
	max-height: 260px;
	min-height: 0;
	margin-inline: auto;
	display: block;
	align-items: stretch;
	justify-content: stretch;
}

.ai-going-social--editor.ai-going-social--format-square .ai-going-social__preview--editor {
	max-height: 220px;
	max-width: 220px;
}

.ai-going-social--editor.ai-going-social--format-vertical .ai-going-social__preview--editor,
.ai-going-social--editor.ai-going-social--format-story .ai-going-social__preview--editor {
	max-height: 280px;
	max-width: 158px;
}

.ai-going-social__editor-mock {
	box-sizing: border-box;
	height: 100%;
	width: 100%;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: 0.85rem 1rem;
	text-align: left;
	line-height: 1.2;
}

.ai-going-social__editor-mock-tagline {
	margin: 0 0 0.3rem;
	color: var(--ags-cyan, #00f6ff);
	font-size: 0.55rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.ai-going-social__editor-mock-headline {
	margin: 0;
	color: #fff;
	font-size: clamp(1.1rem, 4.5vw, 1.65rem);
	font-weight: 700;
	line-height: 1.05;
}

.ai-going-social__editor-mock-sub {
	margin: 0.15rem 0 0;
	color: #fff;
	font-size: clamp(0.75rem, 2.8vw, 1rem);
	font-weight: 700;
	line-height: 1.15;
}

.ai-going-social__editor-mock-meta {
	margin: 0.4rem 0 0;
	color: rgba(255, 255, 255, 0.72);
	font-size: 0.5rem;
	letter-spacing: 0.06em;
	line-height: 1.35;
}

.ai-going-social--touch .ai-going-social__controls {
	flex-direction: column;
	align-items: stretch;
}

.ai-going-social--touch .ai-going-social__controls > .ai-going-social__btn {
	width: 100%;
	height: 3rem;
	min-height: 3rem;
	max-height: 3rem;
	font-size: 0.85rem;
	justify-content: center;
}

.ai-going-social--touch .ai-going-social__consent-input {
	width: 1.35rem;
	height: 1.35rem;
}

.ai-going-social--camera-live .ai-going-social__capture {
	order: -1;
}

@media (min-width: 640px) {
	.ai-going-social__controls {
		gap: 0.75rem;
	}

	.ai-going-social__consent-dialog {
		align-items: center;
	}
}

@media (min-width: 768px) {
	.ai-going-social {
		--ags-preview-max-height: min(440px, 68vh);
	}

	.ai-going-social--format-story,
	.ai-going-social--format-vertical {
		--ags-preview-max-height: min(580px, 78vh);
	}

	.ai-going-social__layout {
		display: grid;
		grid-template-columns: minmax(17rem, 22rem) minmax(0, 1fr);
		grid-template-areas: "panel preview";
		align-items: start;
		gap: clamp(1.25rem, 2.5vw, 2rem);
	}

	.ai-going-social__panel {
		grid-area: panel;
	}

	.ai-going-social__preview {
		grid-area: preview;
		position: sticky;
		top: 1rem;
		min-height: 14rem;
	}

	.ai-going-social--format-story .ai-going-social__canvas,
	.ai-going-social--format-vertical .ai-going-social__canvas {
		width: auto;
	}
}

@media (max-width: 639px) {
	.ai-going-social__consent-dialog-card {
		margin-top: 0.25rem;
		margin-bottom: 1rem;
	}
}
