/* GW Scanner front end. Phone first. Light and dark. */
.gws {
	--gws-main: #1d5fa7;
	--gws-main-ink: #ffffff;
	--gws-accent: #e8771e;
	--gws-alt: #F5C518;
	--gws-alt-ink: #1a1a1a;
	--gws-bg: #ffffff;
	--gws-card: #f6f8fb;
	--gws-ink: #16202c;
	--gws-muted: #5a6776;
	--gws-line: #dbe2ea;
	--gws-high: #1e7d3c;
	--gws-med: #9a6a00;
	--gws-low: #8a3b2e;
	--gws-radius: 12px;
	color: var(--gws-ink);
	background: var(--gws-bg);
	font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	max-width: 1180px;
	margin: 0 auto;
	padding: 12px 16px 20px;
	box-sizing: border-box;
}
@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .gws {
		--gws-main: #4a8fe0;
		--gws-main-ink: #0b1420;
		--gws-accent: #f39a4c;
		--gws-bg: #0f151c;
		--gws-card: #18212b;
		--gws-ink: #e8eef5;
		--gws-muted: #9fb0c2;
		--gws-line: #2a3644;
		--gws-high: #5fcf86;
		--gws-med: #f0c25a;
		--gws-low: #f08d7c;
	}
}
:root[data-theme="dark"] .gws {
	--gws-main: #4a8fe0;
	--gws-main-ink: #0b1420;
	--gws-accent: #f39a4c;
	--gws-bg: #0f151c;
	--gws-card: #18212b;
	--gws-ink: #e8eef5;
	--gws-muted: #9fb0c2;
	--gws-line: #2a3644;
	--gws-high: #5fcf86;
	--gws-med: #f0c25a;
	--gws-low: #f08d7c;
}
.gws *, .gws *::before, .gws *::after { box-sizing: border-box; }
.gws [hidden] { display: none !important; }

/* Centered short lines, one statement per line. */
.gws-lines { margin: 8px 0; text-align: center; }
.gws-lines > span { display: block; }
.gws-sub { color: var(--gws-muted); font-size: 14px; }

/* Buttons */
.gws-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 44px; padding: 10px 18px; border-radius: 10px; border: 2px solid transparent;
	font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.gws-btn-main { background: var(--gws-main); color: var(--gws-main-ink); }
.gws-btn-main:hover { filter: brightness(1.08); }
.gws-btn-alt { background: var(--gws-alt); color: var(--gws-alt-ink); }
.gws-btn-alt:hover { filter: brightness(1.05); }
.gws-btn-ghost { background: transparent; color: var(--gws-ink); border-color: var(--gws-line); }
.gws-btn:disabled { opacity: .5; cursor: not-allowed; }
.gws-btn:focus-visible, .gws a:focus-visible { outline: 3px solid var(--gws-accent); outline-offset: 2px; }

/* Upload at the very top */
.gws-pick { margin: 0 0 8px; text-align: center; }
.gws-upload { width: 100%; max-width: 420px; min-height: 56px; font-size: 18px; position: relative; }
.gws-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.gws-hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Section headers: icon left, title right, never stacked */
.gws-h { display: flex; align-items: center; gap: 10px; margin: 18px 0 8px; font-size: 19px; line-height: 1.2; }
.gws-h .gws-ico { flex: 0 0 auto; color: var(--gws-accent); }
.gws-h > span { flex: 0 1 auto; }
.gws-h-sm { font-size: 16px; margin: 4px 0 10px; }

/* Photo stage */
.gws-canvas-wrap { position: relative; background: var(--gws-card); border: 1px solid var(--gws-line); border-radius: var(--gws-radius); padding: 8px; }
.gws-canvas { display: block; width: auto; height: auto; max-width: 100%; max-height: 62vh; margin: 0 auto; touch-action: none; border-radius: 8px; cursor: crosshair; }
.gws-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 12px 0 4px; }
.gws-status { text-align: center; color: var(--gws-muted); min-height: 1.4em; margin: 6px 0; }

/* One card per picked item; cards sit in a grid */
.gws-items { display: grid; grid-template-columns: 1fr; gap: 14px; margin-top: 14px; align-items: start; }
@media (min-width: 860px) { .gws-items { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.gws-item { border: 1px solid var(--gws-line); border-radius: var(--gws-radius); padding: 14px; background: var(--gws-bg); min-width: 0; }
.gws-item-head { display: flex; align-items: center; gap: 12px; }
.gws-crop { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 1px solid var(--gws-line); flex: 0 0 auto; }
.gws-item-title { font-weight: 700; font-size: 17px; margin: 0; }
.gws-item-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; min-height: 4px; }

.gws-chip { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; border: 1.5px solid currentColor; }
.gws-chip-ai { color: var(--gws-high); }
.gws-chip-info { color: var(--gws-muted); }

/* Guided pickers */
.gws-describe { margin-top: 12px; padding: 10px 12px; border-radius: 10px; background: var(--gws-card); border: 1px solid var(--gws-line); }
.gws-describe > summary { cursor: pointer; list-style: none; margin: 0; }
.gws-describe > summary::-webkit-details-marker { display: none; }
.gws-describe > summary::after { content: "+"; margin-left: auto; font-weight: 700; color: var(--gws-muted); }
.gws-describe[open] > summary::after { content: "\2212"; }
.gws-field { margin: 10px 0 0; }
.gws-field-label { display: block; font-size: 13px; font-weight: 700; color: var(--gws-muted); margin: 0 0 6px; }
.gws-input { width: 100%; min-height: 42px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--gws-line); background: var(--gws-bg); color: var(--gws-ink); font: inherit; }
.gws-pills { display: flex; flex-wrap: wrap; gap: 8px; }
.gws-pill { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--gws-line); background: var(--gws-bg); color: var(--gws-ink); font: inherit; font-size: 14px; cursor: pointer; white-space: nowrap; }
.gws-pill[aria-pressed="true"] { background: var(--gws-main); border-color: var(--gws-main); color: var(--gws-main-ink); font-weight: 650; }
.gws-swatch { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(0,0,0,.35); flex: 0 0 auto; }

/* Keyword chips */
.gws-kw { margin-top: 12px; }
.gws-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.gws-kchip { display: inline-flex; align-items: center; gap: 4px; padding: 4px 4px 4px 12px; border-radius: 999px; background: var(--gws-card); border: 1.5px solid var(--gws-accent); font-size: 14px; font-weight: 600; white-space: nowrap; max-width: 100%; }
.gws-kchip > span { overflow: hidden; text-overflow: ellipsis; }
.gws-kchip-x { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--gws-muted); cursor: pointer; }
.gws-kchip-x:hover { background: var(--gws-line); color: var(--gws-ink); }
.gws-hint { margin: 0; color: var(--gws-muted); font-size: 14px; text-align: center; width: 100%; }
.gws-add { display: flex; gap: 8px; margin-top: 10px; }
.gws-add-input { flex: 1 1 auto; min-width: 0; min-height: 40px; padding: 8px 12px; border-radius: 8px; border: 1px solid var(--gws-line); background: var(--gws-bg); color: var(--gws-ink); font: inherit; }
.gws-btn-sm { min-height: 40px; padding: 8px 14px; }

/* eBay search links */
.gws-cta { display: grid; grid-template-columns: 1fr; gap: 10px; margin-top: 14px; }
@media (min-width: 420px) { .gws-cta { grid-template-columns: 1fr 1fr; } }
.gws-cta .gws-btn { width: 100%; }

/* Network content: separate section below the search links */
.gws-network { margin-top: 14px; padding: 12px; border-radius: 10px; border: 1px dashed var(--gws-line); }
.gws-netlinks { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 0; padding: 0; list-style: none; }
.gws-netlinks a { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--gws-main); color: var(--gws-main); text-decoration: none; font-weight: 600; white-space: nowrap; }
.gws-netlinks a.gws-maker { border-color: var(--gws-accent); color: var(--gws-accent); }

.gws-disclaimer { font-size: 14px; color: var(--gws-muted); margin-top: 18px; }
.gws-foot { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--gws-line); font-size: 13px; color: var(--gws-muted); }
.gws-foot .gws-ico { width: 16px; height: 16px; vertical-align: -3px; color: var(--gws-accent); }
.gws-links { display: flex; justify-content: center; gap: 18px; margin: 6px 0 0; }
.gws-links a { color: var(--gws-main); }
.gws-error { color: var(--gws-low); font-weight: 600; }

/* First step on each card: what is being scanned */
.gws-cat { margin-top: 12px; }
.gws-cat-label { margin: 0 0 8px; cursor: pointer; }
.gws-cat-select { font-weight: 600; }

/* Routing: the network site made for this item */
.gws-route { margin-top: 12px; }
.gws-route-note { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 14px 12px; border-radius: 10px; background: var(--gws-card); border: 2px solid var(--gws-alt); text-align: center; min-width: 0; }
.gws-route-lines { margin: 0; max-width: 100%; }
.gws-route-lead { color: var(--gws-muted); font-size: 14px; font-weight: 600; }
.gws-route-name { font-size: 18px; font-weight: 750; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gws-route-go { max-width: 100%; }
.gws-btn-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gws-btn .gws-ico { flex: 0 0 auto; }

/* Network list, in menu order with the best match first */
.gws-nl { display: grid; gap: 8px; min-width: 0; }
.gws-nl-sec { display: grid; gap: 6px; min-width: 0; padding: 10px; border: 1px solid var(--gws-line); border-radius: 10px; background: var(--gws-bg); }
.gws-nl-hub { display: flex; justify-content: center; margin: 0; min-width: 0; }
.gws-nl-hub > .gws-nl-name { font-weight: 750; white-space: nowrap; }
.gws-nl-grp { min-width: 0; padding: 4px 10px; border-radius: 8px; background: var(--gws-card); }
.gws-nl-sum { display: flex; align-items: center; gap: 8px; width: 100%; min-height: 36px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--gws-ink); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; }
.gws-nl-sum::after { content: "+"; margin-left: auto; color: var(--gws-muted); font-weight: 700; }
.gws-nl-sum[aria-expanded="true"]::after { content: "\2212"; }
.gws-nl-sum:focus-visible, .gws-explore-sum:focus-visible { outline: 3px solid var(--gws-accent); outline-offset: 2px; border-radius: 6px; }
.gws-nl-glabel { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gws-nl-count { flex: 0 0 auto; padding: 1px 8px; border-radius: 999px; border: 1px solid var(--gws-line); color: var(--gws-muted); font-size: 12px; font-weight: 600; }
.gws-nl-sites { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 4px 0 8px; padding: 0; list-style: none; }
.gws-nl-sites li { min-width: 0; max-width: 100%; margin: 0; }
.gws-nl-site { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; min-height: 32px; padding: 4px 12px; border-radius: 999px; border: 1.5px solid var(--gws-line); background: var(--gws-bg); color: var(--gws-ink); font-size: 14px; font-weight: 600; text-decoration: none; white-space: nowrap; }
a.gws-nl-site { border-color: var(--gws-main); color: var(--gws-main); }
a.gws-nl-site:hover { background: var(--gws-card); }
.gws-nl-site.is-soon { color: var(--gws-muted); border-style: dashed; font-weight: 500; }
.gws-nl-site.is-here { background: var(--gws-card); border-color: var(--gws-muted); }
.gws-nl-site.is-best { border-width: 2px; border-color: var(--gws-alt); }
.gws-nl-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gws-nl-chip { flex: 0 0 auto; padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 800; letter-spacing: .02em; text-transform: uppercase; }
.gws-nl-chip-best { background: var(--gws-alt); color: var(--gws-alt-ink); }
.gws-nl-chip-here { background: var(--gws-line); color: var(--gws-ink); }
@media (min-width: 641px) {
	.gws-nl-grp { padding: 2px 0; background: transparent; }
}

/* This site is the best match: the network list waits behind a small toggle */
.gws-explore { margin-top: 12px; padding: 4px 12px; border-radius: 10px; border: 1px dashed var(--gws-line); }
.gws-explore-sum { justify-content: center; width: 100%; min-height: 40px; margin: 0; padding: 0; border: 0; background: transparent; color: var(--gws-ink); font: inherit; font-size: 15px; font-weight: 600; cursor: pointer; }
.gws-explore-sum[aria-expanded="true"] { margin-bottom: 8px; }
.gws-explore .gws-nl { padding-bottom: 8px; }
