/* Theme: light by default, dark when the system asks for it (unless overridden with data-theme="light"), or when data-theme="dark" */

:root {
	color-scheme: light;
	--bg: #ffffff;
	--sidebar: #f3f4f6;
	--card: #ffffff;
	--text: #111827;
	--muted: #5f6673;
	--border: #e5e7eb;
	--hover: #e9ebef;
	--chip: #e5e7eb;
	--accent: #2563eb;
	--accent-text: #2563eb;
	--accent-soft: #eff6ff;
	--on-accent: #ffffff;
	--success: #16a34a;
	--on-success: #ffffff;
	--danger: #e11d48;
	--danger-text: #be123c;
	--danger-soft: #ffe4ea;
	--on-danger: #ffffff;
	--shadow: 0 1px 2px rgba(17, 24, 39, .05);
	--radius: 8px;
	--sidebar-width: 220px;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #0d1117;
		--sidebar: #161b22;
		--card: #161b22;
		--text: #e6edf3;
		--muted: #8b949e;
		--border: #30363d;
		--hover: #21262d;
		--chip: #21262d;
		--accent: #2f6fe4;
		--accent-text: #60a5fa;
		--accent-soft: rgba(56, 139, 253, .15);
		--on-accent: #ffffff;
		--success: #16a34a;
		--on-success: #ffffff;
		--danger: #fb7185;
		--danger-text: #fb7185;
		--danger-soft: rgba(251, 113, 133, .15);
		--on-danger: #2a0a10;
		--shadow: 0 1px 2px rgba(0, 0, 0, .3);
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #0d1117;
	--sidebar: #161b22;
	--card: #161b22;
	--text: #e6edf3;
	--muted: #8b949e;
	--border: #30363d;
	--hover: #21262d;
	--chip: #21262d;
	--accent: #2f6fe4;
	--accent-text: #60a5fa;
	--accent-soft: rgba(56, 139, 253, .15);
	--on-accent: #ffffff;
	--success: #16a34a;
	--on-success: #ffffff;
	--danger: #fb7185;
	--danger-text: #fb7185;
	--danger-soft: rgba(251, 113, 133, .15);
	--on-danger: #2a0a10;
	--shadow: 0 1px 2px rgba(0, 0, 0, .3);
}

* {
	box-sizing: border-box;
}

html, body {
	margin: 0;
	padding: 0;
	background: var(--bg);
	color: var(--text);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	-webkit-tap-highlight-color: transparent;
}

/* No pinch or double-tap zoom in the installed app (set in index.php), only scrolling */
.standalone {
	touch-action: pan-x pan-y;
}

[hidden] {
	display: none !important;
}

h1, h2 {
	margin: 0;
}

/* Form elements */

input[type="text"],
input[type="password"],
input[type="email"],
input[type="date"],
input[type="time"],
input[type="search"],
select,
textarea {
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--text);
	font: inherit;
	/* At least 16px, or iOS zooms in when the field gets focus */
	font-size: 16px;
}

textarea {
	line-height: 1.5;
	resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
	outline: 2px solid var(--accent);
	outline-offset: -1px;
}

label,
.field {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-size: .9rem;
	color: var(--muted);
}

.field small {
	font-size: .8rem;
}

.weekday-picker {
	display: flex;
	gap: 6px;
}

.weekday-picker label {
	position: relative;
	display: block;
	flex: 1;
}

.weekday-picker input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.weekday-picker span {
	display: block;
	padding: 10px 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	color: var(--text);
	font-weight: 600;
	text-align: center;
}

.weekday-picker input:checked + span {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--on-accent);
}

.weekday-picker input:focus-visible + span {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

label input,
label select {
	font-size: 16px;
}

label.checkbox {
	flex-direction: row;
	align-items: center;
	gap: 10px;
	color: var(--text);
}

label.checkbox input {
	width: 20px;
	height: 20px;
	accent-color: var(--accent);
}

.button {
	padding: 12px 18px;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card);
	color: var(--text);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.button.primary {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--on-accent);
}

.button.danger {
	border-color: var(--danger);
	background: transparent;
	color: var(--danger-text);
}

.button.block {
	display: block;
	width: 100%;
	margin-bottom: 16px;
}

a.button {
	text-align: center;
	text-decoration: none;
}

.button:disabled {
	opacity: .6;
	cursor: default;
}

.button:active:not(:disabled) {
	transform: scale(.97);
}

.link-button {
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--accent-text);
	font: inherit;
	font-size: .9rem;
	cursor: pointer;
}

.link-button.danger {
	color: var(--danger-text);
}

.icon-button {
	flex: 0 0 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--muted);
	font-size: 1.2rem;
	line-height: 1;
	cursor: pointer;
}

.icon-button:hover,
.icon-button:focus-visible {
	background: var(--hover);
	color: var(--text);
}

.icon-button:disabled {
	visibility: hidden;
}

.icon-button.remove {
	font-size: 1.5rem;
}

.icon-button.remove:hover,
.icon-button.remove:focus-visible {
	color: var(--danger-text);
}

.form-error,
.message {
	padding: 10px 14px;
	border-radius: var(--radius);
	background: var(--danger);
	color: var(--on-danger);
	font-size: .95rem;
}

.card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 16px;
	padding: 18px;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
}

.card h2 {
	font-size: 1.05rem;
}

.card p {
	margin: 0;
}

.muted,
.hint {
	color: var(--muted);
	font-size: .9rem;
}

.hint {
	margin: 12px 4px;
}

/* Login / setup */

.auth {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 100vh;
	min-height: 100dvh;
	padding: 20px;
}

.auth-form {
	width: 100%;
	max-width: 380px;
}

.auth-form h1 {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	color: var(--accent-text);
	font-size: 1.5rem;
}

.auth-form .logo {
	width: 40px;
	height: 40px;
}

.auth-form p {
	color: var(--muted);
	text-align: center;
}

/* Layout */

.topbar {
	position: sticky;
	top: 0;
	z-index: 10;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 56px;
	padding: env(safe-area-inset-top) 14px 0;
	background: var(--sidebar);
	border-bottom: 1px solid var(--border);
}

.topbar h1 {
	flex: 1;
	font-size: 1.1rem;
	font-weight: 500;
}

.counter {
	color: var(--muted);
	font-size: .9rem;
}

.menu-toggle {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-left: -6px;
	color: var(--text);
}

.container {
	padding: 16px 14px calc(32px + env(safe-area-inset-bottom));
}

.message.success {
	background: var(--accent);
	color: var(--on-accent);
}

.message {
	position: sticky;
	top: calc(68px + env(safe-area-inset-top));
	z-index: 5;
	margin-bottom: 12px;
	box-shadow: var(--shadow);
}

/* Side menu: a drawer behind the hamburger button on small screens, always visible on wide ones */

.sidebar {
	position: fixed;
	top: 0;
	bottom: 0;
	left: 0;
	z-index: 30;
	display: flex;
	flex-direction: column;
	width: min(280px, 85vw);
	padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
	overflow-y: auto;
	background: var(--sidebar);
	border-right: 1px solid var(--border);
	transform: translateX(-100%);
	/* Hidden also takes the links out of the tab order while the drawer is closed */
	visibility: hidden;
	transition: transform .2s ease, visibility 0s .2s;
}

.menu-open .sidebar {
	transform: none;
	visibility: visible;
	transition: transform .2s ease;
}

.menu-backdrop {
	position: fixed;
	inset: 0;
	z-index: 20;
	background: rgba(0, 0, 0, .45);
	opacity: 0;
	pointer-events: none;
	transition: opacity .2s;
}

.menu-open .menu-backdrop {
	opacity: 1;
	pointer-events: auto;
}

.menu-open {
	overflow: hidden;
}

.brand {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 14px;
}

.brand-text {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.brand .logo {
	flex: 0 0 auto;
	width: 34px;
	height: 34px;
}

/* The logo follows the theme: a white house with a heart on the accent colour */
.logo-bg,
.logo-heart {
	fill: var(--accent);
}

.logo-house {
	fill: var(--on-accent);
}

.brand-name {
	font-size: 1.15rem;
	font-weight: 700;
}

.brand-user {
	color: var(--muted);
	font-size: .8rem;
}

.nav {
	display: flex;
	flex-direction: column;
	padding-bottom: 16px;
}

.nav a {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 44px;
	padding: 0 16px;
	color: var(--text);
	font-weight: 600;
	text-decoration: none;
}

.nav a:hover,
.nav a:focus-visible {
	background: var(--hover);
}

.nav a.active {
	background: var(--accent-soft);
	color: var(--accent-text);
}

.icon {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
}

.nav .icon {
	color: var(--muted);
}

.badge {
	min-width: 22px;
	margin-left: auto;
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--danger);
	color: var(--on-danger);
	font-size: .75rem;
	font-weight: 700;
	line-height: 18px;
	text-align: center;
}

.menu-dot {
	position: absolute;
	top: 6px;
	right: 5px;
	width: 9px;
	height: 9px;
	border: 2px solid var(--sidebar);
	border-radius: 50%;
	background: var(--danger);
	box-sizing: content-box;
}

.nav a.active .icon {
	color: inherit;
}

@media (min-width: 900px) {
	.sidebar {
		width: var(--sidebar-width);
		transform: none;
		visibility: visible;
		transition: none;
	}

	.menu-toggle,
	.menu-backdrop {
		display: none;
	}

	.topbar,
	.container {
		margin-left: var(--sidebar-width);
	}

	.topbar {
		padding-left: 22px;
	}

	.container {
		padding-left: 22px;
		padding-right: 22px;
	}

	.filter {
		margin-right: -22px;
		margin-left: -22px;
		padding: 2px 22px;
	}

	.menu-open {
		overflow: visible;
	}
}

/* Add forms */

.add-form {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-bottom: 20px;
}

.add-form.inline {
	flex-direction: row;
}

.add-form.inline input {
	flex: 1;
}

/* Suggestions below the name field (instead of a <datalist>, which can't be closed on Android) */

.autocomplete {
	position: relative;
	display: flex;
	flex: 1;
	min-width: 0;
}

.suggestion-list {
	position: absolute;
	top: calc(100% + 4px);
	right: 0;
	left: 0;
	z-index: 6;
	margin: 0;
	padding: 4px 0;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	list-style: none;
}

.suggestion-list li {
	padding: 10px 14px;
	cursor: pointer;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.suggestion-list li:hover,
.suggestion-list li[aria-selected="true"] {
	background: var(--hover);
}

/* Shown while there's no connection (set by api() in app.js) */

.offline-bar {
	display: none;
	margin: 0 0 12px;
	padding: 10px 14px;
	border-radius: var(--radius);
	background: var(--danger-soft);
	color: var(--danger-text);
	font-size: .9rem;
}

.offline .offline-bar {
	display: block;
}

.offline-age {
	display: block;
	margin-top: 6px;
}

.offline-age[hidden] {
	display: none;
}

#addQuantity {
	flex: 0 0 90px;
	width: 90px;
}

.add-button {
	flex: 0 0 48px;
	padding: 0;
	border-color: var(--success);
	background: var(--success);
	color: var(--on-success);
	font-size: 1.6rem;
	line-height: 1;
}

/* Store filter */

.filter {
	display: flex;
	gap: 8px;
	margin: 0 -14px 14px;
	padding: 2px 14px;
	overflow-x: auto;
	scrollbar-width: none;
}

.filter::-webkit-scrollbar {
	display: none;
}

.chip {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	gap: 6px;
	padding: 7px 13px;
	border: 1px solid var(--chip);
	border-radius: 999px;
	background: var(--chip);
	color: var(--text);
	font: inherit;
	font-size: .9rem;
	font-weight: 600;
	white-space: nowrap;
	cursor: pointer;
}

.chip[aria-pressed="true"] {
	border-color: var(--accent);
	background: var(--accent);
	color: var(--on-accent);
}

.chip .count {
	color: var(--muted);
	font-weight: 400;
}

.chip .count:empty {
	display: none;
}

.chip[aria-pressed="true"] .count {
	color: inherit;
	opacity: .85;
}

.store-choices {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 8px;
}

/* Lists */

.list {
	margin: 0;
	padding: 0;
	list-style: none;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	overflow: hidden;
	box-shadow: var(--shadow);
}

.list:empty {
	display: none;
}

.group {
	margin-bottom: 20px;
}

.section-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin: 0 4px 8px;
}

.section-header h2 {
	color: var(--muted);
	font-size: .85rem;
	font-weight: 600;
	letter-spacing: .05em;
	text-transform: uppercase;
}

.section-header .count {
	color: var(--muted);
	font-size: .85rem;
}

.item,
.row {
	display: flex;
	align-items: center;
	gap: 12px;
	min-height: 54px;
	padding: 8px 8px 8px 14px;
	border-bottom: 1px solid var(--border);
}

.item:last-child,
.row:last-child {
	border-bottom: 0;
}

.row .text {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
	cursor: pointer;
}

.row .text small {
	color: var(--muted);
	font-size: .85rem;
}

.check {
	position: relative;
	flex: 0 0 26px;
	height: 26px;
	cursor: pointer;
}

.check input {
	position: absolute;
	width: 100%;
	height: 100%;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.check .box {
	display: block;
	width: 26px;
	height: 26px;
	border: 2px solid var(--muted);
	border-radius: 50%;
	transition: background .15s, border-color .15s;
}

.check input:checked + .box {
	background: var(--accent);
	border-color: var(--accent);
}

.check input:checked + .box::after {
	content: "";
	display: block;
	width: 6px;
	height: 12px;
	margin: 4px 0 0 8px;
	border: solid var(--on-accent);
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.check input:focus-visible + .box {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.item .text {
	flex: 1;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	column-gap: 8px;
	min-width: 0;
	padding: 4px 0;
}

.item.editable .text {
	cursor: pointer;
}

.name {
	overflow-wrap: anywhere;
}

/* The quantity of a shopping list item, in front of the name */
.amount {
	flex: 0 1 auto;
	max-width: 35%;
	color: var(--muted);
	overflow-wrap: anywhere;
}

.amount:empty {
	display: none;
}

.meta,
.added-by {
	color: var(--muted);
	font-size: .9rem;
}

.added-by {
	font-size: .8rem;
	font-style: italic;
}

.list.checked .name,
.item.done .name {
	color: var(--muted);
	text-decoration: line-through;
}

.group.overdue .section-header h2 {
	color: var(--danger-text);
}

.menu a {
	display: flex;
	align-items: center;
	gap: 14px;
	min-height: 64px;
	padding: 10px 14px;
	border-bottom: 1px solid var(--border);
	color: var(--text);
	text-decoration: none;
}

.menu li:last-child a {
	border-bottom: 0;
}

.menu a:active {
	background: var(--hover);
}

.menu .menu-icon {
	font-size: 1.4rem;
}

.menu .text {
	flex: 1;
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.menu .text small {
	color: var(--muted);
	font-size: .85rem;
}

.menu .chevron {
	color: var(--muted);
	font-size: 1.4rem;
}

.back-link {
	display: inline-block;
	margin: 0 4px 14px;
	color: var(--accent-text);
	font-size: .95rem;
	text-decoration: none;
}

.row.event .text {
	cursor: default;
}

.event-time {
	flex: 0 0 auto;
	min-width: 96px;
	color: var(--muted);
	font-size: .85rem;
	font-variant-numeric: tabular-nums;
}

.empty {
	margin: 32px 0;
	color: var(--muted);
	text-align: center;
}

/* Recipes */

.recipes-toolbar {
	display: flex;
	gap: 8px;
	margin-bottom: 16px;
}

.recipes-toolbar input {
	flex: 1;
}

.recipe-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 14px;
}

.recipe-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: var(--card);
	border: 1px solid var(--border);
	border-radius: var(--radius);
	box-shadow: var(--shadow);
	color: var(--text);
	text-decoration: none;
}

.recipe-card:hover,
.recipe-card:focus-visible {
	border-color: var(--accent);
}

.recipe-card-photo {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.recipe-card-photo.placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--hover);
	font-size: 2.5rem;
}

.recipe-card-title {
	padding: 10px 12px;
	font-weight: 600;
	overflow-wrap: anywhere;
}

.recipe-photo {
	display: block;
	width: 100%;
	max-height: 380px;
	margin-bottom: 16px;
	object-fit: cover;
	border-radius: var(--radius);
}

.recipe-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 16px;
}

.recipe-header h2 {
	font-size: 1.5rem;
	overflow-wrap: anywhere;
}

.ingredient-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ingredient-list .checkbox {
	font-size: 1rem;
}

.recipe-instructions {
	line-height: 1.6;
	overflow-wrap: anywhere;
}

.recipe-instructions p,
.recipe-instructions ul,
.recipe-instructions ol {
	margin: 0 0 .8em;
}

.recipe-instructions ul,
.recipe-instructions ol {
	padding-left: 1.4em;
}

.recipe-instructions li {
	margin: .25em 0;
}

.recipe-instructions h3,
.recipe-instructions h4 {
	margin: 1.1em 0 .4em;
	font-size: 1.05rem;
}

.recipe-instructions h4 {
	font-size: 1rem;
}

.recipe-instructions > :first-child {
	margin-top: 0;
}

.recipe-instructions > :last-child {
	margin-bottom: 0;
}

.recipe-instructions hr {
	margin: 1.2em 0;
	border: 0;
	border-top: 2px dashed var(--border);
}

.recipe-instructions a {
	color: var(--accent-text);
}

/* Markdown editor: a toolbar above the textarea, and a preview in its place */
.md-editor {
	overflow: hidden;
	border: 1px solid var(--border);
	border-radius: var(--radius);
	background: var(--card);
}

.md-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px;
	padding: 4px;
	background: var(--sidebar);
	border-bottom: 1px solid var(--border);
}

.md-toolbar .spacer {
	flex: 1;
}

.md-toolbar button {
	min-width: 34px;
	padding: 6px 10px;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: .9rem;
	cursor: pointer;
}

.md-toolbar button:hover:not(:disabled),
.md-toolbar button:focus-visible {
	background: var(--hover);
}

.md-toolbar button:disabled {
	opacity: .4;
	cursor: default;
}

.md-toolbar .md-tab[aria-pressed="true"] {
	background: var(--accent-soft);
	color: var(--accent-text);
	font-weight: 600;
}

.md-editor textarea {
	display: block;
	width: 100%;
	border: 0;
	border-radius: 0;
}

.md-preview {
	min-height: 200px;
	padding: 12px 14px;
	color: var(--text);
	font-size: 1rem;
}

.recipe-columns .card .button.block {
	margin-bottom: 0;
}

.recipe-form-photo {
	display: block;
	width: 100%;
	max-width: 320px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--radius);
}

.photo-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* A label that opens the file picker, styled as a button */
.file-button {
	display: inline-block;
	color: var(--text);
	font-size: inherit;
}

.ingredient-head,
.ingredient-row {
	display: grid;
	grid-template-columns: 80px 100px minmax(0, 1fr) 36px 36px 36px;
	align-items: center;
	gap: 6px;
}

.ingredient-head span:last-child {
	grid-column: 3 / -1;
}

.ingredient-rows {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.ingredient-row input {
	padding: 10px;
}

@media (max-width: 599px) {
	.ingredient-head,
	.ingredient-row {
		grid-template-columns: 64px 72px minmax(0, 1fr) 32px;
	}

	.ingredient-row .move {
		display: none;
	}
}

@media (min-width: 900px) {
	.recipe-columns {
		display: grid;
		grid-template-columns: minmax(260px, 1fr) 2fr;
		align-items: start;
		gap: 16px;
	}
}

.not-found {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
	margin: 48px 0;
	color: var(--muted);
	text-align: center;
}

.not-found p {
	margin: 0;
}

.not-found-code {
	color: var(--text);
	font-size: 3rem;
	font-weight: 700;
	line-height: 1;
}

.notice {
	margin: 0 0 16px;
	padding: 10px 14px;
	border-radius: var(--radius);
	background: var(--danger-soft);
	color: var(--danger-text);
	font-size: .9rem;
}

/* A row of options of which one is chosen, e.g. the theme */
.segmented {
	display: flex;
	gap: 4px;
	padding: 4px;
	border-radius: var(--radius);
	background: var(--hover);
}

.segmented label {
	position: relative;
	display: block;
	flex: 1;
}

.segmented input {
	position: absolute;
	inset: 0;
	margin: 0;
	opacity: 0;
	cursor: pointer;
}

.segmented span {
	display: block;
	padding: 9px 4px;
	border-radius: calc(var(--radius) - 4px);
	color: var(--muted);
	font-size: .9rem;
	font-weight: 600;
	text-align: center;
	transition: background .15s, color .15s;
}

.segmented input:checked + span {
	background: var(--card);
	color: var(--accent-text);
	box-shadow: var(--shadow);
}

.segmented input:focus-visible + span {
	outline: 2px solid var(--accent);
	outline-offset: 2px;
}

.loading {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin: 32px 0;
	color: var(--muted);
}

.loading::before {
	content: "";
	width: 20px;
	height: 20px;
	border: 2px solid var(--border);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin .8s linear infinite;
}

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

.checked-section {
	margin-top: 28px;
}

.pending-section {
	margin-bottom: 20px;
}

.pending-section .list {
	border-color: var(--accent);
}

.icon-button.approve:hover,
.icon-button.approve:focus-visible {
	color: var(--accent);
}

.push-prompt {
	border-color: var(--accent);
}

.push-prompt-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 8px;
}

.account-name {
	font-size: 1.15rem;
	font-weight: 600;
}

/* Dialog */

.dialog {
	width: calc(100% - 28px);
	max-width: 420px;
	padding: 0;
	border: 0;
	border-radius: var(--radius);
	background: var(--card);
	color: var(--text);
	box-shadow: 0 10px 40px rgba(0, 0, 0, .3);
}

.dialog::backdrop {
	background: rgba(0, 0, 0, .45);
}

.dialog form {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 20px;
}

.dialog h2 {
	font-size: 1.15rem;
}

.dialog-buttons {
	display: flex;
	gap: 8px;
	margin-top: 6px;
}

.dialog-buttons .spacer {
	flex: 1;
}
