@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url('./fonts/source-sans-3-latin-ext-wght-normal.woff2')
		format('woff2');
	unicode-range:
		U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304,
		U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
		U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
	font-family: 'Source Sans 3';
	font-style: normal;
	font-weight: 200 900;
	font-display: swap;
	src: url('./fonts/source-sans-3-latin-wght-normal.woff2') format('woff2');
	unicode-range:
		U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC,
		U+0304, U+0308, U+0329, U+2000-206F, U+2074, U+20AC, U+2122, U+2191,
		U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
	--navy: #003b5c;
	--navy-deep: #002b43;
	--blue: #006a9b;
	--cyan: #60cfe3;
	--sky: #edf9fc;
	--paper: #fff;
	--ink: #202b33;
	--muted: #52606a;
	--line: #d4dee3;
	--quiet: #f5f7f8;

	--radius: 0.65rem;
	--radius-control: 0.4rem;
	--radius-choice: 0.5rem;

	--shadow: 0 2px 8px #153b5010;
	--shadow-raised: 0 12px 36px #001a3020;

	--focus: #ffdd67;
	--error: #a12622;

	--space: 1.5rem;
	--measure: 72rem;

	color-scheme: light;
	font-family: 'Source Sans 3', Arial, Helvetica, sans-serif;
	font-size: 100%;
	color: var(--ink);
	background: var(--paper);
}

* {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	scroll-padding-top: 1rem;
}

body {
	margin: 0;
	min-width: 320px;
	background: var(--paper);
	color: var(--ink);
	font-size: 1.125rem;
	line-height: 1.5;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

button,
input,
textarea,
select {
	font: inherit;
}

button,
a,
input,
summary,
[contenteditable='true'] {
	touch-action: manipulation;
}

button {
	cursor: pointer;
}

button:disabled {
	cursor: default;
}

button,
input,
select,
textarea {
	max-width: 100%;
}

:focus-visible {
	outline: 3px solid var(--navy);
	outline-offset: 3px;
	box-shadow: 0 0 0 5px var(--focus);
}

a {
	color: var(--blue);
	text-decoration: underline;
	text-underline-offset: 0.18em;
	text-decoration-thickness: 1px;
}

a:hover {
	color: var(--navy);
	text-decoration-thickness: 2px;
}

h1,
h2,
h3,
h4 {
	color: var(--navy);
	font-weight: 650;
	line-height: 1.15;
	overflow-wrap: break-word;
}

h1 {
	margin: 0.4rem 0 1rem;
	font-size: clamp(2.125rem, 4vw, 3rem);
	letter-spacing: -0.02em;
}

h2 {
	margin: 0 0 1rem;
	font-size: 1.875rem;
}

h3 {
	margin: 0 0 0.75rem;
	font-size: 1.375rem;
}

p {
	margin: 0 0 1rem;
}

/* accessibility */

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link {
	position: absolute;
	top: 0;
	left: 1rem;
	z-index: 100;
	padding: 1rem;
	background: var(--focus);
	color: var(--navy);
	transform: translateY(-150%);
}

.skip-link:focus {
	transform: translateY(0);
}

/* shared width */

.shell {
	width: min(100% - 3rem, var(--measure));
	margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header — exact visual language of /ex/
   -------------------------------------------------------------------------- */

.site-header {
	min-height: 7.25rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 2rem;

	padding-block: 1.25rem;

	background: var(--cyan);
	color: var(--navy-deep);

	border-bottom: 1px solid var(--line);

	/*
    Current generator HTML puts .shell and .site-header on the same node.
    This extends the cyan header to the viewport edge without changing HTML.
  */
	box-shadow:
		0 0 0 100vmax var(--cyan),
		inset 0 -1px 0 var(--line);
	clip-path: inset(0 -100vmax);
}

.site-header :focus-visible {
	outline-color: var(--navy-deep);
}

.brand {
	display: inline-flex;
	align-items: center;
	gap: 0.9rem;
	max-width: 100%;

	color: var(--navy-deep);
	text-decoration: none;

	font-weight: 700;
	font-size: 1.6rem;
	letter-spacing: -0.035em;
	white-space: nowrap;
}

.brand:hover {
	color: var(--navy-deep);
}

.brand-mark {
	display: inline-flex;
	flex-flow: row nowrap;
	align-items: baseline;
	flex: none;

	border-right: 1px solid #23546766;
	padding-right: 0.9rem;

	font-size: 2.9rem;
	font-weight: 750;
	line-height: 1;
	letter-spacing: -0.09em;
	white-space: nowrap;
}

.brand-mark > span {
	display: inline-block;
	flex: none;
	line-height: 1;
}

.brand-dot {
	color: var(--navy);
}

.brand-name {
	color: var(--navy-deep);
	white-space: nowrap;
}

.brand-light {
	font-weight: 400;
}

.brand-domain {
	font-size: 1rem;
	font-weight: 400;
	letter-spacing: -0.03em;
}

.utility-nav {
	display: flex;
	gap: 1.5rem;
	flex-wrap: wrap;
	align-items: center;
}

.utility-nav .text-button {
	color: var(--navy-deep);
	font-size: 1rem;
}

/* text actions */

.text-button,
.text-action,
.inline-link,
.lens-actions button,
.icon-button,
.file-label {
	border: 0;
	background: transparent;
	padding: 0;
	color: var(--blue);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	text-decoration-thickness: 1px;
}

.text-button:hover,
.text-action:hover,
.inline-link:hover,
.lens-actions button:hover,
.file-label:hover {
	color: var(--navy);
	text-decoration-thickness: 2px;
}

.text-button:disabled {
	opacity: 0.45;
	cursor: default;
	text-decoration: none;
}

/* --------------------------------------------------------------------------
   Intro / topic
   -------------------------------------------------------------------------- */

.generator-intro {
	padding: 2.9rem 0 2.5rem;
	border-bottom: 1px solid var(--line);
}

.eyebrow,
.section-kicker {
	margin: 0 0 0.75rem;
	color: var(--navy);
	font-size: 0.9375rem;
	font-weight: 650;
	letter-spacing: 0.07em;
	text-transform: uppercase;
}

.generator-intro h1 {
	margin-bottom: 2rem;
}

.topic-block {
	max-width: 52rem;
}

.topic-block label {
	display: block;
	margin-bottom: 0.35rem;

	color: var(--navy);
	font-size: 1.25rem;
	font-weight: 650;
}

.field-hint {
	margin-bottom: 1rem;
	color: var(--muted);
	font-size: 1rem;
}

.topic-row {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 0.75rem;
	align-items: stretch;
}

.topic-row input {
	width: 100%;
	min-height: 3rem;

	border: 1px solid var(--line);
	border-radius: var(--radius-control);

	padding: 0.8rem 1rem;

	background: var(--paper);
	color: var(--ink);

	font-size: 1.05rem;
}

.topic-row input:hover {
	border-color: #9eb5c0;
}

.topic-row input:focus {
	border-color: var(--blue);
}

.topic-row input::placeholder {
	color: #75838b;
}

/* --------------------------------------------------------------------------
   Buttons — copied conceptually from /ex/
   -------------------------------------------------------------------------- */

.button {
	display: inline-flex;
	justify-content: center;
	align-items: center;
	gap: 0.75rem;

	min-height: 3rem;

	padding: 0.6rem 1.25rem;

	border: 2px solid var(--navy);
	border-radius: var(--radius-control);

	background: var(--navy);
	color: #fff;

	font-weight: 650;
	line-height: 1.35;
	text-align: center;
	text-decoration: none;

	transition:
		background-color 0.12s ease,
		border-color 0.12s ease;
}

.button:hover {
	background: var(--navy-deep);
	border-color: var(--navy-deep);
	color: #fff;
}

.button:active {
	transform: none;
}

.button-primary {
	background: var(--navy);
	color: #fff;
}

/* --------------------------------------------------------------------------
   Idea block
   -------------------------------------------------------------------------- */

.idea-stage {
	position: relative;

	margin: 2rem 0 3rem;
	padding: 1.25rem;

	background: var(--sky);

	border: 1px solid #9fc5d7;
	border-left: 4px solid var(--blue);
	border-radius: var(--radius);

	box-shadow: var(--shadow);
}

.section-kicker-row,
.workbench-heading,
.lens-head,
.dialog-head,
.session-summary {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 1rem;
}

.idea-stage .section-kicker {
	margin-bottom: 0.4rem;
	color: var(--navy);
}

.idea-status {
	max-width: 50%;

	color: var(--muted);

	font-size: 0.9375rem;
	text-align: right;
}

/*
  Finalny pomysł: bardziej jak duży tytuł z /ex/, a nie hero 5rem.
  Przy dłuższej treści scrolluje się tylko tekst.
*/
.idea-output {
	position: relative;

	min-height: 3.3em;
	max-height: clamp(10rem, 27svh, 15.5rem);

	margin: 0.25rem 0 1rem;
	padding: 0.25rem 0.65rem 2.4rem 0;

	overflow-y: auto;
	overscroll-behavior: contain;
	scrollbar-gutter: stable;

	color: var(--navy);

	font-size: clamp(1.625rem, 3vw, 2.35rem);
	font-weight: 650;
	line-height: 1.16;
	letter-spacing: -0.02em;

	cursor: text;
	caret-color: var(--blue);

	scrollbar-width: thin;
	scrollbar-color: #83b5c8 transparent;

	transition:
		opacity 0.12s ease,
		transform 0.12s ease;

	/*
    Pierwsza maska wygasza tekst.
    Druga zostawia w pełni widoczny pas dla scrollbara.
  */
	-webkit-mask-image:
		linear-gradient(
			to bottom,
			#000 0,
			#000 calc(100% - 2.2rem),
			rgba(0, 0, 0, 0.42) calc(100% - 0.7rem),
			transparent 100%
		),
		linear-gradient(#000, #000);

	-webkit-mask-size:
		calc(100% - 14px) 100%,
		14px 100%;

	-webkit-mask-position:
		left top,
		right top;

	-webkit-mask-repeat: no-repeat;

	mask-image:
		linear-gradient(
			to bottom,
			#000 0,
			#000 calc(100% - 2.2rem),
			rgba(0, 0, 0, 0.42) calc(100% - 0.7rem),
			transparent 100%
		),
		linear-gradient(#000, #000);

	mask-size:
		calc(100% - 14px) 100%,
		14px 100%;

	mask-position:
		left top,
		right top;

	mask-repeat: no-repeat;
}

.idea-output::-webkit-scrollbar {
	width: 7px;
}

.idea-output::-webkit-scrollbar-track {
	background: transparent;
}

.idea-output::-webkit-scrollbar-thumb {
	background: #83b5c8;
	border: 2px solid transparent;
	border-radius: 1rem;
	background-clip: padding-box;
}

.idea-output::-webkit-scrollbar-thumb:hover {
	background: var(--blue);
	border: 2px solid transparent;
	background-clip: padding-box;
}

.idea-output:empty::before {
	content: attr(data-placeholder);
	color: #607783;
}

.idea-output[data-changing='true'] {
	opacity: 0.35;
	transform: translateY(3px);
}

.idea-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.25rem;
	align-items: center;

	padding-top: 0.9rem;

	border-top: 1px solid #a5cbdc;
}

.idea-actions .text-action {
	min-height: 2.5rem;
	padding: 0.25rem 0;

	color: var(--blue);
	font-size: 1rem;
}

.rebuild-notice {
	margin: 1rem 0 0;
	padding: 1rem 1.25rem;

	border: 1px solid #a5cbdc;
	border-left: 4px solid var(--blue);
	border-radius: var(--radius-choice);

	background: #edf7fb;
	color: #174459;

	font-size: 1rem;
}

.rebuild-notice .inline-link {
	margin-left: 0.5rem;
	font-weight: 650;
}

/*
  Na dużym ekranie dock jest sticky.
  Na telefonie i niskim laptopie pozostaje zwykłą sekcją.
*/
@media (min-width: 56rem) and (min-height: 47.5rem) {
	.idea-stage {
		position: sticky;
		top: 0.75rem;
		z-index: 20;

		box-shadow: var(--shadow-raised);
	}
}

/* --------------------------------------------------------------------------
   Lens workbench
   -------------------------------------------------------------------------- */

.lens-workbench {
	padding: 0 0 3.5rem;
}

.workbench-heading {
	margin-bottom: 1.25rem;
}

.workbench-heading h2 {
	margin-bottom: 0;
}

.undo-button {
	margin-top: 1.65rem;
	min-height: 2.75rem;
}

.lens-list {
	display: grid;
	gap: 0.75rem;
}

/*
  Soczewki korzystają z dokładnie tej samej logiki co .choice w /ex/.
*/
.lens {
	padding: 1rem;

	border: 1px solid var(--line);
	border-radius: var(--radius-choice);

	background: var(--paper);

	transition:
		background-color 0.12s ease,
		border-color 0.12s ease,
		box-shadow 0.12s ease;
}

.lens:hover {
	background: var(--quiet);
}

.lens[data-locked='true'] {
	background: var(--sky);
	border-color: var(--blue);
	box-shadow: inset 0 0 0 1px var(--blue);
}

.lens-head {
	align-items: baseline;
}

.lens h3 {
	margin: 0;

	color: var(--navy);

	font-size: 1rem;
	font-weight: 650;
	letter-spacing: 0;
	text-transform: none;
}

.lens-state {
	color: var(--muted);
	font-size: 0.9375rem;
}

.lens-text {
	max-width: 48rem;

	margin: 0.55rem 0 0.8rem;

	color: var(--ink);

	font-size: 1.125rem;
	line-height: 1.45;
}

.lens[data-empty='true'] .lens-text {
	color: var(--muted);
}

.lens-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
}

.lens-actions button {
	min-height: 2.5rem;

	color: var(--blue);

	font-size: 1rem;
}

.lens-actions button[aria-pressed='true'] {
	color: var(--navy);
	font-weight: 650;
}

.workbench-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;

	padding-top: 1.25rem;
}

/* --------------------------------------------------------------------------
   Direction controls
   -------------------------------------------------------------------------- */

.direction-section {
	padding: 2rem 0 3rem;

	border-top: 1px solid var(--line);
}

.direction-section h2 {
	margin-bottom: 0.5rem;
}

.chip-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;

	margin-top: 1.25rem;
}

.chip {
	min-height: 2.75rem;

	padding: 0.55rem 0.9rem;

	border: 1px solid var(--line);
	border-radius: var(--radius-choice);

	background: var(--paper);
	color: var(--ink);

	cursor: pointer;

	transition:
		background-color 0.12s ease,
		border-color 0.12s ease,
		box-shadow 0.12s ease;
}

.chip:hover {
	background: var(--quiet);
	border-color: #83b5c8;
}

.chip[aria-pressed='true'] {
	background: var(--sky);
	border-color: var(--blue);
	box-shadow: inset 0 0 0 1px var(--blue);

	color: var(--navy);
	font-weight: 600;
}

/* --------------------------------------------------------------------------
   Session summary — notice-like block from /ex/
   -------------------------------------------------------------------------- */

.session-summary {
	margin: 0 0 3rem;
	padding: 1rem 1.25rem;

	border: 1px solid #9fc5d7;
	border-left: 4px solid var(--blue);
	border-radius: var(--radius-choice);

	background: var(--sky);
}

.session-summary h2 {
	margin-bottom: 0.25rem;

	color: var(--navy);

	font-size: 1.5rem;
}

.session-summary .field-hint {
	margin-bottom: 0;
}

.session-summary > button {
	align-self: center;
}

/* --------------------------------------------------------------------------
   Informational content / FAQ
   -------------------------------------------------------------------------- */

.about-tool,
.faq {
	max-width: 52rem;

	padding-bottom: 3.5rem;
}

.about-tool p:not(.section-kicker),
.faq p {
	color: var(--ink);
	font-size: 1.125rem;
}

.faq details {
	padding: 1rem 0;

	border-top: 1px solid var(--line);
}

.faq details:last-child {
	border-bottom: 1px solid var(--line);
}

.faq summary {
	min-height: 2.75rem;
	padding: 0.4rem 0;

	color: var(--blue);

	cursor: pointer;

	font-weight: 600;

	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.faq details p {
	margin: 0.65rem 0 0.15rem;
}

/* --------------------------------------------------------------------------
   Footer — same family as /ex/
   -------------------------------------------------------------------------- */

.site-footer {
	display: flex;
	justify-content: space-between;
	gap: 2rem;

	padding-block: 2.25rem 1.5rem;

	background: var(--navy-deep);
	color: #fff;

	font-size: 1rem;

	box-shadow: 0 0 0 100vmax var(--navy-deep);
	clip-path: inset(0 -100vmax);
}

.site-footer span:last-child {
	color: #d0e0e9;
}

.site-footer :focus-visible {
	outline-color: #fff;
}

/* --------------------------------------------------------------------------
   Dialogs — based on confirmation-dialog from /ex/
   -------------------------------------------------------------------------- */

.panel-dialog {
	width: min(100% - 2rem, 45rem);
	max-height: calc(100% - 2rem);

	overflow: auto;

	border: 1px solid var(--line);
	border-radius: 0.8rem;

	padding: 1.75rem;

	color: var(--ink);
	background: var(--paper);

	box-shadow: 0 16px 60px #001a3040;

	margin: auto;
}

.panel-dialog::backdrop {
	background: #062e4666;
}

.compact-dialog {
	width: min(100% - 2rem, 32rem);
}

.dialog-head {
	margin-bottom: 1.25rem;
}

.dialog-head h2 {
	margin-bottom: 0;
}

.icon-button {
	min-width: 2.75rem;
	min-height: 2.75rem;

	color: var(--blue);

	font-size: 1.8rem;
	line-height: 1;

	text-decoration: none;
}

.stacked-actions {
	display: grid;
	gap: 0.75rem;
}

.stacked-actions > button {
	width: 100%;

	padding: 1rem;

	border: 1px solid var(--line);
	border-radius: var(--radius-choice);

	background: var(--paper);
	color: var(--ink);

	text-align: left;
	cursor: pointer;

	font-weight: 600;
}

.stacked-actions > button:hover {
	background: var(--quiet);
	border-color: #83b5c8;
}

.stacked-actions span {
	display: block;

	margin-top: 0.2rem;

	color: var(--muted);

	font-size: 0.9375rem;
	font-weight: 400;
}

.dialog-tools {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;

	padding-top: 1rem;
	margin-top: 1rem;

	border-top: 1px solid var(--line);
}

.file-label {
	display: inline-block;
}

/* --------------------------------------------------------------------------
   History and sessions
   -------------------------------------------------------------------------- */

.history-session-open {
	width: 100%;

	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;

	border: 0;
	background: transparent;
	color: inherit;

	padding: 0;

	text-align: left;
	cursor: pointer;
}

.history-session-open strong {
	color: var(--navy);
	font-size: 1.125rem;
}

.history-session-open span {
	color: var(--muted);
	font-size: 0.9375rem;
	white-space: nowrap;
}

.history-session-open:hover strong {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}

.empty-state {
	padding: 0.75rem 0 1.5rem;
	color: var(--muted);
}

.saved-idea-topline {
	display: flex;
	align-items: center;
	gap: 0.6rem;

	min-height: 2rem;
}

.saved-idea > p {
	margin: 0.5rem 0 0.75rem;

	font-size: 1.125rem;
	line-height: 1.5;
}

.star-button {
	border: 0;
	background: transparent;

	padding: 0;

	color: var(--blue);

	font-size: 1.25rem;

	cursor: pointer;
}

.mini-label {
	color: var(--muted);

	font-size: 0.875rem;
}

.session-name-row {
	display: grid;
	grid-template-columns: minmax(7rem, 9rem) 1fr;
	gap: 0.9rem;
	align-items: center;

	margin-bottom: 1rem;
}

.session-name-row label {
	color: var(--navy);

	font-size: 1rem;
	font-weight: 650;
}

.session-name-row input {
	width: 100%;

	border: 1px solid var(--line);
	border-radius: var(--radius-control);

	background: var(--paper);

	padding: 0.65rem 0.8rem;

	color: var(--ink);
}

.session-tools button {
	border: 0;
	background: transparent;
	padding: 0;

	color: var(--blue);

	text-decoration: underline;
	text-underline-offset: 0.18em;

	cursor: pointer;
}

.saved-ideas-list {
	margin-top: 0.25rem;
}

.rebuild-candidate {
	margin: 0.5rem 0 1.5rem;

	color: var(--navy);

	font-size: clamp(1.375rem, 3vw, 2rem);
	font-weight: 650;
	line-height: 1.25;
}

.history-session {
	padding: 1rem 0;

	border-top: 1px solid var(--line);
}

.history-session:last-child {
	border-bottom: 1px solid var(--line);
}

.history-session-head {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 1rem;
}

.history-session h3 {
	margin: 0 0 0.25rem;

	color: var(--navy);

	font-size: 1.25rem;
}

.history-session p {
	margin: 0;
	color: var(--muted);
}

.idea-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.saved-idea {
	padding: 1rem 0;

	border-top: 1px solid var(--line);
}

.saved-idea-text {
	margin-bottom: 0.75rem;

	font-size: 1.125rem;
}

.saved-idea-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.saved-idea-actions button {
	border: 0;
	background: transparent;
	padding: 0;

	color: var(--blue);

	cursor: pointer;

	text-decoration: underline;
	text-underline-offset: 0.18em;
}

/* --------------------------------------------------------------------------
   Presentation mode
   -------------------------------------------------------------------------- */

body.is-presentation .site-header,
body.is-presentation .direction-section,
body.is-presentation .session-summary,
body.is-presentation .about-tool,
body.is-presentation .faq,
body.is-presentation .site-footer,
body.is-presentation .generator-intro .eyebrow,
body.is-presentation .generator-intro h1,
body.is-presentation .field-hint {
	display: none;
}

body.is-presentation .generator-intro {
	padding: 1.5rem 0 1rem;
	border-bottom: 0;
}

body.is-presentation .idea-stage {
	position: sticky;
	top: 0.75rem;
	z-index: 30;

	margin: 0 0 1.75rem;
	padding: 1.5rem;

	box-shadow: var(--shadow-raised);
}

body.is-presentation .idea-output {
	max-height: min(34svh, 20rem);

	padding-bottom: 2.6rem;

	font-size: clamp(2rem, 4.4vw, 3.6rem);
	line-height: 1.1;
}

body.is-presentation .lens-list {
	gap: 0.6rem;
}

body.is-presentation .lens {
	padding: 0.75rem 1rem;
}

body.is-presentation .lens-text {
	font-size: clamp(1.2rem, 2vw, 1.65rem);
}

body.is-presentation .shell {
	width: min(100% - 3.5rem, 80rem);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (max-width: 52rem) {
	.site-header,
	.utility-nav {
		gap: 1rem;
	}

	.brand {
		font-size: 1.3rem;
	}
}

@media (max-width: 40rem) {
	.shell {
		width: calc(100% - 2rem);
	}

	.site-header {
		min-height: 0;

		align-items: flex-start;
		flex-direction: column;
		gap: 0.7rem;

		padding-block: 1.2rem;
	}

	.brand {
		font-size: 1.5rem;
	}

	.utility-nav {
		gap: 1.5rem;
	}

	.generator-intro {
		padding: 2rem 0;
	}

	.generator-intro h1 {
		margin-bottom: 1.5rem;

		font-size: clamp(2rem, 10vw, 2.65rem);
	}

	.topic-row {
		grid-template-columns: 1fr;
	}

	.topic-row .button {
		width: 100%;
	}

	.idea-stage {
		position: relative;
		top: auto;
		z-index: auto;

		margin: 1.5rem 0 2.25rem;
		padding: 1rem;

		border-radius: var(--radius-choice);

		box-shadow: none;
	}

	.section-kicker-row {
		align-items: baseline;
	}

	.idea-status {
		max-width: 52%;
		font-size: 0.875rem;
	}

	.idea-output {
		min-height: 3.2em;
		max-height: min(29svh, 13.5rem);

		padding-right: 0.35rem;
		padding-bottom: 2.25rem;

		font-size: clamp(1.4rem, 6.5vw, 1.8rem);
		line-height: 1.18;
	}

	.idea-actions {
		gap: 0.5rem 1rem;
	}

	.workbench-heading {
		align-items: flex-end;
	}

	.lens-head {
		display: block;
	}

	.lens-state {
		display: block;
		margin-top: 0.15rem;
	}

	.session-summary {
		display: block;
	}

	.session-summary > button {
		margin-top: 0.5rem;
	}

	.site-footer {
		flex-direction: column;
		gap: 0.5rem;
	}

	.panel-dialog {
		padding: 1.25rem;
	}

	.session-name-row {
		grid-template-columns: 1fr;
		gap: 0.35rem;
	}

	body.is-presentation .idea-stage {
		position: relative;
		top: auto;
	}

	body.is-presentation .idea-output {
		max-height: min(31svh, 15rem);
		font-size: clamp(1.7rem, 8vw, 2.4rem);
	}
}

@media (min-width: 40.01rem) and (max-height: 47.49rem) {
	.idea-stage {
		position: relative;
		top: auto;
	}

	.idea-output {
		max-height: 13rem;
	}
}

/* --------------------------------------------------------------------------
   Print
   -------------------------------------------------------------------------- */

@media print {
	dialog,
	.site-header,
	.generator-intro,
	.lens-workbench,
	.direction-section,
	.idea-actions,
	.session-summary,
	.about-tool,
	.faq,
	.site-footer,
	.skip-link {
		display: none !important;
	}

	.shell {
		width: 100%;
		max-width: none;
	}

	.idea-stage {
		position: static;

		margin: 0;
		padding: 0;

		border: 0;
		background: #fff;
		box-shadow: none;
	}

	.idea-output {
		max-height: none;
		overflow: visible;

		padding: 0;

		color: #000;

		font-size: 20pt;

		-webkit-mask-image: none;
		mask-image: none;
	}

	body {
		background: #fff;
		color: #000;

		font-size: 11pt;
	}

	h1,
	h2,
	h3,
	a {
		color: #000;
	}
}

/* --------------------------------------------------------------------------
   Motion
   -------------------------------------------------------------------------- */

@media (prefers-reduced-motion: no-preference) {
	.button,
	.lens,
	.chip {
		transition:
			background-color 0.12s ease,
			border-color 0.12s ease,
			box-shadow 0.12s ease;
	}
}

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		scroll-behavior: auto !important;
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
	}
}

/* ========================================================================== 
   UI controls, /ex/ logo treatment and colour modes
   ========================================================================== */

.theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 2.75rem;
	height: 2.75rem;
	flex: none;
	padding: 0;
	border: 1px solid #23546766;
	border-radius: var(--radius-control);
	background: #ffffff55;
	color: var(--navy-deep);
	cursor: pointer;
	transition:
		background-color 0.12s ease,
		border-color 0.12s ease,
		transform 0.12s ease;
}

.theme-toggle:hover {
	background: #ffffff88;
	border-color: #23546799;
}

.theme-toggle:active {
	transform: translateY(1px);
}

.theme-icon {
	grid-area: 1 / 1;
	display: block;
	pointer-events: none;
}

/* W jasnym motywie pokazujemy księżyc = akcja przejścia do ciemnego. */
.theme-icon-sun {
	display: none;
}
.theme-icon-moon {
	display: block;
}

html[data-theme='dark'] .theme-icon-sun {
	display: block;
}
html[data-theme='dark'] .theme-icon-moon {
	display: none;
}

.footer-feedback {
	color: #fff;
	font-size: 1rem;
}

.footer-feedback:hover {
	color: #fff;
}

.dialog-head-actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 1rem;
}

.presentation-exit {
	display: none;
}

body.is-presentation .presentation-exit {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 60;
	display: inline-flex;
	align-items: center;
	min-height: 2.75rem;
	padding: 0.55rem 1rem;
	border: 2px solid var(--navy);
	border-radius: var(--radius-control);
	background: var(--paper);
	color: var(--navy);
	font-weight: 650;
	box-shadow: var(--shadow-raised);
}

body.is-presentation .presentation-exit:hover {
	background: var(--sky);
}

html[data-theme='dark'] {
	color-scheme: dark;
	--paper: #0f1b23;
	--ink: #e7f0f4;
	--muted: #afc0c8;
	--line: #35505d;
	--quiet: #172832;
	--sky: #153643;
	--blue: #79d1e8;
	--cyan: #184b5e;
	--navy: #a3e3f1;
	--navy-deep: #08161e;
	--shadow: 0 2px 8px #00000030;
	--shadow-raised: 0 12px 36px #00000055;
}

html[data-theme='dark'] .site-header,
html[data-theme='dark'] .site-header .brand,
html[data-theme='dark'] .site-header .brand-name,
html[data-theme='dark'] .site-header .brand:hover,
html[data-theme='dark'] .utility-nav .text-button {
	color: #e6f7fb;
}

html[data-theme='dark'] .brand-dot {
	color: #8edced;
}
html[data-theme='dark'] .brand-mark {
	border-right-color: #8edced55;
}

html[data-theme='dark'] .theme-toggle {
	background: #ffffff12;
	border-color: #8edced66;
	color: #e6f7fb;
}

html[data-theme='dark'] .theme-toggle:hover {
	background: #ffffff22;
	border-color: #8edcedaa;
}

html[data-theme='dark'] .button,
html[data-theme='dark'] .button-primary {
	background: #075d82;
	border-color: #2f95b8;
	color: #fff;
}

html[data-theme='dark'] .button:hover,
html[data-theme='dark'] .button-primary:hover {
	background: #08739a;
	border-color: #53b7d3;
}

html[data-theme='dark'] .idea-stage,
html[data-theme='dark'] .session-summary {
	background: #153643;
	border-color: #3d7085;
	border-left-color: #62c8df;
}

html[data-theme='dark'] .rebuild-notice {
	background: #16323e;
	border-color: #3d7085;
	border-left-color: #62c8df;
	color: #d8e8ee;
}

html[data-theme='dark'] .lens,
html[data-theme='dark'] .chip,
html[data-theme='dark'] .stacked-actions > button,
html[data-theme='dark'] .topic-row input,
html[data-theme='dark'] .session-name-row input,
html[data-theme='dark'] .panel-dialog {
	background: var(--paper);
	color: var(--ink);
}

html[data-theme='dark'] .lens:hover,
html[data-theme='dark'] .chip:hover,
html[data-theme='dark'] .stacked-actions > button:hover {
	background: var(--quiet);
}

html[data-theme='dark'] .lens[data-locked='true'],
html[data-theme='dark'] .chip[aria-pressed='true'] {
	background: var(--sky);
	border-color: var(--blue);
}

html[data-theme='dark'] .presentation-exit {
	background: #102630;
	color: #dff5fb;
	border-color: #62c8df;
}

html[data-theme='dark'] .presentation-exit:hover {
	background: #183846;
}

@media (max-width: 40rem) {
	.dialog-head-actions {
		gap: 0.65rem;
	}
	#show-all-sessions-button {
		font-size: 0.9375rem;
	}
	.theme-toggle {
		width: 2.6rem;
		height: 2.6rem;
	}
}
