/* Capricorn Fleet Manager — estilos base del frontend */

.cfm-app {
	margin: 1rem 0;
}

.cfm-app .cfm-placeholder {
	opacity: 0.7;
	font-style: italic;
}

.cfm-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.cfm-table th,
.cfm-table td {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
}

.cfm-table th {
	font-weight: 600;
}

.cfm-table .cfm-col-num {
	text-align: right;
	white-space: nowrap;
}

.cfm-table .cfm-col-img {
	width: 56px;
}

.cfm-table .cfm-col-img img {
	width: 48px;
	height: auto;
	border-radius: 3px;
	display: block;
}

.cfm-fleet-table-title {
	margin: 0 0 0.5rem;
}

.cfm-empty {
	opacity: 0.7;
	font-style: italic;
}

/* Resumen / estadísticas */
.cfm-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.cfm-stat {
	font-size: 0.9rem;
	opacity: 0.85;
}

.cfm-stat strong {
	font-size: 1.05rem;
}

/* Insignia de estado de producción */
.cfm-badge {
	display: inline-block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 0.1rem 0.4rem;
	border-radius: 3px;
	background: rgba( 0, 0, 0, 0.08 );
	margin-top: 0.2rem;
}

/* Filtros y toolbar */
.cfm-filter,
.cfm-toolbar select {
	padding: 0.4rem 0.6rem;
	margin-bottom: 0.5rem;
}

.cfm-toolbar {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

/* Formularios de alta */
.cfm-add-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.cfm-add-form h4 {
	width: 100%;
	margin: 0;
}

.cfm-add-form input,
.cfm-add-form select,
.cfm-add-form textarea {
	padding: 0.4rem 0.6rem;
}

.cfm-add-form textarea {
	width: 100%;
	min-height: 3rem;
}

.cfm-btn,
.cfm-add-form button {
	cursor: pointer;
	padding: 0.4rem 0.8rem;
}

.cfm-btn-del {
	color: #b00;
	background: none;
	border: 1px solid currentColor;
	border-radius: 3px;
	cursor: pointer;
}

.cfm-vis {
	padding: 0.2rem 0.4rem;
}

/* ------------------------------------------------------------------ */
/* Tarjetas de hangar/buyback (mismas clases de BuddyBoss Platform:    */
/* item-entry, list-wrap, list-wrap-inner, item-avatar, item,          */
/* item-block, item-meta, list-title, member-buttons-wrap — heredan    */
/* tipografía/spacing/hover del tema; aquí solo fijamos el grid y el   */
/* acento de color por fabricante, que no existen en BuddyBoss).       */
/* ------------------------------------------------------------------ */

.cfm-ship-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 260px, 1fr ) );
	gap: 1rem;
	list-style: none;
	margin: 0.75rem 0 0;
	padding: 0;
}

.cfm-ship-card .item-avatar {
	position: relative;
	border-top: 3px solid var( --cfm-mfr-color, transparent );
}

.cfm-ship-card .item-avatar img {
	width: 100%;
	height: auto;
	display: block;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.cfm-ship-card .item-meta.cfm-badge {
	display: inline-block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 0.1rem 0.4rem;
	border-radius: 3px;
	background: rgba( 0, 0, 0, 0.08 );
}

.cfm-ship-card .item-meta.cfm-notes {
	opacity: 0.75;
}

.cfm-visibility {
	margin: 0.4rem 0;
}

.cfm-visibility .cfm-vis {
	width: 100%;
	padding: 0.3rem 0.5rem;
}

/* Interruptores generales de compartición + botón de refresco */
.cfm-owner-toolbar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.cfm-share-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	cursor: pointer;
	font-size: 0.9rem;
}

.cfm-refresh-wrap {
	margin-left: auto;
}

.cfm-btn-refresh,
.cfm-btn-refresh-install {
	cursor: pointer;
	padding: 0.4rem 0.9rem;
	border-radius: 4px;
	border: 1px solid rgba( 0, 0, 0, 0.2 );
	background: transparent;
	font-weight: 600;
	text-decoration: none;
	color: inherit;
}

.cfm-btn-refresh:disabled {
	opacity: 0.6;
	cursor: default;
}

/* Chips de fabricante (filtro visual) */
.cfm-mfr-chips {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0.5rem 0;
}

.cfm-chip {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	padding: 0.25rem 0.65rem;
	border-radius: 999px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	background: transparent;
	cursor: pointer;
	font-size: 0.8rem;
}

.cfm-chip.is-active {
	background: rgba( 0, 0, 0, 0.08 );
	font-weight: 600;
}

.cfm-chip-dot {
	width: 0.6rem;
	height: 0.6rem;
	border-radius: 50%;
	display: inline-block;
}

/* Mercado */
.cfm-market-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 1rem;
	margin-top: 1rem;
}

.cfm-card {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	padding: 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.cfm-card h4 {
	margin: 0;
}

.cfm-card-type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
}

.cfm-card-price {
	font-weight: 600;
}

.cfm-card-meta {
	font-size: 0.8rem;
	opacity: 0.7;
	margin-top: auto;
}

.cfm-card-actions {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.cfm-market-create {
	margin: 0.5rem 0 1rem;
}

.cfm-market-create summary {
	cursor: pointer;
	font-weight: 600;
}
/* Tarjetas autosuficientes: no dependen del CSS interno de BuddyBoss. */
.cfm-ship-card .list-wrap {
	height: 100%;
	border: 1px solid rgba( 15, 23, 42, 0.12 );
	border-radius: 10px;
	background: #fff;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba( 15, 23, 42, 0.05 );
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.cfm-ship-card .list-wrap:hover {
	transform: translateY( -2px );
	box-shadow: 0 8px 22px rgba( 15, 23, 42, 0.1 );
}

.cfm-ship-card .list-wrap-inner {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.cfm-ship-card .item-avatar {
	min-height: 110px;
	background: linear-gradient( 135deg, #111827, #334155 );
}

.cfm-ship-placeholder {
	display: grid;
	place-items: center;
	min-height: 110px;
	color: rgba( 255, 255, 255, 0.55 );
	font-size: 1.6rem;
}

.cfm-ship-card > .list-wrap .item {
	padding: 0.9rem 1rem 0.75rem;
	flex: 1;
}

.cfm-ship-card .list-title {
	font-size: 1rem;
	line-height: 1.35;
	margin: 0.25rem 0 0.5rem;
	overflow-wrap: anywhere;
}

.cfm-ship-card .item-meta {
	font-size: 0.78rem;
	line-height: 1.4;
	margin: 0.2rem 0;
}

.cfm-ship-card .member-buttons-wrap {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
}

.cfm-ship-card .cfm-btn-del {
	width: 30px;
	height: 30px;
	border: 0;
	border-radius: 50%;
	background: rgba( 255, 255, 255, 0.92 );
	color: #991b1b;
	box-shadow: 0 1px 5px rgba( 0, 0, 0, 0.18 );
}

.cfm-pledge-type {
	display: inline-block;
	width: fit-content;
	padding: 0.15rem 0.45rem;
	border-radius: 999px;
	background: #e2e8f0;
	color: #334155;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.035em;
}

.cfm-pledge-type-upgrade { background: #ede9fe; color: #6d28d9; }
.cfm-pledge-type-paint { background: #fce7f3; color: #be185d; }
.cfm-pledge-type-gear { background: #fee2e2; color: #b91c1c; }
.cfm-pledge-type-pack { background: #dbeafe; color: #1d4ed8; }
.cfm-pledge-type-addon { background: #fef3c7; color: #92400e; }

.cfm-buyback-controls {
	display: grid;
	grid-template-columns: minmax( 240px, 1fr ) minmax( 180px, 260px );
	gap: 0.65rem;
	margin: 0.65rem 0;
}

.cfm-buyback-controls .cfm-filter,
.cfm-buyback-controls .cfm-filter-type {
	width: 100%;
	margin: 0;
	padding: 0.6rem 0.75rem;
}

.cfm-buyback-grid {
	grid-template-columns: repeat( auto-fill, minmax( 235px, 1fr ) );
}

.cfm-load-more {
	display: block;
	margin: 1rem auto;
	min-width: 180px;
}

.cfm-load-more[hidden] { display: none; }

@media ( max-width: 640px ) {
	.cfm-buyback-controls { grid-template-columns: 1fr; }
	.cfm-ship-grid, .cfm-buyback-grid { grid-template-columns: 1fr; }
}
/* Inventario RSI: naves por defecto y paquetes agrupados. */
.cfm-fleet-controls {
	display: grid;
	grid-template-columns: minmax( 240px, 1fr ) minmax( 220px, 320px );
	gap: 0.65rem;
	margin: 0.65rem 0;
}

.cfm-fleet-controls .cfm-filter,
.cfm-fleet-controls .cfm-filter-type {
	width: 100%;
	margin: 0;
	padding: 0.6rem 0.75rem;
}

.cfm-fleet-grid {
	grid-auto-flow: dense;
}

.cfm-fleet-grid > .cfm-pledge-group {
	grid-column: 1 / -1;
	list-style: none;
	border: 1px solid rgba( 148, 163, 184, 0.35 );
	border-radius: 12px;
	background: #fff;
	padding: 0.75rem;
}

.cfm-pledge-header {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.65rem;
	margin-bottom: 0.75rem;
}

.cfm-pledge-header h3 {
	font-size: 1.05rem;
	line-height: 1.3;
	margin: 0.2rem 0 0;
}

.cfm-pledge-label {
	display: inline-block;
	padding: 0.12rem 0.45rem;
	border-radius: 999px;
	background: #2563eb;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.045em;
}

.cfm-pledge-meta {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	font-size: 0.78rem;
	color: #475569;
}

.cfm-pledge-meta strong {
	font-size: 0.95rem;
	color: #0f172a;
}

.cfm-package-pricing {
	display: grid;
	gap: 0.15rem;
	min-width: 235px;
	margin: 0.35rem 0 0;
}

.cfm-package-pricing div,
.cfm-ship-pricing div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
}

.cfm-package-pricing dt,
.cfm-ship-pricing dt {
	font-weight: 400;
	color: #64748b;
}

.cfm-package-pricing dd,
.cfm-ship-pricing dd {
	margin: 0;
	font-weight: 700;
	color: #0f172a;
	text-align: right;
}

.cfm-package-pricing .is-saving dd {
	color: #15803d;
}

.cfm-package-pricing .is-overcost dd {
	color: #b45309;
}

.cfm-ship-pricing {
	display: grid;
	gap: 0.15rem;
	margin: 0.65rem 0 0;
	padding-top: 0.55rem;
	border-top: 1px solid rgba( 148, 163, 184, 0.35 );
	font-size: 0.75rem;
}
.cfm-pledge-hint {
	flex-basis: 100%;
	margin: 0;
	font-size: 0.76rem;
	color: #64748b;
}

.cfm-pledge-items {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 0.75rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cfm-fleet-grid > .cfm-pledge-group.is-compact {
	grid-column: auto;
	padding: 0;
	overflow: hidden;
}

.cfm-pledge-group.is-compact .cfm-pledge-header {
	display: block;
	margin: 0;
	padding: 0.7rem 0.8rem 0.55rem;
	border-bottom: 1px solid rgba( 148, 163, 184, 0.25 );
}

.cfm-pledge-group.is-compact .cfm-pledge-meta {
	align-items: flex-start;
	margin-top: 0.4rem;
}

.cfm-pledge-group.is-compact .cfm-package-pricing {
	min-width: 0;
	width: 100%;
}

.cfm-pledge-group.is-compact .cfm-pledge-hint {
	display: none;
}

.cfm-pledge-group.is-compact .cfm-pledge-items {
	grid-template-columns: 1fr;
	gap: 0;
	padding: 0;
}

.cfm-pledge-group.is-compact .cfm-ship-card .list-wrap {
	border: 0;
	border-radius: 0;
	box-shadow: none;
}

.cfm-pledge-group.is-compact .cfm-ship-card .list-wrap:hover {
	transform: none;
	box-shadow: none;
}

.cfm-unverified {
	background: #fef3c7 !important;
	color: #92400e;
}

/* Hangar público y catálogo de organización simplificados. */
.cfm-simple-hangar-grid,
.cfm-org-fleet-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.cfm-simple-ship-card {
	overflow: hidden;
	list-style: none;
	border: 1px solid rgba( 148, 163, 184, 0.35 );
	border-radius: 12px;
	background: #fff;
	box-shadow: 0 5px 16px rgba( 15, 23, 42, 0.07 );
}

.cfm-simple-ship-image {
	display: grid;
	place-items: center;
	aspect-ratio: 16 / 9;
	background: #0f172a;
	color: #94a3b8;
	overflow: hidden;
}

.cfm-simple-ship-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.cfm-simple-ship-card.is-unowned .cfm-simple-ship-image img {
	filter: grayscale( 1 );
	opacity: 0.58;
}

.cfm-manufacturer-label {
	display: flex;
	align-items: center;
	gap: 0.45rem;
	width: fit-content;
	max-width: calc( 100% - 1.4rem );
	margin: 0.7rem 0.7rem 0;
	padding: 0.25rem 0.58rem;
	border-radius: 999px;
	background: var( --cfm-mfr-color, #6b7280 );
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.2;
	text-shadow: 0 1px 2px rgba( 0, 0, 0, 0.45 );
}

.cfm-manufacturer-label img {
	width: 22px;
	height: 22px;
	object-fit: contain;
	filter: drop-shadow( 0 1px 1px rgba( 0, 0, 0, 0.35 ) );
}

.cfm-simple-ship-card h3 {
	margin: 0;
	padding: 0.7rem;
	font-size: 1rem;
	line-height: 1.35;
}

.cfm-simple-ship-card h3 a {
	color: inherit;
	text-decoration: none;
}

.cfm-org-count {
	color: #2563eb;
}

.cfm-hangar-count {
	margin: 0 0 0.75rem;
	color: #64748b;
}

@media ( max-width: 640px ) {
	.cfm-fleet-controls { grid-template-columns: 1fr; }
	.cfm-pledge-meta { align-items: flex-start; }
	.cfm-pledge-items { grid-template-columns: 1fr; }
}

/* CCU and editing additions */
/* Capricorn Fleet Manager — estilos base del frontend */

.cfm-app {
	margin: 1rem 0;
}

.cfm-app .cfm-placeholder {
	opacity: 0.7;
	font-style: italic;
}

.cfm-table {
	width: 100%;
	border-collapse: collapse;
	margin-top: 0.5rem;
}

.cfm-table th,
.cfm-table td {
	text-align: left;
	padding: 0.5rem 0.75rem;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.1 );
}

.cfm-table th {
	font-weight: 600;
}

.cfm-table .cfm-col-num {
	text-align: right;
	white-space: nowrap;
}

.cfm-table .cfm-col-img {
	width: 56px;
}

.cfm-table .cfm-col-img img {
	width: 48px;
	height: auto;
	border-radius: 3px;
	display: block;
}

.cfm-fleet-table-title {
	margin: 0 0 0.5rem;
}

.cfm-empty {
	opacity: 0.7;
	font-style: italic;
}

/* Resumen / estadísticas */
.cfm-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: 0.75rem;
}

.cfm-stat {
	font-size: 0.9rem;
	opacity: 0.85;
}

.cfm-stat strong {
	font-size: 1.05rem;
}

/* Insignia de estado de producción */
.cfm-badge {
	display: inline-block;
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	padding: 0.1rem 0.4rem;
	border-radius: 3px;
	background: rgba( 0, 0, 0, 0.08 );
	margin-top: 0.2rem;
}

/* Filtros y toolbar */
.cfm-filter,
.cfm-toolbar select {
	padding: 0.4rem 0.6rem;
	margin-bottom: 0.5rem;
}

.cfm-toolbar {
	display: flex;
	gap: 0.5rem;
	align-items: center;
	margin-bottom: 0.75rem;
}

/* Formularios de alta */
.cfm-add-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	align-items: center;
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.cfm-add-form h4 {
	width: 100%;
	margin: 0;
}

.cfm-add-form input,
.cfm-add-form select,
.cfm-add-form textarea {
	padding: 0.4rem 0.6rem;
}

.cfm-add-form textarea {
	width: 100%;
	min-height: 3rem;
}

.cfm-btn,
.cfm-add-form button {
	cursor: pointer;
	padding: 0.4rem 0.8rem;
}

.cfm-btn-del {
	color: #b00;
	background: none;
	border: 1px solid currentColor;
	border-radius: 3px;
	cursor: pointer;
}

.cfm-vis {
	padding: 0.2rem 0.4rem;
}

/* Mercado */
.cfm-market-grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 1rem;
	margin-top: 1rem;
}

.cfm-card {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	padding: 0.9rem;
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.cfm-card h4 {
	margin: 0;
}

.cfm-card-type {
	font-size: 0.7rem;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	opacity: 0.6;
}

.cfm-card-price {
	font-weight: 600;
}

.cfm-card-meta {
	font-size: 0.8rem;
	opacity: 0.7;
	margin-top: auto;
}

.cfm-card-actions {
	display: flex;
	gap: 0.4rem;
	flex-wrap: wrap;
}

.cfm-market-create {
	margin: 0.5rem 0 1rem;
}

.cfm-market-create summary {
	cursor: pointer;
	font-weight: 600;
}

/* Planificador de CCU */
.cfm-note {
	font-size: 0.85rem;
	background: rgba( 0, 0, 0, 0.05 );
	border-left: 3px solid rgba( 0, 0, 0, 0.2 );
	padding: 0.5rem 0.75rem;
	margin: 0 0 1rem;
}

.cfm-ccu-builder {
	border: 1px solid rgba( 0, 0, 0, 0.12 );
	border-radius: 6px;
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}

.cfm-ccu-builder summary {
	cursor: pointer;
	font-weight: 600;
}

.cfm-builder-inner {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-top: 0.75rem;
}

.cfm-chain-name,
.cfm-step-form input {
	padding: 0.4rem 0.6rem;
}

.cfm-owned-ccus {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.cfm-chip {
	cursor: pointer;
	border: 1px dashed rgba( 0, 0, 0, 0.3 );
	border-radius: 12px;
	padding: 0.2rem 0.6rem;
	background: none;
	font-size: 0.85rem;
}

.cfm-step-row {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0;
	border-bottom: 1px solid rgba( 0, 0, 0, 0.08 );
}

.cfm-step-row .cfm-btn-del {
	margin-left: auto;
}

.cfm-chains {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 280px, 1fr ) );
	gap: 1rem;
	margin-top: 1rem;
}

.cfm-chain-steps {
	margin: 0.5rem 0;
	padding-left: 1.2rem;
}

.cfm-chain-steps li {
	margin: 0.15rem 0;
}

.cfm-step-cost {
	opacity: 0.7;
	font-size: 0.85rem;
}

.cfm-chain-totals {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-top: 0.5rem;
	padding-top: 0.5rem;
	border-top: 1px solid rgba( 0, 0, 0, 0.1 );
}

.cfm-owned {
	background: rgba( 40, 140, 60, 0.15 );
}

.cfm-save-pos strong {
	color: #1a7f37;
}

.cfm-save-neg strong {
	color: #b00;
}

.cfm-btn-primary {
	font-weight: 600;
}

.cfm-badge-est {
	background: rgba( 200, 140, 0, 0.18 );
}

.cfm-app { min-width: 0; max-width: 100%; }
.cfm-table-scroll { width: 100%; overflow-x: auto; }
.cfm-inline-edit { display: flex; flex-direction: column; gap: .5rem; min-width: 150px; }
.cfm-inline-edit label { display: flex; flex-direction: column; }
.cfm-inline-edit input, .cfm-inline-edit textarea { max-width: 100%; min-width: 0; }
.cfm-add-form { flex-wrap: wrap; }
.cfm-error { color: #a00; border-left: 3px solid currentColor; padding: .5rem; }

/* BuddyBoss surfaces: inherit the site's palette and typography. */
.cfm-app, .cfm-fleet-table-wrap {
	--cfm-accent: var(--bb-primary-color, #385dff);
	--cfm-surface: var(--bb-content-background-color, #fff);
	--cfm-line: var(--bb-content-border-color, #e5e7eb);
	--cfm-text: var(--bb-body-text-color, #374151);
	--cfm-muted: var(--bb-alternate-text-color, #64748b);
	font-family: inherit; color: var(--cfm-text); line-height: 1.55;
}
.cfm-app *, .cfm-fleet-table-wrap * { box-sizing: border-box; }
.cfm-connect { padding: clamp(20px, 3vw, 32px); border: 1px solid var(--cfm-line); border-radius: 16px; background: var(--cfm-surface); box-shadow: 0 3px 16px rgba(15,23,42,.03); }
.cfm-sync-heading { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; }
.cfm-app .cfm-sync-heading h2 { margin: 5px 0 8px; font-size: clamp(23px, 2.5vw, 30px); line-height: 1.2; letter-spacing: -.025em; color: inherit; }
.cfm-sync-heading p { margin: 0; color: var(--cfm-muted); font-size: 14px; }
.cfm-eyebrow { font-size: 11px; letter-spacing: .12em; font-weight: 700; color: var(--cfm-accent); }
.cfm-sync-badge { flex-shrink: 0; border: 1px solid var(--cfm-line); border-radius: 100px; padding: 5px 11px; color: var(--cfm-muted); font-size: 12px; }
.cfm-sync-status { margin: 22px 0 14px; padding: 12px 15px; border-radius: 9px; background: var(--bb-body-background-color, #f6f8fb); font-size: 14px; overflow-wrap: anywhere; }
.cfm-sync-status.is-error { color: #922b30; background: #fff4f3; border: 1px solid #f4d5d2; }
.cfm-sync-progress { width: 100%; height: 9px; accent-color: var(--cfm-accent); margin: 0 0 16px; }
.cfm-sync-progress[hidden] { display: none; }
.cfm-sync-actions, .cfm-sync-links { display: flex; gap: 10px; flex-wrap: wrap; }
.cfm-app button.cfm-btn, .cfm-app .cfm-add-form button, .cfm-app .cfm-chip, .cfm-app .cfm-mfr-chips button {
	font: inherit; font-size: 13px; font-weight: 500; min-height: 40px; padding: 9px 15px; border: 1px solid var(--cfm-line); border-radius: 8px; background: var(--cfm-surface); color: var(--cfm-text); box-shadow: none; cursor: pointer; line-height: 1.4; white-space: normal;
}
.cfm-app button.cfm-btn:hover, .cfm-app .cfm-chip:hover { border-color: var(--cfm-accent); color: var(--cfm-accent); }
.cfm-app button.cfm-btn-primary, .cfm-app .cfm-add-form button { background: var(--cfm-accent); border-color: var(--cfm-accent); color: #fff; }
.cfm-app button:disabled { opacity: .5; cursor: not-allowed; }
.cfm-app button:focus-visible, .cfm-app a:focus-visible, .cfm-app summary:focus-visible { outline: 2px solid var(--cfm-accent); outline-offset: 3px; }
.cfm-sync-help { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin: 16px 0 12px; color: var(--cfm-muted); font-size: 12px; }
.cfm-sync-help span { max-width: 68ch; }
.cfm-sync-help button { flex-shrink: 0; }
.cfm-sync-links a { font-size: 12px; color: var(--cfm-accent); text-decoration: none; }
.cfm-connection-settings { border-top: 1px solid var(--cfm-line); margin-top: 20px; padding-top: 15px; font-size: 13px; color: var(--cfm-muted); }
.cfm-connection-settings summary, .cfm-manual-add summary { cursor: pointer; font-weight: 500; }
.cfm-connection-settings p { margin: 12px 0; }
.cfm-owner-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--cfm-line); margin-bottom: 20px; }
.cfm-owner-toolbar label { margin: 0; font-size: 13px; }
.cfm-summary { gap: 14px; margin: 20px 0; }
.cfm-stat { padding: 15px 18px; border: 1px solid var(--cfm-line); border-radius: 10px; background: var(--cfm-surface); opacity: 1; color: var(--cfm-muted); }
.cfm-stat strong { color: var(--cfm-text); font-size: 21px; font-weight: 600; margin-right: 5px; }
.cfm-manual-add { border: 1px solid var(--cfm-line); border-radius: 10px; padding: 14px 18px; margin: 12px 0 20px; font-size: 13px; background: var(--cfm-surface); }
.cfm-app input:not([type=checkbox]), .cfm-app select, .cfm-app textarea { border: 1px solid var(--cfm-line); border-radius: 8px; font: inherit; font-size: 14px; min-height: 40px; background: var(--cfm-surface); color: var(--cfm-text); max-width: 100%; }
.cfm-app .cfm-fleet-controls { gap: 12px; }
.cfm-app .cfm-mfr-chips { gap: 7px; margin: 14px 0 22px; }
.cfm-app .cfm-mfr-chips button { min-height: 34px; padding: 6px 12px; border-radius: 100px; font-size: 12px; }
.cfm-app .cfm-mfr-chips button.is-active { color: var(--cfm-accent); border-color: var(--cfm-accent); }
.cfm-ship-card .list-wrap, .cfm-card, .cfm-simple-ship-card { border-color: var(--cfm-line); border-radius: 12px; background: var(--cfm-surface); box-shadow: 0 2px 7px rgba(15,23,42,.03); }
.cfm-ship-card .list-wrap:hover { transform: none; box-shadow: 0 5px 18px rgba(15,23,42,.07); }
.cfm-app .cfm-ship-card .cfm-btn-del { width: auto; height: auto; min-height: 40px; border-radius: 8px; box-shadow: none; color: #922b30; }
.cfm-app .cfm-owned-ccus { max-height: 320px; overflow-y: auto; padding: 4px; margin: 12px 0; }
.cfm-app .cfm-step-row { flex-wrap: wrap; padding: 12px 0; }
.cfm-ship-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); }
@media (max-width: 600px) {
	.cfm-sync-heading, .cfm-sync-help { flex-direction: column; gap: 12px; }
	.cfm-sync-actions { flex-direction: column; }
	.cfm-sync-actions button, .cfm-sync-help button { width: 100%; }
	.cfm-sync-badge { font-size: 11px; }
	.cfm-sync-links { gap: 10px 16px; }
	.cfm-stat { width: 100%; }
	.cfm-toolbar { flex-wrap: wrap; }
}
@media (prefers-reduced-motion: reduce) { .cfm-app *, .cfm-fleet-table-wrap * { transition: none !important; } }

/* Inventory cards: image first, quiet metadata and on-demand owner controls. */
.cfm-app .cfm-fleet-grid { align-items: start; gap: 22px; }
.cfm-app .cfm-pledge-items { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); gap: 18px; align-items: start; }
.cfm-app .cfm-fleet-grid > .cfm-pledge-group { border: 1px solid var(--cfm-line); background: var(--cfm-surface); padding: 22px; border-radius: 16px; }
.cfm-app .cfm-pledge-header { align-items: start; gap: 12px 24px; margin: 0 0 20px; }
.cfm-app .cfm-pledge-header h3 { font-size: 16px; font-weight: 600; line-height: 1.45; margin: 5px 0 0; color: var(--cfm-text); }
.cfm-app .cfm-pledge-label { padding: 0; background: none; color: var(--cfm-muted); font-size: 10px; letter-spacing: .11em; font-weight: 600; }
.cfm-app .cfm-pledge-meta { gap: 4px; font-size: 11px; color: var(--cfm-muted); }
.cfm-app .cfm-pack-breakdown { font-weight: 500; color: var(--cfm-text); }
.cfm-app .cfm-package-pricing { min-width: 0; font-size: 11px; max-width: 340px; }
.cfm-app .cfm-package-pricing dd { font-size: 11px; font-weight: 600; }
.cfm-app .cfm-pledge-hint { font-size: 11px; margin-top: 2px; }
.cfm-app .cfm-fleet-grid > .cfm-pledge-group.is-compact { display: flex; flex-direction: column; padding: 0; }
.cfm-app .cfm-pledge-group.is-compact > .cfm-pledge-items { order: 0; width: 100%; }
.cfm-app .cfm-pledge-group.is-compact > .cfm-pledge-header { order: 1; margin: 0; padding: 14px 18px; border: 0; border-top: 1px solid var(--cfm-line); background: var(--bb-body-background-color, #f8fafc); width: 100%; }
.cfm-app .cfm-pledge-group.is-compact .cfm-pledge-header h3 { font-size: 12px; margin: 3px 0 5px; font-weight: 500; }
.cfm-app .cfm-pledge-group.is-compact .cfm-pledge-meta { margin: 0; }
.cfm-app .cfm-ship-card .list-wrap { border-radius: 12px; overflow: hidden; }
.cfm-app .cfm-ship-card .list-wrap-inner { display: flex; flex-direction: column; height: auto; }
.cfm-app .cfm-ship-card .item-avatar { width: 100%; aspect-ratio: 16 / 10; min-height: 0; margin: 0; background: #172432; overflow: hidden; }
.cfm-app .cfm-ship-card .item-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; border-radius: 0; }
.cfm-app .cfm-ship-card .cfm-ship-placeholder { height: 100%; min-height: 0; background: radial-gradient(ellipse at 50% 80%, #354861, #172432 75%); color: #9eafc3; }
.cfm-app .cfm-ship-card .item { display: flex; flex-direction: column; padding: 18px; gap: 0; min-height: 0; }
.cfm-app .cfm-ship-card .item-block { margin: 0; width: 100%; }
.cfm-app .cfm-ship-card h2.list-title { font-size: 18px; line-height: 1.3; letter-spacing: -.025em; font-weight: 650; margin: 5px 0 12px; min-height: 0; padding: 0; }
.cfm-app .cfm-ship-card .list-title a { color: var(--cfm-text); }
.cfm-app .cfm-ship-card p.item-meta { font-size: 12px; line-height: 1.55; margin: 0 0 6px; color: var(--cfm-muted); }
.cfm-app .cfm-ship-card p.member-type { font-size: 11px; letter-spacing: .02em; margin: 0; }
.cfm-app .cfm-ship-card p.cfm-badge { display: inline-block; background: #eef5f2; color: #426d59; border-radius: 4px; padding: 3px 6px; font-size: 9px; line-height: 1.4; margin: 8px 0 0; letter-spacing: .04em; }
.cfm-app .cfm-ship-card .cfm-ship-pricing { font-size: 11px; margin: 12px 0 0; padding-top: 10px; }
.cfm-app .cfm-ship-card .cfm-ship-pricing dd { font-size: 13px; font-weight: 600; }
.cfm-app .cfm-item-management { border-top: 1px solid var(--cfm-line); margin-top: 16px; padding-top: 10px; width: 100%; }
.cfm-app .cfm-item-management summary { display: flex; align-items: center; justify-content: space-between; gap: 12px; list-style: none; cursor: pointer; min-height: 32px; font-size: 11px; color: var(--cfm-muted); }
.cfm-app .cfm-item-management summary::-webkit-details-marker { display: none; }
.cfm-app .cfm-item-management summary > span:last-child { color: var(--cfm-accent); font-weight: 500; }
.cfm-app .cfm-item-controls { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; }
.cfm-app .cfm-item-controls .cfm-visibility, .cfm-app .cfm-item-controls form, .cfm-app .cfm-delete-confirmation { width: 100%; }
.cfm-app .cfm-item-controls select { width: 100%; margin: 0; font-size: 12px; }
.cfm-app .cfm-item-controls button.cfm-btn { padding: 7px 11px; min-height: 36px; font-size: 12px; }
.cfm-app .cfm-ship-card .cfm-item-controls button.cfm-btn-del { background: transparent; border: 1px solid #eccfce; border-radius: 8px; padding: 7px 11px; min-height: 36px; font: inherit; font-size: 12px; color: #a23939; width: auto; box-shadow: none; }
.cfm-app .cfm-ship-card .cfm-item-controls button.cfm-btn-del:hover { background: #fff3f2; border-color: #d19a97; }
.cfm-app .cfm-mfr-chips { gap: 8px; }
.cfm-app .cfm-mfr-chips button { display: inline-flex; align-items: center; gap: 7px; font-size: 11px; border-color: transparent; background: transparent; min-height: 32px; }
.cfm-app .cfm-mfr-chips button.is-active { background: var(--cfm-surface); border-color: var(--cfm-line); box-shadow: 0 1px 3px #1724320a; }
@media (max-width: 600px) {
 .cfm-app .cfm-fleet-grid > .cfm-pledge-group:not(.is-compact) { padding: 14px; }
 .cfm-app .cfm-pledge-meta { align-items: flex-start; }
 .cfm-app .cfm-ship-card .item-avatar { aspect-ratio: 16 / 9; }
 .cfm-app .cfm-pledge-items { grid-template-columns: 1fr; }
 .cfm-app .cfm-pledge-header { margin-bottom: 14px; }
}
.cfm-app .cfm-ship-card .cfm-price-unavailable { font-size: 11px; color: var(--cfm-muted); border-top: 1px solid var(--cfm-line); margin: 12px 0 0; padding-top: 10px; }
.cfm-app .cfm-pledge-group.is-compact .cfm-pack-visible, .cfm-app .cfm-pledge-group.is-compact .cfm-pack-reference { display: none; }
/* Pack membership is context on each card, without separate group panels. */
.cfm-app .cfm-fleet-grid { align-items: stretch; }
.cfm-app .cfm-fleet-grid > .cfm-ship-card { height: 100%; min-width: 0; }
.cfm-app .cfm-fleet-grid > .cfm-ship-card > .list-wrap, .cfm-app .cfm-fleet-grid > .cfm-ship-card .list-wrap-inner { height: 100%; }
.cfm-app .cfm-fleet-grid .cfm-ship-card .item { flex: 1; }
.cfm-app .cfm-fleet-grid .cfm-ship-card .item-block { flex: 1; }
.cfm-app .cfm-pack-context { width: 100%; margin: 14px 0 0; }
.cfm-app .cfm-pack-context summary { display: flex; align-items: center; gap: 6px; list-style: none; font-size: 11px; color: var(--cfm-muted); min-height: 30px; cursor: pointer; }
.cfm-app .cfm-pack-context summary::-webkit-details-marker { display: none; }
.cfm-app .cfm-pack-context summary > span:first-child { flex-shrink: 0; color: var(--cfm-muted); font-size: 9px; letter-spacing: .06em; text-transform: uppercase; }
.cfm-app .cfm-pack-context summary > span:nth-child(2) { text-overflow: ellipsis; overflow: hidden; white-space: nowrap; }
.cfm-app .cfm-pack-context summary > span:last-child { margin-left: auto; }
.cfm-app .cfm-pack-detail { border: 1px solid var(--cfm-line); background: var(--bb-body-background-color, #f8fafc); border-radius: 8px; padding: 12px; margin-top: 6px; }
.cfm-app .cfm-pack-detail .cfm-pledge-header { display: block; margin: 0; }
.cfm-app .cfm-pack-detail .cfm-pledge-header h3 { font-size: 12px; margin: 0 0 8px; }
.cfm-app .cfm-pack-detail .cfm-pledge-label { display: none; }
.cfm-app .cfm-pack-detail .cfm-pledge-meta { align-items: flex-start; }
.cfm-app .cfm-pack-detail .cfm-package-pricing { width: 100%; font-size: 10px; }
.cfm-app .cfm-pack-detail .cfm-pledge-hint { margin-top: 8px; font-size: 10px; }
.cfm-app .cfm-fleet-grid .cfm-item-management { margin-top: 8px; }
.cfm-app .cfm-fleet-grid .cfm-ship-card .item-avatar { flex-shrink: 0; }
.cfm-app .cfm-ship-card .cfm-cost-note, .cfm-app .cfm-pack-detail .cfm-cost-note { color: var(--cfm-muted); font-size: 10px; line-height: 1.55; margin: 8px 0 0; overflow-wrap: anywhere; }
.cfm-app .cfm-allocated-cost dd { color: var(--cfm-accent); }
.cfm-app .cfm-valuation-link { font-size: 11px; display: inline-block; margin-top: 10px; }
.cfm-app [hidden] { display: none !important; }
.cfm-app .cfm-ship-card button.cfm-pack-help { display: inline; border: 0; background: transparent; padding: 0; margin: 0 0 0 5px; font: inherit; color: var(--cfm-accent); text-decoration: underline; cursor: pointer; min-height: 0; box-shadow: none; }
.cfm-app .cfm-pack-context summary .cfm-pack-action { flex-shrink: 0; color: var(--cfm-accent); font-size: 10px; white-space: nowrap; }
.cfm-app .cfm-match-form { width: 100%; border-top: 1px solid var(--cfm-line); padding-top: 12px; margin-top: 6px; }
.cfm-app .cfm-match-form label { display: block; font-size: 11px; margin: 0 0 9px; }
.cfm-app .cfm-match-form input, .cfm-app .cfm-match-form select { display: block; width: 100%; margin: 5px 0 0; }
.cfm-app .cfm-match-message { font-size: 11px; line-height: 1.5; margin: 8px 0; color: var(--cfm-muted); }
