/* Niltar AI Bespoke Fabric Designer - light luxury theme */
.nabd, .nabd * { box-sizing: border-box; }
.nabd [hidden] { display: none !important; }

.nabd {
	--nabd-amber: #d97706;
	--nabd-amber-dark: #b45309;
	--nabd-ink: #0f172a;
	--nabd-text: #1e293b;
	--nabd-muted: #475569;
	--nabd-line: #cbd5e1;
	--nabd-soft: #f8fafc;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	line-height: 1.4;
}

.nabd-launch {
	position: fixed;
	left: 20px;
	bottom: var(--nabd-bottom, 95px);
	z-index: 99990;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 14px 22px;
	border: 0;
	border-radius: 35px;
	background: var(--nabd-amber);
	color: #fff;
	font-weight: 700;
	font-size: 11px;
	line-height: 1;
	font-family: inherit;
	letter-spacing: 1px;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 8px 25px rgba(0, 0, 0, .3);
}
.nabd-launch:hover, .nabd-launch:focus-visible { background: var(--nabd-amber-dark); color: #fff; }
.nabd-launch:focus-visible, .nabd-btn:focus-visible, .nabd-close:focus-visible,
.nabd-tile-btn:focus-visible { outline: 3px solid #fbbf24; outline-offset: 2px; }

.nabd-panel {
	position: fixed;
	left: 20px;
	bottom: calc(var(--nabd-bottom, 95px) + 60px);
	z-index: 99991;
	width: min(440px, calc(100vw - 40px));
	max-height: calc(100vh - var(--nabd-bottom, 95px) - 80px);
	max-height: calc(100dvh - var(--nabd-bottom, 95px) - 80px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 20px;
	border: 1px solid var(--nabd-line);
	border-radius: 16px;
	background: #fff;
	color: var(--nabd-text);
	font-size: 14px;
	box-shadow: 0 15px 40px rgba(0, 0, 0, .15);
}

.nabd-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 15px; padding-bottom: 10px; border-bottom: 1px solid #e2e8f0; }
.nabd-eyebrow { display: block; color: var(--nabd-amber-dark); font-size: 9px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; }
.nabd-title { margin: 2px 0 0; padding: 0; color: var(--nabd-ink); font-size: 16px; font-weight: 600; line-height: 1.25; }
.nabd-close { flex: none; margin: 0; padding: 4px 8px; border: 0; border-radius: 6px; background: none; color: #64748b; font-size: 18px; line-height: 1; cursor: pointer; }
.nabd-close:hover { color: var(--nabd-ink); background: #f1f5f9; }

.nabd-field { margin: 0 0 12px; min-width: 0; }
.nabd-field label, .nabd-refine label { display: block; margin: 0 0 4px; color: var(--nabd-muted); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.nabd-refine label { color: var(--nabd-amber-dark); }
.nabd-row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.nabd input[type="text"], .nabd input[type="email"], .nabd input[type="tel"],
.nabd select, .nabd textarea {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 9px;
	border: 1px solid var(--nabd-line);
	border-radius: 8px;
	background: var(--nabd-soft);
	color: var(--nabd-ink);
	font-weight: 400;
	font-size: 13px;
	line-height: 1.35;
	font-family: inherit;
	box-shadow: none;
}
.nabd textarea { resize: vertical; min-height: 64px; }
.nabd input:focus, .nabd select:focus, .nabd textarea:focus { border-color: var(--nabd-amber); outline: 2px solid rgba(217, 119, 6, .25); outline-offset: 0; background: #fff; }

.nabd-btn {
	display: block;
	width: 100%;
	margin: 0;
	padding: 12px;
	border: 0;
	border-radius: 8px;
	font-weight: 700;
	font-size: 11px;
	line-height: 1.2;
	font-family: inherit;
	letter-spacing: 1px;
	text-transform: uppercase;
	text-align: center;
	cursor: pointer;
}
.nabd-btn[disabled] { opacity: .55; cursor: progress; }
.nabd-btn-primary { background: var(--nabd-amber); color: #fff; box-shadow: 0 4px 15px rgba(217, 119, 6, .3); }
.nabd-btn-primary:hover:not([disabled]) { background: var(--nabd-amber-dark); }
.nabd-btn-dark { width: auto; flex: none; padding: 9px 14px; background: #334155; color: #fff; }
.nabd-btn-dark:hover:not([disabled]) { background: var(--nabd-ink); }

.nabd-status { min-height: 0; margin: 12px 0 0; color: var(--nabd-amber-dark); font-size: 12px; font-weight: 600; }
.nabd-status:empty { display: none; }
.nabd-status.is-error { color: #b91c1c; }
.nabd-status.is-ok { color: #047857; }

.nabd-h4 { margin: 14px 0 8px; padding: 0; color: var(--nabd-muted); font-size: 11px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.nabd-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 12px; }

.nabd-tile { position: relative; overflow: hidden; border: 2px solid var(--nabd-line); border-radius: 6px; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .05); }
.nabd-tile.is-selected { border-color: var(--nabd-amber); box-shadow: 0 0 0 2px rgba(217, 119, 6, .25); }
.nabd-tile-btn { display: block; width: 100%; margin: 0; padding: 0; border: 0; background: none; cursor: pointer; text-align: center; }
.nabd-tile-media { display: block; width: 100%; aspect-ratio: 1 / 1; background: #e2e8f0; }
.nabd-tile-media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.nabd-tile-label { display: block; padding: 3px; background: var(--nabd-ink); color: #fbbf24; font-size: 8px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.nabd-tile.is-loading .nabd-tile-media { background: linear-gradient(100deg, #e2e8f0 30%, #f1f5f9 50%, #e2e8f0 70%); background-size: 200% 100%; animation: nabd-shimmer 1.4s linear infinite; }
.nabd-tile.is-failed .nabd-tile-media { display: flex; flex-direction: column; gap: 6px; align-items: center; justify-content: center; padding: 6px; background: #fef2f2; color: #b91c1c; font-size: 10px; text-align: center; }
.nabd-retry { margin-top: 4px; padding: 3px 8px; border: 1px solid #b91c1c; border-radius: 4px; background: #fff; color: #b91c1c; font-weight: 700;
	font-size: 9px;
	line-height: 1.2; font-family: inherit; text-transform: uppercase; cursor: pointer; }
@keyframes nabd-shimmer { to { background-position: -200% 0; } }

.nabd-preview { margin: 0 0 12px; }
.nabd-preview a { display: block; }
.nabd-preview img { display: block; width: 100%; height: auto; max-height: 340px; object-fit: contain; border: 1px solid var(--nabd-line); border-radius: 8px; background: #f1f5f9; }

.nabd-refine { margin: 0 0 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.nabd-inline { display: flex; gap: 6px; align-items: stretch; }
.nabd-inline input { flex: 1; min-width: 0; }

.nabd-sample { margin-top: 12px; padding-top: 12px; border-top: 1px solid #e2e8f0; }
.nabd-note { margin: 0 0 10px; color: var(--nabd-muted); font-size: 12px; }
.nabd-check { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 12px; color: var(--nabd-muted); font-size: 12px; cursor: pointer; }
.nabd-check input { flex: none; width: 16px; height: 16px; margin: 2px 0 0; }
.nabd-check a { color: var(--nabd-amber-dark); }
.nabd-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

.nabd-fine { margin: 14px 0 0; color: #64748b; font-size: 10px; line-height: 1.4; }
.nabd-foot { margin-top: 10px; padding-top: 10px; border-top: 1px solid #e2e8f0; text-align: center; }
.nabd-foot p { margin: 0; color: var(--nabd-amber-dark); font-size: 9px; font-weight: 700; letter-spacing: .5px; }

/* Daily free allowance */
.nabd-credits { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 9px 11px; border: 1px solid #fde68a; border-radius: 10px; background: #fffbeb; color: #78350f; font-size: 12px; line-height: 1.35; }
.nabd-credits.is-empty { border-color: #fecaca; background: #fef2f2; color: #7f1d1d; }
.nabd-credits-text { min-width: 0; }
.nabd-credits-text strong { display: block; font-weight: 600; }
.nabd-credits-reset { display: block; margin-top: 2px; font-size: 11px; opacity: .8; }
.nabd-credits-reset:empty { display: none; }
.nabd-pips { display: flex; flex: none; gap: 4px; }
.nabd-pips:empty { display: none; }
.nabd-pips i { display: block; width: 9px; height: 9px; border-radius: 50%; background: var(--nabd-amber); box-shadow: 0 0 0 1px rgba(180, 83, 9, .35) inset; }
.nabd-pips i.is-used { background: transparent; }
.nabd-credits.is-empty .nabd-pips i { background: transparent; box-shadow: 0 0 0 1px rgba(185, 28, 28, .45) inset; }

@media (max-width: 520px) {
	.nabd-launch { left: 12px; padding: 12px 18px; }
	.nabd-panel {
		left: 10px;
		right: 10px;
		bottom: 10px;
		width: auto;
		max-height: calc(100vh - 20px);
		max-height: calc(100dvh - 20px);
		padding: 16px;
	}
	/* 16px stops iOS Safari zooming into fields */
	.nabd input[type="text"], .nabd input[type="email"], .nabd input[type="tel"],
	.nabd select, .nabd textarea { font-size: 16px; }
	.nabd-row { grid-template-columns: 1fr; gap: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.nabd-tile.is-loading .nabd-tile-media { animation: none; }
}
