/* mansys/static/css/estimate_new.css */

/* 1. Root Variables */

:root {
    --brand-color: #166166;
}

/*-------------------------------*/
/* 2. Layout */
/* #region */
.estimate-container {
    max-width: 1000px;
    margin: auto;
    padding-bottom: 120px;
}

.theme-toggle-wrap {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 10px;
}

.theme-toggle-btn {
    padding: 8px 14px;
    border-radius: 20px;
    border: 1px solid var(--brand-color);
    background: #fff;
    color: var(--brand-color);
    cursor: pointer;
    font-weight: 600;
}

.theme-toggle-btn:hover {
    background: var(--brand-color);
    color: #fff;
}

.box {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 18px;
    box-shadow: 0 1px 5px rgba(0,0,0,0.08);
}

h3 { margin-bottom: 15px; }

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
/* #endregion */

/* 3. Common Inputs / Buttons / Labels */
/* #region */
input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
}

select {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    margin-bottom: 10px;
}

label {
    font-weight: bold;
    margin-top: 8px;
    display: block;
}

.service-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.service-btn {
    flex: 1 1 calc(33% - 10px);
    padding: 12px 8px;
    text-align: center;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #f8f8f8;
    cursor: pointer;
    font-size: 15px;
}

.service-btn.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
    font-weight: bold;
}

/* 1) 전역 label은 box 안에서만 block 처리 */
.box label {
    font-weight: bold;
    margin-top: 8px;
    display: block;
}

.box label.check-wrap {
    display: inline-flex;
}
/* #endregion */

/* 4. Service Card */
/* #region */
.service-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    background: #fff;
}

.unit-price-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

.unit-price-btn {
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--brand-color);
    background: #fff;
    color: var(--brand-color);
    cursor: pointer;
    font-size: 14px;
}

.unit-price-btn.refresh {
    border-color: #999;
    color: #555;
}

.unit-price-btn:hover {
    background: var(--brand-color);
    color: #fff;
}

.unit-price-btn.refresh:hover {
    background: #ddd;
    color: #222;
}

/* 카드 헤더 */
.service-header {
    background: #f0f4f4;
    padding: 12px;
    font-weight: bold;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 카드 헤더 오른쪽 금액 */
.service-price-summary {
    color: var(--brand-color);
}

/* 카드 내용 */
.service-body {
    padding: 12px;
    display: none; /* 기본 닫힘 */
}

/* 펼쳐진 상태 */
.service-card.open .service-body {
    display: block;
}

.extra-row {
    display: flex;
    gap: 10px;
    margin-top: 8px;
}

.extra-row input {
    flex: 1;
}

.remove-extra-btn {
    background: #ff5d5d;
    border: none;
    padding: 0 10px;
    color: white;
    border-radius: 4px;
    cursor: pointer;
}

.hidden {
    display: none;
}
/* #endregion */

/* Dark Mode */
body.dark-mode {
    background: #0f1115;
    color: #f1f5f9;
}

body.dark-mode .estimate-container {
    color: #f1f5f9;
}

body.dark-mode .box {
    background: #1b1f24;
    border-color: #2c333b;
    box-shadow: 0 1px 6px rgba(0,0,0,0.6);
}

body.dark-mode input,
body.dark-mode select {
    background: #11161d;
    border-color: #2c333b;
    color: #f1f5f9;
}

body.dark-mode .service-card {
    background: #1b1f24;
    border-color: #2c333b;
}

body.dark-mode .service-header {
    background: #252d36;
    color: #f1f5f9;
}

body.dark-mode .service-body {
    background: #1b1f24;
}

body.dark-mode .service-btn {
    background: #1b1f24;
    border-color: #2c333b;
    color: #f1f5f9;
}

body.dark-mode .service-btn.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}

body.dark-mode #summary-footer {
    background: #0f1115;
    color: #f1f5f9;
}

body.dark-mode .summary-line span,
body.dark-mode .summary-unit {
    color: #d6dde7;
}

body.dark-mode .summary-promotions {
    border-color: #2c333b;
}

body.dark-mode .promotion-row {
    color: #d6dde7;
}

body.dark-mode #preview-btn {
    border-color: #4cd3df;
    color: #4cd3df;
}

body.dark-mode #preview-btn:hover {
    background: rgba(76, 211, 223, 0.12);
}

body.dark-mode .theme-toggle-btn {
    background: var(--brand-color);
    color: #fff;
}

body.dark-mode .service-body p {
    color: #f1f5f9;
}

body.dark-mode .grout-range-btn,
body.dark-mode .life-range-btn,
body.dark-mode .appliance-btn,
body.dark-mode .package-btn {
    background: #222832;
    border-color: #3a434f;
    color: #f1f5f9;
}

body.dark-mode .grout-range-btn.active,
body.dark-mode .life-range-btn.active,
body.dark-mode .package-btn.active {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}

body.dark-mode .grout-range-btn:hover,
body.dark-mode .life-range-btn:hover,
body.dark-mode .appliance-btn:hover,
body.dark-mode .package-btn:hover {
    background: #2d3541;
}

body.dark-mode .grout-range-box,
body.dark-mode .life-range-box,
body.dark-mode .floorcoating-box,
body.dark-mode .appliance-row,
body.dark-mode .balcony-list .grout-item-row {
    background: #121821;
    border-color: #2c333b;
    color: #f1f5f9;
}

body.dark-mode .wall-sub,
body.dark-mode .life-sub-wrapper {
    border-left-color: #3a434f;
}

body.dark-mode .grout-range-box button {
    background: #222832;
    border-color: #3a434f;
    color: #f1f5f9;
}

body.dark-mode .grout-select,
body.dark-mode .life-select,
body.dark-mode .appliance-price-input,
body.dark-mode .extra-row input {
    background: #0f131a;
    border-color: #3a434f;
    color: #f1f5f9;
}

body.dark-mode .elastic-option {
    background: #121821;
    border-color: #2c333b;
    color: #f1f5f9;
}

body.dark-mode .elastic-option:has(input[type=\"radio\"]:checked) {
    background: rgba(22, 98, 102, 0.2);
    box-shadow: 0 0 0 2px rgba(22, 98, 102, 0.25);
}

body.dark-mode .extra-row .extra-sign {
    color: #f1f5f9;
}

body.dark-mode .extra-add-btn {
    background: #222832;
    color: #f1f5f9;
    border: 1px solid #3a434f;
}

body.dark-mode .service-body {
    border-top: 1px solid #2c333b;
}

body.dark-mode .unit-price-btn {
    background: transparent;
}

body.dark-mode .unit-price-btn.refresh {
    border-color: #3a434f;
    color: #cdd4df;
}

body.dark-mode .unit-price-btn.refresh:hover {
    background: #2d3541;
    color: #fff;
}

/*-------------------------------*/
/* 5. Service Modules */
/* ================================
      줄눈 UI 스타일
================================ */
/* #region */
/* 줄눈 범위 버튼 */
.grout-range-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.grout-silicone-all {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px dashed #cdd9d9;
    border-radius: 8px;
    background: #f5fbfb;
}

.grout-silicone-all .check-wrap {
    margin: 0;
    font-weight: 600;
    color: var(--brand-color);
}

.grout-silicone-all input[type="checkbox"] {
    accent-color: var(--brand-color);
}

.grout-silicone-all .check-wrap span {
    min-width: 300px;
}

.grout-range-btn {
    padding: 10px 16px;
    border-radius: 6px;
    background: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.grout-range-btn.active {
    background: #166166;      /* 에브리홈 대표색 */
    color: white;
    border-color: #166166;
    font-weight: 600;
}

/* 줄눈 범위 전체 박스 */
.grout-range-box {
    border: 1px solid #ddd;
    padding: 14px;
    margin-top: 14px;
    border-radius: 10px;
    background: #fafafa;
}

/* 범위 제목 (펼침/접힘) */
.grout-range-box h4 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.grout-range-box .grout-item-row span {
    min-width: 150px;
}

/* 접힘 상태 */
.grout-range-box.closed .content {
    display: none;
}

.grout-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.grout-item-row label {
    margin-left: 4px;
}

.wall-sub {
    margin-left: 6px;
    padding-left: 12px;
    border-left: 3px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.wall-sub.hidden {
    display: none;
}

.grout-select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    min-width: 120px;
}

.balcony-list {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.balcony-list .grout-item-row {
    background: white;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: 8px;
}

.grout-range-box button {
    padding: 6px 10px;
    border-radius: 6px;
    border: 1px solid #bbb;
    background: #eee;
    cursor: pointer;
}

.grout-range-box button:hover {
    background: #ddd;
}



/* 2) 줄눈 item 전용 체크박스 */
.grout-item-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-color);
    transform: translateY(2px);
}

/* 3) 줄눈 item label 스타일 */
.grout-item-row label {
    display: inline-block;
    font-weight: normal;
    margin: 0;
}

.check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}

.check-wrap input {
    cursor: pointer;
}

/* 줄눈 패키지 버튼 */
.grout-package-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
/* #endregion */

/* ================================
   생활코팅 UI 스타일
================================ */
/* #region */
/* 범위 버튼 영역 */
.life-range-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0;
}

.life-range-btn {
    padding: 10px 16px;
    border-radius: 6px;
    background: #eee;
    border: 1px solid #ccc;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.life-range-btn.active {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
    font-weight: 600;
}

/* 범위 박스 */
.life-range-box {
    border: 1px solid #ddd;
    background: #fafafa;
    padding: 14px;
    margin-top: 14px;
    border-radius: 10px;
}

.life-range-box h4 {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 600;
}

/* 옵션 row */
.life-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

/* 체크박스 스타일 */
.life-item-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: var(--brand-color);
    transform: translateY(2px);
}

/* 선택 박스 */
.life-select {
    padding: 6px 8px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #fff;
    min-width: 140px;
}

/* 서브 옵션 박스 (벽 타일 코팅) */
.life-sub-wrapper {
    margin-left: 24px;
    padding-left: 12px;
    border-left: 3px solid #ddd;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* 체크랩 공통 스타일 */
.life-item-row .check-wrap {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    user-select: none;
}
/* #endregion */

/* ================================
      탄성코트 UI 스타일
================================ */
/* #region */
/* 🔵 탄성코트 전체 그룹 */
.elastic-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 10px;
}

/* 🟢 각 옵션(카드 스타일) */
.elastic-option {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 12px 18px;
    border: 2px solid #ddd;
    border-radius: 10px;
    background: #fafafa;

    cursor: pointer;
    transition: all 0.25s;

    position: relative;
}

/* input은 숨김 */
.elastic-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

/* 텍스트 */
.elastic-text {
    font-size: 16px;
    font-weight: 600;
}

/* 가격 */
.elastic-price {
    font-size: 15px;
    font-weight: 500;
    color: #333;
}

/* 🟦 hover 효과 */
.elastic-option:hover {
    border-color: #3a82f7;
    background: #f3f9ff;
}

/* 🟧 선택된 상태 */
.elastic-option input[type="radio"]:checked + .elastic-text + .elastic-price,
.elastic-option input[type="radio"]:checked ~ .elastic-price {
    color: #166166 !important; /* 에브리홈 대표 색상 */
}

/* 선택된 카드 스타일 */
.elastic-option input[type="radio"]:checked ~ .elastic-text,
.elastic-option input[type="radio"]:checked ~ .elastic-price,
.elastic-option input[type="radio"]:checked {
    font-weight: 700;
}

.elastic-option input[type="radio"]:checked ~ .elastic-text {
    color: #166166;
}

.elastic-option input[type="radio"]:checked ~ .elastic-price {
    color: #166166;
}

/* 선택된 카드 border 강조 */
.elastic-option input[type="radio"]:checked ~ .elastic-text::before,
.elastic-option input[type="radio"]:checked ~ .elastic-price::before {
    border-color: #166166;
}

.elastic-option:has(input[type="radio"]:checked) {
    border-color: #166166;
    background: #e9f5f5;
    box-shadow: 0 0 0 3px rgba(22, 98, 102, 0.1);
}

/* Smooth transition */
.elastic-option,
.elastic-option span {
    transition: all 0.25s;
}
/* #endregion */

/* ================================
      마루코팅 UI 스타일
================================ */
/* #region */
.floorcoating-box {
    border: 1px solid #ddd;
    background: #fafafa;
    padding: 14px;
    margin-top: 14px;
    border-radius: 10px;
}

.floor-item-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 8px 0;
}

.floor-item-row .check-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}

.floor-item-row input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--brand-color);
    cursor: pointer;
}
/* #endregion */

/* ==========================
   가전 분해청소 UI
============================*/
/* #region */
.appliance-btn-wrap {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.appliance-btn {
    padding: 8px 12px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    transition: 0.2s;
}

.appliance-btn:hover {
    background: #ddd;
}

.appliance-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.appliance-row {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fafafa;
    padding: 10px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.appliance-label {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
}

.appliance-price-input {
    flex: 1;
    padding: 8px;
    border: 1px solid #bbb;
    border-radius: 6px;
}

.appliance-remove {
    background: #ff5d5d;
    border: none;
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.appliance-remove:hover {
    background: #e64444;
}

/* 슬라이드 인/아웃 애니메이션 */
.appliance-row {
    opacity: 0;
    transform: translateY(-6px);
    transition: all 0.25s ease;
}

.appliance-row.show {
    opacity: 1;
    transform: translateY(0);
}

.appliance-row.hide {
    opacity: 0;
    transform: translateY(-10px);
}
/* #endregion */

/* ===========================
   ★ 패키지 버튼 공통 스타일
=========================== */
/* #region */
.package-btn {
    flex: 1 1 calc(33% - 10px);
    padding: 10px 12px;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    transition: 0.2s;
    font-size: 14px;
}

.package-btn.active {
    background: var(--brand-color);
    color: #fff;
    border-color: var(--brand-color);
    font-weight: 600;
}

/* 컨테이너 */
.package-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}
/* #endregion */

/*-------------------------------*/
/* 6. Summary Footer */
/* #region */
#summary-footer {
    position: fixed;
    bottom: 0;
    left: 0; right: 0;
    background: #fff;
    border-top: 2px solid #eee;
    padding: 15px 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    z-index: 999;
}

.summary-footer__prices {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.summary-line {
    display: flex;
    align-items: baseline;
    gap: 6px;
    font-weight: 600;
}

.summary-line span {
    font-size: 16px;
    color: #333;
}

.summary-line strong {
    font-size: 20px;
    color: var(--brand-color);
}

.summary-final strong {
    font-size: 22px;
}

.summary-unit {
    font-size: 14px;
    color: #444;
}

.summary-promotions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 0;
    border-top: 1px dashed #ddd;
    border-bottom: 1px dashed #ddd;
}

.promotion-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    color: #444;
}

.promotion-row strong {
    font-size: 15px;
    color: #c53030;
}

.summary-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

#preview-btn,
#save-btn {
    padding: 10px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    border: 1px solid transparent;
}

#preview-btn {
    border-color: var(--brand-color);
    background: transparent;
    color: var(--brand-color);
}

#preview-btn:hover {
    background: rgba(22, 97, 102, 0.08);
}

#save-btn {
    background: var(--brand-color);
    border: none;
    color: #fff;
}

#save-btn:hover {
    opacity: 0.9;
}
/* #endregion */

/*-------------------------------*/
/* 7. Animation Module */
/* #region */
.service-card.open {
    animation: fadeSlideIn 0.3s ease forwards;
}

@keyframes fadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}


/* #endregion */

/*-------------------------------*/
/* 8. Media Queries */
/* #region */
@media(max-width: 768px) {
    .service-btn {
        flex: 1 1 calc(50% - 10px);
    }
    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* 박스 전체 여백 축소 (모바일 기준) */
@media(max-width: 768px) {
    .box {
        padding: 14px 16px !important;  /* 기존 20px → 더 가볍게 */
        margin-bottom: 14px !important; /* 박스 간의 공백 늘림 */
        margin-top: 14px !important; /* 박스 간의 공백 늘림 */
        background-color: #f2f2f2;
    }

    h3 {
        margin-bottom: 12px !important;
        font-size: 17px !important;
    }

    .estimate-container {
        padding: 0 8px 140px !important; /* 좌우 공백 확보 */
    }
}

/* 서비스 버튼 공간 개선 */
@media(max-width: 768px) {
    .service-btn {
        padding: 10px 6px !important;
        border-radius: 12px !important;
        font-size: 14px !important;
    }
}

/* 서비스 상세카드 여백 다이어트 */
@media(max-width: 768px) {
    .service-card {
        margin-bottom: 10px !important;
        border-radius: 12px !important;
    }

    .service-header {
        padding: 10px 12px !important;
    }

    .service-body {
        padding: 10px 12px !important;
    }
}

/* 줄눈, 코팅 등 내부 row 간격 줄이기 */
@media(max-width: 768px) {
    .grout-item-row,
    .life-item-row {
        margin: 6px 0 !important;
        gap: 8px !important;
    }
}

/* 버튼류 라인 높이 개선 */
@media(max-width: 768px) {
    .grout-range-btn,
    .life-range-btn {
        padding: 8px 12px !important;
        font-size: 13px !important;
        border-radius: 8px !important;
    }

    .grout-range-box,
    .life-range-box {
        padding: 12px !important;
        margin-top: 12px !important;
    }
}

/* 하단 총합 박스 여백 */
@media(max-width: 768px) {
#summary-footer {
    padding: 12px 16px !important;
    font-size: 16px !important;
    }

    #save-btn {
        padding: 8px 12px !important;
        border-radius: 8px !important;
        font-size: 14px !important;
    }
}
/* #endregion */

/* Unit price modal */
.unit-price-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.unit-price-modal.hidden {
    display: none;
}

.unit-price-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.5);
}

.unit-price-modal__dialog {
    position: relative;
    background: #fff;
    padding: 24px;
    border-radius: 10px;
    width: min(360px, calc(100% - 40px));
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    z-index: 1;
}

.unit-price-modal__dialog h4 {
    margin-top: 0;
}

.unit-price-modal__dialog input {
    width: 100%;
    margin-top: 10px;
}

.unit-price-modal__actions {
    margin-top: 16px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.unit-price-modal__actions button {
    padding: 8px 14px;
    border-radius: 6px;
    border: 1px solid #ccc;
    background: #f8f8f8;
    cursor: pointer;
}

.unit-price-modal__actions button.primary {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}

body.dark-mode .unit-price-modal__dialog {
    background: #1b1f24;
    color: #f1f5f9;
}

body.dark-mode .unit-price-modal__actions button {
    background: #222832;
    border-color: #3a434f;
    color: #f1f5f9;
}

body.dark-mode .unit-price-modal__actions button.primary {
    background: var(--brand-color);
    border-color: var(--brand-color);
    color: #fff;
}

/* JSON preview modal */
.preview-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.preview-modal.hidden {
    display: none;
}

.preview-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.preview-modal__dialog {
    position: relative;
    width: min(720px, calc(100% - 40px));
    max-height: calc(100% - 80px);
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    z-index: 1;
}

.preview-modal__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.preview-modal__close {
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #555;
}

.preview-modal__content {
    flex: 1;
    padding: 12px;
    background: #0f1115;
    color: #d4f1f5;
    overflow: auto;
    border-radius: 8px;
    font-size: 14px;
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
}

.preview-modal__actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.preview-modal__actions .primary {
    padding: 8px 16px;
    border-radius: 6px;
    background: var(--brand-color);
    border: none;
    color: #fff;
    cursor: pointer;
}

body.dark-mode .preview-modal__dialog {
    background: #181c24;
    color: #f1f5f9;
}

body.dark-mode .preview-modal__content {
    background: #0b0d13;
}

body.dark-mode .preview-modal__close {
    color: #f1f5f9;
}
