/* Family theme — reusable components. Markup lives in resources/views/components/ui. */

/* ---------- Button ---------- */

.btn {
    --btn-bg: var(--surface-2);
    --btn-fg: var(--text);
    --btn-border: transparent;
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 22px;
    border: 1.5px solid var(--btn-border);
    border-radius: var(--radius-pill);
    background: var(--btn-bg);
    color: var(--btn-fg);
    font-weight: 700;
    font-size: var(--text-sm);
    line-height: 1;
    white-space: nowrap;
    user-select: none;
    transition: transform var(--dur-fast) var(--ease), box-shadow var(--dur) var(--ease),
        background-color var(--dur-fast) var(--ease), border-color var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease);
}

.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.97); }

.btn--primary {
    --btn-bg: var(--primary);
    --btn-fg: var(--on-primary);
    box-shadow: var(--shadow-primary);
}
.btn--primary:hover { --btn-bg: var(--primary-hover); }

.btn--dark {
    --btn-bg: var(--text);
    --btn-fg: var(--bg);
}

.btn--soft {
    --btn-bg: var(--primary-soft);
    --btn-fg: var(--primary);
}

.btn--outline {
    --btn-bg: transparent;
    --btn-border: var(--border-strong);
}
.btn--outline:hover { --btn-border: var(--text); }

.btn--ghost { --btn-bg: transparent; }
.btn--ghost:hover { --btn-bg: var(--surface-2); transform: none; }

.btn--danger {
    --btn-bg: var(--danger-soft);
    --btn-fg: var(--danger);
}
.btn--danger:hover { --btn-bg: var(--danger); --btn-fg: #fff; }

.btn--success {
    --btn-bg: var(--success);
    --btn-fg: #fff;
}

.btn--sm { min-height: 36px; padding: 0 14px; font-size: var(--text-xs); }
.btn--lg { min-height: 56px; padding: 0 30px; font-size: var(--text-md); }
.btn--block { width: 100%; }

.btn[disabled],
.btn.is-disabled {
    opacity: .5;
    pointer-events: none;
    box-shadow: none;
}

.btn.is-loading {
    color: transparent !important;
    pointer-events: none;
}

.btn.is-loading::after {
    content: '';
    position: absolute;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2.5px solid var(--btn-fg);
    border-right-color: transparent;
    animation: spin .7s linear infinite;
}

.icon-btn {
    position: relative;
    display: inline-grid;
    place-items: center;
    width: 44px;
    height: 44px;
    flex: none;
    border-radius: 50%;
    color: var(--text);
    transition: background-color var(--dur-fast) var(--ease), transform var(--dur-fast) var(--ease),
        color var(--dur-fast) var(--ease);
}

.icon-btn:hover { background: var(--surface-2); }
.icon-btn:active { transform: scale(.92); }
.icon-btn--solid { background: var(--surface); box-shadow: var(--shadow-sm); }
.icon-btn--sm { width: 34px; height: 34px; }
.icon-btn--danger:hover { background: var(--danger-soft); color: var(--danger); }

.icon-btn__badge {
    position: absolute;
    top: 2px;
    right: 0;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border-radius: var(--radius-pill);
    background: var(--primary);
    color: var(--on-primary);
    font-size: 11px;
    font-weight: 800;
    line-height: 19px;
    text-align: center;
    box-shadow: 0 0 0 2px var(--bg);
}

.icon-btn__badge.is-bump { animation: bump .45s var(--ease-spring); }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes bump { 0% { transform: scale(1); } 40% { transform: scale(1.5); } 100% { transform: scale(1); } }

/* ---------- Form fields ---------- */

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }

.field__label {
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text);
}

.field__label em { color: var(--primary); font-style: normal; }

.field__control { position: relative; display: flex; align-items: center; }

.input,
.select,
.textarea {
    width: 100%;
    min-height: 50px;
    padding: 12px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    background: var(--surface);
    color: var(--text);
    transition: border-color var(--dur-fast) var(--ease), box-shadow var(--dur-fast) var(--ease),
        background-color var(--dur) var(--ease);
}

.textarea { min-height: 120px; resize: vertical; line-height: 1.5; }

.input::placeholder,
.textarea::placeholder { color: var(--text-faint); }

.input:hover,
.select:hover,
.textarea:hover { border-color: var(--border-strong); }

.input:focus,
.select:focus,
.textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px var(--primary-soft);
}

.input[readonly] { background: var(--surface-2); color: var(--text-muted); }

.field__control > .icon {
    position: absolute;
    left: 15px;
    color: var(--text-faint);
    pointer-events: none;
}

.field__control--icon .input { padding-left: 46px; }
.field__control--action .input { padding-right: 50px; }

.field__action {
    position: absolute;
    right: 5px;
    color: var(--text-muted);
}

.select {
    appearance: none;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23908090' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.select--sm { min-height: 38px; padding: 6px 38px 6px 12px; font-size: var(--text-sm); font-weight: 600; }

.field__hint { font-size: var(--text-xs); color: var(--text-muted); }

.field__error {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--danger);
}

.field.has-error .input,
.field.has-error .select,
.field.has-error .textarea {
    border-color: var(--danger);
    box-shadow: 0 0 0 4px var(--danger-soft);
}

.check {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: var(--text-sm);
    font-weight: 600;
}

.check input {
    appearance: none;
    flex: none;
    width: 22px;
    height: 22px;
    margin: 0;
    border: 1.5px solid var(--border-strong);
    border-radius: 7px;
    background: var(--surface) center / 0 no-repeat;
    cursor: pointer;
    transition: all var(--dur-fast) var(--ease);
}

.check input:checked {
    border-color: var(--primary);
    background-color: var(--primary);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
    background-size: 15px;
}

.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }

.switch input {
    appearance: none;
    flex: none;
    width: 46px;
    height: 27px;
    margin: 0;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    cursor: pointer;
    transition: background-color var(--dur) var(--ease);
}

.switch input::after {
    content: '';
    position: absolute;
    top: 3px;
    left: 3px;
    width: 21px;
    height: 21px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    transition: transform var(--dur) var(--ease-spring);
}

.switch input:checked { background: var(--success); }
.switch input:checked::after { transform: translateX(19px); }

/* Radio presented as a selectable card */

.choice { position: relative; display: block; cursor: pointer; }

.choice input { position: absolute; opacity: 0; pointer-events: none; }

.choice__body {
    display: flex;
    align-items: center;
    gap: 14px;
    height: 100%;
    padding: 16px 18px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    background: var(--surface);
    transition: all var(--dur-fast) var(--ease);
}

.choice__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: var(--surface-2);
    color: var(--text-muted);
    transition: all var(--dur-fast) var(--ease);
}

.choice__title { font-weight: 700; }
.choice__text { font-size: var(--text-xs); color: var(--text-muted); }

.choice__mark {
    flex: none;
    width: 22px;
    height: 22px;
    margin-left: auto;
    border: 1.5px solid var(--border-strong);
    border-radius: 50%;
    transition: all var(--dur-fast) var(--ease);
}

.choice:hover .choice__body { border-color: var(--border-strong); }

.choice input:checked + .choice__body {
    border-color: var(--primary);
    background: var(--primary-soft);
}

.choice input:checked + .choice__body .choice__icon { background: var(--primary); color: var(--on-primary); }
.choice input:checked + .choice__body .choice__mark { border: 7px solid var(--primary); }
.choice input:focus-visible + .choice__body { outline: 2px solid var(--accent); outline-offset: 3px; }

/* Quantity stepper */

.stepper {
    display: inline-flex;
    align-items: center;
    height: 42px;
    padding: 3px;
    border-radius: var(--radius-pill);
    background: var(--surface-2);
}

.stepper__btn {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--surface);
    color: var(--text);
    box-shadow: var(--shadow-sm);
    transition: all var(--dur-fast) var(--ease);
}

.stepper__btn:hover:not([disabled]) { background: var(--primary); color: var(--on-primary); }
.stepper__btn:active:not([disabled]) { transform: scale(.88); }
.stepper__btn[disabled] { opacity: .35; cursor: not-allowed; box-shadow: none; }

.stepper__value {
    min-width: 36px;
    padding: 0 4px;
    font-weight: 800;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.stepper--sm { height: 36px; }
.stepper--sm .stepper__btn { width: 30px; height: 30px; }
.stepper--sm .stepper__value { min-width: 30px; font-size: var(--text-sm); }

/* ---------- Badge, chip ---------- */

.badge {
    --tone: var(--text-muted);
    --tone-soft: var(--surface-2);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 11px;
    border-radius: var(--radius-pill);
    background: var(--tone-soft);
    color: var(--tone);
    font-size: var(--text-xs);
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
}

.badge--dot::before {
    content: '';
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: currentColor;
}

.badge--success { --tone: var(--success); --tone-soft: var(--success-soft); }
.badge--warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.badge--danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }
.badge--info { --tone: var(--info); --tone-soft: var(--info-soft); }
.badge--accent { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.badge--primary { --tone: var(--primary); --tone-soft: var(--primary-soft); }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 40px;
    padding: 0 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-pill);
    background: var(--surface);
    color: var(--text-muted);
    font-size: var(--text-sm);
    font-weight: 700;
    white-space: nowrap;
    transition: all var(--dur-fast) var(--ease);
}

.chip:hover { border-color: var(--text); color: var(--text); }

.chip.is-active {
    border-color: var(--text);
    background: var(--text);
    color: var(--bg);
}

.chip__count { font-size: var(--text-xs); opacity: .6; }

.chip--sm { min-height: 34px; padding: 0 13px; border-width: 1px; font-weight: 600; }
.chips--sub { margin-bottom: 20px; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }

/* ---------- Card ---------- */

.card {
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.card__body { padding: clamp(18px, 2.4vw, 28px); }
.card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: clamp(18px, 2.4vw, 24px) clamp(18px, 2.4vw, 28px) 0;
}
.card__head h3, .card__head h4 { font-size: var(--text-lg); }
.card__foot {
    padding: 16px clamp(18px, 2.4vw, 28px);
    border-top: 1px solid var(--border);
}

.card--flat { box-shadow: none; }
.card--soft { border-color: transparent; background: var(--surface-2); box-shadow: none; }

/* ---------- Avatar ---------- */

.avatar {
    display: inline-grid;
    place-items: center;
    flex: none;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: var(--grad-brand);
    color: #fff;
    font-size: var(--text-sm);
    font-weight: 800;
}

.avatar--lg { width: 72px; height: 72px; font-size: var(--text-xl); }

/* ---------- Alert ---------- */

.alert {
    --tone: var(--info);
    --tone-soft: var(--info-soft);
    display: flex;
    gap: 12px;
    padding: 14px 18px;
    border-radius: var(--radius);
    background: var(--tone-soft);
    color: var(--tone);
    font-size: var(--text-sm);
    font-weight: 600;
}

.alert--success { --tone: var(--success); --tone-soft: var(--success-soft); }
.alert--warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }
.alert--danger { --tone: var(--danger); --tone-soft: var(--danger-soft); }

/* ---------- Empty state ---------- */

.empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: clamp(32px, 6vw, 64px) 20px;
    text-align: center;
}

.empty__art {
    display: grid;
    place-items: center;
    width: 92px;
    height: 92px;
    border-radius: 32px;
    background: var(--grad-warm);
    color: var(--text);
    animation: float 5s ease-in-out infinite;
}

.empty p { max-width: 380px; color: var(--text-muted); }

@keyframes float { 50% { transform: translateY(-8px) rotate(-3deg); } }

/* ---------- Table ---------- */

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

.table th {
    padding: 12px 16px;
    font-size: var(--text-xs);
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
    text-align: left;
    color: var(--text-faint);
    white-space: nowrap;
}

.table td {
    padding: 14px 16px;
    border-top: 1px solid var(--border);
    font-size: var(--text-sm);
    vertical-align: middle;
}

.table tbody tr { transition: background-color var(--dur-fast) var(--ease); }
.table tbody tr:hover { background: var(--surface-2); }
.table .is-right { text-align: right; }
.table .is-muted-row { opacity: .55; }

.thumb {
    flex: none;
    width: 52px;
    height: 52px;
    border-radius: 14px;
    object-fit: cover;
    background: var(--surface-2);
}

.thumb--sm { width: 40px; height: 40px; border-radius: 11px; }
.thumb--lg { width: 76px; height: 76px; border-radius: 18px; }

.thumbs { display: flex; }
.thumbs .thumb { box-shadow: 0 0 0 2px var(--surface); }
.thumbs .thumb + .thumb { margin-left: -14px; }
.thumbs__more {
    display: grid;
    place-items: center;
    width: 40px;
    height: 40px;
    margin-left: -14px;
    border-radius: 11px;
    background: var(--surface-3);
    box-shadow: 0 0 0 2px var(--surface);
    font-size: var(--text-xs);
    font-weight: 800;
}

/* ---------- Pagination ---------- */

.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 32px; }

.pagination__item {
    display: grid;
    place-items: center;
    min-width: 42px;
    height: 42px;
    padding: 0 12px;
    border-radius: var(--radius-pill);
    font-size: var(--text-sm);
    font-weight: 700;
    color: var(--text-muted);
    transition: all var(--dur-fast) var(--ease);
}

a.pagination__item:hover { background: var(--surface-2); color: var(--text); }
.pagination__item.is-active { background: var(--text); color: var(--bg); }
.pagination__item.is-disabled { opacity: .35; }

/* ---------- Overlay: modal and drawer ---------- */

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    visibility: hidden;
    background: var(--overlay);
    opacity: 0;
    backdrop-filter: blur(6px);
    transition: opacity var(--dur) var(--ease), visibility 0s linear var(--dur);
}

.overlay.is-open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
}

.overlay--modal { align-items: center; justify-content: center; padding: 20px; }
.overlay--drawer { justify-content: flex-end; }
.overlay--top { align-items: flex-start; justify-content: center; padding: clamp(12px, 8vh, 96px) 16px 16px; }

.modal {
    width: 100%;
    max-width: 460px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    padding: clamp(22px, 3vw, 32px);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-lg);
    transform: translateY(24px) scale(.96);
    transition: transform var(--dur) var(--ease-spring);
}

.modal--wide { max-width: 640px; }
.overlay.is-open .modal { transform: none; }

.modal__title { font-size: var(--text-xl); }
.modal__text { margin-top: 10px; color: var(--text-muted); }
.modal__actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 26px; }

.drawer {
    display: flex;
    flex-direction: column;
    width: min(460px, 100%);
    height: 100%;
    background: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateX(100%);
    transition: transform .42s var(--ease);
}

.overlay.is-open .drawer { transform: none; }

.drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
}

.drawer__head h3 { font-size: var(--text-xl); }
.drawer__body { flex: 1; overflow-y: auto; padding: 4px 22px 22px; overscroll-behavior: contain; }
.drawer__foot {
    padding: 18px 22px calc(18px + env(safe-area-inset-bottom));
    border-top: 1px solid var(--border);
    background: var(--surface);
}

/* ---------- Toasts ---------- */

.toasts {
    position: fixed;
    right: 20px;
    bottom: calc(20px + var(--tabbar-h));
    z-index: 200;
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: min(380px, calc(100vw - 40px));
    pointer-events: none;
}

.toast {
    --tone: var(--success);
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    overflow: hidden;
    border-radius: var(--radius);
    background: var(--text);
    color: var(--bg);
    font-size: var(--text-sm);
    font-weight: 600;
    box-shadow: var(--shadow-lg);
    pointer-events: auto;
    animation: toast-in .45s var(--ease-spring);
}

.toast.is-leaving { animation: toast-out .3s var(--ease) forwards; }

.toast__icon {
    display: grid;
    place-items: center;
    flex: none;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--tone);
    color: #fff;
}

.toast::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    background: var(--tone);
    transform-origin: left;
    animation: toast-timer var(--life, 4s) linear forwards;
}

.toast--error { --tone: #f0525a; }
.toast--warning { --tone: #f5a524; }
.toast--info { --tone: #4c9bff; }
.toast--success { --tone: #22b87c; }

@keyframes toast-in { from { opacity: 0; transform: translateY(24px) scale(.92); } }
@keyframes toast-out { to { opacity: 0; transform: translateX(40px); } }
@keyframes toast-timer { to { transform: scaleX(0); } }

/* ---------- Skeleton ---------- */

.skeleton {
    border-radius: var(--radius-sm);
    background: linear-gradient(100deg, var(--surface-2) 30%, var(--surface-3) 50%, var(--surface-2) 70%);
    background-size: 300% 100%;
    animation: shimmer 1.4s linear infinite;
}

@keyframes shimmer { to { background-position: -150% 0; } }

/* ---------- Stat ---------- */

.stat {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 6px;
    padding: 22px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    background: var(--surface);
    box-shadow: var(--shadow-sm);
    transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.stat:hover { transform: translateY(-4px); box-shadow: var(--shadow); }

.stat__icon {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    margin-bottom: 8px;
    border-radius: 15px;
    background: var(--tone-soft, var(--primary-soft));
    color: var(--tone, var(--primary));
}

.stat__label { font-size: var(--text-sm); font-weight: 600; color: var(--text-muted); }
.stat__value {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    font-weight: 700;
    letter-spacing: -.03em;
    font-variant-numeric: tabular-nums;
}
.stat__note { font-size: var(--text-xs); color: var(--text-faint); }

.stat--accent { --tone: var(--accent); --tone-soft: var(--accent-soft); }
.stat--success { --tone: var(--success); --tone-soft: var(--success-soft); }
.stat--warning { --tone: var(--warning); --tone-soft: var(--warning-soft); }

/* ---------- Progress track (order status) ---------- */

.track { display: flex; gap: 6px; }

.track__step { flex: 1; min-width: 0; }

.track__bar {
    height: 6px;
    border-radius: var(--radius-pill);
    background: var(--surface-3);
    overflow: hidden;
}

.track__bar::after {
    content: '';
    display: block;
    height: 100%;
    width: 0;
    border-radius: inherit;
    background: var(--grad-brand);
    transition: width .8s var(--ease);
}

.track__step.is-done .track__bar::after,
.track__step.is-current .track__bar::after { width: 100%; }

.track__label {
    margin-top: 8px;
    font-size: var(--text-xs);
    font-weight: 700;
    color: var(--text-faint);
}

.track__step.is-done .track__label { color: var(--text-muted); }
.track__step.is-current .track__label { color: var(--primary); }

@media (max-width: 640px) {
    .track__label { display: none; }
    .track__step.is-current .track__label { display: block; white-space: nowrap; }
}

/* ---------- Dropzone ---------- */

.dropzone {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed var(--border-strong);
    border-radius: var(--radius);
    background: var(--surface-2);
    text-align: center;
    color: var(--text-muted);
    transition: all var(--dur-fast) var(--ease);
}

.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.dropzone:hover,
.dropzone.is-over {
    border-color: var(--primary);
    background: var(--primary-soft);
    color: var(--primary);
}

.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 12px; }

.media {
    position: relative;
    aspect-ratio: 1;
    overflow: hidden;
    border: 2px solid transparent;
    border-radius: var(--radius);
    background: var(--surface-2);
    transition: all var(--dur) var(--ease);
}

.media img { width: 100%; height: 100%; object-fit: cover; }
.media.is-cover { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); }
.media.is-removing { opacity: 0; transform: scale(.8); }

.media__bar {
    position: absolute;
    inset: auto 6px 6px;
    display: flex;
    justify-content: space-between;
    gap: 6px;
}

.media__btn {
    display: grid;
    place-items: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(20, 12, 24, .7);
    color: #fff;
    backdrop-filter: blur(6px);
    transition: all var(--dur-fast) var(--ease);
}

.media__btn:hover { background: var(--primary); transform: scale(1.1); }
.media.is-cover .media__btn--cover { background: var(--primary); }
.media__tag {
    position: absolute;
    top: 6px;
    left: 6px;
}

/* Group of .choice cards: as many columns as fit comfortably */
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 12px; }

/* Chips that wrap to the next row instead of scrolling out of sight */
.chips--wrap { flex-wrap: wrap; overflow: visible; padding-bottom: 0; }
