:root {
	--bg: #dde8ef;
	--panel: #ffffff;
	--text: #1f2a24;
	--muted: #66736b;
	--line: #d9e2dc;
	--accent: #2f6b3a;
	--accent-soft: #e5efe7;
	--ok: #3dbb5c;
	--bad: #e2443a;
	--built: #bdb8ae;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	color: var(--text);
}

* { box-sizing: border-box; }

/* Flex rows below would otherwise override the hidden attribute. */
[hidden] { display: none !important; }

html, body {
	margin: 0;
	height: 100%;
	overflow: hidden;
	background: var(--bg);
}

#stage {
	position: fixed;
	inset: 0 0 0 340px;
}

#scene {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
	outline: none;
}

#panel {
	position: fixed;
	inset: 0 auto 0 0;
	width: 340px;
	background: var(--panel);
	border-right: 1px solid var(--line);
	overflow-y: auto;
	z-index: 2;
}

#panel-toggle { display: none; }

#panel-body { padding: 18px 18px 28px; }

header h1 {
	font-size: 19px;
	margin: 0 0 2px;
	letter-spacing: .01em;
}

.muted { color: var(--muted); font-size: 13px; margin: 6px 0 0; line-height: 1.4; }
.small { font-size: 12px; }

fieldset {
	border: 0;
	border-top: 1px solid var(--line);
	margin: 16px 0 0;
	padding: 14px 0 0;
}

legend {
	font-weight: 600;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--accent);
	padding: 0 8px 0 0;
}

label.row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	font-size: 14px;
	margin-top: 10px;
}

label.row input[type=number] { width: 86px; }
.pair { display: grid; grid-template-columns: 1.4fr 1fr; gap: 10px; }
.pair label.row input[type=number] { width: 64px; }
label.stack { display: flex; flex-direction: column; gap: 4px; font-size: 14px; margin-top: 10px; }
label.stack input[type=text] { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; }
label.row select { max-width: 200px; }

input[type=number], select {
	font: inherit;
	font-size: 14px;
	padding: 5px 7px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: #fff;
	color: var(--text);
}

input[type=range] {
	width: 100%;
	accent-color: var(--accent);
	margin: 6px 0 2px;
}

label.check {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
	margin-top: 10px;
}

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

button {
	font: inherit;
	font-size: 14px;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 7px;
	background: #f6f8f6;
	color: var(--text);
	cursor: pointer;
}

button:hover { background: var(--accent-soft); }
button:disabled { opacity: .45; cursor: default; }

.seg { display: flex; gap: 6px; }
.seg button { flex: 1; font-weight: 600; }
.seg button.on { background: var(--accent); border-color: var(--accent); color: #fff; }

.buttons {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px;
}

.buttons .wide { grid-column: 1 / -1; }
.muted.scale { display: flex; justify-content: space-between; margin: 0 0 4px; font-size: 12px; }
.check + .buttons, .scale + .check { margin-bottom: 10px; }
label.row .muted { margin: 0; }
.seg.mode { margin-bottom: 8px; }

button.primary {
	width: 100%;
	margin-top: 8px;
	padding: 11px;
	font-weight: 700;
	background: var(--accent);
	border-color: var(--accent);
	color: #fff;
}

button.primary:hover { background: #255830; }

#camera { margin-top: 10px; width: 100%; }

button.secondary {
	width: 100%;
	margin-top: 6px;
	padding: 10px;
	font-weight: 600;
	border-color: var(--accent);
	color: var(--accent);
	background: #fff;
}

/* Price summary dialog */
#price-dialog {
	width: min(1040px, calc(100vw - 32px));
	max-height: calc(100vh - 32px);
	border: 0;
	border-radius: 12px;
	padding: 0;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
	color: var(--text);
}

#price-dialog::backdrop, #drawing-dialog::backdrop, #send-dialog::backdrop { background: rgba(20, 30, 25, .45); }
#send-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--text); }
#send-form { display: flex; flex-direction: column; padding: 18px 20px; gap: 6px; }
#send-form .dialog-head p { margin: 6px 0 0; font-size: 14px; line-height: 1.5; }
#send-form textarea { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
#send-status:empty { display: none; }
#send-result { margin-right: auto; }
button.send { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 700; }
button.send:hover { filter: brightness(1.12); }
.req { display: inline-block; font-size: 12px; font-weight: 700; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
#drawing-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); }
#drawing-form { display: flex; flex-direction: column; padding: 18px 20px; gap: 6px; }
#drawing-form .pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
#drawing-result { margin-right: auto; }
/* PDF viewer: the pages drawn with pdf.js, the order buttons under them */
#pdf-dialog { width: min(1100px, calc(100vw - 24px)); height: calc(100vh - 24px); max-height: none; border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--text); overflow: hidden; }
#pdf-dialog::backdrop { background: rgba(20, 30, 25, .55); }
.pdf-wrap { display: flex; flex-direction: column; height: 100%; }
.pdf-head { padding: 14px 18px 10px; border-bottom: 1px solid var(--line); align-items: center; }
.pdf-head > div:first-child { flex: 1; min-width: 0; }
.pdf-head p { margin: 4px 0 0; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-zoom { display: flex; gap: 4px; }
.pdf-zoom button { min-width: 38px; padding: 6px 8px; font-weight: 700; }
.pdf-pages { flex: 1; min-height: 0; overflow: auto; background: #e7e9e4; padding: 12px; display: flex; flex-direction: column; align-items: center; gap: 12px; outline: none; }
.pdf-pages canvas { display: block; flex: none; background: #fff; box-shadow: 0 2px 10px rgba(0, 0, 0, .18); }
.pdf-pages.zoomed { align-items: flex-start; }
.pdf-status { margin: auto; color: var(--muted); font-size: 15px; text-align: center; }
.pdf-status .spin { display: block; width: 30px; height: 30px; margin: 0 auto 10px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--accent); animation: pdfspin .8s linear infinite; }
@keyframes pdfspin { to { transform: rotate(360deg); } }
.pdf-foot { padding: 12px 18px; border-top: 1px solid var(--line); background: #fff; }
.pdf-foot button { padding: 10px 14px; font-weight: 600; }
.pdf-foot .primary { margin: 0; }
#pdf-result { margin-right: auto; }
button.order-btn:not(.primary) { border-color: var(--accent); color: var(--accent); background: #fff; }
.order-form { flex: none; max-height: 62%; overflow: auto; padding: 14px 18px; border-top: 1px solid var(--line); background: #fff; display: flex; flex-direction: column; gap: 8px; }
.order-form h3 { margin: 0; font-size: 17px; }
.order-form p { margin: 0; }
.order-form textarea { font: inherit; font-size: 14px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; resize: vertical; }
.order-jobs { margin: 0; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 8px; }
.order-jobs legend { padding: 0 4px; font-weight: 600; font-size: 14px; }
#order-jobs-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 4px 14px; }
#order-jobs-list label { display: flex; gap: 8px; align-items: flex-start; font-size: 14px; line-height: 1.35; cursor: pointer; }
#order-jobs-list input { accent-color: var(--accent); width: 16px; height: 16px; margin-top: 1px; flex: none; }
#order-jobs-list small { display: block; color: var(--muted); font-size: 12px; }
.order-actions { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.order-actions .primary { width: auto; margin: 0; padding: 10px 14px; }
#order-result { margin-right: auto; }
.order-open .pdf-foot { display: none; }
@media (max-width: 640px) {
	#pdf-dialog { width: 100vw; height: 100dvh; max-width: 100vw; border-radius: 0; margin: 0; }
	.pdf-head { padding: 10px 12px 8px; }
	.pdf-head h2 { font-size: 17px; }
	.pdf-zoom button { min-width: 34px; padding: 5px 6px; }
	#pdf-zoom-fit { display: none; }
	.pdf-pages { padding: 8px; }
	.pdf-foot { padding: 10px 12px; }
	.pdf-foot button { flex: 1 1 auto; }
	#pdf-result:empty { display: none; }
	.order-form { max-height: 75%; padding: 12px; }
}
#price-table .fixed { font-size: 13px; font-weight: 600; color: var(--accent); white-space: nowrap; }
#price-table input[readonly] { background: #f1f1ec; color: var(--muted); cursor: not-allowed; }
#account-dialog { width: min(480px, calc(100vw - 32px)); border: 0; border-radius: 12px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); color: var(--text); }
#account-dialog::backdrop { background: rgba(20, 30, 25, .45); }
#account-form { display: flex; flex-direction: column; padding: 18px 20px; gap: 8px; }
#account-text { margin: 4px 0 0; font-size: 15px; line-height: 1.5; }
#account-result { margin-right: auto; }
/* After a login that took over a guest wall: the button the visitor asked for blinks a few times. */
.attention { animation: attention 1s ease-in-out 4; }
@keyframes attention { 50% { box-shadow: 0 0 0 4px var(--accent-soft), 0 0 0 7px var(--accent); } }
.who { margin: 2px 0 6px; font-size: 14px; }
.who a { color: var(--accent); font-weight: 600; }
#projects-box select { max-width: 210px; }
@media (max-width: 520px) { #drawing-form .pair { grid-template-columns: 1fr; } }
#price-form { display: flex; flex-direction: column; max-height: calc(100vh - 32px); padding: 18px 20px; gap: 8px; }
.dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.dialog-head h2 { margin: 0; font-size: 19px; }
.dialog-head .close { border: 0; background: none; font-size: 26px; line-height: 1; padding: 0 4px; color: var(--muted); }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 8px; }

#price-table { border-collapse: collapse; width: 100%; font-size: 14px; }
#price-table th { position: sticky; top: 0; background: #f6f8f6; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px; z-index: 1; }
#price-table td { padding: 6px 8px; border-top: 1px solid var(--line); vertical-align: middle; }
#price-table tr.group td { background: var(--accent-soft); font-weight: 700; font-size: 13px; color: var(--accent); padding: 6px 8px; }
#price-table tr.off td:not(.c-inc) { opacity: .45; }
#price-table .c-num { text-align: right; white-space: nowrap; }
#price-table .c-inc { width: 28px; text-align: center; }
#price-table input[type=number] { width: 92px; text-align: right; }
#price-table select { width: 100%; min-width: 180px; max-width: 320px; }
#price-table .hint { display: block; font-size: 12px; color: var(--muted); }

#price-totals { margin-left: auto; font-size: 14px; border-collapse: collapse; }
#price-totals th { text-align: left; font-weight: 400; padding: 2px 16px 2px 0; color: var(--muted); }
#price-totals td { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
#price-totals tr.grand th, #price-totals tr.grand td { font-size: 17px; color: var(--text); padding-top: 6px; }

.dialog-foot { display: flex; justify-content: flex-end; align-items: center; gap: 8px; flex-wrap: wrap; }
.dialog-foot .primary { width: auto; margin: 0; padding: 9px 14px; }
#price-result { margin-right: auto; }
#price-result a { color: var(--accent); font-weight: 600; }

@media (max-width: 820px) {
	#price-form { padding: 14px 12px; }
	#price-table select { min-width: 140px; }
	#price-table input[type=number] { width: 72px; }
}

#bend-box {
	margin-top: 16px;
	border-top: 1px solid var(--line);
	padding-top: 12px;
}

.box-title {
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: .06em;
	color: var(--accent);
	margin: 0 0 6px;
}

#bend-list {
	margin: 0;
	padding-left: 20px;
	font-size: 13px;
	line-height: 1.45;
}

#bend-list li { margin-bottom: 4px; }
#bend-list b { font-variant-numeric: tabular-nums; }

#warnings {
	list-style: none;
	padding: 0;
	margin: 16px 0 0;
}

#warnings li {
	font-size: 13px;
	line-height: 1.4;
	background: #fdf0e8;
	border-left: 3px solid #e08a3c;
	padding: 7px 9px;
	margin-top: 6px;
	border-radius: 4px;
}

.legend { font-size: 13px; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin: 14px 0 0; }
.sw { display: inline-block; width: 14px; height: 14px; border-radius: 3px; margin-left: 6px; }
.sw:first-child { margin-left: 0; }
.sw.ok { background: var(--ok); }
.sw.bad { background: var(--bad); }
.sw.built { background: var(--built); }

#stats {
	position: absolute;
	top: 12px;
	right: 12px;
	background: rgba(255, 255, 255, .93);
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 10px 12px;
	font-size: 13px;
	min-width: 230px;
	box-shadow: 0 4px 18px rgba(30, 50, 40, .08);
	pointer-events: none;
}

#stats table { border-collapse: collapse; width: 100%; }
#stats td { padding: 2px 0; }
#stats td:last-child { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; padding-left: 14px; }
#stats .title { font-weight: 700; margin: 6px 0 4px; padding-top: 6px; border-top: 1px solid var(--line); }

/* "Detali informacija": the header folds the figures away (arrow up = fold, down = unfold). */
#stats-toggle {
	pointer-events: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	font: inherit;
	font-weight: 700;
	color: var(--accent);
	cursor: pointer;
}
#stats-toggle:hover { background: none; text-decoration: underline; }
#stats-toggle .chev { width: 14px; height: 14px; flex: 0 0 auto; transition: transform .15s; }
#stats.closed { min-width: 0; }
#stats.closed #stats-body { display: none; }
#stats.closed #stats-toggle .chev { transform: rotate(180deg); }

/* Undo / redo / guide, top left of the 3D view. */
#history-bar {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	gap: 6px;
	z-index: 2;
}
#history-bar button {
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	display: grid;
	place-items: center;
	border-radius: 10px;
	background: rgba(255, 255, 255, .95);
	border: 1px solid var(--line);
	box-shadow: 0 4px 14px rgba(30, 50, 40, .1);
	color: var(--text);
	font-weight: 800;
	font-size: 17px;
}
#history-bar button:hover:not(:disabled) { background: var(--accent-soft); color: var(--accent); }
#history-bar svg { width: 20px; height: 20px; }
#history-bar #tour-open { color: var(--accent); }
/* "Į svetainę" (2.11.0): back to the website without logging out. */
#history-bar #go-home { display: flex; align-items: center; gap: 6px; height: 40px; padding: 0 12px 0 10px; border-radius: 10px; background: rgba(255, 255, 255, .95); border: 1px solid var(--line); box-shadow: 0 4px 14px rgba(30, 50, 40, .1); color: var(--accent); font-weight: 700; font-size: 14px; text-decoration: none; }
#history-bar #go-home[hidden] { display: none; }
#history-bar #go-home:hover { background: var(--accent-soft); }

/* Touch screens (body.touch): the keyboard's actions as buttons over the scene. */
#touch-bar, #view-bar, .touch-text { display: none; }
body.touch .key { display: none; }
body.touch .touch-text { display: inline; }
body.touch #touch-bar, body.touch #view-bar { display: flex; }
#touch-bar button, #view-bar button {
	margin: 0;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}
#touch-bar {
	position: absolute;
	left: 50%;
	bottom: calc(14px + env(safe-area-inset-bottom));
	transform: translateX(-50%);
	gap: 4px;
	padding: 5px;
	background: rgba(255, 255, 255, .96);
	border: 1px solid var(--line);
	border-radius: 16px;
	box-shadow: 0 6px 22px rgba(30, 50, 40, .16);
	z-index: 2;
}
#touch-bar button {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	min-width: 68px;
	padding: 7px 6px 6px;
	border: 0;
	border-radius: 11px;
	background: none;
	font-size: 12px;
	font-weight: 700;
	color: var(--text);
}
#touch-bar button svg { width: 24px; height: 24px; }
#touch-bar button.on { background: var(--accent); color: #fff; }
#touch-bar button:active:not(:disabled), #view-bar button:active { background: var(--accent-soft); color: var(--accent); }
#touch-bar button.on:active { background: #255830; color: #fff; }
#view-bar {
	position: absolute;
	right: 12px;
	bottom: calc(96px + env(safe-area-inset-bottom));
	flex-direction: column;
	gap: 6px;
	z-index: 2;
}
#view-bar button {
	width: 46px;
	height: 46px;
	padding: 0;
	display: grid;
	place-items: center;
	border-radius: 12px;
	background: rgba(255, 255, 255, .96);
	border: 1px solid var(--line);
	box-shadow: 0 4px 14px rgba(30, 50, 40, .12);
	color: var(--text);
}
#view-bar svg { width: 24px; height: 24px; }
body.touch #hint { bottom: calc(92px + env(safe-area-inset-bottom)); }
/* The finger covers the point it touches: the "galima / negalima" label goes above it. */
body.touch #tip { transform: translate(-50%, calc(-100% - 48px)); }

/* Guide: the highlighted area (a hole in the dark cover) and a card pointing at it. */
#tour { position: fixed; inset: 0; z-index: 50; }
#tour.center { background: rgba(15, 25, 20, .55); }
.tour-spot {
	position: fixed;
	border-radius: 12px;
	box-shadow: 0 0 0 9999px rgba(15, 25, 20, .55);
	outline: 3px solid #b8d45a;
	outline-offset: 2px;
	transition: top .25s, left .25s, width .25s, height .25s;
	pointer-events: none;
	animation: tour-pulse 1.6s ease-in-out infinite;
}
#tour.center .tour-spot { display: none; }
@keyframes tour-pulse { 50% { outline-color: rgba(184, 212, 90, .35); } }
.tour-card {
	position: fixed;
	width: min(340px, calc(100vw - 24px));
	background: #fff;
	color: var(--text);
	border-radius: 14px;
	padding: 16px 18px 14px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, .3);
	transition: top .25s, left .25s;
}
.tour-card::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	background: #fff;
	transform: rotate(45deg);
	display: none;
}
.tour-card.arrow-left::before { display: block; left: -8px; top: var(--arrow, 50%); margin-top: -8px; }
.tour-card.arrow-right::before { display: block; right: -8px; top: var(--arrow, 50%); margin-top: -8px; }
.tour-card.arrow-up::before { display: block; top: -8px; left: var(--arrow, 50%); margin-left: -8px; }
.tour-card.arrow-down::before { display: block; bottom: -8px; left: var(--arrow, 50%); margin-left: -8px; }
.tour-step { margin: 0 0 2px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.tour-card h2 { margin: 0 0 6px; font-size: 18px; color: var(--accent); }
.tour-text { margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.tour-text kbd { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.tour-nav { display: flex; gap: 8px; align-items: center; }
.tour-nav button { width: auto; margin: 0; padding: 7px 14px; }
.tour-nav .tour-skip { margin-right: auto; border: 0; background: none; color: var(--muted); padding-left: 0; }
.tour-nav .primary { padding: 7px 18px; }

#hint {
	position: absolute;
	left: 50%;
	bottom: 14px;
	transform: translateX(-50%);
	background: rgba(31, 42, 36, .78);
	color: #fff;
	font-size: 13px;
	padding: 7px 12px;
	border-radius: 999px;
	white-space: nowrap;
	pointer-events: none;
	max-width: calc(100% - 24px);
	overflow: hidden;
	text-overflow: ellipsis;
}

kbd {
	font: inherit;
	font-size: 12px;
	background: rgba(255, 255, 255, .2);
	border-radius: 3px;
	padding: 0 4px;
}

#dims {
	position: absolute;
	inset: 0;
	overflow: hidden;
	pointer-events: none;
}

.dim {
	position: absolute;
	left: 0;
	top: 0;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 700;
	color: var(--text);
	background: rgba(255, 255, 255, .92);
	border-radius: 4px;
	padding: 2px 6px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, .18);
	font-variant-numeric: tabular-nums;
	will-change: transform;
}

.dim.small { font-size: 11px; padding: 1px 5px; }
.dim.muted { color: var(--muted); font-weight: 600; }

#tip {
	position: absolute;
	pointer-events: none;
	font-size: 13px;
	font-weight: 600;
	padding: 5px 9px;
	border-radius: 6px;
	color: #fff;
	background: var(--ok);
	transform: translate(14px, -130%);
	white-space: nowrap;
	max-width: 70vw;
	overflow: hidden;
	text-overflow: ellipsis;
}

#tip.bad { background: var(--bad); }

#toast {
	position: absolute;
	left: 50%;
	top: 14px;
	transform: translateX(-50%);
	background: var(--text);
	color: #fff;
	font-size: 14px;
	padding: 9px 14px;
	border-radius: 8px;
	max-width: calc(100% - 290px);
	box-shadow: 0 6px 20px rgba(0, 0, 0, .18);
	z-index: 3;
}

#toast.bad { background: #b8322a; }
#toast.ok { background: var(--accent); }

@media (max-width: 820px) {
	#stage { inset: 0; }

	#panel {
		inset: auto 0 0 0;
		width: auto;
		max-height: 62vh;
		border-right: 0;
		border-top: 1px solid var(--line);
		border-radius: 14px 14px 0 0;
		box-shadow: 0 -6px 24px rgba(0, 0, 0, .12);
	}

	#panel-toggle {
		display: block;
		position: sticky;
		top: 0;
		width: 100%;
		border: 0;
		border-bottom: 1px solid var(--line);
		border-radius: 0;
		background: var(--panel);
		font-weight: 700;
		padding: 12px;
		z-index: 1;
	}

	body.collapsed #panel-body { display: none; }
	#panel-body { padding: 12px 16px 24px; }

	#stats { top: 56px; right: 8px; left: 8px; min-width: 0; font-size: 12px; padding: 8px 10px; }
	#stats.closed { top: 8px; left: auto; }
	#history-bar { top: 8px; left: 8px; }
	#history-bar button { width: 38px; height: 38px; }
	#history-bar #go-home { height: 38px; padding: 0 10px; }
	#stats table { display: grid; grid-template-columns: 1fr 1fr; column-gap: 14px; }
	#stats tbody, #stats tr { display: contents; }
	#stats tr { display: flex; justify-content: space-between; }
	#stats tr:nth-child(n+7) { display: none; }
	#hint { display: none; }
	#toast { max-width: calc(100% - 24px); top: auto; bottom: calc(62vh + 12px); }
	body.collapsed #toast { bottom: 70px; }

	/* Touch buttons above the folded "Nustatymai" bar; hidden while the settings sheet is open. */
	body.touch #touch-bar { bottom: calc(56px + env(safe-area-inset-bottom)); }
	body.touch #view-bar { right: 8px; bottom: calc(128px + env(safe-area-inset-bottom)); }
	body.touch:not(.collapsed) #touch-bar, body.touch:not(.collapsed) #view-bar { display: none; }
	body.touch.collapsed #toast { bottom: calc(128px + env(safe-area-inset-bottom)); max-width: calc(100% - 132px); }
	body.collapsed #panel-toggle { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
	/* Guide: a lower sheet leaves room for the card above the highlighted settings. */
	body.touring #panel { max-height: 54vh; }
	#panel-body * { scroll-margin-top: 58px; }
}
@media (max-width: 380px) {
	#touch-bar button { min-width: 60px; padding-left: 3px; padding-right: 3px; }
}

/* Order / request sent (2.8.0): confirmation with the order's stages. */
#sent-dialog { width: min(520px, calc(100vw - 32px)); border: 0; border-radius: 14px; padding: 0; box-shadow: 0 20px 60px rgba(0, 0, 0, .3); color: var(--text); }
#sent-dialog::backdrop { background: rgba(20, 30, 25, .55); }
.sent-form { display: flex; flex-direction: column; align-items: stretch; padding: 24px 24px 18px; gap: 6px; }
.sent-check { width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; margin: 0 auto 6px; }
.sent-check svg { width: 30px; height: 30px; }
.sent-form h2 { margin: 0; text-align: center; font-size: 21px; color: var(--accent); }
#sent-text { margin: 4px 0 8px; text-align: center; font-size: 14.5px; line-height: 1.55; }
.sent-steps { list-style: none; margin: 6px 0 4px; padding: 12px 14px; border-radius: 12px; background: #f6f8f4; display: flex; flex-direction: column; gap: 8px; }
.sent-steps:empty { display: none; }
.sent-steps li { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--muted); }
.sent-steps li small { margin-left: auto; font-size: 12px; color: var(--muted); }
.sent-steps .dot { flex: none; width: 14px; height: 14px; border-radius: 50%; background: #dfe4dc; }
.sent-steps li.done { color: var(--text); }
.sent-steps li.done .dot { background: var(--accent); }
.sent-steps li.current { color: var(--text); font-weight: 700; }
.sent-steps li.current .dot { background: #fff; box-shadow: 0 0 0 3px #b8d45a; }
#sent-where:empty { display: none; }
.sent-form .dialog-foot { margin-top: 8px; }
.sent-form .dialog-foot .primary { min-width: 120px; }
.sent-link { margin-right: auto; color: var(--accent); font-weight: 600; font-size: 14px; }

/* Narrow phones: the house icon only, so the bar does not reach the "Detali informacija" button. */
@media (max-width: 440px) {
	#history-bar #go-home span { display: none; }
	/* the folded figures go to a second row under the buttons */
	#stats.closed { top: 54px; }
	#history-bar #go-home { width: 38px; padding: 0; justify-content: center; }
}
