/* Noble Pixel developer & design tools (.dv-*). Mobile first; uses the theme's colour variables with fallbacks. */
.dv { --dv-line: var(--line, #e2e8f0); --dv-surface: var(--surface, #f5f8fc); --dv-ink: var(--ink, #17222f); --dv-muted: var(--muted, #66768a); --dv-blue: var(--blue, #1f7cec); --dv-r: var(--radius, 14px); }
.dv [hidden] { display: none !important; }
.dv input[type="number"] { width: 100%; font: inherit; color: var(--dv-ink); background: #fff; border: 1.5px solid var(--dv-line); border-radius: 12px; padding: 10px 12px; min-height: 44px; }
.dv input[type="number"]:focus { outline: none; border-color: var(--dv-blue); box-shadow: 0 0 0 4px rgba(31,124,236,.14); }
.dv input[type="range"] { accent-color: var(--dv-blue); width: 100%; min-width: 0; }
.dv input[type="checkbox"], .dv input[type="radio"] { accent-color: var(--dv-blue); width: 18px; height: 18px; flex: 0 0 auto; margin: 0; }
.dv input[type="color"] { width: 100%; height: 44px; min-width: 52px; border: 1.5px solid var(--dv-line); border-radius: 12px; padding: 3px; background: #fff; cursor: pointer; }
.dv .tool-label small { font-weight: 500; color: var(--dv-muted); }
.dv .btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; }
.dv .btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.dv code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88em; background: var(--dv-surface); padding: 1px 5px; border-radius: 5px; word-break: break-word; }
.dv kbd { font: 600 .85em ui-monospace, Menlo, Consolas, monospace; border: 1px solid var(--dv-line); border-bottom-width: 2px; border-radius: 6px; padding: 1px 6px; background: #fff; }
.dv-sm { padding: 8px 14px !important; font-size: .88rem !important; min-height: 38px; }
.dv-mt { margin-top: 16px; }
.dv-center { text-align: center; }
.dv-center-row { justify-content: center; }
.dv-drop { padding: 28px 18px; }
.dv-msg { margin-top: 12px; }
.dv-work { margin-top: 18px; }
.dv-privacy { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 16px 0 0; color: var(--dv-muted); font-size: .86rem; text-align: center; }
.dv-privacy svg { color: #12a150; flex: 0 0 auto; }
.dv-foot { margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--dv-line); display: flex; justify-content: flex-end; }
.dv-out { min-height: 120px; }
.dv textarea.tool-code { white-space: pre; overflow-wrap: normal; overflow-x: auto; tab-size: 4; }

/* form bits */
.dv-range { display: grid; grid-template-columns: 96px 1fr 56px; align-items: center; gap: 10px; margin: 10px 0 0; font-weight: 600; font-size: .92rem; color: var(--dv-ink); }
.dv-range output { text-align: right; font-variant-numeric: tabular-nums; color: var(--dv-muted); }
.dv-check { display: flex; align-items: center; gap: 10px; margin: 12px 0 0; font-size: .95rem; cursor: pointer; line-height: 1.35; }
.dv-check small { color: var(--dv-muted); font-weight: 500; }
.dv-check--inline { margin: 0; }
.dv-opts { display: grid; grid-template-columns: 1fr; gap: 0 18px; margin-top: 4px; }
.dv-pair { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; align-items: flex-end; }
.dv-pair > label { flex: 1 1 140px; min-width: 0; display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: .9rem; color: var(--dv-ink); }
.dv-pair > label.dv-check { flex-direction: row; align-items: center; }
.dv-pair--colors > label { flex: 1 1 100px; }
.dv-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 20px; margin-bottom: 12px; font-size: .94rem; }
.dv-bar label { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.dv-bar select { width: auto; padding: 8px 10px; }
.dv-file { position: relative; overflow: hidden; }
.dv-file input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; font-size: 0; }
.dv-file:focus-within { outline: 3px solid var(--dv-blue); outline-offset: 2px; }
.dv-box { border: 1px solid var(--dv-line); border-radius: var(--dv-r); padding: 12px 14px 14px; margin: 20px 0 0; background: var(--dv-surface); min-width: 0; }
.dv-box legend { font-weight: 800; color: var(--dv-ink); padding: 0 6px; }
.dv-box--plain { margin-top: 12px; background: #fff; }
.dv-warn { margin: 16px 0 0; padding: 12px 14px; border-radius: 12px; background: #fff8e6; border: 1px solid #ffe3a3; color: #5c4400; font-size: .92rem; line-height: 1.55; }
.dv-warn ul { margin: 6px 0 0; padding-left: 20px; }
.dv-warn li { margin-bottom: 4px; }
.dv-warn code { background: rgba(255,255,255,.7); }
.dv-errs { padding: 12px 14px; border-radius: 12px; background: #fff3f0; border: 1px solid #ffd2c7; color: #9a2b14; font-size: .92rem; margin-bottom: 10px; }
.dv-errs ul { margin: 6px 0 0; padding-left: 20px; }
.dv-more { margin-top: 16px; border: 1px solid var(--dv-line); border-radius: 12px; padding: 0 14px; background: #fff; }
.dv-more summary { cursor: pointer; font-weight: 700; color: var(--dv-ink); padding: 12px 0; }
.dv-more[open] { padding-bottom: 12px; }
.dv-steps { margin: 0; padding-left: 20px; font-size: .93rem; line-height: 1.6; }
.dv-steps li { margin-bottom: 8px; }
.dv-bad { border-color: #e2462b !important; }

/* chips and buttons made by JS */
.dv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.dv-chip { font: inherit; font-weight: 600; font-size: .9rem; border: 1.5px solid var(--dv-line); background: #fff; color: var(--dv-ink); padding: 8px 14px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.dv-chip:hover { border-color: var(--dv-blue); }
.dv-chip.is-on { background: var(--navy, #243547); border-color: var(--navy, #243547); color: #fff; }
.dv-chipc { display: inline-flex; align-items: center; gap: 8px; font: 600 .88rem ui-monospace, Menlo, Consolas, monospace; border: 1.5px solid var(--dv-line); background: #fff; color: var(--dv-ink); padding: 6px 12px 6px 6px; border-radius: 999px; cursor: pointer; min-height: 40px; }
.dv-chipc i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(17,28,41,.15); flex: 0 0 auto; }
.dv-chipc small { color: var(--dv-muted); font-weight: 500; }
.dv-chipc.is-copied { border-color: #12a150; }
.dv-checker { background-color: #fff; background-image: repeating-conic-gradient(#e8edf3 0% 25%, #fff 0% 50%); background-size: 16px 16px; }

/* readability */
.dv-explain { margin-top: 14px; padding: 14px 16px; border-radius: 14px; background: var(--dv-surface); font-size: .92rem; line-height: 1.6; }
.dv-explain p { margin: 0 0 8px; } .dv-explain p:last-child { margin: 0; color: var(--dv-muted); }
.dv-hl { white-space: pre-wrap; word-break: break-word; padding: 16px; border: 1px solid var(--dv-line); border-radius: 14px; background: #fff; line-height: 1.75; font-size: .97rem; max-height: 480px; overflow: auto; }
mark.dv-long { background: #fff1b8; color: inherit; border-radius: 3px; padding: 1px 0; }
.dv-pv { text-decoration: underline wavy #e2462b; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.dv-longlist { margin: 0; padding-left: 22px; font-size: .93rem; line-height: 1.6; }
.dv-longlist li { margin-bottom: 8px; }
.dv-longlist small { color: var(--dv-muted); font-weight: 600; }
.dv .chips { gap: 8px; }
.dv .chips .chip { padding: 6px 12px; font-size: .88rem; }
.dv .chip small { color: var(--dv-muted); font-weight: 500; }

/* JSON */
.dv-jerr { padding: 14px 16px; border-radius: 14px; background: #fff3f0; border: 1px solid #ffd2c7; color: #7d2412; }
.dv-jerr p { margin: 0 0 6px; }
.dv-jerr__at { font-weight: 700; }
.dv-snip { margin: 8px 0 10px; padding: 10px 12px; background: #111c29; color: #dbe7f5; border-radius: 10px; overflow-x: auto; font: .85rem/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre; }
.dv-jok { margin-bottom: 4px; }
.dv-tree { margin-top: 0; max-height: 520px; overflow: auto; padding: 12px 14px; border: 1.5px solid var(--dv-line); border-radius: 12px; background: var(--dv-surface); font: .86rem/1.6 ui-monospace, Menlo, Consolas, monospace; margin-bottom: 10px; }
.dv-tree details > summary { cursor: pointer; list-style: none; padding-left: 16px; position: relative; word-break: break-all; }
.dv-tree details > summary::-webkit-details-marker { display: none; }
.dv-tree details > summary::before { content: "▸"; position: absolute; left: 0; color: var(--dv-muted); }
.dv-tree details[open] > summary::before { content: "▾"; }
.dv-tc { padding-left: 18px; border-left: 1px dashed #c9d4e0; margin-left: 4px; }
.dv-tn { padding-left: 16px; word-break: break-all; }
.dv-t-key { color: #8a2be2; } .dv-t-str { color: #0c7a3d; } .dv-t-num { color: #b35a00; } .dv-t-bool { color: #1f5fbf; font-weight: 700; } .dv-t-null { color: var(--dv-muted); font-style: italic; } .dv-t-meta { color: var(--dv-muted); }
.dv-tmore { font: inherit; margin: 4px 0 4px 16px; background: #fff; border: 1px solid var(--dv-line); border-radius: 8px; padding: 4px 10px; cursor: pointer; color: var(--dv-blue); }

/* gradient */
.dv-prev { border-radius: 16px; overflow: hidden; aspect-ratio: 16 / 10; border: 1px solid var(--dv-line); }
.dv-prev__fill { width: 100%; height: 100%; }
.dv-bar-wrap { margin: 18px 4px 0; }
.dv-stopbar { position: relative; height: 34px; border-radius: 10px; border: 1px solid var(--dv-line); cursor: copy; touch-action: none; }
.dv-stopbar__fill { position: absolute; inset: 0; border-radius: 9px; }
.dv-handle { position: absolute; top: 50%; width: 26px; height: 42px; margin: -21px 0 0 -13px; border-radius: 8px; border: 3px solid #fff; background: var(--c, #000); box-shadow: 0 0 0 1px rgba(17,28,41,.35), 0 3px 8px rgba(17,28,41,.3); cursor: grab; padding: 0; touch-action: none; }
.dv-handle.is-sel { box-shadow: 0 0 0 2px var(--dv-blue), 0 3px 10px rgba(17,28,41,.35); transform: scale(1.08); }
.dv-handle:focus-visible { outline: 3px solid var(--dv-blue); outline-offset: 2px; }
.dv-stops { display: grid; gap: 8px; }
.dv-stop { display: grid; grid-template-columns: 52px 1fr 1fr 40px; gap: 8px; align-items: end; padding: 8px; border: 1.5px solid var(--dv-line); border-radius: 12px; background: #fff; }
.dv-stop.is-sel { border-color: var(--dv-blue); }
.dv-stop input[type="color"] { height: 44px; min-width: 0; }
.dv-stop__n { display: flex; flex-direction: column; gap: 2px; font-size: .78rem; font-weight: 600; color: var(--dv-muted); }
.dv-stop__n input { min-height: 40px !important; padding: 8px !important; }
.dv-x { font: 700 1.3rem/1 system-ui, sans-serif; width: 40px; height: 40px; border-radius: 10px; border: 1.5px solid var(--dv-line); background: #fff; color: var(--dv-muted); cursor: pointer; }
.dv-x:hover:not(:disabled) { color: #b3311a; border-color: #ffd2c7; }
.dv-x:disabled { opacity: .35; cursor: not-allowed; }
.dv-presets { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 8px; }
.dv-preset { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; text-align: center; }
.dv-preset span { display: block; height: 48px; border-radius: 10px; box-shadow: inset 0 0 0 1px rgba(17,28,41,.12); }
.dv-preset small { font-size: .74rem; color: var(--dv-muted); font-weight: 600; }
.dv-preset:hover span, .dv-preset:focus-visible span { box-shadow: 0 0 0 2px var(--dv-blue); }
button.dv-preset.dv-checker { background-image: none; background-color: transparent; }

/* box shadow */
.dv-stage { display: grid; place-items: center; min-height: 300px; border-radius: 16px; border: 1px solid var(--dv-line); padding: 40px 20px; transition: background-color .2s; }
.dv-shadowbox { width: min(220px, 70%); aspect-ratio: 4 / 3; background: #fff; }

/* palette */
.dv-palette { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dv-sw { display: grid; grid-template-columns: 110px 1fr; border: 1px solid var(--dv-line); border-radius: 14px; overflow: hidden; background: #fff; }
.dv-sw__c { position: relative; min-height: 120px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; padding: 8px; }
.dv-sw__lock { width: 40px; height: 40px; border-radius: 10px; border: 0; background: rgba(255,255,255,.22); color: inherit; cursor: pointer; display: grid; place-items: center; }
.dv-sw__lock.is-on { background: rgba(0,0,0,.28); color: #fff; }
.dv-sw__edit { position: relative; font-size: .76rem; font-weight: 700; padding: 4px 8px; border-radius: 6px; background: rgba(255,255,255,.22); cursor: pointer; }
.dv-sw__edit input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; min-width: 0; cursor: pointer; }
.dv-sw__b { padding: 10px 12px; min-width: 0; }
.dv-sw__b b { font: 700 1.05rem ui-monospace, Menlo, Consolas, monospace; color: var(--dv-ink); }
.dv-sw__copy { display: flex; gap: 6px; margin: 8px 0; flex-wrap: wrap; }
.dv-sw__copy button { font: 600 .78rem ui-monospace, Menlo, Consolas, monospace; border: 1.5px solid var(--dv-line); background: #fff; color: var(--dv-ink); border-radius: 8px; padding: 6px 10px; cursor: pointer; min-height: 34px; }
.dv-sw__copy button:hover { border-color: var(--dv-blue); color: var(--dv-blue); }
.dv-sw__ct { display: grid; gap: 4px; font-size: .78rem; color: var(--dv-muted); }
.dv-sw__ct .tb { font-size: .7rem; padding: 2px 7px; margin-left: 2px; }
.dv-harm { padding: 12px 0; border-bottom: 1px dashed var(--dv-line); }
.dv-harm__head { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.dv-harm__head h3 { margin: 0; font-size: 1rem; color: var(--dv-ink); }
.dv-harm .tool-hint { margin: 4px 0 8px; }
.dv-harm__row { display: flex; gap: 6px; flex-wrap: wrap; }
.dv-mini { flex: 1 1 80px; min-height: 64px; border: 0; border-radius: 10px; cursor: pointer; display: flex; align-items: flex-end; padding: 6px 8px; font: 700 .76rem ui-monospace, Menlo, Consolas, monospace; box-shadow: inset 0 0 0 1px rgba(17,28,41,.1); }

/* image colour picker */
.dv-pickstage { position: relative; border-radius: 14px; padding: 8px; display: flex; justify-content: center; border: 1px solid var(--dv-line); }
.dv-pickstage canvas#ip-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; cursor: crosshair; touch-action: none; }
.dv-pickstage canvas#ip-canvas:focus-visible { outline: 3px solid var(--dv-blue); outline-offset: 3px; }
.dv-loupe { position: absolute; width: 120px; height: 120px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(17,28,41,.35), 0 8px 24px rgba(17,28,41,.35); pointer-events: none; image-rendering: pixelated; z-index: 3; background: #e6ebf2; }
.dv-current { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: stretch; }
.dv-current__sw { border-radius: 14px; min-height: 84px; background: var(--dv-surface); box-shadow: inset 0 0 0 1px rgba(17,28,41,.12); }
.dv-current__vals { display: grid; gap: 6px; min-width: 0; }
.dv-val { display: flex; align-items: center; gap: 8px; justify-content: space-between; }
.dv-val code { font-size: .9rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* password */
.dv-pwout { display: grid; grid-template-columns: 1fr; gap: 10px; }
.dv-pwout input { font-size: 1.15rem !important; padding: 14px 16px !important; letter-spacing: .02em; }
.dv-pwout .btn { justify-content: center; }
.dv-meter { margin: 14px 0 6px; }
.dv-meter__bar { height: 10px; border-radius: 99px; background: #e6ebf2; overflow: hidden; }
.dv-meter__bar i { display: block; height: 100%; width: 0; border-radius: 99px; background: #12a150; transition: width .25s; }
.dv-meter__bar i.is-warn { background: #f0a020; } .dv-meter__bar i.is-bad { background: #e2462b; }
.dv-meter p { margin: 8px 0 0; font-size: .92rem; line-height: 1.5; }
.dv-meter .tool-hint { display: block; margin: 4px 0 0; font-size: .82rem; }
.dv-pwlist ol { margin: 12px 0 10px; padding-left: 24px; }
.dv-pwlist li { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 0; border-bottom: 1px dashed var(--dv-line); }
.dv-pwlist code { font-size: .95rem; word-break: break-all; background: none; padding: 0; }

/* canvases (mockup, social) */
.dv-canvaswrap { border-radius: 14px; padding: 10px; display: flex; justify-content: center; align-items: center; border: 1px solid var(--dv-line); }
.dv-canvaswrap canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
#sr-src { cursor: crosshair; touch-action: none; }
#sr-src:focus-visible { outline: 3px solid var(--dv-blue); outline-offset: 3px; }
.dv-choice { flex-wrap: wrap; margin-top: 4px; }
.dv-sizes .dv-check { margin-top: 10px; }
.dv-sizes small { margin-left: auto; padding-left: 8px; white-space: nowrap; }
.dv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 230px), 1fr)); gap: 14px; margin-top: 16px; }
.dv-card { border: 1px solid var(--dv-line); border-radius: 14px; overflow: hidden; background: #fff; display: flex; flex-direction: column; }
.dv-card__img { display: grid; place-items: center; padding: 10px; min-height: 150px; }
.dv-card__img canvas { display: block; max-width: 100%; max-height: 220px; width: auto; height: auto; box-shadow: 0 0 0 1px rgba(17,28,41,.15); }
.dv-card__b { padding: 10px 12px 12px; display: grid; gap: 2px; }
.dv-card__b b { font-size: .92rem; color: var(--dv-ink); }
.dv-card__b small { color: var(--dv-muted); font-size: .82rem; }
.dv-card__b .btn { margin-top: 8px; justify-content: center; }

/* cookie banner preview */
.dv-cbprev { position: relative; height: 340px; border-radius: 14px; border: 1px solid var(--dv-line); overflow: hidden; transform: translateZ(0); background: #f8fafc; }
.dv-cbframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

@media (min-width: 640px) {
	.dv-opts--2 { grid-template-columns: 1fr 1fr; }
	.dv-pwout { grid-template-columns: 1fr auto auto; }
	.dv-palette { grid-template-columns: repeat(5, minmax(0, 1fr)); }
	.dv-sw { grid-template-columns: 1fr; }
	.dv-sw__c { min-height: 150px; }
}
@media (max-width: 380px) {
	.dv-range { grid-template-columns: 82px 1fr 48px; gap: 8px; }
	.dv-stop { grid-template-columns: 46px 1fr 1fr 36px; gap: 6px; padding: 6px; }
	.dv-x { width: 36px; height: 36px; }
	.dv-sw { grid-template-columns: 92px 1fr; }
}
@media (prefers-reduced-motion: reduce) { .dv-meter__bar i, .dv-stage { transition: none; } }
