/* Base styles and reusable components for the LosUsados redesign. Requires tokens.css. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-height) + var(--space-4)); }
body { margin: 0; min-width: 320px; font-family: var(--font-sans); font-size: var(--text-base); line-height: var(--leading-normal); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3, h4 { margin: 0 0 var(--space-3); font-family: var(--font-display); font-weight: 600; line-height: var(--leading-tight); color: var(--text-strong); letter-spacing: -.01em; }
h1 { font-size: var(--text-3xl); }
h2 { font-size: var(--text-2xl); }
h3 { font-size: var(--text-xl); }
h4 { font-size: var(--text-lg); }
p { margin: 0 0 var(--space-4); }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--radius-sm); }
::selection { background: var(--blue-200); }

.container { width: min(var(--container), 100% - 2 * var(--gutter)); margin-inline: auto; }
.container--narrow { width: min(var(--container-narrow), 100% - 2 * var(--gutter)); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack > * + * { margin-top: var(--space-4); }
.cluster { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.text-muted { color: var(--text-muted); }
.text-sm { font-size: var(--text-sm); }
.eyebrow { display: inline-block; margin-bottom: var(--space-2); font-size: var(--text-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.icon { flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn {
  --btn-bg: var(--surface); --btn-fg: var(--text-strong); --btn-border: var(--border-strong);
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--tap); padding: .625rem 1.125rem; border: 1px solid var(--btn-border); border-radius: var(--radius);
  background: var(--btn-bg); color: var(--btn-fg); font-size: var(--text-sm); font-weight: 600; line-height: 1.2; text-align: center; text-decoration: none; white-space: nowrap;
  transition: box-shadow var(--duration) var(--ease), border-color var(--duration) var(--ease), transform var(--duration) var(--ease);
}
.btn:hover { text-decoration: none; color: var(--btn-fg); box-shadow: var(--hover-overlay); }
.btn:active { box-shadow: var(--press-overlay); transform: translateY(1px); }
.btn:focus-visible { box-shadow: var(--focus); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; box-shadow: none; transform: none; }
.btn--primary { --btn-bg: var(--brand-blue); --btn-fg: #fff; --btn-border: var(--brand-blue); }
.btn--secondary { --btn-bg: var(--surface); --btn-fg: var(--brand-blue); --btn-border: var(--brand-blue); }
.btn--secondary:hover { box-shadow: none; background: var(--blue-50); }
.btn--ghost { --btn-bg: transparent; --btn-fg: var(--brand-blue); --btn-border: transparent; }
.btn--ghost:hover { box-shadow: none; background: var(--blue-50); }
.btn--whatsapp { --btn-bg: var(--whatsapp); --btn-fg: #fff; --btn-border: var(--whatsapp); }
.btn--danger { --btn-bg: var(--surface); --btn-fg: var(--danger); --btn-border: var(--danger); }
.btn--sm { min-height: 36px; padding: .375rem .75rem; font-size: var(--text-xs); }
.btn--lg { min-height: 52px; padding: .875rem 1.5rem; font-size: var(--text-base); border-radius: var(--radius-lg); }
.btn--block { width: 100%; }
.btn--icon { width: var(--tap); padding: 0; border-radius: var(--radius-pill); }
.btn--icon.btn--sm { width: 36px; }

/* ---------- Form fields ---------- */
.field { display: grid; gap: var(--space-2); min-width: 0; }
.label { font-size: var(--text-sm); font-weight: 600; color: var(--text-strong); }
.label .optional { font-weight: 400; color: var(--text-muted); }
.label .required { color: var(--danger); }
.help { font-size: var(--text-xs); color: var(--text-muted); }
.error-text { display: flex; gap: var(--space-1); align-items: center; font-size: var(--text-xs); font-weight: 600; color: var(--danger); }
.input, .select, .textarea {
  width: 100%; min-height: var(--tap); padding: .625rem .875rem; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--text-strong); font-size: var(--text-base);
  transition: border-color var(--duration) var(--ease), box-shadow var(--duration) var(--ease);
}
.input::placeholder, .textarea::placeholder { color: var(--ink-500); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--ink-500); }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--brand-blue); box-shadow: var(--focus); }
.input:disabled, .select:disabled { background: var(--surface-muted); color: var(--text-muted); cursor: not-allowed; }
.textarea { min-height: 120px; resize: vertical; }
.select { appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' fill='none' stroke='%234D4D4D' stroke-width='1.8' stroke-linecap='round' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .75rem center; }
[aria-invalid="true"].input, [aria-invalid="true"].select, [aria-invalid="true"].textarea, [aria-invalid="true"] > .ms__trigger { border-color: var(--danger); background-color: var(--danger-bg); }
.input-group { display: flex; align-items: stretch; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.input-group:focus-within { border-color: var(--brand-blue); box-shadow: var(--focus); }
.input-group .input { border: 0; border-radius: 0; box-shadow: none; min-width: 0; }
.input-group__addon { display: grid; place-items: center; padding-inline: .875rem; background: var(--surface-muted); color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; }
.search-input { position: relative; }
.search-input .icon { position: absolute; left: .875rem; top: 50%; transform: translateY(-50%); color: var(--text-muted); pointer-events: none; }
.search-input .input { padding-left: 2.75rem; }

.check { display: flex; gap: var(--space-3); align-items: flex-start; min-height: var(--tap); padding-block: .625rem; cursor: pointer; font-size: var(--text-sm); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--brand-blue); flex-shrink: 0; }
.switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-size: var(--text-sm); font-weight: 600; min-height: var(--tap); }
.switch input { appearance: none; width: 44px; height: 26px; margin: 0; border-radius: var(--radius-pill); background: var(--ink-300); position: relative; transition: background var(--duration) var(--ease); cursor: pointer; }
.switch input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform var(--duration) var(--ease); }
.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(18px); }

.segmented { display: flex; flex-wrap: wrap; gap: var(--space-2); border: 0; padding: 0; margin: 0; }
.segmented legend { margin-bottom: var(--space-2); padding: 0; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: inline-flex; align-items: center; gap: var(--space-2); min-height: var(--tap); padding: .5rem 1rem; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface); font-size: var(--text-sm); font-weight: 600; cursor: pointer; transition: all var(--duration) var(--ease); }
.segmented input:checked + span { border-color: var(--brand-blue); background: var(--blue-50); color: var(--brand-blue); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }

/* Range slider (simulator) */
.range { --pct: 50%; width: 100%; height: 28px; margin: 0; appearance: none; background: transparent; cursor: pointer; }
.range::-webkit-slider-runnable-track { height: 6px; border-radius: var(--radius-pill); background: linear-gradient(to right, var(--brand-blue) var(--pct), var(--ink-200) var(--pct)); }
.range::-moz-range-track { height: 6px; border-radius: var(--radius-pill); background: var(--ink-200); }
.range::-moz-range-progress { height: 6px; border-radius: var(--radius-pill); background: var(--brand-blue); }
.range::-webkit-slider-thumb { appearance: none; width: 22px; height: 22px; margin-top: -8px; border: 3px solid #fff; border-radius: 50%; background: var(--brand-blue); box-shadow: 0 0 0 1px var(--brand-blue), var(--shadow); }
.range::-moz-range-thumb { width: 18px; height: 18px; border: 3px solid #fff; border-radius: 50%; background: var(--brand-blue); box-shadow: 0 0 0 1px var(--brand-blue); }
.range:focus-visible { box-shadow: none; }
.range:focus-visible::-webkit-slider-thumb { box-shadow: var(--focus); }

/* ---------- Combobox with search and multiple selection ---------- */
.ms { position: relative; }
.ms__trigger { display: flex; align-items: center; gap: var(--space-2); width: 100%; min-height: var(--tap); padding: .5rem 2.5rem .5rem .875rem; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); text-align: left; font-size: var(--text-base); color: var(--text-strong); }
.ms__trigger:hover { border-color: var(--ink-500); }
.ms__trigger[aria-expanded="true"] { border-color: var(--brand-blue); box-shadow: var(--focus); }
.ms__trigger:disabled { background: var(--surface-muted); color: var(--text-muted); cursor: not-allowed; }
.ms__value { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ms__value--placeholder { color: var(--ink-500); }
.ms__count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding-inline: 6px; border-radius: var(--radius-pill); background: var(--brand-blue); color: #fff; font-size: var(--text-xs); font-weight: 700; }
.ms__clear { position: absolute; top: 6px; right: 2.125rem; display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: var(--text-muted); }
.ms__clear[hidden] { display: none; }
.ms__clear:hover { background: var(--surface-muted); color: var(--text-strong); }
.ms__chevron { position: absolute; top: 13px; right: .75rem; color: var(--text-muted); transition: transform var(--duration) var(--ease); pointer-events: none; }
.ms__trigger[aria-expanded="true"] .ms__chevron { transform: rotate(180deg); }
.ms__panel { position: absolute; z-index: var(--z-overlay); top: calc(100% + 6px); left: 0; right: 0; min-width: 260px; display: grid; grid-template-rows: auto minmax(0, 1fr) auto; max-height: min(420px, 60vh); border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); box-shadow: var(--shadow-lg); overflow: hidden; }
@media (max-width: 767px) {
  .ms__panel { position: fixed; top: auto; left: 0; right: 0; bottom: 0; max-height: 75vh; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding-bottom: env(safe-area-inset-bottom); animation: sheet-in .2s var(--ease); }
  .ms__footer .btn { flex: 1; min-height: var(--tap); }
}
.ms__search { padding: var(--space-3); border-bottom: 1px solid var(--border); }
.ms__list { margin: 0; padding: var(--space-2); list-style: none; overflow-y: auto; overscroll-behavior: contain; }
.ms__option { display: flex; align-items: center; gap: var(--space-3); min-height: var(--tap); padding: .5rem .75rem; border-radius: var(--radius-sm); cursor: pointer; font-size: var(--text-sm); color: var(--text-strong); }
.ms__option[data-active="true"] { background: var(--surface-muted); }
.ms__option[aria-selected="true"] { color: var(--brand-blue); font-weight: 600; }
.ms__box { display: grid; place-items: center; width: 20px; height: 20px; border: 1.5px solid var(--ink-300); border-radius: 5px; color: transparent; flex-shrink: 0; }
.ms--single .ms__box { border-radius: 50%; }
.ms__option[aria-selected="true"] .ms__box { border-color: var(--brand-blue); background: var(--brand-blue); color: #fff; }
.ms__label { flex: 1; }
.ms__meta { color: var(--text-muted); font-size: var(--text-xs); font-weight: 400; }
.ms__empty { padding: var(--space-6) var(--space-4); text-align: center; color: var(--text-muted); font-size: var(--text-sm); }
.ms__footer { display: flex; justify-content: space-between; gap: var(--space-2); padding: var(--space-2) var(--space-3); border-top: 1px solid var(--border); background: var(--ink-50); }
.ms__tags { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.ms__tags:empty { display: none; }

/* ---------- Chips and badges ---------- */
.chip { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 36px; padding: .375rem .875rem; border: 1px solid var(--border-strong); border-radius: var(--radius-pill); background: var(--surface); color: var(--text-strong); font-size: var(--text-sm); font-weight: 500; white-space: nowrap; transition: all var(--duration) var(--ease); }
button.chip:hover, a.chip:hover { border-color: var(--brand-blue); color: var(--brand-blue); text-decoration: none; }
.chip[aria-pressed="true"] { border-color: var(--brand-blue); background: var(--blue-50); color: var(--brand-blue); font-weight: 600; }
.chip--removable { padding-right: .375rem; background: var(--blue-50); border-color: var(--blue-200); color: var(--brand-blue); font-weight: 600; }
.chip__remove { display: grid; place-items: center; width: 32px; height: 32px; margin-block: -4px; border: 0; border-radius: 50%; background: transparent; color: inherit; }
.chip__remove:hover { background: var(--blue-100); }
.chip-row { display: flex; gap: var(--space-2); overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.chip-row::-webkit-scrollbar { display: none; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--text); font-size: var(--text-xs); font-weight: 600; line-height: 1.4; white-space: nowrap; }
.badge .icon { width: 14px; height: 14px; }
.badge--financiable { background: var(--success-bg); color: var(--success); }
.badge--insurable { background: var(--blue-50); color: var(--brand-blue); }
.badge--dealer { background: var(--brand-blue); color: #fff; }
.badge--private { background: var(--surface); color: var(--text-strong); box-shadow: inset 0 0 0 1px var(--border-strong); }
.badge--verified { background: var(--blue-50); color: var(--brand-blue); }
.badge--new { background: var(--warning-bg); color: var(--warning); }
.badge--status-published { background: var(--success-bg); color: var(--success); }
.badge--status-review { background: var(--warning-bg); color: var(--warning); }
.badge--status-draft { background: var(--surface-muted); color: var(--text); }
.badge--status-expired { background: var(--danger-bg); color: var(--danger); }

/* ---------- Vehicle card ---------- */
.vehicle-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--space-5); }
.vcard { position: relative; display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; transition: box-shadow var(--duration) var(--ease), transform var(--duration) var(--ease); }
.vcard:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); }
.vcard__link { position: absolute; inset: 0; z-index: 1; }
.vcard__link:focus-visible { box-shadow: inset 0 0 0 3px var(--blue-ring); border-radius: var(--radius-lg); }
.vcard__media { position: relative; aspect-ratio: 4 / 3; background: var(--surface-muted); }
.vcard__media { overflow: hidden; }
.vcard__media img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.vcard__media--empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-2); background: linear-gradient(135deg, var(--ink-50), var(--ink-100)); color: var(--text-muted); font-size: var(--text-xs); font-weight: 600; }
.vcard__media .vcard__brand { position: static; width: 72px; height: 72px; object-fit: contain; opacity: .55; filter: grayscale(1); }
.vcard__badges { position: absolute; left: var(--space-3); top: var(--space-3); display: flex; flex-wrap: wrap; gap: var(--space-1); }
.vcard__fav { position: absolute; z-index: 2; right: var(--space-3); top: var(--space-3); display: grid; place-items: center; width: 40px; height: 40px; border: 0; border-radius: 50%; background: rgb(255 255 255 / .92); color: var(--text-strong); box-shadow: var(--shadow); }
.vcard__fav[aria-pressed="true"] { color: var(--danger); }
.vcard__fav[aria-pressed="true"] path { fill: currentColor; }
.vcard__photos { position: absolute; right: var(--space-3); bottom: var(--space-3); display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: var(--radius-pill); background: rgb(0 0 0 / .6); color: #fff; font-size: var(--text-xs); font-weight: 600; }
.vcard__photos .icon { width: 14px; height: 14px; }
.vcard__body { display: flex; flex-direction: column; gap: var(--space-2); padding: var(--space-4); flex: 1; }
.vcard__title { margin: 0; font-family: var(--font-sans); font-size: var(--text-base); font-weight: 600; line-height: 1.35; color: var(--text-strong); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.vcard__specs { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-3); color: var(--text-muted); font-size: var(--text-sm); }
.vcard__specs span { display: inline-flex; align-items: center; gap: 4px; }
.vcard__specs .icon { width: 16px; height: 16px; }
.vcard__price { margin-top: auto; padding-top: var(--space-2); font-family: var(--font-display); font-size: var(--text-xl); font-weight: 600; color: var(--text-strong); }
.vcard__quota { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--success); font-weight: 600; }
.vcard__quota .icon { width: 16px; height: 16px; }
.vcard__footer { display: flex; justify-content: space-between; align-items: center; gap: var(--space-2); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--border); color: var(--text-muted); font-size: var(--text-xs); }
.vcard__footer span { display: inline-flex; align-items: center; gap: 4px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vcard__footer .icon { width: 14px; height: 14px; }

@media (min-width: 768px) {
  .vcard--row { flex-direction: row; }
  .vcard--row .vcard__media { width: 40%; max-width: 340px; aspect-ratio: auto; min-height: 220px; flex-shrink: 0; }
  .vcard--row .vcard__content { display: flex; flex-direction: column; flex: 1; }
}
.vcard__content { display: flex; flex-direction: column; flex: 1; }

/* ---------- Panels: simulator, insurance, partners ---------- */
.panel { border: 1px solid var(--border); border-radius: var(--radius-lg); background: var(--surface); padding: var(--space-5); }
.panel__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.panel__title { display: flex; align-items: center; gap: var(--space-2); margin: 0; font-size: var(--text-lg); }
.panel__brand { height: 22px; width: auto; }

.sim { display: grid; gap: var(--space-5); }
.sim__row { display: grid; gap: var(--space-1); }
.sim__row-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); font-size: var(--text-sm); }
.sim__row-head output { font-weight: 700; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.sim__scale { display: flex; justify-content: space-between; font-size: var(--text-xs); color: var(--text-muted); }
.sim__result { display: grid; gap: var(--space-1); padding: var(--space-4); border-radius: var(--radius); background: var(--blue-50); text-align: center; }
.sim__result strong { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 600; color: var(--brand-blue); font-variant-numeric: tabular-nums; line-height: 1.1; }
.sim__result span { font-size: var(--text-sm); color: var(--text); }
.sim__breakdown { display: grid; grid-template-columns: 1fr auto; gap: var(--space-2) var(--space-4); margin: 0; font-size: var(--text-sm); }
.sim__breakdown dt { color: var(--text-muted); }
.sim__breakdown dd { margin: 0; text-align: right; font-weight: 600; color: var(--text-strong); font-variant-numeric: tabular-nums; }
.fine-print { margin: 0; font-size: var(--text-xs); color: var(--text-muted); line-height: 1.5; }

.price-tag { display: flex; align-items: baseline; gap: var(--space-2); flex-wrap: wrap; }
.price-tag strong { font-family: var(--font-display); font-size: var(--text-2xl); font-weight: 600; color: var(--text-strong); }

.partners { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-6) var(--space-10); padding: var(--space-6); border-radius: var(--radius-lg); background: var(--surface); border: 1px solid var(--border); }
.partners__slot { display: grid; place-items: center; width: 132px; height: 52px; border: 1.5px dashed var(--border-strong); border-radius: var(--radius); color: var(--text-muted); font-size: var(--text-xs); font-weight: 600; text-align: center; }
.partners img { height: 36px; width: auto; }

.ad-slot { position: relative; display: grid; place-items: center; gap: var(--space-2); min-height: 120px; padding: var(--space-6); border-radius: var(--radius-lg); background: repeating-linear-gradient(135deg, var(--ink-100) 0 12px, var(--ink-50) 12px 24px); border: 1px dashed var(--border-strong); color: var(--text-muted); text-align: center; font-size: var(--text-sm); }
.ad-slot::before { content: "Publicidad"; position: absolute; top: var(--space-2); left: var(--space-3); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }

/* ---------- Feedback ---------- */
.alert { display: flex; gap: var(--space-3); align-items: flex-start; padding: var(--space-4); border-radius: var(--radius); border: 1px solid; font-size: var(--text-sm); }
.alert p { margin: 0; }
.alert strong { color: inherit; }
.alert--info { background: var(--blue-50); border-color: var(--blue-200); color: var(--brand-blue); }
.alert--success { background: var(--success-bg); border-color: color-mix(in srgb, var(--success) 30%, #fff); color: var(--success); }
.alert--warning { background: var(--warning-bg); border-color: color-mix(in srgb, var(--warning) 30%, #fff); color: var(--warning); }
.alert--danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 30%, #fff); color: var(--danger); }

.toast-region { position: fixed; z-index: var(--z-toast); left: 50%; bottom: calc(var(--bottom-nav-height) + var(--space-4)); transform: translateX(-50%); display: grid; gap: var(--space-2); width: min(420px, calc(100% - 2 * var(--gutter))); pointer-events: none; }
@media (min-width: 1024px) { .toast-region { bottom: var(--space-6); } }
.toast { display: flex; gap: var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-radius: var(--radius); background: var(--ink-900); color: #fff; box-shadow: var(--shadow-lg); font-size: var(--text-sm); pointer-events: auto; animation: toast-in var(--duration) var(--ease); }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }

.skeleton { border-radius: var(--radius-sm); background: linear-gradient(90deg, var(--ink-100) 25%, var(--ink-50) 50%, var(--ink-100) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite linear; }
@keyframes shimmer { to { background-position: -200% 0; } }

.empty { display: grid; justify-items: center; gap: var(--space-3); padding: var(--space-12) var(--space-6); text-align: center; color: var(--text-muted); }
.empty__icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--blue-50); color: var(--brand-blue); }
.empty h3 { margin: 0; }

/* ---------- Dialog and bottom sheet ---------- */
.dialog { width: min(560px, calc(100% - 2 * var(--gutter))); max-height: min(85vh, 760px); padding: 0; border: 0; border-radius: var(--radius-lg); background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); }
.dialog::backdrop { background: rgb(16 24 40 / .55); }
.dialog[open] { display: flex; flex-direction: column; animation: dialog-in var(--duration) var(--ease); }
@keyframes dialog-in { from { opacity: 0; transform: translateY(12px) scale(.98); } }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-bottom: 1px solid var(--border); }
.dialog__head h2 { margin: 0; font-size: var(--text-lg); }
.dialog__body { padding: var(--space-5); overflow-y: auto; }
.dialog__foot { display: flex; justify-content: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-5); border-top: 1px solid var(--border); background: var(--ink-50); }
@media (max-width: 767px) {
  .dialog--sheet { width: 100%; max-width: none; max-height: 88vh; margin: auto 0 0; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .dialog--sheet[open] { animation: sheet-in .24s var(--ease); }
  .dialog--sheet .dialog__head::before { content: ""; position: absolute; left: 50%; top: 6px; width: 40px; height: 4px; margin-left: -20px; border-radius: 2px; background: var(--ink-300); }
  .dialog--sheet .dialog__head { position: relative; padding-top: var(--space-5); }
  .dialog__foot > .btn { flex: 1; }
}
@keyframes sheet-in { from { transform: translateY(100%); } }

/* ---------- Navigation ---------- */
.tabs { display: flex; gap: var(--space-1); padding: 4px; border-radius: var(--radius); background: var(--surface-muted); overflow-x: auto; scrollbar-width: none; }
.tabs [role="tab"] { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 40px; padding: .5rem 1rem; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font-size: var(--text-sm); font-weight: 600; white-space: nowrap; }
.tabs [role="tab"][aria-selected="true"] { background: var(--surface); color: var(--brand-blue); box-shadow: var(--shadow-sm); }

.breadcrumbs { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin: 0; padding: 0; list-style: none; font-size: var(--text-sm); color: var(--text-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: var(--space-2); }
.breadcrumbs li + li::before { content: "/"; color: var(--ink-300); }
.breadcrumbs a { color: var(--text-muted); }
.breadcrumbs [aria-current="page"] { color: var(--text-strong); font-weight: 600; }

.pagination { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: var(--space-1); }
.pagination a, .pagination span { display: grid; place-items: center; min-width: var(--tap); height: var(--tap); padding-inline: var(--space-2); border-radius: var(--radius); color: var(--text-strong); font-size: var(--text-sm); font-weight: 600; }
.pagination a:hover { background: var(--surface-muted); text-decoration: none; }
.pagination [aria-current="page"] { background: var(--brand-blue); color: #fff; }
.pagination .gap { color: var(--text-muted); }

.stepper { display: flex; gap: var(--space-2); margin: 0; padding: 0; list-style: none; counter-reset: step; overflow-x: auto; scrollbar-width: none; }
.stepper li { counter-increment: step; display: flex; align-items: center; gap: var(--space-2); flex: 1; min-width: max-content; padding-bottom: var(--space-3); border-bottom: 3px solid var(--ink-200); color: var(--text-muted); font-size: var(--text-sm); font-weight: 600; }
.stepper li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--ink-100); color: var(--text); font-size: var(--text-xs); }
.stepper [data-state="done"] { border-color: var(--success); color: var(--text); }
.stepper [data-state="done"]::before { content: "✓"; background: var(--success); color: #fff; }
.stepper [aria-current="step"] { border-color: var(--brand-blue); color: var(--brand-blue); }
.stepper [aria-current="step"]::before { background: var(--brand-blue); color: #fff; }

/* Mobile bottom navigation and sticky action bar */
.bottom-nav { position: fixed; z-index: var(--z-header); left: 0; right: 0; bottom: 0; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--bottom-nav-height) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--border); background: rgb(255 255 255 / .97); backdrop-filter: blur(8px); }
.bottom-nav a { display: grid; justify-items: center; align-content: center; gap: 2px; color: var(--text-muted); font-size: 11px; font-weight: 600; text-decoration: none; }
.bottom-nav a[aria-current="page"] { color: var(--brand-blue); }
.bottom-nav__publish .icon { width: 40px; height: 40px; padding: 9px; border-radius: 50%; background: var(--brand-blue); color: #fff; margin-top: -14px; box-shadow: var(--shadow); }
@media (min-width: 1024px) { .bottom-nav { display: none; } }

.action-bar { position: sticky; z-index: var(--z-sticky); bottom: 0; display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) var(--gutter); padding-bottom: calc(var(--space-3) + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); box-shadow: 0 -6px 20px rgb(16 24 40 / .08); }
.action-bar__price { flex: 1; min-width: 0; display: grid; line-height: 1.2; }
.action-bar__price strong { font-family: var(--font-display); font-size: var(--text-lg); color: var(--text-strong); }
.action-bar__price span { font-size: var(--text-xs); color: var(--success); font-weight: 600; }
@media (min-width: 1024px) { .action-bar--mobile { display: none; } }
