/* Creativewity — generator tool styles (brand yellow / graphite) */

.app-shell { display: flex; flex-direction: column; gap: 20px; }

.gpanel {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow-sm); padding: 22px 24px 26px;
}
.gpanel h2 {
	font-family: var(--font-display); font-size: 19px; font-weight: 600;
	margin: 0 0 18px; display: flex; align-items: center; gap: 10px; color: var(--ink);
}
.gstep {
	display: inline-flex; align-items: center; justify-content: center;
	width: 28px; height: 28px; border-radius: 8px;
	background: var(--signal); color: var(--ink); font-size: 14px; font-weight: 700;
	font-family: var(--font-display);
}

.gfield { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--muted); }
.gfield.slim { max-width: 110px; }
.gfield input, .gfield select {
	font: 14px var(--font-body); padding: 9px 11px; border: 1px solid var(--line);
	border-radius: 8px; background: #fff; color: var(--ink);
}
.grow { display: flex; flex-wrap: wrap; gap: 14px; align-items: flex-end; }
.ggrid-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 14px; }
.ghint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; }

.gswitch { display: inline-flex; align-items: center; gap: 7px; font-size: 13.5px; cursor: pointer; padding-bottom: 8px; }
.gswitch input { accent-color: var(--signal-deep); width: 16px; height: 16px; }

.paper-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.paper-tab {
	font: 600 14px var(--font-body); padding: 10px 20px; border-radius: 999px;
	border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
}
.paper-tab.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.paper-pane.is-hidden { display: none; }
.paper-pane .gfield { max-width: 420px; }

.design-layout { display: grid; grid-template-columns: 1.2fr 1fr; gap: 26px; }
.design-block { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px 14px; margin: 0 0 14px; }
.design-block legend { font-family: var(--font-display); font-size: 13px; font-weight: 600; color: var(--ink); padding: 0 6px; }

.design-preview { display: flex; flex-direction: column; }
.preview-caption { font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--muted); margin: 0 0 8px; }
.preview-stage {
	flex: 1; min-height: 260px; display: flex; align-items: center; justify-content: center;
	border-radius: 12px; padding: 26px;
	background:
		radial-gradient(circle, rgba(247,206,8,0.35) 1px, transparent 1.5px) 0 0 / 18px 18px,
		linear-gradient(var(--ink), #222);
}
.preview-meta { font-family: var(--font-mono); font-size: 12px; color: var(--muted); margin: 10px 0 0; }

.label-cell {
	background: #fff; border-radius: 4px; display: flex; flex-direction: column;
	align-items: center; justify-content: center; overflow: hidden; padding: 4px 6px;
	text-align: center; color: #000;
}
#previewCell { box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.label-title { font-family: var(--font-body); width: 100%; overflow: hidden; line-height: 1.25; display: -webkit-box; -webkit-box-orient: vertical; }
.label-code { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 0; }
.label-code svg, .label-code img { max-width: 100%; max-height: 100%; height: 100%; }
.label-value, .label-extra { font-family: var(--font-mono); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.3; }
.label-error { font-size: 10px; color: var(--danger); font-family: var(--font-body); }

.data-toolbar { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dropzone {
	display: flex; flex-direction: column; align-items: center; gap: 4px;
	border: 2px dashed var(--line); border-radius: var(--radius); background: var(--mist);
	padding: 26px 16px; text-align: center; cursor: pointer; color: var(--muted);
	transition: border-color .15s, background .15s;
}
.dropzone strong { color: var(--ink); font-size: 14.5px; }
.dropzone span { font-size: 12.5px; font-family: var(--font-mono); }
.dropzone.is-drag { border-color: var(--signal-deep); background: #fdf7dd; }

.bulk-box { margin-top: 14px; border: 1px solid var(--line); border-left: 3px solid var(--signal); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.bulk-box.is-hidden { display: none; }
.bulk-box .btn { align-self: flex-start; }

.table-wrap { margin-top: 16px; overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; }
.data-table { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 640px; }
.data-table th { font-family: var(--font-display); font-size: 12px; text-align: left; background: var(--mist); color: var(--ink); padding: 9px 10px; border-bottom: 1px solid var(--line); }
.data-table td { padding: 4px 6px; border-bottom: 1px solid var(--line); }
.data-table td:first-child { color: var(--muted); font-family: var(--font-mono); font-size: 12px; padding-left: 12px; }
.data-table input { width: 100%; border: 1px solid transparent; border-radius: 6px; padding: 6px 8px; font: 13.5px var(--font-body); background: transparent; }
.data-table input.mono { font-family: var(--font-mono); }
.data-table input:focus { border-color: var(--signal-deep); background: #fff; outline: none; }
.data-table input.copies { max-width: 70px; }
.row-del { border: 0; background: none; color: var(--muted); font-size: 16px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.row-del:hover { color: var(--danger); background: #fdecea; }
.table-summary { font-size: 12.5px; color: var(--muted); margin: 8px 2px 0; font-family: var(--font-mono); }

.actions-bar {
	position: sticky; bottom: 14px; display: flex; align-items: center; justify-content: space-between;
	gap: 16px; flex-wrap: wrap; background: var(--ink); color: #d8d8d2; border-radius: var(--radius);
	padding: 12px 18px; box-shadow: 0 12px 30px rgba(43,43,43,.32);
}
.actions-meta { font-family: var(--font-mono); font-size: 12.5px; }
.actions-buttons { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.actions-bar .gswitch { color: #d8d8d2; padding-bottom: 0; }

.sheet-modal { position: fixed; inset: 0; z-index: 90; background: rgba(43,43,43,.55); display: flex; align-items: center; justify-content: center; padding: 24px; }
.sheet-modal.is-hidden { display: none; }
.sheet-modal-card { background: var(--mist); border-radius: 14px; max-width: 900px; width: 100%; max-height: 90vh; display: flex; flex-direction: column; overflow: hidden; }
.sheet-modal-head { display: flex; justify-content: space-between; align-items: center; padding: 12px 18px; background: #fff; border-bottom: 1px solid var(--line); font-family: var(--font-display); }
.modal-x { border: 1px solid var(--line); background: #fff; border-radius: 8px; width: 34px; height: 34px; font-size: 20px; cursor: pointer; line-height: 1; }
.sheet-modal-body { overflow: auto; padding: 24px; display: flex; flex-direction: column; align-items: center; gap: 24px; }

.print-page { background: #fff; box-shadow: 0 6px 20px rgba(0,0,0,.15); display: grid; overflow: hidden; }
.print-page .label-cell { border-radius: 0; }
.print-page.with-borders .label-cell { outline: 1px dashed #b9c2d8; outline-offset: -1px; }
.print-root { display: none; }

@media (max-width: 860px) {
	.design-layout { grid-template-columns: 1fr; }
	.actions-bar { position: static; }
}
@media print {
	body * { visibility: hidden; }
	.print-root, .print-root * { visibility: visible; }
	.print-root { display: block; position: absolute; left: 0; top: 0; width: 100%; }
	.print-page { box-shadow: none; margin: 0; page-break-after: always; }
	.site-header, .site-footer, .page-hero, .actions-bar { display: none; }
	@page { margin: 0; }
}

/* ==========================================================================
   QR & Barcode Studio  (tabbed: QR · Barcode · Label Sheets)
   ========================================================================== */
.studio { display: flex; flex-direction: column; gap: 22px; }
.studio .is-hidden { display: none !important; }

/* -- Top tool tabs -------------------------------------------------------- */
.studio-tabs {
	display: inline-flex; gap: 6px; padding: 6px;
	background: var(--mist); border: 1px solid var(--line); border-radius: 999px;
	align-self: flex-start; flex-wrap: wrap;
}
.studio-tab {
	display: inline-flex; align-items: center; gap: 9px;
	font: 600 14.5px var(--font-body); padding: 10px 20px; border-radius: 999px;
	border: 0; background: transparent; color: var(--muted); cursor: pointer;
	transition: background .18s var(--ease), color .18s var(--ease);
}
.studio-tab:hover { color: var(--ink); }
.studio-tab.is-active { background: var(--ink); color: #fff; box-shadow: var(--shadow-sm); }
.stab-ico { display: inline-flex; line-height: 1; opacity: .75; }
.studio-tab.is-active .stab-ico { opacity: 1; color: var(--signal); }
.stab-ico .ico { width: 16px; height: 16px; display: block; }

/* -- Two-column layout: controls + sticky output -------------------------- */
.studio-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 22px; align-items: start; }
.studio-controls { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.studio-output { position: sticky; top: 92px; }

.gpanel-title {
	font-family: var(--font-display); font-size: 16px; font-weight: 600; color: var(--ink);
	margin: 0 0 16px; display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.link-reset {
	font: 500 12.5px var(--font-body); color: var(--muted); background: none; border: 0;
	cursor: pointer; text-decoration: underline; text-underline-offset: 2px; padding: 0;
}
.link-reset:hover { color: var(--ink); }

/* -- Segmented controls (content types + dot styles) ---------------------- */
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn {
	font: 600 13px var(--font-body); padding: 8px 14px; border-radius: 8px;
	border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
	transition: all .15s var(--ease);
}
.seg-btn:hover { border-color: var(--ink); color: var(--ink); }
.seg-btn.is-active { background: var(--signal); border-color: var(--signal-deep); color: var(--ink); }
.qr-type { margin-bottom: 16px; }
.dot-style { margin-top: 4px; }

.qr-forms { margin-top: 4px; }
.qr-form { display: flex; flex-direction: column; gap: 14px; }

/* -- Fields --------------------------------------------------------------- */
.ggrid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; margin-bottom: 4px; }
.gfield textarea {
	font: 14px var(--font-body); padding: 9px 11px; border: 1px solid var(--line);
	border-radius: 8px; background: #fff; color: var(--ink); resize: vertical; min-height: 74px;
}
.gfield + .gfield { margin-top: 12px; }
.gswitch.tight { padding-bottom: 0; margin-top: 8px; }

/* colour picker + hex pair */
.color-field { display: flex; align-items: center; gap: 8px; }
.color-field input[type="color"] {
	width: 40px; height: 38px; padding: 2px; border: 1px solid var(--line);
	border-radius: 8px; background: #fff; cursor: pointer;
}
.color-field input[type="text"] { flex: 1; text-transform: uppercase; }
.gfield .mono { font-family: var(--font-mono); }

input[type="range"] { accent-color: var(--signal-deep); width: 100%; }

.logo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 6px 0 4px; }
.logo-name { font: 12.5px var(--font-mono); color: var(--muted); word-break: break-all; }

/* -- Output card ---------------------------------------------------------- */
.output-card {
	background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
	box-shadow: var(--shadow-sm); padding: 22px;
}
.code-stage {
	display: flex; align-items: center; justify-content: center;
	min-height: 300px; border-radius: 12px; padding: 26px; margin-bottom: 14px;
	background:
		radial-gradient(circle, rgba(247,206,8,0.30) 1px, transparent 1.5px) 0 0 / 18px 18px,
		linear-gradient(var(--ink), #222);
}
.code-stage.light {
	background:
		linear-gradient(45deg, #f0efeb 25%, transparent 25%) -8px 0 / 16px 16px,
		linear-gradient(-45deg, #f0efeb 25%, transparent 25%) -8px 0 / 16px 16px,
		linear-gradient(45deg, transparent 75%, #f0efeb 75%) / 16px 16px,
		linear-gradient(-45deg, transparent 75%, #f0efeb 75%) / 16px 16px,
		#fff;
}
#qrCanvas { width: 260px; height: 260px; max-width: 100%; border-radius: 6px; image-rendering: pixelated; }
.code-stage.light #bcSvg { max-width: 100%; height: auto; }
.code-note { font: 12px var(--font-mono); color: var(--muted); margin: 0 0 16px; text-align: center; min-height: 16px; }

.dl-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 10px; }
.dl-row .gfield.slim { max-width: 96px; }

.bc-validate { font: 12.5px var(--font-mono); margin: 12px 0 0; min-height: 16px; }
.bc-validate.is-ok  { color: #1c8a4d; }
.bc-validate.is-bad { color: var(--danger); }

/* -- Responsive ----------------------------------------------------------- */
@media (max-width: 860px) {
	.studio-grid { grid-template-columns: 1fr; }
	.studio-output { position: static; }
	.studio-tabs { align-self: stretch; justify-content: center; }
}

/* -- Studio v1.2: presets, scan check, extra controls --------------------- */
.preset-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 2px; }
.preset-chip {
	display: inline-flex; align-items: center; gap: 8px;
	font: 600 12.5px var(--font-body); padding: 7px 12px 7px 8px; border-radius: 999px;
	border: 1px solid var(--line); background: #fff; color: var(--muted); cursor: pointer;
	transition: all .15s var(--ease);
}
.preset-chip:hover { border-color: var(--ink); color: var(--ink); transform: translateY(-1px); }
.preset-chip span {
	width: 18px; height: 18px; border-radius: 50%;
	border: 1px solid rgba(0,0,0,.12); display: inline-block;
}

.scan-check { font: 12.5px var(--font-mono); margin: 0 0 6px; text-align: center; min-height: 16px; }
.scan-check.is-ok   { color: #1c8a4d; }
.scan-check.is-warn { color: #b45309; }
.scan-check.is-bad  { color: var(--danger); }

#qrGradRow { margin-top: 10px; }
#qrEyeColorRow { margin-top: 8px; max-width: 220px; }
#qrFrameTextRow { margin-top: 2px; }

.dl-row .gfield.slim select { min-width: 76px; }

optgroup { font-style: normal; font-weight: 700; }
