/* Hast Rekha AI */
.bdp {
	--maroon: #5b1212; --orange: #fb4d14; --ink: #241a15; --muted: #6b5f58; --line: #efe2d6; --cream: #fdf6ee;
	max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; color: var(--ink);
	font-family: "Roboto", "Poppins", Arial, sans-serif;
}
.bdp *, .bdp *::before, .bdp *::after { box-sizing: border-box; }
.bdp h1, .bdp h2, .bdp h3 { font-family: "Lora", Georgia, serif; color: var(--maroon); margin: 0; }
.bdp p { margin: 0; }
.bdp [hidden] { display: none !important; }
.bdp-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 18px; box-shadow: 0 2px 10px rgba(90, 50, 20, .05); }
.bdp-card h2 { font-size: 19px; margin-bottom: 10px; }
.bdp-note { font-size: 13px; color: var(--muted); margin-top: 6px; line-height: 1.5; }
.bdp-kicker { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 13px; color: var(--orange); background: #fff0e8; padding: 6px 12px; border-radius: 999px; }
.bdp-kicker svg { width: 18px; height: 18px; }
.bdp-chip { display: inline-block; padding: 4px 10px; border-radius: 999px; background: #fff0e8; color: var(--orange); font-size: 12px; font-weight: 600; }

/* buttons */
.bdp-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.bdp-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 0 18px;
	border-radius: 12px; border: 1px solid transparent; font: 500 15px "Roboto", Arial, sans-serif; cursor: pointer; text-decoration: none;
}
.bdp-btn svg { width: 20px; height: 20px; }
.bdp-btn--primary { background: linear-gradient(90deg, #fd5a1e, #fb3d10); color: #fff; box-shadow: 0 4px 12px rgba(251, 61, 16, .25); }
.bdp-btn--primary:hover { filter: brightness(1.05); }
.bdp-btn--primary:disabled { opacity: .6; cursor: wait; }
.bdp-btn--ghost { background: #fff; color: var(--maroon); border-color: #ead8ca; }
.bdp-btn--ghost:hover { background: #fff7f0; }
.bdp-btn--danger { background: #fff; color: #c92a2a; border-color: #f3c9c9; }

/* intro */
.bdp-intro { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; align-items: start; }
.bdp-intro__head { grid-column: 1 / -1; text-align: center; max-width: 720px; margin: 0 auto 6px; }
.bdp-intro__head h1 { font-size: clamp(28px, 4vw, 40px); margin: 12px 0 8px; }
.bdp-intro__head p { color: var(--muted); font-size: 16px; line-height: 1.55; }
.bdp-hands { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.bdp-hands button {
	display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 8px; border-radius: 14px;
	border: 2px solid #eee2d8; background: var(--cream); cursor: pointer; color: var(--maroon); font: inherit;
}
.bdp-hands svg { width: 58px; height: 58px; color: #c47a4a; }
.bdp-hands strong { font-size: 16px; }
.bdp-hands span { font-size: 12px; color: var(--muted); }
.bdp-hands [aria-checked="true"] { border-color: var(--orange); background: #fff1e8; box-shadow: 0 0 0 3px rgba(251, 77, 20, .12); }
.bdp-hands [aria-checked="true"] svg { color: var(--orange); }
.bdp-choose h2 + .bdp-hands { margin-top: 4px; }
.bdp-choose h2:not(:first-child) { margin-top: 20px; }
.bdp-actions .bdp-btn { flex: 1 1 200px; }
.bdp-qr { display: flex; gap: 14px; align-items: center; margin-top: 16px; padding: 12px; border-radius: 12px; background: var(--cream); }
.bdp-qr__code { width: 112px; height: 112px; flex: none; background: #fff; border-radius: 8px; padding: 4px; }
.bdp-qr__code svg { width: 100%; height: 100%; display: block; }
.bdp-qr strong { color: var(--maroon); }
.bdp-qr p { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.45; }
.bdp-tips ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.bdp-tips li { display: flex; gap: 10px; font-size: 14.5px; line-height: 1.4; }
.bdp-tips b { flex: none; width: 30px; height: 30px; display: grid; place-items: center; background: var(--cream); border-radius: 8px; }
.bdp-privacy { grid-column: 1 / -1; background: #f3faf5; border: 1px solid #cfe9d8; border-radius: 14px; padding: 14px 16px; font-size: 13.5px; line-height: 1.55; color: #24543a; }
.bdp-privacy strong { display: block; margin-bottom: 2px; }

/* permission sheet */
.bdp-sheet { position: fixed; inset: 0; z-index: 1200; background: rgba(20, 10, 5, .55); display: flex; align-items: flex-end; justify-content: center; padding: 16px; }
.bdp-sheet__box { width: min(460px, 100%); background: #fff; border-radius: 20px; padding: 22px; text-align: center; animation: bdp-up .25s ease; }
.bdp-sheet__ico { font-size: 40px; }
.bdp-sheet__box h2 { font-size: 21px; margin: 6px 0 8px; }
.bdp-sheet__box p { color: var(--muted); font-size: 14.5px; line-height: 1.5; }
@keyframes bdp-up { from { transform: translateY(30px); opacity: 0; } }
@media (min-width: 760px) { .bdp-sheet { align-items: center; } }

/* camera */
.bdp-cam { position: fixed; inset: 0; z-index: 1100; background: #000; color: #fff; }
body.bdp-cam-open { overflow: hidden; }
body.bdp-cam-open .bd-bottomnav { display: none; }
.bdp-cam video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.bdp-cam video.is-mirrored { transform: scaleX(-1); }
.bdp-guide { position: absolute; left: 50%; top: 46%; width: min(78vw, 62vh); height: min(78vw, 62vh); transform: translate(-50%, -50%); color: rgba(255, 255, 255, .9); filter: drop-shadow(0 0 6px rgba(0, 0, 0, .6)); pointer-events: none; }
.bdp-guide use { stroke-dasharray: 2.2 1.6; }
.bdp-guide.is-flipped { transform: translate(-50%, -50%) scaleX(-1); }
.bdp-cam__top { position: absolute; left: 0; right: 0; top: 0; display: flex; align-items: center; justify-content: space-between; padding: calc(12px + env(safe-area-inset-top)) 14px 12px; background: linear-gradient(rgba(0, 0, 0, .55), transparent); }
.bdp-cam__hand { font-size: 13px; font-weight: 500; background: rgba(0, 0, 0, .35); padding: 6px 12px; border-radius: 999px; }
.bdp-round { width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(0, 0, 0, .4); color: #fff; display: grid; place-items: center; cursor: pointer; }
.bdp-round svg { width: 22px; height: 22px; }
.bdp-cam__tip { position: absolute; left: 50%; bottom: calc(120px + env(safe-area-inset-bottom)); transform: translateX(-50%); width: max-content; max-width: 92vw; text-align: center; font-size: 14px; padding: 8px 14px; border-radius: 12px; background: rgba(0, 0, 0, .5); }
.bdp-cam__tip.is-warn { background: rgba(201, 42, 42, .8); }
.bdp-cam__bar { position: absolute; left: 0; right: 0; bottom: 0; display: flex; justify-content: center; padding: 18px 0 calc(22px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, rgba(0, 0, 0, .6)); }
.bdp-shutter { width: 74px; height: 74px; border-radius: 50%; border: 5px solid #fff; background: rgba(255, 255, 255, .25); cursor: pointer; }
.bdp-shutter:active { background: #fff; }

/* stage / canvases */
.bdp-stage { margin-top: 12px; border-radius: 12px; overflow: hidden; background: #f4ece5; display: grid; place-items: center; }
.bdp-stage canvas { display: block; max-width: 100%; max-height: 70vh; width: auto; height: auto; }
.bdp-preview .bdp-card, .bdp-progress .bdp-card, .bdp-fail .bdp-card { max-width: 640px; margin: 0 auto; }

/* progress */
.bdp-progress .bdp-card { text-align: center; padding: 28px 22px; }
.bdp-spinner { width: 54px; height: 54px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid #fde3d6; border-top-color: var(--orange); animation: bdp-spin 1s linear infinite; }
@keyframes bdp-spin { to { transform: rotate(360deg); } }
.bdp-steps { list-style: none; padding: 0; margin: 16px auto 0; max-width: 380px; text-align: left; display: grid; gap: 10px; }
.bdp-steps li { position: relative; padding-left: 30px; font-size: 14.5px; color: #a0928a; }
.bdp-steps li::before { content: ""; position: absolute; left: 0; top: 1px; width: 18px; height: 18px; border-radius: 50%; border: 2px solid #e7d9cf; }
.bdp-steps li.is-active { color: var(--ink); font-weight: 500; }
.bdp-steps li.is-active::before { border-color: var(--orange); border-top-color: transparent; animation: bdp-spin .8s linear infinite; }
.bdp-steps li.is-done { color: #2b8a3e; }
.bdp-steps li.is-done::before { border-color: #2b8a3e; background: #2b8a3e; }
.bdp-steps li.is-done::after { content: "✓"; position: absolute; left: 5px; top: 0; color: #fff; font-size: 12px; font-weight: 700; }

/* fail */
.bdp-issues { margin: 12px 0 0; padding: 0; list-style: none; display: grid; gap: 8px; }
.bdp-issues li { background: #fff4ec; border: 1px solid #fbd9c4; color: #8a3a12; border-radius: 10px; padding: 10px 12px; font-size: 14.5px; line-height: 1.45; }
.bdp-issues li::before { content: "⚠️ "; }

/* result */
.bdp-result__grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 18px; align-items: start; }
.bdp-result__visual { position: sticky; top: 96px; }
.bdp-result__title { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.bdp-result__title h2 { margin: 0; }
.bdp-nophoto { padding: 26px 16px; text-align: center; color: var(--muted); font-size: 14px; }
.bdp-layers { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.bdp-layer { display: inline-flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px; border: 1px solid #eadfd6; background: #fff; font: 500 13px "Roboto", Arial, sans-serif; color: #6b5f58; cursor: pointer; }
.bdp-layer i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); opacity: .35; }
.bdp-layer small { font-size: 11px; color: #9a8c84; }
.bdp-layer.is-on { border-color: var(--c); color: var(--ink); background: color-mix(in srgb, var(--c) 8%, #fff); }
.bdp-layer.is-on i { opacity: 1; }
.bdp-layer:disabled { opacity: .5; cursor: not-allowed; text-decoration: line-through; }
.bdp-actions--wrap .bdp-btn { flex: 1 1 120px; min-height: 42px; font-size: 14px; padding: 0 12px; }
.bdp-saved { margin-top: 12px; padding: 12px; background: #f3faf5; border: 1px solid #cfe9d8; border-radius: 12px; font-size: 13.5px; color: #24543a; }
.bdp-saved__row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.bdp-saved__row input { flex: 1 1 200px; min-width: 0; height: 40px; border: 1px solid #cfe9d8; border-radius: 10px; padding: 0 10px; font-size: 13px; }
.bdp-saved__row .bdp-btn { min-height: 40px; flex: none; }

.bdp-result__text { display: grid; gap: 14px; }
.bdp-overall p { font-size: 15px; line-height: 1.6; }
.bdp-overall p + p { margin-top: 8px; }
.bdp-insights { display: grid; gap: 12px; }
.bdp-insight { border-left: 4px solid var(--c); }
.bdp-insight header { display: flex; align-items: center; gap: 10px; }
.bdp-insight header i { width: 12px; height: 12px; border-radius: 50%; background: var(--c); flex: none; }
.bdp-insight header div { flex: 1; }
.bdp-insight h3 { font-size: 17px; }
.bdp-insight header span { font-size: 12.5px; color: var(--muted); }
.bdp-conf { font-size: 13px; color: var(--c); }
.bdp-conf.is-off { color: #9a8c84; font-weight: 500; }
.bdp-bar { height: 5px; border-radius: 3px; background: #f1e8e1; margin: 10px 0 2px; overflow: hidden; }
.bdp-bar span { display: block; height: 100%; background: var(--c); border-radius: 3px; }
.bdp-insight p { margin-top: 10px; font-size: 14.5px; line-height: 1.55; }
.bdp-insight ul { margin: 8px 0 0; padding-left: 18px; display: grid; gap: 6px; font-size: 14px; line-height: 1.55; color: #3c322c; }
.bdp-insight.is-missing { border-left-color: #ddd; background: #fcfaf8; }
.bdp-insight.is-missing p { color: var(--muted); }
.bdp-mounts summary { cursor: pointer; font: 600 16px "Lora", Georgia, serif; color: var(--maroon); }
.bdp-mounts ul { margin: 12px 0 0; padding-left: 18px; display: grid; gap: 8px; font-size: 14px; line-height: 1.5; }

.bdp-ask__log { display: flex; flex-direction: column; gap: 8px; max-height: 340px; overflow-y: auto; margin-top: 10px; }
.bdp-ask__log:empty { display: none; }
.bdp-msg { max-width: 88%; padding: 10px 12px; border-radius: 14px; font-size: 14.5px; line-height: 1.5; }
.bdp-msg--me { align-self: flex-end; background: var(--maroon); color: #fff; border-bottom-right-radius: 4px; }
.bdp-msg--ai { align-self: flex-start; background: var(--cream); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.bdp-msg.is-typing { color: var(--muted); }
.bdp-ask__chips { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.bdp-ask__chips button { border: 1px solid #ead8ca; background: #fff; color: var(--maroon); border-radius: 999px; padding: 7px 12px; font: 13px "Roboto", Arial, sans-serif; cursor: pointer; }
.bdp-ask__chips button:hover { background: #fff5ee; }
.bdp-ask__form { display: flex; gap: 8px; margin-top: 12px; }
.bdp-ask__form input { flex: 1; min-width: 0; height: 46px; border: 1px solid #ead8ca; border-radius: 12px; padding: 0 12px; font-size: 16px; }
.bdp-ask__form input:focus { outline: 0; border-color: var(--orange); box-shadow: 0 0 0 3px rgba(251, 77, 20, .12); }
.bdp-disclaimer { font-size: 12.5px; color: var(--muted); line-height: 1.55; padding: 0 4px; }

.bdp-toast { position: fixed; z-index: 1300; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom)); transform: translateX(-50%); max-width: min(92vw, 440px); padding: 11px 16px; border-radius: 12px; background: #2a1712; color: #fff; font-size: 14px; text-align: center; box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }

@media (max-width: 900px) {
	.bdp-intro, .bdp-result__grid { grid-template-columns: 1fr; }
	.bdp-result__visual { position: static; }
}
@media (max-width: 520px) {
	.bdp { padding-top: 16px; }
	.bdp-card { padding: 15px; border-radius: 14px; }
	.bdp-intro__head p { font-size: 15px; }
}
