
:root {
	--green: #0E9F5B;
	--green-dark: #0B7E48;
	--green-soft: #E7F6EE;
	--green-border: #BFE8D2;
	--ink: #1A1D1F;
	--ink-2: #6B7280;
	--ink-3: #9CA3AF;
	--line: #ECEEF1;
	--bg: #F7F8F9;
	--card: #FFFFFF;
	--red-soft: #FDF0EF;
	--red: #D9544A;
	--blue-soft: #EEF4FD;
	--blue: #3B72D9;
	--radius: 14px;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
	font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
	background: var(--bg);
	color: var(--ink);
	-webkit-font-smoothing: antialiased;
	display: flex; flex-direction: column;
}
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 15px; }

/* ── Top bar ── */
.topbar {
	display: flex; align-items: center; gap: 18px;
	padding: 14px 22px;
	background: var(--card);
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo-mark {
	width: 30px; height: 30px; border-radius: 8px;
	background: var(--green); color: #fff;
	display: grid; place-items: center;
}
.logo-name { font-size: 17px; font-weight: 700; letter-spacing: -.3px; }
.topbar .divider { width: 1px; height: 24px; background: var(--line); }
.proj-summary { line-height: 1.25; min-width: 0; }
.proj-summary .name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.proj-summary .meta { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.saved { margin-left: auto; font-size: 12px; color: var(--ink-3); display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.saved .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); }
.btn-reset { font-size: 12.5px; color: var(--ink-3); background: none; border: 1px solid var(--line); border-radius: 9px; padding: 8px 13px; min-height: 36px; }
.btn-reset:active { background: var(--bg); }

/* ── Steps ── */
.steps {
	display: flex; gap: 4px;
	padding: 10px 22px;
	background: var(--card);
	border-bottom: 1px solid var(--line);
	flex-shrink: 0;
	overflow-x: auto;
}
.step {
	font-size: 13px; color: var(--ink-2);
	padding: 9px 15px; border-radius: 99px; min-height: 38px;
	display: flex; align-items: center; gap: 7px;
	background: none; border: none; white-space: nowrap;
}
.step .n {
	width: 18px; height: 18px; border-radius: 50%;
	font-size: 10.5px; font-weight: 600;
	display: grid; place-items: center;
	background: var(--line); color: var(--ink-2);
}
.step.done .n { background: var(--green-soft); color: var(--green); }
.step.active { background: var(--green); color: #fff; font-weight: 600; }
.step.active .n { background: rgba(255,255,255,.25); color: #fff; }

/* ── Main ── */
.main { flex: 1; overflow: auto; }
.view { display: none; height: 100%; }
.view.active { display: block; }

/* ── Project view ── */
.project-form {
	max-width: 520px; margin: 40px auto; padding: 0 22px;
}
.project-form h2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; margin-bottom: 6px; }
.project-form .sub { font-size: 14px; color: var(--ink-2); margin-bottom: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.field input, .field select {
	width: 100%; padding: 12px 14px;
	border: 1px solid var(--line); border-radius: 11px;
	background: var(--card); color: var(--ink);
	outline: none;
}
.field input:focus, .field select:focus { border-color: var(--green); }
.field-static {
	width: 100%; padding: 12px 14px; box-sizing: border-box;
	border: 1px solid var(--line); border-radius: 11px;
	background: var(--bg); color: var(--ink);
}
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }

.btn {
	border: none; border-radius: 12px;
	padding: 13px 22px;
	font-size: 14.5px; font-weight: 600;
}
.btn-primary { background: var(--green); color: #fff; }
.btn-primary:active { background: var(--green-dark); }
.btn-ghost { background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 10px; }
.btn-danger-ghost { background: none; border: none; color: var(--red); font-size: 12.5px; font-weight: 600; }

/* ── Areas view ── */
.areas-layout { display: grid; grid-template-columns: 1fr 330px; height: 100%; }
@media (max-width: 900px) {
	.areas-layout { grid-template-columns: 1fr; height: auto; }
	.canvas-col { height: auto; }
	.canvas-wrap { height: 460px; }
	.panel { border-left: none !important; border-top: 1px solid var(--line); overflow-y: visible; height: auto; }
}
.canvas-col { padding: 18px 22px; display: flex; flex-direction: column; min-width: 0; }
/* ── Feature palette (tap to place) ── */
.palette { margin-bottom: 12px; display: flex; flex-direction: column; gap: 7px; }
.palette-row { display: flex; gap: 7px; overflow-x: auto; padding-bottom: 2px; }
.pal-cat {
	font-size: 13px; font-weight: 600; color: var(--ink-2);
	background: var(--bg); border: 1px solid transparent; border-radius: 9px;
	padding: 9px 14px; min-height: 38px; white-space: nowrap; flex-shrink: 0;
}
.pal-cat.sel { background: var(--ink); color: #fff; }
.pal-chip {
	display: flex; align-items: center; gap: 7px;
	font-size: 12.5px; font-weight: 600; color: var(--ink-2);
	background: #fff; border: 1px solid var(--line); border-radius: 99px;
	padding: 9px 13px; min-height: 38px; white-space: nowrap; flex-shrink: 0;
}
.pal-chip .code {
	font-size: 9px; font-weight: 700;
	border: 1.5px solid; border-radius: 50%;
	width: 18px; height: 18px;
	display: grid; place-items: center;
}
.pal-chip.sel { background: var(--green-soft); border-color: var(--green); color: var(--green-dark); }

.canvas-wrap {
	flex: 1; min-height: 320px;
	background: #FBFCFC;
	border: 1px solid var(--line);
	border-radius: var(--radius);
	position: relative; overflow: hidden; touch-action: none;
}
.canvas-wrap svg { display: block; width: 100%; height: 100%; touch-action: none; }
.canvas-hint {
	position: absolute; bottom: 12px; left: 50%; transform: translateX(-50%);
	font-size: 12px; color: var(--ink-3);
	background: rgba(255,255,255,.9); border: 1px solid var(--line);
	padding: 5px 12px; border-radius: 99px;
	pointer-events: none; white-space: nowrap;
}
.cvb {
	width: 42px; height: 40px; border: none; background: #fff; color: #5B6573;
	font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center;
	transition: background .12s;
}
.cvb:hover { background: #F2F4F6; }
.cvb:active { background: #E8EBEE; }
.cvsep { height: 1px; background: var(--line); margin: 0 7px; }
.canvas-empty {
	position: absolute; inset: 0;
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
	color: var(--ink-3); font-size: 14px;
}

.area-tabs { display: flex; gap: 10px; margin-top: 14px; overflow-x: auto; padding-bottom: 2px; }
.area-tab {
	border: 1px solid var(--line); border-radius: 12px;
	padding: 10px 16px; background: var(--card);
	line-height: 1.25; text-align: left;
	flex-shrink: 0; min-width: 110px;
}
.area-tab .t { font-size: 13px; font-weight: 600; }
.area-tab .s { font-size: 11.5px; color: var(--ink-3); }
.area-tab.active { border-color: var(--green); background: var(--green-soft); }
.area-tab.active .s { color: var(--green); }
.area-tab.add { border-style: dashed; color: var(--ink-2); font-size: 13px; display: grid; place-items: center; min-width: 120px; }

/* ── Right panel ── */
.panel {
	padding: 20px; background: var(--card);
	border-left: 1px solid var(--line);
	display: flex; flex-direction: column; gap: 16px;
	overflow-y: auto;
}
.panel h2 { font-size: 16.5px; font-weight: 700; letter-spacing: -.2px; }
.panel .sub { font-size: 12px; color: var(--ink-2); margin-top: 2px; }
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }

.stat-row { display: flex; gap: 8px; }
.stat { flex: 1; background: var(--bg); border-radius: 11px; padding: 10px 12px; line-height: 1.3; }
.stat .v { font-size: 16px; font-weight: 700; }
.stat .l { font-size: 11px; color: var(--ink-2); }

.section-title {
	font-size: 11px; font-weight: 700; letter-spacing: .07em;
	text-transform: uppercase; color: var(--ink-3);
	display: flex; justify-content: space-between; align-items: center;
	margin-bottom: 8px;
}
.link-btn { font-size: 12.5px; color: var(--green); background: none; border: none; font-weight: 600; }
/* collapsible secondary sections — keep the panel clean by default */
.fold { border-top: 1px solid var(--line); }
.fold > summary {
	list-style: none; cursor: pointer; user-select: none;
	display: flex; align-items: center; gap: 7px;
	font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
	color: var(--ink-3); padding: 13px 2px; min-height: 22px;
}
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary::after {
	content: "›"; margin-left: auto; font-size: 17px; font-weight: 600;
	color: var(--ink-3); transform: rotate(90deg); transition: transform .15s ease;
}
.fold[open] > summary::after { transform: rotate(-90deg); }
.fold .fold-body { padding-bottom: 12px; }
.fold-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--green); display: inline-block; }

.feature-row {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 0; border-bottom: 1px solid var(--line);
	font-size: 13px; gap: 8px;
}
.feature-row:last-child { border-bottom: none; }
.feature-row .q { color: var(--ink-2); font-size: 12.5px; white-space: nowrap; }
.feature-row .x { color: var(--ink-3); background: none; border: none; font-size: 17px; padding: 6px 10px; }

.measure-row {
	display: flex; flex-direction: column; gap: 4px;
	background: var(--bg); border-radius: 10px;
	padding: 10px 12px; font-size: 12.5px;
	margin-bottom: 7px;
}
.measure-row .top { display: flex; align-items: center; gap: 8px; }
.measure-row .badge {
	width: 20px; height: 20px; border-radius: 50%;
	background: var(--green); color: #fff;
	font-size: 10.5px; font-weight: 700;
	display: grid; place-items: center; flex-shrink: 0;
}
.measure-row .nm { color: var(--ink); font-weight: 600; flex: 1; min-width: 0; line-height: 1.3; }
.measure-row .sub { display: flex; justify-content: space-between; align-items: baseline; padding-left: 28px; }
.measure-row .qty { color: var(--ink-2); white-space: nowrap; }
.measure-row .pr { font-weight: 700; color: var(--ink); white-space: nowrap; }

.total-line {
	display: flex; justify-content: space-between; align-items: baseline;
	padding-top: 12px; border-top: 1px solid var(--line);
}
.total-line .l { font-size: 12.5px; color: var(--ink-2); }
.total-line .v { font-size: 19px; font-weight: 700; letter-spacing: -.3px; }

/* ── Measures view ── */
.measures-page, .scope-page { max-width: 760px; margin: 0 auto; padding: 28px 22px 60px; }
.page-head { margin-bottom: 22px; }
.page-head h2 { font-size: 22px; font-weight: 700; letter-spacing: -.4px; }
.page-head .sub { font-size: 14px; color: var(--ink-2); margin-top: 4px; }

.m-group { margin-bottom: 26px; }
.m-group-title { font-size: 13px; font-weight: 700; color: var(--ink-2); margin-bottom: 10px; display: flex; gap: 8px; align-items: center; }
.m-group-title .pill { font-size: 11px; font-weight: 600; color: var(--green); background: var(--green-soft); padding: 2px 9px; border-radius: 99px; }

.m-card {
	display: flex; align-items: center; gap: 14px;
	background: var(--card); border: 1px solid var(--line);
	border-radius: 13px; padding: 13px 16px; margin-bottom: 9px;
}
.m-card.off { opacity: .45; }
.m-card .info { flex: 1; min-width: 0; line-height: 1.3; }
.m-card .info .nm { font-size: 14px; font-weight: 600; }
.m-card .info .src { font-size: 11.5px; color: var(--ink-3); }
.m-card input.qty-input {
	width: 76px; padding: 8px 10px; text-align: right;
	border: 1px solid var(--line); border-radius: 9px;
	font-size: 14px; font-weight: 600; outline: none;
}
.m-card input.qty-input:focus { border-color: var(--green); }
.m-card .unit { font-size: 12px; color: var(--ink-2); width: 34px; }
.m-card .price { font-size: 14px; font-weight: 700; width: 86px; text-align: right; }
.m-card .toggle {
	width: 42px; height: 25px; border-radius: 99px;
	background: var(--line); border: none; position: relative;
	transition: background .15s; flex-shrink: 0;
}
.m-card .toggle::after {
	content: ""; position: absolute; top: 3px; left: 3px;
	width: 19px; height: 19px; border-radius: 50%;
	background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2);
	transition: left .15s;
}
.m-card .toggle.on { background: var(--green); }
.m-card .toggle.on::after { left: 20px; }

.empty-note {
	text-align: center; color: var(--ink-3); font-size: 14px;
	padding: 40px 0;
}

/* ── Compliance findings ── */
.finding {
	display: flex; gap: 9px; align-items: flex-start;
	border-radius: 10px; padding: 9px 11px;
	font-size: 12px; line-height: 1.45;
	margin-bottom: 7px;
}
.finding .ic { flex-shrink: 0; font-size: 13px; margin-top: 1px; }
.finding .ref { display: block; font-size: 10.5px; opacity: .75; margin-top: 2px; }
.finding.block { background: var(--red-soft); color: #8C2F28; border: 1px solid #F2C5C1; }
.finding.warn  { background: #FDF6E7; color: #8A6116; border: 1px solid #F0DFB6; }
.finding.suggest { background: var(--blue-soft); color: #2A5290; border: 1px solid #C9DAF5; }
.finding.ok    { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green-border); }
.finding .fix-btn {
	margin-top: 5px; font-size: 11.5px; font-weight: 700;
	background: #fff; border: 1px solid currentColor; color: inherit;
	border-radius: 8px; padding: 4px 10px;
}
.blocked-banner {
	background: var(--red-soft); border: 1px solid #F2C5C1;
	border-radius: 13px; padding: 14px 16px;
	font-size: 13px; color: #8C2F28; line-height: 1.5;
	margin-bottom: 18px;
}
.blocked-banner b { display: block; margin-bottom: 3px; }
.scope-note {
	background: var(--bg); border-radius: 10px;
	padding: 11px 14px; font-size: 12px; color: var(--ink-2);
	margin-top: 14px; line-height: 1.5;
}

/* ── Scope view ── */
.scope-doc {
	background: var(--card); border: 1px solid var(--line);
	border-radius: 16px; padding: 32px;
}
.scope-doc .doc-head { display: flex; justify-content: space-between; gap: 20px; margin-bottom: 24px; padding-bottom: 18px; border-bottom: 1px solid var(--line); }
.scope-doc .doc-head h3 { font-size: 18px; font-weight: 700; }
.scope-doc .doc-head .meta { font-size: 12.5px; color: var(--ink-2); line-height: 1.5; margin-top: 4px; }
.scope-doc .doc-head .right { text-align: right; font-size: 12.5px; color: var(--ink-2); line-height: 1.5; }
.scope-item {
	display: flex; align-items: baseline; gap: 12px;
	padding: 10px 0; border-bottom: 1px dashed var(--line);
	font-size: 14.5px;
}
.scope-item:last-of-type { border-bottom: none; }
.scope-item .letter { font-weight: 700; color: var(--green); width: 20px; flex-shrink: 0; }
.scope-item .desc { flex: 1; }
.scope-item .desc .loc { color: var(--ink-3); font-size: 12px; margin-left: 6px; }
.scope-item .amt { font-weight: 600; white-space: nowrap; }
.scope-total {
	display: flex; justify-content: space-between; align-items: baseline;
	margin-top: 18px; padding-top: 16px; border-top: 2px solid var(--ink);
}
.scope-total .l { font-size: 14px; font-weight: 700; }
.scope-total .v { font-size: 24px; font-weight: 700; letter-spacing: -.5px; }
.scope-actions { 
	display: grid;
	grid-template-columns: repeat(4, 1fr); 
	/* justify-content: center;
	justify-items: center; */
	gap: 12px;
	margin-top: 20px; 

}
.scope-actions .btn { flex: 1; max-width: 170px; }
.scope-actions .btn:nth-child(5){
	grid-column: 2 / 3;
}

/* ── Modal ── */
.modal-back {
	position: fixed; inset: 0; background: rgba(20,24,28,.45);
	display: none; align-items: flex-end; justify-content: center;
	z-index: 50; padding: 0;
}
@media (min-width: 700px) { .modal-back { align-items: center; padding: 24px; } }
.modal-back.open { display: flex; }
.modal {
	background: var(--card); border-radius: 20px 20px 0 0;
	width: 100%; max-width: 560px; max-height: 88vh;
	overflow-y: auto; padding: 26px 24px 30px;
}
@media (min-width: 700px) { .modal { border-radius: 20px; } }
.modal h3 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; margin-bottom: 4px; }
.modal .sub { font-size: 13px; color: var(--ink-2); margin-bottom: 20px; }
.chip-grid { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 20px; }
.chip {
	font-size: 13.5px; font-weight: 600;
	border: 1px solid var(--line); border-radius: 99px;
	background: var(--card); padding: 10px 17px;
	color: var(--ink-2);
}
.chip.sel { background: var(--green-soft); border-color: var(--green); color: var(--green); }
.modal .section-label { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--ink-3); margin: 4px 0 10px; }
.dim-preview {
	background: var(--green-soft); border: 1px solid var(--green-border);
	border-radius: 11px; padding: 12px 16px;
	font-size: 14px; font-weight: 600; color: var(--green-dark);
	margin-bottom: 20px; text-align: center;
}
.modal-actions { display: flex; gap: 10px; margin-top: 4px; }
.modal-actions .btn { flex: 1; }

/* ── Print (two-page package) ── */
#print-doc { display: none; }
.print-page { padding: 28px 34px; }
.print-head {
	display: flex; justify-content: space-between; align-items: flex-start;
	padding-bottom: 14px; border-bottom: 2px solid var(--ink); margin-bottom: 20px;
}
.print-head .brand { display: flex; align-items: center; gap: 9px; font-size: 19px; font-weight: 700; }
.print-head .brand .mark { width: 28px; height: 28px; border-radius: 7px; background: var(--green); color: #fff; display: grid; place-items: center; }
.print-head .meta { text-align: right; font-size: 12px; color: var(--ink-2); line-height: 1.5; }
.print-title { font-size: 15px; font-weight: 700; margin-bottom: 12px; }
.print-areas-table { width: 100%; border-collapse: collapse; margin-top: 16px; font-size: 12px; }
.print-areas-table th { text-align: left; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; color: var(--ink-3); padding: 6px 8px; border-bottom: 1px solid var(--ink); }
.print-areas-table td { padding: 7px 8px; border-bottom: 1px solid var(--line); }
.print-page .scope-doc .doc-head { display: none; }   /* avoid duplicating the page header */
@media print {
	@page { size: A4; margin: 0; }   /* margin:0 makes Chrome drop its date/title/URL/page-number header & footer */
	body > *:not(#print-doc) { display: none !important; }
	#print-doc { display: block !important; }
	.print-page { page-break-after: always; padding: 14mm 13mm; }
	.print-page:last-child { page-break-after: auto; }
	.print-hide { display: none !important; }
}

/* ═══════════════ Design polish — Apple-like calibration (visual layer only) ═══════════════
	Pure CSS overrides appended after the base styles. No logic, markup or class changes. */
:root {
	--bg: #F5F5F7;            /* Apple system gray background */
	--line: #E8E8ED;
	--ink: #1D1D1F;
	--ink-2: #6E6E73;
	--ink-3: #98989D;
	--green-soft: #E9F7F0;
	--shadow-sm: 0 1px 2px rgba(16,24,40,.05), 0 1px 3px rgba(16,24,40,.06);
	--shadow-md: 0 2px 6px rgba(16,24,40,.07), 0 12px 28px rgba(16,24,40,.10);
	--focus-ring: 0 0 0 4px rgba(14,159,91,.16);
}
body { letter-spacing: -0.01em; }
button { transition: background-color .18s ease, color .18s ease, box-shadow .18s ease, transform .12s ease, border-color .18s ease, filter .18s ease; }
button:active { transform: scale(.97); }
button:focus-visible { outline: none; box-shadow: var(--focus-ring); }
input, select, textarea { transition: border-color .18s ease, box-shadow .18s ease; }
input:focus, select:focus, textarea:focus { border-color: var(--green); box-shadow: var(--focus-ring); outline: none; }

/* top bar — frosted glass */
.topbar {
	background: rgba(255,255,255,.82);
	backdrop-filter: saturate(180%) blur(18px); -webkit-backdrop-filter: saturate(180%) blur(18px);
	border-bottom: 1px solid rgba(0,0,0,.06);
	padding-top: 15px; padding-bottom: 15px;
}
.logo-mark { border-radius: 9px; box-shadow: 0 2px 6px rgba(14,159,91,.35); }
.btn-reset { border-radius: 99px; min-height: 38px; }
.btn-reset:hover { background: rgba(0,0,0,.045); }

/* steps — segmented-control feel */
.steps { gap: 6px; }
.step { font-weight: 500; }
.step:hover { background: rgba(0,0,0,.045); }
.step.active { background: var(--ink); color: #fff; font-weight: 600; box-shadow: var(--shadow-sm); }
.step.active .n { background: rgba(255,255,255,.25); color: #fff; }
.step.done { color: var(--green-dark); }

/* buttons */
.btn { border-radius: 13px; letter-spacing: -0.01em; }
.btn-primary { background: linear-gradient(180deg, #12AC65 0%, var(--green) 100%); box-shadow: 0 1px 2px rgba(14,159,91,.35), 0 4px 14px rgba(14,159,91,.22); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { background: var(--green-dark); filter: none; }
.btn-ghost:hover { background: var(--bg); }
.link-btn { border-radius: 8px; padding: 3px 7px; }
.link-btn:hover { background: var(--green-soft); }

/* cards, tabs & panels */
.area-tab { border-radius: 13px; box-shadow: var(--shadow-sm); }
.area-tab:hover { box-shadow: var(--shadow-md); transform: translateY(-1px); }
.area-tab.active { box-shadow: 0 0 0 1.5px var(--green), var(--shadow-sm); }
.m-card { border-color: rgba(0,0,0,.05); box-shadow: var(--shadow-sm); }
.m-card:hover { box-shadow: var(--shadow-md); }
.scope-doc { border: none; border-radius: 18px; box-shadow: var(--shadow-md); }
.stat { border-radius: 12px; }
.panel { border-left-color: rgba(0,0,0,.05); }
.section-title { color: #86868B; }

/* inputs — comfortable 44pt targets */
.field input, .field select { min-height: 44px; border-radius: 12px; }

/* modals — iOS sheet with spring + blurred backdrop */
.modal-back { background: rgba(17,20,24,.40); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.modal { border-radius: 22px 22px 0 0; box-shadow: 0 -8px 40px rgba(0,0,0,.18); }
@media (min-width: 700px) { .modal { border-radius: 22px; box-shadow: 0 24px 64px rgba(0,0,0,.22); } }
.modal-back.open .modal { animation: sheetIn .38s cubic-bezier(.32,.72,0,1) both; }
@keyframes sheetIn { from { transform: translateY(28px); opacity: .55; } to { transform: translateY(0); opacity: 1; } }

/* chips */
.chip:hover, .pal-chip:hover { border-color: var(--green); color: var(--green-dark); }
.chip.sel { box-shadow: inset 0 0 0 1px var(--green); }

/* iOS-style switch */
.m-card .toggle { width: 46px; height: 28px; background: #E9E9EB; }
.m-card .toggle::after { width: 24px; height: 24px; top: 2px; left: 2px; box-shadow: 0 1px 3px rgba(0,0,0,.22), 0 3px 8px rgba(0,0,0,.12); transition: left .22s cubic-bezier(.32,.72,0,1); }
.m-card .toggle.on { background: var(--green); }
.m-card .toggle.on::after { left: 20px; }

/* canvas — frosted floating controls */
.canvas-wrap { border-radius: 16px; }
#zoom-ctl > div, #mode-toggle, #btn-arrange-canvas, #btn-merge, #btn-corners, #canvas-legend, #feat-editor {
	background: rgba(255,255,255,.88) !important;
	backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
	box-shadow: 0 2px 12px rgba(16,24,40,.12) !important;
	border-color: rgba(0,0,0,.06) !important;
}
.canvas-hint { background: rgba(255,255,255,.82); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); box-shadow: var(--shadow-sm); border-color: rgba(0,0,0,.05); }
.cvb:hover { background: rgba(0,0,0,.05); }

/* numeric alignment everywhere money/qty appears */
.stat .v, .m-card .price, .m-card input.qty-input, .measure-row .pr, .measure-row .qty,
.scope-item .amt, .total-line .v, .scope-total .v { font-variant-numeric: tabular-nums; }

/* view transitions */
.view.active { animation: viewIn .28s ease both; }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* saved indicator — gentle pulse */
.saved .dot { animation: savedPulse 2.6s ease-out infinite; }
@keyframes savedPulse { 0% { box-shadow: 0 0 0 0 rgba(14,159,91,.35); } 70% { box-shadow: 0 0 0 6px rgba(14,159,91,0); } 100% { box-shadow: 0 0 0 0 rgba(14,159,91,0); } }

/* subtle scrollbars */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(0,0,0,.16); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: rgba(0,0,0,.28); }
::-webkit-scrollbar-track { background: transparent; }

/* iPad / touch: bigger targets */
@media (pointer: coarse) {
	.link-btn { padding: 8px 10px; }
	.feature-row .x { min-width: 44px; min-height: 40px; }
	.cvb { width: 46px; height: 44px; }
	.btn { min-height: 48px; }
}

/* accessibility: respect reduced motion */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}
