.tw-widget-table {
	position: relative;
	isolation: isolate;
	max-width: 100%;
	overflow: hidden;
	padding: clamp(.8rem, 1.5vw, 1.2rem);
	border: 1px solid color-mix(in srgb, var(--tw-color-brand) 14%, var(--tw-color-border));
	border-radius: 1.35rem;
	background: linear-gradient(145deg, rgb(255 255 255 / 94%), color-mix(in srgb, var(--tw-color-brand-soft) 34%, #fff));
	box-shadow: 0 1rem 2.8rem rgb(35 30 18 / 6%);
	color: var(--tw-color-text);
}

.tw-widget-table::before {
	position: absolute;
	z-index: -1;
	inset: 0;
	background:
		radial-gradient(circle at 88% 0, color-mix(in srgb, var(--tw-color-brand) 12%, transparent), transparent 28%),
		linear-gradient(color-mix(in srgb, var(--tw-color-brand) 4%, transparent) 1px, transparent 1px),
		linear-gradient(90deg, color-mix(in srgb, var(--tw-color-brand) 4%, transparent) 1px, transparent 1px);
	background-size: auto, 4rem 4rem, 4rem 4rem;
	content: '';
	pointer-events: none;
}

.tw-widget-table__header { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-block-end: .75rem; padding-block-end: .8rem; border-block-end: 1px solid var(--tw-color-border); }
.tw-widget-table__title { display: flex; align-items: center; gap: .65rem; }
.tw-widget-table__title > span { display: grid; width: 2.75rem; aspect-ratio: 1; border: 1px solid var(--tw-color-border); border-radius: .85rem; background: var(--tw-color-brand-soft); color: var(--tw-color-focus); place-items: center; }
.tw-widget-table__title svg { width: 1.1rem; }
.tw-widget-table__title small { display: block; color: var(--tw-color-text-muted); font-size: .58rem; }
.tw-widget-table__title h2 { margin: .12rem 0 0; color: var(--tw-color-ink); font-size: clamp(1rem, 1.6vw, 1.35rem); }
.tw-widget-table__badge { display: inline-flex; min-height: 2.65rem; align-items: center; padding-inline: .8rem; border: 1px solid var(--tw-color-border); border-radius: .8rem; background: #fff; color: var(--tw-color-ink); font-size: .66rem; font-weight: 800; white-space: nowrap; }
.tw-widget-table__hint { display: none; margin: 0; }
.tw-widget-table__viewport { max-width: 100%; overflow-x: auto; contain: inline-size layout paint; border: 1px solid var(--tw-color-border); border-radius: 1rem; background: rgb(255 255 255 / 78%); overscroll-behavior-inline: contain; scrollbar-color: var(--tw-color-brand) var(--tw-color-surface-subtle); scrollbar-width: thin; }
.tw-widget-table__viewport:focus-visible { outline: 3px solid var(--tw-color-focus-ring); outline-offset: -4px; }
.tw-widget-table table { width: 100%; min-width: 46rem; border-spacing: 0; border-collapse: separate; table-layout: fixed; }
.tw-widget-table th,
.tw-widget-table td { padding: clamp(.8rem, 1.8vw, 1.15rem); border-block-end: 1px solid var(--tw-color-border); color: var(--tw-color-text-muted); font-size: clamp(.72rem, 1vw, .86rem); line-height: 1.75; text-align: center; vertical-align: middle; }
.tw-widget-table thead th { position: relative; height: 7.4rem; border-block-end-color: color-mix(in srgb, var(--tw-color-brand) 26%, var(--tw-color-border)); background: color-mix(in srgb, var(--tw-color-brand-soft) 44%, #fff); color: var(--tw-color-ink); font-weight: 850; }
.tw-widget-table thead th:first-child,
.tw-widget-table tbody th { width: clamp(9.5rem, 17vw, 13rem); color: var(--tw-color-ink); font-weight: 850; text-align: start; }
.tw-widget-table tbody th { position: sticky; z-index: 2; inset-inline-start: 0; background: linear-gradient(145deg, #fff, #fbfaf6); box-shadow: -1px 0 var(--tw-color-border) inset; }
.tw-widget-table tbody tr:last-child > * { border-block-end: 0; }
.tw-widget-table tbody tr { transition: background-color 200ms ease; }
.tw-widget-table tbody td { background: rgb(255 255 255 / 55%); }
.tw-widget-table__media { display: grid; width: 5.2rem; height: 5.2rem; margin-inline: auto; overflow: hidden; border: 1px solid var(--tw-color-border); border-radius: 1rem; background: #fff; box-shadow: 0 .65rem 1.6rem rgb(35 30 18 / 6%); place-items: center; }
.tw-widget-table img { display: block; width: 100%; height: 100%; object-fit: contain; padding: .38rem; }
.tw-widget-table__column-title { display: block; margin-block-start: .45rem; color: var(--tw-color-ink); font-size: .72rem; }
.tw-widget-table :is(td, th) :is(strong, b) { color: var(--tw-color-focus); font-weight: 900; }
.tw-widget-table :is(td, th) a { color: var(--tw-color-focus); font-weight: 800; text-underline-offset: .2em; }

@media (hover: hover) {
	.tw-widget-table { transition: border-color 220ms ease, box-shadow 280ms ease, transform 280ms var(--tw-ease-standard); }
	.tw-widget-table:hover { border-color: color-mix(in srgb, var(--tw-color-brand) 42%, var(--tw-color-border)); box-shadow: 0 1.6rem 3.5rem rgb(42 33 7 / 11%); transform: translateY(-3px); }
	.tw-widget-table tbody tr:hover { background: color-mix(in srgb, var(--tw-color-brand-soft) 42%, transparent); }
	.tw-widget-table tbody tr:hover td { color: var(--tw-color-ink); }
}

@media (max-width: 700px) {
	.tw-widget-table { padding: .75rem; border-radius: 1rem; }
	.tw-widget-table__header { align-items: flex-start; margin-block-end: .55rem; padding-block-end: .65rem; }
	.tw-widget-table__title small { display: none; }
	.tw-widget-table__title > span { width: 2.5rem; border-radius: .75rem; }
	.tw-widget-table__badge { min-height: 2.5rem; padding-inline: .65rem; font-size: .61rem; }
	.tw-widget-table__hint { display: flex; min-height: 2.7rem; align-items: center; padding: .65rem .8rem .5rem; color: var(--tw-color-text-muted); font-size: .64rem; line-height: 1.7; }
	.tw-widget-table__hint::before { width: .42rem; height: .42rem; margin-inline-end: .45rem; border-radius: 50%; background: var(--tw-color-brand); box-shadow: 0 0 0 .25rem rgb(225 178 47 / 10%); content: ''; }
	.tw-widget-table table { width: max-content; min-width: 100%; table-layout: auto; }
	.tw-widget-table thead th:first-child,
	.tw-widget-table tbody th { width: 8rem; min-width: 8rem; max-width: 8rem; }
	.tw-widget-table thead th:not(:first-child),
	.tw-widget-table tbody td { width: min(58vw, 13rem); min-width: min(58vw, 13rem); scroll-snap-align: start; }
	.tw-widget-table__viewport { scroll-snap-type: inline proximity; }
	.tw-widget-table th,
	.tw-widget-table td { padding: .8rem .7rem; font-size: .7rem; }
	.tw-widget-table thead th { height: 6.4rem; }
	.tw-widget-table__media { width: 4.25rem; height: 4.25rem; border-radius: .8rem; }
}

@media (prefers-reduced-motion: reduce) {
	.tw-widget-table,
	.tw-widget-table tbody tr { transition: none; transform: none; }
}

/* Standalone builder tables share the page shell without shrinking nested tables. */
#main-content > .tw-widget-table {
	box-sizing: border-box;
	width: min(calc(100% - (2 * var(--tw-gutter))), var(--tw-page-shell));
	margin-inline: auto;
}
