/* AutoFie front end. Scoped to .af so the theme stays in control elsewhere. */
.af {
	/* Brand tokens follow the AutoFie theme (gold #f5c518 + navy #1a1a2e), with fallbacks. */
	--af-red: var(--primary, #f5c518);
	--af-red-dark: var(--primary-hover, #e3b30c);
	--af-on-red: var(--primary-foreground, #1a1a2e);
	--af-danger: var(--destructive, #e5484d);
	--af-ink: var(--foreground, #1a1a2e);
	--af-muted: var(--muted-foreground, #55566a);
	--af-line: var(--border, #e2e3ea);
	--af-soft: var(--muted, #f1f1f5);
	--af-card: var(--card, #fff);
	--af-ok: var(--success, #2e9e4f);
	--af-radius: 12px;
	color: var(--af-ink);
	font-size: 16px;
	line-height: 1.5;
	box-sizing: border-box;
}
.af *, .af *::before, .af *::after { box-sizing: inherit; }
.af h2 { font-size: 1.35rem; margin: 0 0 12px; }
.af a { color: inherit; }
.af-muted { color: var(--af-muted); font-size: .92rem; }
.af [hidden] { display: none !important; }

/* Buttons */
.af-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; padding: 10px 18px; border: 1px solid var(--af-red); border-radius: 10px; background: var(--af-red); color: var(--af-on-red) !important; font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; }
.af-btn:hover { background: var(--af-red-dark); border-color: var(--af-red-dark); }
.af-btn:disabled { opacity: .6; cursor: progress; }
.af-btn-ghost { background: var(--af-card); border-color: var(--af-line); color: var(--af-ink) !important; }
.af-btn-ghost:hover { background: var(--af-soft); border-color: var(--af-red); color: var(--af-ink) !important; }
.af-btn-danger { background: transparent; border-color: var(--af-line); color: var(--af-danger) !important; }
.af-btn-sm { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.af-btn-lg { min-height: 52px; padding: 12px 28px; font-size: 1.05rem; }
.af-btn-block { width: 100%; }
.af-link { color: var(--af-muted); }

/* Alerts */
.af-alert { padding: 12px 14px; border-radius: 10px; background: var(--af-soft); border: 1px solid var(--af-line); margin: 0 0 16px; }
.af-alert ul { margin: 0; padding-left: 18px; }
.af-alert-error { background: #fdecea; border-color: #f5c2bd; color: #7a1d14; }
.af-alert-ok { background: #e6f4ea; border-color: #b7dfc2; color: #12522a; }
.af-notice, .af-empty { padding: 28px; text-align: center; background: var(--af-soft); border-radius: var(--af-radius); }

/* Badges & status */
.af-badge { display: inline-block; padding: 2px 10px; border-radius: 999px; background: color-mix(in srgb, var(--af-red) 10%, transparent); color: var(--af-red); font-size: .8rem; font-weight: 600; }
.af-badge-light { position: absolute; left: 8px; top: 8px; background: rgba(255, 255, 255, .95); }
.af-verified { display: inline-flex; align-items: center; gap: 4px; font-size: .78rem; font-weight: 600; color: var(--af-ok); }
.af-verified::before { content: "✓"; display: inline-grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: var(--af-ok); color: #fff; font-size: 10px; }
.af-status { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .8rem; font-weight: 600; background: var(--af-soft); color: var(--af-muted); }
.af-status-publish { background: #e6f4ea; color: var(--af-ok); }
.af-status-pending { background: #fff4e5; color: #9a5b00; }
.af-status-af_rejected { background: #fdecea; color: var(--af-danger); }

/* Cards */
.af-grid-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 720px) { .af-grid-cards { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; } }
@media (min-width: 1100px) { .af-grid-cards { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.af-card { display: flex; flex-direction: column; background: var(--af-card); border: 1px solid var(--af-line); border-radius: var(--af-radius); overflow: hidden; transition: box-shadow .15s; }
.af-card:hover { box-shadow: 0 6px 20px rgba(0, 0, 0, .08); }
.af-card-media { position: relative; display: block; aspect-ratio: 4 / 3; background: var(--af-soft); overflow: hidden; }
.af-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-card-noimg { display: block; width: 100%; height: 100%; min-height: 80px; background: var(--af-soft) center / 40% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23c4c4c8' stroke-width='1.5'%3E%3Cpath d='M3 13l2-5a2 2 0 012-1h10a2 2 0 012 1l2 5v5a1 1 0 01-1 1h-1a1 1 0 01-1-1v-1H6v1a1 1 0 01-1 1H4a1 1 0 01-1-1v-5z'/%3E%3Ccircle cx='7.5' cy='14.5' r='1'/%3E%3Ccircle cx='16.5' cy='14.5' r='1'/%3E%3C/svg%3E"); }
.af-card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.af-card-title { font-size: .95rem; line-height: 1.3; margin: 0; font-weight: 600; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.af-card-title a { text-decoration: none; }
.af-card-price { color: var(--af-red); font-weight: 700; font-size: 1.05rem; }
.af-chips { display: flex; flex-wrap: wrap; gap: 4px; list-style: none; margin: 2px 0 0; padding: 0; }
.af-chips li { font-size: .75rem; padding: 1px 8px; border-radius: 999px; background: var(--af-soft); color: var(--af-muted); }
.af-card-foot { margin-top: auto; padding-top: 6px; display: flex; justify-content: space-between; gap: 6px; font-size: .8rem; color: var(--af-muted); }
.af-loc { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Browse */
.af-searchbar { display: flex; gap: 8px; margin-bottom: 12px; }
.af-searchbar input { flex: 1; min-width: 0; }
.af input[type=text], .af input[type=search], .af input[type=number], .af input[type=tel], .af input[type=email], .af input[type=password], .af input[type=url], .af select, .af textarea {
	width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--af-line); border-radius: 10px; background: var(--af-card); color: var(--af-ink); font: inherit;
}
.af textarea { min-height: 120px; }
.af input:focus, .af select:focus, .af textarea:focus { outline: 2px solid color-mix(in srgb, var(--af-red) 35%, transparent); border-color: var(--af-red); }
.af-cat-tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 10px; scrollbar-width: none; }
.af-cat-tabs a { flex: none; padding: 7px 14px; border: 1px solid var(--af-line); border-radius: 999px; text-decoration: none; font-size: .9rem; white-space: nowrap; background: var(--af-card); }
.af-cat-tabs a.is-active { background: var(--af-red); border-color: var(--af-red); color: var(--af-on-red); }
.af-more-filters { border: 1px solid var(--af-line); border-radius: var(--af-radius); padding: 0 12px; margin-bottom: 12px; background: var(--af-card); }
.af-more-filters summary { cursor: pointer; padding: 12px 0; font-weight: 600; }
.af-filter-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 720px) { .af-filter-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.af-filter-actions { display: flex; align-items: center; gap: 14px; margin: 12px 0; }
.af-resultbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin: 4px 0 12px; color: var(--af-muted); font-size: .92rem; }
.af-resultbar label { display: flex; align-items: center; gap: 8px; }
.af-resultbar select { width: auto; min-height: 38px; padding: 6px 10px; }
.af-pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 24px 0; }
.af-pagination .page-numbers { padding: 8px 12px; border: 1px solid var(--af-line); border-radius: 8px; text-decoration: none; }
.af-pagination .current { background: var(--af-red); border-color: var(--af-red); color: var(--af-on-red); }
.af-cat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 720px) { .af-cat-tiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.af-cat-tile { display: flex; flex-direction: column; justify-content: flex-end; min-height: 96px; padding: 14px; border-radius: var(--af-radius); background: var(--af-soft); border: 1px solid var(--af-line); text-decoration: none; }
.af-cat-tile:hover { border-color: var(--af-red); }
.af-cat-name { font-weight: 600; }
.af-cat-count { color: var(--af-muted); font-size: .85rem; }

/* Submit form */
.af-form fieldset { border: 1px solid var(--af-line); border-radius: var(--af-radius); padding: 16px; margin: 0 0 16px; background: var(--af-card); }
.af-form legend { font-weight: 700; padding: 0 6px; }
.af-form:not(.has-cat) .af-needs-cat { display: none; }
.af-grid { display: grid; grid-template-columns: 1fr; gap: 0 16px; }
@media (min-width: 640px) { .af-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.af-wide { grid-column: 1 / -1; }
.af-field { margin: 0 0 12px; }
.af-field > label:first-child { display: block; font-weight: 600; font-size: .92rem; margin-bottom: 4px; }
.af-check { display: flex; align-items: flex-end; }
.af-check label { display: flex; gap: 8px; align-items: center; min-height: 44px; }
.af-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 640px) { .af-cats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.af-cat { position: relative; }
.af-cat input { position: absolute; opacity: 0; inset: 0; }
.af-cat span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 56px; padding: 8px; border: 1px solid var(--af-line); border-radius: 10px; font-size: .9rem; font-weight: 600; cursor: pointer; }
.af-cat input:checked + span { border-color: var(--af-red); background: color-mix(in srgb, var(--af-red) 8%, transparent); color: var(--af-red); }
.af-cat input:focus-visible + span { outline: 2px solid var(--af-red); }
.af-thumbs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; list-style: none; padding: 0; margin: 0 0 10px; }
@media (min-width: 640px) { .af-thumbs { grid-template-columns: repeat(5, minmax(0, 1fr)); } }
.af-thumb { position: relative; aspect-ratio: 1; border: 2px solid var(--af-line); border-radius: 10px; overflow: hidden; cursor: pointer; background: var(--af-soft); }
.af-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-thumb.is-cover { border-color: var(--af-red); }
.af-thumb.is-cover::after { content: "Cover"; position: absolute; left: 0; right: 0; top: 0; background: var(--af-red); color: var(--af-on-red); font-size: .72rem; text-align: center; font-weight: 600; }
.af-thumb-x { position: absolute; right: 4px; bottom: 4px; width: 28px; height: 28px; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .65); color: #fff; font-size: 18px; line-height: 1; cursor: pointer; }
.af-thumb-remove { position: absolute; left: 0; right: 0; bottom: 0; display: flex; gap: 4px; align-items: center; justify-content: center; padding: 3px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .75rem; }
.af-thumb:has(.af-thumb-remove input:checked) img { opacity: .35; }
.af-upload { display: flex; align-items: center; justify-content: center; min-height: 64px; border: 2px dashed var(--af-line); border-radius: 10px; cursor: pointer; font-weight: 600; color: var(--af-ink); position: relative; }
.af-upload input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.af-actions { display: flex; align-items: center; gap: 14px; }

/* Listing page */
.af-crumbs { font-size: .88rem; color: var(--af-muted); margin-bottom: 12px; }
.af-crumbs a { text-decoration: none; }
.af-listing-grid { display: grid; grid-template-columns: 1fr; gap: 20px; }
@media (min-width: 960px) { .af-listing-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .af-listing-side { position: sticky; top: 24px; } }
.af-listing-side { display: flex; flex-direction: column; gap: 12px; }
@media (max-width: 959px) { .af-listing-grid { display: flex; flex-direction: column; } .af-listing-side { order: -1; } .af-listing-main { display: contents; } .af-gallery { order: -2; } }
.af-gallery-main { position: relative; aspect-ratio: 4 / 3; background: #111; border-radius: var(--af-radius); overflow: hidden; }
.af-gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.af-gal-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .9); font-size: 24px; line-height: 1; cursor: pointer; }
.af-gal-prev { left: 10px; } .af-gal-next { right: 10px; }
.af-gal-count { position: absolute; right: 10px; top: 10px; background: rgba(0, 0, 0, .6); color: #fff; font-size: .8rem; padding: 2px 8px; border-radius: 999px; }
.af-gallery-thumbs { display: flex; gap: 6px; overflow-x: auto; list-style: none; padding: 0; margin: 8px 0 0; }
.af-gallery-thumbs button { width: 72px; height: 56px; padding: 0; border: 2px solid transparent; border-radius: 8px; overflow: hidden; cursor: pointer; background: none; }
.af-gallery-thumbs button.is-active { border-color: var(--af-red); }
.af-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-box { background: var(--af-card); border: 1px solid var(--af-line); border-radius: var(--af-radius); padding: 16px; }
.af-listing-title { font-size: 1.35rem; line-height: 1.25; margin: 0 0 6px; }
.af-listing-price { color: var(--af-red); font-size: 1.6rem; font-weight: 800; }
.af-listing-meta { margin: 8px 0 0; }
.af-seller-head { display: flex; gap: 12px; align-items: center; margin-bottom: 12px; }
.af-seller-head strong { display: block; }
.af-avatar { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: var(--af-red); color: var(--af-on-red); font-weight: 700; }
.af-contact-btns { display: grid; gap: 8px; }
.af-section { margin-top: 24px; }
.af-specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin: 0; border: 1px solid var(--af-line); border-radius: var(--af-radius); overflow: hidden; }
.af-specs div { padding: 10px 12px; border-bottom: 1px solid var(--af-line); }
.af-specs div:nth-child(odd) { border-right: 1px solid var(--af-line); }
.af-specs dt { font-size: .8rem; color: var(--af-muted); }
.af-specs dd { margin: 0; font-weight: 600; word-break: break-word; }
.af-desc p { margin: 0 0 10px; }
.af-safety { background: var(--af-soft); border-radius: var(--af-radius); padding: 16px; }
.af-safety h2 { font-size: 1.05rem; }
.af-safety ul { margin: 0; padding-left: 18px; color: var(--af-muted); font-size: .92rem; }

/* My listings */
.af-mine-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.af-mine-head h2 { margin: 0; }
.af-mine-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.af-mine-item { display: grid; grid-template-columns: 84px 1fr; gap: 12px; padding: 12px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); }
.af-mine-thumb { display: block; width: 84px; height: 84px; border-radius: 8px; overflow: hidden; }
.af-mine-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.af-mine-title { font-weight: 600; text-decoration: none; }
.af-mine-price { color: var(--af-red); font-weight: 700; }
.af-mine-meta { display: flex; gap: 10px; align-items: center; margin-top: 4px; }
.af-mine-reason { margin-top: 4px; font-size: .85rem; color: var(--af-danger); }
.af-mine-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; align-items: flex-start; }
.af-mine-actions form { margin: 0; }
@media (min-width: 720px) { .af-mine-item { grid-template-columns: 84px 1fr auto; } .af-mine-actions { grid-column: auto; justify-content: flex-end; } }
.af-close { position: relative; }
.af-close summary { list-style: none; }
.af-close summary::-webkit-details-marker { display: none; }
.af-close form { position: absolute; right: 0; z-index: 5; width: 260px; display: grid; gap: 8px; margin-top: 6px; padding: 12px; background: var(--af-card); border: 1px solid var(--af-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); font-size: .9rem; }
@media (max-width: 719px) { .af-close form { left: 0; right: auto; } }

/* Accounts */
.af-small { font-size: .85rem; }
.af-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.af-inline { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; }
.af-hp { position: absolute !important; left: -9999px !important; height: 1px; overflow: hidden; }
.af-auth { display: flex; justify-content: center; }
.af-auth-card { width: 100%; max-width: 460px; background: var(--af-card); border: 1px solid var(--af-line); border-radius: 16px; padding: 20px; }
.af-auth-tabs { display: grid; grid-template-columns: 1fr 1fr; background: var(--af-soft); border-radius: 10px; padding: 4px; margin-bottom: 16px; }
.af-auth-tabs a { text-align: center; padding: 10px; border-radius: 8px; text-decoration: none; font-weight: 600; color: var(--af-muted); }
.af-auth-tabs a.is-active { background: var(--af-card); color: var(--af-ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.af-stack .af-field { margin-bottom: 12px; }
.af-account-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.af-account-head > div { flex: 1; min-width: 0; }
.af-account-head strong { font-size: 1.15rem; margin-right: 6px; }
.af-avatar-img { border-radius: 50%; object-fit: cover; flex: none; }
.af-avatar { flex: none; }
.af-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.af-stat { display: flex; flex-direction: column; padding: 14px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); text-decoration: none; }
.af-stat strong { font-size: 1.5rem; }
.af-stat span { color: var(--af-muted); font-size: .85rem; }
.af-quick { display: flex; flex-wrap: wrap; gap: 8px; }
.af-avatar-edit { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.af-avatar-edit > div { display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.af-file { position: relative; overflow: hidden; }
.af-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.af-narrow { max-width: 460px; }
.af-box + .af-box, .af-box + form, .af-alert + form { margin-top: 12px; }
.af-dealer-intro h3 { margin: 0 0 6px; }
.af-id-uploads { display: grid; grid-template-columns: 1fr; gap: 10px; margin: 0 0 14px; }
@media (min-width: 640px) { .af-id-uploads { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.af-id-upload { min-height: 96px; padding: 10px; text-align: center; }
.af-upload.has-file { border-color: var(--af-ok); color: var(--af-ok); }

/* Profiles */
.af-profile-head { display: grid; grid-template-columns: auto 1fr; gap: 14px; align-items: center; }
.af-profile-head h1 { font-size: 1.4rem; margin: 0 6px 0 0; display: inline; }
.af-profile-info p { margin: 4px 0; }
.af-profile-stats { display: flex; flex-wrap: wrap; gap: 14px; list-style: none; padding: 0; margin: 6px 0 0; font-size: .92rem; }
.af-profile-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 8px; }
@media (min-width: 720px) { .af-profile-head { grid-template-columns: auto 1fr auto; } .af-profile-actions { grid-column: auto; } }
.af-stars { color: #d0d0d4; letter-spacing: 1px; }
.af-stars .on { color: #f5a623; }
.af-star-input { display: inline-flex; flex-direction: row-reverse; gap: 2px; margin-bottom: 8px; }
.af-star-input input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.af-star-input label { font-size: 30px; color: #d0d0d4; cursor: pointer; line-height: 1; }
.af-star-input input:checked ~ label, .af-star-input label:hover, .af-star-input label:hover ~ label { color: #f5a623; }
.af-star-input input:focus-visible + label { outline: 2px solid var(--af-red); }
.af-review-form textarea { margin-bottom: 4px; }
.af-review-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 12px; }
.af-review { padding: 14px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); }
.af-review-head { display: flex; gap: 10px; align-items: center; }
.af-review p { margin: 8px 0 0; }
.af-review-reply { margin-top: 10px; padding: 10px 12px; background: var(--af-soft); border-radius: 8px; font-size: .92rem; }
.af-review-reply p { margin: 4px 0 0; }
.af-reply-form { margin-top: 8px; }
.af-reply-form form { display: grid; gap: 6px; margin-top: 6px; }
.af-inline-form { display: inline; margin: 0; }
.af-inline-form button { background: none; border: 0; padding: 0; cursor: pointer; color: var(--af-muted); text-decoration: underline; }
.af-follow-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.af-follow-list li { display: flex; align-items: center; gap: 10px; padding: 10px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); }
.af-follow-list li a { flex: 1; text-decoration: none; }
.af-seller-link { text-decoration: none; }

/* Saved */
.af-card { position: relative; }
.af-save { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; cursor: pointer; font: inherit; color: var(--af-ink); text-decoration: none; padding: 0; }
.af-save-icon { position: absolute; top: 8px; right: 8px; z-index: 2; width: 36px; height: 36px; justify-content: center; border-radius: 50%; background: rgba(255, 255, 255, .95); box-shadow: 0 1px 4px rgba(0, 0, 0, .15); }
.af-save-full { margin: 10px 0 0; min-height: 40px; padding: 8px 14px; border: 1px solid var(--af-line); border-radius: 10px; font-weight: 600; }
.af-heart { width: 18px; height: 18px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7.5-4.6-9.5-9.2C1.2 8.6 3.3 5 6.8 5c2 0 3.4 1.1 4.2 2.4h2C13.8 6.1 15.2 5 17.2 5c3.5 0 5.6 3.6 4.3 6.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2'%3E%3Cpath d='M12 21s-7.5-4.6-9.5-9.2C1.2 8.6 3.3 5 6.8 5c2 0 3.4 1.1 4.2 2.4h2C13.8 6.1 15.2 5 17.2 5c3.5 0 5.6 3.6 4.3 6.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; }
.af-save.is-saved { color: var(--af-red); }
.af-save.is-saved .af-heart { -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21s-7.5-4.6-9.5-9.2C1.2 8.6 3.3 5 6.8 5c2 0 3.4 1.1 4.2 2.4h2C13.8 6.1 15.2 5 17.2 5c3.5 0 5.6 3.6 4.3 6.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M12 21s-7.5-4.6-9.5-9.2C1.2 8.6 3.3 5 6.8 5c2 0 3.4 1.1 4.2 2.4h2C13.8 6.1 15.2 5 17.2 5c3.5 0 5.6 3.6 4.3 6.8C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E"); }
.af-card .af-badge-light { top: 8px; left: 8px; }

/* Toast */
.af-toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: #1d1d1f; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem; opacity: 0; pointer-events: none; transition: .2s; z-index: 9999; max-width: calc(100% - 32px); }
.af-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* Report */
.af-report { margin-top: 10px; }
.af-report summary { cursor: pointer; color: var(--af-muted); list-style: none; }
.af-report-form { display: grid; gap: 6px; margin-top: 8px; font-size: .92rem; }
.af-count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--af-danger); color: #fff; font-size: .75rem; font-weight: 700; }
.af-btn-ghost .af-count { margin-left: 4px; }

/* Notifications */
.af-notif-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.af-notif { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); }
.af-notif.is-unread { border-color: var(--af-red); background: color-mix(in srgb, var(--af-red) 8%, var(--af-card)); }
.af-notif-icon { flex: none; display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: var(--af-soft); }
.af-notif-body p { margin: 2px 0; }
.af-notif-body a { text-decoration: none; }

/* Inbox */
.af-thread-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.af-thread-item a { display: flex; gap: 12px; align-items: center; padding: 10px; border: 1px solid var(--af-line); border-radius: var(--af-radius); background: var(--af-card); text-decoration: none; }
.af-thread-item.is-unread a { border-color: var(--af-red); }
.af-thread-thumb { flex: none; width: 52px; height: 52px; border-radius: 10px; overflow: hidden; display: grid; place-items: center; }
.af-thread-thumb img { width: 100%; height: 100%; object-fit: cover; }
.af-thread-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.af-thread-top { display: flex; justify-content: space-between; gap: 8px; }
.af-thread-listing, .af-thread-preview { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.af-thread-item.is-unread .af-thread-preview { color: var(--af-ink); font-weight: 600; }

/* Chat */
.af-chat { display: flex; flex-direction: column; height: min(78vh, 760px); min-height: 460px; border: 1px solid var(--af-line); border-radius: 16px; overflow: hidden; background: var(--af-card); }
.af-chat-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--af-line); }
.af-chat-back { font-size: 28px; line-height: 1; text-decoration: none; padding: 0 4px; }
.af-chat-who { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.af-chat-who a { text-decoration: none; }
.af-chat-menu { position: relative; }
.af-chat-menu summary { list-style: none; cursor: pointer; font-size: 22px; padding: 0 8px; }
.af-chat-menu > div { position: absolute; right: 0; top: 30px; z-index: 5; display: grid; min-width: 160px; background: var(--af-card); border: 1px solid var(--af-line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0, 0, 0, .12); overflow: hidden; }
.af-chat-menu > div > * { padding: 10px 14px; border: 0; background: none; text-align: left; font: inherit; cursor: pointer; text-decoration: none; }
.af-chat-menu > div > *:hover { background: var(--af-soft); }
.af-chat-listing { display: flex; gap: 10px; align-items: center; padding: 8px 12px; background: var(--af-soft); text-decoration: none; font-size: .9rem; }
.af-chat-listing img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; }
.af-chat-price { color: var(--af-red); font-weight: 700; }
.af-chat-log { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 6px; background: var(--af-soft); }
.af-chat-day { align-self: center; font-size: .75rem; color: var(--af-muted); background: var(--af-card); border: 1px solid var(--af-line); padding: 2px 10px; border-radius: 999px; margin: 6px 0; }
.af-msg { max-width: 78%; padding: 8px 10px 4px; border-radius: 14px; word-wrap: break-word; }
.af-msg p { margin: 0; white-space: pre-wrap; }
.af-msg img { display: block; max-width: 240px; width: 100%; border-radius: 10px; margin-bottom: 4px; }
.af-msg audio { display: block; width: 240px; max-width: 100%; height: 40px; }
.af-msg-dur { font-size: .75rem; opacity: .8; }
.af-msg-meta { display: block; text-align: right; font-size: .7rem; opacity: .75; margin-top: 2px; }
.af-msg.is-mine { align-self: flex-end; background: var(--af-red); color: var(--af-on-red); border-bottom-right-radius: 4px; }
.af-msg.is-theirs { align-self: flex-start; background: var(--af-card); border: 1px solid var(--af-line); border-bottom-left-radius: 4px; }
.af-chat-safety { padding: 8px 12px; background: #fff4e5; color: #6b4300; font-size: .85rem; border-top: 1px solid #f3dcb5; }
.af-chat-blocked { padding: 12px; text-align: center; color: var(--af-muted); border-top: 1px solid var(--af-line); }
.af-quick-replies { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px 0; }
.af-quick-replies button { flex: none; padding: 6px 12px; border: 1px solid var(--af-line); border-radius: 999px; background: var(--af-card); font: inherit; font-size: .85rem; cursor: pointer; }
.af-chat-form { display: flex; align-items: flex-end; gap: 6px; padding: 8px; border-top: 1px solid var(--af-line); }
.af-chat-form textarea { flex: 1; min-height: 42px; max-height: 140px; resize: none; padding: 10px 12px; border-radius: 20px; }
.af-chat-attach, .af-chat-mic, .af-chat-send { flex: none; display: grid; place-items: center; width: 42px; height: 42px; border: 0; border-radius: 50%; background: var(--af-soft); cursor: pointer; font-size: 18px; position: relative; overflow: hidden; }
.af-chat-attach input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.af-chat-send { background: var(--af-red); color: var(--af-on-red); }
.af-recording { display: flex; align-items: center; gap: 10px; padding: 12px; border-top: 1px solid var(--af-line); }
.af-recording button:not(.af-btn) { border: 0; background: none; color: var(--af-muted); text-decoration: underline; cursor: pointer; font: inherit; }
.af-recording .af-btn { margin-left: auto; }
.af-rec-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--af-danger); animation: af-pulse 1s infinite; }
@keyframes af-pulse { 50% { opacity: .3; } }

/* Card — matches the Lovable ListingCard */
.af-card-body { padding: 12px; gap: 0; }
.af-card-price { font-size: 1.125rem; font-weight: 700; color: var(--af-red); line-height: 1.4; }
.af-card-title { font-size: .875rem; font-weight: 600; -webkit-line-clamp: 1; }
.af-chips { margin-top: 8px; gap: 6px; }
.af-chips li { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 2px 8px; background: var(--af-soft); color: var(--af-muted); }
.af-chips svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.af-card-foot { margin-top: 12px; padding-top: 8px; border-top: 1px solid var(--af-line); display: flex; align-items: center; gap: 8px; justify-content: flex-start; min-width: 0; }
.af-card-avatar { flex: none; display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: color-mix(in srgb, var(--af-red) 12%, transparent); color: var(--af-ink); font-size: 10px; font-weight: 600; }
.af-card-seller { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; color: var(--af-muted); }
.af-verified-icon { flex: none; width: 16px; height: 16px; background: var(--af-ok); -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z'/%3E%3Cpath d='m9 12 2 2 4-4'/%3E%3C/svg%3E") center / contain no-repeat; }
.af-badge-popular { position: absolute; left: 8px; top: 8px; background: var(--af-red); color: var(--af-on-red); }
.af-grid-cards { gap: 16px; }

/* ===== AI tools (Diagnose, VIN, widget) ===== */
.af-svg { width: 16px; height: 16px; flex: none; }
.af-tool .af-small { font-size: .75rem; }
.af-tool-hero { background: linear-gradient(to bottom right, var(--secondary, #1a1a2e), var(--secondary, #1a1a2e), color-mix(in srgb, var(--secondary, #1a1a2e) 90%, transparent)); color: #fff; padding: 3rem 1rem; text-align: center; }
@media (min-width: 640px) { .af-tool-hero { padding-block: 4rem; } }
.af-tool-hero-inner { max-width: 48rem; margin-inline: auto; }
.af-tool-hero h1 { margin: 1rem 0 0; font-size: 1.875rem; font-weight: 800; letter-spacing: -0.025em; color: #fff; }
@media (min-width: 640px) { .af-tool-hero h1 { font-size: 2.25rem; } }
.af-tool-hero p { margin: .75rem auto 0; max-width: 36rem; font-size: .875rem; color: rgb(255 255 255 / .9); }
@media (min-width: 640px) { .af-tool-hero p { font-size: 1rem; } }
.af-pill-primary { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; background: color-mix(in srgb, var(--af-red) 90%, transparent); color: var(--af-on-red); padding: 4px 12px; font-size: .75rem; font-weight: 600; }
.af-pill-cta { margin-top: 1.25rem; display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: var(--af-red); color: var(--af-on-red) !important; padding: 8px 16px; font-size: .875rem; font-weight: 600; text-decoration: none; box-shadow: 0 10px 15px -3px rgb(0 0 0 / .2); }
.af-pill-cta:hover { filter: brightness(1.1); }
.af-tool-body { max-width: 48rem; margin-inline: auto; padding: 2.5rem 1rem; }
.af-tool-card { background: var(--af-card); border: 1px solid var(--af-line); border-radius: 1rem; padding: 1.25rem; box-shadow: 0 1px 2px rgb(0 0 0 / .05); }
@media (min-width: 640px) { .af-tool-card { padding: 1.75rem; } }
.af-tool-label { display: block; font-size: .875rem; font-weight: 600; }
.af-tool-label.af-small { font-size: .75rem; margin-bottom: 6px; }
.af-tool textarea#af_problem { margin-top: 8px; min-height: 120px; }
.af-tool-grid { margin-top: 1rem; display: grid; gap: 1rem; }
@media (min-width: 640px) { .af-tool-grid { grid-template-columns: 1fr 1fr; } }
.af-tool-photo { margin-top: 1rem; }
.af-dashed { display: inline-flex; align-items: center; gap: 8px; margin-top: 8px; padding: 8px 16px; border: 1px dashed var(--af-line); border-radius: 8px; background: var(--af-card); color: var(--af-ink); font: inherit; font-size: .875rem; font-weight: 500; cursor: pointer; }
.af-dashed:hover { border-color: var(--af-red); }
#af_diag_preview { position: relative; display: inline-block; margin-top: 8px; }
#af_diag_preview img { width: 128px; height: 128px; object-fit: cover; border-radius: 8px; border: 1px solid var(--af-line); }
#af_diag_remove { position: absolute; right: -8px; top: -8px; width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--secondary, #1a1a2e); color: #fff; cursor: pointer; }
.af-tool-submit { margin-top: 1.5rem; }
@media (max-width: 639px) { .af-tool-submit { width: 100%; } }
.af-tool-disclaimer { margin-top: 1rem; font-size: .75rem; color: var(--af-muted); display: flex; gap: 4px; align-items: flex-start; }
.af-tool-disclaimer .af-svg { width: 14px; height: 14px; margin-top: 1px; }
.af-tool-faq { background: var(--surface, var(--af-card)); padding: 3.5rem 1rem; }
.af-tool-faq-inner { max-width: 48rem; margin-inline: auto; }
.af-tool-faq h2 { text-align: center; font-size: 1.5rem; font-weight: 700; margin: 0; }
@media (min-width: 640px) { .af-tool-faq h2 { font-size: 1.875rem; } }
.af-tool-faq > div > .af-muted { text-align: center; margin: .5rem 0 2rem; font-size: .875rem; }
.af-faq { background: var(--af-card); border: 1px solid var(--af-line); border-radius: .75rem; padding: 1.25rem; box-shadow: 0 1px 2px rgb(0 0 0 / .05); margin-bottom: 1rem; }
.af-faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 12px; font-weight: 600; }
.af-faq summary::-webkit-details-marker { display: none; }
.af-faq-plus { color: var(--af-red); transition: transform .15s; }
.af-faq[open] .af-faq-plus { transform: rotate(45deg); }
.af-faq p { margin: .75rem 0 0; font-size: .875rem; line-height: 1.625; color: var(--af-muted); }

/* Diagnosis result */
.af-dx { margin-top: 1.5rem; }
.af-dx h2 { font-size: 1.125rem; font-weight: 700; margin: 0; }
.af-dx h3 { font-size: .875rem; font-weight: 600; margin: 1.25rem 0 .25rem; }
.af-dx-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.af-dx-cause { font-size: .875rem; line-height: 1.625; color: var(--af-muted); margin: 0; }
.af-dx ol, .af-dx ul { margin: .5rem 0 0; padding-left: 1.25rem; font-size: .875rem; color: var(--af-muted); }
.af-dx li + li { margin-top: .25rem; }
.af-dx-ok { color: var(--af-ink); }
.af-sev { display: inline-flex; align-items: center; gap: 4px; border-radius: 999px; border: 1px solid; padding: 4px 10px; font-size: .75rem; font-weight: 600; white-space: nowrap; }
.af-sev.is-low { background: rgb(16 185 129 / .1); color: #047857; border-color: rgb(16 185 129 / .3); }
.af-sev.is-medium { background: rgb(245 158 11 / .1); color: #b45309; border-color: rgb(245 158 11 / .3); }
.af-sev.is-high { background: color-mix(in srgb, var(--af-red) 12%, transparent); color: var(--af-ink); border-color: color-mix(in srgb, var(--af-red) 40%, transparent); }
.af-dx-code { margin-top: .75rem; border: 1px solid var(--af-line); border-radius: .5rem; padding: 1rem; background: color-mix(in srgb, var(--af-soft) 60%, transparent); }
.af-dx-code > p { margin: .5rem 0 0; font-size: .875rem; }
.af-dx-code-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 !important; }
.af-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-weight: 700; background: color-mix(in srgb, var(--af-red) 12%, transparent); padding: 2px 8px; border-radius: 4px; }
.af-dx-sub { font-size: .75rem !important; font-weight: 600; margin-top: .75rem !important; }
.af-dx-cost { font-size: .75rem !important; color: var(--af-muted); }
.af-dx-mech { margin-top: 1.25rem; border: 1px solid color-mix(in srgb, var(--af-red) 30%, transparent); background: color-mix(in srgb, var(--af-red) 6%, transparent); border-radius: .5rem; padding: 1rem; }
.af-dx-mech h3 { margin: 0; }
.af-dx-mech p { margin: .25rem 0 0; font-size: .875rem; line-height: 1.6; }
.af-dx-refs { list-style: none; padding: 0 !important; }
.af-dx-refs a { color: var(--af-ink); text-decoration: underline; text-decoration-color: var(--af-red); text-underline-offset: 3px; font-size: .875rem; }
.af-dx-compact { font-size: .875rem; }
.af-dx-compact h3 { font-size: .75rem; margin: .5rem 0 .25rem; }
.af-dx-compact .af-dx-code { padding: .5rem; margin-top: .5rem; }
.af-dx-compact .af-dx-code > p, .af-dx-compact li { font-size: .75rem; }
.af-dx-compact .af-dx-cause { color: var(--af-ink); margin-top: 6px; }

/* VIN */
.af-vin-hero { border-bottom: 1px solid var(--af-line); background: linear-gradient(to bottom, color-mix(in srgb, var(--af-red) 10%, transparent), transparent); padding: 2.5rem 1rem; text-align: center; }
@media (min-width: 640px) { .af-vin-hero { padding-block: 3.5rem; } }
.af-vin-hero-inner { max-width: 56rem; margin-inline: auto; }
.af-pill-soft { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; background: color-mix(in srgb, var(--af-red) 15%, transparent); color: var(--af-ink); padding: 4px 12px; font-size: .75rem; font-weight: 600; }
.af-vin-hero h1 { margin: 1rem 0 0; font-size: 1.875rem; font-weight: 800; }
@media (min-width: 640px) { .af-vin-hero h1 { font-size: 2.25rem; } }
.af-vin-hero p { margin: .75rem auto 0; max-width: 42rem; font-size: .875rem; color: var(--af-muted); }
.af-vin-form { margin: 1.5rem auto 0; max-width: 36rem; display: flex; flex-direction: column; gap: 8px; }
@media (min-width: 640px) { .af-vin-form { flex-direction: row; } }
.af-vin-form input { flex: 1; height: 48px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 1rem; letter-spacing: .1em; }
.af-vin-form .af-btn { height: 48px; }
.af-vin-error { color: var(--af-danger) !important; }
.af-vin-body { max-width: 56rem; padding-top: 2rem; }
.af-vin-empty { display: flex; gap: 12px; align-items: flex-start; }
.af-vin-empty > .af-svg { width: 20px; height: 20px; margin-top: 2px; color: var(--af-red); }
.af-vin-empty h2 { font-size: 1rem; font-weight: 600; margin: 0; }
.af-vin-empty ul { list-style: none; padding: 0; margin: .5rem 0 0; display: grid; gap: 6px; font-size: .875rem; color: var(--af-muted); }
@media (min-width: 640px) { .af-vin-empty ul { grid-template-columns: 1fr 1fr; } }
.af-vin-result { display: grid; gap: 1rem; }
.af-vin-result .af-tool-card { padding: 1.25rem; border-radius: .75rem; }
.af-vin-head { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: color-mix(in srgb, var(--af-soft) 40%, var(--af-card)); }
.af-vin-head-l { display: flex; gap: 16px; align-items: flex-start; }
.af-vin-logo { width: 56px; height: 56px; border-radius: 8px; border: 1px solid var(--af-line); background: #fff; object-fit: contain; padding: 4px; }
.af-vin-k { margin: 0; font-size: .75rem; text-transform: uppercase; letter-spacing: .05em; color: var(--af-muted); }
.af-mono { margin: 0; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.af-vin-head h2 { margin: .5rem 0 0; font-size: 1.25rem; font-weight: 700; }
@media (min-width: 640px) { .af-vin-head h2 { font-size: 1.5rem; } }
.af-vin-warn { width: 100%; margin: 0; font-size: .75rem; color: #b45309; }
.af-sev-sm { display: inline-flex; align-items: center; gap: 4px; height: fit-content; border-radius: 999px; padding: 2px 10px; font-size: .7rem; font-weight: 700; text-transform: uppercase; white-space: nowrap; }
.af-sev-sm.is-low { background: rgb(16 185 129 / .15); color: #047857; }
.af-sev-sm.is-medium { background: rgb(245 158 11 / .15); color: #b45309; }
.af-sev-sm.is-high { background: rgb(244 63 94 / .15); color: #be123c; }
.af-two { display: grid; gap: 1rem; }
@media (min-width: 768px) { .af-two { grid-template-columns: 1fr 1fr; } }
.af-vin-sect-head { display: flex; align-items: center; gap: 8px; margin-bottom: .75rem; }
.af-vin-sect-head h3 { margin: 0; font-size: 1rem; font-weight: 600; }
.af-vin-icon { color: var(--af-red); width: 18px; text-align: center; }
.af-vin-sect p { margin: 0; font-size: .875rem; }
.af-vin-sect p + p { margin-top: .5rem; }
.af-spec-grid { display: grid; gap: .75rem 1.5rem; margin: 0; }
@media (min-width: 640px) { .af-spec-grid { grid-template-columns: 1fr 1fr; } }
.af-spec-grid dt { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--af-muted); }
.af-spec-grid dd { margin: 0; font-size: .875rem; font-weight: 500; }
.af-issue-list { list-style: none; padding: 0; margin: 0; display: grid; gap: .75rem; }
.af-issue-list li { border: 1px solid var(--af-line); border-radius: .5rem; padding: .75rem; font-size: .875rem; }
.af-issue-head { display: flex; justify-content: space-between; gap: 8px; align-items: flex-start; }
.af-maint { display: grid; gap: 6px; }
.af-maint div { display: grid; grid-template-columns: minmax(110px, 30%) 1fr; gap: 12px; font-size: .875rem; padding: 6px 0; border-bottom: 1px solid var(--af-line); }
.af-price-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; text-align: center; }
.af-price-grid > div { border: 1px solid var(--af-line); border-radius: .5rem; padding: .75rem; }
.af-price-grid > div.is-avg { background: color-mix(in srgb, var(--af-red) 6%, transparent); }
.af-price-l { font-size: 10px !important; text-transform: uppercase; letter-spacing: .05em; color: var(--af-muted); }
.af-price-v { margin-top: 4px !important; font-weight: 700; }
.af-plain, .af-check-list, .af-flag-list { margin: 0; padding-left: 1.1rem; font-size: .875rem; color: var(--af-muted); }
.af-plain li + li, .af-check-list li + li, .af-flag-list li + li { margin-top: 4px; }
.af-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.af-chip { padding: 4px 10px; border-radius: 999px; background: var(--af-soft); font-size: .8rem; }
.af-history-grid { margin-top: .75rem; display: grid; gap: 8px; }
@media (min-width: 640px) { .af-history-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .af-history-grid { grid-template-columns: repeat(4, 1fr); } }
.af-history-link { display: flex; justify-content: space-between; gap: 8px; border: 1px solid var(--af-line); border-radius: .5rem; padding: .75rem; text-decoration: none; background: var(--af-card); }
.af-history-link:hover { border-color: var(--af-red); background: color-mix(in srgb, var(--af-red) 5%, var(--af-card)); }
.af-hl-t { margin: 0; font-size: .875rem; font-weight: 600; }

/* Floating Diagnose widget */
.af-dw-launch { position: fixed; right: 20px; bottom: 20px; z-index: 40; width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--af-red); color: var(--af-on-red); display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 25px 50px -12px color-mix(in srgb, var(--af-red) 40%, transparent); transition: transform .15s; }
.af-dw-launch:hover { transform: scale(1.05); }
.af-dw-launch .af-svg { width: 24px; height: 24px; position: relative; }
.af-dw-ping { position: absolute; inset: 0; border-radius: 50%; background: color-mix(in srgb, var(--af-red) 40%, transparent); animation: af-ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
@keyframes af-ping { 75%, 100% { transform: scale(1.6); opacity: 0; } }
@media (min-width: 640px) { .af-dw-launch { right: 24px; bottom: 24px; } }
.af-dw-launch[hidden] { display: none !important; }
.af-dw-bubble { position: fixed; right: 20px; bottom: 96px; z-index: 40; max-width: 260px; text-align: left; border: 1px solid var(--af-line); background: var(--af-card); color: var(--af-ink); border-radius: 16px 16px 4px 16px; padding: 12px; box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); cursor: pointer; font: inherit; }
.af-dw-bubble strong { display: block; font-size: .875rem; }
.af-dw-bubble span { display: block; margin-top: 4px; font-size: .75rem; color: var(--af-muted); }
.af-dw-bubble-x { position: absolute; right: -6px; top: -6px; width: 20px; height: 20px; border-radius: 50%; background: var(--secondary, #1a1a2e); color: #fff !important; display: grid !important; place-items: center; margin: 0 !important; font-size: 12px !important; }
.af-dw-panel { position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 50; display: flex; flex-direction: column; max-height: 85vh; overflow: hidden; border: 1px solid var(--af-line); border-radius: 16px; background: var(--af-card); box-shadow: 0 25px 50px -12px rgb(0 0 0 / .25); }
@media (min-width: 640px) { .af-dw-panel { left: auto; right: 24px; bottom: 24px; width: 380px; max-height: 600px; } }
.af-dw-panel[hidden] { display: none; }
.af-dw-head { display: flex; align-items: center; gap: 12px; background: var(--secondary, #1a1a2e); color: #fff; padding: 12px 16px; }
.af-dw-head > div { flex: 1; display: flex; flex-direction: column; }
.af-dw-head strong { font-size: .875rem; }
.af-dw-head span:not(.af-dw-icon) { font-size: 11px; color: rgb(255 255 255 / .8); }
.af-dw-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--af-red); color: var(--af-on-red); display: grid; place-items: center; }
.af-dw-head button { background: none; border: 0; color: rgb(255 255 255 / .9); font-size: 20px; cursor: pointer; padding: 4px 8px; border-radius: 6px; }
.af-dw-head button:hover { background: rgb(255 255 255 / .1); }
.af-dw-log { flex: 1; overflow-y: auto; padding: 16px 12px; display: flex; flex-direction: column; gap: 12px; background: var(--background, var(--af-soft)); min-height: 200px; }
.af-dw-msg { display: flex; }
.af-dw-msg.is-user { justify-content: flex-end; }
.af-dw-b { max-width: 85%; padding: 8px 12px; border-radius: 16px; font-size: .875rem; }
.af-dw-b p { margin: 0; }
.af-dw-msg.is-user .af-dw-b { background: var(--af-red); color: var(--af-on-red); border-bottom-right-radius: 4px; max-width: 80%; }
.af-dw-msg.is-bot .af-dw-b { background: var(--af-soft); border-bottom-left-radius: 4px; }
.af-dw-b code { font-family: ui-monospace, monospace; background: rgb(0 0 0 / .06); padding: 0 4px; border-radius: 4px; }
.af-dw-foot { border-top: 1px solid var(--af-line); background: var(--af-card); }
.af-dw-row { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 8px 12px 0; font-size: 11px; color: var(--af-muted); }
.af-dw-row select { width: auto; min-height: 0; height: auto; padding: 2px 6px; font-size: 11px; border-radius: 6px; }
.af-dw-form { display: flex; align-items: flex-end; gap: 8px; padding: 8px 12px; }
.af-dw-form textarea { flex: 1; min-height: 38px; max-height: 140px; resize: none; border-radius: 18px; padding: 8px 14px; font-size: .875rem; }
.af-dw-mic, .af-dw-send { flex: none; width: 36px; height: 36px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer; }
.af-dw-mic { background: var(--secondary, #1a1a2e); color: #fff; }
.af-dw-mic.is-rec { background: var(--af-red); color: var(--af-on-red); animation: af-pulse 1s infinite; }
.af-dw-send { background: var(--af-red); color: var(--af-on-red); }
.af-dw-mic:disabled, .af-dw-send:disabled { opacity: .5; }
.af-dw-err { margin: 0; padding: 0 16px 4px; font-size: 11px; color: var(--af-danger); }
.af-dw-more { margin: 0; padding: 0 16px 8px; font-size: 10px; color: var(--af-muted); }
.af-dw-more a { font-weight: 600; color: var(--af-ink); }

/* Google sign-in */
.af-or { position: relative; text-align: center; margin: 4px 0; }
.af-or::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--af-line); }
.af-or span { position: relative; padding: 0 8px; background: var(--af-card); color: var(--af-muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .04em; }
.af-google { gap: 10px; }

/* ===== Import Duty Calculator ===== */
.af-duty-hero { background: var(--secondary, #1a1a2e); color: #fff; text-align: center; padding: 2.5rem 1rem 4.5rem; border-radius: 0 0 1.5rem 1.5rem; }
.af-duty-hero .af-pill-soft { background: rgb(255 255 255 / .12); color: #fff; }
.af-duty-hero h1 { margin: .75rem 0 0; font-size: 1.875rem; font-weight: 800; letter-spacing: -.025em; color: #fff; }
.af-duty-hero p { margin: .6rem auto 0; max-width: 34rem; font-size: .95rem; color: rgb(255 255 255 / .85); }
@media (min-width: 640px) { .af-duty-hero h1 { font-size: 2.5rem; } }
.af-duty-wrap { max-width: 72rem; margin: -3rem auto 0; padding: 0 1rem; display: grid; gap: 1rem; align-items: start; position: relative; }
@media (min-width: 960px) { .af-duty-wrap { grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 1.5rem; } .af-duty-result { position: sticky; top: 84px; } }
.af-duty-form fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.af-duty-form fieldset + fieldset { margin-top: 1.5rem; padding-top: 1.5rem; border-top: 1px solid var(--af-line); }
.af-duty-form legend { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.05rem; margin-bottom: 1rem; padding: 0; }
.af-duty-step { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--af-red); color: var(--af-on-red); font-size: .8rem; font-weight: 800; }
.af-duty-grid { display: grid; gap: 0 12px; }
@media (min-width: 560px) { .af-duty-grid { grid-template-columns: 1fr 1fr; } }
.af-duty-grid .af-field { margin: 0 0 12px; }
.af-duty-grid label, .af-duty-more label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }
.af-duty-chips { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 1rem; }
@media (min-width: 560px) { .af-duty-chips { grid-template-columns: repeat(6, 1fr); } }
.af-dchip input, .af-seg input { position: absolute; opacity: 0; pointer-events: none; }
.af-dchip span { display: flex; align-items: center; justify-content: center; text-align: center; min-height: 44px; padding: 6px; border: 1px solid var(--af-line); border-radius: 10px; font-size: .8rem; font-weight: 600; cursor: pointer; background: var(--af-card); line-height: 1.2; }
.af-dchip input:checked + span { border-color: var(--af-red); background: color-mix(in srgb, var(--af-red) 14%, var(--af-card)); box-shadow: inset 0 0 0 1px var(--af-red); }
.af-dchip input:focus-visible + span, .af-seg input:focus-visible + span { outline: 2px solid var(--af-red); outline-offset: 2px; }
.af-duty-row { display: flex; flex-wrap: wrap; gap: 10px; }
.af-seg { display: inline-flex; background: var(--af-soft); border-radius: 10px; padding: 3px; flex-wrap: wrap; }
.af-seg span { display: block; padding: 8px 12px; border-radius: 8px; font-size: .85rem; font-weight: 600; color: var(--af-muted); cursor: pointer; }
.af-seg input:checked + span { background: var(--af-card); color: var(--af-ink); box-shadow: 0 1px 3px rgb(0 0 0 / .1); }
.af-duty-money { display: flex; }
.af .af-duty-money select { width: auto; flex: none; border-radius: 10px 0 0 10px; border-right: 0; background: var(--af-soft); font-weight: 600; }
.af .af-duty-money input { border-radius: 0 10px 10px 0; font-size: 1.05rem; font-weight: 600; }
.af-duty-more { margin-top: .75rem; }
.af-duty-more summary { cursor: pointer; font-size: .85rem; font-weight: 600; color: var(--af-ink); text-decoration: underline; text-decoration-color: var(--af-red); text-underline-offset: 3px; }
.af-duty-more .af-field { margin: .75rem 0 .25rem; }
.af-duty-card { padding: 1.25rem; }
.af-duty-empty { display: flex; gap: 12px; align-items: center; color: var(--af-muted); }
.af-duty-empty .af-svg { width: 40px; height: 40px; color: var(--af-red); }
.af-duty-empty p { margin: 0; font-size: .9rem; }
.af-duty-empty strong { color: var(--af-ink); }
.af-duty-kicker { margin: 0; font-size: .8rem; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--af-muted); }
.af-duty-big { margin: 2px 0 0; font-size: 2.4rem; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.af-duty-alerts:not(:empty) { margin-top: .75rem; display: grid; gap: 6px; }
.af-duty-alert { margin: 0; padding: 8px 10px; border-radius: 8px; font-size: .8rem; line-height: 1.45; border: 1px solid; }
.af-duty-alert.is-bad { background: rgb(220 38 38 / .08); border-color: rgb(220 38 38 / .35); color: #991b1b; }
.af-duty-alert.is-warn { background: rgb(245 158 11 / .1); border-color: rgb(245 158 11 / .35); color: #92400e; }
.af-duty-alert.is-info { background: var(--af-soft); border-color: var(--af-line); color: var(--af-ink); }
.dark .af-duty-alert.is-bad { color: #fca5a5; } .dark .af-duty-alert.is-warn { color: #fcd34d; }
.af-duty-bar { display: flex; height: 12px; border-radius: 999px; overflow: hidden; margin-top: 1rem; gap: 2px; background: var(--af-soft); }
.af-duty-bar span, .af-duty-legend i { background: #94a3b8; }
.af-duty-bar .is-car, .af-duty-legend i.is-car { background: var(--secondary, #1a1a2e); }
.dark .af-duty-bar .is-car, .dark .af-duty-legend i.is-car { background: #cbd5e1; }
.af-duty-bar .is-ship, .af-duty-legend i.is-ship { background: #3b82f6; }
.af-duty-bar .is-duty, .af-duty-legend i.is-duty { background: var(--af-red); }
.af-duty-bar .is-clear, .af-duty-legend i.is-clear { background: #16a34a; }
.af-duty-legend { list-style: none; margin: .75rem 0 0; padding: 0; display: grid; gap: 6px; font-size: .85rem; }
.af-duty-legend li { display: flex; align-items: center; gap: 8px; }
.af-duty-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.af-duty-legend b { margin-left: auto; font-weight: 600; font-variant-numeric: tabular-nums; }
.af-duty-landed { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-top: .9rem; padding: .9rem 1rem; border-radius: 12px; background: color-mix(in srgb, var(--af-red) 14%, var(--af-card)); border: 1px solid color-mix(in srgb, var(--af-red) 45%, transparent); }
.af-duty-landed span { font-size: .85rem; font-weight: 600; }
.af-duty-landed strong { font-size: 1.25rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.af-duty-break { margin-top: 1rem; }
.af-duty-break summary { cursor: pointer; font-weight: 600; font-size: .9rem; }
.af-duty-break table { width: 100%; border-collapse: collapse; margin-top: .5rem; font-size: .85rem; font-variant-numeric: tabular-nums; }
.af-duty-break td { padding: 7px 0; border-bottom: 1px solid var(--af-line); vertical-align: top; }
.af-duty-break td:nth-child(2) { color: var(--af-muted); text-align: right; padding: 7px 10px; white-space: nowrap; }
.af-duty-break td:last-child { text-align: right; white-space: nowrap; font-weight: 600; }
.af-duty-break small { display: block; color: var(--af-muted); font-size: .72rem; }
.af-duty-break tr.is-sub td { color: var(--af-muted); font-weight: 600; }
.af-duty-break tr.is-total td { border-bottom: 0; font-weight: 800; font-size: .95rem; padding-top: 10px; }
.af-duty-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 1rem; }
.af-duty-actions .af-btn { font-size: .9rem; padding-inline: 10px; }
#d_fx { margin: .75rem 0 0; }
.af-duty-local { display: block; margin-top: 1rem; text-decoration: none; color: var(--af-ink) !important; }
.af-duty-local strong { display: block; }
.af-duty-local span { font-size: .85rem; color: var(--af-muted); }
.af-duty-local:hover { border-color: var(--af-red); }
.af-duty-notes { max-width: 72rem; }
.af-duty-notes .af-tool-disclaimer a { color: var(--af-ink); text-decoration: underline; }
.af-duty-sticky { display: none; }
@media (max-width: 959px) {
	.af-duty-sticky:not([hidden]) { position: fixed; left: 12px; right: 84px; bottom: 12px; z-index: 40; display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 14px; background: var(--secondary, #1a1a2e); color: #fff !important; text-decoration: none; box-shadow: 0 10px 25px rgb(0 0 0 / .25); }
	.af-duty-sticky span { font-size: .75rem; opacity: .8; }
	.af-duty-sticky strong { font-size: 1.05rem; }
	.af-duty-sticky em { margin-left: auto; font-style: normal; font-size: .75rem; color: var(--af-red); font-weight: 700; }
	.af-duty-notes { padding-bottom: 6rem; }
}
@media print {
	.site-header, .site-footer, .af-duty-hero, .af-duty-form, .af-duty-actions, .af-duty-local, .af-duty-sticky, .af-dw, .af-duty-notes details { display: none !important; }
	.af-duty-wrap { display: block; margin: 0; }
}
.af-duty-form legend { float: left; width: 100%; }
.af-duty-form legend + * { clear: both; }
.af-duty-sticky strong, .af-duty-landed strong, .af-duty-big, .af-duty-legend b { white-space: nowrap; }
.af-duty-sticky span { line-height: 1.2; }
@media (max-width: 420px) { .af-duty-actions { grid-template-columns: 1fr; } .af-duty-landed { flex-direction: column; align-items: flex-start; gap: 2px; } }
