@media (max-width: 768px) {
	.container {
		padding: 1rem;
	}
	/* Header: collapsed search sits inline with heading; expanded drops below */
	.page-header {
		flex-direction: row; /* default row */
		align-items: center;
		gap: 1rem; /* increased gap */
		flex-wrap: nowrap;
		position: relative; /* enable absolute centering of heading */
	}
	.page-header.search-expanded { /* when expanded, stack */
		flex-direction: column;
		align-items: stretch;
		gap: 0.9rem;
	}
	/* Absolute center heading when collapsed; revert to normal flow when expanded */
	.page-header:not(.search-expanded) .h1 {
		position: static;
		transform: none;
		pointer-events: auto;
	}
	/* Provide space on the right for the search icon so it doesn't overlap heading */
	.page-header:not(.search-expanded) .search-input.is-collapsed {
		/* margin removed; we'll push via parent .search-bar for better control */
		z-index: 2; /* above heading for focus */
	}
	.page-header.search-expanded .search-bar {
		align-self: stretch;
		margin-left: 0;
	}
	/* When expanded, restore heading to normal flow */
	.page-header.search-expanded .h1 {
		position: static;
		transform: none;
		pointer-events: auto;
		text-align: center; /* center heading when search expanded */
		width: 100%;
	}
	.page-header.search-expanded .search-input {
		width: 100%;
	}
	.page-header .h1 { flex: 1 1 auto; min-width: 0; }
	.page-header .search-input.is-collapsed {
		flex: 0 0 auto;
	}
	.page-header .search-input:not(.is-collapsed) {
		align-self: stretch;
	}
	.logo-card {
		/* Prevent overflow while preserving margin/padding */
		width: calc(100% - 2rem); /* 2 * 1rem side margins */
		padding: 0.6rem;
		grid-template-columns: 70px 1fr; /* match smaller logo */
		margin: 1rem;
		box-sizing: border-box;
	}
	.logo-frame {
		width: 70px;
	}
	.logo-card .org-info {
		gap: 0.45rem;
		display: flex; /* override desktop grid for stacking */
		flex-direction: column; /* stack name then actions */
		align-items: center;
		width: 100%;
	}
	.logo-card .org-actions {
		display: flex;
		flex-direction: row;
		align-items: stretch;
		gap: 0.5rem; /* internal gap token */
		justify-content: flex-start; /* default; overridden for stretching */
		flex-wrap: wrap;
		width: 100%;
		margin-top: 0.25rem;
		padding: 0 0.5rem; /* horizontal padding equals gap for equal side spacing */
		box-sizing: border-box;
	}
	.logo-card .org-actions .org-btn {
		width: auto; /* natural width */
		text-align: center;
		padding: 0.5rem 0.6rem;
	}
	/* Stretch non-placeholder actions: buttons share full row width */
	.logo-card:not(.placeholder) .org-actions {
		justify-content: space-between; /* distribute buttons across padded width */
	}
	.logo-card:not(.placeholder) .org-actions .org-btn {
		flex: 1 1 auto; /* grow evenly while respecting content */
		text-align: center;
		min-width: 0; /* allow shrink to avoid overflow */
	}
	/* Hide placeholder logo column & expand content */
	.logo-card.placeholder {
		grid-template-columns: 1fr; /* remove logo column */
	}
	.logo-card.placeholder .logo-frame {
		display: none;
	}
	.org-btn {
		width: auto !important;
	}
	.sections-grid {
		flex-direction: column;
	}
	.sections-grid .col {
		width: 100%;
	}
	/* Removed duplicate .page-header column override to keep inline icon beside heading */
	.h1 {
		font-size: clamp(1.8rem, 7.4vw, 2.6rem);
		white-space: nowrap; /* keep on one line */
		overflow: hidden;
		text-overflow: ellipsis; /* truncate if space too tight */
	}
	/* If heading truncates too early, allow a bit more room by shrinking icon sooner */
	.page-header .search-input.is-collapsed { --collapsed-size: clamp(30px, 6.4vw, 40px); }
	/* Narrower phones: shrink icon further */
	@media (max-width: 520px) {
		.page-header .search-input.is-collapsed { --collapsed-size: clamp(28px, 7.8vw, 36px); }
		.h1 { font-size: clamp(1.65rem, 7.1vw, 2.25rem); }
	}
	@media (max-width: 410px) {
		.page-header .search-input.is-collapsed { --collapsed-size: clamp(26px, 8.5vw, 32px); }
		.h1 { font-size: clamp(1.55rem, 7.6vw, 2rem); }
	}
	@media (max-width: 350px) {
		.page-header .search-input.is-collapsed { --collapsed-size: clamp(24px, 9.2vw, 30px); }
		.h1 { font-size: clamp(1.45rem, 8.2vw, 1.85rem); }
	}
	/* Let height be intrinsic; remove forced 43px so square icon size controls height */
	.search-bar, .search-input {
		height: auto;
	}
	.search-input {
		width: 20rem;
	}
	#orgSearch {
		font-size: 1.5rem !important;
	}
	.sections-grid {
		grid-template-columns: 1fr !important;
	}
	h2 {
		text-align: center;
	}
	.logo-card.placeholder .org-actions {
		justify-content: center;
	}
}