:root {
	--bg: #e8edf1;
	--paper: #fff;
	--soft: #f4f7f9;
	--hover: #eef3f4;
	--ink: #152028;
	--muted: #4d5c66;
	--line: #c5d0d8;
	--accent: #0d5c58;
	--accent-ink: #fff;
	--danger: #8e1d1d;
	--danger-bg: #f8e4e4;
	--ok: #1b5e3b;
	--ok-bg: #e3f3ea;
	--warn-bg: #fff4d6;
	--warn: #6b5200;
	--nav: #102027;
	--nav-2: #18323c;
	--nav-ink: #f3f6f8;
	--nav-muted: #9fb0ba;
	--on: #fff;
	--on-ink: #102027;
	--input: #fff;
	--input-border: #8fa0ab;
	--solid: #102027;
	--solid-ink: #fff;
	--chip: #1d3a44;
	--chip-ink: #d5e6ec;
	--focus: #0b57d0;
	--overlay: rgba(16, 32, 39, 0.55);
	--sans: "Segoe UI", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
	--max: 1120px;
}
html { color-scheme: light; }
html.mel-night {
	color-scheme: dark;
	--bg: #0e1519;
	--paper: #162026;
	--soft: #1b272e;
	--hover: #22323a;
	--ink: #e8eef2;
	--muted: #9aadb8;
	--line: #2a3b44;
	--accent: #5ec4bb;
	--accent-ink: #0b1216;
	--danger: #f0a3a3;
	--danger-bg: #3a1e1e;
	--ok: #8fd4ad;
	--ok-bg: #173328;
	--warn-bg: #3a3218;
	--warn: #e6d08a;
	--nav: #0b1216;
	--nav-2: #10181d;
	--nav-ink: #e8eef2;
	--nav-muted: #8aa0ab;
	--on: #4db8af;
	--on-ink: #0b1216;
	--input: #121a1f;
	--input-border: #3a4d56;
	--solid: #4db8af;
	--solid-ink: #0b1216;
	--chip: #24343c;
	--chip-ink: #d5e6ec;
	--focus: #6aa8ff;
	--overlay: rgba(6, 10, 12, 0.72);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html {
	overflow-x: clip;
	max-width: 100%;
}
body {
	font-family: var(--sans);
	background: var(--bg);
	color: var(--ink);
	font-size: 14px;
	line-height: 1.35;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: clip;
}
a { color: var(--accent); }
a:hover { text-decoration: underline; }
@keyframes mel-spin {
	to { transform: rotate(360deg); }
}
.mel-spin {
	display: block;
	width: 22px;
	height: 22px;
	border: 2px solid var(--line);
	border-top-color: var(--accent);
	border-radius: 50%;
	animation: mel-spin 0.65s linear infinite;
	flex-shrink: 0;
}
.mel-loader {
	position: fixed;
	inset: 0;
	z-index: 240;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 12px;
	background: var(--overlay);
}
.mel-loader[hidden] { display: none !important; }
.mel-loader .mel-spin {
	width: 36px;
	height: 36px;
	border-width: 3px;
	border-color: rgba(243, 246, 248, 0.28);
	border-top-color: #5ec4bb;
}
.mel-loader-txt {
	margin: 0;
	font-size: 14px;
	font-weight: 650;
	color: #f3f6f8;
}
html.is-wait,
html.is-wait body { cursor: wait; }
:focus-visible {
	outline: 3px solid var(--focus);
	outline-offset: 2px;
}
.mel-hp {
	position: absolute !important;
	left: -9999px !important;
	height: 0 !important;
	width: 0 !important;
	opacity: 0 !important;
}
.mel-skip {
	position: absolute;
	left: -999px;
}
.mel-skip:focus {
	left: 8px;
	top: 8px;
	z-index: 50;
	background: var(--paper);
	color: var(--ink);
	padding: 8px 12px;
}
.mel-chrome {
	position: sticky;
	top: 0;
	left: 0;
	right: 0;
	z-index: 40;
	width: 100%;
	max-width: 100%;
	flex: 0 0 auto;
	box-sizing: border-box;
}
.mel-top {
	background: var(--nav);
	color: var(--nav-ink);
	position: relative;
	width: 100%;
	max-width: 100%;
	flex: 0 0 auto;
	/* stała szerokość = viewport, niezależnie od szerokich tabel na stronie */
	box-sizing: border-box;
}
.mel-crumb {
	background: #eef3f6;
	border-bottom: 1px solid var(--line, #d7e0e4);
	color: #5b6b75;
	font-size: 12px;
	line-height: 1.3;
	flex: 0 0 auto;
	width: 100%;
}
.mel-crumb-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 0;
	padding: 5px 0;
	min-width: 0;
}
.mel-crumb-sep {
	margin: 0 6px;
	color: #9aa8b2;
	font-weight: 500;
}
.mel-crumb-a {
	color: #3d4f5a;
	text-decoration: none;
	font-weight: 600;
}
.mel-crumb-a:hover { text-decoration: underline; color: var(--accent, #0f766e); }
.mel-crumb-here {
	color: #1f2d36;
	font-weight: 700;
	min-width: 0;
	overflow-wrap: anywhere;
}
html.mel-night .mel-crumb {
	background: #121a20;
	border-bottom-color: var(--line);
	color: #9aa8b2;
}
html.mel-night .mel-crumb-a { color: #c5d0d6; }
html.mel-night .mel-crumb-here { color: #e8eef2; }
html.mel-night .mel-crumb-sep { color: #5b6b75; }
@media (max-width: 760px) {
	.mel-crumb { font-size: 11px; }
	.mel-crumb-inner { padding: 4px 0; }
	.mel-crumb-sep { margin: 0 5px; }
	body.is-chat-open .mel-crumb { display: none; }
}
.mel-top a { color: var(--nav-ink); text-decoration: none; }
.mel-wrap {
	width: min(var(--max), calc(100% - 20px));
	max-width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}
.mel-top-row {
	display: flex;
	align-items: center;
	gap: 16px;
	min-height: 52px;
	padding: 6px 0;
}
.mel-brand {
	display: flex;
	align-items: center;
	gap: 2px;
	flex: 0 0 auto;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-decoration: none;
	white-space: nowrap;
}
.mel-brand:hover { text-decoration: none; opacity: 0.9; }
.mel-brand-mark {
	display: block;
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	background: transparent;
}
.mel-brand-words {
	display: flex;
	align-items: baseline;
	min-width: 0;
	transform: translateY(1px);
	font-size: 19px;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
	white-space: nowrap;
}
.mel-brand-words.is-lg,
.mel-login-brand .mel-brand-words {
	font-size: 28px;
}
.mel-brand-me { color: #fff; }
.mel-brand-rest { color: #10d918; }
.mel-login-brand .mel-brand-me { color: var(--ink); }
.mel-login-brand .mel-brand-rest { color: #10d918; }
html.mel-night .mel-login-brand .mel-brand-me { color: #fff; }
html.mel-night .mel-login-brand .mel-brand-rest { color: #10d918; }
.mel-top-end {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-width: 0;
	gap: 8px;
}
.mel-clocks {
	display: flex;
	align-items: stretch;
	justify-content: center;
	flex: 1 1 auto;
	min-width: 0;
	font-variant-numeric: tabular-nums;
	color: var(--nav-ink);
}
.mel-clock {
	display: flex;
	align-items: baseline;
	gap: 6px;
	padding: 0 14px;
	white-space: nowrap;
}
.mel-clock + .mel-clock {
	border-left: 1px solid rgba(255,255,255,0.14);
}
.mel-clock-tz {
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--nav-muted);
}
.mel-clock time {
	font-size: 14px;
	font-weight: 650;
	letter-spacing: 0.02em;
}
.mel-clock-short { display: none; }
body.is-guest .mel-clocks { display: none; }
.mel-top-tools {
	display: flex;
	align-items: center;
	gap: 12px;
	flex: 0 0 auto;
	margin-left: auto;
}
.mel-prefs {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	flex: 0 0 auto;
}
.mel-prefs.is-compact { display: none; }
.mel-night-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 28px;
	padding: 0;
	border: 1px solid rgba(255,255,255,0.16);
	border-radius: 4px;
	background: rgba(255,255,255,0.08);
	color: var(--nav-ink);
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}
.mel-night-btn:hover { background: rgba(255,255,255,0.14); }
.mel-night-ico {
	display: block;
	width: 18px;
	height: 18px;
}
.mel-night-btn .mel-night-sun { display: none; }
html.mel-night .mel-night-btn .mel-night-moon { display: none; }
html.mel-night .mel-night-btn .mel-night-sun { display: block; }
.mel-flags {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	padding: 2px;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 6px;
}
.mel-flag {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border: 0;
	background: transparent;
	color: var(--nav-muted);
	padding: 4px 7px;
	border-radius: 4px;
	cursor: pointer;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none;
	line-height: 1;
}
.mel-flag:hover { background: rgba(255,255,255,0.1); color: var(--nav-ink); text-decoration: none; }
.mel-flag.is-on {
	background: var(--on);
	color: var(--on-ink);
}
.mel-flag svg { display: block; width: 14px; height: 10px; }
.mel-lang.is-compact { display: none; }
.mel-lang.is-row .mel-lang-list {
	display: inline-flex;
	align-items: center;
	gap: 1px;
	padding: 2px;
	background: rgba(255,255,255,0.06);
	border: 1px solid rgba(255,255,255,0.1);
	border-radius: 6px;
}
.mel-lang-now {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 32px;
	height: 28px;
	padding: 0;
	border: 1px solid rgba(255,255,255,0.16);
	border-radius: 4px;
	background: rgba(255,255,255,0.08);
	color: #fff;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
}
.mel-lang-now svg { display: block; width: 18px; height: 12px; }
.mel-who {
	display: flex;
	align-items: center;
	gap: 8px;
	padding-left: 12px;
	border-left: 1px solid rgba(255,255,255,0.14);
	font-size: 13px;
}
.mel-who form { margin: 0; }
.mel-who-name {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--nav-ink);
	font-weight: 600;
	text-decoration: none;
	max-width: 16rem;
}
.mel-who-name:hover { text-decoration: none; opacity: 0.88; }
.mel-who-name > span:first-child {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mel-badge {
	display: inline-block;
	padding: 2px 7px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	background: var(--chip);
	color: var(--chip-ink);
	white-space: nowrap;
}
.mel-logout {
	background: transparent;
	border: 1px solid rgba(255,255,255,0.2);
	color: var(--nav-ink);
	padding: 4px 10px;
	border-radius: 4px;
	font: inherit;
	font-size: 12px;
	font-weight: 650;
	cursor: pointer;
	white-space: nowrap;
}
.mel-logout:hover { background: rgba(255,255,255,0.1); }
.mel-nav {
	background: var(--nav-2);
	border-top: 1px solid rgba(255,255,255,0.08);
	width: 100%;
	max-width: 100%;
}
.mel-nav-inner {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px;
	padding: 4px 0;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
}
.mel-nav a, .mel-nav span {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px;
	color: var(--nav-ink);
	text-decoration: none;
	font-weight: 600;
	font-size: 13px;
	border-radius: 4px;
}
.mel-nav a:hover { background: rgba(255,255,255,0.08); text-decoration: none; }
.mel-top .mel-nav a.is-on {
	background: var(--on);
	color: var(--on-ink);
	font-weight: 750;
}
.mel-top .mel-nav a.is-on span:not(.mel-nav-dot) {
	color: var(--on-ink);
}
.mel-nav span.is-off {
	color: var(--nav-muted);
	font-weight: 500;
	cursor: default;
}
.mel-nav-dot {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 18px;
	height: 18px;
	padding: 0 5px;
	border-radius: 999px;
	background: #c62828;
	color: #fff;
	font-size: 11px;
	font-weight: 800;
	line-height: 1;
	letter-spacing: 0;
	flex: 0 0 auto;
}
.mel-attn-dot {
	display: inline-block;
	width: 8px;
	height: 8px;
	margin-right: 6px;
	border-radius: 50%;
	background: #c62828;
	vertical-align: middle;
	flex: 0 0 auto;
}
.ord-pay-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ord-pay-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}
.ord-pay-row .ord-pay-edit {
	width: 100%;
	margin: 0;
}
.mel-flow-ord-card.is-attn,
.mel-carton-row.is-attn {
	box-shadow: inset 3px 0 0 #c62828;
}
tr.is-attn > td:first-child {
	box-shadow: inset 3px 0 0 #c62828;
}
.mel-main {
	flex: 1 1 auto;
	padding: 12px 0 24px;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow-x: auto;
}
.mel-h1 { margin: 0; font-size: 20px; letter-spacing: -0.02em; }
.mel-lead { margin: 0 0 10px; color: var(--muted); max-width: 40rem; font-size: 13px; }
.mel-flash {
	padding: 7px 10px;
	border-radius: 4px;
	margin: 0 0 10px;
	border: 1px solid transparent;
	font-size: 13px;
}
.mel-flash.err { background: var(--danger-bg); color: var(--danger); border-color: #e3b4b4; }
.mel-flash.ok { background: var(--ok-bg); color: var(--ok); border-color: #b7dcc7; }
.mel-flash.warn { background: var(--warn-bg); color: var(--warn); border-color: #e6d59a; }
.mel-tenant-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	flex-wrap: wrap;
	padding: 8px 10px;
	margin: 0 0 10px;
	border-radius: 4px;
	border: 1px solid var(--line);
	background: var(--warn-bg);
	color: var(--warn);
	font-size: 13px;
}
.mel-tenant-bar form { margin: 0; }
.mel-table tr.is-on td { background: var(--soft); }
.mel-card {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 10px 12px;
	margin-bottom: 10px;
}
.mel-h2 { margin: 0 0 8px; font-size: 15px; }
.mel-grid { display: grid; gap: 8px; }
.mel-kpis {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
	gap: 8px;
	margin: 0 0 10px;
}
.mel-kpi {
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 8px 10px;
	text-decoration: none;
	color: inherit;
	display: block;
}
.mel-kpi b {
	display: block;
	font-size: 20px;
	font-variant-numeric: tabular-nums;
	letter-spacing: -0.03em;
	line-height: 1.15;
}
.mel-kpi span { color: var(--muted); font-size: 12px; font-weight: 600; }
a.mel-kpi:hover { border-color: var(--accent); text-decoration: none; }
a.mel-kpi.is-on {
	border-color: var(--accent);
	box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent);
}
.mel-form-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0 0 8px;
}
.mel-form-head h2 { margin: 0; font-size: 16px; }
.mel-group {
	margin: 0 0 8px;
	padding: 8px 10px;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 4px;
}
.mel-group h3 {
	margin: 0 0 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
}
.mel-fields {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 8px 10px;
	min-width: 0;
}
.mel-user-edit { padding: 10px 12px; }
.mel-user-edit .mel-form-head { margin: 0 0 8px; }
.mel-user-edit .mel-fields { gap: 8px 10px; }
.mel-user-edit .mel-field { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.mel-user-edit .mel-field[hidden] { display: none; }
.mel-user-edit .mel-field label { margin: 0; }
.mel-user-edit .mel-field input:not([type="checkbox"]):not([type="radio"]),
.mel-user-edit .mel-field select {
	width: 100%;
	height: 32px;
	box-sizing: border-box;
}
.mel-user-edit .mel-hint { margin: 0; line-height: 1.35; min-height: 16px; }
.mel-user-pass {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 0;
}
.mel-user-pass input[type="password"] {
	flex: 1 1 160px;
	min-width: 0;
}
.mel-user-flag {
	flex: 0 1 auto;
	margin: 0;
	padding: 0;
	align-items: center;
	white-space: nowrap;
	font-weight: 600;
}
.mel-user-flag input { width: auto; height: auto; margin: 0; }
.mel-user-edit .mel-actions { margin-top: 8px; }
.mel-form input.is-bad,
.mel-form select.is-bad {
	border-color: var(--danger);
	background: var(--danger-bg);
	box-shadow: 0 0 0 1px var(--danger);
}
.mel-form input.is-bad:focus,
.mel-form select.is-bad:focus {
	border-color: var(--danger);
}
.mel-fields-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mel-two .mel-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.mel-field {
	min-width: 0;
	display: flex;
	flex-direction: column;
}
.mel-field > input,
.mel-field > select,
.mel-field > textarea {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	box-sizing: border-box;
}
.mel-field > input[type="date"] {
	min-height: 32px;
	height: 32px;
}
.mel-flow-pkg-work .mel-fields-2 .mel-field > input:not([type="checkbox"]):not([type="radio"]),
.mel-flow-pkg-work .mel-fields-2 .mel-field > select,
.mel-flow-shp-work .mel-fields-2 .mel-field > input:not([type="checkbox"]):not([type="radio"]),
.mel-flow-shp-work .mel-fields-2 .mel-field > select {
	height: 34px;
	width: 100%;
	min-width: 0;
	box-sizing: border-box;
}
.mel-span-2 { grid-column: span 2; }
.mel-span-3 { grid-column: 1 / -1; }
.mel-form label {
	display: block;
	font-weight: 600;
	margin: 0 0 3px;
	font-size: 12px;
	color: var(--ink);
}
.mel-form > label { margin: 8px 0 3px; }
.mel-field label { margin: 0 0 3px; }
.mel-form input[type="text"],
.mel-form input[type="email"],
.mel-form input[type="password"],
.mel-form input[type="tel"],
.mel-form input[type="date"],
.mel-form input[type="number"],
.mel-form select,
.mel-form textarea {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	font: inherit;
	font-size: 13px;
	padding: 5px 8px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-form textarea {
	min-height: 42px;
	height: auto;
	resize: vertical;
	line-height: 1.35;
}
.mel-form input:focus, .mel-form select:focus, .mel-form textarea:focus {
	border-color: var(--focus);
}
.mel-pick {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 4px;
}
.mel-pass-wrap { position: relative; }
.mel-pass-wrap button {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	border: 0;
	background: transparent;
	color: var(--muted);
	font: inherit;
	font-size: 12px;
	font-weight: 700;
	cursor: pointer;
	padding: 4px;
}
.mel-check {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 8px 0;
	font-weight: 500;
	font-size: 13px;
}
.mel-check input { margin: 0; }
.mel-pick .mel-check {
	margin: 0;
	padding: 4px 8px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 3px;
}
.mel-hint { color: var(--muted); font-size: 12px; margin: 2px 0 0; }
.mel-caps { display: none; color: var(--warn); font-weight: 700; font-size: 12px; margin-top: 4px; }
.mel-caps.is-on { display: block; }
.mel-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
	margin-top: 8px;
	padding-top: 8px;
	border-top: 1px solid var(--line);
}
.mel-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--accent);
	color: var(--accent-ink);
	border: 1px solid var(--accent);
	padding: 5px 12px;
	border-radius: 3px;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	cursor: pointer;
	text-decoration: none;
}
.mel-btn:hover { filter: brightness(1.06); text-decoration: none; color: var(--accent-ink); }
.mel-btn[disabled] { opacity: 0.6; cursor: not-allowed; }
.mel-btn-ghost {
	background: var(--paper);
	color: var(--ink);
	border-color: var(--line);
}
.mel-btn-ghost:hover { color: var(--ink); }
.mel-btn-danger { background: var(--danger); border-color: var(--danger); }
.mel-link { font-weight: 650; }
button.mel-link {
	display: inline;
	background: none;
	border: 0;
	padding: 0;
	margin: 0;
	color: var(--accent);
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}
button.mel-link:hover { text-decoration: underline; }
@media (max-width: 760px) {
	a.mel-link,
	button.mel-link {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		min-height: 36px;
		padding: 7px 12px;
		margin: 0;
		border: 1px solid var(--line, #d7e0e4);
		border-radius: 3px;
		background: var(--paper, #fff);
		color: var(--ink, #0f172a);
		font: inherit;
		font-size: 13px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none;
		text-align: center;
		white-space: nowrap;
		box-sizing: border-box;
		cursor: pointer;
	}
	a.mel-link:hover,
	button.mel-link:hover {
		filter: brightness(0.98);
		text-decoration: none;
		color: var(--ink, #0f172a);
	}
	a.mel-link.is-danger,
	button.mel-link.is-danger {
		color: var(--danger, #b91c1c);
		border-color: color-mix(in srgb, var(--danger, #b91c1c) 35%, var(--line, #d7e0e4));
	}
	.mel-td-actions,
	.mel-flow-ord-actions,
	.mel-carton-actions,
	.mel-scan-lists,
	.mel-scan-list-actions {
		display: flex;
		flex-wrap: wrap;
		gap: 8px;
		align-items: stretch;
		white-space: normal;
	}
	.mel-td-actions .mel-inline,
	.mel-flow-ord-actions .mel-inline {
		display: contents;
	}
	.mel-td-actions a.mel-link,
	.mel-td-actions button.mel-link,
	.mel-flow-ord-actions a.mel-link,
	.mel-flow-ord-actions button.mel-link,
	.mel-carton-actions .mel-btn,
	.mel-scan-list-go {
		flex: 1 1 calc(50% - 8px);
	}
	.mel-carton-more > summary,
	.mel-scan-more > summary,
	.mel-scan-list .mel-scan-more > summary {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		flex: 1 1 calc(50% - 8px);
		min-height: 36px;
		padding: 7px 12px !important;
		margin: 0;
		border: 1px solid var(--line, #d7e0e4);
		border-radius: 3px;
		background: var(--paper, #fff);
		color: var(--ink, #0f172a) !important;
		font: inherit;
		font-size: 13px;
		font-weight: 700;
		line-height: 1.2;
		text-decoration: none;
		text-align: center;
		white-space: nowrap;
		box-sizing: border-box;
		cursor: pointer;
		width: 100%;
		list-style: none;
	}
	.mel-carton-more > summary::-webkit-details-marker,
	.mel-scan-more > summary::-webkit-details-marker { display: none; }
	.mel-scan-list .mel-scan-more > summary::before { content: none !important; }
	a.mel-link.mel-scan-list-go {
		display: flex;
		width: 100%;
		margin-top: 8px;
	}
}
.mel-login-box { max-width: 380px; margin: 0 auto; }
.mel-login-brand {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0 0 16px;
	font-weight: 700;
	font-size: 22px;
	letter-spacing: 0.02em;
	color: var(--ink);
}
.mel-login-brand > img {
	display: block;
	width: 56px;
	height: 56px;
	flex-shrink: 0;
	background: transparent;
}
.mel-login-brand .mel-brand-words {
	transform: translateY(2px);
}
.mel-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.mel-table th, .mel-table td {
	text-align: left;
	padding: 5px 8px;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}
.mel-table th { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; }
.mel-two {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	min-width: 0;
}
.mel-two > * { min-width: 0; }
.dash-ops {
	display: flex;
	flex-direction: column;
	gap: 14px;
}
.dash-ops-block + .dash-ops-block {
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.dash-ops-h {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 0 0 8px;
}
.dash-ops-h strong { font-size: 14px; }
.dash-ops-counts {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}
.dash-ops-counts a {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	background: var(--bg, transparent);
}
.dash-ops-counts a:hover { border-color: var(--accent); }
.dash-ops-n {
	font-weight: 800;
	font-size: 15px;
	letter-spacing: -0.02em;
}
.dash-ops-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.dash-ops-list li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 8px;
	font-size: 13px;
	min-width: 0;
}
.dash-ops-src {
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	max-width: 100%;
}
.mel-foot {
	border-top: 1px solid var(--line);
	padding: 14px 0;
	color: var(--muted);
	font-size: 13px;
	background: var(--paper);
}
.mel-guest-main { padding: 20px 0 36px; }
.mel-muted { color: var(--muted); }
noscript p { margin: 0 0 8px; }
.mel-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	margin: 0 0 8px;
}
.mel-toolbar .mel-h1 { margin: 0; flex: 1 1 auto; min-width: 0; }
.mel-toolbar .mel-h2 { margin: 0; }
.mel-page-lead {
	margin: -2px 0 10px;
	color: var(--muted);
	font-size: 13px;
	line-height: 1.4;
	max-width: 52rem;
}
.mel-sec-label {
	margin: 8px 0 6px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--muted);
}
.mel-field.is-full { grid-column: 1 / -1; }
.mel-form.is-block { margin-bottom: 12px; }
.mel-form.is-split {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--line);
}
.mel-form.is-split > h3 {
	margin: 0 0 8px;
	font-size: 13px;
	font-weight: 700;
}
.mel-inline-form {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px;
	margin: 0;
	vertical-align: middle;
}
.mel-inline-form select {
	font: inherit;
	font-size: 12px;
	padding: 3px 6px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
	max-width: 11rem;
}
.mel-inline-form .mel-btn {
	padding: 3px 8px;
	font-size: 12px;
	min-height: 0;
}
form.mel-inline { display: inline; margin: 0; }
.mel-link.is-danger,
button.mel-link.is-danger { color: var(--danger); }
.mel-list-plain {
	margin: 0;
	padding-left: 1.2rem;
	color: var(--muted);
	font-size: 12px;
	line-height: 1.45;
}
.mel-list-plain li { margin: 0 0 2px; }
.mel-pick-tools {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin: 0 0 6px;
}
.mel-pick-tools .mel-hint { margin: 0; }
.mel-input-sm {
	width: 5rem !important;
	max-width: 100%;
}
.mel-card > h2,
.mel-card > h3 {
	margin: 0 0 8px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.mel-card > h3 { font-size: 13px; color: var(--muted); text-transform: none; letter-spacing: 0; }
.mel-card .mel-table { margin-top: 4px; }
.mel-actions.is-loose {
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
}
.mel-actions.is-tight { margin-top: 6px; }
.mel-pkg-pick-cartons {
	display: flex;
	flex-direction: column;
	gap: 8px;
	margin-top: 8px;
}
.mel-pkg-pick-check {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	cursor: pointer;
	flex: 0 0 auto;
}
.mel-pkg-pick-check input {
	width: 18px;
	height: 18px;
	margin: 0;
}
.mel-pkg-pick-cartons .mel-carton-summary {
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
}
.mel-pkg-pick-jobs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 10px;
	font-size: 12px;
	color: var(--muted);
}
.mel-pkg-toolbar {
	flex-wrap: nowrap;
	gap: 8px;
	margin-top: 12px;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}
.mel-pkg-toolbar .mel-btn {
	flex: 0 0 auto;
	white-space: nowrap;
}
.mel-table td.mel-td-actions {
	white-space: nowrap;
	vertical-align: middle;
}
.mel-table .mel-inline-form { white-space: normal; }
.mel-group + .mel-actions { margin-top: 10px; }
.mel-form-zero { margin: 0; }
.mel-st {
	display: inline-block;
	padding: 1px 7px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	background: #e8eef2;
	color: #1d3a44;
	margin-left: 6px;
	vertical-align: middle;
}
.mel-table input:not([type="hidden"]) {
	width: 100%;
	font: inherit;
	font-size: 13px;
	padding: 4px 6px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-table input[type="hidden"] {
	display: none !important;
}
.mel-search {
	display: flex;
	gap: 6px;
	align-items: center;
	flex: 1;
	justify-content: flex-end;
	min-width: 0;
}
.mel-search input[type="search"] {
	min-width: 0;
	width: min(240px, 100%);
	font: inherit;
	font-size: 13px;
	padding: 5px 8px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-empty {
	text-align: center;
	padding: 14px 8px;
}
.mel-empty p { margin: 0 0 8px; }
.mel-table-wrap { overflow-x: auto; }
.mel-table tr.is-inactive td { color: var(--muted); }
.mel-table tbody tr:hover td { background: var(--hover); }
.mel-scan-inbox {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.mel-scan-list {
	display: flex;
	flex-direction: column;
	gap: 0;
	border: 1px solid var(--line);
	border-radius: 8px;
	padding: 0;
	background: var(--paper);
	overflow: hidden;
}
.mel-scan-list-head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px 18px;
	padding: 10px 12px;
}
.mel-scan-list-who {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 4px;
	min-width: 0;
	flex: 1 1 auto;
}
.mel-scan-list-titleline {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 8px;
	min-width: 0;
}
.mel-scan-list-head strong {
	font-size: 14px;
	font-weight: 750;
	line-height: 1.25;
}
.mel-scan-list-sub {
	font-size: 12px;
	font-weight: 500;
	color: var(--muted);
	overflow-wrap: anywhere;
}
.mel-scan-list-aside {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
	flex: 0 0 auto;
	min-width: 9.5rem;
}
.mel-scan-prog {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	grid-template-areas:
		"main lines"
		"bar bar";
	gap: 2px 10px;
	align-items: end;
	min-width: 9.5rem;
	max-width: 14rem;
	padding: 0;
	border: 0;
	background: transparent;
}
.mel-scan-prog-main {
	grid-area: main;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0;
	min-width: 0;
}
.mel-scan-prog-ratio {
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}
.mel-scan-prog-ratio b {
	font-size: 18px;
	font-weight: 800;
	color: var(--ink);
}
.mel-scan-prog-ratio b.is-scan { color: var(--accent); }
.mel-scan-prog-ratio i {
	font-style: normal;
	font-size: 14px;
	font-weight: 600;
	color: var(--muted);
	padding: 0 1px;
}
.mel-scan-prog-lab {
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.01em;
	color: var(--muted);
	line-height: 1.2;
	white-space: nowrap;
}
.mel-scan-prog-lines {
	grid-area: lines;
	font-size: 11px;
	font-weight: 650;
	color: var(--muted);
	white-space: nowrap;
	padding-bottom: 1px;
}
.mel-scan-prog-bar {
	grid-area: bar;
	height: 3px;
	border-radius: 999px;
	background: rgba(15, 23, 42, 0.08);
	overflow: hidden;
	margin-top: 2px;
}
.mel-scan-prog-bar > span {
	display: block;
	height: 100%;
	border-radius: inherit;
	background: var(--accent);
}
.mel-scan-prog.is-partial .mel-scan-prog-ratio b.is-scan { color: #9a6b00; }
.mel-scan-prog.is-partial .mel-scan-prog-bar > span { background: #b08900; }
.mel-scan-prog.is-ok .mel-scan-prog-ratio b.is-scan { color: #1b6b3c; }
.mel-scan-prog.is-ok .mel-scan-prog-bar > span { background: #2f7a4a; }
.mel-scan-facts {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 2px 0;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ink);
}
.mel-scan-fact { white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.mel-scan-fact-k {
	color: var(--muted);
	font-weight: 600;
}
.mel-scan-fact-k::after { content: ":"; }
.mel-scan-fact-sep {
	margin: 0 7px;
	color: var(--muted);
	font-weight: 500;
}
.mel-scan-list-lab {
	color: var(--muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.03em;
	text-transform: uppercase;
}
.mel-scan-list-row {
	display: grid;
	grid-template-columns: minmax(7.2rem, 34%) 1fr;
	gap: 8px;
	align-items: start;
	padding: 6px 10px;
	border-top: 1px solid #edf1f4;
}
.mel-scan-list-val {
	min-width: 0;
	font-size: 13px;
	line-height: 1.4;
	overflow-wrap: anywhere;
}
.mel-scan-list-val b { font-weight: 700; }
.mel-scan-list-sep {
	margin: 0 4px;
	color: var(--muted);
}
.mel-scan-list-go {
	display: block;
	border-top: 1px solid var(--line);
	padding: 8px 10px;
	margin-top: 2px;
}
.mel-scan-list .mel-scan-more { min-width: 0; }
.mel-scan-list .mel-scan-more > summary { padding: 0; }
.mel-scan-more-block {
	margin: 0 12px;
	padding: 6px 0 2px;
	border-top: 1px solid #edf1f4;
}
.mel-scan-list-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
	justify-content: space-between;
	padding: 8px 12px 10px;
	border-top: 1px solid #edf1f4;
	background: #f7fafb;
}
.mel-scan-list-actions-main,
.mel-scan-list-actions-side {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	align-items: center;
}
.mel-scan-list-actions .mel-inline { display: contents; }
.mel-scan-list-actions .mel-btn {
	flex: 0 0 auto;
	min-height: 32px;
	min-width: 0;
	padding: 5px 12px;
	font-size: 13px;
	font-weight: 650;
	border-radius: 6px;
}
.mel-scan-list-actions .mel-btn.is-warn {
	color: #8a5a00;
	border-color: #e0c48a;
	background: #fff8e8;
}
.mel-scan-list-actions .mel-btn.is-warn:hover { filter: none; background: #fff1d4; color: #8a5a00; }
.mel-scan-list.is-detail .mel-scan-list-actions { background: #f7fafb; }
@media (max-width: 760px) {
	.mel-scan-list-head {
		flex-direction: column;
		align-items: stretch;
		gap: 8px;
		padding: 10px;
	}
	.mel-scan-list-aside {
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		min-width: 0;
		width: 100%;
	}
	.mel-scan-prog {
		min-width: 0;
		max-width: none;
		flex: 1 1 auto;
	}
	.mel-scan-facts { font-size: 12px; }
	.mel-scan-list-actions {
		padding: 8px 10px 10px;
		flex-direction: column;
		align-items: stretch;
	}
	.mel-scan-list-actions-main,
	.mel-scan-list-actions-side {
		width: 100%;
	}
	.mel-scan-list-actions .mel-btn {
		flex: 1 1 calc(50% - 6px);
		min-height: 36px;
		justify-content: center;
		text-align: center;
	}
	.mel-scan-more-block { margin: 0 10px; }
}
.mel-scan-more {
	font-size: 13px;
	min-width: 0;
}
.mel-scan-more > summary {
	cursor: pointer;
	font-weight: 650;
	color: var(--accent);
	list-style: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 0;
}
.mel-scan-more > summary::-webkit-details-marker { display: none; }
.mel-scan-more > summary::before {
	content: "▸";
	color: var(--muted);
	font-size: 11px;
}
.mel-scan-more[open] > summary::before { content: "▾"; }
.mel-scan-hist {
	margin: 8px 0 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.mel-scan-hist li {
	padding: 0;
	border: 0;
	margin: 0;
}
.mel-scan-ev {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 10px;
	padding: 5px 8px 5px 9px;
	border: 1px solid var(--line);
	border-left-width: 3px;
	border-radius: 8px;
	background: var(--soft);
	min-width: 0;
	overflow-wrap: normal;
	word-break: normal;
	font-size: 12px;
	line-height: 1.35;
}
.mel-scan-ev.is-create { border-left-color: #5b4a1f; }
.mel-scan-ev.is-save { border-left-color: #1b5e3b; }
.mel-scan-ev.is-send { border-left-color: #0d5c58; }
.mel-scan-ev.is-open { border-left-color: #1d3a6b; }
.mel-scan-ev.is-cancel { border-left-color: #8e1d1d; }
.mel-scan-ev-act {
	display: inline-block;
	padding: 0 7px;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 700;
	line-height: 1.6;
	background: #e8eef2;
	color: #1d3a44;
}
.mel-scan-ev.is-create .mel-scan-ev-act { background: #f4efe0; color: #5b4a1f; }
.mel-scan-ev.is-save .mel-scan-ev-act { background: #e3f3ea; color: #1b5e3b; }
.mel-scan-ev.is-send .mel-scan-ev-act { background: #e6f3f2; color: #0d5c58; }
.mel-scan-ev.is-open .mel-scan-ev-act { background: #e7eef8; color: #1d3a6b; }
.mel-scan-ev.is-cancel .mel-scan-ev-act { background: #f8e4e4; color: #8e1d1d; }
.mel-scan-ev-when {
	color: var(--muted);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.mel-scan-ev-who {
	font-weight: 650;
	color: var(--ink);
	max-width: 120px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mel-scan-ev-meta {
	margin-left: auto;
	color: var(--muted);
	white-space: nowrap;
}
.mel-scan-items {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.mel-scan-item {
	display: grid;
	grid-template-columns: 48px minmax(0, 1fr) auto;
	gap: 10px;
	align-items: center;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 6px;
	background: var(--soft, #f7fafb);
}
.mel-scan-item.is-partial { border-color: #c9a227; }
.mel-scan-item.is-ok { border-color: #2f7a4a; background: #f3faf5; }
.mel-scan-item.is-over { border-color: #b45309; background: #fff8f0; }
.mel-scan-item-img,
.mel-scan-item-ph {
	width: 48px;
	height: 48px;
	border-radius: 4px;
	object-fit: cover;
	background: #dfe6eb;
}
.mel-scan-item-name {
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.25;
}
.mel-scan-item-meta {
	margin: 2px 0 0;
	font-size: 12px;
	color: var(--muted);
	overflow-wrap: anywhere;
}
.mel-scan-item-qty {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 1px;
	font-size: 13px;
	text-align: right;
}
.mel-scan-item-ratio {
	display: inline-flex;
	align-items: baseline;
	gap: 3px;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}
.mel-scan-item-ratio b {
	font-size: 16px;
	font-weight: 800;
}
.mel-scan-item-ratio b.is-scan { color: var(--accent); }
.mel-scan-item-ratio i {
	font-style: normal;
	font-size: 13px;
	font-weight: 600;
	color: var(--muted);
}
.mel-scan-item-ratio-lab {
	font-size: 10px;
	font-weight: 600;
	color: var(--muted);
	white-space: nowrap;
}
.mel-scan-item.is-ok .mel-scan-item-ratio b.is-scan { color: #1b6b3c; }
.mel-scan-item.is-partial .mel-scan-item-ratio b.is-scan { color: #9a6b00; }
.mel-scan-item.is-over .mel-scan-item-ratio b.is-scan { color: #b45309; }
.mel-scan-list.is-detail {
	margin-bottom: 0;
}
.mel-scan-ev-meta b {
	color: var(--ink);
	font-weight: 700;
	font-variant-numeric: tabular-nums;
}
.mel-st.is-open { background: #e8eef2; color: #1d3a44; }
.mel-st.is-run { background: #fff4d6; color: #6b5200; }
.mel-st.is-ready { background: #e3f3ea; color: #1b5e3b; }
.mel-st.is-pack { background: #e7eef8; color: #1d3a6b; }
.mel-st.is-ship { background: #e6f3f2; color: #0d5c58; }
.mel-st.is-done { background: #d5e6d9; color: #1b5e3b; }
.mel-st.is-off { background: #f8e4e4; color: #8e1d1d; }
.mel-st.is-active { background: #d7ecff; color: #134a72; }
.mel-st.is-picked { background: #e3f3ea; color: #1b5e3b; }
.mel-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	margin: 0 0 10px;
	border-bottom: 1px solid var(--line);
}
.mel-tabs a {
	padding: 7px 12px;
	margin-bottom: -1px;
	border: 0;
	border-bottom: 2px solid transparent;
	border-radius: 0;
	background: transparent;
	color: var(--muted);
	font-size: 13px;
	font-weight: 650;
	text-decoration: none;
}
.mel-tabs a:hover { color: var(--ink); text-decoration: none; }
.mel-tabs a.is-on {
	background: transparent;
	color: var(--ink);
	border-bottom-color: var(--accent);
}
.mel-secnav {
	display: flex;
	margin: 0 0 12px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
}
.mel-secnav a {
	flex: 1;
	text-align: center;
	padding: 8px 10px;
	color: var(--muted);
	font-size: 13px;
	font-weight: 700;
	text-decoration: none;
	border-right: 1px solid var(--line);
}
.mel-secnav a:last-child { border-right: 0; }
.mel-secnav a:hover { background: #f4f7f9; color: var(--ink); text-decoration: none; }
.mel-secnav a.is-on {
	background: var(--nav);
	color: #fff;
}
.mel-perm-side {
	margin: 0 0 18px;
	padding: 12px 12px 8px;
	border: 1px solid var(--line);
	border-radius: 8px;
	background: var(--paper);
}
.mel-perm-side h2 {
	margin: 0 0 10px;
	font-size: 16px;
}
.mel-perm-scroll { overflow-x: auto; }
.mel-perm-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 13px;
}
.mel-perm-table th,
.mel-perm-table td {
	padding: 8px 10px;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
	text-align: left;
}
.mel-perm-table thead th {
	font-size: 12px;
	font-weight: 800;
	white-space: nowrap;
	background: var(--soft);
}
.mel-perm-table tbody th {
	min-width: 220px;
	font-weight: 700;
}
.mel-perm-table tbody th small {
	display: block;
	margin-top: 2px;
	font-weight: 500;
	color: var(--muted);
	line-height: 1.35;
}
.mel-perm-table td { min-width: 132px; }
.mel-perm-group th {
	padding-top: 14px;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--muted);
	background: var(--soft);
	border-bottom-color: var(--line);
}
.mel-perm-tick {
	display: inline-flex;
	align-items: center;
	margin: 0;
	cursor: pointer;
}
.mel-perm-table select { width: 100%; max-width: 220px; }
.mel-perm-add { margin-top: 8px; padding: 14px 16px; }
.mel-perm-add h2 { margin: 0 0 6px; font-size: 16px; }
.mel-perm-sides {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 16px;
	margin: 10px 0;
	padding: 0;
	border: 0;
}
.mel-perm-sides legend { font-weight: 700; font-size: 13px; margin-bottom: 4px; }
.mel-perm-extra {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 12px;
	padding-top: 10px;
	border-top: 1px solid var(--line);
}
.mel-perm-extra form {
	display: flex;
	align-items: center;
	gap: 8px;
}
.mel-steps {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin: 0 0 10px;
	background: var(--paper);
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
}
.mel-steps.is-2 { grid-template-columns: 1fr 1fr; }
.mel-steps.is-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.mel-step {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	padding: 10px 12px;
	color: inherit;
	text-decoration: none;
	border-right: 1px solid var(--line);
	min-width: 0;
}
.mel-step:last-child { border-right: 0; }
.mel-step:hover { background: #f4f7f9; text-decoration: none; }
.mel-step.is-on { background: #f3f8f7; box-shadow: inset 0 -3px 0 var(--accent); }
.mel-step-n {
	flex: 0 0 22px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 3px;
	background: #e8eef2;
	color: var(--muted);
	font-size: 12px;
	font-weight: 800;
}
.mel-step.is-on .mel-step-n {
	background: var(--accent);
	color: #fff;
}
.mel-step-body {
	min-width: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.mel-step-body b {
	display: inline;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: -0.01em;
}
.mel-step-body .mel-nav-dot {
	min-width: 16px;
	height: 16px;
	font-size: 10px;
}
.mel-step-body small {
	display: block;
	margin-top: 2px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 500;
	line-height: 1.3;
}
.mel-list-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 8px;
	padding-bottom: 8px;
	border-bottom: 1px solid var(--line);
}
.mel-filter {
	display: flex;
	align-items: center;
	gap: 6px;
}
.mel-filter label {
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
}
.mel-filter select {
	font: inherit;
	font-size: 13px;
	padding: 4px 8px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-filter-tree {
	margin-left: 8px;
	font-weight: 600;
	color: var(--ink);
	white-space: nowrap;
}
.mel-user-group td {
	background: var(--soft);
	border-top: 1px solid var(--line);
	padding-top: 10px;
	padding-bottom: 8px;
}
.mel-user-group-lab {
	display: inline-block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	color: var(--muted);
}
.mel-user-tree {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding-left: calc(var(--mel-tree-d, 1) * 1.15rem);
}
.mel-user-tree-guide {
	display: inline-block;
	width: 0.7rem;
	height: 0.7rem;
	border-left: 2px solid var(--line);
	border-bottom: 2px solid var(--line);
	margin-top: -0.35rem;
	flex: 0 0 auto;
}
.mel-user-depth-2 .mel-user-tree-name {
	font-weight: 500;
}
.mel-table tr.mel-user-depth-1 td:first-child,
.mel-table tr.mel-user-depth-2 td:first-child {
	background: transparent;
}

.mel-dl {
	display: grid;
	grid-template-columns: 8.5rem 1fr;
	gap: 4px 12px;
	margin: 0 0 10px;
	font-size: 13px;
}
.mel-dl dt { color: var(--muted); font-weight: 600; }
.mel-dl dd { margin: 0; }
.mel-op-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 8px;
	border-top: 1px solid var(--line);
}
.mel-table tr.mel-msg-pin td { background: #eef6f5; }
.mel-msg-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 420px;
	overflow: auto;
	padding: 4px 0 8px;
}
.mel-msg {
	background: #f3f6f8;
	border: 1px solid var(--line);
	border-radius: 4px;
	padding: 7px 10px;
	max-width: 82%;
}
.mel-msg.is-me {
	align-self: flex-end;
	background: #e7f1ef;
}
.mel-msg-who { color: var(--muted); font-size: 11px; font-weight: 650; margin: 0 0 3px; }
.mel-msg-body { white-space: pre-wrap; font-size: 13px; }
.mel-msg-atts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-top: 6px;
}
.mel-msg-thumb {
	display: block;
	width: 88px;
	height: 88px;
	border-radius: 4px;
	overflow: hidden;
	border: 1px solid var(--line);
	background: #fff;
}
.mel-msg-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mel-msg-file {
	display: flex;
	flex-direction: column;
	justify-content: center;
	min-width: 120px;
	max-width: 200px;
	padding: 6px 8px;
	border: 1px solid var(--line);
	border-radius: 4px;
	background: #fff;
	text-decoration: none;
	color: inherit;
	font-size: 12px;
	font-weight: 650;
}
.mel-msg-file small { color: var(--muted); font-weight: 500; }
.mel-msg-file:hover { border-color: var(--accent); text-decoration: none; }
.mel-drop {
	margin-top: 8px;
	border: 1px dashed #9aadb8;
	border-radius: 4px;
	padding: 8px;
	background: #f7f9fa;
}
.mel-drop.is-over { border-color: var(--accent); background: #eef6f5; }
.mel-csv-drop {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.45rem;
	min-height: 220px;
	margin: 0 0 1rem;
	padding: 1.75rem 1.25rem;
	border: 2px dashed #9eb0ba;
	border-radius: 14px;
	background: linear-gradient(180deg, #f4f8f9 0%, #eef3f5 100%);
	text-align: center;
	cursor: pointer;
	transition: border-color .15s ease, background .15s ease, box-shadow .15s ease;
}
.mel-csv-drop:hover,
.mel-csv-drop.is-over {
	border-color: var(--accent);
	background: #e8f4f2;
	box-shadow: inset 0 0 0 1px rgba(31, 111, 102, 0.15);
}
.mel-csv-drop.has-file {
	border-style: solid;
	border-color: var(--accent);
	background: #eef7f5;
}
.mel-csv-drop-input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
}
.mel-csv-drop-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--ink, #102027);
}
.mel-csv-drop-hint {
	font-size: 0.95rem;
	color: var(--muted, #5a6b73);
	max-width: 28rem;
}
.mel-csv-drop-name {
	margin-top: 0.35rem;
	font-size: 1rem;
	font-weight: 600;
	color: var(--accent);
	word-break: break-all;
}
@media (min-width: 720px) {
	.mel-csv-drop { min-height: 280px; padding: 2.5rem 2rem; }
	.mel-csv-drop-title { font-size: 1.35rem; }
}
html.mel-night .mel-csv-drop {
	background: linear-gradient(180deg, #152026 0%, #10181c 100%);
	border-color: #3a4d56;
}
html.mel-night .mel-csv-drop:hover,
html.mel-night .mel-csv-drop.is-over,
html.mel-night .mel-csv-drop.has-file {
	background: #1a2e2c;
	border-color: var(--accent);
}
html.mel-night .mel-csv-drop-title { color: #e8eef1; }
html.mel-night .mel-csv-drop-hint { color: #9aafb8; }
.mel-drop-ui { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.mel-drop-ui .mel-hint { margin: 0; }
.mel-drop-list {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}
.mel-drop-card {
	position: relative;
	width: 96px;
	background: #fff;
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
	font-size: 11px;
}
.mel-drop-card img, .mel-drop-ico {
	width: 100%;
	height: 64px;
	object-fit: cover;
	display: block;
	background: #e8eef1;
}
.mel-drop-ico {
	display: flex;
	align-items: center;
	justify-content: center;
	font-weight: 800;
	letter-spacing: 0.04em;
	color: var(--muted);
}
.mel-drop-card div:not(.mel-drop-ico) {
	padding: 4px 6px 6px;
}
.mel-drop-card span {
	display: block;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	font-weight: 650;
}
.mel-drop-card small { color: var(--muted); }
.mel-drop-rm {
	position: absolute;
	top: 2px;
	right: 2px;
	width: 22px;
	height: 22px;
	border: 0;
	border-radius: 3px;
	background: rgba(20, 28, 32, 0.72);
	color: #fff;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.mel-lightbox {
	position: fixed;
	inset: 0;
	background: rgba(10, 16, 20, 0.82);
	z-index: 40;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 28px;
}
.mel-lightbox[hidden] { display: none !important; }
.mel-lightbox img {
	max-width: min(96vw, 1100px);
	max-height: 88vh;
	border-radius: 4px;
	background: #111;
}
.mel-lightbox-x {
	position: absolute;
	top: 8px;
	right: 10px;
	border: 0;
	background: transparent;
	color: #fff;
	font: inherit;
	font-size: 28px;
	font-weight: 400;
	line-height: 1;
	padding: 4px 8px;
	cursor: pointer;
}
.mel-chat {
	display: grid;
	grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
	min-height: calc(100vh - 170px);
	border: 1px solid var(--line);
	border-radius: 4px;
	overflow: hidden;
	background: var(--paper);
}
.mel-chat-list {
	display: flex;
	flex-direction: column;
	min-height: 0;
	border-right: 1px solid var(--line);
	background: #f4f7f8;
}
.mel-chat-search { padding: 8px; border-bottom: 1px solid var(--line); }
.mel-chat-search input {
	width: 100%;
	font: inherit;
	font-size: 13px;
	padding: 6px 8px;
	border: 1px solid #8fa0ab;
	border-radius: 3px;
}
.mel-chat-people { overflow: auto; flex: 1; }
.mel-chat-person {
	display: block;
	padding: 8px 10px;
	border-bottom: 1px solid var(--line);
	text-decoration: none;
	color: inherit;
}
.mel-chat-person:hover { background: #eef3f4; text-decoration: none; }
.mel-chat-person.is-on { background: #e7f1ef; }
.mel-chat-person-name { display: block; font-weight: 700; }
.mel-chat-person-sub, .mel-chat-person-last {
	display: block;
	color: var(--muted);
	font-size: 12px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.mel-chat-pane {
	display: flex;
	flex-direction: column;
	min-width: 0;
	min-height: 0;
	background: #fff;
}
.mel-chat-head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-bottom: 1px solid var(--line);
	flex: 0 0 auto;
}
.mel-chat-head-who { min-width: 0; flex: 1; }
.mel-chat-head strong { display: block; }
.mel-chat-back { display: none; }
.mel-chat-empty {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 24px;
}
.mel-chat-none {
	margin: auto;
	text-align: center;
	color: var(--muted);
	padding: 24px 8px;
}
.mel-chat-pane .mel-msg-list {
	flex: 1;
	min-height: 0;
	max-height: none;
	height: auto;
	overflow: auto;
	padding: 10px 12px;
}
.mel-chat-form {
	margin: 0;
	padding: 8px 12px 12px;
	border-top: 1px solid var(--line);
	background: #f7f9fa;
	flex: 0 0 auto;
}
.mel-chat-form.is-over { outline: 2px solid var(--accent); outline-offset: -2px; }
.mel-compose {
	display: flex;
	align-items: flex-end;
	gap: 6px;
}
.mel-compose textarea {
	flex: 1;
	min-width: 0;
	margin: 0;
	resize: none;
	max-height: 120px;
	line-height: 1.35;
	overflow-y: auto;
}
.mel-compose-plus {
	display: none;
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	border: 1px solid var(--line);
	background: #fff;
	border-radius: 4px;
	color: var(--accent);
	font: inherit;
	font-size: 22px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	align-items: center;
	justify-content: center;
	padding: 0;
}
.mel-compose-send {
	flex: 0 0 auto;
	white-space: nowrap;
	padding: 0 14px;
	min-height: 42px;
}
.mel-drop-list:empty { display: none; margin: 0; }
.mel-chat-form .mel-drop-list { margin: 0 0 8px; }
.mel-shortcuts { list-style: none; margin: 0; padding: 0; }
.mel-shortcuts li { margin: 0 0 4px; }
.mel-shortcuts .mel-link { display: inline-flex; align-items: center; gap: 6px; }
.mel-table input[type="number"] { width: 64px; max-width: 100%; }
.mel-row-actions {
	display: inline-flex;
	gap: 10px;
	align-items: baseline;
	flex-wrap: wrap;
}
.mel-row-actions form { display: inline; margin: 0; }
.mel-add-line { margin-top: 6px; }
.mel-hint-short { display: none; }
.mel-back-short { display: none; }
.mel-burger,
.mel-drawer,
.mel-dock { display: none; }
@media (max-width: 960px) {
	.mel-fields, .mel-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mel-span-2, .mel-span-3 { grid-column: 1 / -1; }
}
@media (max-width: 800px) {
	.mel-two { grid-template-columns: 1fr; }
	.mel-two .mel-fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mel-steps, .mel-steps.is-2, .mel-steps.is-4 { grid-template-columns: 1fr; }
	.mel-step { border-right: 0; border-bottom: 1px solid var(--line); }
	.mel-step:last-child { border-bottom: 0; }
	.mel-h1 { font-size: 18px; }
	.mel-search { flex: 1 1 100%; justify-content: stretch; }
	.mel-search input[type="search"] { width: 100%; }
}
@media (max-width: 760px) {
	.mel-main, .mel-wrap { max-width: 100%; }
	.mel-wrap { width: calc(100% - 12px); }
	.mel-chrome { z-index: 50; padding-top: env(safe-area-inset-top); background: var(--nav); }
	.mel-top { padding-top: 0; }
	.mel-top-row {
		display: grid;
		grid-template-columns: 36px minmax(0, 1fr) auto;
		align-items: center;
		gap: 6px;
		min-height: 44px;
		padding: 2px 0;
		overflow: visible;
	}
	body.is-guest .mel-top-row { grid-template-columns: minmax(0, 1fr) auto; }
	.mel-burger {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		border: 0;
		border-radius: 4px;
		background: rgba(255,255,255,0.08);
		color: #fff;
		cursor: pointer;
		padding: 0;
		position: relative;
		z-index: 51;
		transition: background 0.22s ease;
	}
	body.is-menu .mel-burger { background: rgba(255,255,255,0.18); }
	.mel-burger-bars,
	.mel-burger-bars::before,
	.mel-burger-bars::after {
		display: block;
		width: 16px;
		height: 2px;
		background: #fff;
		border-radius: 1px;
		position: relative;
		transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), top 0.32s cubic-bezier(0.22, 1, 0.36, 1), background 0.2s ease;
	}
	.mel-burger-bars::before,
	.mel-burger-bars::after {
		content: '';
		position: absolute;
		left: 0;
		transform-origin: center;
	}
	.mel-burger-bars::before { top: -5px; }
	.mel-burger-bars::after { top: 5px; }
	body.is-menu .mel-burger-bars { background: transparent; }
	body.is-menu .mel-burger-bars::before {
		top: 0;
		transform: rotate(45deg);
	}
	body.is-menu .mel-burger-bars::after {
		top: 0;
		transform: rotate(-45deg);
	}
	.mel-brand {
		min-width: 0;
		gap: 2px;
		overflow: hidden;
		flex: 1 1 auto;
	}
	.mel-brand-mark { width: 40px; height: 40px; flex-shrink: 0; }
	.mel-brand-words {
		max-width: 46vw;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.mel-top-end {
		flex: 0 0 auto;
		justify-content: flex-end;
		gap: 6px;
	}
	.mel-lang.is-compact { display: block; position: relative; }
	.mel-prefs.is-compact { display: inline-flex; }
	.mel-lang.is-compact .mel-lang-list {
		position: absolute;
		top: calc(100% + 6px);
		right: 0;
		z-index: 55;
		display: flex;
		flex-direction: column;
		min-width: 156px;
		padding: 4px;
		background: #102027;
		border: 1px solid rgba(255,255,255,0.16);
		border-radius: 6px;
		box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
	}
	.mel-lang.is-compact .mel-lang-list[hidden] { display: none; }
	.mel-lang.is-compact .mel-flag {
		width: 100%;
		justify-content: flex-start;
		gap: 8px;
		padding: 8px 8px;
		color: #f3f6f8;
		border-radius: 4px;
	}
	.mel-lang.is-compact .mel-flag.is-on {
		background: var(--on);
		color: var(--on-ink);
	}
	.mel-clocks {
		display: flex;
		justify-content: flex-end;
		align-items: stretch;
		flex: 0 0 auto;
		min-width: 0;
	}
	.mel-clock {
		flex-direction: column;
		align-items: flex-end;
		justify-content: center;
		gap: 0;
		padding: 0 7px;
		line-height: 1.15;
		white-space: nowrap;
	}
	.mel-clock + .mel-clock {
		border-left: 1px solid rgba(255,255,255,0.16);
	}
	.mel-clock-full { display: none; }
	.mel-clock-short { display: inline; }
	.mel-clock-tz {
		font-size: 8px;
		letter-spacing: 0.08em;
	}
	.mel-clock time {
		font-size: 12px;
		font-weight: 700;
		letter-spacing: 0;
	}
	.mel-top-tools,
	.mel-nav { display: none; }
	body.is-guest .mel-clocks { display: none; }

	.mel-drawer {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 38;
		pointer-events: none;
		visibility: hidden;
		transition: visibility 0.4s;
	}
	body.is-menu .mel-drawer {
		pointer-events: auto;
		visibility: visible;
		transition-delay: 0s;
	}
	body:not(.is-menu) .mel-drawer { transition-delay: 0.38s; }
	.mel-drawer-panel {
		position: absolute;
		inset: 0;
		width: 100%;
		background: #102027;
		color: #f3f6f8;
		/* nagłówek + minimenu (crumb) — treść menu pod chrome, nie pod spodem */
		padding: calc(88px + env(safe-area-inset-top)) 14px calc(24px + env(safe-area-inset-bottom));
		overflow: auto;
		display: flex;
		flex-direction: column;
		gap: 14px;
		transform: translate3d(-100%, 0, 0);
		transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
		will-change: transform;
		touch-action: pan-y;
	}
	.mel-drawer-panel.is-drag { transition: none; }
	body.is-menu .mel-drawer-panel { transform: translate3d(0, 0, 0); }
	.mel-drawer-who {
		display: flex;
		flex-direction: column;
		align-items: flex-start;
		gap: 4px;
		min-width: 0;
		padding-bottom: 10px;
		border-bottom: 2px solid rgba(255,255,255,0.2);
	}
	.mel-drawer-who-main {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		gap: 8px;
		min-width: 0;
		max-width: 100%;
	}
	.mel-drawer-who strong {
		font-size: 16px;
		font-weight: 700;
		letter-spacing: -0.02em;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		min-width: 0;
	}
	.mel-drawer-who .mel-badge { flex-shrink: 0; }
	.mel-drawer-login {
		font-size: 12px;
		font-weight: 600;
		color: rgba(255,255,255,0.55);
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
		max-width: 100%;
	}
	.mel-drawer-nav {
		display: flex;
		flex-direction: column;
		margin-top: 0;
		border-top: 0;
	}
	.mel-drawer-item {
		opacity: 0.4;
		transform: translate3d(-16px, 0, 0);
		transition: transform 0.38s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.38s ease;
	}
	body.is-menu .mel-drawer-item {
		opacity: 1;
		transform: none;
	}
	body.is-menu .mel-drawer-item:nth-child(1) { transition-delay: 0.05s; }
	body.is-menu .mel-drawer-item:nth-child(2) { transition-delay: 0.08s; }
	body.is-menu .mel-drawer-item:nth-child(3) { transition-delay: 0.11s; }
	body.is-menu .mel-drawer-item:nth-child(4) { transition-delay: 0.14s; }
	body.is-menu .mel-drawer-item:nth-child(5) { transition-delay: 0.17s; }
	body.is-menu .mel-drawer-item:nth-child(6) { transition-delay: 0.2s; }
	body.is-menu .mel-drawer-item:nth-child(7) { transition-delay: 0.23s; }
	body.is-menu .mel-drawer-item:nth-child(8) { transition-delay: 0.26s; }
	body:not(.is-menu) .mel-drawer-item { transition-delay: 0s; }
	.mel-drawer-item-row {
		display: flex;
		align-items: stretch;
		border-bottom: 1px solid rgba(255,255,255,0.08);
	}
	.mel-drawer-nav a {
		display: flex;
		align-items: center;
		justify-content: space-between;
		gap: 10px;
		padding: 14px 2px;
		color: #f3f6f8;
		text-decoration: none;
		font-weight: 650;
		font-size: 16px;
		letter-spacing: -0.01em;
		transition: color 0.15s ease, padding 0.15s ease;
	}
	.mel-drawer-item-row > a { flex: 1 1 auto; min-width: 0; }
	.mel-drawer-nav a:hover { color: #fff; text-decoration: none; }
	.mel-drawer-nav a.is-on {
		color: #fff;
		box-shadow: inset 3px 0 0 #7ec8c3;
		padding-left: 12px;
	}
	.mel-drawer-caret {
		flex: 0 0 44px;
		width: 44px;
		margin: 0;
		padding: 0;
		border: 0;
		border-left: 1px solid rgba(255,255,255,0.08);
		background: transparent;
		color: rgba(243,246,248,0.7);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		appearance: none;
		-webkit-appearance: none;
		cursor: pointer;
	}
	.mel-drawer-caret:hover { color: #fff; background: rgba(255,255,255,0.06); }
	.mel-drawer-caret svg {
		display: block;
		width: 18px;
		height: 18px;
		transition: transform 0.2s ease;
	}
	.mel-drawer-item.is-open > .mel-drawer-item-row .mel-drawer-caret svg { transform: rotate(180deg); }
	.mel-drawer-sub {
		display: flex;
		flex-direction: column;
		padding: 0 0 4px;
		background: rgba(0,0,0,0.12);
	}
	.mel-drawer-sub[hidden] { display: none; }
	.mel-drawer-sub a {
		font-size: 14px;
		font-weight: 600;
		padding: 11px 2px 11px 20px;
		color: rgba(243,246,248,0.82);
		border-bottom: 1px solid rgba(255,255,255,0.06);
	}
	.mel-drawer-sub a:last-child { border-bottom: 0; }
	.mel-drawer-sub a.is-on {
		color: #fff;
		padding-left: 20px;
		box-shadow: inset 3px 0 0 #7ec8c3;
	}
	.mel-drawer-foot {
		margin-top: auto;
		padding-top: 12px;
		display: flex;
		flex-direction: column;
		gap: 8px;
	}
	.mel-drawer-foot .mel-btn,
	.mel-drawer-out .mel-btn {
		width: 100%;
		min-height: 44px;
		background: transparent;
		color: #f3f6f8;
		border-color: rgba(255,255,255,0.22);
	}
	.mel-drawer-foot .mel-btn:hover,
	.mel-drawer-out .mel-btn:hover { color: #fff; background: rgba(255,255,255,0.08); }
	.mel-drawer-out { margin: 0; }
	.mel-drawer-back { font-weight: 700; }

	.mel-dock {
		display: flex;
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 35;
		background: #102027;
		border-top: 1px solid rgba(255,255,255,0.1);
		padding: 2px 2px calc(2px + env(safe-area-inset-bottom));
	}
	.mel-dock a,
	.mel-dock button {
		flex: 1;
		display: flex;
		align-items: center;
		justify-content: center;
		position: relative;
		min-height: 40px;
		border: 0;
		background: transparent;
		color: #9fb0ba;
		font: inherit;
		font-size: 10px;
		font-weight: 700;
		text-decoration: none;
		text-align: center;
		padding: 4px 2px;
		cursor: pointer;
	}
	.mel-dock a.is-on { color: #fff; }
	.mel-dock .mel-nav-dot {
		position: absolute;
		top: 2px;
		right: 10px;
		min-width: 16px;
		height: 16px;
		font-size: 10px;
		padding: 0 4px;
	}
	body.is-chat-open .mel-dock { display: none; }

	.mel-main { padding: 6px 0 8px; }
	.mel-h1 {
		font-size: 16px;
		line-height: 1.25;
		overflow-wrap: anywhere;
	}
	.mel-h2 { margin: 0 0 6px; font-size: 14px; }
	.mel-lead { margin: 0 0 6px; font-size: 12px; }
	.mel-card { padding: 8px; margin-bottom: 6px; }
	.mel-kpis { gap: 6px; margin: 0 0 6px; }
	.mel-kpi { padding: 6px 8px; }
	.mel-kpi b { font-size: 18px; }
	.mel-flash { padding: 6px 8px; margin: 0 0 6px; font-size: 12px; }
	.mel-group { padding: 6px 8px; margin: 0 0 6px; }
	.mel-fields { gap: 6px 8px; }
	.mel-actions { margin-top: 6px; padding-top: 6px; gap: 6px; }
	.mel-empty { padding: 10px 6px; }
	.mel-tabs { margin: 0 0 6px; }
	.mel-tabs a { padding: 6px 8px; font-size: 12px; }
	.mel-secnav { margin: 0 0 8px; }
	.mel-secnav a { padding: 6px 6px; font-size: 12px; }
	.mel-steps { margin: 0 0 6px; }
	.mel-step { padding: 8px; gap: 8px; }
	.mel-list-bar { gap: 6px; margin: 0 0 6px; padding-bottom: 6px; }
	.mel-dl { margin: 0 0 6px; font-size: 12px; }
	.mel-foot {
		padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
		font-size: 11px;
	}
	body:not(.is-guest) .mel-foot { display: none; }
	body:not(.is-guest) { padding-bottom: calc(48px + env(safe-area-inset-bottom)); }
	html.is-chat-open,
	html.is-chat-open body {
		height: 100%;
		max-height: 100%;
		overflow: hidden;
		overscroll-behavior: none;
	}
	body.is-chat-open { padding-bottom: 0; }
	body.is-chat-open .mel-chrome,
	body.is-chat-open .mel-top,
	body.is-chat-open .mel-crumb,
	body.is-chat-open .mel-foot { display: none; }
	body.is-chat-open .mel-main {
		flex: 1;
		min-height: 0;
		display: flex;
		flex-direction: column;
		padding: 0;
	}
	body.is-chat-open .mel-wrap {
		width: 100%;
		margin: 0;
		flex: 1;
		min-height: 0;
		display: flex;
		flex-direction: column;
	}
	body.is-chat-open .mel-flash {
		flex: 0 0 auto;
		margin: 0;
		border-radius: 0;
	}
	body:not(.is-guest):not(.is-chat-open) .mel-main { padding-bottom: 6px; }

	.mel-toolbar { align-items: stretch; flex-direction: column; gap: 6px; margin: 0 0 6px; }
	.mel-list-bar, .mel-form-head, .mel-filter { flex-wrap: wrap; }
	.mel-filter, .mel-search { width: 100%; }
	.mel-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mel-secnav { flex-wrap: wrap; }
	.mel-secnav a { flex: 1 1 33%; min-width: 30%; }
	.mel-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
	.mel-tabs a { white-space: nowrap; }
	.mel-dl { grid-template-columns: 1fr; gap: 2px; }
	.mel-dl dt { margin-top: 4px; }
	.mel-op-actions { gap: 4px; padding-top: 6px; }
	.mel-op-actions .mel-btn { flex: 1 1 calc(50% - 4px); min-height: 36px; padding: 6px 8px; }
	.mel-actions .mel-btn { min-height: 36px; padding: 6px 10px; }
	.mel-btn { padding: 6px 10px; }
	.mel-fields, .mel-fields-2, .mel-pick, .mel-two .mel-fields { grid-template-columns: 1fr; }
	.mel-user-pass { flex-wrap: wrap; }
	.mel-user-flag { white-space: normal; }
	.mel-span-2, .mel-span-3 { grid-column: auto; }
	.mel-form input[type="text"],
	.mel-form input[type="email"],
	.mel-form input[type="password"],
	.mel-form input[type="tel"],
	.mel-form input[type="date"],
	.mel-form input[type="number"],
	.mel-form input[type="search"],
	.mel-form select,
	.mel-form textarea,
	.mel-search input[type="search"],
	.mel-chat-search input {
		font-size: 16px;
		min-height: 40px;
		padding: 6px 8px;
	}
	.mel-filter select {
		font-size: 16px;
		min-height: 40px;
		padding: 6px 8px;
	}
	.mel-two { gap: 6px; }
	.mel-login-box { max-width: none; }
	.mel-guest-main { padding: 12px 0 20px; }

	.mel-table-wrap { overflow: visible; }
	.mel-table, .mel-table tbody { display: block; width: 100%; }
	.mel-table tr:first-child:has(th) { display: none; }
	.mel-table tr {
		display: block;
		background: #fff;
		border: 1px solid var(--line);
		border-radius: 4px;
		margin: 0 0 6px;
		padding: 2px 0;
	}
	.mel-table td {
		display: grid;
		grid-template-columns: minmax(5.2rem, 30%) 1fr;
		gap: 6px;
		padding: 4px 8px;
		border: 0;
		border-bottom: 1px solid #edf1f4;
		overflow-wrap: anywhere;
		word-break: break-word;
		font-size: 12px;
	}
	.mel-table td .mel-scan-more,
	.mel-table td .mel-scan-ev {
		overflow-wrap: normal;
		word-break: normal;
	}
	.mel-table td:last-child { border-bottom: 0; }
	.mel-table td::before {
		content: attr(data-th);
		color: var(--muted);
		font-size: 10px;
		font-weight: 700;
		letter-spacing: 0.03em;
		text-transform: uppercase;
	}
	.mel-table td:not([data-th])::before,
	.mel-table td[data-th=""]::before { content: none; }
	.mel-table td:not([data-th]),
	.mel-table td[data-th=""] { display: block; }
	.mel-table tbody tr:hover td { background: transparent; }

	.mel-chat {
		grid-template-columns: 1fr;
		min-height: calc(100dvh - 44px - env(safe-area-inset-top) - 48px - env(safe-area-inset-bottom));
		border-radius: 0;
		margin: 0 -6px;
		border-left: 0;
		border-right: 0;
	}
	body.is-chat .mel-toolbar { display: none; }
	body.is-chat-open .mel-chat {
		position: fixed;
		top: var(--mel-chat-top, 0px);
		left: 0;
		right: 0;
		height: var(--mel-chat-vh, 100svh);
		z-index: 36;
		flex: none;
		min-height: 0;
		margin: 0;
		border: 0;
		display: flex;
		flex-direction: column;
		background: var(--paper);
	}
	.mel-chat.is-open .mel-chat-list { display: none; }
	.mel-chat:not(.is-open) .mel-chat-pane { display: none; }
	body.is-chat-open .mel-chat-pane {
		flex: 1;
		min-height: 0;
	}
	body.is-chat-open .mel-chat-head {
		padding: calc(4px + env(safe-area-inset-top)) 8px 4px;
		background: #fff;
		z-index: 2;
		gap: 6px;
	}
	.mel-chat-head-who strong {
		font-size: 14px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.mel-chat-head-who .mel-hint {
		font-size: 11px;
		overflow: hidden;
		text-overflow: ellipsis;
		white-space: nowrap;
	}
	.mel-chat-back { display: inline-flex; padding: 4px 8px; min-height: 32px; font-size: 12px; }
	.mel-back-full { display: none; }
	.mel-back-short { display: inline; }
	.mel-hint-full { display: none; }
	.mel-hint-short { display: block; margin: 0; }
	.mel-compose { gap: 4px; }
	.mel-compose-plus {
		display: inline-flex;
		width: 40px;
		height: 40px;
		font-size: 20px;
	}
	.mel-compose-send { min-height: 40px; padding: 0 10px; font-size: 13px; }
	.mel-compose textarea { min-height: 40px; }
	.mel-drop-desk { display: none; }
	.mel-chat-form {
		flex: 0 0 auto;
		padding: 6px 8px calc(8px + env(safe-area-inset-bottom, 0px));
		background: #f7f9fa;
		z-index: 4;
	}
	body.is-chat-open .mel-chat-form {
		position: sticky;
		bottom: 0;
	}
	.mel-chat-form .mel-drop-list {
		flex-wrap: nowrap;
		overflow-x: auto;
		max-height: none;
		margin: 0 0 4px;
	}
	.mel-chat-form .mel-drop-card { width: 64px; flex: 0 0 auto; }
	.mel-chat-form .mel-drop-card img,
	.mel-chat-form .mel-drop-ico { height: 44px; }
	.mel-chat-pane .mel-msg-list { padding: 6px; gap: 6px; }
	.mel-msg { max-width: 92%; padding: 5px 8px; }
	.mel-msg-who {
		font-size: 10px;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.mel-msg-body { font-size: 13px; overflow-wrap: anywhere; }
	.mel-chat-search { padding: 6px; }
	.mel-chat-person { padding: 7px 8px; }
	.mel-chat-person-sub, .mel-chat-person-last { font-size: 11px; }
	html.is-menu,
	html.is-menu body {
		height: 100%;
		max-height: 100%;
		overflow: hidden;
		overscroll-behavior: none;
	}
	body.is-menu {
		position: fixed;
		left: 0;
		right: 0;
		width: 100%;
	}
	body.is-menu .mel-chrome {
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		z-index: 50;
	}
	@media (prefers-reduced-motion: reduce) {
		.mel-drawer,
		.mel-drawer-panel,
		.mel-drawer-nav a,
		.mel-drawer-item,
		.mel-drawer-caret svg,
		.mel-burger-bars,
		.mel-burger-bars::before,
		.mel-burger-bars::after {
			transition: none !important;
		}
		.mel-drawer-panel { transform: none; }
		body:not(.is-menu) .mel-drawer-panel { transform: translate3d(-100%, 0, 0); }
	}
}
@media (max-width: 560px) {
	.mel-kpis { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
	.mel-brand-words { display: none; }
}

html.mel-night ::selection {
	background: #2b5c58;
	color: #e8eef2;
}
html.mel-night input:-webkit-autofill,
html.mel-night textarea:-webkit-autofill,
html.mel-night select:-webkit-autofill {
	-webkit-text-fill-color: var(--ink);
	caret-color: var(--ink);
	box-shadow: 0 0 0 1000px var(--input) inset;
	transition: background-color 9999s ease-out;
}
html.mel-night .mel-pick .mel-check,
html.mel-night .mel-search input[type="search"],
html.mel-night .mel-table input:not([type="hidden"]),
html.mel-night .mel-table select,
html.mel-night .mel-chat-search input,
html.mel-night .mel-compose textarea,
html.mel-night .mel-drop,
html.mel-night .mel-drop-card,
html.mel-night .mel-chat-head,
html.mel-night .mel-msg.is-me,
html.mel-night .mel-login-box,
html.mel-night .mel-lightbox-box {
	background: var(--paper);
	color: var(--ink);
	border-color: var(--line);
}
html.mel-night .mel-form label,
html.mel-night .mel-login-box .mel-h1,
html.mel-night .mel-login-box .mel-check,
html.mel-night .mel-perm-table thead th,
html.mel-night .mel-perm-group th {
	color: var(--ink);
}
html.mel-night .mel-table tbody tr:hover td,
html.mel-night .mel-secnav a:hover,
html.mel-night .mel-step:hover,
html.mel-night .mel-chat-person:hover {
	background: var(--hover);
}
html.mel-night .mel-step.is-on { background: #1a2e32; }
html.mel-night .mel-step-n { background: var(--chip); color: var(--chip-ink); }
html.mel-night .mel-step.is-on .mel-step-n { background: var(--accent); color: var(--accent-ink); }
html.mel-night .mel-st.is-open { background: #24343c; color: #c5d6de; }
html.mel-night .mel-st.is-run { background: #3a3218; color: #e6d08a; }
html.mel-night .mel-st.is-ready { background: #173328; color: #8fd4ad; }
html.mel-night .mel-st.is-pack { background: #1e2c44; color: #b7c8ee; }
html.mel-night .mel-st.is-ship { background: #163632; color: #7ec8c3; }
html.mel-night .mel-st.is-done { background: #1b3a28; color: #8fd4ad; }
html.mel-night .mel-st.is-off { background: #3a1e1e; color: #f0a3a3; }
html.mel-night .mel-st.is-active { background: #163246; color: #9fd0f0; }
html.mel-night .mel-st.is-picked { background: #173328; color: #8fd4ad; }
html.mel-night .mel-flash.err { border-color: #6a3a3a; }
html.mel-night .mel-flash.ok { border-color: #2a5540; }
html.mel-night .mel-flash.warn { border-color: #5a4c22; }
html.mel-night .mel-tenant-bar { border-color: #5a4c22; }
html.mel-night .mel-table tr.mel-msg-pin td { background: #1a2e2c; }
html.mel-night .mel-chat-person.is-on { background: #1a2e2c; }
html.mel-night .mel-msg { background: var(--soft); color: var(--ink); }
html.mel-night .mel-msg.is-me { background: #1d3533; }
html.mel-night .mel-chat-form { background: var(--soft); }
html.mel-night .mel-drop { background: var(--soft); border-color: #3a4d56; }
html.mel-night .mel-drop.is-over { background: #1a2e2c; }
html.mel-night .mel-lightbox { background: var(--overlay); }
html.mel-night .mel-scan-more > summary { color: var(--accent); }
html.mel-night .mel-scan-list,
html.mel-night .mel-scan-list-row,
html.mel-night .mel-scan-list-go,
html.mel-night .mel-scan-more-block,
html.mel-night .mel-scan-list-actions { border-color: var(--line); }
html.mel-night .mel-scan-list-actions { background: var(--soft); }
html.mel-night .mel-scan-prog-ratio b.is-scan,
html.mel-night .mel-scan-item-ratio b.is-scan { color: #7ec8c3; }
html.mel-night .mel-scan-prog-bar { background: rgba(255,255,255,0.08); }
html.mel-night .mel-scan-list-actions .mel-btn.is-warn {
	background: #3a3420;
	border-color: #6b5a2a;
	color: #d4c28a;
}
html.mel-night .mel-scan-ev { background: var(--soft); border-color: var(--line); }
html.mel-night .mel-scan-ev.is-create { border-left-color: #d4c28a; }
html.mel-night .mel-scan-ev.is-save { border-left-color: #8fd4ad; }
html.mel-night .mel-scan-ev.is-send { border-left-color: #5ec4bb; }
html.mel-night .mel-scan-ev.is-open { border-left-color: #8aa8e0; }
html.mel-night .mel-scan-ev.is-cancel { border-left-color: #f0a3a3; }
html.mel-night .mel-scan-ev.is-create .mel-scan-ev-act { background: #3a3420; color: #d4c28a; }
html.mel-night .mel-scan-ev.is-save .mel-scan-ev-act { background: #173328; color: #8fd4ad; }
html.mel-night .mel-scan-ev.is-send .mel-scan-ev-act { background: #163632; color: #7ec8c3; }
html.mel-night .mel-scan-ev.is-open .mel-scan-ev-act { background: #1e2c44; color: #b7c8ee; }
html.mel-night .mel-scan-ev.is-cancel .mel-scan-ev-act { background: #3a1e1e; color: #f0a3a3; }
html.mel-night .mel-kpi:hover { background: var(--hover); }
html.mel-night .mel-loader-txt { color: var(--ink); }
html.mel-night .mel-loader .mel-spin {
	border-color: rgba(232, 238, 242, 0.22);
	border-top-color: var(--accent);
}
html.mel-night a.mel-link,
html.mel-night button.mel-link { color: var(--accent); }
html.mel-night .mel-btn:hover { filter: brightness(1.12); }
html.mel-night .mel-secnav a.is-on { background: var(--accent); color: var(--accent-ink); }
html.mel-night .mel-btn-ghost {
	background: var(--soft);
	color: var(--ink);
	border-color: var(--input-border);
}
@media (max-width: 760px) {
	html.mel-night .mel-table tr { background: var(--paper); border-color: var(--line); }
	html.mel-night .mel-table td { border-color: var(--line); }
	html.mel-night .mel-lang.is-compact .mel-lang-list {
		background: var(--nav);
		border-color: rgba(255,255,255,0.16);
	}
	html.mel-night .mel-chat-head { background: var(--paper); }
}

/* —— Layout polish: rytm stron ERP / admin —— */
.mel-main > .mel-toolbar + .mel-steps,
.mel-main > .mel-toolbar + .mel-flow-chrome,
.mel-main > .mel-toolbar + .mel-tabs,
.mel-main > .mel-toolbar + .mel-secnav { margin-top: 0; }
.mel-main > .mel-hint.mel-page-lead,
.mel-main > p.mel-hint {
	margin: 0 0 10px;
	max-width: 52rem;
	line-height: 1.4;
}
.mel-tabs { margin-bottom: 12px; }
.mel-admin-focus {
	margin: 0 0 12px;
	padding-bottom: 12px;
	border-bottom: 1px solid var(--line);
}
.mel-admin-focus h2 {
	margin: 0 0 8px;
	font-size: 16px;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.mel-table code {
	font-size: 12px;
	font-weight: 650;
	letter-spacing: 0.01em;
}
.mel-empty-pad { padding: 10px; }
@media (max-width: 980px) {
	.mel-steps.is-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.mel-steps.is-4 .mel-step:nth-child(2) { border-right: 0; }
}
@media (max-width: 760px) {
	.mel-steps.is-4 { grid-template-columns: 1fr; }
	.mel-inline-form {
		flex-direction: column;
		align-items: stretch;
		gap: 4px;
	}
	.mel-inline-form select { max-width: none; width: 100%; }
	.mel-input-sm { width: 100% !important; }
	.lbl-form { max-width: none; }
}

/* GameHub import — szczegółowy raport per SKU */
.gh-run-head { margin-bottom: 10px; }
.gh-report-list {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin: 0 0 16px;
}
.gh-sku-card {
	border-left: 4px solid var(--line);
	padding: 10px 12px;
}
.gh-sku-card.is-ok { border-left-color: var(--ok); }
.gh-sku-card.is-fail { border-left-color: var(--danger); }
.gh-sku-head {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start;
	justify-content: space-between;
	gap: 8px 16px;
	margin-bottom: 8px;
}
.gh-sku-id { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.gh-sku-code { font-size: 15px; letter-spacing: 0.02em; }
.gh-sku-name { color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.gh-sku-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.gh-sku-msg { font-size: 13px; color: var(--ink); }
.gh-badge {
	display: inline-block;
	padding: 2px 8px;
	border-radius: 4px;
	font-size: 11px;
	font-weight: 650;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	background: var(--soft);
	color: var(--muted);
}
.gh-badge-update { background: var(--ok-bg); color: var(--ok); }
.gh-badge-create { background: #e3eef8; color: #1a4a7a; }
.gh-badge-skip,
.gh-badge-noop { background: var(--soft); color: var(--muted); }
.gh-badge-fail { background: var(--danger-bg); color: var(--danger); }
.gh-sec { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line); }
.gh-sec-title {
	margin: 0 0 6px;
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.gh-field-list {
	margin: 0;
	padding: 0;
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 6px;
}
.gh-field-list li {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	padding: 3px 8px;
	background: var(--soft);
	border-radius: 4px;
	font-size: 12px;
	max-width: 100%;
}
.gh-fk { font-weight: 650; color: var(--ink); }
.gh-fv { color: var(--muted); overflow-wrap: anywhere; }
.gh-stock-line { margin: 0; font-size: 13px; }
.gh-sizes { margin-left: 6px; color: var(--muted); }
.gh-thumbs {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 10px;
	margin-top: 8px;
}
.gh-thumb {
	margin: 0;
	background: var(--soft);
	border: 1px solid var(--line);
	border-radius: 6px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}
.gh-thumb.is-ok { border-color: #9bc9ae; }
.gh-thumb.is-bad { border-color: #e0b0b0; }
.gh-thumb a { display: block; background: #0f181c; }
.gh-thumb img {
	display: block;
	width: 100%;
	height: 120px;
	object-fit: contain;
	background: #0f181c;
}
.gh-thumb-empty {
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--muted);
	background: var(--soft);
}
.gh-thumb figcaption {
	padding: 6px 8px;
	display: flex;
	flex-direction: column;
	gap: 2px;
	font-size: 11px;
	line-height: 1.3;
}
.gh-img-st { font-weight: 700; color: var(--ink); }
.gh-thumb.is-bad .gh-img-st { color: var(--danger); }
.gh-img-file { color: var(--muted); overflow-wrap: anywhere; }
.gh-img-bytes { color: var(--muted); }
.gh-img-src { color: var(--accent); text-decoration: underline; }
@media (max-width: 760px) {
	.gh-thumbs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.gh-thumb img,
	.gh-thumb-empty { height: 96px; }
}

.ord-items-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 0 10px;
	flex-wrap: wrap;
}
.ord-items-head h3 {
	margin: 0;
}
.ord-items-head.is-sup {
	max-width: 720px;
}
.ord-pdf-tools {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
.ord-thumb-size {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: #475569;
}
.ord-thumb-size select {
	min-width: 88px;
	padding: 6px 8px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
}
.ord-items-table.is-sup {
	--ord-thumb-size: 80px;
	width: 100%;
	max-width: 720px;
	table-layout: fixed;
	border-collapse: collapse;
}
.ord-th-size,
.ord-td-size {
	width: 72px;
	text-align: center;
	white-space: nowrap;
}
.ord-th-note,
.ord-td-note {
	text-align: left;
	word-break: break-word;
	color: #334155;
	font-size: 13px;
}
.ord-items-table.is-sup .ord-td-note {
	font-size: 12px;
}
.ord-items-table.is-sup th,
.ord-items-table.is-sup td {
	padding: 8px 10px;
	vertical-align: middle;
}
.ord-th-img,
.ord-td-img {
	width: 88px;
	text-align: center;
}
.ord-items-table.is-sup .ord-th-img,
.ord-items-table.is-sup .ord-td-img {
	width: calc(var(--ord-thumb-size, 80px) + 24px);
}
.ord-items-table.is-sup .ord-td-sku {
	width: auto;
	text-align: left;
}
.ord-items-table.is-sup .ord-td-sku code {
	font-size: 14px;
	font-weight: 700;
}
.ord-th-qty,
.ord-td-qty {
	width: 72px;
	text-align: center;
	font-weight: 700;
}
.mel-prod-icon {
	display: inline-block;
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: 6px;
	background: var(--soft, #f1f5f9);
	border: 1px solid var(--line, #d7e0e4);
	vertical-align: middle;
	cursor: zoom-in;
}
.ord-items-table.is-sup .ord-thumb,
.ord-items-table.is-sup .mel-prod-icon.ord-thumb {
	width: var(--ord-thumb-size, 80px);
	height: var(--ord-thumb-size, 80px);
}
.ord-items-table.is-sup .ord-thumb-empty {
	width: var(--ord-thumb-size, 80px);
	height: var(--ord-thumb-size, 80px);
}
@media (max-width: 760px) {
	.mel-table.ord-items-table tr {
		display: grid;
		grid-template-columns: 52px minmax(0, 1fr);
		column-gap: 10px;
		row-gap: 0;
		padding: 10px 10px 10px 8px;
		margin: 0 0 10px;
		align-items: start;
	}
	.mel-table.ord-items-table td {
		display: grid;
		grid-template-columns: 5.75rem minmax(0, 1fr);
		align-items: start;
		column-gap: 8px;
		row-gap: 0;
		padding: 6px 0;
		border: 0;
		border-bottom: 1px solid #edf1f4;
		font-size: 13px;
		font-weight: 400;
		line-height: 1.35;
		min-width: 0;
		color: #0f172a;
	}
	.mel-table.ord-items-table td:last-child { border-bottom: 0; padding-bottom: 0; }
	.mel-table.ord-items-table td::before {
		font-size: 11px;
		font-weight: 600;
		letter-spacing: 0.02em;
		text-transform: none;
		color: var(--muted);
		line-height: 1.35;
		padding-top: 0;
	}
	.mel-table.ord-items-table .ord-td-img,
	.mel-table.ord-items-table td.ord-td-img[data-th=""] {
		grid-column: 1;
		grid-row: 1 / span 2;
		display: flex !important;
		grid-template-columns: none;
		align-items: flex-start;
		justify-content: flex-start;
		padding: 0;
		margin: 0;
		border: 0;
		width: 52px;
		max-width: 52px;
		align-self: start;
	}
	.mel-table.ord-items-table .ord-td-img::before { content: none !important; display: none; }
	.mel-table.ord-items-table .ord-td-img .ord-thumb,
	.mel-table.ord-items-table .ord-td-img .mel-prod-icon,
	.mel-table.ord-items-table .ord-td-img .ord-thumb-empty {
		width: 52px;
		height: 52px;
		margin: 0;
		display: block;
	}
	.mel-table.ord-items-table .ord-td-sku,
	.mel-table.ord-items-table .ord-td-sku[data-th] {
		grid-column: 2;
		grid-row: 1;
		display: block !important;
		border: 0;
		padding: 0 0 2px;
		min-width: 0;
	}
	.mel-table.ord-items-table .ord-td-sku::before { content: none !important; display: none; }
	.mel-table.ord-items-table .ord-td-sku code {
		font-family: inherit;
		font-size: 13px;
		font-weight: 700;
		background: none;
		padding: 0;
	}
	.mel-table.ord-items-table .ord-td-name,
	.mel-table.ord-items-table .ord-td-name[data-th] {
		grid-column: 2;
		grid-row: 2;
		display: block !important;
		border: 0;
		padding: 0 0 8px;
		color: #334155;
		min-width: 0;
	}
	.mel-table.ord-items-table .ord-td-name::before { content: none !important; display: none; }
	.mel-table.ord-items-table.is-sup .ord-td-sku {
		grid-row: 1 / span 2;
		align-self: center;
		padding: 0;
	}
	.mel-table.ord-items-table .ord-td-size,
	.mel-table.ord-items-table .ord-td-qty,
	.mel-table.ord-items-table .ord-td-found,
	.mel-table.ord-items-table .ord-td-ok,
	.mel-table.ord-items-table .ord-td-note {
		grid-column: 1 / -1;
	}
	.mel-table.ord-items-table .ord-td-size {
		margin-top: 2px;
		padding-top: 8px;
		border-top: 1px solid #edf1f4;
	}
	.mel-table.ord-items-table .ord-td-qty,
	.mel-table.ord-items-table .ord-td-found,
	.mel-table.ord-items-table .ord-td-ok,
	.mel-table.ord-items-table .ord-td-note {
		font-size: 13px;
		font-weight: 400;
	}
	.mel-table.ord-items-table .ord-td-found .mel-input-sm {
		max-width: 6.5rem;
		width: 100%;
		font-size: 13px;
		font-weight: 400;
		padding: 4px 8px;
	}
	.mel-table.ord-items-table .ord-td-ok label {
		display: inline-flex;
		align-items: center;
		gap: 6px;
		font-size: 13px;
		font-weight: 400;
		margin: 0;
	}
}
.ord-thumb {
	display: inline-block;
	width: 40px;
	height: 40px;
	object-fit: contain;
	border-radius: 6px;
	background: var(--soft, #f1f5f9);
	vertical-align: middle;
	cursor: zoom-in;
}
.ord-thumb-empty {
	display: inline-block;
	width: 40px;
	height: 40px;
	border-radius: 6px;
	background: var(--soft, #e8eef5);
	vertical-align: middle;
}
.ord-img-float {
	position: fixed;
	z-index: 9999;
	width: 500px;
	height: 500px;
	margin: 0;
	padding: 8px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #dbe3ee;
	border-radius: 12px;
	box-shadow: 0 12px 40px rgba(15, 23, 42, 0.22);
	pointer-events: none;
}
.ord-img-float[hidden] { display: none !important; }
.ord-img-float img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	background: #f8fafc;
	border-radius: 8px;
}
.ord-peek {
	position: fixed;
	inset: 0;
	z-index: 8600;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: 28px 12px 40px;
	overflow: auto;
	background: rgba(8, 18, 28, 0.48);
}
.ord-peek[hidden] { display: none !important; }
html.is-ord-peek { overflow: hidden; }
.ord-peek-card {
	position: relative;
	width: min(720px, 100%);
	margin: auto;
	background: var(--paper, #fff);
	border: 1px solid var(--line);
	border-radius: 14px;
	box-shadow: 0 22px 60px rgba(8, 18, 28, 0.28);
}
.ord-peek-x {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 2;
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 999px;
	background: var(--soft, #eef2f7);
	color: var(--ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}
.ord-peek-body { padding: 22px 22px 26px; }
.ord-peek-top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	margin: 0 40px 14px 0;
}
.ord-peek-no {
	margin: 0;
	font-size: 22px;
	font-weight: 800;
	letter-spacing: -0.03em;
}
.ord-peek-actions {
	margin-left: auto;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}
.ord-peek-facts {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 10px 14px;
	margin: 0 0 18px;
	padding: 12px 14px;
	border-radius: 10px;
	background: var(--soft, #f3f6fa);
}
.ord-peek-fact { min-width: 0; }
.ord-peek-k {
	display: block;
	font-size: 11px;
	font-weight: 700;
	color: var(--muted);
	text-transform: uppercase;
	letter-spacing: 0.04em;
	margin: 0 0 3px;
}
.ord-peek-v {
	font-size: 14px;
	font-weight: 650;
	line-height: 1.35;
	word-break: break-word;
}
.ord-peek-sec { margin: 0; }
.ord-peek-h {
	display: flex;
	align-items: baseline;
	gap: 8px;
	margin: 0 0 10px;
	font-size: 15px;
}
.ord-peek-count {
	font-weight: 600;
	color: var(--muted);
	font-size: 13px;
}
.ord-peek-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.ord-peek-item {
	display: grid;
	grid-template-columns: 72px minmax(0, 1fr) auto;
	gap: 12px;
	align-items: center;
	padding: 10px 12px;
	border: 1px solid var(--line);
	border-radius: 10px;
	background: var(--paper, #fff);
}
.ord-peek-ph { width: 72px; height: 72px; }
.ord-peek-img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: contain;
	border-radius: 8px;
	background: var(--soft, #f1f5f9);
}
.ord-peek-img.is-empty {
	background: linear-gradient(145deg, #e8eef5, #f7fafc);
}
.ord-peek-sku {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	font-weight: 800;
}
.ord-peek-sku code { font-size: 14px; }
.ord-peek-size {
	font-size: 12px;
	font-weight: 700;
	color: var(--muted);
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--soft, #eef2f7);
}
.ord-peek-name {
	margin-top: 4px;
	font-size: 13px;
	color: var(--muted);
	line-height: 1.35;
}
.ord-peek-qty {
	text-align: right;
	white-space: nowrap;
}
.ord-peek-qty strong {
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.03em;
}
.ord-peek-qty span {
	font-size: 12px;
	color: var(--muted);
	font-weight: 650;
}
.ord-peek-wait,
.ord-peek-fail,
.ord-peek-empty {
	margin: 12px 0;
	color: var(--muted);
}
.ord-peek-fail { color: var(--danger, #b42318); }
html.mel-night .ord-peek { background: rgba(0, 0, 0, 0.62); }
html.mel-night .ord-peek-facts { background: rgba(255, 255, 255, 0.04); }
@media (max-width: 560px) {
	.ord-peek-item {
		grid-template-columns: 56px minmax(0, 1fr);
	}
	.ord-peek-ph,
	.ord-peek-img { width: 56px; height: 56px; }
	.ord-peek-qty {
		grid-column: 2;
		text-align: left;
	}
}

.ord-due-label {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
}

.mel-carton-add-box {
	padding-top: 12px;
	padding-bottom: 12px;
}
.mel-carton-add-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	min-width: 0;
}
.mel-carton-add-head h2 {
	margin: 0;
	min-width: 0;
	font-size: 16px;
	line-height: 1.25;
}
.mel-carton-add-toggle {
	flex: 0 0 auto;
	min-height: 32px;
	padding: 4px 12px;
}
.mel-carton-add-toggle .is-when-open { display: none; }
.mel-carton-add-box.is-open .mel-carton-add-toggle .is-when-open { display: inline; }
.mel-carton-add-box.is-open .mel-carton-add-toggle .is-when-shut { display: none; }
.mel-carton-add-panel {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.28s ease;
}
.mel-carton-add-box.is-open .mel-carton-add-panel {
	grid-template-rows: 1fr;
}
.mel-carton-add-panel-inner {
	overflow: hidden;
	min-height: 0;
}
.mel-carton-add-box.is-open .mel-carton-add-panel-inner {
	padding-top: 12px;
}
.mel-carton-add .mel-carton-add-row {
	display: grid;
	grid-template-columns: minmax(0, 1.4fr) 72px minmax(0, 1fr);
	align-items: end;
	gap: 8px 10px;
	margin: 0 0 10px;
}
.mel-carton-add.has-op .mel-carton-add-row {
	grid-template-columns: minmax(0, 1.2fr) minmax(0, 1.2fr) 72px minmax(0, 1fr);
}
.mel-carton-add-row > label {
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	gap: 3px;
	margin: 0 !important;
	min-width: 0;
	font-weight: 650;
}
.mel-carton-add-row > label > span {
	display: block;
	font-size: 12px;
	font-weight: 650;
	line-height: 1.2;
	color: var(--muted);
}
.mel-carton-add-row input[type="text"],
.mel-carton-add-row input[type="number"],
.mel-carton-add-row select {
	width: 100%;
	height: 34px;
	box-sizing: border-box;
	font: inherit;
	font-size: 13px;
	padding: 5px 8px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-carton-add-photo input[type="file"] {
	display: block;
	width: 100%;
	height: 34px;
	box-sizing: border-box;
	margin: 0;
	padding: 4px 6px;
	font: inherit;
	font-size: 12px;
	line-height: 24px;
	border: 1px solid var(--input-border);
	border-radius: 3px;
	background: var(--input);
	color: var(--ink);
}
.mel-carton-add .mel-carton-add-go {
	width: 100%;
	min-height: 36px;
}
@media (max-width: 560px) {
	.mel-carton-add .mel-carton-add-row,
	.mel-carton-add.has-op .mel-carton-add-row {
		grid-template-columns: minmax(0, 1fr) 72px;
	}
	.mel-carton-add-op,
	.mel-carton-add-photo {
		grid-column: 1 / -1;
	}
}

.mel-carton-list {
	display: flex;
	flex-direction: column;
	gap: 8px;
}
.mel-carton-row {
	padding: 8px 10px;
	border: 1px solid var(--line, #e5e7eb);
	border-radius: 10px;
	background: var(--soft, #fafafa);
}
.mel-carton-row.is-on {
	border-color: var(--accent, #0f766e);
	background: #f0faf8;
}
.mel-carton-main {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px 12px;
}
.mel-carton-thumb-wrap {
	display: block;
	width: 44px;
	height: 44px;
	border-radius: 6px;
	overflow: hidden;
	background: #e8eceb;
	flex-shrink: 0;
}
.mel-carton-thumb-wrap.is-empty {
	background: repeating-linear-gradient(-45deg, #eceff1, #eceff1 6px, #e2e6e8 6px, #e2e6e8 12px);
}
.mel-carton-thumb,
.mel-carton-photo {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.mel-carton-photo {
	width: 160px;
	height: 160px;
	border-radius: 10px;
}
.mel-carton-summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-width: 0;
	flex: 1 1 200px;
}
.mel-carton-name {
	font-size: 14px;
	color: var(--text, #111);
}
.mel-carton-facts {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	font-size: 12px;
	color: var(--muted);
	margin: 0;
}
.mel-carton-facts strong { color: var(--text, #111); }
.mel-carton-links {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin: 0;
}
.mel-carton-note { margin: 0; }
.mel-carton-actions {
	display: flex;
	flex-direction: row;
	gap: 6px;
	align-items: center;
	margin-left: auto;
}
.mel-carton-more {
	margin: 0;
}
.mel-carton-more > summary {
	cursor: pointer;
	color: var(--accent, #0f766e);
	font-weight: 650;
	font-size: 13px;
	list-style: none;
	white-space: nowrap;
}
.mel-carton-more > summary::-webkit-details-marker { display: none; }
.mel-carton-more .is-open { display: none; }
.mel-carton-more[open] .is-closed { display: none; }
.mel-carton-more[open] .is-open { display: inline; }
.mel-carton-more-body {
	display: flex;
	flex-direction: column;
	gap: 12px;
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid var(--line, #e5e7eb);
}
.mel-carton-more-body[hidden] { display: none !important; }
@media (max-width: 720px) {
	.mel-carton-actions { margin-left: 0; width: 100%; }
	.mel-carton-actions .mel-btn { flex: 1; }
}
.mel-carton-photo-lg {
	width: 120px;
	height: 120px;
	object-fit: cover;
	border-radius: 8px;
	display: block;
	border: 1px solid var(--line, #e5e7eb);
}
.mel-carton-assign {
	margin: 0 0 12px;
	padding: 10px 12px;
	border: 1px dashed #cbd5e1;
	border-radius: 10px;
	background: #f8fafc;
}
.mel-carton-assign-h {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 10px;
	margin: 0 0 8px;
	font-size: 13px;
}
.mel-carton-assign-list {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}
.mel-carton-assign-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	padding: 6px 8px;
	border-radius: 8px;
	background: #fff;
	border: 1px solid #e2e8f0;
}
.mel-carton-assign-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	min-width: 0;
	font-size: 13px;
}
.mel-carton-assign-meta strong {
	font-family: Consolas, Monaco, monospace;
	font-size: 13px;
}
.mel-carton-assign-acts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
}
.mel-carton-assign-acts .mel-btn {
	padding: 6px 12px;
	font-size: 13px;
}
html.mel-night .mel-carton-assign { background: rgba(255,255,255,0.03); border-color: var(--line); }
html.mel-night .mel-carton-assign-row { background: rgba(0,0,0,0.2); border-color: var(--line); }
.mel-carton-job {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 10px;
	border: 1px solid var(--line, #e5e7eb);
	border-radius: 8px;
	background: #fff;
}
.mel-carton-job + .mel-carton-job { margin-top: 2px; }
.mel-carton-job-h {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
	font-size: 13px;
}
.mel-carton-job-acts {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-left: auto;
}
.mel-carton-job-acts .mel-btn {
	padding: 5px 10px;
	font-size: 12px;
}
.mel-carton-job-acts .mel-btn.is-danger {
	color: #b91c1c;
	border-color: #fecaca;
}
.mel-carton-job-acts .mel-btn.is-danger:hover {
	background: #fef2f2;
}
html.mel-night .mel-carton-job { background: rgba(255,255,255,0.03); }
.mel-carton-items {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.mel-carton-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 4px 8px 4px 4px;
	border: 1px solid var(--line, #e5e7eb);
	border-radius: 8px;
	background: #fff;
	max-width: 100%;
}
.mel-carton-item-img {
	width: 36px;
	height: 36px;
	object-fit: cover;
	border-radius: 5px;
	display: block;
	background: #e8eceb;
	flex-shrink: 0;
}
.mel-carton-item-img.is-empty {
	background: repeating-linear-gradient(-45deg, #eceff1, #eceff1 6px, #e2e6e8 6px, #e2e6e8 12px);
}
.mel-carton-item-meta {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 4px 6px;
	align-items: baseline;
	font-size: 12px;
	min-width: 0;
}
.mel-carton-item-meta code { font-size: 12px; font-weight: 700; }
html.mel-night .mel-carton-item { background: rgba(255,255,255,0.04); }
@media (max-width: 720px) {
	.mel-carton-row {
		grid-template-columns: 56px minmax(0, 1fr);
	}
	.mel-carton-thumb-wrap { width: 56px; height: 56px; }
	.mel-carton-actions {
		grid-column: 1 / -1;
		flex-direction: row;
		flex-wrap: wrap;
	}
}
html.mel-night .mel-carton-row {
	background: rgba(255, 255, 255, 0.03);
	border-color: rgba(255, 255, 255, 0.08);
}
html.mel-night .mel-carton-row.is-on {
	background: rgba(15, 118, 110, 0.18);
}

