/* Merchant workspace additions. The open-source runtime is retained under app/LICENSE. */
:root {
	color-scheme: light;
	--bg: #f5f7f6;
	--surface: #fff;
	--surface-soft: #f0f4f2;
	--ink: #1b2b25;
	--muted: #596a62;
	--line: #dce5df;
	--accent: #126044;
	--accent-soft: #e5f2ea;
	--danger: #a23832;
	--warning: #8c570b;
	--shadow: 0 16px 70px #1835271a;
	font-family:
		-apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
		"Microsoft YaHei", sans-serif;
	font-size: 14px;
}
* {
	box-sizing: border-box;
}
body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	line-height: 1.65;
}
button,
input,
textarea,
select {
	font: inherit;
}
button,
a,
input,
select,
textarea {
	-webkit-tap-highlight-color: transparent;
}
button {
	cursor: pointer;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	padding: 8px 14px;
	border-radius: 7px;
	font-weight: 550;
	white-space: nowrap;
}
button:hover {
	background: var(--surface-soft);
	border-color: var(--muted);
}
button:active {
	transform: translateY(1px);
}
button:disabled {
	opacity: 0.5;
	cursor: not-allowed;
	transform: none;
}
button.primary {
	background: var(--accent);
	color: #fff;
	border-color: var(--accent);
}
button.primary:hover {
	filter: brightness(0.92);
}
button.danger {
	color: var(--danger);
}
button.small {
	padding: 4px 9px;
	font-size: 12px;
}
a {
	color: var(--accent);
	text-underline-offset: 3px;
}
input,
select,
textarea {
	width: 100%;
	color: var(--ink);
	background: var(--surface);
	border: 1px solid #aebfb4;
	border-radius: 6px;
	padding: 10px 12px;
}
input::placeholder,
textarea::placeholder {
	color: var(--muted);
	opacity: 1;
}
input[type="checkbox"] {
	width: 17px;
	height: 17px;
	accent-color: var(--accent);
	flex-shrink: 0;
}
textarea {
	resize: vertical;
	min-height: 105px;
	line-height: 1.7;
}
input:focus,
select:focus,
textarea:focus,
button:focus-visible,
a:focus-visible {
	outline: 3px solid #7abf9e;
	outline-offset: 3px;
}
label {
	display: flex;
	flex-direction: column;
	gap: 6px;
	font-weight: 550;
	margin-bottom: 16px;
}
label.check {
	flex-direction: row;
	align-items: flex-start;
	font-weight: 400;
	gap: 9px;
}
label.check input {
	margin-top: 5px;
}
fieldset {
	border: 1px solid var(--line);
	border-radius: 7px;
	margin: 0 0 16px;
	padding: 15px;
}
legend {
	padding: 0 6px;
	font-weight: 600;
}
small,
.muted {
	color: var(--muted);
}
h1,
h2,
h3,
p {
	margin-top: 0;
}
h1 {
	font-size: 29px;
	letter-spacing: -0.7px;
	line-height: 1.3;
	font-weight: 650;
	margin-bottom: 8px;
}
h2 {
	font-size: 17px;
	margin-bottom: 18px;
	font-weight: 650;
}
h3 {
	font-size: 15px;
	margin-bottom: 10px;
}
p {
	margin-bottom: 14px;
}
.skip {
	position: fixed;
	top: -60px;
	z-index: 20;
	background: var(--surface);
	padding: 12px;
}
.skip:focus {
	top: 8px;
	left: 8px;
}
.boot {
	padding: 12vh 9vw;
}
.shell {
	min-height: 100dvh;
	display: grid;
	grid-template-columns: 230px minmax(0, 1fr);
}
.sidebar {
	background: var(--surface);
	border-right: 1px solid var(--line);
	padding: 26px 18px;
	display: flex;
	flex-direction: column;
	position: sticky;
	top: 0;
	height: 100dvh;
}
.brand {
	display: flex;
	gap: 11px;
	align-items: center;
	margin: 0 9px 30px;
}
.brand-mark {
	width: 35px;
	height: 35px;
	border-radius: 9px;
	background: var(--accent);
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 700;
	font-size: 20px;
}
.brand-name {
	font-size: 21px;
	font-weight: 700;
	letter-spacing: 1px;
}
.brand-sub {
	font-size: 11px;
	color: var(--muted);
}
.workspace-label {
	font-size: 12px;
	margin: 0 9px 8px;
	color: var(--muted);
}
.tenant-select {
	font-size: 13px;
	margin-bottom: 25px;
	padding: 10px 8px;
}
.nav {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.nav button {
	border: none;
	text-align: left;
	font-weight: 450;
	background: transparent;
	padding: 11px 15px;
	color: var(--muted);
}
.nav button.active {
	background: var(--accent-soft);
	color: var(--accent);
	font-weight: 650;
}
.nav-divider {
	height: 1px;
	background: var(--line);
	margin: 14px 8px;
}
.sidebar-foot {
	margin-top: auto;
	padding: 24px 9px 0;
	font-size: 12px;
	color: var(--muted);
}
.sidebar-foot .user-name {
	font-weight: 600;
	color: var(--ink);
	margin-bottom: 8px;
	overflow-wrap: anywhere;
}
.topbar {
	height: 67px;
	padding: 0 34px;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	background: var(--surface);
	font-size: 12px;
	color: var(--muted);
}
.topbar strong {
	font-weight: 550;
	color: var(--ink);
}
.main {
	padding: 35px 36px 60px;
	max-width: 1540px;
	margin: 0 auto;
}
.page-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 20px;
	margin-bottom: 24px;
}
.page-heading p {
	max-width: 760px;
	color: var(--muted);
	margin: 0;
	font-size: 13px;
}
.actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	align-items: center;
}
.notice {
	border-left: 3px solid var(--accent);
	padding: 12px 16px;
	background: var(--accent-soft);
	color: var(--accent);
	margin-bottom: 22px;
	font-size: 13px;
	border-radius: 0 6px 6px 0;
}
.notice.warn {
	border-color: var(--warning);
	background: #fff6e6;
	color: #764b0f;
}
.notice.error {
	border-color: var(--danger);
	color: var(--danger);
	background: #fff0ef;
}
.stat-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	margin-bottom: 25px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 10px;
}
.stat {
	padding: 24px;
	border-right: 1px solid var(--line);
}
.stat:last-child {
	border: none;
}
.stat-label {
	color: var(--muted);
	font-size: 12px;
}
.stat-value {
	display: block;
	font-size: 32px;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
	line-height: 1.4;
	letter-spacing: -1px;
	margin: 5px 0;
}
.stat small {
	font-size: 11px;
}
.split {
	display: grid;
	grid-template-columns: minmax(0, 1.8fr) minmax(270px, 1fr);
	gap: 22px;
	align-items: start;
}
.panel {
	background: var(--surface);
	padding: 24px;
	border: 1px solid var(--line);
	border-radius: 10px;
	min-width: 0;
	margin-bottom: 22px;
}
.panel-head {
	display: flex;
	justify-content: space-between;
	gap: 14px;
	align-items: center;
	margin-bottom: 16px;
}
.panel-head h2 {
	margin: 0;
}
.empty {
	padding: 48px 25px;
	text-align: center;
	border: 1px dashed #b6c8bd;
	border-radius: 8px;
	color: var(--muted);
}
.empty h3 {
	font-size: 17px;
	color: var(--ink);
}
.empty p {
	max-width: 530px;
	margin: 0 auto 18px;
}
.table-wrap {
	width: 100%;
	overflow-x: auto;
}
table {
	width: 100%;
	border-collapse: collapse;
	text-align: left;
	font-size: 13px;
}
th {
	font-weight: 500;
	color: var(--muted);
	font-size: 11px;
	padding: 10px 12px;
	background: var(--surface-soft);
	white-space: nowrap;
}
td {
	padding: 15px 12px;
	border-bottom: 1px solid var(--line);
	vertical-align: top;
}
tr:last-child td {
	border-bottom: 0;
}
td.question {
	min-width: 200px;
	max-width: 360px;
}
td .actions {
	min-width: 110px;
}
.cell-note {
	display: block;
	font-size: 11px;
	color: var(--muted);
	margin-top: 4px;
	word-break: break-word;
}
.badge {
	display: inline-block;
	font-size: 11px;
	padding: 3px 7px;
	line-height: 1.5;
	border-radius: 4px;
	background: var(--surface-soft);
	color: var(--muted);
	white-space: nowrap;
}
.badge.good {
	background: var(--accent-soft);
	color: var(--accent);
}
.badge.warn {
	background: #fff3dc;
	color: #80500c;
}
.badge.bad {
	background: #ffedeb;
	color: var(--danger);
}
.cards {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 18px;
}
.card {
	padding: 22px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 9px;
	min-width: 0;
}
.card p {
	color: var(--muted);
	font-size: 13px;
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.card .actions {
	padding-top: 8px;
}
.list-row {
	display: flex;
	justify-content: space-between;
	gap: 18px;
	padding: 15px 0;
	border-bottom: 1px solid var(--line);
	font-size: 13px;
}
.list-row:last-child {
	border-bottom: 0;
}
.number {
	font-variant-numeric: tabular-nums;
}
.mono {
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 11px;
	overflow-wrap: anywhere;
}
.checklist {
	display: grid;
	gap: 14px;
	font-size: 13px;
}
.checklist > div {
	display: flex;
	gap: 10px;
	align-items: flex-start;
}
.check-box {
	width: 18px;
	height: 18px;
	border-radius: 4px;
	background: var(--accent-soft);
	color: var(--accent);
	display: inline-grid;
	place-items: center;
	flex-shrink: 0;
	font-size: 12px;
}
.auth {
	min-height: 100dvh;
	display: grid;
	grid-template-columns: minmax(320px, 0.9fr) minmax(380px, 1fr);
}
.auth-story {
	background: #163f30;
	color: #edf6f1;
	padding: 70px 10%;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
}
.auth-story h1 {
	font-size: clamp(32px, 3.8vw, 52px);
	line-height: 1.45;
	max-width: 540px;
	margin: 40px 0 22px;
	letter-spacing: -1px;
}
.auth-story p {
	color: #c5dbcf;
	max-width: 430px;
	line-height: 1.9;
}
.auth-story .brand {
	margin: 0;
}
.auth-story .brand-mark {
	background: #d6eadd;
	color: #163f30;
}
.auth-lines {
	border-top: 1px solid #557565;
	margin-top: 60px;
	padding-top: 24px;
	font-size: 13px;
	line-height: 2;
	color: #c5dbcf;
}
.auth-main {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 45px;
	background: var(--surface);
}
.auth-form {
	width: min(390px, 100%);
}
.auth-form h2 {
	font-size: 25px;
	margin-bottom: 9px;
}
.auth-form form {
	margin-top: 30px;
}
.auth-form button {
	width: 100%;
	padding: 12px;
	margin: 8px 0 20px;
}
.auth-form small {
	font-size: 12px;
}
.form-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0 18px;
}
.form-grid .full {
	grid-column: 1 / -1;
}
.field-hint {
	display: block;
	margin-top: 3px;
	color: var(--muted);
	font-size: 11px;
	font-weight: 400;
}
.form-error {
	color: var(--danger);
	background: #fff0ef;
	border-radius: 6px;
	padding: 10px 14px;
	font-size: 13px;
	margin-bottom: 16px;
}
.form-error:empty {
	display: none;
}
.form-actions {
	display: flex;
	gap: 10px;
	justify-content: flex-end;
	padding-top: 12px;
}
dialog {
	padding: 0;
	border: 1px solid var(--line);
	background: var(--surface);
	color: var(--ink);
	border-radius: 12px;
	box-shadow: var(--shadow);
	width: min(760px, calc(100vw - 32px));
	max-height: 90dvh;
}
dialog::backdrop {
	background: #0c211a66;
}
.dialog-head {
	padding: 22px 26px;
	border-bottom: 1px solid var(--line);
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
}
.dialog-head h2 {
	margin: 0;
	font-size: 19px;
}
.dialog-body {
	padding: 25px 26px;
	max-height: calc(90dvh - 83px);
	overflow-y: auto;
}
.check-group {
	max-height: 230px;
	overflow-y: auto;
}
.check-group label {
	margin-bottom: 8px;
	font-size: 12px;
}
pre.answer {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
	font: inherit;
	font-size: 13px;
	padding: 20px;
	background: var(--surface-soft);
	border: 1px solid var(--line);
	border-radius: 8px;
	max-height: 440px;
	overflow: auto;
}
.evidence-image {
	display: block;
	max-width: 100%;
	max-height: 400px;
	object-fit: contain;
	margin: 16px 0;
}
.report {
	max-width: 980px;
	margin: 36px auto;
	padding: 38px;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: 10px;
}
.report h1 {
	font-size: 28px;
	margin: 20px 0 10px;
}
.report-section {
	border-top: 1px solid var(--line);
	padding-top: 25px;
	margin-top: 28px;
}
.report-source {
	padding: 20px;
	background: var(--surface-soft);
	margin: 15px 0;
	border-radius: 7px;
}
.report-stats {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 15px;
}
.report-stats strong {
	display: block;
	font-size: 24px;
}
.report-stats span {
	display: block;
	color: var(--muted);
	font-size: 11px;
}
.report-conclusion {
	white-space: pre-wrap;
	overflow-wrap: anywhere;
}
.report + .competitor-panel {
	max-width: 980px;
	margin: 20px auto;
}
@media (max-width: 740px) {
	.report + .competitor-panel {
		margin: 16px;
	}
}
#toast {
	display: none;
	position: fixed;
	bottom: 28px;
	right: 28px;
	max-width: min(480px, calc(100vw - 32px));
	padding: 14px 20px;
	border-radius: 8px;
	box-shadow: var(--shadow);
	z-index: 40;
	background: var(--accent);
	color: #fff;
	font-size: 13px;
}
#toast.visible {
	display: block;
}
#toast.error {
	background: var(--danger);
}
.toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 18px;
}
.toolbar select {
	width: auto;
	min-width: 160px;
	max-width: 400px;
}
.text-link {
	border: none;
	background: none;
	padding: 0;
	color: var(--accent);
	text-decoration: underline;
	text-underline-offset: 3px;
	font-size: inherit;
	white-space: normal;
	text-align: left;
}
.subtle-box {
	border: 1px solid var(--line);
	background: var(--surface-soft);
	border-radius: 7px;
	padding: 16px;
	margin-bottom: 20px;
}
.subtle-box p {
	margin: 0;
	font-size: 12px;
	color: var(--muted);
}
.wide-form {
	max-width: 820px;
}
@media (max-width: 1150px) {
	.shell {
		grid-template-columns: 195px minmax(0, 1fr);
	}
	.sidebar {
		padding: 22px 12px;
	}
	.main {
		padding: 28px 22px 50px;
	}
	.split {
		grid-template-columns: minmax(0, 1fr);
		gap: 0;
	}
	.stat {
		padding: 18px;
	}
	.stat-value {
		font-size: 27px;
	}
}
@media (max-width: 740px) {
	.shell {
		display: block;
	}
	.sidebar {
		position: static;
		height: auto;
		padding: 16px;
		border-right: none;
		border-bottom: 1px solid var(--line);
	}
	.brand {
		margin: 0 0 16px;
	}
	.workspace-label,
	.sidebar-foot {
		display: none;
	}
	.tenant-select {
		margin-bottom: 14px;
	}
	.nav {
		flex-direction: row;
		overflow-x: auto;
		gap: 4px;
		padding-bottom: 4px;
	}
	.nav button {
		flex-shrink: 0;
		padding: 8px 12px;
	}
	.nav-divider {
		display: none;
	}
	.topbar {
		height: auto;
		min-height: 54px;
		padding: 12px 18px;
	}
	.main {
		padding: 24px 16px 40px;
	}
	.page-heading {
		flex-direction: column;
		gap: 15px;
	}
	h1 {
		font-size: 25px;
	}
	.stat-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
	.stat:nth-child(2) {
		border-right: 0;
	}
	.stat:nth-child(-n + 2) {
		border-bottom: 1px solid var(--line);
	}
	.panel {
		padding: 18px;
	}
	.cards,
	.form-grid {
		grid-template-columns: minmax(0, 1fr);
	}
	.auth {
		grid-template-columns: minmax(0, 1fr);
	}
	.auth-story {
		padding: 25px;
	}
	.auth-story h1 {
		font-size: 27px;
		margin: 25px 0 12px;
	}
	.auth-story p {
		margin-bottom: 0;
		font-size: 12px;
	}
	.auth-lines {
		display: none;
	}
	.auth-main {
		padding: 32px 25px;
	}
	.dialog-head,
	.dialog-body {
		padding: 18px;
	}
	.report {
		padding: 22px;
		margin: 16px;
	}
	.report-stats {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}
@media (prefers-color-scheme: dark) {
	:root {
		color-scheme: dark;
		--bg: #111b17;
		--surface: #19271f;
		--surface-soft: #23362a;
		--ink: #e7f0e9;
		--muted: #aec3b6;
		--line: #354d3e;
		--accent: #80c8a4;
		--accent-soft: #253e30;
		--danger: #f1a69b;
		--warning: #e4ba70;
		--shadow: 0 16px 70px #0005;
	}
	button.primary {
		color: #11291b;
	}
	.badge.warn,
	.notice.warn {
		background: #3a3020;
		color: #edc781;
	}
	.badge.bad,
	.form-error,
	.notice.error {
		background: #442b27;
		color: #ffb8ad;
	}
	.brand-mark {
		color: #11291b;
	}
	#toast {
		color: #10261b;
	}
	#toast.error {
		background: #713e37;
		color: #fff;
	}
	input,
	select,
	textarea {
		border-color: #607b69;
	}
}
@media (prefers-reduced-motion: reduce) {
	button:active {
		transform: none;
	}
}
@media print {
	body {
		background: white;
		color: #111;
	}
	.sidebar,
	.topbar,
	.actions,
	.skip,
	#toast {
		display: none !important;
	}
	.shell {
		display: block;
	}
	.report {
		border: 0;
		margin: 0;
		padding: 10px;
		max-width: none;
	}
	.report-source {
		break-inside: avoid;
	}
}
