/**
 * Personalized Verse Board designer.
 */

.tbs-designer-page .tbs-page { padding-top: 32px; }
.tbs-vb-admin-note {
	margin-bottom: 20px; padding: 12px 16px; border-radius: 12px;
	background: #FFF4DE; color: #8A5A00; font-size: 14px; font-weight: 600;
}
.tbs-vb-admin-note a { margin-left: 6px; color: inherit; }

/* App shell -------------------------------------------------------------- */
.tbs-vb { position: relative; min-height: 560px; border: 1px solid var(--tbs-line); border-radius: 22px; background: var(--tbs-white); box-shadow: 0 24px 60px rgba(36,39,42,.08); overflow: hidden; overflow: clip; }
.tbs-vb-loading { position: absolute; inset: 0; background: linear-gradient(90deg, var(--tbs-page-soft), #fff, var(--tbs-page-soft)); background-size: 200% 100%; animation: tbsVbShimmer 1.4s linear infinite; }
.tbs-vb.is-ready .tbs-vb-loading { display: none; }
@keyframes tbsVbShimmer { to { background-position: -200% 0; } }
.tbs-vb-noscript { padding: 40px; text-align: center; }

.tbs-vb__app {
	display: grid;
	grid-template-columns: 88px 340px minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) auto;
	grid-template-areas: "rail panel stage" "rail panel bar";
	min-height: 640px;
}

/* Left rail */
.tbs-vb__rail { grid-area: rail; display: flex; flex-direction: column; gap: 4px; padding: 14px 8px; background: var(--tbs-ink); }
.tbs-vb__tab {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border: 0; border-radius: 12px;
	background: transparent; color: #AEB6C1; font: 700 11.5px/1.2 var(--tbs-sans); text-align: center; cursor: pointer;
	transition: background .2s, color .2s;
}
.tbs-vb__tab:hover { background: rgba(255,255,255,.08); color: #fff; }
.tbs-vb__tab.is-active { background: rgba(255,255,255,.12); color: #fff; box-shadow: inset 3px 0 0 var(--tbs-sun-b); }
.tbs-vb__tab.is-active svg { color: var(--tbs-sun-b); }
.tbs-vb__tab:focus-visible { outline: 2px solid var(--tbs-sun-b); outline-offset: 2px; }

/* Panels */
.tbs-vb__panels { grid-area: panel; border-right: 1px solid var(--tbs-line); background: #FBFCFE; }
.tbs-vb__panel { padding: 22px 22px 28px; }
.tbs-vb__panel-title { margin: 0 0 14px; font-size: 22px; }
.tbs-vb__label { display: block; margin: 18px 0 8px; font-size: 13px; font-weight: 800; color: var(--tbs-ink); }
.tbs-vb__label small { font-weight: 600; color: var(--tbs-muted); }
.tbs-vb__panel-title + .tbs-vb__label { margin-top: 0; }
.tbs-vb__help { margin: 8px 0 0; font-size: 13px; color: var(--tbs-muted); }
.tbs-vb__input {
	width: 100%; min-height: 48px; padding: 12px 14px; border: 1px solid var(--tbs-line-strong); border-radius: 12px;
	background: #fff; font: 500 15px/1.5 var(--tbs-sans); color: var(--tbs-ink);
}
.tbs-vb__textarea { min-height: 120px; resize: vertical; }
.tbs-vb__input:focus { outline: none; border-color: var(--tbs-sun-b); box-shadow: 0 0 0 3px rgba(240,156,55,.22); }

.tbs-vb__reader {
	display: flex; gap: 12px; align-items: flex-start; margin-top: 18px; padding: 14px; border: 1px dashed rgba(240,99,62,.45); border-radius: 14px;
	background: var(--tbs-warm); color: var(--tbs-ink); text-decoration: none;
}
.tbs-vb__reader svg { flex: 0 0 auto; color: var(--tbs-accent-text); margin-top: 2px; }
.tbs-vb__reader span { display: flex; flex-direction: column; gap: 2px; font-size: 14px; }
.tbs-vb__reader small { color: var(--tbs-muted); font-size: 12.5px; }
.tbs-vb__reader:hover { border-style: solid; text-decoration: none; }

.tbs-vb__chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tbs-vb__chip {
	display: inline-flex; align-items: center; justify-content: center; height: 34px; padding: 0 12px; border: 1px solid var(--tbs-line-strong); border-radius: 999px; background: #fff;
	font: 700 12.5px/1 var(--tbs-sans); color: var(--tbs-ink); white-space: nowrap; cursor: pointer;
}
.tbs-vb__chip:hover { border-color: var(--tbs-sun-b); background: var(--tbs-warm); }

/* Upload */
.tbs-vb__drop { position: relative; }
.tbs-vb__file { position: absolute; width: 1px; height: 1px; opacity: 0; }
.tbs-vb__drop-label {
	display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 22px 16px; border: 2px dashed var(--tbs-line-strong); border-radius: 16px;
	background: #fff; text-align: center; cursor: pointer; transition: border-color .2s, background .2s;
}
.tbs-vb__drop-label svg { color: var(--tbs-accent-text); }
.tbs-vb__drop-label small { font-size: 12.5px; color: var(--tbs-muted); line-height: 1.45; }
.tbs-vb__drop-label:hover, .tbs-vb__drop.is-over .tbs-vb__drop-label { border-color: var(--tbs-sun-b); background: var(--tbs-warm); }
.tbs-vb__file:focus-visible + .tbs-vb__drop-label { outline: 2px solid var(--tbs-sun-b); outline-offset: 2px; }
.tbs-vb__photo-tools { margin-top: 6px; }

.tbs-vb__range { width: 100%; accent-color: var(--tbs-sun-a); }
.tbs-vb__link { margin-top: 10px; padding: 0; border: 0; background: none; color: var(--tbs-accent-text); font: 700 13px var(--tbs-sans); cursor: pointer; text-decoration: underline; }

.tbs-vb__swatches { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.tbs-vb__swatches--img { grid-template-columns: repeat(3, 1fr); }
.tbs-vb__swatch { display: flex; flex-direction: column; gap: 4px; padding: 0; border: 0; background: none; cursor: pointer; font: 600 11.5px var(--tbs-sans); color: var(--tbs-muted); text-align: center; }
.tbs-vb__swatch img, .tbs-vb__swatch canvas { display: block; width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 10px; border: 2px solid transparent; box-shadow: 0 0 0 1px var(--tbs-line); }
.tbs-vb__swatch.is-selected img, .tbs-vb__swatch.is-selected canvas { border-color: var(--tbs-sun-a); box-shadow: 0 0 0 3px rgba(240,99,62,.2); }

/* Segmented buttons */
.tbs-vb__seg { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; padding: 4px; border-radius: 12px; background: var(--tbs-page); }
.tbs-vb__seg button {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 42px; padding: 6px; border: 0; border-radius: 9px;
	background: transparent; color: var(--tbs-ink); font: 700 13px var(--tbs-sans); cursor: pointer;
}
.tbs-vb__seg button small { font: 600 10.5px var(--tbs-sans); color: var(--tbs-muted); }
.tbs-vb__fonts button { min-height: 60px; font-size: 22px; line-height: 1; }
.tbs-vb__seg button.is-selected { background: #fff; box-shadow: 0 2px 8px rgba(36,39,42,.12); }

/* Layout presets */
.tbs-vb__layouts { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.tbs-vb__layout { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; border: 1px solid var(--tbs-line); border-radius: 10px; background: #fff; font: 700 10.5px var(--tbs-sans); color: var(--tbs-muted); cursor: pointer; }
.tbs-vb__layout.is-selected { border-color: var(--tbs-sun-a); color: var(--tbs-ink); box-shadow: 0 0 0 3px rgba(240,99,62,.15); }
.tbs-vb__layout-ico { position: relative; display: block; width: 30px; height: 40px; border-radius: 3px; background: var(--tbs-page); }
.tbs-vb__layout-ico b { position: absolute; height: 10px; border-radius: 2px; background: var(--tbs-sun-a); }
.tbs-vb__layout-ico--center b { left: 5px; right: 5px; top: 15px; }
.tbs-vb__layout-ico--top b { left: 5px; right: 5px; top: 5px; }
.tbs-vb__layout-ico--bottom b { left: 5px; right: 5px; bottom: 5px; }
.tbs-vb__layout-ico--left b { left: 3px; width: 14px; top: 15px; }
.tbs-vb__layout-ico--right b { right: 3px; width: 14px; top: 15px; }

/* Colours */
.tbs-vb__colors { display: flex; flex-wrap: wrap; gap: 8px; }
.tbs-vb__color { position: relative; width: 32px; height: 32px; padding: 0; border: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(36,39,42,.18); cursor: pointer; }
.tbs-vb__color.is-selected { box-shadow: inset 0 0 0 1px rgba(36,39,42,.18), 0 0 0 2px #fff, 0 0 0 4px var(--tbs-sun-a); }
.tbs-vb__color--custom { display: inline-flex; align-items: center; justify-content: center; background: conic-gradient(#F0633E, #F09C37, #E9B44C, #2F5D46, #1F3A5F, #8A2A12, #F0633E); color: #fff; font-weight: 800; overflow: hidden; }
.tbs-vb__color--custom input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.tbs-vb__color--custom span { text-shadow: 0 1px 2px rgba(0,0,0,.5); }

.tbs-vb__toggle { display: flex; align-items: center; gap: 8px; margin-top: 16px; font-size: 14px; font-weight: 600; cursor: pointer; }
.tbs-vb__toggle input { width: 18px; height: 18px; accent-color: var(--tbs-ink); }

/* Size & frame cards */
.tbs-vb__cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.tbs-vb__card {
	display: flex; flex-direction: column; align-items: center; gap: 3px; padding: 12px 6px; border: 1px solid var(--tbs-line); border-radius: 14px;
	background: #fff; color: var(--tbs-ink); font-family: var(--tbs-sans); cursor: pointer; text-align: center;
	transition: border-color .2s, box-shadow .2s;
}
.tbs-vb__card strong { font-size: 13.5px; }
.tbs-vb__card small { font-size: 11px; color: var(--tbs-muted); }
.tbs-vb__card em { font-style: normal; font-size: 12.5px; font-weight: 800; color: var(--tbs-accent-text); }
.tbs-vb__card:hover { border-color: var(--tbs-line-strong); }
.tbs-vb__card.is-selected { border-color: var(--tbs-sun-a); box-shadow: 0 0 0 3px rgba(240,99,62,.15); }
.tbs-vb__paper { display: block; margin-bottom: 6px; border-radius: 2px; background: var(--tbs-page); box-shadow: inset 0 0 0 1px var(--tbs-line-strong); }
.tbs-vb__frame-swatch { display: block; width: 44px; height: 54px; margin-bottom: 6px; box-sizing: border-box; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.tbs-vb__frame-swatch::after { content: ""; display: block; width: 100%; height: 100%; border-radius: var(--tbs-fr-in, 0); background: #F6EFE2; }
.tbs-vb__frame-photo { display: block; width: 64px; height: 64px; margin-bottom: 6px; overflow: hidden; border-radius: 6px; box-shadow: 0 2px 6px rgba(0,0,0,.18); }
.tbs-vb__frame-photo img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }

/* Review */
.tbs-vb__checks { display: grid; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tbs-vb__checks li { display: flex; gap: 10px; padding: 12px; border-radius: 12px; font-size: 13px; color: var(--tbs-muted); }
.tbs-vb__checks li span { display: flex; flex-direction: column; gap: 2px; }
.tbs-vb__checks li strong { color: var(--tbs-ink); font-size: 13.5px; }
.tbs-vb__checks li svg { flex: 0 0 auto; margin-top: 1px; }
.tbs-vb__checks .is-ok { background: #EEF8F1; }
.tbs-vb__checks .is-ok svg { color: #1E6B3A; }
.tbs-vb__checks .is-warn { background: #FFF6E3; }
.tbs-vb__checks .is-warn svg { color: #8A5A00; }
.tbs-vb__checks .is-bad { background: #FDECEC; }
.tbs-vb__checks .is-bad svg { color: #A1201A; }
.tbs-vb__ack { display: flex; gap: 10px; align-items: flex-start; width: 100%; margin-top: 12px; padding: 12px; border: 1px solid #F5C9A8; border-radius: 12px; background: #FFF6EE; font: 600 13.5px/1.45 var(--tbs-sans); color: var(--tbs-ink); text-align: left; cursor: pointer; }
.tbs-vb__ack[hidden] { display: none; }
.tbs-vb__ack i { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; margin-top: 1px; border: 2px solid var(--tbs-line-strong); border-radius: 6px; background: #fff; color: transparent; }
.tbs-vb__ack[aria-checked="true"] { border-color: var(--tbs-ink); background: #fff; }
.tbs-vb__ack[aria-checked="true"] i { border-color: var(--tbs-ink); background: var(--tbs-ink); color: #fff; }
.tbs-vb__summary { display: grid; gap: 8px; margin-top: 18px; padding: 14px; border-radius: 14px; background: var(--tbs-page-soft); font-size: 14px; }
.tbs-vb__summary div { display: flex; justify-content: space-between; gap: 12px; }
.tbs-vb__summary .is-total { padding-top: 8px; border-top: 1px solid var(--tbs-line); font-weight: 800; font-size: 16px; }
.tbs-vb__qty { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; }
.tbs-vb__qty .tbs-vb__label { margin: 0; }
.tbs-vb__stepper { display: inline-flex; align-items: center; border: 1px solid var(--tbs-line-strong); border-radius: 12px; overflow: hidden; }
.tbs-vb__stepper button { width: 40px; height: 40px; border: 0; background: #fff; font-size: 18px; cursor: pointer; }
.tbs-vb__stepper button:hover { background: var(--tbs-page-soft); }
.tbs-vb__stepper output { min-width: 36px; text-align: center; font-weight: 800; }

/* Stage ------------------------------------------------------------------ */
.tbs-vb__stage {
	grid-area: stage; display: flex; flex-direction: column; min-width: 0; padding: 18px 24px 8px;
	background:
		radial-gradient(circle at 1px 1px, rgba(36,39,42,.07) 1px, transparent 0) 0 0 / 18px 18px,
		var(--tbs-page-soft);
}
.tbs-vb__stage-top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 14px; font-size: 13px; font-weight: 700; color: var(--tbs-muted); }
.tbs-vb__quality-chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 12px; border-radius: 999px; font-size: 12.5px; }
.tbs-vb__quality-chip.is-ok { background: #E7F6EC; color: #1E6B3A; }
.tbs-vb__quality-chip.is-warn { background: #FFF4DE; color: #8A5A00; }
.tbs-vb__quality-chip.is-bad { background: #FDE8E8; color: #A1201A; }
.tbs-vb__canvas-area { flex: 1 1 auto; display: flex; align-items: center; justify-content: center; min-height: 300px; }
.tbs-vb__frame { position: relative; display: inline-block; line-height: 0; box-shadow: 0 22px 44px rgba(36,39,42,.28), 0 4px 10px rgba(36,39,42,.18); }
.tbs-vb__frame::before, .tbs-vb-modal__frame::before { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: var(--tbs-fr-in, 0); box-shadow: inset 0 0 0 1px rgba(0,0,0,.28), inset 0 2px 5px rgba(0,0,0,.22); pointer-events: none; }
.tbs-vb__frame canvas, .tbs-vb-modal__frame img { border-radius: var(--tbs-fr-in, 0); }
.tbs-vb__canvas { display: block; touch-action: none; box-shadow: 0 0 0 1px rgba(0,0,0,.2), inset 0 0 6px rgba(0,0,0,.3); }
.tbs-vb__canvas:focus-visible { outline: 3px solid var(--tbs-sun-b); outline-offset: 3px; }
.tbs-vb__canvas.is-dragging { cursor: grabbing !important; }

/* Bottom bar */
.tbs-vb__bar { grid-area: bar; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 14px 24px; border-top: 1px solid var(--tbs-line); background: #fff; }
.tbs-vb__bar-price { display: flex; flex-direction: column; }
.tbs-vb__price { font-size: 24px; font-weight: 800; color: var(--tbs-ink); }
.tbs-vb__bar-meta { font-size: 13px; color: var(--tbs-muted); }
.tbs-vb__bar-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.tbs-vb__bar .tbs-btn, .tbs-vb-modal .tbs-btn { min-height: 50px; }
.tbs-vb__buy-btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.tbs-vb__buy-btn.is-busy { opacity: .85; cursor: progress; }

/* Toast */
.tbs-vb__toast {
	position: fixed; left: 50%; top: 50%; z-index: 1001; transform: translate(-50%, -50%);
	display: flex; flex-direction: column; gap: 6px; width: min(440px, calc(100% - 32px)); padding: 16px 18px; border-radius: 16px;
	background: var(--tbs-ink); color: #fff; font-size: 14px; box-shadow: 0 18px 40px rgba(0,0,0,.3);
	animation: tbsVbUp .3s var(--tbs-ease);
}
.tbs-vb__toast[hidden] { display: none; }
.tbs-vb__toast.is-error { background: #8F1D17; }
.tbs-vb__toast strong { display: flex; align-items: center; gap: 8px; font-size: 15px; }
.tbs-vb__toast-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.tbs-vb__toast .tbs-btn { min-height: 42px; padding: 0 18px; font-size: 14px; }
@keyframes tbsVbUp { from { opacity: 0; transform: translate(-50%, calc(-50% + 10px)); } }
.tbs-vb__toast.is-modal { align-items: center; gap: 10px; padding: 24px 22px; text-align: center; }
.tbs-vb__toast.is-modal .tbs-vb__toast-actions { justify-content: center; }
.tbs-vb__toast-busy { gap: 12px !important; }
.tbs-vb__spin { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.3); border-top-color: #fff; border-radius: 50%; animation: tbsVbSpin .8s linear infinite; }
@keyframes tbsVbSpin { to { transform: rotate(360deg); } }
.tbs-vb__scrim { position: fixed; inset: 0; z-index: 1000; background: rgba(20,22,24,.45); animation: tbsVbFade .2s ease; }
.tbs-vb__scrim[hidden] { display: none; }
@keyframes tbsVbFade { from { opacity: 0; } }

/* Preview modal ---------------------------------------------------------- */
.tbs-vb-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.tbs-vb-modal[hidden] { display: none; }
.tbs-vb-modal__backdrop { position: absolute; inset: 0; background: rgba(18,20,22,.72); backdrop-filter: blur(4px); }
.tbs-vb-modal__box { position: relative; display: flex; flex-direction: column; width: min(1000px, 100%); max-height: calc(100vh - 40px); overflow: auto; border-radius: 22px; background: #fff; box-shadow: 0 30px 80px rgba(0,0,0,.4); }
.tbs-vb-modal__close { position: absolute; top: 12px; right: 12px; z-index: 2; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: rgba(255,255,255,.9); cursor: pointer; }
.tbs-vb-modal__title { margin: 0; padding: 20px 24px 0; font-size: 26px; }
.tbs-vb-modal__wall {
	display: flex; align-items: center; justify-content: center; margin: 16px 24px 0; padding: 48px 24px 64px; border-radius: 16px;
	background:
		radial-gradient(ellipse at 50% 0%, rgba(255,240,215,.9), rgba(255,240,215,0) 60%),
		linear-gradient(180deg, #EFE8DD 0%, #E6DDCF 78%, #CDBFA9 78.4%, #D9CCB7 100%);
}
.tbs-vb-modal__frame { position: relative; height: min(52vh, 460px); line-height: 0; box-shadow: 0 30px 50px rgba(60,40,20,.35), 0 8px 14px rgba(60,40,20,.25); }
.tbs-vb-modal__frame.is-landscape { height: auto; width: min(80%, 620px); }
.tbs-vb-modal__frame img { display: block; width: 100%; height: 100%; object-fit: cover; box-shadow: inset 0 0 0 1px rgba(0,0,0,.2); }
.tbs-vb-modal__info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 16px 24px 0; font-size: 14px; }
.tbs-vb-modal__info p { margin: 0; }
.tbs-vb-modal__quality { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.tbs-vb-modal__quality.is-ok { color: #1E6B3A; }
.tbs-vb-modal__quality.is-warn { color: #8A5A00; }
.tbs-vb-modal__quality.is-bad { color: #A1201A; }
.tbs-vb-modal__price { margin-left: auto !important; font-size: 24px; font-weight: 800; }
.tbs-vb-modal__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 16px 24px 22px; }

/* Responsive ------------------------------------------------------------- */
@media (max-width: 1100px) {
	.tbs-vb__app { grid-template-columns: 76px 300px minmax(0, 1fr); }
	.tbs-vb__panel { padding: 18px; }
}
@media (max-width: 899px) {
		.tbs-vb { border-radius: 18px; }
	.tbs-vb__app {
		grid-template-columns: minmax(0, 1fr);
		grid-template-rows: auto auto auto auto;
		grid-template-areas: "stage" "rail" "panel" "bar";
		min-height: 0;
	}
	.tbs-vb__stage { padding: 14px 14px 4px; }
	.tbs-vb__rail { flex-direction: row; overflow-x: auto; padding: 6px; gap: 2px; position: sticky; top: 0; z-index: 3; }
	.tbs-vb__tab { flex: 1 1 0; min-width: 0; padding: 8px 2px; font-size: 10.5px; }
	.tbs-vb__tab.is-active { box-shadow: inset 0 -3px 0 var(--tbs-sun-b); }
	.tbs-vb__panels { max-height: none; border-right: 0; }
	.tbs-vb__bar { position: sticky; bottom: 0; z-index: 3; padding: 12px 14px; box-shadow: 0 -8px 20px rgba(36,39,42,.08); }
	.tbs-vb__bar-actions { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1.6fr; }
	.tbs-vb__price { font-size: 20px; }
	.tbs-vb-modal { padding: 0; align-items: flex-end; }
	.tbs-vb-modal__box { border-radius: 22px 22px 0 0; max-height: 94vh; }
	.tbs-vb-modal__wall { margin: 12px 12px 0; padding: 28px 12px 40px; }
	.tbs-vb-modal__frame { height: min(46vh, 380px); }
	.tbs-vb-modal__actions { display: grid; grid-template-columns: 1fr 1.4fr; padding: 14px 12px 18px; }
}
@media (prefers-reduced-motion: reduce) {
	.tbs-vb-loading, .tbs-vb__toast { animation: none; }
}
.tbs-vb__panel-title { margin-top: 0 !important; }

/* Languages and fonts */
.tbs-vb__langs button { font-size: 14px; }
.tbs-vb__sublabel { margin: 12px 0 6px; font-size: 11.5px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--tbs-muted); }
.tbs-vb__fontgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tbs-vb__font {
	display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 64px; padding: 8px 6px;
	border: 1px solid var(--tbs-line); border-radius: 12px; background: #fff; color: var(--tbs-ink); cursor: pointer; overflow: hidden;
	transition: border-color .2s, box-shadow .2s;
}
.tbs-vb__font span { line-height: 1.15; white-space: nowrap; }
.tbs-vb__font small { font: 600 11px var(--tbs-sans); color: var(--tbs-muted); }
.tbs-vb__font:hover { border-color: var(--tbs-line-strong); }
.tbs-vb__font.is-selected { border-color: var(--tbs-sun-a); box-shadow: 0 0 0 3px rgba(240,99,62,.15); }
.tbs-vb__chips[lang="ml"] .tbs-vb__chip { font-family: var(--tbs-sans), "Noto Sans Malayalam", sans-serif; font-weight: 600; font-size: 13px; }
.tbs-vb__chips[lang="hi"] .tbs-vb__chip { font-family: var(--tbs-sans), "Hind", sans-serif; font-weight: 600; font-size: 13.5px; padding-top: 2px; }

/* Font dropdown with previews */
.tbs-vb__dd { position: relative; }
.tbs-vb__dd-btn {
	display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 10px; width: 100%; min-height: 56px; padding: 8px 14px;
	border: 1px solid var(--tbs-line-strong); border-radius: 12px; background: #fff; color: var(--tbs-ink); cursor: pointer; text-align: left;
}
.tbs-vb__dd-btn:hover, .tbs-vb__dd.is-open .tbs-vb__dd-btn { border-color: var(--tbs-sun-b); }
.tbs-vb__dd.is-open .tbs-vb__dd-btn { box-shadow: 0 0 0 3px rgba(240,156,55,.2); }
.tbs-vb__dd-sample { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.3; font-family: var(--tbs-sans); font-size: 15px; }
.tbs-vb__dd-name { font: 700 11.5px var(--tbs-sans); color: var(--tbs-muted); white-space: nowrap; }
.tbs-vb__dd-list {
	position: absolute; z-index: 20; left: 0; right: 0; top: calc(100% + 6px); max-height: 380px; overflow-y: auto; padding: 6px;
	border: 1px solid var(--tbs-line); border-radius: 14px; background: #fff; box-shadow: 0 18px 40px rgba(36,39,42,.18); outline: none;
	overscroll-behavior: contain;
}
.tbs-vb__dd-group { position: sticky; top: -6px; z-index: 1; margin: 0; padding: 8px 10px 6px; background: #fff; font-size: 11px; font-weight: 800; letter-spacing: 1px; text-transform: uppercase; color: var(--tbs-muted); }
.tbs-vb__opt {
	display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 10px; min-height: 48px; padding: 6px 10px;
	border-radius: 10px; cursor: pointer; outline: none;
}
.tbs-vb__opt-sample { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; line-height: 1.35; color: var(--tbs-ink); }
.tbs-vb__opt small { font: 600 11px var(--tbs-sans); color: var(--tbs-muted); white-space: nowrap; }
.tbs-vb__opt:hover, .tbs-vb__opt:focus { background: var(--tbs-warm); }
.tbs-vb__opt.is-selected { background: var(--tbs-page); box-shadow: inset 3px 0 0 var(--tbs-sun-a); }
.tbs-vb__opt--same .tbs-vb__opt-sample { font: 600 14px var(--tbs-sans); color: var(--tbs-muted); }

/* Formatting bar under the board */
.tbs-vb__stage-inner { display: flex; flex-direction: column; min-width: 0; }
@media (min-width: 900px) {
	.tbs-vb__stage-inner { position: sticky; top: 12px; }
	.admin-bar .tbs-vb__stage-inner { top: 44px; }
}
.tbs-vb__canvas-area { position: relative; flex-direction: column; justify-content: flex-start; min-height: 0; }
.tbs-vb__fmt {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; width: 100%; max-width: 760px; margin: 14px auto 4px; padding: 8px;
	border-radius: 14px; background: #fff; box-shadow: 0 6px 20px rgba(36,39,42,.1), 0 0 0 1px rgba(36,39,42,.06);
}
.tbs-vb__fmt.is-sel { box-shadow: 0 6px 20px rgba(36,39,42,.1), 0 0 0 2px var(--tbs-sun-b); }
.tbs-vb__fmt-target { padding: 0 4px; font: 800 11px var(--tbs-sans); letter-spacing: .6px; text-transform: uppercase; color: var(--tbs-muted); white-space: nowrap; }
.tbs-vb__fmt.is-sel .tbs-vb__fmt-target { color: var(--tbs-accent-text); }
.tbs-vb__fmt-size { display: inline-flex; align-items: center; border: 1px solid var(--tbs-line-strong); border-radius: 10px; overflow: hidden; }
.tbs-vb__fmt-size button { width: 36px; height: 38px; border: 0; background: #fff; font: 800 15px var(--tbs-serif); color: var(--tbs-ink); cursor: pointer; }
.tbs-vb__fmt-size button sup { font-size: 11px; }
.tbs-vb__fmt-size button:hover { background: var(--tbs-warm); }
.tbs-vb__fmt-size output { min-width: 44px; text-align: center; font: 700 12.5px var(--tbs-sans); }
.tbs-vb__fmt-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--tbs-line-strong); border-radius: 10px; background: #fff; color: var(--tbs-ink); cursor: pointer; }
.tbs-vb__fmt-btn:hover { background: var(--tbs-warm); }
.tbs-vb__fmt-bold b { font: 900 18px var(--tbs-serif); }
.tbs-vb__fmt-bold.is-on { background: var(--tbs-ink); border-color: var(--tbs-ink); color: #fff; }
.tbs-vb__fmt-colors { display: inline-flex; align-items: center; gap: 5px; }
.tbs-vb__fmt-colors .tbs-vb__color { width: 26px; height: 26px; }
.tbs-vb__fmt-done { height: 40px; padding: 0 16px; border: 0; border-radius: 10px; background: var(--tbs-ink); color: #fff; font: 800 13px var(--tbs-sans); cursor: pointer; }
.tbs-vb__fmt-done[hidden] { display: none; }
.tbs-vb__fonts {
	display: flex; gap: 6px; flex: 1 1 100%; min-width: 0; overflow-x: auto; padding: 2px 2px 6px; scroll-behavior: smooth;
	scrollbar-width: thin; overscroll-behavior-x: contain;
}
.tbs-vb__fchip {
	flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-width: 88px; height: 56px; padding: 4px 12px;
	border: 1px solid var(--tbs-line); border-radius: 10px; background: #fff; color: var(--tbs-ink); cursor: pointer;
}
.tbs-vb__fchip span { line-height: 1.25; white-space: nowrap; }
.tbs-vb__fchip small { font: 600 10.5px var(--tbs-sans); color: var(--tbs-muted); white-space: nowrap; }
.tbs-vb__fchip:hover { border-color: var(--tbs-line-strong); background: var(--tbs-warm); }
.tbs-vb__fchip.is-selected { border-color: var(--tbs-sun-a); box-shadow: 0 0 0 2px rgba(240,99,62,.25); }
@media (min-width: 900px) and (max-width: 1199px) {
	.tbs-vb__fmt-target { display: none; }
	.tbs-vb__fmt-colors .tbs-vb__color { width: 24px; height: 24px; }
}
@media (max-width: 599px) {
	.tbs-vb__fmt-target { flex: 1 1 100%; text-align: center; }
}

/* Step panels */
.tbs-vb__panel-title { display: flex; align-items: center; gap: 10px; margin: 0 0 16px; font-size: 20px; }
.tbs-vb__panel-title span { display: inline-flex; align-items: center; justify-content: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tbs-warm); color: var(--tbs-accent-text); font: 800 13px var(--tbs-sans); }
.tbs-vb__next { display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; margin-top: 22px; }
.tbs-vb__order { width: 100%; margin-top: 16px; }
.tbs-vb__label small { font-weight: 600; text-transform: none; letter-spacing: 0; color: var(--tbs-muted); }

/* Rotate button on the stage */
.tbs-vb__stage-tools { display: inline-flex; align-items: center; gap: 8px; }
.tbs-vb__rotate { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 12px; border: 1px solid var(--tbs-line-strong); border-radius: 999px; background: #fff; font: 700 12.5px var(--tbs-sans); color: var(--tbs-ink); cursor: pointer; }
.tbs-vb__rotate:hover { border-color: var(--tbs-sun-b); background: var(--tbs-warm); }
.tbs-vb__sizes { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.tbs-vb__sizes .tbs-vb__card { justify-content: flex-end; }

/* Board zoom */
.tbs-vb__viewport { display: flex; width: 100%; overflow: auto; overscroll-behavior: contain; }
.tbs-vb__viewport .tbs-vb__frame { flex: none; margin: auto; }
.tbs-vb__viewport.is-zoomed { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--tbs-line); }
.tbs-vb__zoom { display: inline-flex; align-items: center; border: 1px solid var(--tbs-line-strong); border-radius: 999px; background: #fff; overflow: hidden; }
.tbs-vb__zoom button { display: inline-flex; align-items: center; justify-content: center; min-width: 34px; height: 32px; padding: 0 6px; border: 0; background: transparent; color: var(--tbs-ink); cursor: pointer; }
.tbs-vb__zoom button:hover { background: var(--tbs-warm); }
.tbs-vb__zoom .tbs-vb__zoom-val { min-width: 50px; font: 700 12.5px var(--tbs-sans); }

/* Reference link */
.tbs-vb__reflink { margin-top: 10px; }
.tbs-vb__refopts[hidden] { display: none; }
.tbs-vb__refopts .tbs-vb__label { margin-top: 12px; }
@media (max-width: 599px) {
	.tbs-vb__stage-tools { flex-wrap: wrap; gap: 6px; }
	.tbs-vb__rotate span { display: none; }
	.tbs-vb__rotate { padding: 0 9px; }
	.tbs-vb__quality-chip { white-space: nowrap; }
	.tbs-vb__zoom button { min-width: 30px; }
	.tbs-vb__zoom .tbs-vb__zoom-val { min-width: 44px; }
}
.tbs-vb__fmt .tbs-vb__fmt-els { display: inline-flex; width: auto; padding: 3px; }
.tbs-vb__fmt .tbs-vb__fmt-els[hidden] { display: none; }
.tbs-vb__fmt .tbs-vb__fmt-els button { min-height: 34px; padding: 0 12px; font-size: 12.5px; }
.tbs-vb__fmt-target[hidden] { display: none; }
