

:root {
	--item-property-gap: 16px;
	--item-property-label-gap: 6px;
	--item-photo-width: 120px;
	--item-photo-height: 146px;
	color-scheme: light;
	--bg: #F7F8FC;
	--surface-1: #FFFFFF;
	--surface-2: #EEF0F7;
	--border: #E5E8F0;
	--text-1: #202435;
	--text-2: #626A7F;
	--text-3: #747D91;
	--accent: #5748D9;
	--on-accent: #FFFFFF;
	--danger: #C33B3A;
	--on-danger: #FFFFFF;
	--highlight: #C87F12;

	--group-chip-alpha: 10%;

	--group-0: #7F77DD;
	--group-1: #EF9F27;
	--group-2: #378ADD;
	--group-3: #639922;
	--group-4: #D4537E;
	--group-5: #1D9E75;
	--group-6: #A05BD3;

	--radius-plate: 14px;
	--radius-item: 12px;
	--radius-sheet: 18px;
	--radius-dialog: 16px;
	--radius-control: 12px;
	--radius-chip: 9px;
	--radius-photo: 9px;
	--size-product-link-thumb: 64px;
	--size-item-photo: 84px;
	--gap-item-photo: 10px;
	--gap-item-text: 2px;
	--photo-viewer-bg: #000000;
	--photo-viewer-content: #FFFFFF;
	--radius-qty: 7px;
	--radius-check: 6px;
	--radius-bubble-tail: 5px;
	--radius-code: 4px;
	--gap-plate: 4px;
	--pad-row-x: 13px;
	--pad-plate-y: 8px;
	--pad-item-y: 4px;
	--pad-row-y: 10px;
	--gap-icon: 11px;
	--tap-min: 48px;

	--fs-title: 17px;
	--fs-item: 14px;
	--fs-body: 14px;
	--fs-button: 13px;
	--fs-hint: 13px;
	--fs-counter: 12px;
	--fs-caption: 11px;
	--fw-medium: 500;

	--card: var(--surface-1);
	--text: var(--text-1);
	--muted: var(--text-2);
	--line: var(--border);
	--accent-text: var(--on-accent);
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		color-scheme: dark;
		--bg: #141720;
		--surface-1: #1D222E;
		--surface-2: #272E3D;
		--border: #343D50;
		--text-1: #F0F2F7;
		--text-2: #B1B9CB;
		--text-3: #98A3B8;
		--accent: #B7A9FF;
		--on-accent: #21164D;
		--danger: #FF9B96;
		--on-danger: #4B1110;
		--highlight: #EF9F27;
		--group-chip-alpha: 16%;
	}
}

:root[data-theme="dark"] {
	color-scheme: dark;
	--bg: #141720;
	--surface-1: #1D222E;
	--surface-2: #272E3D;
	--border: #343D50;
	--text-1: #F0F2F7;
	--text-2: #B1B9CB;
	--text-3: #98A3B8;
	--accent: #B7A9FF;
	--on-accent: #21164D;
	--danger: #FF9B96;
	--on-danger: #4B1110;
	--highlight: #EF9F27;
	--group-chip-alpha: 16%;
}


.group-color { --group-color: var(--group-0); }
.group-color[data-color="1"] { --group-color: var(--group-1); }
.group-color[data-color="2"] { --group-color: var(--group-2); }
.group-color[data-color="3"] { --group-color: var(--group-3); }
.group-color[data-color="4"] { --group-color: var(--group-4); }
.group-color[data-color="5"] { --group-color: var(--group-5); }
.group-color[data-color="6"] { --group-color: var(--group-6); }

.group-chip-color {
	color: var(--group-color, var(--accent));
	background: color-mix(in srgb, var(--group-color, var(--accent)) var(--group-chip-alpha), transparent);
}

* { box-sizing: border-box; }

body {
	margin: 0;
	padding: env(safe-area-inset-top) var(--pad-row-x) env(safe-area-inset-bottom);
	background: var(--bg);
}

body, #screen-welcome .client-preview {
	color: var(--text-1);
	font: var(--fs-body)/1.43 Roboto, -apple-system, "Segoe UI", system-ui, sans-serif;
}

[hidden] { display: none !important; }

.screen { max-width: 680px; margin: 0 auto; }

.screen-fixed {
	display: flex;
	flex-direction: column;
	height: calc(100dvh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
}

#session-startup {
	position: fixed;
	inset: 0;
	z-index: 40;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	background: var(--bg);
	color: var(--text-1);
}

.session-startup-brand { display: flex; align-items: center; gap: 10px; font-size: 20px; font-weight: 700; letter-spacing: -.7px; }
.session-startup-brand img { border-radius: 7px; }
.session-startup-progress { width: 28px; height: 28px; border: 3px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: session-startup-spin .8s linear infinite; }
@keyframes session-startup-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .session-startup-progress { animation: none; } }

.pane { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.pane-scroll { flex: 1; min-height: 0; overflow-y: auto; }
#pane-items { padding-inline-end: var(--list-scrollbar-width, 0px); }
#list-items { overflow-anchor: none; margin-inline-end: calc(-1 * var(--list-scrollbar-width, 0px)); }


.icon {
	width: 24px;
	height: 24px;
	fill: currentColor;
	display: block;
	flex: none;
}

.icon-button {
	width: var(--tap-min);
	height: var(--tap-min);
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	margin: 0;
	border: none;
	border-radius: 50%;
	background: none;
	color: var(--muted);
	cursor: pointer;
}

.icon-button:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
.icon-button:disabled { opacity: 0.4; cursor: default; background: none; color: var(--muted); }

.icon-button.primary { background: none; color: var(--accent); }
.icon-button.primary:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.icon-button.primary:disabled { background: none; color: var(--text-3); opacity: 1; }

.icon-button.is-on { color: var(--accent); }
.icon-button.is-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }




.plate {
	position: relative;
	display: flex;
	align-items: center;
	gap: var(--gap-icon);
	width: 100%;
	margin-bottom: var(--gap-plate);
	padding: var(--pad-plate-y) var(--pad-row-x);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: var(--radius-plate);
	color: var(--text-1);
	text-align: left;
	overflow: hidden;
}

.plate-striped::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	width: 4px;
	background: var(--group-color, var(--accent));
}

.plate-striped { padding-left: calc(var(--pad-row-x) + 4px); }

.plate.is-row { padding: 0; gap: 0; flex-wrap: wrap; }
.plate.is-row.plate-striped { padding-left: 0; }

.plate-open {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: var(--pad-plate-y) 12px;
	background: none;
	border: none;
	border-radius: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.plate.plate-striped .plate-open { padding-left: 12px; }



.group-lonely {
	flex: 1 0 100%;
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 40px;
	padding: 0 var(--pad-row-x) var(--pad-plate-y);
	background: none;
	border: none;
	border-radius: 0;
	color: var(--accent);
	font: inherit;
	font-weight: var(--fw-medium);
	text-align: left;
	cursor: pointer;
}

.group-lonely .icon { width: 17px; height: 17px; flex: none; }

.plate.plate-striped .group-lonely { padding-left: calc(var(--pad-row-x) + 4px); }

.plate-body { flex: 1; min-width: 0; }

.plate-title {
	display: block;
	font-size: var(--fs-item);
	font-weight: var(--fw-medium);
	color: var(--text-1);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plate-caption {
	display: block;
	font-size: var(--fs-caption);
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plate-caption .icon {
	width: 13px;
	height: 13px;
	display: inline-block;
	vertical-align: -2px;
	margin-right: 4px;
}

.plate-tail { display: flex; align-items: center; gap: 6px; flex: none; }

.mark-dot {
	width: 6px;
	height: 6px;
	flex: none;
	border-radius: 50%;
	background: var(--accent);
}

.mark-count {
	font-size: var(--fs-caption);
	color: var(--accent);
	font-variant-numeric: tabular-nums;
}

.plate-tail.is-muted .mark-dot { background: var(--text-3); }
.plate-tail.is-muted .mark-count { color: var(--text-3); }

.row {
	display: flex;
	align-items: center;
	gap: var(--gap-icon);
	padding: var(--pad-row-y) 0;
	border-bottom: 1px solid var(--border);
}

.row:last-child { border-bottom: none; }
.row.separated-row, .move-target.separated-row { border-top: 1px solid var(--border); border-bottom: none; }
.search-result .row-open > .icon { width: 18px; height: 18px; color: var(--text-3); }
.search-result.is-group .row-title { font-weight: var(--fw-medium); }

.avatar {
	width: 29px;
	height: 29px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	background: color-mix(in srgb, var(--accent) 16%, transparent);
	color: var(--accent);
	font-size: var(--fs-counter);
	font-weight: var(--fw-medium);
}

.avatar.is-large {
	width: 38px;
	height: 38px;
	background: var(--accent);
	color: var(--on-accent);
	font-size: var(--fs-item);
}

.switch-row { cursor: pointer; }
.switch-row .item-check { margin-left: auto; }

.section-label {
	display: block;
	margin-bottom: 4px;
	font-size: var(--fs-caption);
	color: var(--text-3);
}

.row-action {
	width: 100%;
	padding: var(--pad-row-y) 0;
	background: none;
	border: none;
	border-bottom: 1px solid var(--border);
	border-radius: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.row-action:last-child { border-bottom: none; }
.row-action-label { flex: none; color: var(--accent); font-size: var(--fs-body); }
.row-action.is-danger .row-title { color: var(--danger); }
.row-action.is-danger .icon { color: var(--danger); }

.profile-row {
	width: 100%;
	padding: 4px 0;
	background: none;
	border: none;
	border-radius: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.profile-row .icon { flex: none; color: var(--text-2); }
.row-body { flex: 1; min-width: 0; }
.row-title { display: block; font-size: var(--fs-item); color: var(--text-1); }

.row-open {
	flex: 1;
	min-width: 0;
	display: flex;
	align-items: center;
	gap: var(--gap-icon);
	padding: 0;
	background: none;
	border: none;
	border-radius: 0;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.row-open:hover .row-title { color: var(--accent); }

.row-title.is-done { color: var(--text-3); text-decoration: line-through; }

.group-chip {
	width: 40px;
	height: 40px;
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
}

.group-chip .icon { width: 20px; height: 20px; }
.group-chip.is-small { width: 32px; height: 32px; }
.group-chip.is-small .icon { width: 16px; height: 16px; }

.picker-label {
	display: block;
	margin: 12px 0 6px;
	font-size: var(--fs-caption);
	color: var(--text-3);
}

.picker-colors { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

.picker-color {
	width: var(--tap-min);
	height: var(--tap-min);
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: none;
	cursor: pointer;
}

.picker-color::before {
	content: "";
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: var(--group-color);
}

.picker-color[aria-pressed="true"]::before {
	box-shadow: 0 0 0 3px var(--surface-1), 0 0 0 5px var(--group-color);
}

.picker-icons {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(var(--tap-min), 1fr));
	gap: 4px;
}

.picker-icon {
	min-width: var(--tap-min);
	height: var(--tap-min);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	border: 1px solid transparent;
	border-radius: var(--radius-control);
	background: none;
	color: var(--text-2);
	cursor: pointer;
}

.picker-icon:hover { background: var(--surface-2); }

.picker-icon[aria-pressed="true"] {
	border-color: var(--group-color);
	color: var(--group-color);
	background: color-mix(in srgb, var(--group-color) var(--group-chip-alpha), transparent);
}

.item-check-box {
	position: relative;
	width: var(--tap-min);
	height: var(--tap-min);
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
}

.item-check {
	width: 22px;
	height: 22px;
	margin: 0;
	flex: none;
	appearance: none;
	border: 2px solid var(--text-3);
	border-radius: var(--radius-check);
	background: none;
	cursor: pointer;
}

.item-check:checked {
	border-color: var(--accent);
	background: var(--accent);
}

.item-check:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.item-plate { border-radius: var(--radius-item); min-height: var(--tap-min); }
.item-plate.is-row { flex-wrap: nowrap; }
.item-plate .plate-open { gap: 6px; min-height: var(--tap-min); padding: var(--pad-item-y) 12px var(--pad-item-y) 2px; }
.item-plate .plate-body { padding: 0; }
.item-copy { flex: 1; min-width: 0; padding: var(--pad-item-y) 12px var(--pad-item-y) 2px; }
.item-copy .plate-open { width: 100%; min-height: 0; padding: 0; }
.item-copy > .item-note, .item-copy > .plate-caption { margin-top: var(--gap-item-text); }
.item-plate.is-reordering { padding-left: 12px; }
.item-plate .item-thumbnail { width: var(--size-item-photo); height: var(--size-item-photo); margin: 6px var(--gap-item-photo) 6px 2px; padding: 0; border: none; color: var(--text-3); }
button.item-thumbnail { cursor: zoom-in; }
button.item-thumbnail:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.item-thumbnail .product-link-placeholder .icon { width: 24px; height: 24px; }
.item-store-link { display: flex; align-items: center; gap: 6px; width: fit-content; max-width: 100%; margin-top: var(--gap-item-text); color: var(--accent); font-size: var(--fs-body); line-height: 1.4; text-decoration: none; }
.item-store-link > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-store-link > .icon { flex: none; width: 18px; height: 18px; }
a.item-store-link:hover > span { text-decoration: underline; }
a.item-store-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-photo); }
.item-store-link.is-disabled { color: var(--text-3); }
.item-note { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: var(--fs-hint); }
.item-meta { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; flex: none; max-width: 45%; }
.item-meta .qty-chip { overflow-wrap: anywhere; }
.item-selected { display: inline-flex; color: var(--accent); }
.item-selected .icon { width: 18px; height: 18px; }
.item-check-mark { display: none; position: absolute; pointer-events: none; color: var(--on-accent); }
.item-check-mark .icon { display: block; width: 18px; height: 18px; }
.item-check:checked + .item-check-mark { display: inline-flex; }
.item-note.is-overdue { color: var(--danger); }
.item-reminder { display: inline-flex; vertical-align: -2px; margin-left: 4px; color: var(--text-2); }
.item-reminder .icon { width: 13px; height: 13px; }

.schedule-rows { margin: 8px 0; }
.schedule-rows > .schedule-row:first-child { border-top: none; margin-top: 0; }
.schedule-row { min-height: var(--tap-min); gap: 10px; width: 100%; }
.schedule-row > .icon:first-child { width: 20px; height: 20px; }
.schedule-row > span { flex: 1; min-width: 0; }
.schedule-value { display: block; color: var(--text-2); font-size: var(--fs-hint); overflow-wrap: anywhere; }
.schedule-warning { color: var(--text-2); font-size: var(--fs-hint); margin: 8px 0; }
.schedule-editor { background: var(--surface-2); color: var(--text-1); border-radius: var(--radius-control); padding: 12px; margin: 8px 0; }
.schedule-editor h3 { margin: 0 0 8px; font-size: var(--fs-body); font-weight: var(--fw-medium); }
.schedule-editor .field-label { margin-top: 8px; }
.schedule-editor input, .schedule-editor select { min-width: 0; max-width: 100%; min-height: var(--tap-min); }
.schedule-editor input:not([type="checkbox"]) { width: 100%; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--surface-1); color: var(--text-1); font: inherit; }
.schedule-editor input { margin-bottom: 4px; }
.schedule-time-toggle { display: flex; align-items: center; gap: 8px; min-height: var(--tap-min); }
.schedule-time-toggle input { width: 22px; height: 22px; min-height: 22px; margin: 0; accent-color: var(--accent); }
.schedule-quick { display: flex; flex-wrap: wrap; gap: 4px; }
.schedule-quick button { min-height: var(--tap-min); }
.schedule-editor-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.schedule-editor-actions button { min-height: var(--tap-min); }
.schedule-reminder-row { display: flex; align-items: center; gap: 4px; padding: 4px 0; }
.schedule-reminder-row > span { flex: 1; min-width: 0; }
.schedule-reminder-row small { display: block; color: var(--text-2); overflow-wrap: anywhere; }
.schedule-custom-offset, .schedule-absolute { display: flex; gap: 6px; flex-wrap: wrap; }
.schedule-custom-offset input { flex: 1; width: 65px; }
.schedule-editor .schedule-custom-offset input { width: 65px; }
.schedule-custom-offset select { flex: 1; background: var(--surface-1); color: var(--text-1); border: 1px solid var(--border); border-radius: var(--radius-control); padding: 8px; }
.schedule-absolute input { flex: 1; width: 120px; }
.schedule-editor .schedule-absolute input { width: 120px; }

.item-name { display: block; min-width: 0; word-break: break-word; }

.product-link { display: flex; align-items: center; gap: 10px; min-width: 0; min-height: var(--tap-min); padding: 6px; border: 1px solid var(--border); border-radius: var(--radius-photo); background: var(--bg); color: var(--text-1); text-decoration: none; text-align: left; }
a.product-link:hover { border-color: var(--accent); }
a.product-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.product-link-thumb { position: relative; display: grid; place-items: center; flex: none; width: var(--size-product-link-thumb); height: var(--size-product-link-thumb); overflow: hidden; border-radius: var(--radius-photo); background: var(--surface-2); }
.product-link-thumb img { position: absolute; inset: 0; z-index: 1; width: 100%; height: 100%; object-fit: contain; background: var(--surface-1); }
.product-link-thumb img[hidden] { display: none; }
.product-link-placeholder { color: var(--text-3); font-size: var(--fs-counter); }
.product-link-text { flex: 1; min-width: 0; }
.product-link-domain { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: var(--fs-caption); }
.product-link-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; font-size: var(--fs-body); line-height: 1.4; overflow-wrap: anywhere; }
.product-link > .icon { flex: none; width: 18px; height: 18px; color: var(--text-3); }
.product-link-editor-preview { margin-top: 8px; }
.product-link-editor-preview:empty { margin-top: 0; }
.product-link-form-row { display: flex; gap: 12px; }
.product-link-form-row > label { flex: 1; min-width: 0; }
.product-link-form-row input, .product-link-form-row select { width: 100%; }

@media (hover: none) {
	#list-items .plate { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

.plate.is-done .item-name { color: var(--text-3); text-decoration: line-through; }

.plate.is-selected {
	background: color-mix(in srgb, var(--accent) 14%, var(--surface-1));
	border-color: color-mix(in srgb, var(--accent) 32%, transparent);
}

.picker-groups { display: flex; flex-direction: column; }

.move-target {
	min-height: var(--tap-min);
	padding: 0 8px;
	border-radius: var(--radius-control);
}
.move-target.separated-row { border-radius: 0; }

.move-target[aria-pressed="true"] {
	background: color-mix(in srgb, var(--accent) 14%, transparent);
}

.move-target[aria-pressed="true"] .row-title { color: var(--accent); font-weight: var(--fw-medium); }

.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: var(--tap-min);
	margin: 4px 0 var(--gap-plate);
	padding: 0 var(--pad-row-x);
	background: none;
	border: none;
	border-radius: 0;
	color: var(--text-3);
	font: inherit;
	font-size: var(--fs-caption);
	text-align: left;
	cursor: pointer;
}

.section-chevron { display: inline-flex; }
.section-chevron .icon { width: 16px; height: 16px; }

.stepper { display: flex; align-items: center; gap: 6px; }

.stepper-value {
	flex: 0 0 4rem;
	text-align: center;
	font-variant-numeric: tabular-nums;
}

.stepper-unit {
	flex: 1;
	min-width: 0;
	padding: 10px 12px;
	border: 1px solid var(--border);
	border-radius: var(--radius-control);
	background: var(--bg);
	color: var(--text-1);
	font: inherit;
}

.stepper-unit:disabled { opacity: 0.5; }

textarea {
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 1px solid var(--border);
	border-radius: var(--radius-control);
	background: var(--bg);
	color: var(--text-1);
	font: inherit;
	resize: vertical;
}

.row-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	width: 100%;
	min-height: var(--tap-min);
	padding: 0;
	margin-top: 4px;
	background: none;
	border: none;
	border-top: 1px solid var(--border);
	border-radius: 0;
	color: var(--text-1);
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.row-link.is-danger { color: var(--danger); }

.field-error { margin: -4px 0 8px; font-size: var(--fs-caption); color: var(--danger); }

.history-icon { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: var(--radius-chip); background: var(--surface-2); color: var(--text-2); }
.history-icon .icon { width: 13px; height: 13px; }

.qty-chip {
	flex: none;
	padding: 5px 9px;
	border-radius: var(--radius-qty);
	background: var(--surface-2);
	color: var(--text-2);
	font-size: var(--fs-hint);
}

.count {
	flex: none;
	font-size: var(--fs-counter);
	color: var(--text-2);
	font-variant-numeric: tabular-nums;
}

.count-done { color: var(--text-1); font-weight: var(--fw-medium); }

.topbar-titles { flex: 1; min-width: 0; }

.topbar-search { flex: 1; min-width: 0; margin: 0; }

.topbar-subtitle {
	display: block;
	font-size: var(--fs-caption);
	color: var(--text-3);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.empty-state {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	gap: 8px;
	padding: 40px 24px;
	color: var(--text-3);
}

.empty-state-icon {
	width: 44px;
	height: 44px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: var(--radius-control);
	background: var(--surface-2);
	color: var(--text-2);
}

.empty-state-title {
	font-size: var(--fs-item);
	font-weight: var(--fw-medium);
	color: var(--text-1);
}

.empty-state-hint { font-size: var(--fs-caption); color: var(--text-3); max-width: 34ch; }

.empty-state button { width: auto; }

.empty-state-actions {
	display: grid;
	grid-auto-rows: 1fr;
	gap: 8px;
	width: max-content;
	max-width: 100%;
	margin-top: 8px;
}

.empty-state-actions .button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	min-width: 0;
	min-height: var(--tap-min);
}

.empty-state-actions .icon { width: 18px; height: 18px; }

.skeleton-plate {
	height: 62px;
	margin-bottom: var(--gap-plate);
	border-radius: var(--radius-plate);
	background: var(--surface-2);
	animation: skeleton-pulse 1.4s ease-in-out infinite;
}

.skeleton-plate:nth-child(2) { animation-delay: 0.18s; }
.skeleton-plate:nth-child(3) { animation-delay: 0.36s; }

@keyframes skeleton-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.45; }
}

@media (prefers-reduced-motion: reduce) {
	.skeleton-plate { animation: none; }
}


.msg-menu {
	position: fixed;
	z-index: 30;
	min-width: 180px;
	max-width: min(320px, calc(100vw - 16px));
	max-height: calc(100dvh - 16px);
	overflow-y: auto;
	padding: 4px 0;
	border-radius: var(--radius-control);
	background: var(--card);
	border: 1px solid var(--line);
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.msg-menu button {
	display: flex;
	align-items: center;
	gap: 12px;
	width: 100%;
	min-height: var(--tap-min);
	padding: 10px 14px;
	border: none;
	border-radius: 0;
	background: none;
	color: var(--text-1);
	text-align: left;
}

.msg-menu button:hover { background: color-mix(in srgb, var(--accent) 10%, transparent); filter: none; }
.msg-menu .icon { width: 24px; height: 24px; color: var(--muted); }
.menu-label { flex: 1; min-width: 0; }
.menu-check { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 22px; height: 22px; border: 2px solid var(--text-3); border-radius: var(--radius-check); }
.menu-check.is-checked { background: var(--accent); border-color: var(--accent); }
.msg-menu .menu-check .icon { color: var(--on-accent); width: 18px; height: 18px; }
.menu-separator { height: 1px; margin: 4px 0; background: var(--border); }
.msg-menu button:disabled { opacity: 0.45; cursor: default; }
.msg-menu button:disabled:hover { background: none; }

.select-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
	padding: 6px 4px 6px 12px;
	border-bottom: 1px solid var(--line);
	background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.select-bar span { flex: 1; }


.select-bar.is-topbar {
	margin: 4px 0 8px;
	padding: 0;
	gap: 8px;
	border-bottom: none;
	background: none;
	color: var(--accent);
	font-size: var(--fs-title);
	font-weight: var(--fw-medium);
}

.select-bar.is-topbar .icon-button { color: var(--accent); }

.msg.highlight { box-shadow: 0 0 0 3px color-mix(in srgb, var(--highlight) 55%, transparent); }
.msg { transition: box-shadow 240ms ease; }

.msg.selected { outline: 2px solid var(--accent); outline-offset: 2px; }

#chat-list { padding: 4px; }

@media (hover: none) {
	.msg { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
}

.msg-quote[data-reply-to] { cursor: pointer; }


.faq { border-top: 1px solid var(--line); }
.faq:first-of-type { border-top: none; }

.faq > summary {
	padding: 10px 0;
	cursor: pointer;
	font-weight: var(--fw-medium);
	list-style: none;
	display: flex;
	align-items: center;
	gap: 8px;
}

.faq > summary::-webkit-details-marker { display: none; }

.faq > summary::before {
	content: '';
	flex: none;
	width: 0;
	height: 0;
	border-left: 6px solid var(--accent);
	border-top: 4px solid transparent;
	border-bottom: 4px solid transparent;
	transition: transform 0.15s;
}

.faq[open] > summary::before { transform: rotate(90deg); }

.faq > p, .faq > ol, .faq > ul { margin: 0 0 10px; }
.faq > ol, .faq > ul { padding-left: 22px; }
.faq li { margin-bottom: 4px; }


.input-bar {
	display: flex;
	align-items: flex-end;
	gap: 6px;
	flex: none;
	padding: 8px 0 calc(4px + env(safe-area-inset-bottom));
	background: var(--bg);
}

.input-bar textarea {
	margin: 0;
	flex: 1;
	resize: none;
	overflow-y: auto;
}

.list-compose .icon-button.primary { background: var(--accent); color: var(--on-accent); border-radius: var(--radius-control); }
.list-compose .icon-button.primary:disabled { background: var(--surface-2); color: var(--text-3); opacity: 1; }

.input-bar textarea:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

.chat-compose-field { position: relative; display: flex; flex: 1; min-width: 0; }
.chat-compose-field textarea { width: 100%; padding-left: var(--tap-min); }
.chat-editor { width: 100%; min-width: 0; min-height: var(--tap-min); padding: 10px 12px 10px var(--tap-min); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--bg); color: var(--text-1); font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; overflow-y: auto; overflow-x: hidden; }
.chat-editor:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.chat-editor[data-empty="true"]::before { content: attr(data-placeholder); color: var(--text-3); pointer-events: none; }
.chat-editor .chat-emoji { user-select: all; }
.chat-emoji-menu { position: absolute; left: 0; top: 50%; transform: translateY(-50%); color: var(--text-2); }
.chat-emoji-menu:hover { color: var(--text-2); background: color-mix(in srgb, var(--text-1) 8%, transparent); }

.chat-compose > button[type="submit"] { color: var(--text-1); }
.chat-compose > button[type="submit"]:enabled:hover { color: var(--text-1); background: color-mix(in srgb, var(--text-1) 8%, transparent); }
.chat-compose > button[type="submit"]:disabled { color: var(--text-1); opacity: 0.38; }

.edit-bar {
	display: flex;
	align-items: center;
	gap: 6px;
	flex: none;
	padding: 6px 4px 6px 12px;
	background: color-mix(in srgb, var(--accent) 8%, var(--bg));
}

.edit-bar-body { flex: 1; min-width: 0; }

.attach-thumb {
	width: 40px;
	height: 40px;
	flex: none;
	object-fit: cover;
	border-radius: var(--radius-photo);
}
.edit-bar-title { display: block; font-size: var(--fs-counter); color: var(--accent); }

.edit-bar-text {
	display: block;
	font-size: var(--fs-hint);
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.msg-quote {
	margin-bottom: 5px;
	padding: 0 0 0 8px;
	border-left: 2px solid var(--accent);
	border-radius: 0;
	background: none;
}

.msg.own .msg-quote { border-left-color: var(--on-accent); }
.msg.own .msg-quote-author { color: var(--on-accent); opacity: 0.8; }

.msg-quote-author { display: block; font-size: var(--fs-caption); color: var(--accent); }

.msg-quote-text {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: var(--fs-hint);
	line-height: 1.8;
	color: var(--muted);
}

.msg.own .msg-quote-text { color: var(--on-accent); opacity: 0.85; }

h1 { font-size: var(--fs-title); font-weight: var(--fw-medium); margin: 0; }
h2 { font-size: var(--fs-item); font-weight: var(--fw-medium); margin: 0 0 8px; }
.lead { color: var(--text-2); margin: 8px 0 0; }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-caption); color: var(--text-3); }

.hero { padding: 24px 4px 8px; }

.features {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	color: var(--muted);
	font-size: var(--fs-body);
}

.features li { padding: 3px 0 3px 18px; position: relative; }
.features li::before { content: "·"; position: absolute; left: 6px; }

.card {
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: var(--radius-plate);
	padding: 16px;
	margin-bottom: var(--gap-plate);
}

.topbar {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: none;
	min-height: 64px;
	margin: 0 0 var(--gap-plate);
}

.topbar h1 {
	flex: 1;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.topbar-group {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	min-width: 0;
	padding: 0;
	background: none;
	border: none;
	border-radius: var(--radius-control);
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.topbar-actions { display: flex; gap: 2px; flex: none; }

@media (max-width: 359px) {
	#screen-list .topbar { gap: 4px; }
	#screen-list .topbar-actions { gap: 0; }
	#list-chip { display: none; }
}


.flat-section { margin-bottom: 12px; }
.flat-section > .section-label { margin: 20px 13px 6px; }
.section-hint { margin: 4px 13px; }
#settings-body, #group-body, #user-body { padding: 0 3px 16px; }
.flat-section > .row, #set-sessions > .row { padding-left: 13px; padding-right: 13px; }
#settings-body .row { border-bottom: none; }
#settings-body .settings-auth-row { min-height: 60px; }
#settings-body .settings-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
#settings-body .settings-block > .section-label { margin-top: 8px; }
#group-body .row { border-bottom: none; }
#group-body > .group-block + .group-block { border-top: 1px solid var(--border); padding-top: 12px; margin-top: 12px; }
.group-invitation { padding-top: 8px; }
.group-invitation-title { display: flex; align-items: center; gap: 12px; color: var(--accent); min-height: var(--tap-min); font-weight: var(--fw-medium); }
.invite-link-icon { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 29px; height: 29px; border: 1px solid currentColor; border-radius: 50%; }
.invite-link-icon .icon { width: 15px; height: 15px; }
.group-invitation-card { min-width: 0; border-radius: var(--radius-control); padding: 12px; background: var(--surface-1); color: var(--text-1); }
.group-invitation-card > p { margin: 0 0 8px; }
.group-invitation-link { display: flex; align-items: center; gap: 8px; min-width: 0; }
.group-invitation-link code { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: var(--text-2); font-family: inherit; font-size: var(--fs-hint); }
.group-invitation-link .icon-button { flex: none; color: var(--accent); }
.group-invitation-card #group-rotate { color: var(--danger); margin-top: 8px; }
.row { min-height: var(--tap-min); }
.row > .icon, .row-open > .icon { width: 17px; height: 17px; color: var(--text-2); }
.row-action-label { font-size: var(--fs-caption); }
.profile-row { padding: var(--pad-row-y) 13px; }
.profile-row .row-title { font-weight: var(--fw-medium); }
.profile-row > .icon { width: 16px; height: 16px; }
#group-icon-toggle { border-bottom: none; }

button.outlined {
	background: none;
	border: 1px solid var(--border);
	color: var(--accent);
}
.text-link { color: var(--accent); text-decoration: none; }
.field-label {
	display: block;
	font-size: var(--fs-caption);
	color: var(--text-3);
	margin: 8px 0 4px;
}
.user-section { border-top: 1px solid var(--border); margin-top: 20px; padding-top: 20px; }
.user-name { font-size: 24px; font-weight: 400; }
.user-section #user-alias-save {
	width: auto;
	padding: 10px 8px;
	background: none;
	border-color: transparent;
	color: var(--accent);
}
.user-section .title-with-icon { font-size: var(--fs-item); }
.user-section .title-with-icon .icon { width: 1em; height: 1em; }

.settings-switch {
	appearance: none;
	-webkit-appearance: none;
	position: relative;
	flex: none;
	width: 52px;
	height: 32px;
	margin: 0;
	border: 2px solid var(--border);
	border-radius: 16px;
	background: var(--surface-2);
	cursor: pointer;
}
.settings-switch::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	top: 6px;
	left: 6px;
	border-radius: 50%;
	background: var(--text-2);
	transition: transform 120ms ease;
}
.settings-switch:checked { background: var(--accent); border-color: var(--accent); }
.settings-switch:checked::before {
	width: 24px;
	height: 24px;
	top: 2px;
	left: 2px;
	transform: translateX(20px);
	background: var(--on-accent);
}
.settings-switch:disabled { opacity: 0.5; cursor: default; }

#screen-groups { position: relative; padding-bottom: 88px; }
.group-fab {
	position: fixed;
	right: max(calc((100vw - 680px) / 2 + 16px), 16px);
	bottom: calc(16px + env(safe-area-inset-bottom));
	width: 56px;
	height: 56px;
	padding: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	border: none;
	border-radius: 50%;
	background: var(--accent);
	color: var(--on-accent);
	z-index: 5;
}
.login-panel { max-width: 420px; margin: 24px auto; }
.login-panel .button { margin-bottom: 12px; }
.login-panel .small { margin-bottom: 20px; }
button.login-back { display: block; width: 100%; min-height: var(--tap-min); margin-top: 8px; text-align: center; }

body.has-modal { overflow: hidden; }
#modal-text { min-height: 0; overflow-y: auto; font-size: var(--fs-hint); }
.modal-actions { flex: none; }
.modal-actions .ghost, .modal-actions .button {
	background: none;
	border-color: transparent;
	color: var(--accent);
}
.modal.is-sheet { align-items: flex-end; padding: 0; }
.modal.is-sheet .modal-box {
	max-width: 680px;
	max-height: 85dvh;
	border-radius: var(--radius-sheet) var(--radius-sheet) 0 0;
	padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.modal.is-item-history #modal-title { margin: 0; }
.history-back { display: flex; align-items: center; gap: var(--gap-icon); width: 100%; min-height: var(--tap-min); padding: 10px 0; background: none; border: none; border-radius: 0; color: var(--text-1); font: inherit; font-size: var(--fs-title); text-align: left; }
.history-back .icon { width: 18px; height: 18px; color: var(--text-2); }
.history .row-title { font-size: var(--fs-hint); }
.modal.is-read-by #modal-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-title); border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 4px; }
.modal.is-read-by #modal-title .icon { width: 1em; height: 1em; }
.item-units { display: flex; flex-wrap: wrap; gap: 6px; margin-left: 8px; }
.item-unit {
	padding: 5px 8px;
	border: none;
	border-radius: var(--radius-qty);
	background: var(--surface-2);
	color: var(--text-2);
	font: inherit;
	font-size: var(--fs-counter);
}
.item-unit[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.item-quantity-viewport { overflow-x: auto; }
.item-quantity-controls { display: flex; align-items: center; justify-content: space-between; gap: 4px; min-width: 352px; }
.item-stepper { display: flex; align-items: center; flex: none; border: 1px solid var(--border); border-radius: var(--radius-control); }
.item-stepper:focus-within { border-color: var(--accent); }
.modal.is-item-card .item-stepper .icon-button { width: 48px; height: 48px; padding: 0; flex: none; }
.modal.is-item-card #item-basics { display: flex; flex-direction: column; gap: var(--item-property-gap); }
.modal.is-item-card .modal-box { max-width: 640px; max-height: calc(100dvh - 32px); border: none; padding: var(--item-property-gap); padding-bottom: calc(var(--item-property-gap) + env(safe-area-inset-bottom)); }
.modal.is-item-card .modal-box::before { content: ''; align-self: center; flex: none; width: 32px; height: 4px; border-radius: var(--radius-qty); background: var(--border); margin: 6px 0 22px; }
.modal.is-item-card #modal-text { scrollbar-width: none; }
.modal.is-item-card #modal-text::-webkit-scrollbar { display: none; }
.modal.is-item-card .item-field { display: block; position: relative; margin: 4px 0 0; }
.modal.is-item-card .item-field .field-label { position: absolute; top: -9px; left: 10px; padding: 0 4px; margin: 0; background: var(--surface-1); font-size: var(--fs-caption); }
.modal.is-item-card .item-field input, .modal.is-item-card .item-field textarea { margin: 0; background: var(--surface-1); font-size: var(--fs-body); }
.modal.is-item-card .item-field input { min-height: 56px; }
.modal.is-item-card .item-field textarea { min-height: 64px; }
.modal.is-item-card .picker-label { display: block; margin: 0 0 var(--item-property-label-gap); font-size: var(--fs-caption); color: var(--text-2); }
.modal.is-item-card input.stepper-value { flex: 0 0 46px; width: 46px; min-height: 48px; margin: 0; padding: 0; text-align: center; font-size: var(--fs-body); background: transparent; border: none; border-radius: 0; box-shadow: none; }
.modal.is-item-card .item-units { margin-left: 0; gap: 4px; flex-wrap: nowrap; flex: none; }
.modal.is-item-card .item-unit { width: 48px; height: 48px; min-width: 48px; padding: 0; font-size: var(--fs-caption); }
.modal.is-item-card .schedule-rows { margin: 0; }
.modal.is-item-card .schedule-row { border: none; margin: 0; padding: 0; gap: 10px; font-size: var(--fs-hint); }
.modal.is-item-card .schedule-row > span { display: flex; align-items: center; gap: 10px; }
.modal.is-item-card .schedule-row > span > span:first-child { flex: 1; }
.modal.is-item-card .schedule-row .schedule-value { max-width: 140px; color: var(--text-3); font-size: var(--fs-counter); text-align: right; }
.modal.is-item-card .item-link-details { border: 1px solid var(--border); border-radius: var(--radius-control); padding: 0 12px; }
.item-link-details summary { display: flex; align-items: center; gap: 10px; min-height: 56px; color: var(--accent); cursor: pointer; list-style: none; }
.item-link-details summary::-webkit-details-marker { display: none; }
.item-link-details summary.has-link { color: var(--text-2); }
.item-link-copy { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 2px; }
.item-link-copy > span:first-child { font-size: var(--fs-caption); color: var(--text-3); }
.item-link-copy > span:last-child { font-size: var(--fs-counter); color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-link-details summary.has-link > .icon:last-child { width: 18px; height: 18px; color: var(--accent); }
.item-link-details .product-link-editor-preview .product-link { display: none; }
.item-link-details[open] #item-link-editor { padding-bottom: 12px; }
.item-photo { display: flex; align-items: center; gap: var(--item-property-gap); }
.item-photo-image { flex: none; width: var(--item-photo-width); height: var(--item-photo-height); padding: 0; display: grid; place-items: center; overflow: hidden; background: var(--surface-2); color: var(--accent); border: 1px solid var(--border); border-radius: var(--radius-photo); }
.item-photo-image.is-empty { border-style: dashed; }
.item-photo-image img { width: 100%; height: 100%; object-fit: contain; }
.item-photo-image > .icon { width: 30px; height: 30px; }
.item-photo-copy { min-width: 0; display: flex; flex-direction: column; align-items: start; gap: var(--item-property-label-gap); }
.item-photo-title { font-size: var(--fs-item); font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.item-photo-hint, .item-photo-source { font-size: var(--fs-caption); color: var(--text-3); }
.item-photo-action { min-height: var(--tap-min); padding: 0; color: var(--accent); font-size: var(--fs-button); }
.modal.is-item-card button.item-photo-action { width: auto; padding: 0; border: none; background: transparent; color: var(--accent); }
.modal.is-item-card #item-history { justify-content: flex-start; gap: 10px; min-height: 48px; padding: 0; border: none; background: transparent; color: var(--accent); }
.modal.is-item-card #item-history .icon { width: 18px; height: 18px; margin: 1px; }
.modal.is-item-card #item-history span { flex: 1; text-align: left; }
.modal.is-item-card .modal-actions > button {
	flex: none;
	padding: 10px;
	border: none;
	border-radius: var(--radius-control);
	background: transparent;
	color: var(--accent);
}
.modal.is-item-card #item-delete { color: var(--danger); margin-right: auto; padding-left: 0; }
.modal.is-item-card #modal-ok { background: var(--accent); color: var(--on-accent); }
.modal.is-item-card:not(.is-changed) #modal-ok { background: transparent; color: var(--accent); }
.modal.is-add-item #modal-ok { min-height: var(--tap-min); background: var(--accent); color: var(--on-accent); }
@media (prefers-reduced-motion: reduce) {
	.settings-switch::before { transition: none; }
}


input[type="text"], input[type="email"], input[type="password"], input[type="search"], input[type="url"],
.product-link-form-row input, .product-link-form-row select, #browser-import-group {
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 1px solid var(--line);
	border-radius: var(--radius-control);
	background: var(--bg);
	color: var(--text);
	font: inherit;
}

input[type="url"], .product-link-form-row input, .product-link-form-row select, #browser-import-group { min-height: var(--tap-min); }

.browser-import-add { display: flex; align-items: center; gap: 8px; min-height: var(--tap-min); color: var(--text-1); }
.browser-import-add input { flex: none; width: 20px; height: 20px; accent-color: var(--accent); }
#browser-import-group:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }

input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }

button {
	font: inherit;
	font-size: var(--fs-button);
	font-weight: var(--fw-medium);
	padding: 12px 16px;
	border: 1px solid transparent;
	border-radius: var(--radius-control);
	background: var(--accent);
	color: var(--accent-text);
	cursor: pointer;
}

button:hover { filter: brightness(1.05); }
button:disabled { opacity: 0.5; cursor: default; filter: none; }

.button { display: inline-block; width: 100%; text-align: center; text-decoration: none; }
a.button { padding: 12px 16px; }

#download-link { display: inline-flex; align-items: center; justify-content: center; gap: 10px; }


.app-mark {
	width: 22px;
	height: 22px;
	flex: none;
	border-radius: 4px;
	box-shadow: 0 0 0 2px var(--accent-text);
}

button.ghost {
	width: auto;
	background: transparent;
	color: var(--text);
	border-color: var(--line);
	padding: 9px 12px;
}


button.danger { background: var(--danger); color: var(--on-danger); }

button.link {
	width: auto;
	background: none;
	border: none;
	color: var(--accent);
	padding: 4px 0;
}

button.small { width: auto; padding: 7px 10px; }

.with-button { display: flex; gap: 8px; align-items: start; }
.with-button input { flex: 1; }
.row-links { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; }

.divider {
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 12px 0;
	color: var(--muted);
	font-size: var(--fs-hint);
}

.divider::before, .divider::after {
	content: "";
	flex: 1;
	height: 1px;
	background: var(--line);
}

.error {
	background: var(--danger);
	color: var(--on-danger);
	padding: 12px 14px;
	border-radius: var(--radius-plate);
	margin: 0 0 16px;
}


.copy-preview {
	margin: 8px 0;
	padding-left: 18px;
	color: var(--muted);
	font-size: var(--fs-body);
}

.member-row {
	display: block;
	width: 100%;
	padding: 10px 0;
	background: none;
	border: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.member-row:hover { color: var(--accent); }

.group-muted {
	display: inline-flex;
	flex: none;
	color: var(--text-3);
}

.group-muted .icon { width: 13px; height: 13px; }


.badge {
	display: inline-block;
	padding: 1px 8px;
	border-radius: 999px;
	font-size: var(--fs-counter);
	border: 1px solid var(--line);
	color: var(--muted);
}



.empty { color: var(--muted); padding: 16px 4px; }


.tabs {
	display: flex;
	gap: var(--gap-plate);
	margin-bottom: var(--gap-plate);
	flex: none;
}

.tab {
	flex: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: var(--tap-min);
	background: var(--surface-1);
	border: none;
	border-bottom: 2px solid transparent;
	border-radius: var(--radius-control);
	color: var(--text-2);
	font: inherit;
	font-size: var(--fs-counter);
	padding: 8px;
	cursor: pointer;
}

.tab-icon { display: block; line-height: 0; }
.tab .icon { width: 16px; height: 16px; }

.tab.is-active {
	background: color-mix(in srgb, var(--accent) 14%, var(--surface-1));
	border-bottom-color: var(--accent);
	color: var(--accent);
	font-weight: var(--fw-medium);
}

.list-tabs { padding: 3px; gap: 0; border-radius: var(--radius-control); background: var(--surface-2); }
.list-tabs .tab { border: 0; background: transparent; font-size: var(--fs-button); }
.list-tabs .tab.is-active { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.list-tabs .dot { margin-left: 0; padding: 2px 6px; border-radius: var(--radius-qty); background: var(--accent); color: var(--on-accent); font-size: var(--fs-counter); }
.list-tabs .dot.is-muted { background: var(--surface-1); color: var(--text-3); }

.dot {
	display: inline-block;
	margin-left: 6px;
	background: none;
	color: var(--accent);
	font-size: var(--fs-caption);
	font-weight: var(--fw-medium);
	font-variant-numeric: tabular-nums;
}

.dot.is-muted {
	background: none;
	color: var(--text-3);
}



.msg {
	background: var(--surface-2);
	border: none;
	border-radius: var(--radius-plate) var(--radius-plate) var(--radius-plate) var(--radius-bubble-tail);
	padding: var(--pad-plate-y) 11px;
	margin-bottom: var(--gap-plate);
	max-width: min(85%, 300px);
	width: fit-content;
	word-break: break-word;
}

.msg.own {
	margin-left: auto;
	background: var(--accent);
	color: var(--on-accent);
	border-radius: var(--radius-plate) var(--radius-plate) var(--radius-bubble-tail) var(--radius-plate);
}

.msg-author { color: var(--accent); font-size: var(--fs-caption); margin-bottom: 2px; }
.msg-text { white-space: pre-wrap; }
.chat-product { display: grid; gap: 8px; margin-top: 8px; min-width: 0; }
.chat-product .product-link { margin: 0; }
.chat-product-add { justify-self: start; display: inline-flex; align-items: center; gap: 6px; }
.chat-product-add svg { width: 18px; height: 18px; }

.msg-text a { color: inherit; text-decoration: underline; overflow-wrap: anywhere; }

.msg-code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	background: color-mix(in srgb, currentColor 15%, transparent);
	border-radius: var(--radius-code);
	padding: 0 3px;
	cursor: pointer;
	overflow-wrap: anywhere;
}
.msg-meta { color: var(--text-3); font-size: var(--fs-counter); margin-top: 4px; text-align: right; }
.msg.own .msg-meta { color: var(--on-accent); opacity: 0.75; }
.msg-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 6px; }
.msg-actions button { width: auto; }

#chat-older { margin-bottom: 12px; }

.msg.has-photo { width: min(85%, 300px); }

.msg-photo-frame {
	width: 100%;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	border-radius: var(--radius-photo);
	background: var(--surface-2);
	margin-bottom: 6px;
}

.msg-photo {
	display: block;
	width: 100%;
	max-width: 320px;
	height: auto;
	border-radius: var(--radius-photo);
	background: var(--surface-2);
	margin-bottom: 6px;
}

.msg-photo { cursor: pointer; }

.chat-emoji {
	--emoji-height: 1.6em;
	--emoji-max-width: 4em;
	display: inline-block;
	position: relative;
	overflow: hidden;
	width: min(var(--emoji-max-width), calc(var(--emoji-height) * var(--emoji-ratio, 1.5)));
	height: var(--emoji-height);
	vertical-align: middle;
	background-size: contain;
	background-position: center;
	background-repeat: no-repeat;
}
.chat-emoji > span { opacity: 0; }
.emoji-palette { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); width: min(304px, calc(100vw - 32px)); max-height: min(240px, 40dvh); overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain; padding: 4px; }
.emoji-choice .chat-emoji { max-width: 100%; flex-shrink: 0; }
.msg-menu .emoji-choice { min-width: 0; width: 100%; height: 48px; padding: 4px 2px; justify-content: center; font-size: var(--fs-body); }
.msg-reactions { display: flex; flex-wrap: wrap; gap: 4px; }
.msg-reactions:not(:empty) { margin-top: 6px; }
.reaction-chip {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 2px;
	min-width: 0;
	height: 24px;
	min-height: 24px;
	padding: 0 4px;
	border: none;
	border-radius: var(--radius-control);
	background: var(--surface-2);
	color: var(--text-2);
	font-size: 12px;
	line-height: 1;
}
.reaction-chip.is-mine { color: var(--accent); background: color-mix(in srgb, var(--accent) 18%, var(--surface-1)); }
.reaction-chip::before { content: ''; position: absolute; inset: -12px -6px; }
.reaction-chip .chat-emoji { --emoji-height: 20px; --emoji-max-width: 48px; }
.msg-quote-text .chat-emoji, .edit-bar-text .chat-emoji { --emoji-height: 1.5em; --emoji-max-width: 3.7em; }
.edit-bar-text { line-height: 1.8; }
.reacted-group { display: flex; align-items: center; gap: 8px; margin-block: 12px; }
.reacted-group .chat-emoji { --emoji-height: 32px; --emoji-max-width: 80px; flex-shrink: 0; }

.msg-photo-frame > .msg-photo {
	max-width: none;
	height: 100%;
	object-fit: contain;
	margin-bottom: 0;
}

.msg-sending { position: relative; }
.msg-sending .msg-photo { opacity: 0.55; cursor: default; }

.spinner {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 28px;
	height: 28px;
	margin: -14px 0 0 -14px;
	border: 3px solid var(--line);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: spin 0.9s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

@media (prefers-reduced-motion: reduce) {
	.spinner { animation: none; }
}

.msg-photo-gone {
	color: var(--muted);
	font-size: var(--fs-hint);
	font-style: italic;
	margin-bottom: 6px;
}


.event-plate {
	width: fit-content;
	max-width: 42ch;
	margin: 0 auto var(--gap-plate);
	padding: 4px 9px;
	background: var(--surface-1);
	border-radius: var(--radius-chip);
	font-size: var(--fs-caption);
	color: var(--text-3);
	text-align: center;
}


.photo-viewer {
	position: fixed;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	max-height: none;
	margin: 0;
	padding: 0;
	border: none;
	background: var(--photo-viewer-bg);
	color: var(--photo-viewer-content);
	overflow: hidden;
}

.photo-viewer[open] { display: grid; place-items: center; }
.photo-viewer::backdrop { background: var(--photo-viewer-bg); }

.photo-viewer img {
	width: 100%;
	height: 100%;
	min-height: 0;
	object-fit: contain;
}

.photo-viewer .photo-viewer-close {
	position: absolute;
	top: calc(12px + env(safe-area-inset-top));
	right: calc(12px + env(safe-area-inset-right));
	color: inherit;
}


.modal {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	z-index: 10;
}

.modal-box {
	display: flex;
	flex-direction: column;
	max-height: calc(100dvh - 32px);
	background: var(--surface-1);
	border: 1px solid var(--border);
	border-radius: var(--radius-dialog);
	padding: 24px;
	width: 100%;
	max-width: 460px;
}

.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.modal-actions button { width: auto; }
.modal-box code { word-break: break-all; font-size: var(--fs-body); }

.discard-dialog { width: min(360px, calc(100% - 32px)); max-height: calc(100dvh - 32px); overflow-y: auto; border: none; border-radius: var(--radius-dialog); padding: 24px; background: var(--surface-1); color: var(--text-1); font: inherit; font-size: var(--fs-hint); }
.discard-dialog::backdrop { background: rgba(0, 0, 0, 0.45); }
.discard-dialog > p { margin: 0 0 20px; }
.discard-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.discard-actions > button { width: auto; min-height: var(--tap-min); border-color: transparent; color: var(--accent); }

.toast {
	position: fixed;
	left: 50%;
	bottom: calc(24px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	background: var(--text-1);
	color: var(--bg);
	padding: 12px 18px;
	border-radius: var(--radius-control);
	z-index: 20;
	max-width: calc(100% - 32px);
}

.toast .link {
	color: var(--bg);
	font-weight: var(--fw-medium);
	text-decoration: underline;
	padding: 0;
}

.title-with-icon { display: flex; align-items: center; gap: 8px; }

.title-icon { flex: none; display: inline-flex; }
.title-icon .icon { width: 26px; height: 26px; color: var(--text-1); }

.msg-menu button.is-danger { color: var(--danger); }
.msg-menu button.is-danger .icon { color: var(--danger); }
