.ql-editor table, .ql-editor td, .ql-editor th,
.ql-snow .ql-editor table, .ql-snow .ql-editor td,
.quillWrapper table, .quillWrapper td, .quillWrapper th {
    border: 1px solid var(--bs-border-color);
    border-collapse: collapse;
    padding: 4px 8px;
    min-width: 60px;
}

.ql-table-insert::before { content: '⊞'; font-size: 15px; }

.comment-body img { max-width: 100%; height: auto; border-radius: .375rem; margin: .25rem 0; }
.comment-body blockquote {
    border-left: 3px solid var(--bs-border-color);
    margin: .5rem 0;
    padding-left: .75rem;
    color: var(--bs-secondary-color);
}

.comment-quill-editor {
    background: var(--bs-paper-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ql-toolbar.ql-snow,
[data-bs-theme="dark"] .ql-container.ql-snow {
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ql-toolbar.ql-snow,
[data-bs-theme="dark"] .ql-container.ql-snow,
[data-bs-theme="dark"] .comment-quill-editor .ql-editor {
    background: var(--bs-paper-bg);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ql-snow .ql-stroke {
    stroke: var(--bs-body-color);
}

[data-bs-theme="dark"] .ql-snow .ql-fill,
[data-bs-theme="dark"] .ql-snow .ql-picker-label svg .ql-stroke {
    fill: var(--bs-body-color);
}

[data-bs-theme="dark"] .ql-snow .ql-picker,
[data-bs-theme="dark"] .ql-snow .ql-picker-label {
    color: var(--bs-body-color);
}
.comment-body p:last-child { margin-bottom: 0; }
.comment-quill-editor { min-height: 120px; }
.comment-editor-form--compact .comment-quill-editor { min-height: 80px; }
.comment-quill-editor .ql-editor { min-height: inherit; }

.deal-thread-card {
    background: var(--bs-paper-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 12px;
    box-shadow: var(--bs-box-shadow-sm);
    overflow: hidden;
    transition: box-shadow .15s ease;
    color: var(--bs-body-color);
}

.deal-thread-card:hover {
    box-shadow: var(--bs-box-shadow);
}

.deal-thread-card__inner {
    display: grid;
    grid-template-columns: 14.125rem minmax(0, 1fr);
    grid-template-rows: min-content 1fr min-content;
    grid-template-areas:
        "media header"
        "media body"
        "media footer";
    min-height: 14.25rem;
    position: relative;
}

.deal-thread-card__inner::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 14.125rem;
    background: var(--bs-gray-50);
    border-radius: 12px 0 0 12px;
    pointer-events: none;
}

.deal-thread-card__media {
    grid-area: media;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    position: relative;
    z-index: 1;
    min-height: 14.25rem;
    outline: 8px solid var(--bs-paper-bg);
    outline-offset: -8px;
}

.deal-thread-card__image-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
}

.deal-thread-card__image {
    display: block;
    max-width: calc(100% - 4px);
    max-height: 11rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.deal-thread-card__image--placeholder {
    width: 5rem;
    height: 5rem;
    object-fit: cover;
    opacity: .55;
    filter: grayscale(1);
}

.deal-thread-card__content {
    display: contents;
}

.deal-thread-card__header {
    grid-area: header;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    padding: 1rem 1rem 0;
    position: relative;
    z-index: 1;
}

.deal-thread-card__body {
    grid-area: body;
    padding: .5rem 1rem 0;
    min-width: 0;
    position: relative;
    z-index: 1;
}

.deal-thread-card__footer {
    grid-area: footer;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: .5rem;
    padding: .75rem 1rem 1rem;
    position: relative;
    z-index: 1;
}

.deal-thread-card__title {
    font-size: 1.05rem;
    line-height: 1.35;
    margin: 0 0 .35rem;
    font-weight: 600;
    color: var(--bs-heading-color);
}

.deal-thread-card__title a {
    color: inherit;
    text-decoration: none;
}

.deal-thread-card__title a:hover {
    color: var(--bs-primary);
}

.deal-thread-card__meta {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    margin-bottom: .5rem;
}

.deal-thread-card__meta a {
    color: inherit;
    text-decoration: none;
}

.deal-thread-card__meta a:hover {
    text-decoration: underline;
}

.deal-thread-card__excerpt {
    color: var(--bs-secondary-color);
    font-size: .875rem;
    line-height: 1.45;
    margin-bottom: .65rem;
}

.deal-thread-card__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem;
    margin-bottom: .25rem;
}

.deal-thread-card__price-old {
    color: var(--bs-secondary-color);
    text-decoration: line-through;
    font-size: .875rem;
}

.deal-thread-card__price-new {
    color: #198754;
    font-size: 1.125rem;
    font-weight: 700;
}

.deal-thread-card__time {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    white-space: nowrap;
    flex-shrink: 0;
    padding-top: .15rem;
}

.deal-thread-card__footer-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
    margin-left: auto;
}

.deal-vote-box {
    display: inline-flex;
    align-items: center;
    height: 36px;
    padding: 0 3px;
    background: color-mix(in srgb, var(--bs-body-color) 8%, transparent);
    border-radius: 999px;
    flex-shrink: 0;
}

.deal-vote-box__btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid transparent;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-paper-bg);
    line-height: 1;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}

.deal-vote-box__btn svg {
    width: 14px;
    height: 14px;
    pointer-events: none;
}

.deal-vote-box__btn--up {
    color: #f84343;
}

.deal-vote-box__btn--up:hover:not(:disabled) {
    background: rgba(248, 67, 67, .08);
    border-color: rgba(248, 67, 67, .18);
}

.deal-vote-box__btn--up.is-active {
    background: #f84343;
    border-color: #f84343;
    color: #fff;
}

.deal-vote-box__btn--down {
    color: #3a8dde;
}

.deal-vote-box__btn--down:hover:not(:disabled) {
    background: rgba(58, 141, 222, .08);
    border-color: rgba(58, 141, 222, .18);
}

.deal-vote-box__btn--down.is-active {
    background: #3a8dde;
    border-color: #3a8dde;
    color: #fff;
}

.deal-vote-box__btn:disabled {
    opacity: .55;
    cursor: default;
}

.deal-vote-box__score {
    min-width: 2.75rem;
    padding: 0 .25rem;
    text-align: center;
    font-size: .875rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    line-height: 1;
}

.deal-vote-box__score.is-hot {
    color: #f84343;
}

.deal-vote-box__score.is-cold {
    color: #3a8dde;
}

@media (max-width: 767.98px) {
    .deal-thread-card__inner {
        grid-template-columns: 8.5rem minmax(0, 1fr);
        min-height: 0;
    }

    .deal-thread-card__inner::before {
        width: 8.5rem;
    }

    .deal-thread-card__media {
        min-height: 8.5rem;
        padding: .75rem;
    }

    .deal-thread-card__image {
        max-height: 7rem;
    }

    .deal-thread-card__header,
    .deal-thread-card__body,
    .deal-thread-card__footer {
        padding-left: .75rem;
        padding-right: .75rem;
    }
}

@media (max-width: 479.98px) {
    .deal-thread-card__inner {
        grid-template-columns: minmax(0, 1fr);
        grid-template-areas:
            "header"
            "media"
            "body"
            "footer";
    }

    .deal-thread-card__inner::before {
        display: none;
    }

    .deal-thread-card__media {
        min-height: 0;
        padding: 0 1rem .25rem;
    }

    .deal-thread-card__image {
        max-height: 8rem;
    }
}

.deal-show-page {
    max-width: 980px;
    margin-left: auto;
    margin-right: auto;
}

.deal-show-card {
    background: var(--bs-paper-bg);
    border: 1px solid var(--bs-border-color);
    border-radius: 0;
    box-shadow: var(--bs-box-shadow-sm);
    overflow: hidden;
    color: var(--bs-body-color);
}

@media (min-width: 992px) {
    .deal-show-card {
        border-radius: 12px;
    }
}

.deal-show-hero {
    display: flex;
    flex-direction: column;
}

@media (min-width: 768px) {
    .deal-show-hero {
        flex-direction: row;
        min-height: 18rem;
    }
}

.deal-show-hero__gallery {
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bs-gray-50);
    padding: 1.5rem;
    border-bottom: 1px solid var(--bs-border-color);
}

@media (min-width: 768px) {
    .deal-show-hero__gallery {
        flex: 0 0 25%;
        max-width: 25%;
        border-bottom: 0;
        border-right: 1px solid var(--bs-border-color);
        min-height: 18rem;
    }
}

.deal-show-hero__image {
    display: block;
    max-width: 100%;
    max-height: 14rem;
    width: auto;
    height: auto;
    object-fit: contain;
}

.deal-show-hero__image--placeholder {
    width: 6rem;
    height: 6rem;
    opacity: .45;
    filter: grayscale(1);
    object-fit: cover;
}

.deal-show-hero__about {
    flex: 1 1 auto;
    min-width: 0;
    padding: 1rem 1rem 1.25rem;
}

@media (min-width: 768px) {
    .deal-show-hero__about {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

.deal-show-hero__top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: .75rem;
    margin-bottom: .75rem;
}

.deal-show-hero__time {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    white-space: nowrap;
    padding-top: .35rem;
}

.deal-show-hero__meta {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
    margin-bottom: .35rem;
}

.deal-show-hero__meta a {
    color: inherit;
    text-decoration: none;
}

.deal-show-hero__meta a:hover {
    text-decoration: underline;
}

.deal-show-hero__title {
    font-size: clamp(1.125rem, 2vw, 1.375rem);
    line-height: 1.35;
    font-weight: 600;
    margin: 0 0 .75rem;
    color: var(--bs-heading-color);
}

.deal-show-hero__price {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: .5rem .75rem;
    margin-bottom: 1rem;
}

.deal-show-hero__price-old {
    color: var(--bs-secondary-color);
    text-decoration: line-through;
    font-size: .9375rem;
}

.deal-show-hero__price-new {
    color: #198754;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.1;
}

.deal-show-hero__discount {
    display: inline-flex;
    align-items: center;
    padding: .15rem .5rem;
    border-radius: 999px;
    background: rgba(25, 135, 84, .1);
    color: #198754;
    font-size: .8125rem;
    font-weight: 600;
}

.deal-show-hero__actions {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

@media (min-width: 576px) {
    .deal-show-hero__actions {
        flex-direction: row;
        flex-wrap: wrap;
        align-items: center;
    }
}

.deal-show-hero__cta {
    min-width: 12rem;
}

.deal-show-details {
    padding: 1rem 1rem 1.25rem;
}

@media (min-width: 768px) {
    .deal-show-details {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

.deal-show-author {
    display: flex;
    align-items: center;
    gap: .75rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--bs-border-color);
}

.deal-show-author__avatar {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    object-fit: cover;
    background: var(--bs-gray-50);
    flex-shrink: 0;
}

.deal-show-author__name {
    font-weight: 600;
    text-decoration: none;
    color: inherit;
}

.deal-show-author__name:hover {
    color: var(--bs-primary);
}

.deal-show-author__meta {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
}

.deal-show-description {
    font-size: .9375rem;
    line-height: 1.6;
}

.deal-show-description .ql-editor {
    padding: 0;
}

.deal-show-promo {
    margin-top: 1.25rem;
    padding: 1rem 1.125rem;
    border: 1px dashed rgba(255, 193, 7, .65);
    border-radius: 10px;
    background: rgba(255, 193, 7, .08);
}

.deal-show-sidebar-tools {
    display: flex;
    align-items: center;
    gap: .5rem;
    flex-shrink: 0;
}

.deal-show-comments {
    padding: 1rem 1rem 1.25rem;
}

@media (min-width: 768px) {
    .deal-show-comments {
        padding: 1.25rem 1.5rem 1.5rem;
    }
}

.deal-show-hot {
    color: var(--bs-secondary-color);
    font-size: .8125rem;
}

.deal-show-hot strong {
    color: #f84343;
}

.deal-show-expired-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
    padding: .875rem 1rem;
    margin-bottom: .75rem;
    border: 1px solid color-mix(in srgb, var(--bs-danger) 25%, transparent);
    border-radius: 10px;
    background: color-mix(in srgb, var(--bs-danger) 8%, transparent);
    color: var(--bs-danger-text-emphasis, #842029);
    font-size: .9375rem;
}

@media (min-width: 992px) {
    .deal-show-expired-banner {
        border-radius: 12px;
    }
}

.deal-show-expired-banner__text {
    flex: 1 1 auto;
    min-width: 0;
    margin: 0;
}

.deal-show-expired-banner__action {
    flex-shrink: 0;
}

.deal-show-hero--expired .deal-show-hero__gallery,
.deal-show-hero--expired .deal-show-hero__image {
    filter: grayscale(1);
}

.deal-show-hero--expired .deal-show-hero__cta {
    filter: grayscale(1);
    opacity: .85;
}

.deal-show-hero--expired .deal-show-hero__price-new,
.deal-show-hero--expired .deal-show-hero__discount {
    color: var(--bs-secondary-color);
}

.deal-show-hero--expired .deal-show-hero__discount {
    background: color-mix(in srgb, var(--bs-secondary-color) 12%, transparent);
}

[data-bs-theme="dark"] .ts-wrapper.form-select,
[data-bs-theme="dark"] .ts-wrapper.multi .ts-control,
[data-bs-theme="dark"] .ts-dropdown {
    background: var(--bs-paper-bg);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ts-dropdown .option,
[data-bs-theme="dark"] .ts-dropdown .optgroup-header,
[data-bs-theme="dark"] .ts-dropdown .no-results {
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ts-dropdown .option.active,
[data-bs-theme="dark"] .ts-dropdown .option:hover {
    background: var(--bs-primary-bg-subtle);
    color: var(--bs-body-color);
}

[data-bs-theme="dark"] .ts-wrapper.multi .ts-control > div {
    background: var(--bs-gray-100);
    color: var(--bs-body-color);
    border-color: var(--bs-border-color);
}

[data-bs-theme="dark"] .ts-wrapper .ts-control input {
    color: var(--bs-body-color);
}
