/* MrDesignz Toolkit. Builds on the theme's tokens (--ink, --paper, --gold, --serif, --sans, --radius)
   and breakpoints (640, 900, 1180). Loaded only on toolkit pages. */

.mdzt-page [hidden] { display: none !important; }

/* ---------- Page frame ---------- */
.mdzt-hero { padding: 40px 0 36px; }
.mdzt-hero h1 { font-size: clamp(34px, 6vw, 56px); margin-bottom: 12px; }
.mdzt-hero h1 em { color: var(--gold); font-weight: 400; }
.mdzt-hero .page-lede { font-size: 18px; }
.mdzt-hero-index { padding-bottom: 44px; }
@media (min-width: 900px) {
	.mdzt-hero { padding: 56px 0 48px; }
	.mdzt-hero-index { padding: 72px 0 64px; }
}

.mdzt-crumbs ol { display: flex; flex-wrap: wrap; gap: 4px 0; list-style: none; margin: 0 0 18px; padding: 0; font-size: 14px; color: var(--muted-dark); }
.mdzt-crumbs li + li::before { content: "/"; margin: 0 10px; color: rgba(255, 255, 255, 0.3); }
.mdzt-crumbs a { color: var(--gold-soft); text-decoration: none; }
.mdzt-crumbs a:hover { text-decoration: underline; text-underline-offset: 3px; }
.mdzt-crumbs [aria-current] { color: var(--white); }

.mdzt-local { margin: 14px 0 0; font-size: 14px; font-weight: 600; color: var(--gold-soft); }

.mdzt-work { padding: 28px 0 64px; }
@media (min-width: 900px) { .mdzt-work { padding: 40px 0 88px; } }

.mdzt-h3 { font: 600 20px/1.2 var(--serif); margin: 28px 0 12px; }

/* ---------- Tool layout: controls beside output ---------- */
.mdzt-app { display: grid; gap: 24px; align-items: start; }
@media (min-width: 900px) {
	.mdzt-app { grid-template-columns: minmax(300px, 360px) minmax(0, 1fr); gap: 40px; }
	.mdzt-panel { position: sticky; top: 96px; }
}
.mdzt-panel { gap: 16px; padding: 22px; }
@media (min-width: 640px) { .mdzt-panel { padding: 28px; } }
.mdzt-output { min-width: 0; }

/* Theme inputs are full width with a 48px height; these controls need their own sizing. */
.card-form input[type="range"],
.card-form input[type="checkbox"],
.card-form input[type="radio"],
.card-form input[type="color"],
.card-form input[type="file"] { width: auto; min-height: 0; padding: 0; border: 0; background: none; }
.card-form input[type="range"] { width: 100%; accent-color: var(--ink); height: 28px; }
.card-form input[type="checkbox"], .card-form input[type="radio"] { width: 24px; height: 24px; accent-color: var(--ink); flex: none; margin: 0; }
.card-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: grid; gap: 8px; }
.card-form legend { font-size: 14px; font-weight: 700; padding: 0; margin-bottom: 8px; }
.card-form select:disabled, .card-form input:disabled { opacity: 0.55; }
.card-form [aria-invalid="true"] { border-color: #b3261e; }

.mdzt-range { display: grid; gap: 4px; }
.mdzt-range label { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; font-weight: 700; }
.mdzt-range output { font-weight: 600; color: var(--muted-light); font-variant-numeric: tabular-nums; }
.mdzt-check { display: flex !important; grid-template-columns: none !important; align-items: center; gap: 10px !important; font-weight: 500 !important; font-size: 15px !important; min-height: 32px; cursor: pointer; }
.mdzt-hint { margin: 0; font-size: 14px; line-height: 1.5; color: var(--muted-light); }
.mdzt-hint a { color: var(--gold-deep); }
.mdzt-field-error { margin: 0; font-size: 14px; font-weight: 600; color: #b3261e; }
.mdzt-field-error:empty { display: none; }

.mdzt-colour-field { display: grid; gap: 6px; }
.mdzt-colour-field > label { font-size: 14px; font-weight: 700; }
.mdzt-colour-row { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 8px; }
.mdzt-colour-row input[type="text"] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; text-transform: uppercase; }
.card-form input.mdzt-swatch-input { width: 48px; height: 48px; padding: 3px; border: 1px solid var(--line-light); border-radius: var(--radius); background: var(--white); cursor: pointer; }

/* ---------- Buttons ---------- */
.mdzt-panel .btn { width: 100%; }
.mdzt-panel .btn:disabled { opacity: 0.5; cursor: not-allowed; }
.mdzt-btn-line {
	display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
	font: 700 14px/1 var(--sans); color: var(--ink); background: var(--white);
	border: 1px solid rgba(11, 11, 12, 0.35); border-radius: var(--radius); cursor: pointer;
	transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.mdzt-btn-line:hover { border-color: var(--ink); background: var(--paper); }
.mdzt-btn-xs { min-height: 36px; padding: 0 12px; font-size: 13px; }
.mdzt-btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.mdzt-status { min-height: 24px; margin: 12px 0 0; font-size: 14px; font-weight: 600; color: var(--gold-deep); }
.mdzt-status.is-error { color: #b3261e; }

/* ---------- File drop ---------- */
.mdzt-drop { position: relative; }
.mdzt-file { position: absolute; inset: 0; width: 100% !important; height: 100% !important; opacity: 0; cursor: pointer; }
.mdzt-drop label {
	display: grid; gap: 4px; place-items: center; text-align: center; min-height: 120px; padding: 20px;
	background: var(--white); border: 1.5px dashed rgba(11, 11, 12, 0.3); border-radius: 6px; font-weight: 500;
}
.mdzt-drop label strong { font: 600 18px/1.2 var(--serif); }
.mdzt-drop label span { font-size: 14px; color: var(--muted-light); }
.mdzt-drop:hover label, .mdzt-drop.is-over label { border-color: var(--gold-deep); background: #fffdf6; }
.mdzt-file:focus-visible + label { outline: 2px solid var(--gold); outline-offset: 3px; }

.mdzt-empty-state { display: grid; place-items: center; min-height: 240px; padding: 32px; text-align: center; background: var(--paper); border-radius: 6px; color: var(--muted-light); }
.mdzt-empty-state p { margin: 0; max-width: 360px; }

/* ---------- Contrast checker ---------- */
.mdzt-ratio-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 24px; margin-bottom: 16px; }
.mdzt-ratio { margin: 0; display: flex; align-items: baseline; gap: 12px; }
.mdzt-ratio-num { font: 600 clamp(44px, 8vw, 64px)/1 var(--serif); font-variant-numeric: tabular-nums; }
.mdzt-ratio-label { font-size: 14px; color: var(--muted-light); }
.mdzt-verdict { margin: 0; font-weight: 700; }
.mdzt-preview-text { padding: 28px; border-radius: 6px; border: 1px solid var(--line-light); }
.mdzt-preview-text p { margin: 0 0 12px; }
.mdzt-pt-large { font: 600 28px/1.2 var(--serif); }
.mdzt-pt-body { font-size: 16px; line-height: 1.6; }
.mdzt-pt-small { font-size: 13px; }
.mdzt-pt-btn { display: inline-block; padding: 10px 18px; border: 2px solid var(--mdzt-pt-line, currentColor); border-radius: var(--radius); font-weight: 700; font-size: 15px; }

.mdzt-results { width: 100%; margin-top: 20px; border-collapse: collapse; font-size: 15px; }
.mdzt-results th, .mdzt-results td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--line-light); }
.mdzt-results thead th { font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted-light); }
.mdzt-results tbody th { font-weight: 600; }
.mdzt-results .is-pass, .mdzt-results .is-fail { font-weight: 700; white-space: nowrap; }
.mdzt-results .is-pass { color: #1d6b3a; }
.mdzt-results .is-pass::before { content: "✓ "; }
.mdzt-results .is-fail { color: #b3261e; }
.mdzt-results .is-fail::before { content: "✕ "; }
.mdzt-results .mdzt-na { color: var(--muted-light); font-size: 13px; }
.mdzt-suggest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mdzt-suggest-list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 15px; }
.mdzt-mini-swatch { width: 28px; height: 28px; border-radius: var(--radius); border: 1px solid var(--line-light); flex: none; }

/* ---------- Palette ---------- */
.mdzt-swatches { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
@media (min-width: 640px) { .mdzt-swatches { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; } }
.mdzt-sw { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; align-items: stretch; }
@media (min-width: 640px) { .mdzt-sw { grid-template-columns: 1fr; gap: 10px; } }
.mdzt-sw-color { position: relative; display: block; min-height: 96px; border-radius: 6px; border: 1px solid var(--line-light); cursor: pointer; }
@media (min-width: 640px) { .mdzt-sw-color { min-height: 150px; } }
.mdzt-sw.is-locked .mdzt-sw-color { box-shadow: inset 0 0 0 3px var(--ink), inset 0 0 0 5px var(--white); }
.mdzt-sw-edit { position: absolute; left: 10px; bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.mdzt-sw-color:focus-within { outline: 2px solid var(--gold); outline-offset: 3px; }
.mdzt-sw-meta { display: grid; gap: 2px; align-content: start; justify-items: start; }
.mdzt-sw-hex, .mdzt-sw-val { padding: 4px 0; background: none; border: 0; cursor: pointer; text-align: left; color: var(--ink); min-height: 28px; }
.mdzt-sw-hex { font: 700 16px/1.2 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.mdzt-sw-val { font-size: 13px; color: var(--muted-light); }
.mdzt-sw-hex:hover, .mdzt-sw-val:hover { text-decoration: underline; text-underline-offset: 3px; }
.mdzt-sw-lock { margin-top: 6px; }
.mdzt-sw-lock[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.mdzt-export legend { margin-bottom: 10px; }
.mdzt-export .mdzt-btn-line { flex: 1 1 calc(50% - 4px); }

.mdzt-site-preview {
	--sp-bg: #fff; --sp-surface: #eee; --sp-text: #111; --sp-primary: #333; --sp-on-primary: #fff; --sp-accent: #666; --sp-logo: #333; --sp-kicker: #666;
	background: var(--sp-bg); color: var(--sp-text); border: 1px solid var(--line-light); border-radius: 6px; overflow: hidden;
}
.mdzt-sp-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-bottom: 1px solid color-mix(in srgb, var(--sp-text) 12%, transparent); font-size: 14px; }
.mdzt-sp-logo { font: 700 18px/1 var(--serif); color: var(--sp-logo); }
.mdzt-sp-nav { white-space: pre; opacity: 0.8; display: none; }
@media (min-width: 640px) { .mdzt-sp-nav { display: inline; } }
.mdzt-sp-hero { padding: 28px 20px; }
.mdzt-sp-kicker { margin: 0 0 6px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--sp-kicker); }
.mdzt-sp-title { margin: 0 0 8px; font: 600 clamp(24px, 4vw, 34px)/1.1 var(--serif); }
.mdzt-sp-text { margin: 0 0 18px; max-width: 460px; }
.mdzt-sp-btn { display: inline-block; padding: 12px 20px; border-radius: var(--radius); background: var(--sp-primary); color: var(--sp-on-primary); font-weight: 700; font-size: 15px; }
.mdzt-sp-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 20px 20px; }
.mdzt-sp-card { height: 56px; border-radius: var(--radius); background: var(--sp-surface); border-top: 3px solid var(--sp-accent); }

.mdzt-saved-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.mdzt-saved-list li { display: flex; align-items: center; gap: 8px; }
.mdzt-saved-strip { display: flex; flex: 1; height: 36px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line-light); }
.mdzt-saved-strip span { flex: 1; }

/* ---------- Image tools ---------- */
.mdzt-saving { margin: 0 0 16px; font: 600 22px/1.3 var(--serif); }
.mdzt-saving.is-worse { color: #8a1c1c; font: 600 16px/1.5 var(--sans); }
.mdzt-compare { display: grid; gap: 16px; }
@media (min-width: 640px) { .mdzt-compare { grid-template-columns: 1fr 1fr; } }
.mdzt-compare figure { margin: 0; }
.mdzt-frame { aspect-ratio: 4 / 3; background: var(--paper) repeating-conic-gradient(rgba(11, 11, 12, 0.06) 0 25%, transparent 0 50%) 0 0 / 20px 20px; border-radius: 6px; overflow: hidden; display: grid; place-items: center; }
.mdzt-frame img { width: 100%; height: 100%; object-fit: contain; }
.is-actual .mdzt-frame { overflow: auto; display: block; }
.is-actual .mdzt-frame img { width: auto; height: auto; max-width: none; object-fit: none; }
.mdzt-compare figcaption { margin-top: 8px; font-size: 14px; color: var(--muted-light); }
.mdzt-compare figcaption strong { color: var(--ink); margin-right: 6px; }

.mdzt-stage { display: grid; place-items: center; padding: 16px; min-height: 280px; background: var(--paper) repeating-conic-gradient(rgba(11, 11, 12, 0.06) 0 25%, transparent 0 50%) 0 0 / 20px 20px; border-radius: 6px; }
.mdzt-canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; box-shadow: 0 10px 30px -12px rgba(0, 0, 0, 0.35); touch-action: none; cursor: grab; }
.mdzt-canvas:active { cursor: grabbing; }
.mdzt-dims-out { margin: 12px 0 4px; font-weight: 600; }
.mdzt-dims-out.is-warning { color: #8a1c1c; }
.mdzt-dims { gap: 12px; }
.mdzt-crop-controls { display: grid; gap: 12px; }

/* ---------- Favicon ---------- */
.mdzt-tabs-preview { display: grid; gap: 10px; }
@media (min-width: 640px) { .mdzt-tabs-preview { grid-template-columns: 1fr 1fr; } }
.mdzt-tab { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 8px 8px 0 0; font: 500 14px/1.2 system-ui, sans-serif; overflow: hidden; }
.mdzt-tab span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mdzt-tab canvas { width: 16px; height: 16px; flex: none; }
.mdzt-tab.is-light { background: #e9e9ec; color: #1f1f22; }
.mdzt-tab.is-dark { background: #2a2a2e; color: #ececf1; }
.mdzt-sizes { list-style: none; margin: 0; padding: 20px; display: flex; flex-wrap: wrap; align-items: flex-end; gap: 20px 28px; background: var(--paper); border-radius: 6px; }
.mdzt-sizes li { display: grid; justify-items: center; gap: 8px; font-size: 12px; color: var(--muted-light); }
.mdzt-sizes canvas { image-rendering: auto; }
.mdzt-sizes canvas[data-size="180"], .mdzt-sizes canvas[data-size="192"] { width: 96px; height: 96px; }
.mdzt-sizes canvas.is-apple { border-radius: 22%; }
.mdzt-files { margin: 0; padding-left: 1.2em; font-size: 15px; columns: 2 220px; }
.mdzt-code { margin: 0 0 12px; padding: 16px; background: var(--ink); color: #f1eee6; border-radius: 6px; overflow-x: auto; font: 13px/1.6 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; white-space: pre; }
.mdzt-code:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }

/* ---------- Font pairing ---------- */
.mdzt-pairs { display: grid; gap: 6px; max-height: 340px; overflow-y: auto; padding: 2px; }
.mdzt-pair { display: grid !important; grid-template-columns: 20px minmax(0, 1fr); column-gap: 10px !important; row-gap: 0 !important; align-items: center; padding: 10px 12px; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--radius); cursor: pointer; font-weight: 500 !important; }
.mdzt-pair:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.mdzt-pair input { grid-row: span 2; }
.mdzt-pair-h { font-weight: 700; font-size: 15px; }
.mdzt-pair-b { font-size: 13px; color: var(--muted-light); }
.mdzt-adjust summary { cursor: pointer; font-size: 14px; font-weight: 700; padding: 6px 0; }
.mdzt-adjust-grid { display: grid; gap: 14px; margin-top: 10px; }

.mdzt-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.mdzt-pair-name { margin: 0; font-weight: 700; }
.mdzt-seg { display: inline-flex; border: 1px solid rgba(11, 11, 12, 0.35); border-radius: var(--radius); overflow: hidden; }
.mdzt-seg button { min-height: 40px; padding: 0 16px; font: 700 14px/1 var(--sans); background: var(--white); color: var(--ink); border: 0; cursor: pointer; }
.mdzt-seg button + button { border-left: 1px solid rgba(11, 11, 12, 0.35); }
.mdzt-seg button[aria-pressed="true"] { background: var(--ink); color: var(--white); }

.mdzt-type-stage { background: var(--paper); border-radius: 6px; padding: 16px; }
.mdzt-type-preview {
	--tp-h-font: Georgia, serif; --tp-b-font: system-ui, sans-serif; --tp-h-size: 44px; --tp-h-weight: 600; --tp-h-space: 0; --tp-b-size: 17px; --tp-b-weight: 400; --tp-lh: 1.6;
	margin: 0 auto; max-width: 100%; padding: clamp(20px, 4vw, 44px); background: var(--white); border: 1px solid var(--line-light); border-radius: 4px;
}
.mdzt-type-preview.is-phone { max-width: 375px; }
.mdzt-type-preview.is-phone .mdzt-tp-heading { font-size: min(var(--tp-h-size), 34px); }
.mdzt-type-preview.is-phone .mdzt-tp-sub { font-size: min(calc(var(--tp-h-size) * 0.48), 20px); }
.mdzt-type-preview [contenteditable] { outline: none; border-radius: 2px; }
.mdzt-type-preview [contenteditable]:hover { box-shadow: 0 0 0 1px var(--line-light); }
.mdzt-type-preview [contenteditable]:focus-visible { box-shadow: 0 0 0 2px var(--gold); }
.mdzt-tp-kicker { margin: 0 0 14px; font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); }
.mdzt-tp-heading { margin: 0 0 10px; font-family: var(--tp-h-font); font-size: var(--tp-h-size); font-weight: var(--tp-h-weight); letter-spacing: var(--tp-h-space); line-height: 1.1; overflow-wrap: anywhere; }
.mdzt-tp-sub { margin: 0 0 16px; font-family: var(--tp-h-font); font-size: calc(var(--tp-h-size) * 0.48); font-weight: var(--tp-h-weight); letter-spacing: var(--tp-h-space); line-height: 1.25; }
.mdzt-tp-body { margin: 0 0 22px; font-family: var(--tp-b-font); font-size: var(--tp-b-size); font-weight: var(--tp-b-weight); line-height: var(--tp-lh); max-width: 62ch; }
.mdzt-tp-btn { display: inline-block; padding: 12px 22px; background: var(--ink); color: var(--white); border-radius: var(--radius); font-family: var(--tp-b-font); font-weight: 700; font-size: 15px; }

/* ---------- Guide, FAQ, related ---------- */
.mdzt-guide h2 { font-size: clamp(26px, 4vw, 32px); margin: 0 0 18px; }
.mdzt-guide h2:not(:first-child) { margin-top: 40px; }
.mdzt-guide-grid { display: grid; gap: 40px; }
@media (min-width: 900px) { .mdzt-guide-grid { grid-template-columns: 1fr 1fr; gap: 72px; } }
.mdzt-steps { margin: 0; padding-left: 1.3em; display: grid; gap: 10px; }
.mdzt-steps li::marker { font-weight: 700; color: var(--gold-deep); }
.mdzt-notes { margin: 0; padding-left: 1.2em; display: grid; gap: 8px; color: var(--ink); }
.mdzt-faq details { border-bottom: 1px solid var(--line-light); }
.mdzt-faq summary { cursor: pointer; padding: 14px 0; font-weight: 700; list-style-position: outside; }
.mdzt-faq details p { margin: 0 0 16px; color: var(--muted-light); }
.mdzt-related { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.mdzt-related a { color: var(--gold-deep); font-weight: 700; text-underline-offset: 3px; }
.mdzt-hire { margin-top: 36px; padding: 24px; background: var(--white); border-left: 3px solid var(--gold); border-radius: 0 6px 6px 0; }
.mdzt-hire p { margin: 0 0 14px; }

/* ---------- Cards and landing ---------- */
.mdzt-grid { display: grid; gap: 16px; }
@media (min-width: 640px) { .mdzt-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1180px) { .mdzt-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
.mdzt-card .tool-initial { color: var(--gold); }
.mdzt-card .mdzt-icon { width: 22px; height: 22px; }
.mdzt-card-cat { font-size: 12px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gold-deep); }
.mdzt-card[hidden] { display: none; }
.mdzt-more .section-head { margin-bottom: 24px; align-items: center; }
.mdzt-more .section-title-sm { margin: 0; }

.mdzt-search { margin-top: 28px; max-width: 640px; }
.mdzt-search input { min-height: 52px; font-size: 17px; }
.mdzt-search input::placeholder { color: var(--muted-dark); }
.mdzt-search .btn { min-height: 52px; }

.mdzt-filter { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.mdzt-chip { min-height: 44px; padding: 0 18px; font: 700 14px/1 var(--sans); color: var(--ink); background: var(--white); border: 1px solid rgba(11, 11, 12, 0.35); border-radius: 999px; cursor: pointer; }
.mdzt-chip:hover { border-color: var(--ink); }
.mdzt-chip[aria-pressed="true"] { background: var(--ink); color: var(--white); border-color: var(--ink); }
.mdzt-count { min-height: 24px; margin: 8px 0 16px; font-size: 14px; font-weight: 600; color: var(--muted-light); }
.mdzt-empty { margin-top: 8px; padding: 28px; background: var(--paper); border-radius: 6px; }
.mdzt-empty p:last-child { margin: 0; display: flex; flex-wrap: wrap; gap: 20px; }

/* ---------- Tiles: shared ---------- */
.mdzt-tile {
	--tile-bg: var(--white); --tile-fg: var(--ink); --tile-muted: #55534d; --tile-line: var(--line-light); --tile-accent: var(--gold-deep);
	position: relative; display: flex; flex-direction: column; gap: 18px; padding: 20px;
	background: var(--tile-bg); color: var(--tile-fg); border: 1px solid var(--tile-line); border-radius: 6px; text-decoration: none;
}
a.mdzt-tile { transition: border-color 0.2s var(--ease), transform 0.2s var(--ease); }
a.mdzt-tile:hover { border-color: var(--tile-accent); transform: translateY(-2px); }
a.mdzt-tile:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { a.mdzt-tile, a.mdzt-tile:hover { transition: none; transform: none; } }

.mdzt-tile-body { display: flex; flex-direction: column; gap: 6px; }
.mdzt-tile-cat { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--tile-accent); }
.mdzt-tile-name { margin: 0; font: 600 22px/1.15 var(--serif); letter-spacing: -0.01em; }
.mdzt-tile-desc { margin: 0; font-size: 15px; line-height: 1.55; color: var(--tile-muted); }
.mdzt-tile-go { margin-top: 4px; font-size: 14px; font-weight: 700; color: var(--tile-accent); }
.mdzt-tile[hidden] { display: none !important; }

/* ---------- Tool previews ---------- */
.mdzt-art { display: block; }
.mdzt-art-colour-palette-generator { display: flex; gap: 6px; height: 132px; }
.mdzt-art-sw { flex: 1; display: flex; align-items: flex-end; justify-content: center; padding-bottom: 8px; background: var(--c); border-radius: 3px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tile-fg) 22%, transparent); }
.mdzt-art-sw span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 10px; font-weight: 700; letter-spacing: 0.08em; color: var(--t); }

.mdzt-art-font-pairing { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 16px; }
.mdzt-art-aa { font: 600 88px/0.95 var(--serif); letter-spacing: -0.03em; }
.mdzt-art-ab { font: 500 54px/1 var(--sans); color: var(--tile-accent); }
.mdzt-art-cap { flex-basis: 100%; margin-top: 8px; font-size: 12px; color: var(--tile-muted); }

.mdzt-art-colour-contrast-checker { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.mdzt-art-sample { align-self: stretch; padding: 18px; background: #fff; color: #767676; font: 600 22px/1.2 var(--serif); border: 1px solid var(--line-light); border-radius: 3px; }
.mdzt-art-ratio { display: inline-flex; align-items: baseline; gap: 8px; font-size: 13px; font-weight: 700; color: var(--tile-fg); }
.mdzt-art-ratio b { font: 700 20px/1 var(--serif); }

.mdzt-art-image-compressor { display: flex; flex-direction: column; gap: 12px; }
.mdzt-art-bar { display: flex; flex-direction: column; gap: 5px; }
.mdzt-art-bar span { display: block; width: var(--w); height: 16px; background: var(--tile-muted); opacity: 0.45; border-radius: 2px; }
.mdzt-art-bar.is-out span { background: var(--gold); opacity: 1; }
.mdzt-art-bar em { font-style: normal; font-size: 12px; font-weight: 700; color: var(--tile-fg); }

.mdzt-art-image-resizer { display: flex; align-items: flex-end; gap: 4%; }
.mdzt-art-frame { position: relative; display: flex; align-items: flex-end; padding: 6px; border: 2px solid var(--gold); border-radius: 2px; }
.mdzt-art-frame:nth-child(1) { width: 29%; }
.mdzt-art-frame:nth-child(2) { width: 38%; }
.mdzt-art-frame:nth-child(3) { width: 23%; }
.mdzt-art-frame span { font-size: 10px; font-weight: 700; line-height: 1.2; color: var(--tile-fg); }

.mdzt-art-favicon-generator { display: flex; flex-direction: column; gap: 14px; }
.mdzt-art-tab { display: inline-flex; align-self: flex-start; align-items: center; gap: 8px; padding: 10px 16px; background: var(--tile-fg); color: var(--tile-bg); border-radius: 10px 10px 0 0; font-size: 13px; font-weight: 600; }
.mdzt-art-fav { display: grid; place-items: center; width: 18px; height: 18px; background: var(--gold); color: var(--ink); border-radius: 4px; font: italic 600 12px/1 var(--serif); }
.mdzt-art-sizes { display: flex; flex-wrap: wrap; gap: 6px; }
.mdzt-art-sizes span { padding: 4px 8px; font-size: 12px; font-weight: 700; color: var(--tile-fg); border: 1px solid color-mix(in srgb, var(--tile-fg) 30%, transparent); border-radius: 999px; }

/* ---------- Landing board: lead tile and gallery (grid spans) ---------- */
.mdzt-board { display: grid; gap: 14px; grid-auto-flow: dense; }
@media (min-width: 640px) {
	.mdzt-board { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-auto-rows: minmax(190px, auto); }
	.mdzt-board .mdzt-size-lead, .mdzt-board .mdzt-size-wide { grid-column: span 2; }
	.mdzt-board .mdzt-size-lead, .mdzt-board .mdzt-size-tall { grid-row: span 2; }
}
@media (min-width: 1180px) { .mdzt-board { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.mdzt-board .mdzt-tile { justify-content: space-between; }
.mdzt-board .mdzt-size-lead { --tile-bg: var(--gold); --tile-fg: var(--ink); --tile-muted: rgba(11, 11, 12, 0.78); --tile-line: var(--gold); --tile-accent: var(--ink); padding: 28px; }
.mdzt-board .mdzt-size-lead .mdzt-tile-name { font-size: clamp(30px, 3vw, 40px); }
.mdzt-board .mdzt-art { flex: 1; display: flex; }
.mdzt-board .mdzt-size-lead .mdzt-art-colour-palette-generator { height: auto; min-height: 200px; }
.mdzt-board .mdzt-art-font-pairing { align-content: flex-end; }
.mdzt-board .mdzt-size-tall .mdzt-art-aa { font-size: clamp(88px, 9vw, 132px); }
.mdzt-board .mdzt-art-image-resizer, .mdzt-board .mdzt-art-image-compressor, .mdzt-board .mdzt-art-favicon-generator { justify-content: center; }
.mdzt-board .mdzt-art-image-compressor, .mdzt-board .mdzt-art-favicon-generator, .mdzt-board .mdzt-art-colour-contrast-checker { flex-direction: column; }
.mdzt-board .mdzt-tile-font-pairing, .mdzt-board .mdzt-tile-image-compressor, .mdzt-board .mdzt-tile-favicon-generator {
	--tile-bg: var(--ink-2); --tile-fg: var(--white); --tile-muted: rgba(255, 255, 255, 0.72); --tile-line: var(--ink-2); --tile-accent: var(--gold);
}
.mdzt-board .mdzt-tile-colour-contrast-checker { --tile-bg: var(--paper); --tile-line: var(--paper); }
.mdzt-board .mdzt-tile-guide { --tile-bg: var(--white); justify-content: flex-end; }
.mdzt-board .mdzt-tile-guide .mdzt-tile-name { font-size: 26px; }
.mdzt-board .mdzt-tile-hire { --tile-bg: var(--ink); --tile-fg: var(--white); --tile-muted: rgba(255, 255, 255, 0.72); --tile-line: var(--ink); align-items: flex-start; justify-content: flex-end; }
.mdzt-board .mdzt-tile-hire .btn { background: var(--gold); color: var(--ink); border-color: var(--gold); }
@media (min-width: 640px) { .mdzt-board .mdzt-tile-image-compressor { flex-direction: row; align-items: stretch; gap: 28px; } .mdzt-board .mdzt-tile-image-compressor .mdzt-tile-body { justify-content: flex-end; } .mdzt-board .mdzt-tile-image-compressor .mdzt-art { flex: 1; } .mdzt-board .mdzt-tile-image-compressor .mdzt-tile-body { flex: 1; } }

.mdzt-board .mdzt-size-tall .mdzt-art-image-resizer { align-items: center; }
.mdzt-board .mdzt-size-tall .mdzt-art-image-resizer .mdzt-art-frame { align-self: center; }

/* Filter chips: one swipeable row on phones. */
@media (max-width: 639px) {
	.mdzt-index .mdzt-filter { flex-wrap: nowrap; overflow-x: auto; margin-right: calc(-1 * var(--gutter)); padding-right: var(--gutter); scrollbar-width: none; }
	.mdzt-index .mdzt-chip { flex: none; }
}

.mdzt-notes-row { margin-top: 20px; }
@media (min-width: 900px) { .mdzt-notes-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px; } }

/* Toolkit pages use the full screen width from 1280 px; the theme's 1200 px cap stays on other pages. */
@media (min-width: 1280px) {
	.mdzt-page { --wrap: 100%; --gutter: clamp(20px, 4vw, 80px); }
	.mdzt-page .mdzt-steps li,
	.mdzt-page .mdzt-notes li,
	.mdzt-page .mdzt-faq p,
	.mdzt-page .mdzt-hint,
	.mdzt-page .mdzt-pt-body,
	.mdzt-page .mdzt-hire p { max-width: 70ch; }
}
