/* Погреб — dark app shell, paper-colored cards. Tokens from the approved mockups. */

:root {
	--bg: #0F0E0D;
	--text: #F3EFE8;
	--muted: #A8A29A;
	--soft: #CFC9C1;
	--line: #3A3632;
	--field: #1C1A18;
	--paper: #F4EFE6;
	--ink: #1E1B18;
	--ink-muted: #6B645B;
	--ink-soft: #5C554D;
	--paper-line: #DDD4C6;
	--gold: #D4B37A;
	--err: #E39A8A;
	--err-ink: #9A3B2A;
	--serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
	--sans: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
	--safe-top: env(safe-area-inset-top, 0px);
	--safe-bottom: env(safe-area-inset-bottom, 0px);
	color-scheme: dark;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	background: var(--bg);
	color: var(--text);
	font-family: var(--sans);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
	text-size-adjust: 100%;
}

button,
input {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
	touch-action: manipulation;
}

button:disabled {
	cursor: default;
	opacity: 0.45;
}

a {
	color: var(--gold);
}

:focus-visible {
	outline: 2px solid var(--gold);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

.ico {
	display: inline-grid;
	place-items: center;
	width: 22px;
	height: 22px;
}

.ico svg {
	width: 100%;
	height: 100%;
}

/* ---- shell ---------------------------------------------------------------------------------- */

.screen {
	min-height: 100dvh;
	display: flex;
	flex-direction: column;
	padding-top: var(--safe-top);
}

.screen-feed {
	height: 100dvh;
	overflow: hidden;
}

.top {
	height: 64px;
	flex: none;
	padding: 8px 8px 0 20px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	position: relative;
}

.top-left {
	justify-content: flex-start;
	gap: 4px;
	padding-left: 8px;
	padding-right: 16px;
}

.brand {
	margin: 0;
	font-family: var(--serif);
	font-weight: 600;
	font-size: 30px;
	letter-spacing: 0.2px;
}

.screen-title {
	margin: 0;
	font-family: var(--serif);
	font-weight: 600;
	font-size: 26px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.top-actions {
	display: flex;
	gap: 4px;
	position: relative;
}

.icon-btn {
	width: 44px;
	height: 44px;
	flex: none;
	display: grid;
	place-items: center;
	border: 0;
	border-radius: 12px;
	background: transparent;
	color: inherit;
	padding: 0;
}

.icon-btn:active {
	background: rgba(243, 239, 232, 0.08);
}

.menu {
	position: absolute;
	top: 48px;
	right: 0;
	z-index: 20;
	min-width: 200px;
	padding: 12px 6px 6px;
	border-radius: 14px;
	background: #24211E;
	border: 1px solid var(--line);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.menu-who {
	padding: 0 10px;
	font-weight: 600;
	font-size: 15px;
}

.menu-login {
	padding: 2px 10px 10px;
	font-size: 13px;
	color: var(--muted);
}

.menu-item {
	display: block;
	width: 100%;
	height: 44px;
	padding: 0 10px;
	border: 0;
	border-top: 1px solid var(--line);
	background: transparent;
	text-align: left;
	font-size: 15px;
}

.chips {
	flex: none;
	display: flex;
	gap: 8px;
	padding: 0 20px 14px;
	align-items: center;
	overflow-x: auto;
	scrollbar-width: none;
}

.chip {
	flex: none;
	height: 32px;
	padding: 0 14px;
	border-radius: 16px;
	border: 1px solid var(--line);
	background: transparent;
	color: var(--soft);
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.chip.active {
	border-color: var(--text);
	background: var(--text);
	color: var(--bg);
	font-weight: 600;
}

.chip-sm {
	height: 34px;
	border-radius: 17px;
	padding: 0 12px;
}

.upload-pill {
	flex: none;
	margin-left: auto;
	height: 32px;
	padding: 0 12px;
	border-radius: 16px;
	border: 0;
	background: rgba(212, 179, 122, 0.16);
	color: var(--gold);
	font-size: 13px;
	font-weight: 600;
	white-space: nowrap;
}

.content {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	container-type: size;
}

.content.feed-mode {
	scroll-snap-type: y mandatory;
}

/* ---- feed ----------------------------------------------------------------------------------- */

.feed {
	--cap-h: 104px;
	--bottom-h: 28px; /* air under the caption */
}

.slide {
	height: 100cqh;
	scroll-snap-align: start;
	scroll-snap-stop: always;
	padding: 0 16px calc(var(--bottom-h) + var(--safe-bottom));
	display: flex;
	flex-direction: column;
	align-items: center;
}

.card {
	position: relative;
	width: min(100%, calc((100cqh - var(--cap-h) - var(--bottom-h) - var(--safe-bottom)) * 2 / 3));
	aspect-ratio: 2 / 3;
	flex: none;
}

.cap {
	width: min(100%, calc((100cqh - var(--cap-h) - var(--bottom-h) - var(--safe-bottom)) * 2 / 3));
	padding: 12px 2px 0;
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	gap: 12px;
}

.cap-text {
	min-width: 0;
}

.cap-title {
	font-family: var(--serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.1;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cap-line2 {
	font-family: var(--serif);
	font-style: italic;
	font-size: 19px;
	color: #DCD5CB;
	margin-top: 2px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cap-line3 {
	font-size: 13px;
	color: var(--muted);
	margin-top: 5px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.cap-count {
	flex: none;
	padding: 6px 10px;
	border-radius: 10px;
	border: 1px solid var(--line);
	font-size: 13px;
	color: var(--soft);
	white-space: nowrap;
}

.face {
	position: absolute;
	inset: 0;
	border-radius: 18px;
	overflow: hidden;
	background: var(--paper);
}

.front {
	cursor: pointer;
}

.front img,
.tile-img img,
.check-img img,
.photo-box img {
	width: 100%;
	height: 100%;
	display: block;
}

.img-label {
	object-fit: contain;
}

.img-photo {
	object-fit: cover;
}

.is-drunk .front img,
.tile.is-drunk img {
	filter: grayscale(1) opacity(0.55);
	transition: filter 0.4s;
}

.badge {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 6px 10px;
	border-radius: 10px;
	background: var(--bg);
	color: var(--text);
	font-size: 12px;
	font-weight: 600;
}

.plaques {
	position: absolute;
	left: 12px;
	right: 12px;
	bottom: 12px;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
}

.plaque {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	max-width: 100%;
	padding: 7px 10px;
	border-radius: 10px;
	background: rgba(15, 14, 13, 0.82);
	color: var(--text);
	font-size: 12.5px;
	font-weight: 500;
}

.plaque-error {
	background: rgba(60, 20, 14, 0.9);
}

.plaque-text {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.plaque-btn {
	flex: none;
	height: 28px;
	padding: 0 10px;
	border: 0;
	border-radius: 8px;
	background: var(--text);
	color: var(--bg);
	font-size: 12.5px;
	font-weight: 600;
}

/* ---- bottle screen (full width; replaced the flipped card) --------------------------------------- */

.screen-bottle {
	height: 100dvh;
	overflow: hidden;
	background: var(--paper);
	color: var(--ink);
}

.screen-bottle a {
	color: #7A4E1E;
}

.bottle-top {
	height: 56px;
	flex: none;
	padding: 6px 8px 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
}

.bottle-top .icon-btn {
	color: var(--ink);
}

.bottle-top .icon-btn:active {
	background: rgba(30, 27, 24, 0.08);
}

.bottle-scroll {
	flex: 1;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 4px 20px 28px;
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.bottle-head {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.bottle-thumb {
	flex: none;
	width: 88px;
	height: 132px;
	border-radius: 8px;
	background: #EAE2D4;
	box-shadow: 0 4px 14px rgba(30, 27, 24, 0.18);
}

.bottle-thumb.is-drunk {
	filter: grayscale(1) opacity(0.7);
}

.bottle-titles {
	flex: 1;
	min-width: 0;
	padding-top: 2px;
}

.bottle-title {
	margin: 0 0 6px;
	font-family: var(--serif);
	font-size: 30px;
	font-weight: 600;
	line-height: 1.05;
	overflow-wrap: anywhere;
}

.bottle-sub {
	font-size: 14px;
	line-height: 1.4;
	color: var(--ink-soft);
}

.bottle-tags {
	margin-top: 10px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.tag {
	height: 26px;
	padding: 0 10px;
	border-radius: 13px;
	background: #EAE2D4;
	display: inline-flex;
	align-items: center;
	font-size: 12.5px;
	color: var(--ink-soft);
}

.note-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
}

.screen-bottle .about {
	font-size: 15.5px;
	line-height: 1.5;
}

.facts-box {
	border-top: 1px solid var(--paper-line);
	padding-top: 16px;
	display: flex;
	flex-direction: column;
	gap: 14px;
}

.facts-short {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 16px;
}

.fact-k {
	font-size: 12.5px;
	color: var(--ink-muted);
}

.fact-v {
	margin-top: 3px;
	font-size: 15px;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

.fact-v.muted {
	font-style: italic;
}

.screen-bottle .scores,
.screen-bottle .mine,
.screen-bottle .refresh {
	padding-top: 16px;
}

.sec-row {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.screen-bottle .sec-title {
	margin: 0;
}

.sec-count {
	font-size: 12.5px;
	color: var(--ink-muted);
}

.screen-bottle .score {
	min-height: 44px;
	font-size: 15px;
}

.screen-bottle .score-val {
	font-size: 16px;
}

.screen-bottle .scores .review-text,
.screen-bottle .mine-text {
	font-size: 15px;
	line-height: 1.5;
}

.screen-bottle .btn-outline-dark {
	height: 40px;
	padding: 0 14px;
	font-size: 14px;
}

.screen-bottle .sources {
	font-size: 14px;
}

.bottle-delete {
	border-top: 1px solid var(--paper-line);
	padding-top: 8px;
}

.screen-bottle .btn-danger {
	color: var(--err-ink);
	align-self: flex-start;
	padding-left: 0;
}

.delete-q {
	margin: 8px 0 10px;
	font-size: 14.5px;
	line-height: 1.45;
}

.delete-row {
	display: flex;
	gap: 10px;
}

.btn-danger-solid {
	height: 40px;
	padding: 0 16px;
	border: 0;
	border-radius: 10px;
	background: var(--err-ink);
	color: var(--paper);
	font-size: 14px;
	font-weight: 600;
}

.btn-danger-solid:disabled {
	opacity: 0.6;
}

.bottle-actions {
	flex: none;
	display: flex;
	gap: 10px;
	padding: 10px 16px calc(14px + var(--safe-bottom));
	border-top: 1px solid var(--paper-line);
	background: var(--paper);
}

.bottle-actions .stepper-light {
	height: 48px;
	border-radius: 14px;
}

.bottle-actions .btn-dark {
	height: 48px;
	border-radius: 14px;
	font-size: 15px;
}

.note {
	margin: 0;
	padding: 8px 10px;
	border-radius: 10px;
	background: #EAE2D4;
	font-size: 12.5px;
	line-height: 1.4;
	color: var(--ink-soft);
}

.muted {
	color: var(--ink-muted);
}

.scores {
	border-top: 1px solid var(--paper-line);
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.scores p {
	margin: 0;
	font-size: 13.5px;
}

.sec-title {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.6px;
	text-transform: uppercase;
	color: var(--ink-muted);
}

.sec-title-dark {
	font-size: 11.5px;
	color: var(--muted);
}

.score-group {
	margin-top: 4px;
	font-size: 12px;
	color: var(--ink-muted);
}

.score {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	min-height: 32px;
	align-items: center;
	font-size: 14px;
	color: var(--ink) !important;
	text-decoration: none;
	border-bottom: 1px dashed var(--paper-line);
}

.score-who {
	min-width: 0;
}

.score-year {
	color: var(--ink-muted);
	font-size: 12.5px;
}

.score-val {
	flex: none;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.err {
	color: var(--err-ink);
}

.about {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
}

.mine {
	border-top: 1px solid var(--paper-line);
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mine-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}

.review {
	display: block;
	padding: 6px 0 8px;
	color: var(--ink) !important;
	text-decoration: none;
	border-bottom: 1px dashed var(--paper-line);
}

.scores .review-text {
	font-size: 13.5px;
	line-height: 1.45;
}

.review-who {
	margin-top: 3px;
	font-size: 12.5px;
	color: var(--ink-muted);
}

.sources {
	font-size: 13px;
}

.refresh {
	border-top: 1px solid var(--paper-line);
	padding-top: 12px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.refresh-hint {
	margin: 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ink-muted);
}

.sources summary {
	cursor: pointer;
	color: #7A4E1E;
	min-height: 32px;
	display: flex;
	align-items: center;
}

.sources ul {
	margin: 4px 0 0;
	padding-left: 18px;
	display: flex;
	flex-direction: column;
	gap: 6px;
	overflow-wrap: anywhere;
}

.grow {
	flex: 1;
}

.btn-dark {
	height: 44px;
	border: 0;
	border-radius: 12px;
	background: var(--ink);
	color: var(--paper);
	font-size: 14px;
	font-weight: 600;
}

.btn-outline-dark {
	align-self: flex-start;
	height: 36px;
	padding: 0 12px;
	border: 1px solid #CFC5B6;
	border-radius: 10px;
	background: transparent;
	color: var(--ink);
	font-size: 13px;
}

.stepper {
	flex: none;
	display: flex;
	align-items: center;
	height: 52px;
	border: 1px solid var(--line);
	border-radius: 14px;
}

.stepper button {
	width: 44px;
	height: 100%;
	border: 0;
	background: transparent;
	font-size: 22px;
}

.stepper-val {
	min-width: 52px;
	text-align: center;
	font-size: 15px;
	font-weight: 600;
	white-space: nowrap;
}

.stepper-light {
	height: 44px;
	border-color: #CFC5B6;
	border-radius: 12px;
}

.stepper-light button {
	width: 36px;
	color: var(--ink);
}

.stepper-light .stepper-val {
	min-width: 44px;
	font-size: 13.5px;
}

/* ---- grid ----------------------------------------------------------------------------------- */

.grid {
	padding: 0 16px calc(32px + var(--safe-bottom));
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	column-gap: 10px;
	row-gap: 14px;
}

.grid-3 {
	grid-template-columns: repeat(3, minmax(0, 1fr));
	column-gap: 8px;
	row-gap: 12px;
	padding-bottom: calc(32px + var(--safe-bottom));
}

.tile {
	display: flex;
	flex-direction: column;
	gap: 6px;
	padding: 0;
	border: 0;
	background: transparent;
	text-align: left;
	min-width: 0;
}

.tile-img {
	position: relative;
	display: block;
	aspect-ratio: 2 / 3;
	border-radius: 14px;
	overflow: hidden;
	background: var(--paper);
}

.tile-sm .tile-img {
	border-radius: 10px;
}

.tile-name {
	padding: 0 2px;
	font-family: var(--serif);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.15;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tile-sm .tile-name {
	font-family: var(--sans);
	font-size: 12px;
	font-weight: 400;
	line-height: 1.25;
}

.tile.is-drunk .tile-name {
	color: var(--muted);
}

.tile-meta {
	padding: 0 2px;
	margin-top: -4px;
	font-size: 12px;
	color: var(--muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.tile-dot {
	position: absolute;
	right: 8px;
	bottom: 8px;
	width: 26px;
	height: 26px;
	border-radius: 13px;
	display: grid;
	place-items: center;
	background: rgba(15, 14, 13, 0.8);
	color: var(--text);
	font-size: 13px;
	font-weight: 700;
}

.tile-dot-err {
	background: #8A2E1E;
}

/* ---- empty / spinner / toast ---------------------------------------------------------------- */

.empty {
	min-height: 70cqh;
	padding: 40px 32px 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	gap: 10px;
}

.empty-title {
	margin: 0;
	font-family: var(--serif);
	font-size: 28px;
	font-weight: 600;
}

.empty-text {
	margin: 0 0 12px;
	color: var(--muted);
	font-size: 14px;
	line-height: 1.45;
	max-width: 300px;
}

.results .empty-text {
	padding: 24px 20px;
	max-width: none;
}

.spinner {
	display: inline-block;
	flex: none;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	border: 2px solid rgba(243, 239, 232, 0.25);
	border-top-color: var(--text);
	animation: spin 0.9s linear infinite;
	vertical-align: -2px;
}

.spinner-dark {
	border-color: rgba(30, 27, 24, 0.2);
	border-top-color: var(--ink);
}

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

#toast {
	position: fixed;
	left: 50%;
	bottom: calc(28px + var(--safe-bottom));
	z-index: 50;
	transform: translate(-50%, 16px);
	max-width: calc(100vw - 32px);
	padding: 10px 16px;
	border-radius: 12px;
	background: #2A2724;
	color: var(--text);
	font-size: 14px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s, transform 0.2s;
}

#toast.show {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---- buttons / forms ------------------------------------------------------------------------ */

.btn-primary {
	height: 52px;
	padding: 0 20px;
	border: 0;
	border-radius: 14px;
	background: var(--text);
	color: var(--bg);
	font-size: 15px;
	font-weight: 600;
}

.btn-outline {
	align-self: flex-start;
	height: 36px;
	padding: 0 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: transparent;
	font-size: 13px;
}

.btn-link {
	height: 44px;
	padding: 0 8px;
	border: 0;
	background: transparent;
	color: var(--soft);
	font-size: 14px;
}

.btn-gold {
	color: var(--gold);
	font-size: 13px;
	height: 32px;
}

.btn-danger {
	color: var(--err);
	align-self: center;
}

.field {
	display: flex;
	flex-direction: column;
	gap: 4px;
	background: var(--field);
	border-radius: 12px;
	padding: 8px 12px;
}

.field-label {
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	color: var(--muted);
}

.field-input {
	border: 0;
	outline: none;
	background: transparent;
	color: var(--text);
	font-size: 16px;
	height: 26px;
	padding: 0;
	min-width: 0;
}

.field-input::placeholder {
	color: #8F8981;
}

.field-input:disabled {
	opacity: 0.6;
}

.field:focus-within {
	box-shadow: inset 0 0 0 1px var(--gold);
}

.field-hint {
	font-size: 12px;
	color: #8F8981;
}

.form-error {
	margin: 0;
	min-height: 0;
	color: var(--err);
	font-size: 14px;
}

.form-error:empty {
	display: none;
}

/* ---- auth ----------------------------------------------------------------------------------- */

.auth {
	min-height: 100dvh;
	padding: calc(48px + var(--safe-top)) 24px calc(24px + var(--safe-bottom));
	max-width: 420px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.auth-head {
	padding-top: 6vh;
}

.brand-big {
	font-size: 52px;
	line-height: 1;
}

.auth-sub {
	margin: 10px 0 0;
	color: var(--muted);
	font-size: 15px;
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.auth-form .btn-primary {
	margin-top: 8px;
}

.auth .btn-link {
	align-self: center;
}

/* ---- add / processing ----------------------------------------------------------------------- */

.screen-add .top,
.screen-check .top {
	padding-right: 8px;
}

.thumbs {
	display: flex;
	gap: 8px;
	padding: 0 16px 12px;
	overflow-x: auto;
	scrollbar-width: none;
}

.thumb {
	position: relative;
	flex: none;
	width: 44px;
	height: 60px;
	padding: 0;
	border: 2px solid transparent;
	border-radius: 9px;
	overflow: hidden;
	background: var(--field);
}

.thumb.active {
	border-color: var(--text);
}

.thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.thumb-dot {
	position: absolute;
	right: 3px;
	bottom: 3px;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	border: 1.5px solid var(--bg);
}

.dot-busy {
	background: var(--gold);
}

.dot-ready {
	background: #8FC08A;
}

.dot-ok {
	background: var(--text);
}

.dot-err {
	background: #D8604A;
}

.photo-box {
	position: relative;
	margin: 4px 16px 0;
	height: min(380px, 42dvh);
	border-radius: 18px;
	overflow: hidden;
	background: var(--field);
}

.photo-box .img-label {
	background: var(--paper);
}

.photo-note {
	position: absolute;
	left: 12px;
	bottom: 12px;
	right: 12px;
	width: fit-content;
	padding: 6px 10px;
	border-radius: 10px;
	background: rgba(15, 14, 13, 0.8);
	font-size: 12px;
	font-weight: 500;
}

.steps {
	list-style: none;
	margin: 16px 16px 0;
	padding: 0;
	display: flex;
	flex-direction: column;
}

.step {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 9px 4px;
}

.step-mark {
	width: 26px;
	height: 26px;
	flex: none;
	border-radius: 13px;
	display: grid;
	place-items: center;
	font-size: 13px;
	font-weight: 700;
	border: 1.5px solid var(--line);
	color: var(--muted);
}

.step-mark .ico {
	width: 15px;
	height: 15px;
}

.step-done .step-mark {
	background: var(--text);
	border-color: var(--text);
	color: var(--bg);
}

.step-running .step-mark {
	border-color: var(--gold);
}

.step-error .step-mark {
	background: #8A2E1E;
	border-color: #8A2E1E;
	color: var(--text);
}

.step-title {
	font-size: 15px;
	font-weight: 500;
}

.step-pending .step-title {
	color: var(--muted);
}

.step-note {
	font-size: 13px;
	color: var(--muted);
	margin-top: 2px;
	overflow-wrap: anywhere;
}

.step-error .step-note {
	color: var(--err);
}

.bottom-actions {
	margin: auto 16px 0;
	padding: 20px 0 calc(20px + var(--safe-bottom));
	display: flex;
	flex-direction: column;
	gap: 6px;
}

/* ---- check ---------------------------------------------------------------------------------- */

.check-top {
	margin: 0 16px;
	display: flex;
	gap: 14px;
	align-items: flex-end;
}

.check-img {
	position: relative;
	width: 132px;
	height: 198px;
	flex: none;
	border-radius: 12px;
	overflow: hidden;
	background: var(--paper);
}

.check-img.is-busy::after {
	content: '';
	position: absolute;
	inset: 0;
	background: rgba(15, 14, 13, 0.45) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Ccircle cx='12' cy='12' r='9' fill='none' stroke='%23F3EFE8' stroke-width='2' stroke-dasharray='14 44'/%3E%3C/svg%3E") center / 32px no-repeat;
}

.check-side {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding-bottom: 4px;
}

.check-note {
	font-size: 13px;
	color: var(--muted);
	line-height: 1.4;
}

.check-note p {
	margin: 0 0 6px;
}

.check-warn {
	color: var(--err);
	font-size: 13px;
	line-height: 1.4;
	margin: 0;
}

.check-form {
	margin: 18px 16px 0;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.screen-check .form-error {
	margin: 10px 16px 0;
}

.screen-check .btn-danger {
	margin-top: 12px;
}

.segs {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 6px;
}

.seg {
	height: 36px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: transparent;
	color: var(--soft);
	font-size: 13px;
	padding: 0 4px;
}

.seg.active {
	border-color: var(--text);
	background: var(--text);
	color: var(--bg);
	font-weight: 600;
}

.bottom-bar {
	position: sticky;
	bottom: 0;
	margin-top: auto;
	padding: 16px 16px calc(16px + var(--safe-bottom));
	display: flex;
	gap: 10px;
	align-items: center;
	background: linear-gradient(180deg, rgba(15, 14, 13, 0) 0%, var(--bg) 30%);
}

/* ---- notes ---------------------------------------------------------------------------------- */

.notes-wine {
	margin: 0 20px 12px;
	font-family: var(--serif);
	font-size: 20px;
	font-weight: 600;
	color: var(--soft);
}

.notes-field {
	margin: 0 16px;
	padding: 12px 14px;
}

.notes-input {
	width: 100%;
	min-height: 42dvh;
	border: 0;
	outline: none;
	resize: none;
	padding: 0;
	background: transparent;
	color: var(--text);
	font: inherit;
	font-size: 16px;
	line-height: 1.5;
}

.notes-input::placeholder {
	color: #8F8981;
}

/* ---- search --------------------------------------------------------------------------------- */

.search-box {
	flex: 1;
	min-width: 0;
	height: 44px;
	border-radius: 12px;
	background: var(--field);
	display: flex;
	align-items: center;
	padding: 0 12px 0 38px;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23A8A29A' stroke-width='1.6' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='6.5'/%3E%3Cpath d='M16 16l4.5 4.5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: 11px center;
	background-size: 20px;
}

.search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: none;
	background: transparent;
	color: var(--text);
	font-size: 16px;
}

.search-input::placeholder {
	color: #8F8981;
}

.segmented {
	margin: 6px 16px 0;
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	background: var(--field);
	border-radius: 12px;
	padding: 3px;
	gap: 0;
}

.segmented .seg {
	border: 0;
	border-radius: 10px;
	height: 36px;
}

.filter-groups {
	padding: 16px 0 0 16px;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.filter-group {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.chip-row {
	display: flex;
	gap: 6px;
	overflow-x: auto;
	padding-right: 16px;
	scrollbar-width: none;
}

.chip-row::-webkit-scrollbar,
.chips::-webkit-scrollbar,
.thumbs::-webkit-scrollbar {
	display: none;
}

.results-head {
	padding: 18px 20px 8px;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
}

.results-count {
	font-family: var(--serif);
	font-size: 22px;
	font-weight: 600;
}

.results .grid {
	padding-left: 16px;
	padding-right: 16px;
}

@media (prefers-reduced-motion: reduce) {
	#toast {
		transition: none;
	}

	.spinner {
		animation-duration: 2.4s;
	}
}

@media (min-width: 700px) {
	.screen {
		max-width: 520px;
		margin: 0 auto;
	}
}

/* Description on the edit screen: a multi-line field in the same box as the name fields. */
.field-text {
	height: auto;
	min-height: 9em;
	resize: vertical;
	font: inherit;
	font-size: 16px;
	line-height: 1.45;
}
