/*
 * OmniBridge base components. Every rule is scoped to an OmniBridge root
 * (.ob-app, .ob-drawer, .ob-fab-wrap, .ob-fav) so theme and plugin styles are
 * neither overridden nor leaked into.
 */
.ob-app, .ob-drawer, .ob-fab-wrap, .ob-fav {
	--ob-primary: #2563eb;
	--ob-surface: #ffffff;
	--ob-text: #1f2937;
	--ob-muted: #5b6472;
	--ob-border: #e5e7eb;
	--ob-subtle: #f6f7f9;
	--ob-radius: 10px;
	--ob-success: #15803d;
	--ob-warning: #a16207;
	--ob-danger: #b91c1c;
	--ob-info: #1d4ed8;
	--ob-shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 4px 16px rgba(16, 24, 40, .08);
	--ob-font: inherit;
}

.ob-app {
	color: var(--ob-text);
	background: var(--ob-surface);
	font-family: var(--ob-font);
	font-size: 15px;
	line-height: 1.55;
	box-sizing: border-box;
}
.ob-app *, .ob-app *::before, .ob-app *::after,
.ob-drawer *, .ob-drawer *::before, .ob-drawer *::after { box-sizing: border-box; }

.ob-app a { color: var(--ob-primary); text-decoration: underline; text-underline-offset: 2px; }
.ob-app a:hover { text-decoration-thickness: 2px; }
.ob-app :focus-visible, .ob-drawer :focus-visible, .ob-fab:focus-visible, .ob-fav:focus-visible {
	outline: 3px solid var(--ob-primary);
	outline-offset: 2px;
}

.ob-sr-only {
	position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.ob-muted { color: var(--ob-muted); }
.ob-small { font-size: 13px; }
.ob-pad { padding: 16px; }

/* Headings */
.ob-app .ob-h2 { font-size: 1.45rem; line-height: 1.25; margin: 0 0 4px; font-weight: 650; color: var(--ob-text); }
.ob-app .ob-h4 { font-size: 1rem; margin: 16px 0 8px; font-weight: 600; }
.ob-section-head { margin: 0 0 20px; }
/* Headings receive focus programmatically after navigation (for screen readers); they are not controls. */
.ob-app [data-ob-focus]:focus { outline: none; }
.ob-section-head p { margin: 4px 0 0; }
.ob-eyebrow { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--ob-muted); }

/* Buttons */
.ob-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-height: 40px; padding: 8px 16px; border-radius: calc(var(--ob-radius) * .8);
	border: 1px solid transparent; font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2;
	cursor: pointer; text-decoration: none !important; white-space: nowrap;
	transition: background-color .15s, border-color .15s, color .15s;
}
.ob-btn--primary { background: var(--ob-primary); color: #fff !important; }
.ob-btn--primary:hover { filter: brightness(.92); }
.ob-btn--secondary { background: var(--ob-surface); color: var(--ob-text) !important; border-color: var(--ob-border); }
.ob-btn--secondary:hover { background: var(--ob-subtle); }
.ob-btn--ghost { background: transparent; color: var(--ob-primary) !important; padding-inline: 10px; }
.ob-btn--ghost:hover { background: var(--ob-subtle); }
.ob-btn--block { width: 100%; }
.ob-btn[disabled], .ob-btn[aria-busy="true"] { opacity: .6; cursor: progress; }
.ob-link-btn { background: none; border: 0; color: var(--ob-primary); font: inherit; font-size: 13px; cursor: pointer; text-decoration: underline; padding: 4px; }
.ob-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; border: 0; background: transparent; color: inherit; cursor: pointer; }
.ob-icon-btn:hover { background: var(--ob-subtle); }

/* Cards */
.ob-card {
	background: var(--ob-surface); border: 1px solid var(--ob-border); border-radius: var(--ob-radius);
	padding: 20px; margin: 0 0 16px; box-shadow: var(--ob-shadow);
}
.ob-card--highlight { border-color: color-mix(in srgb, var(--ob-primary) 35%, var(--ob-border)); }
.ob-card__title { font-size: 1.05rem; font-weight: 650; margin: 0 0 12px; }
.ob-card__footer { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--ob-border); display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ob-stack > .ob-card { margin-bottom: 16px; }

/* Badges */
.ob-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; line-height: 1.6; border: 1px solid transparent; }
.ob-badge--success { background: #e7f6ec; color: var(--ob-success); }
.ob-badge--warning { background: #fdf4dc; color: var(--ob-warning); }
.ob-badge--danger { background: #fdecec; color: var(--ob-danger); }
.ob-badge--info { background: #e8effd; color: var(--ob-info); }
.ob-badge--neutral { background: var(--ob-subtle); color: var(--ob-muted); border-color: var(--ob-border); }
.ob-count { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ob-primary); color: #fff; font-size: 11px; font-weight: 700; }

/* Notices / empty states */
.ob-notice { padding: 12px 16px; border-radius: var(--ob-radius); border: 1px solid var(--ob-border); background: var(--ob-subtle); margin: 0 0 16px; }
.ob-notice--warning { background: #fdf4dc; border-color: #f2d58a; }
.ob-notice--danger { background: #fdecec; border-color: #f4b8b8; }
.ob-empty { text-align: center; padding: 40px 16px; border: 1px dashed var(--ob-border); border-radius: var(--ob-radius); }
.ob-empty__title { font-weight: 600; font-size: 1.05rem; margin: 0 0 6px; }

/* Tables (stack into cards below 640px) */
.ob-table-wrap { overflow-x: auto; margin: 0 0 16px; border: 1px solid var(--ob-border); border-radius: var(--ob-radius); }
.ob-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.ob-table th { text-align: left; font-weight: 600; color: var(--ob-muted); background: var(--ob-subtle); padding: 10px 12px; border-bottom: 1px solid var(--ob-border); white-space: nowrap; }
.ob-table td { padding: 12px; border-bottom: 1px solid var(--ob-border); vertical-align: top; }
.ob-table tr:last-child td { border-bottom: 0; }
@media (max-width: 640px) {
	.ob-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.ob-table, .ob-table tbody, .ob-table tr, .ob-table td { display: block; width: 100%; }
	.ob-table tr { border-bottom: 1px solid var(--ob-border); padding: 8px 0; }
	.ob-table td { border: 0; padding: 6px 12px; display: grid; grid-template-columns: 38% 1fr; gap: 8px; }
	.ob-table td::before { content: attr(data-label); font-weight: 600; color: var(--ob-muted); }
	.ob-table td .ob-btn { white-space: normal; text-align: center; }
}

/* Lists */
.ob-list { list-style: none; margin: 0; padding: 0; }
.ob-list__item { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid var(--ob-border); }
.ob-list__item:last-child { border-bottom: 0; }
.ob-list__main { min-width: 0; flex: 1; }
.ob-list__title { font-weight: 600; overflow-wrap: anywhere; }
.ob-list__aside { flex-shrink: 0; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.ob-note { margin: 6px 0 0; color: var(--ob-text); }

/* Definition lists */
.ob-dl { display: grid; grid-template-columns: minmax(120px, 30%) 1fr; gap: 8px 16px; margin: 0; }
.ob-dl dt { color: var(--ob-muted); font-weight: 500; }
.ob-dl dd { margin: 0; overflow-wrap: anywhere; }
.ob-checklist { margin: 12px 0 0; padding-left: 20px; }

/* Grid + tiles */
.ob-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; margin: 0 0 16px; }
.ob-home-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.ob-home-grid .ob-card { margin: 0; }
.ob-tile { display: flex; flex-direction: column; border: 1px solid var(--ob-border); border-radius: var(--ob-radius); overflow: hidden; background: var(--ob-surface); box-shadow: var(--ob-shadow); }
.ob-tile.is-unavailable { opacity: .7; }
.ob-tile .ob-thumb { width: 100%; height: 140px; object-fit: cover; border-radius: 0; }
.ob-tile__body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.ob-tile__title { font-size: 1rem; font-weight: 650; margin: 0; line-height: 1.35; }
.ob-tile__actions { margin-top: auto; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.ob-price { margin: 0; font-weight: 600; }
.ob-thumb { display: inline-block; width: 48px; height: 48px; object-fit: cover; border-radius: 6px; background: var(--ob-subtle); vertical-align: middle; }
.ob-thumb--empty { background: linear-gradient(135deg, var(--ob-subtle), var(--ob-border)); }

/* Stats */
.ob-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 10px; margin: 0 0 12px; }
.ob-stat { display: flex; flex-direction: column; padding: 12px; border-radius: calc(var(--ob-radius) * .8); background: var(--ob-subtle); text-decoration: none !important; color: var(--ob-text) !important; }
.ob-stat__value { font-size: 1.5rem; font-weight: 700; line-height: 1.1; }
.ob-stat__label { font-size: 13px; color: var(--ob-muted); }

/* Progress */
.ob-progress { display: inline-block; width: calc(100% - 48px); height: 8px; border-radius: 999px; background: var(--ob-subtle); overflow: hidden; vertical-align: middle; border: 1px solid var(--ob-border); }
.ob-progress__bar { display: block; height: 100%; background: var(--ob-primary); border-radius: 999px; }
.ob-progress__text { display: inline-block; width: 44px; text-align: right; font-size: 12px; font-weight: 600; color: var(--ob-muted); vertical-align: middle; }

/* Filters, search, forms */
.ob-filters { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 16px; }
.ob-chip { border: 1px solid var(--ob-border); background: var(--ob-surface); color: var(--ob-text); border-radius: 999px; padding: 6px 14px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; min-height: 34px; }
.ob-chip.is-active { background: var(--ob-primary); border-color: var(--ob-primary); color: #fff; }
.ob-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-start; gap: 8px; }
.ob-search { margin: 0 0 16px; max-width: 360px; }
.ob-input { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid #c7ccd4; border-radius: calc(var(--ob-radius) * .7); background: var(--ob-surface); color: var(--ob-text); font: inherit; font-size: 15px; }
.ob-input:focus { border-color: var(--ob-primary); }
.ob-form { display: flex; flex-direction: column; gap: 12px; max-width: 560px; }
.ob-form--grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; max-width: 760px; }
.ob-form--grid .ob-span, .ob-form--grid button { grid-column: 1 / -1; justify-self: start; }
@media (max-width: 640px) { .ob-form--grid { grid-template-columns: 1fr; } }
.ob-field { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.ob-field label, .ob-reply label { font-weight: 600; font-size: 14px; }
.ob-form fieldset { border: 0; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.ob-form legend { font-weight: 600; margin-bottom: 4px; }
.ob-check { display: flex; gap: 8px; align-items: center; }
.ob-inline-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 0 0 16px; }
.ob-inline-form label { display: flex; flex-direction: column; font-size: 13px; font-weight: 600; gap: 4px; }
.ob-inline-form .ob-input { width: auto; }
.ob-qty { width: 72px; }

/* Pagination */
.ob-pagination { display: flex; gap: 12px; align-items: center; justify-content: center; margin: 16px 0; }

/* Notifications */
.ob-notifications { list-style: none; margin: 0 0 16px; padding: 0; }
.ob-notification { display: flex; gap: 12px; padding: 12px 8px; border-bottom: 1px solid var(--ob-border); align-items: flex-start; }
.ob-notification__dot { flex: 0 0 8px; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: transparent; }
.ob-notification.is-unread .ob-notification__dot { background: var(--ob-primary); }
.ob-notification.is-unread .ob-notification__title { font-weight: 650; }
.ob-notification__body { flex: 1; min-width: 0; }
.ob-notification__body p { margin: 0 0 2px; }
.ob-notification__actions { display: flex; gap: 4px; flex-wrap: wrap; }

/* Messages */
.ob-thread { display: flex; flex-direction: column; gap: 10px; max-height: 60vh; overflow-y: auto; padding: 12px; border: 1px solid var(--ob-border); border-radius: var(--ob-radius); background: var(--ob-subtle); margin: 0 0 16px; }
.ob-thread__msg { background: var(--ob-surface); border-radius: calc(var(--ob-radius) * .8); padding: 10px 12px; border: 1px solid var(--ob-border); }
.ob-thread__msg img { max-width: 100%; height: auto; }
.ob-reply { display: flex; flex-direction: column; gap: 8px; }
.ob-file { display: flex; flex-direction: column; gap: 4px; font-size: 13px; }

/* Checkout steps */
.ob-steps { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.ob-step { display: flex; gap: 12px; align-items: center; padding: 12px; border: 1px solid var(--ob-border); border-radius: calc(var(--ob-radius) * .8); }
.ob-step__n { flex: 0 0 28px; height: 28px; border-radius: 50%; background: var(--ob-primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 13px; }
.ob-step__body { flex: 1; min-width: 0; }

/* Favorite heart (rendered inside other plugins' cards) */
.ob-fav {
	all: unset; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center; gap: 6px;
	min-width: 36px; height: 36px; padding: 0 8px; border-radius: 999px; cursor: pointer;
	background: rgba(255, 255, 255, .92); color: #374151; border: 1px solid rgba(0, 0, 0, .12);
	font-size: 13px; font-weight: 600; font-family: inherit; line-height: 1;
}
.ob-fav__icon { width: 18px; height: 18px; }
.ob-fav.is-on { color: #dc2626; }
.ob-fav.is-on .ob-fav__icon { fill: currentColor; }
.ob-fav:hover { background: #fff; }
.ob-fav--labelled { padding: 0 14px; }

/* Toast */
.ob-toast { position: fixed; z-index: 100002; left: 50%; bottom: 24px; transform: translateX(-50%); background: #111827; color: #fff; padding: 10px 16px; border-radius: 8px; font-size: 14px; box-shadow: var(--ob-shadow); max-width: calc(100vw - 32px); }
.ob-toast--global { font-family: inherit; }

/* Loading skeleton */
.ob-main[aria-busy="true"] > * { opacity: .45; transition: opacity .15s; }

@media (prefers-reduced-motion: reduce) {
	.ob-app *, .ob-drawer *, .ob-fab-wrap * { transition: none !important; animation: none !important; }
}
.ob-card__footer .ob-cart-actions { margin-left: auto; display: inline-flex; gap: 8px; flex-wrap: wrap; }
.ob-cart-note { margin: 4px 0 0; }
