/**
 * XiotForms — front-end styles.
 */
.xiot-likert { width: 100%; border-collapse: collapse; }
.xiot-likert th, .xiot-likert td { padding: 8px 6px; text-align: center; border-bottom: 1px solid #eef0f3; font-size: .9em; }
.xiot-likert thead th { color: #555; font-weight: 600; }
.xiot-likert tbody th[scope="row"] { text-align: left; font-weight: 500; }
.xiot-ranking { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.xiot-rank-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid #ccd0d4; border-radius: 8px; margin-bottom: 6px; background: #fbfbfc; }
.xiot-rank-item::before { counter-increment: rank; content: counter(rank); font-weight: 700; color: var(--xf-primary); min-width: 18px; }
.xiot-rank-grip { color: #c3c4c7; cursor: move; }
.xiot-rank-label { flex: 1; }
.xiot-rank-btns button { border: 1px solid #ccd0d4; background: #fff; border-radius: 5px; cursor: pointer; width: 28px; height: 26px; }
.xiot-rating { display: inline-flex; gap: 4px; }
.xiot-star-pick { cursor: pointer; color: #d1d5db; font-size: 30px; line-height: 1; transition: transform .1s, color .1s; }
.xiot-star-pick.on { color: #dba617; }
.xiot-star-pick:hover { transform: scale( 1.15 ); }
.xiot-coupon { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.xiot-coupon .xiot-input { flex: 1; min-width: 140px; }
.xiot-coupon-msg { flex: 1 1 100%; font-size: .9em; }
.xiot-coupon-ok { color: #059669; font-weight: 600; }
.xiot-coupon-err { color: #d63638; }
.xiot-datepicker { position: absolute; z-index: 50; background: #fff; border: 1px solid #ccd0d4; border-radius: 10px; box-shadow: 0 8px 28px rgba(0,0,0,.15); padding: 10px; width: 240px; margin-top: 4px; }
.xiot-dp-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-weight: 600; }
.xiot-dp-head button { border: none; background: #f0f0f1; border-radius: 6px; width: 28px; height: 28px; cursor: pointer; font-size: 16px; }
.xiot-dp-grid { display: grid; grid-template-columns: repeat( 7, 1fr ); gap: 2px; text-align: center; }
.xiot-dp-dow { font-size: 11px; color: #888; padding: 4px 0; }
.xiot-dp-day { border: none; background: transparent; border-radius: 6px; padding: 6px 0; cursor: pointer; font-size: 13px; }
.xiot-dp-day:hover { background: var(--xf-primary); color: #fff; }
/* Poll results */
.xiot-poll-results-link { font-size: .85em; color: var(--xf-primary); display: inline-block; margin-top: 8px; }
.xiot-poll-results { margin-top: 10px; }
.xiot-poll-row { margin-bottom: 8px; }
.xiot-poll-label { font-size: .85em; color: #333; }
.xiot-poll-bar { background: #eef0f3; border-radius: 6px; height: 16px; overflow: hidden; margin-top: 3px; }
.xiot-poll-bar span { display: block; height: 100%; background: linear-gradient(90deg,var(--xf-primary),#818cf8); border-radius: 6px; transition: width .5s; }
.xiot-poll-total { font-size: .8em; color: #888; margin-top: 6px; }

/* Conversational mode */
.xiotforms-conversational .xiot-row { font-size: 1.15em; }
.xiotforms-conversational .xiot-label { font-size: 1.25em; }
.xiot-conv-progress { background: #e5e7eb; height: 6px; border-radius: 6px; overflow: hidden; margin-bottom: 24px; }
.xiot-conv-progress span { display: block; height: 100%; background: var(--xf-primary); transition: width .3s; }
.xiot-conv-nav { display: flex; gap: 10px; align-items: center; margin-top: 16px; }
.xiot-conv-nav .xiot-conv-prev { background: #6b7280; padding: 8px 14px; }

.xiotforms-save-continue { margin-left: 14px; font-size: .9em; color: var(--xf-primary); text-decoration: underline; cursor: pointer; }
.xiotforms-resume { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e3a8a; padding: 12px 14px; border-radius: 8px; }
.xiotforms-resume input { width: 100%; margin-top: 8px; padding: 8px 10px; border: 1px solid #bfdbfe; border-radius: 6px; font-family: monospace; font-size: .85em; }
.xiotforms .xiot-calc { background: #f8fafc; font-weight: 600; }
.xiotforms-wrap,
.xiotforms {
	--xf-primary: #6366f1;
	--xf-primary-600: #4f46e5;
	--xf-primary-700: #4338ca;
	--xf-primary-50: #eef2ff;
	--xf-primary-100: #e0e7ff;
	--xf-ink: #0f172a;
	--xf-ink-2: #475569;
	--xf-ink-3: #94a3b8;
	--xf-line: #e8eaf2;
	--xf-line-2: #cdd3e2;
	--xf-bg-soft: #f7f8fc;
	--xf-danger: #e11d48;
	--xf-success: #059669;
	--xf-radius: 12px;
	--xf-radius-lg: 18px;
	--xf-shadow-sm: 0 1px 2px rgba( 15, 23, 42, .06 );
	--xf-shadow: 0 6px 20px rgba( 15, 23, 42, .08 );
	--xf-shadow-lg: 0 18px 50px rgba( 15, 23, 42, .14 );
	--xf-accent-ring: 0 0 0 4px rgba( 99, 102, 241, .16 );
	--xf-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-family: var( --xf-font );
	color: var( --xf-ink );
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
.xiotforms-wrap {
	max-width: 720px;
	margin: 0 0 2em;
}
.xiot-lang-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 1.2em; }
.xiot-lang { font-size: 12px; font-weight: 600; color: var(--xf-ink-2); text-decoration: none; padding: 5px 11px; border: 1px solid var(--xf-line); border-radius: 999px; transition: all .12s; }
.xiot-lang:hover { border-color: var(--xf-primary); color: var(--xf-primary); }
.xiot-lang.is-active { background: var(--xf-primary); border-color: var(--xf-primary); color: #fff; }
.xiotforms-title { margin: 0 0 .35em; font-size: 2em; font-weight: 800; letter-spacing: -.025em; line-height: 1.15; color: var(--xf-ink); }
.xiotforms-desc { margin: 0 0 1.75em; color: var(--xf-ink-2); font-size: 1.04em; line-height: 1.6; }

.xiotforms .xiot-row { margin: 0 0 1.35em; }
.xiotforms .xiot-row.xiot-hidden { display: none !important; }

.xiot-label { display: block; font-weight: 600; font-size: .93em; margin-bottom: .5em; color: var(--xf-ink); letter-spacing: -.005em; }
.xiot-req { color: var(--xf-danger); }
.xiot-desc { font-size: .86em; color: var(--xf-ink-2); margin-top: .45em; line-height: 1.5; }

/* Native checkboxes/radios pick up the accent colour */
.xiotforms input[type="checkbox"], .xiotforms input[type="radio"] { accent-color: var(--xf-primary); width: 17px; height: 17px; }

.xiot-input,
.xiotforms input[type="text"],
.xiotforms input[type="email"],
.xiotforms input[type="url"],
.xiotforms input[type="tel"],
.xiotforms input[type="number"],
.xiotforms input[type="date"],
.xiotforms input[type="time"],
.xiotforms select,
.xiotforms textarea {
	width: 100%;
	padding: 12px 15px;
	border: 1.5px solid var(--xf-line);
	border-radius: var(--xf-radius);
	font-size: 15px;
	line-height: 1.45;
	color: var(--xf-ink);
	background: var(--xf-bg-soft);
	box-sizing: border-box;
	font-family: inherit;
	transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}
.xiotforms ::placeholder { color: var(--xf-ink-3); }
.xiotforms .xiot-input:hover,
.xiotforms select:hover,
.xiotforms textarea:hover { border-color: var(--xf-line-2); background: #fff; }
.xiotforms .xiot-input:focus,
.xiotforms input:focus,
.xiotforms select:focus,
.xiotforms textarea:focus {
	border-color: var(--xf-primary);
	background: #fff;
	box-shadow: var(--xf-accent-ring);
	outline: none;
}
.xiotforms textarea { min-height: 130px; resize: vertical; }

/* Choices */
.xiot-choices { display: flex; flex-direction: column; gap: .4em; }
.xiot-choice { font-weight: 400; display: flex; align-items: center; gap: .5em; }
.xiot-choice input { width: auto; }

/* Multi (name/address) */
.xiot-multi { display: flex; flex-wrap: wrap; gap: 10px; }
.xiot-multi .xiot-sub { flex: 1 1 45%; display: flex; flex-direction: column; }
.xiot-multi .xiot-sub label { font-size: .8em; color: #777; margin-top: 3px; }
.xiot-sub-street, .xiot-sub-line2 { flex: 1 1 100%; }

/* List */
.xiot-list { width: 100%; border-collapse: collapse; }
.xiot-list th, .xiot-list td { padding: 4px; }
.xiot-list-add, .xiot-list-remove { width: 28px; height: 28px; cursor: pointer; }

/* Repeater */
.xiot-repeater-row { display: flex; gap: 10px; align-items: flex-end; margin-bottom: 8px; flex-wrap: wrap; }
.xiot-repeater-cell { display: flex; flex-direction: column; flex: 1 1 120px; }
.xiot-repeater-cell label { font-size: .8em; color: #777; margin-bottom: 3px; }
.xiot-repeater-tools { display: flex; gap: 4px; }
.xiot-repeater-add, .xiot-repeater-remove { width: 34px; height: 42px; cursor: pointer; border: 1px solid #ccd0d4; background: #f6f7f7; border-radius: 6px; font-size: 1.1em; }

/* Column layout — flex rows with a consistent gutter (modern, no cramped fields).
   Each page is the flex container; field rows are the items. The row gap also
   provides vertical rhythm, so per-row bottom margin is reset inside a page. */
.xiotforms .xiot-page { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 1.35em 22px; }
.xiotforms .xiot-page > .xiot-row { margin-bottom: 0; }
.xiot-w-full { flex: 1 1 100%; max-width: 100%; }
.xiot-w-half { flex: 0 1 calc(50% - 11px); max-width: calc(50% - 11px); }
.xiot-w-third { flex: 0 1 calc(33.333% - 15px); max-width: calc(33.333% - 15px); }
.xiotforms .xiot-page-nav { flex: 1 1 100%; }
/* The page itself is full-width within the form. */
.xiotforms .xiot-page { width: 100%; box-sizing: border-box; }

/* Field sizes */
.xiotforms .xiot-size-small { max-width: 140px; }
.xiotforms .xiot-size-medium { max-width: 60%; }
.xiotforms .xiot-size-large { max-width: 100%; }

/* CSS-ready column classes — add to a field's "CSS Class" box for layouts */
.xiotforms .xiot-col-2 { display: inline-block; width: 48%; margin-right: 2%; vertical-align: top; }
.xiotforms .xiot-col-3 { display: inline-block; width: 31.3%; margin-right: 2%; vertical-align: top; }
.xiotforms .xiot-col-4 { display: inline-block; width: 23%; margin-right: 2%; vertical-align: top; }
.xiotforms .xiot-first { clear: left; }
.xiotforms .xiot-last { margin-right: 0; }

/* Label placement */
.xiot-row.xiot-lp-left_label { display: grid; grid-template-columns: 30% 1fr; gap: 12px; align-items: start; }
.xiot-row.xiot-lp-left_label .xiot-label { padding-top: 10px; }
.xiot-row.xiot-lp-left_label .xiot-field,
.xiot-row.xiot-lp-left_label .xiot-desc,
.xiot-row.xiot-lp-left_label .xiot-field-error { grid-column: 2; }
.xiot-row.xiot-lp-hidden .xiot-label { display: none; }

/* Buttons */
.xiot-btn {
	background: var(--xf-primary); color: #fff; border: none;
	padding: 13px 28px; border-radius: var(--xf-radius); font-size: 15px; font-weight: 600;
	letter-spacing: -.01em; cursor: pointer; box-shadow: 0 4px 14px rgba( 99, 102, 241, .32 );
	transition: transform .2s cubic-bezier(.2,.8,.2,1), box-shadow .2s, background .2s;
}
.xiot-btn:hover { background: var(--xf-primary-600); transform: translateY( -2px ); box-shadow: 0 10px 26px rgba( 99, 102, 241, .4 ); }
.xiot-btn:active { transform: translateY( 0 ); box-shadow: 0 4px 14px rgba( 99, 102, 241, .32 ); }
.xiot-btn[disabled] { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
/* Secondary (Previous) — quiet, no accent */
.xiot-prev { background: var(--xf-bg-soft); color: var(--xf-ink-2); box-shadow: none; border: 1.5px solid var(--xf-line); }
.xiot-prev:hover { background: #fff; border-color: var(--xf-line-2); transform: none; box-shadow: none; }
.xiot-page-nav { margin-top: 1.6em; display: flex; gap: 10px; justify-content: space-between; align-items: center; }

/* Progress */
.xiot-progress { background: var(--xf-primary-50); border-radius: 99px; height: 8px; margin-bottom: 7px; overflow: hidden; }
.xiot-progress-bar { background: linear-gradient( 90deg, var(--xf-primary), #818cf8 ); height: 100%; border-radius: 99px; transition: width .4s cubic-bezier(.34,1.4,.64,1); }
.xiot-progress-label { display: block; text-align: right; font-size: .8em; font-weight: 600; color: var(--xf-ink-2); margin: 0 0 1.8em; }

/* Messages / errors */
.xiot-messages:empty { display: none; }
.xiot-error { background: #fff1f2; border: 1px solid #fecdd3; border-left: 4px solid var(--xf-danger); color: #9f1239; padding: 13px 16px; border-radius: var(--xf-radius); margin-bottom: 1.2em; }
.xiot-field-error { color: var(--xf-danger); font-size: .82em; font-weight: 500; margin-top: .35em; }
.xiot-field-error:empty { display: none; }
.xiot-has-error .xiot-input,
.xiot-has-error input,
.xiot-has-error select,
.xiot-has-error textarea { border-color: var(--xf-danger); box-shadow: 0 0 0 3px rgba( 225, 29, 72, .12 ); }

/* Server-rendered states (form not found / restricted / submit-error summary) */
.xiotforms-error { background: #fff1f2; border: 1px solid #fecdd3; border-left: 4px solid var(--xf-danger); color: #9f1239; padding: 14px 16px; border-radius: var(--xf-radius); }
.xiotforms-notice { background: var(--xf-primary-50); border: 1px solid #d9def8; color: var(--xf-primary-600); padding: 14px 16px; border-radius: var(--xf-radius); }
.xiotforms-notice a { color: var(--xf-primary); font-weight: 600; }
.xiotforms-error-summary { background: #fff1f2; border: 1px solid #fecdd3; color: #9f1239; padding: 14px 16px 14px 18px; border-radius: var(--xf-radius); margin-bottom: 1.4em; }
.xiotforms-error-summary p, .xiotforms-error-summary strong { margin: 0 0 6px; font-weight: 700; }
.xiotforms-error-summary ul { margin: 6px 0 0; padding-left: 18px; }
.xiotforms-error-summary li { font-size: .9em; }

.xiotforms-confirmation {
	background: linear-gradient( 180deg, #f0fdf9, #ecfdf5 ); border: 1px solid #a7f3d0; color: #065f46;
	padding: 36px 28px; border-radius: var(--xf-radius-lg, 18px); text-align: center;
	box-shadow: var(--xf-shadow, 0 6px 20px rgba(15,23,42,.08));
	animation: xiotConfPop .45s cubic-bezier(.34,1.56,.64,1);
}
@keyframes xiotConfPop { from { opacity: 0; transform: scale( .9 ) translateY( 10px ); } to { opacity: 1; transform: none; } }
.xiot-conf-check {
	width: 56px; height: 56px; margin: 0 auto 14px; border-radius: 50%;
	background: #10b981; display: flex; align-items: center; justify-content: center;
	animation: xiotCheckPop .5s .15s both cubic-bezier(.34,1.56,.64,1);
}
.xiot-conf-check svg { width: 30px; height: 30px; stroke: #fff; stroke-width: 4; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 40; stroke-dashoffset: 40; animation: xiotCheckDraw .4s .35s forwards ease; }
@keyframes xiotCheckPop { from { transform: scale( 0 ); } to { transform: scale( 1 ); } }
@keyframes xiotCheckDraw { to { stroke-dashoffset: 0; } }

/* Error shake + highlight */
@keyframes xiotShake { 10%,90%{transform:translateX(-1px)} 20%,80%{transform:translateX(2px)} 30%,50%,70%{transform:translateX(-4px)} 40%,60%{transform:translateX(4px)} }
.xiot-has-error { animation: xiotShake .4s; }
.xiotforms .xiot-required .xiot-label::after { content: ''; }

/* Smooth interactions */
.xiotforms .xiot-row { transition: opacity .2s; }
.xiotforms .xiot-choice { padding: 11px 14px; border: 1.5px solid var(--xf-line); border-radius: var(--xf-radius); background: var(--xf-bg-soft); transition: background .15s, border-color .15s, box-shadow .15s; cursor: pointer; }
.xiotforms .xiot-choice:hover { background: #fff; border-color: var(--xf-primary); box-shadow: var(--xf-accent-ring); }
.xiot-btn { position: relative; overflow: hidden; }
.xiot-btn::after { content: ''; position: absolute; inset: 0; background: rgba(255,255,255,.25); transform: scaleX(0); transform-origin: left; transition: transform .3s; }
.xiot-btn:active::after { transform: scaleX(1); }

/* Pricing */
.xiot-total { font-weight: 700; font-size: 1.2em; }
.xiot-product-price { font-weight: 600; }

/* Signature */
.xiot-signature canvas { border: 1px solid var(--xf-line); border-radius: var(--xf-radius); touch-action: none; display: block; background: #fff; }
.xiot-sig-clear { margin-top: 6px; }

.xiotforms [hidden] { display: none !important; }
.xiot-spinner {
	display: inline-block; width: 18px; height: 18px; margin-left: 10px;
	border: 2px solid #cbd5e1; border-top-color: var(--xf-primary); border-radius: 50%;
	animation: xiot-spin .7s linear infinite; vertical-align: middle;
}
@keyframes xiot-spin { to { transform: rotate( 360deg ); } }

/* Searchable dropdown (vanilla combobox) */
.xiot-ss { position: relative; }
.xiot-ss-btn { width: 100%; text-align: left; padding: 11px 13px; border: 1px solid var(--xf-line); border-radius: var(--xf-radius); background: #fff; cursor: pointer; font-size: 15px; color: var(--xf-ink); transition: border-color .15s, box-shadow .15s; }
.xiot-ss-btn:after { content: "\25BE"; float: right; color: var(--xf-ink-2); }
.xiot-ss.open .xiot-ss-btn { border-color: var(--xf-primary); box-shadow: 0 0 0 3px rgba( 79, 70, 229, .18 ); }
.xiot-ss-panel { position: absolute; z-index: 30; left: 0; right: 0; margin-top: 4px; background: #fff; border: 1px solid var(--xf-line); border-radius: var(--xf-radius); box-shadow: 0 12px 34px rgba(15,23,42,.14); overflow: hidden; }
.xiot-ss-search { width: 100%; border: none; border-bottom: 1px solid #eef0f5; padding: 10px 13px; font-size: 14px; box-sizing: border-box; }
.xiot-ss-search:focus { outline: none; }
.xiot-ss-list { max-height: 220px; overflow-y: auto; }
.xiot-ss-opt { padding: 9px 13px; cursor: pointer; font-size: 14px; }
.xiot-ss-opt:hover { background: var(--xf-primary-50); }
.xiot-ss-opt.sel { background: var(--xf-primary-50); color: var(--xf-primary-600); font-weight: 600; }

/* Rating stars */
.xiot-star-pick.on { color: #f59e0b; }

/* ============================================================
 * Accessibility
 * ============================================================ */
.xiotforms .xiot-btn:focus-visible,
.xiotforms .xiot-ss-btn:focus-visible,
.xiotforms .xiot-star-pick:focus-visible,
.xiotforms .xiot-repeater-add:focus-visible,
.xiotforms .xiot-repeater-remove:focus-visible,
.xiotforms .xiot-list-add:focus-visible,
.xiotforms .xiot-list-remove:focus-visible,
.xiotforms .xiot-rank-btns button:focus-visible {
	outline: 2px solid var(--xf-primary);
	outline-offset: 2px;
}
@media ( prefers-reduced-motion: reduce ) {
	.xiot-has-error,
	.xiotforms-confirmation,
	.xiot-conf-check,
	.xiot-conf-check svg { animation: none !important; }
	.xiot-btn:hover { transform: none; }
	.xiot-progress-bar, .xiot-conv-progress span { transition: none; }
}

/* ============================================================
 * Responsive
 * ============================================================ */
@media ( max-width: 600px ) {
	.xiot-w-half, .xiot-w-third { flex: 1 1 100%; max-width: 100%; }
	.xiotforms .xiot-col-2, .xiotforms .xiot-col-3, .xiotforms .xiot-col-4 { width: 100%; margin-right: 0; display: block; }
	.xiot-multi .xiot-sub { flex: 1 1 100%; }
	.xiotforms .xiot-size-small, .xiotforms .xiot-size-medium { max-width: 100%; }
	.xiot-row.xiot-lp-left_label { grid-template-columns: 1fr; }
	.xiot-row.xiot-lp-left_label .xiot-label { padding-top: 0; }
	.xiot-row.xiot-lp-left_label .xiot-field,
	.xiot-row.xiot-lp-left_label .xiot-desc,
	.xiot-row.xiot-lp-left_label .xiot-field-error { grid-column: 1; }
	.xiot-page-nav { flex-direction: column-reverse; align-items: stretch; gap: 8px; }
	.xiot-page-nav .xiot-btn { width: 100%; }
}

/* ---- Appointment / booking field -------------------------------------- */
.xiot-appt-date { max-width: 260px; }
.xiot-appt-slots { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.xiot-appt-slot {
	position: relative; cursor: pointer; border: 1px solid var(--xf-line, #d8dce3); background: #fff;
	color: var(--xf-ink, #1f2733); border-radius: 10px; padding: 9px 14px; font-size: .95em; line-height: 1.2;
	transition: border-color .12s, background .12s, box-shadow .12s; font: inherit;
}
.xiot-appt-slot:hover:not(:disabled) { border-color: var(--xf-primary, #4f46e5); }
.xiot-appt-slot:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--xf-primary-50, #eef2ff); border-color: var(--xf-primary, #4f46e5); }
.xiot-appt-slot.is-selected { background: var(--xf-primary, #4f46e5); border-color: var(--xf-primary, #4f46e5); color: #fff; }
.xiot-appt-slot.is-full, .xiot-appt-slot:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.xiot-appt-rem { display: block; font-size: .72em; opacity: .8; margin-top: 2px; }
.xiot-appt-msg { color: var(--xf-ink-2, #5a6472); font-size: .92em; padding: 6px 0; }
@media ( max-width: 480px ) { .xiot-appt-slot { flex: 1 1 30%; text-align: center; } }

/* ---- Front-end Views / directories ------------------------------------ */
.xiot-view { margin: 0 0 1.5em; }
.xiot-view-title { font-size: 1.7em; font-weight: 800; letter-spacing: -.025em; margin: 0 0 .7em; color: var(--xf-ink, #0f172a); }
.xiot-view-search { display: flex; gap: 8px; margin-bottom: 22px; max-width: 460px; }
.xiot-view-search input[type=search] { flex: 1; padding: 12px 16px; border: 1.5px solid var(--xf-line, #e8eaf2); border-radius: 99px; font-size: 15px; background: var(--xf-bg-soft, #f7f8fc); transition: border-color .18s, box-shadow .18s, background .18s; }
.xiot-view-search input[type=search]:focus { outline: none; border-color: var(--xf-primary, #6366f1); background: #fff; box-shadow: var(--xf-accent-ring, 0 0 0 4px rgba(99,102,241,.16)); }
.xiot-view-search button { padding: 12px 22px; border: none; border-radius: 99px; background: var(--xf-primary, #6366f1); color: #fff; font-weight: 600; cursor: pointer; box-shadow: 0 4px 14px rgba(99,102,241,.3); transition: transform .18s, box-shadow .18s, background .18s; }
.xiot-view-search button:hover { background: var(--xf-primary-600, #4f46e5); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(99,102,241,.38); }
.xiot-view-empty { color: var(--xf-ink-2, #475569); padding: 32px 0; text-align: center; }
.xiot-view-locked { color: var(--xf-ink-2, #475569); background: var(--xf-bg-soft, #f7f8fc); border: 1.5px dashed var(--xf-line-2, #cdd3e2); border-radius: var(--xf-radius-lg, 18px); padding: 28px; text-align: center; }
.xiot-view-dash { color: var(--xf-ink-3, #94a3b8); }

.xiot-view-tablewrap { overflow-x: auto; border: 1px solid var(--xf-line, #e8eaf2); border-radius: var(--xf-radius-lg, 18px); box-shadow: var(--xf-shadow-sm, 0 1px 2px rgba(15,23,42,.06)); }
.xiot-view-table { width: 100%; border-collapse: collapse; }
.xiot-view-table th { text-align: left; font-size: .74em; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--xf-ink-3, #94a3b8); padding: 14px 16px; background: var(--xf-bg-soft, #f7f8fc); border-bottom: 1px solid var(--xf-line, #e8eaf2); }
.xiot-view-table td { padding: 15px 16px; border-bottom: 1px solid var(--xf-line, #eef0f6); font-size: .95em; vertical-align: middle; }
.xiot-view-table tbody tr:last-child td { border-bottom: none; }
.xiot-view-table tbody tr { transition: background .15s; }
.xiot-view-table tbody tr:hover td { background: var(--xf-primary-50, #eef2ff); }
.xiot-view-more { display: inline-flex; align-items: center; gap: 3px; color: var(--xf-primary-600, #4f46e5); text-decoration: none; font-weight: 600; white-space: nowrap; }
.xiot-view-more:hover { gap: 6px; }

.xiot-view-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 22px; }
.xiot-view-card { display: flex; flex-direction: column; border: 1px solid var(--xf-line, #e8eaf2); border-radius: var(--xf-radius-lg, 18px); background: #fff; text-decoration: none; color: inherit; overflow: hidden; box-shadow: var(--xf-shadow-sm, 0 1px 2px rgba(15,23,42,.06)); transition: box-shadow .25s ease, transform .25s ease, border-color .25s ease; }
.xiot-view-card:hover { border-color: transparent; box-shadow: var(--xf-shadow-lg, 0 18px 50px rgba(15,23,42,.14)); transform: translateY(-4px); }
.xiot-view-cell { margin-bottom: 9px; }
.xiot-view-cell:last-child { margin-bottom: 0; }
.xiot-view-label { display: block; font-size: .68em; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; color: var(--xf-ink-3, #94a3b8); margin-bottom: 3px; }
.xiot-view-val { font-size: .95em; color: var(--xf-ink-2, #475569); }

.xiot-view-pagination { display: flex; gap: 7px; flex-wrap: wrap; margin-top: 24px; justify-content: center; }
.xiot-view-pagination .page-numbers { display: inline-flex; min-width: 40px; height: 40px; align-items: center; justify-content: center; padding: 0 12px; border: 1.5px solid var(--xf-line, #e8eaf2); border-radius: 12px; text-decoration: none; font-weight: 600; color: var(--xf-ink-2, #475569); transition: all .15s; }
.xiot-view-pagination .page-numbers.current { background: var(--xf-primary, #6366f1); border-color: var(--xf-primary, #6366f1); color: #fff; box-shadow: 0 4px 12px rgba(99,102,241,.3); }
.xiot-view-pagination .page-numbers:hover:not(.current) { border-color: var(--xf-primary, #6366f1); color: var(--xf-primary, #6366f1); background: var(--xf-primary-50, #eef2ff); }

.xiot-view-back { display: inline-flex; align-items: center; gap: 4px; margin-bottom: 18px; color: var(--xf-primary-600, #4f46e5); text-decoration: none; font-weight: 600; }
.xiot-view-back:hover { gap: 7px; }
.xiot-view-single { background: #fff; border: 1px solid var(--xf-line, #e8eaf2); border-radius: var(--xf-radius-lg, 18px); padding: 26px 28px; box-shadow: var(--xf-shadow, 0 6px 20px rgba(15,23,42,.08)); }
.xiot-view-detail { width: 100%; border-collapse: collapse; }
.xiot-view-detail th { text-align: left; width: 190px; padding: 14px 14px 14px 0; border-bottom: 1px solid var(--xf-line, #eef0f6); color: var(--xf-ink-3, #94a3b8); font-weight: 600; font-size: .8em; text-transform: uppercase; letter-spacing: .04em; vertical-align: top; }
.xiot-view-detail td { padding: 14px 0; border-bottom: 1px solid var(--xf-line, #eef0f6); color: var(--xf-ink, #0f172a); }
.xiot-view-detail tr:last-child th, .xiot-view-detail tr:last-child td { border-bottom: none; }
@media ( max-width: 600px ) { .xiot-view-detail th { width: 40%; } .xiot-view-cards { grid-template-columns: 1fr; } }

/* ============================================================
 * Location (map) field + photo galleries + rich directory
 * ============================================================ */

/* Location field on the form */
.xiot-map-field { display: flex; flex-direction: column; gap: 10px; }
.xiot-map-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.xiot-map-search { flex: 1; min-width: 180px; }
.xiot-map-locate { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; padding: 0 16px; border: 1.5px solid var(--xf-line, #e8eaf2); background: var(--xf-bg-soft, #f7f8fc); border-radius: var(--xf-radius, 12px); cursor: pointer; color: var(--xf-ink-2, #475569); font-size: 14px; font-weight: 600; transition: all .18s; }
.xiot-map-locate:hover { border-color: var(--xf-primary, #6366f1); color: var(--xf-primary, #6366f1); background: var(--xf-primary-50, #eef2ff); }
.xiot-map-locate .dashicons { font-size: 17px; width: 17px; height: 17px; }
.xiot-map-canvas { height: 320px; border: 1.5px solid var(--xf-line, #e8eaf2); border-radius: var(--xf-radius, 12px); z-index: 0; }

/* Photo galleries */
.xiot-gallery { display: flex; flex-wrap: wrap; gap: 8px; }
.xiot-gallery-item { display: block; width: 72px; height: 72px; border-radius: 12px; overflow: hidden; border: 1px solid var(--xf-line, #e8eaf2); box-shadow: var(--xf-shadow-sm, 0 1px 2px rgba(15,23,42,.06)); transition: transform .2s; }
.xiot-gallery-item:hover { transform: scale(1.04); }
.xiot-gallery-item img { width: 100%; height: 100%; object-fit: cover; display: block; }
.xiot-file-link { display: inline-flex; align-items: center; gap: 6px; color: var(--xf-primary-600, #4f46e5); text-decoration: none; font-weight: 500; }
.xiot-file-link .dashicons { font-size: 17px; width: 17px; height: 17px; }

/* Location value in a listing */
.xiot-loc { display: flex; flex-direction: column; gap: 5px; }
.xiot-loc-addr { display: flex; align-items: flex-start; gap: 5px; color: var(--xf-ink-2, #475569); font-size: .95em; }
.xiot-loc-addr .dashicons { font-size: 17px; width: 17px; height: 17px; color: var(--xf-primary, #6366f1); flex: none; }
.xiot-loc-dir { display: inline-flex; align-items: center; gap: 3px; font-weight: 600; color: var(--xf-primary-600, #4f46e5); text-decoration: none; font-size: .9em; }
.xiot-loc-dir:hover { gap: 6px; }

/* Card hero photo + body */
.xiot-view-card { padding: 0; }
.xiot-view-hero { display: block; height: 184px; background: var(--xf-bg-soft, #f7f8fc) center/cover no-repeat; }
a.xiot-view-hero { transition: opacity .2s; }
a.xiot-view-hero:hover { opacity: .92; }
.xiot-view-card-body { display: flex; flex-direction: column; gap: 10px; padding: 18px 18px 20px; flex: 1; }
.xiot-view-card-body .xiot-view-cell { margin: 0; }
.xiot-view-card-body > .xiot-view-cell:first-child .xiot-view-label { display: none; }
.xiot-view-card-body > .xiot-view-cell:first-child .xiot-view-val { font-size: 1.18em; font-weight: 700; letter-spacing: -.02em; color: var(--xf-ink, #0f172a); line-height: 1.25; }
.xiot-view-card .xiot-view-more { margin-top: auto; padding-top: 4px; }

/* Single-entry interactive map */
.xiot-view-map { display: block; height: 300px; border-radius: 14px; overflow: hidden; margin-bottom: 10px; border: 1px solid var(--xf-line, #e8eaf2); z-index: 0; }
.xiot-view-detail-file .xiot-gallery-item { width: 128px; height: 96px; }

/* Photo lightbox */
.xiot-lightbox { position: fixed; inset: 0; background: rgba(8,10,16,.88); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: none; align-items: center; justify-content: center; z-index: 100000; opacity: 0; transition: opacity .2s; }
.xiot-lightbox.open { display: flex; opacity: 1; }
.xiot-lightbox img { max-width: 92vw; max-height: 88vh; border-radius: 12px; box-shadow: 0 30px 80px rgba(0,0,0,.6); }
.xiot-lightbox-close { position: absolute; top: 20px; right: 28px; background: rgba(255,255,255,.12); border: none; color: #fff; width: 44px; height: 44px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; transition: background .15s; }
.xiot-lightbox-close:hover { background: rgba(255,255,255,.24); }
