:root {
	--bg: #f6f5f3;
	--panel: #fff;
	--ink: #1c1917;
	--muted: #78716c;
	--line: #e7e5e4;
	--accent: #c2410c;
	--accent-ink: #fff;
	--warn-bg: #fef3c7;
	--warn: #92400e;
	--ok: #15803d;
	--danger: #b91c1c;
	--radius: 10px;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font:
		14px/1.45 Inter,
		system-ui,
		sans-serif;
}
a {
	color: var(--accent);
}
button,
input,
textarea,
select {
	font: inherit;
	color: inherit;
}
input,
textarea,
select {
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 7px 10px;
	background: #fff;
	width: 100%;
}
input:focus,
textarea:focus,
select:focus {
	outline: 2px solid color-mix(in srgb, var(--accent) 40%, transparent);
	border-color: var(--accent);
}
textarea {
	resize: vertical;
	min-height: 38px;
}

.btn {
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 8px;
	padding: 7px 14px;
	cursor: pointer;
	font-weight: 500;
	white-space: nowrap;
	text-decoration: none;
	color: var(--ink);
	display: inline-flex;
	align-items: center;
	gap: 6px;
}
.btn:hover {
	border-color: #d6d3d1;
	background: #fafaf9;
}
.btn.primary {
	background: var(--accent);
	color: var(--accent-ink);
	border-color: var(--accent);
}
.btn.primary:hover {
	filter: brightness(1.05);
}
.btn.ghost {
	border-color: transparent;
	background: transparent;
}
.btn.danger {
	color: var(--danger);
}
.btn.sm {
	padding: 3px 8px;
	font-size: 13px;
}
.btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 12px 20px;
	background: #fff;
	border-bottom: 1px solid var(--line);
	position: sticky;
	top: 0;
	z-index: 20;
}
.brand {
	font-size: 20px;
	text-decoration: none;
	color: var(--ink);
	letter-spacing: -0.02em;
}
.brand b {
	color: var(--accent);
}
.badge {
	font-size: 12px;
	padding: 3px 10px;
	border-radius: 999px;
	background: #f5f5f4;
	color: var(--muted);
}
.badge.on {
	background: #dcfce7;
	color: var(--ok);
}

.wrap {
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 20px 80px;
}
h1 {
	font-size: 22px;
	margin: 0 0 4px;
	letter-spacing: -0.01em;
}
h2 {
	font-size: 16px;
	margin: 0 0 12px;
}
.muted {
	color: var(--muted);
}
.card {
	background: var(--panel);
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 20px;
}
.grid2 {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: 20px;
	align-items: start;
}
@media (max-width: 860px) {
	.grid2 {
		grid-template-columns: 1fr;
	}
}
.field {
	display: block;
	margin-bottom: 14px;
}
label.field > span {
	display: block;
	font-weight: 500;
	margin-bottom: 4px;
}

.drop {
	border: 2px dashed #d6d3d1;
	border-radius: 12px;
	padding: 28px;
	text-align: center;
	cursor: pointer;
	background: #fafaf9;
	transition: 0.15s;
}
.drop.over {
	border-color: var(--accent);
	background: color-mix(in srgb, var(--accent) 6%, #fff);
}
.thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.thumbs figure {
	margin: 0;
	width: 72px;
	height: 72px;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
	position: relative;
	display: grid;
	place-items: center;
	font-size: 12px;
	color: var(--muted);
}
.thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.progress {
	margin-top: 16px;
	padding: 14px;
	border-radius: 10px;
	background: #fff7ed;
	color: #9a3412;
	display: none;
}
.progress.on {
	display: block;
}
.spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
	vertical-align: -2px;
	margin-right: 6px;
}
@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}

table.list {
	width: 100%;
	border-collapse: collapse;
}
table.list td,
table.list th {
	padding: 10px 8px;
	border-bottom: 1px solid var(--line);
	text-align: left;
}
table.list th {
	font-size: 12px;
	color: var(--muted);
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.pill {
	font-size: 12px;
	padding: 2px 8px;
	border-radius: 999px;
	background: #f5f5f4;
	color: var(--muted);
}
.pill.pub {
	background: #dcfce7;
	color: var(--ok);
}
.pill.warn {
	background: var(--warn-bg);
	color: var(--warn);
}

/* Editor */
.bar {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}
.bar .actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.tabs {
	display: flex;
	gap: 4px;
	border-bottom: 1px solid var(--line);
	margin-bottom: 20px;
	overflow-x: auto;
	overflow-y: hidden;
	scrollbar-width: none;
}
.tabs button {
	border: 0;
	background: none;
	padding: 10px 14px;
	cursor: pointer;
	color: var(--muted);
	font-weight: 500;
	border-bottom: 2px solid transparent;
	margin-bottom: -1px;
	white-space: nowrap;
}
.tabs button.on {
	color: var(--ink);
	border-bottom-color: var(--accent);
}
.editor {
	display: grid;
	grid-template-columns: 340px 1fr;
	gap: 20px;
	align-items: start;
}
.editor.nosrc {
	grid-template-columns: 1fr;
}
@media (max-width: 960px) {
	.editor {
		grid-template-columns: 1fr;
	}
}
.sources {
	position: sticky;
	top: 72px;
	max-height: calc(100vh - 90px);
	overflow: auto;
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.sources img {
	width: 100%;
	border-radius: 10px;
	border: 1px solid var(--line);
	cursor: zoom-in;
}
.sources img.zoom {
	position: fixed;
	inset: 20px;
	width: auto;
	height: calc(100vh - 40px);
	margin: auto;
	z-index: 50;
	object-fit: contain;
	background: #000c;
	cursor: zoom-out;
}
.warnings {
	background: var(--warn-bg);
	color: var(--warn);
	border-radius: 10px;
	padding: 10px 14px;
	margin-bottom: 16px;
}
.warnings ul {
	margin: 4px 0 0;
	padding-left: 18px;
}

.cat {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	margin-bottom: 16px;
}
.cat-head {
	display: flex;
	gap: 8px;
	align-items: center;
	padding: 12px 14px;
	border-bottom: 1px solid var(--line);
}
.cat-head input.cat-name {
	font-weight: 700;
	font-size: 16px;
	border-color: transparent;
}
.cat-head input.cat-name:hover {
	border-color: var(--line);
}
.cat-desc {
	padding: 8px 14px 0;
}
.cat-desc input {
	font-size: 13px;
	color: var(--muted);
	border-style: dashed;
}
.items {
	padding: 4px 14px 10px;
}
.item {
	display: grid;
	grid-template-columns: 56px 1fr 130px auto;
	gap: 10px;
	align-items: start;
	padding: 10px 0;
	border-bottom: 1px solid #f0efee;
}
.item:last-child {
	border-bottom: 0;
}
.item.review {
	background: linear-gradient(90deg, var(--warn-bg), transparent 70%);
	border-radius: 8px;
	padding-left: 6px;
	margin-left: -6px;
}
@media (max-width: 640px) {
	.item {
		grid-template-columns: 48px 1fr;
	}
	.item .price-col,
	.item .tools {
		grid-column: 2;
	}
}
.ph {
	width: 56px;
	height: 56px;
	border-radius: 8px;
	background: #f5f5f4;
	display: grid;
	place-items: center;
	cursor: pointer;
	overflow: hidden;
	color: #a8a29e;
	font-size: 20px;
	border: 1px dashed #d6d3d1;
}
.ph img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.item .name {
	font-weight: 600;
}
.item .desc {
	font-size: 13px;
	margin-top: 4px;
}
.item .meta {
	display: flex;
	gap: 6px;
	margin-top: 4px;
}
.item .meta input {
	font-size: 12px;
}
.note {
	font-size: 12px;
	color: var(--warn);
	margin-top: 4px;
	display: flex;
	gap: 6px;
	align-items: center;
}
.price-col input {
	text-align: right;
	font-weight: 600;
}
.variants {
	margin-top: 6px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.variants .v {
	display: grid;
	grid-template-columns: 1fr 90px 24px;
	gap: 4px;
}
.variants .v input {
	font-size: 13px;
	padding: 4px 8px;
}
.tools {
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.icon {
	border: 0;
	background: none;
	cursor: pointer;
	color: var(--muted);
	padding: 4px 6px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1;
}
.icon:hover {
	background: #f5f5f4;
	color: var(--ink);
}
.add-row {
	display: flex;
	gap: 8px;
	padding: 0 14px 14px;
}

.diff {
	width: 100%;
	border-collapse: collapse;
	margin: 12px 0;
}
.diff td {
	padding: 6px 8px;
	border-bottom: 1px solid var(--line);
}
.diff td.num {
	text-align: right;
	font-variant-numeric: tabular-nums;
}
.diff .up {
	color: var(--danger);
}
.diff .down {
	color: var(--ok);
}
.examples {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 8px 0 14px;
}
.examples button {
	font-size: 12px;
}

.qr {
	display: flex;
	gap: 24px;
	flex-wrap: wrap;
	align-items: center;
}
.qr img {
	width: 220px;
	height: 220px;
	border: 1px solid var(--line);
	border-radius: 12px;
	padding: 8px;
	background: #fff;
}
.phone {
	width: 390px;
	max-width: 100%;
	height: 720px;
	border: 10px solid #1c1917;
	border-radius: 36px;
	overflow: hidden;
	background: #fff;
}
.phone iframe {
	width: 100%;
	height: 100%;
	border: 0;
}

#toast {
	position: fixed;
	bottom: 20px;
	left: 50%;
	transform: translateX(-50%) translateY(80px);
	background: #1c1917;
	color: #fff;
	padding: 10px 16px;
	border-radius: 10px;
	transition: 0.25s;
	z-index: 100;
	max-width: 90vw;
}
#toast.on {
	transform: translateX(-50%) translateY(0);
}
#toast.err {
	background: var(--danger);
}
.savebar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	background: #1c1917;
	color: #fff;
	padding: 10px 20px;
	display: none;
	align-items: center;
	justify-content: center;
	gap: 16px;
	z-index: 30;
}
.savebar.on {
	display: flex;
}

.flags {
	display: flex;
	gap: 6px;
	margin-top: 6px;
	flex-wrap: wrap;
}
.flag {
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 999px;
	padding: 2px 10px;
	font-size: 12px;
	cursor: pointer;
	color: var(--muted);
}
.flag.on {
	background: #fee2e2;
	border-color: #fecaca;
	color: var(--danger);
	font-weight: 600;
}
.item.is-hidden {
	opacity: 0.55;
}
.styles {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-top: 6px;
}
.style-opt {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 14px;
	border-radius: 10px;
	border: 2px solid var(--line);
	cursor: pointer;
	font-weight: 600;
}
.style-opt b {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	display: inline-block;
}
.style-opt.on {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.hour-row {
	display: grid;
	grid-template-columns: 100px 1fr;
	align-items: center;
	gap: 10px;
}
.hour-row > span {
	margin: 0 !important;
}

.langs td {
	vertical-align: middle;
}
.lang-actions {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	justify-content: flex-end;
}
.tr-head {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--muted);
	padding: 8px 0;
	border-bottom: 1px solid var(--line);
}
.tr-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 12px;
	align-items: start;
	padding: 4px 0;
}
.tr-orig {
	padding: 7px 0;
	font-size: 13px;
	color: #44403c;
}
.tr-cat {
	margin-top: 18px;
	padding-top: 10px;
	border-top: 2px solid var(--line);
	font-weight: 700;
}
.tr-cat input {
	font-weight: 700;
}
.tr-item {
	padding: 6px 0;
	border-bottom: 1px dashed var(--line);
}
.tr-item.missing {
	background: var(--warn-bg);
}
.tr-item .tr-row:first-child .tr-orig {
	font-weight: 600;
	color: var(--ink);
}
@media (max-width: 640px) {
	.tr-row,
	.tr-head {
		grid-template-columns: 1fr;
		gap: 2px;
	}
}

/* Stats */
.stats-head {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin-bottom: 16px;
}
.seg {
	display: inline-flex;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 10px;
	padding: 3px;
}
.seg button {
	border: 0;
	background: none;
	padding: 6px 14px;
	border-radius: 7px;
	cursor: pointer;
	font-weight: 500;
	color: var(--muted);
}
.seg button.on {
	background: var(--ink);
	color: #fff;
}
.kpis {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
	margin-bottom: 16px;
}
@media (max-width: 860px) {
	.kpis {
		grid-template-columns: repeat(2, 1fr);
	}
}
.kpi {
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 14px;
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.kpi > span {
	color: var(--muted);
	font-size: 13px;
}
.kpi > b {
	font-size: 30px;
	font-weight: 600;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}
.delta {
	font-size: 12px;
	font-weight: 600;
}
.delta small {
	font-weight: 400;
	color: var(--muted);
}
.delta.up {
	color: var(--ok);
}
.delta.down {
	color: var(--danger);
}
.card.chart-card,
.grid2 > .card {
	margin-bottom: 16px;
}
.card .sub {
	margin: -8px 0 12px;
	font-size: 13px;
}
.mini {
	font-size: 13px;
	color: var(--muted);
	font-weight: 600;
	margin: 18px 0 8px;
}
.empty-stats {
	text-align: center;
	padding: 40px 20px;
}

.cols {
	--h: 180px;
}
.cols-plot {
	position: relative;
	height: var(--h);
	margin-left: 36px;
	border-bottom: 1px solid #d6d3d1;
}
.cols-tick {
	position: absolute;
	left: 0;
	right: 0;
	border-top: 1px solid #f0efee;
}
.cols-tick span {
	position: absolute;
	right: calc(100% + 6px);
	top: -8px;
	font-size: 11px;
	color: var(--muted);
	font-variant-numeric: tabular-nums;
}
.cols-bars {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	gap: 2px;
}
.col {
	flex: 1;
	height: 100%;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	cursor: default;
	outline: none;
}
.col i {
	display: block;
	width: 100%;
	max-width: 24px;
	min-height: 1px;
	background: var(--accent);
	border-radius: 4px 4px 0 0;
	transition: filter 0.15s;
}
.col:hover i,
.col:focus-visible i {
	filter: brightness(1.25);
}
.col:focus-visible {
	box-shadow: inset 0 0 0 2px
		color-mix(in srgb, var(--accent) 40%, transparent);
	border-radius: 4px;
}
.cols-x {
	display: flex;
	gap: 2px;
	margin-left: 36px;
	margin-top: 6px;
}
.cols-x span {
	flex: 1;
	font-size: 11px;
	color: var(--muted);
	text-align: center;
	white-space: nowrap;
	overflow: visible;
}
.tip {
	position: absolute;
	display: none;
	z-index: 60;
	background: #1c1917;
	color: #fff;
	font-size: 12px;
	padding: 6px 10px;
	border-radius: 8px;
	pointer-events: none;
	white-space: nowrap;
}

.meters {
	display: flex;
	flex-direction: column;
	gap: 10px;
}
.meter {
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) 1fr auto;
	gap: 10px;
	align-items: center;
	font-size: 13px;
}
.meter-name {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.meter-bar {
	height: 8px;
	background: #f5f0eb;
	border-radius: 4px;
	overflow: hidden;
}
.meter-bar i {
	display: block;
	height: 100%;
	background: var(--accent);
	border-radius: 0 4px 4px 0;
}
.meter b {
	font-variant-numeric: tabular-nums;
	min-width: 3ch;
	text-align: right;
	font-weight: 600;
}
@media (max-width: 520px) {
	.meter {
		grid-template-columns: 1fr auto;
	}
	.meter-bar {
		grid-column: 1 / -1;
		order: 3;
	}
}

/* Helpers that replaced inline styles */
.row-buttons {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}
.section-title {
	margin-top: 20px;
}
.intro {
	margin-top: -6px;
}
.hint {
	margin: 2px 0 6px;
	font-size: 13px;
}
.narrow {
	max-width: 860px;
}
.tr-card {
	margin-top: 16px;
}
.tr-card .bar h2 {
	margin: 0;
}
.inline-form {
	display: flex;
	gap: 8px;
}
.short {
	max-width: 120px;
}
.slug {
	display: flex;
	align-items: center;
	gap: 6px;
}
.field > .label {
	display: block;
	font-weight: 500;
	margin-bottom: 6px;
}
.swatches {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}
.swatch {
	width: 32px;
	height: 32px;
	border-radius: 8px;
	border: 0;
	cursor: pointer;
}
.swatch.on {
	outline: 3px solid var(--ink);
	outline-offset: 2px;
}
.swatches input[type='color'] {
	width: 44px;
	height: 32px;
	padding: 2px;
}
.upload-row {
	display: flex;
	gap: 10px;
	align-items: center;
}
.logo-thumb {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border: 1px solid var(--line);
	border-radius: 10px;
}
.cover-thumb {
	width: 120px;
	height: 68px;
	object-fit: cover;
	border-radius: 10px;
}
.preview-card {
	display: grid;
	place-items: center;
}
p.pill {
	display: inline-block;
}
.stats .pill.warn {
	margin-bottom: 12px;
}

/* Template picker */
.templates {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 8px;
}
.template {
	display: flex;
	flex-direction: column;
	gap: 4px;
	text-align: left;
	padding: 12px;
	border-radius: 12px;
	border: 2px solid var(--line);
	background: #fff;
	cursor: pointer;
	font: inherit;
}
.template span {
	font-size: 12px;
	color: var(--muted);
	line-height: 1.35;
}
.template.on {
	border-color: var(--accent);
	box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent) 25%, transparent);
}
.center {
	text-align: center;
}

/* Login, account and owner access */
.top-right {
	display: flex;
	align-items: center;
	gap: 12px;
}
.account {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 14px;
}
.account a {
	color: var(--ink);
	text-decoration: none;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.account a:hover {
	text-decoration: underline;
}
.wrap.narrow {
	max-width: 440px;
}
.btn.block {
	width: 100%;
	justify-content: center;
}
.form-error {
	color: var(--danger, #b91c1c);
	font-size: 14px;
	min-height: 1em;
	margin: 0 0 12px;
}
.secret {
	background: #fefce8;
	border: 1px solid #fde68a;
	border-radius: 10px;
	padding: 14px;
	margin: 12px 0;
}
.secret pre {
	white-space: pre-wrap;
	font:
		14px/1.5 ui-monospace,
		monospace;
	margin: 8px 0 12px;
}
.owner-info dt {
	font-size: 13px;
	color: var(--muted);
}
.owner-info dd {
	margin: 0 0 10px;
}
@media (max-width: 480px) {
	.account a {
		max-width: 110px;
	}
}
.narrow-card {
	max-width: 560px;
}
