/* Hallmark · macrostructure: asset workbench · tone: tactile studio · anchor hue: cold cyan */
:root {
	--bg: #e8efee;
	--paper: #f7fbfa;
	--paper-soft: #edf4f2;
	--ink: #14242b;
	--muted: #687b80;
	--stage: #10232b;
	--stage-2: #17333d;
	--stage-3: #1e414c;
	--stage-text: #edf7f5;
	--stage-muted: #9ab5ba;
	--line: #c9d9d6;
	--line-dark: rgba(193, 229, 228, .18);
	--cyan: #7edbd8;
	--coral: #f07d7d;
	--coral-dark: #bc5d64;
	--shadow: 0 24px 70px rgba(23, 50, 57, .16);
	--shadow-small: 0 8px 24px rgba(23, 50, 57, .1);
	--radius: 8px;
	--ease-out: cubic-bezier(.2, .8, .2, 1);
}

* { box-sizing: border-box; }
html { min-width: 320px; overflow-x: clip; background: var(--bg); }
body {
	margin: 0;
	color: var(--ink);
	font: 16px/1.5 "Segoe UI", "Noto Sans SC", system-ui, sans-serif;
	background:
		linear-gradient(rgba(19, 48, 55, .035) 1px, transparent 1px),
		linear-gradient(90deg, rgba(19, 48, 55, .035) 1px, transparent 1px),
		var(--bg);
	background-size: 28px 28px;
}
button, input, select { font: inherit; }
a { color: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.tools-header, .tools-main, .tools-footer { width: min(1320px, calc(100% - 48px)); margin-inline: auto; }
.tools-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 72px;
	border-bottom: 1px solid rgba(20, 36, 43, .14);
}
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 750; letter-spacing: .01em; }
.brand-mark { display: grid; place-items: center; width: 30px; height: 30px; color: var(--stage); background: var(--cyan); border-radius: 7px; }
.brand-mark svg, .hero-note svg, .tab-icon svg, .tab-arrow svg, .rail-footnote-icon svg, .upload-icon svg, .button-icon svg { display: block; width: 1em; height: 1em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.brand-mark svg { width: 20px; height: 20px; stroke-width: 1.75; }
.header-meta, .top-nav { display: flex; align-items: center; gap: 18px; }
.subaru-tap-link {
	padding: 8px 12px;
	color: #fff;
	background: var(--coral-dark);
	border: 1px solid var(--coral-dark);
	border-radius: 6px;
	text-decoration: none;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .04em;
	box-shadow: var(--shadow-small);
}
.subaru-tap-link:hover, .subaru-tap-link:focus-visible { background: var(--stage); border-color: var(--stage); outline: none; }
.top-nav { gap: 16px; font-size: 13px; font-weight: 650; }
.top-nav a { color: var(--muted); text-decoration: none; }
.top-nav a:hover, .top-nav a:focus-visible { color: var(--coral-dark); }
.local-badge { display: inline-flex; align-items: center; gap: 7px; color: var(--muted); font-size: 12px; }
.local-dot { width: 7px; height: 7px; background: var(--coral); border-radius: 50%; box-shadow: 0 0 0 4px rgba(240, 125, 125, .14); }

.tools-hero { display: flex; align-items: end; justify-content: space-between; gap: 32px; padding: 64px 0 38px; }
.eyebrow, .panel-kicker, .rail-label { margin: 0 0 10px; color: var(--coral-dark); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
.tools-hero h1 { max-width: 780px; margin: 0; color: var(--stage); font-size: clamp(42px, 6vw, 76px); font-weight: 800; letter-spacing: -.055em; line-height: .98; }
.lead { max-width: 560px; margin: 18px 0 0; color: var(--muted); font-size: clamp(17px, 2vw, 20px); }
.hero-note { display: inline-flex; align-items: center; gap: 10px; max-width: 280px; padding: 12px 14px; color: var(--stage); background: rgba(247, 251, 250, .78); border: 1px solid var(--line); border-radius: 7px; box-shadow: var(--shadow-small); font-size: 12px; }
.hero-note svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--coral-dark); }

.tool-workbench { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 720px; overflow: hidden; background: var(--stage); border: 1px solid rgba(16, 35, 43, .18); border-radius: var(--radius); box-shadow: var(--shadow); }
.tool-rail { display: flex; flex-direction: column; padding: 24px 14px 18px; color: var(--stage-text); background: var(--stage); border-right: 1px solid var(--line-dark); }
.rail-heading { padding: 0 10px 20px; }
.rail-heading .rail-label { display: block; margin-bottom: 6px; color: var(--cyan); }
.rail-heading strong { display: block; max-width: 150px; font-size: 15px; line-height: 1.35; }
.tool-tabs { display: grid; gap: 6px; }
.tool-tab { display: grid; grid-template-columns: 28px minmax(0, 1fr) 18px; align-items: center; gap: 9px; width: 100%; padding: 13px 10px; color: var(--stage-muted); text-align: left; background: transparent; border: 1px solid transparent; border-radius: 6px; cursor: pointer; transition: background .18s var(--ease-out), color .18s var(--ease-out), transform .18s var(--ease-out); }
.tool-tab:hover { color: var(--stage-text); background: rgba(126, 219, 216, .08); transform: translateX(2px); }
.tool-tab.is-active { color: var(--stage-text); background: var(--stage-2); border-color: rgba(126, 219, 216, .25); box-shadow: inset 3px 0 var(--coral); }
.tab-icon { display: grid; place-items: center; width: 28px; height: 28px; color: var(--cyan); background: rgba(126, 219, 216, .1); border-radius: 5px; }
.tab-icon svg { width: 17px; height: 17px; }
.tab-copy { display: grid; gap: 2px; min-width: 0; }
.tab-copy strong { font-size: 14px; font-weight: 700; }
.tab-copy small { overflow: hidden; color: var(--stage-muted); font-size: 11px; line-height: 1.25; text-overflow: ellipsis; white-space: nowrap; }
.tab-arrow { color: var(--stage-muted); opacity: .65; }
.tab-arrow svg { width: 16px; height: 16px; }
.tool-tab.is-active .tab-arrow { color: var(--coral); opacity: 1; }
.rail-footnote { display: flex; gap: 9px; align-items: flex-start; margin-top: auto; padding: 14px 10px 0; color: var(--stage-muted); border-top: 1px solid var(--line-dark); font-size: 11px; }
.rail-footnote p { margin: 0; }
.rail-footnote-icon { flex: 0 0 auto; color: var(--cyan); }
.rail-footnote-icon svg { width: 16px; height: 16px; }

.tool-stage { min-width: 0; padding: 28px; background: var(--paper); }
.tool-panel[hidden] { display: none; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 0 0 22px; border-bottom: 1px solid var(--line); }
.panel-kicker { margin-bottom: 7px; color: var(--coral-dark); }
.panel-heading h2 { margin: 0; color: var(--stage); font-size: clamp(25px, 3vw, 36px); letter-spacing: -.035em; line-height: 1.08; }
.panel-heading > div:first-child > p:last-child { margin: 9px 0 0; color: var(--muted); font-size: 14px; }
.panel-output { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; padding: 7px 10px; color: var(--muted); background: var(--paper-soft); border: 1px solid var(--line); border-radius: 999px; font-size: 11px; white-space: nowrap; }
.output-dot { width: 7px; height: 7px; background: var(--muted); border-radius: 50%; }
.tool-panel:has(canvas[width]:not([width="0"])) .output-dot { background: var(--coral); }

.workspace-grid { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 22px; padding-top: 22px; }
.canvas-zone { min-width: 0; padding: 14px; background: var(--stage); border-radius: 7px; }
.canvas-zone-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 2px 12px; color: var(--stage-text); font-size: 12px; font-weight: 700; }
.canvas-hint { color: var(--stage-muted); font-size: 11px; font-weight: 500; }
.preview-column { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.25fr); gap: 12px; align-items: start; }
.preview-frame { position: relative; min-height: 360px; padding: 34px 12px 12px; overflow: hidden; background-color: #d9e2df; background-image: linear-gradient(45deg, #c6d3d0 25%, transparent 25%), linear-gradient(-45deg, #c6d3d0 25%, transparent 25%), linear-gradient(45deg, transparent 75%, #c6d3d0 75%), linear-gradient(-45deg, transparent 75%, #c6d3d0 75%); background-size: 22px 22px; background-position: 0 0, 0 11px, 11px -11px, -11px 0; border: 1px solid rgba(16, 35, 43, .16); border-radius: 5px; }
.result-frame { background-color: #eef4f2; }
.preview-label { position: absolute; top: 10px; left: 12px; color: var(--stage); font-size: 10px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.preview-frame canvas { display: block; width: 100%; height: auto; max-height: 560px; object-fit: contain; image-rendering: pixelated; }
.empty-preview { position: absolute; inset: 50% 14px auto; margin: 0; color: var(--muted); text-align: center; transform: translateY(-50%); font-size: 13px; }
.preview-frame canvas:not([width]) + .empty-preview, .preview-frame canvas[width="0"] + .empty-preview { display: block; }
.preview-frame canvas[width]:not([width="0"]) + .empty-preview { display: none; }
.preview-meta { min-height: 20px; margin: 9px 2px 0; color: var(--stage-muted); text-align: right; font-size: 11px; }

.inspector { min-width: 0; }
.upload-zone { display: grid; place-items: center; min-height: 160px; padding: 20px; color: var(--stage-text); text-align: center; background: var(--stage-2); border: 1px dashed rgba(126, 219, 216, .55); border-radius: 6px; cursor: pointer; transition: background .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out); }
.upload-zone:hover, .upload-zone.is-dragging { background: var(--stage-3); border-color: var(--cyan); transform: translateY(-1px); }
.upload-zone:focus-within { outline: 3px solid rgba(240, 125, 125, .45); outline-offset: 3px; }
.upload-zone input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.upload-icon { display: grid; place-items: center; width: 38px; height: 38px; margin-bottom: 9px; color: var(--cyan); background: rgba(126, 219, 216, .1); border-radius: 6px; font-size: 24px; }
.upload-icon svg { width: 22px; height: 22px; }
.upload-zone strong { font-size: 15px; }
.upload-zone small { margin-top: 4px; color: var(--stage-muted); font-size: 11px; }
.control-card { display: grid; gap: 12px; margin-top: 12px; padding: 15px; background: var(--paper-soft); border: 1px solid var(--line); border-radius: 6px; }
.control-heading { display: flex; align-items: center; justify-content: space-between; padding-bottom: 3px; color: var(--stage); font-size: 12px; font-weight: 800; }
.control-heading-note { color: var(--muted); font-size: 10px; font-weight: 600; text-transform: uppercase; }
.control-card label { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--muted); font-size: 12px; }
.range-label output { min-width: 28px; color: var(--stage); font-weight: 750; text-align: right; }
.control-card input[type=range] { width: 100%; accent-color: var(--coral-dark); }
.control-card label > input[type=number], .control-card select { width: 94px; min-height: 34px; padding: 6px 8px; color: var(--ink); background: var(--paper); border: 1px solid var(--line); border-radius: 4px; }
.control-card select { width: 132px; }
.check-row { justify-content: flex-start !important; padding-top: 3px; color: var(--stage) !important; }
.check-row input { accent-color: var(--coral-dark); }
.action-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 8px; margin-top: 12px; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 40px; padding: 8px 11px; color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 5px; cursor: pointer; transition: background .18s var(--ease-out), color .18s var(--ease-out), border-color .18s var(--ease-out), transform .18s var(--ease-out); }
.button:hover:not(:disabled) { transform: translateY(-1px); }
.button:active:not(:disabled) { transform: translateY(0); }
.button:disabled { cursor: not-allowed; opacity: .42; }
.button.primary { color: var(--stage); background: var(--cyan); border-color: var(--cyan); font-weight: 750; }
.button.primary:hover:not(:disabled) { background: #a2e8e2; border-color: #a2e8e2; }
.button.secondary { color: var(--stage-text); background: var(--stage-2); border-color: rgba(126, 219, 216, .26); }
.button.secondary:hover:not(:disabled) { background: var(--stage-3); border-color: rgba(126, 219, 216, .55); }
.button-icon { display: inline-grid; place-items: center; }
.button-icon svg { width: 16px; height: 16px; }
.tool-status { min-height: 22px; margin: 14px 2px 0; color: var(--muted); font-size: 12px; }
.tool-status[data-kind="error"] { color: var(--coral-dark); }
.tool-status[data-kind="success"] { color: #2f766d; }
.tools-footer { display: flex; justify-content: space-between; gap: 12px; padding: 20px 0 38px; color: var(--muted); font-size: 12px; }
.tools-footer a { color: var(--coral-dark); text-decoration: none; }
.tools-footer a:hover, .tools-footer a:focus-visible { text-decoration: underline; }

:where(a, button, input, select):focus-visible { outline: 3px solid rgba(240, 125, 125, .55); outline-offset: 3px; }

@media (max-width: 1040px) {
	.tools-header, .tools-main, .tools-footer { width: min(100% - 32px, 920px); }
	.tools-hero { padding-top: 48px; }
	.workspace-grid { grid-template-columns: minmax(0, 1fr) 250px; gap: 14px; }
	.preview-column { grid-template-columns: 1fr; }
	.preview-frame { min-height: 240px; }
}

@media (max-width: 800px) {
	.tools-header, .tools-main, .tools-footer { width: min(100% - 24px, 680px); }
	.tools-hero { display: block; padding: 42px 0 26px; }
	.hero-note { margin-top: 20px; }
	.tool-workbench { display: block; min-height: 0; }
	.tool-rail { padding: 16px 12px 12px; border-right: 0; border-bottom: 1px solid var(--line-dark); }
	.rail-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 6px 12px; }
	.rail-heading strong { max-width: none; font-size: 13px; }
	.tool-tabs { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 2px; }
	.tool-tab { min-width: 190px; }
	.rail-footnote { display: none; }
	.tool-stage { padding: 18px; }
	.workspace-grid { grid-template-columns: 1fr; }
	.inspector { order: -1; }
	.preview-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.preview-frame { min-height: 260px; }
}

@media (max-width: 520px) {
	.tools-header { min-height: 62px; }
	.local-badge { display: none; }
	.header-meta { gap: 10px; }
	.subaru-tap-link { padding: 7px 9px; }
	.tools-hero h1 { font-size: 46px; }
	.panel-heading { display: block; }
	.panel-output { margin-top: 14px; }
	.canvas-zone { padding: 10px; }
	.canvas-zone-head { display: block; }
	.canvas-hint { display: block; margin-top: 3px; }
	.preview-column { grid-template-columns: 1fr; }
	.preview-frame { min-height: 220px; }
	.action-row { grid-template-columns: 1fr 1.25fr; }
	.tools-footer { display: block; }
	.tools-footer a { display: inline-block; margin-top: 8px; }
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
}
