:root {
    --primary: #ff9715;
    --primary-hover: #e68610;
    --bg-color: #f5f5f7;
    --card-bg: #ffffff;
    --text-main: #1d1d1f;
    --text-muted: #86868b;
    --border: #d2d2d7;
    --success: #34c759;
    --danger: #ff3b30;
    --radius: 20px;
    
    /* Encar & Auction Color Variables */
    --encar-red: #ff3b30;
    --encar-bg: #fff5f5;
    --auction-blue: #007aff;
    --auction-bg: #f0f8ff;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* 상단 환율 바 & 로고 */
.top-bar {
    position: relative;
    background: #1d1d1f;
    color: white;
    padding: 1rem 2rem;
    font-size: 0.9rem;
    display: flex;
    justify-content: center;
    align-items: center;
}
.nav-logo {
    position: absolute;
    left: 1.5rem;
    top: 50%;
    transform: translateY(-50%);
    height: 36px;
}
.rate-container { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; }
.rate-card-badge {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.85rem;
}
.rate-badge-title {
    color: #a1a1a6;
    font-weight: 500;
}
.rate-badge-value {
    color: #ff9715;
    font-weight: 700;
    font-size: 0.95rem;
    letter-spacing: 0.5px;
}
.btn-rate-update {
    background: rgba(255, 151, 21, 0.15);
    border: 1px solid #ff9715;
    color: #ff9715;
    border-radius: 8px;
    padding: 0.35rem 0.8rem;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}
.btn-rate-update:hover {
    background: #ff9715;
    color: #1d1d1f;
}

.container { max-width: 900px; margin: 3rem auto; padding: 0 1.5rem; }

.main-header {
    position: relative;
    text-align: center;
    margin-bottom: 3.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
}

/* 앰비언트 글로우 백그라운드 */
.header-ambient-glow {
    position: absolute;
    top: -30px;
    left: 50%;
    transform: translateX(-50%);
    width: 380px;
    height: 140px;
    background: radial-gradient(circle, rgba(255, 151, 21, 0.18) 0%, rgba(255, 151, 21, 0) 70%);
    filter: blur(25px);
    pointer-events: none;
    z-index: 0;
}

/* 1. BE FORWARD KOREA 브랜드 칩 및 목적지 뱃지 그룹 */
.brand-pill-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.2rem;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 1;
}

.brand-pill {
    display: inline-flex;
    align-items: center;
    background: #ffffff;
    border: 1px solid rgba(255, 151, 21, 0.35);
    padding: 0.45rem 1.25rem;
    border-radius: 30px;
    box-shadow: 0 4px 20px rgba(255, 151, 21, 0.12);
}
.brand-pill-text {
    font-size: 0.88rem;
    font-weight: 800;
    letter-spacing: 1.8px;
    color: #ff9715;
    text-transform: uppercase;
}

.destination-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: #1d1d1f;
    border: 1px solid rgba(255, 151, 21, 0.4);
    padding: 0.45rem 1.1rem;
    border-radius: 30px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    color: #ffffff;
}
.dest-flag {
    font-size: 1.05rem;
}
.destination-pill-text {
    font-size: 0.85rem;
    font-weight: 800;
    letter-spacing: 1.2px;
    color: #ffffff;
}

/* 2. 대형 히어로 타이틀 & 앰버 그라데이션 */
.hero-title {
    position: relative;
    z-index: 1;
    font-size: 2.85rem;
    font-weight: 900;
    letter-spacing: -0.035em;
    color: #1d1d1f;
    margin-bottom: 0.8rem;
    line-height: 1.12;
}
.hero-title .gradient-text {
    background: linear-gradient(135deg, #ff9715 0%, #e66b00 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* 3. 서브 설명 */
.hero-subtitle {
    position: relative;
    z-index: 1;
    color: #6e6e73;
    font-size: 1.08rem;
    font-weight: 400;
    max-width: 620px;
    line-height: 1.55;
    margin-bottom: 1.3rem;
}
.hero-subtitle .hl-text {
    color: #1d1d1f;
    font-weight: 600;
}
.hero-subtitle .dest-hl {
    color: #ff9715;
    font-weight: 700;
}

/* 4. 신뢰 요소 뱃지 로우 */
.header-badges-row {
    position: relative;
    z-index: 1;
    display: flex;
    gap: 0.6rem;
    flex-wrap: wrap;
    justify-content: center;
}
.h-badge {
    background: rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.06);
    color: #424245;
    font-size: 0.82rem;
    font-weight: 600;
    padding: 0.35rem 0.85rem;
    border-radius: 20px;
    transition: all 0.2s ease;
}
.h-badge:hover {
    background: #ffffff;
    border-color: rgba(255, 151, 21, 0.3);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.main-input-section {
    background: var(--card-bg); padding: 2.5rem;
    border-radius: var(--radius); box-shadow: 0 10px 30px rgba(0,0,0,0.05); margin-bottom: 2rem;
}

.enka-input-group {
    background: #ffffff;
    border-radius: 20px;
    padding: 1.8rem;
    border: 2px solid #e8e8ed;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 2rem;
}
/* Data-source 속성에 따른 상위 셀(흰색 영역) 테두리(Stroke) 색상 변경 */
.enka-input-group[data-source="encar"] {
    border-color: rgba(255, 59, 48, 0.45);
    box-shadow: 0 6px 24px rgba(255, 59, 48, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #fffcfc 100%);
}
.enka-input-group[data-source="auction"] {
    border-color: rgba(0, 122, 255, 0.45);
    box-shadow: 0 6px 24px rgba(0, 122, 255, 0.08);
    background: linear-gradient(180deg, #ffffff 0%, #f7faff 100%);
}

.purchase-header { display: flex; justify-content: space-between; align-items: flex-end; margin-bottom: 1rem; }
.purchase-header label { font-size: 1.2rem; font-weight: 600; color: var(--primary); margin-bottom: 0; }

/* Encar/Auction Source Toggle (크게 변경) */
.source-toggle {
    display: flex;
    background: #e3e3e8;
    border-radius: 10px;
    padding: 4px;
    gap: 4px;
}
.source-toggle input { display: none; }
.source-toggle label {
    padding: 0.6rem 2rem;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 8px;
    margin: 0;
}
/* 토글 선택 시 색상 적용 */
input#src-encar:checked + label { background: var(--encar-red); color: white; box-shadow: 0 2px 8px rgba(255,59,48,0.3); }
input#src-auction:checked + label { background: var(--auction-blue); color: white; box-shadow: 0 2px 8px rgba(0,122,255,0.3); }

.mega-input-wrapper { position: relative; display: flex; align-items: center; }
.currency-symbol { position: absolute; left: 1.2rem; font-size: 2rem; font-weight: 600; color: var(--text-muted); }

/* 차량 가격 입력창 기본 스타일 (상위 셀 Stroke 강조를 위해 깔끔한 스타일 적용) */
.mega-input-wrapper input {
    width: 100%; font-size: 2.3rem; font-weight: 700; padding: 0.9rem 1rem 0.9rem 3.5rem;
    border-radius: 14px; color: var(--text-main); 
    border: 2px solid #e3e3e8;
    background-color: #ffffff;
    transition: all 0.3s ease;
}

.mega-input-wrapper input[data-source="encar"]:focus {
    border-color: var(--encar-red);
    box-shadow: 0 0 0 4px rgba(255, 59, 48, 0.15);
    outline: none;
}
.mega-input-wrapper input[data-source="auction"]:focus {
    border-color: var(--auction-blue);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
    outline: none;
}

.options-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; margin-bottom: 2rem; }

/* Encar URL Input Group */
.encar-url-group {
    margin-top: 1rem;
    display: none;
    animation: slideDown 0.25s ease;
}
.encar-url-group.visible { display: block; }
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.encar-url-group label {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}
.url-optional {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 0.85rem;
}
.encar-url-wrapper {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.encar-url-wrapper input[type="url"] {
    flex: 1;
    padding: 0.7rem 1rem;
    font-size: 0.9rem;
    border: 2px solid #e3e3e8;
    border-radius: 10px;
    background: #ffffff;
    color: var(--text-main);
    transition: all 0.2s ease;
    outline: none;
}
.encar-url-wrapper input[type="url"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(255, 151, 21, 0.15);
}
.url-clear-btn {
    background: #eee;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 0.7rem;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.2s;
}
.url-clear-btn:hover { background: #ff3b30; color: white; }


/* 커스텀 프리미엄 Vehicle Type Select 스타일링 */
.input-group label { display: block; font-size: 0.95rem; font-weight: 600; margin-bottom: 0.6rem; color: var(--text-main); }

.custom-select-wrapper {
    position: relative;
    width: 100%;
}
.custom-select-trigger {
    width: 100%;
    padding: 1.1rem 1.2rem;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-main);
    border: 2px solid #e3e3e8;
    border-radius: 14px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.02);
}
.custom-select-trigger:hover {
    border-color: var(--primary);
    background-color: #fffdfa;
}
.custom-select-trigger.active {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(255, 151, 21, 0.15);
    background-color: #ffffff;
}
.custom-select-arrow {
    transition: transform 0.3s ease;
    color: var(--text-main);
}
.custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
    color: var(--primary);
}

.custom-select-options {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid rgba(0,0,0,0.1);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(0,0,0,0.12);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 0.5rem;
}
.custom-select-options.open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
.custom-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.9rem 1.1rem;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s ease;
    margin-bottom: 2px;
}
.custom-option:hover {
    background: #fff5eb;
    color: var(--primary);
}
.custom-option.selected {
    background: rgba(255, 151, 21, 0.12);
    color: var(--primary);
    font-weight: 700;
}
.opt-badge {
    background: #1d1d1f;
    color: #ff9715;
    font-size: 0.85rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.checkbox-wrapper {
    display: flex; align-items: flex-start; gap: 1rem;
    background: #f9f9fb; padding: 1.2rem; border-radius: 12px; border: 1px solid var(--border);
    cursor: pointer; transition: 0.2s; height: 100%;
}
.checkbox-wrapper:hover { border-color: var(--primary); }
.checkbox-wrapper input[type="checkbox"] { width: 1.6rem; height: 1.6rem; accent-color: var(--primary); margin-top: 0.1rem; }
.checkbox-content { display: flex; flex-direction: column; }
.checkbox-content .title { font-weight: 600; font-size: 1rem; }
.checkbox-content .desc { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }

.btn-primary-mega {
    width: 100%; background: var(--primary); color: white; border: none;
    padding: 1.2rem; font-size: 1.3rem; font-weight: 700; border-radius: 16px;
    cursor: pointer; transition: 0.2s; box-shadow: 0 4px 15px rgba(255, 151, 21, 0.3);
}
.btn-primary-mega:hover { background: var(--primary-hover); transform: translateY(-2px); }

/* 환급 혜택 카드 & 토글 & 영수증 */
.tax-benefit-card { background: linear-gradient(135deg, #ffffff 0%, #fdf9f3 100%); border: 1px solid #f8e5c8; border-radius: var(--radius); padding: 2rem; margin-bottom: 2rem; }
.benefit-header h3 { color: var(--primary); font-size: 1.3rem; margin-bottom: 0.3rem; }
.benefit-header p { font-size: 1rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.benefit-math { display: flex; justify-content: space-between; align-items: center; background: white; padding: 1.5rem 2rem; border-radius: 12px; box-shadow: 0 2px 10px rgba(0,0,0,0.03); }
.math-item { display: flex; flex-direction: column; align-items: center; gap: 0.5rem; }
.math-item span { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.math-item strong { font-size: 1.5rem; }
.highlight-tax strong { color: var(--success); }
.math-item.result strong { color: var(--primary); font-size: 1.8rem; }
.math-op { font-size: 2rem; font-weight: 300; color: var(--border); }

.currency-toggle { display: flex; background: #e3e3e8; padding: 0.4rem; border-radius: 12px; margin-bottom: 1.5rem; width: 100%; }
.currency-toggle input { display: none; }
.currency-toggle label { flex: 1; text-align: center; padding: 1rem; font-weight: 600; font-size: 1.1rem; border-radius: 10px; cursor: pointer; color: var(--text-muted); transition: 0.3s; }
.currency-toggle input:checked + label { background: white; color: var(--text-main); box-shadow: 0 2px 8px rgba(0,0,0,0.1); }

.receipt-card { background: white; border-radius: var(--radius); padding: 2.5rem; box-shadow: 0 10px 30px rgba(0,0,0,0.08); margin-bottom: 3rem; }
.receipt-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px dashed var(--border); padding-bottom: 1.5rem; margin-bottom: 1.5rem; }
.receipt-header h3 { font-size: 1.4rem; }
.receipt-dest-subtitle { display: block; font-size: 0.88rem; color: #ff9715; font-weight: 700; margin-top: 0.25rem; }
.badge { background: #1d1d1f; color: white; padding: 0.4rem 1rem; border-radius: 20px; font-size: 1rem; font-weight: 600; }
.receipt-row { display: flex; justify-content: space-between; margin-bottom: 1.2rem; align-items: center; }
.receipt-row .item-name { font-size: 1.1rem; font-weight: 500; }
.receipt-row .item-name small { display: block; font-size: 0.85rem; color: var(--text-muted); margin-top: 0.3rem; }
.receipt-row .item-value { font-size: 1.3rem; font-weight: 600; font-family: monospace; }
.text-muted { color: var(--text-muted); }
.text-primary { color: var(--primary); }
.text-danger { color: var(--danger); }
.receipt-divider { height: 1px; background: var(--border); margin: 1.5rem 0; opacity: 0.5; }
.receipt-divider.thick { height: 2px; opacity: 1; margin: 2rem 0; }
.subtotal .item-name { font-weight: 700; font-size: 1.2rem;}
.subtotal .item-value { font-size: 1.5rem; font-weight: 700; }
.receipt-footer { background: #1d1d1f; color: white; padding: 2rem; border-radius: 12px; margin-top: 2rem; }
.total-row { display: flex; justify-content: space-between; align-items: center; }
.total-row span { font-size: 1.3rem; font-weight: 600; opacity: 0.9; }
.total-row strong { font-size: 2.5rem; font-weight: 700; color: var(--primary); }

/* 하단 참조표 섹션 */
.reference-section { margin-top: 4rem; padding-top: 3rem; border-top: 1px solid var(--border); }
.section-title-wrapper { text-align: center; margin-bottom: 2.5rem; }
.section-title-wrapper h2 { font-size: 1.8rem; font-weight: 700; margin-bottom: 0.5rem; }
.section-title-wrapper p { font-size: 1rem; color: var(--text-muted); }

.ref-card { background: white; border-radius: 16px; border: 1px solid var(--border); overflow: hidden; margin-bottom: 2rem; box-shadow: 0 4px 15px rgba(0,0,0,0.03); }
.ref-card-header { padding: 1.5rem; border-bottom: 1px solid #eee; background: #f9f9fb; }
.ref-card-header h4 { font-size: 1.2rem; font-weight: 700; color: var(--text-main); }
.ref-note { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.5rem; line-height: 1.4; }
.mt-2 { margin-top: 2rem; }
.table-responsive { width: 100%; overflow-x: auto; }
.scroll-table { max-height: 600px; overflow-y: auto; }
.ref-table { width: 100%; border-collapse: collapse; font-size: 0.95rem; white-space: nowrap; }
.ref-table th, .ref-table td { padding: 1rem; text-align: right; border-bottom: 1px solid #eee; }
.ref-table th { background-color: #f0f0f5; color: var(--text-muted); font-weight: 600; text-align: center; position: sticky; top: 0; z-index: 1; }
.ref-table td:nth-child(1), .ref-table td:nth-child(2) { text-align: center; }
.highlight-th { background-color: #ffe8cc !important; color: var(--primary) !important; }
.highlight-primary { background-color: var(--primary) !important; color: white !important; }
.ref-table tbody tr:hover { background-color: #fafafc; }

/* 푸터 (Footer) 영역 */
.site-footer {
    margin-top: 4rem; padding: 2.5rem 0 1rem; text-align: center; border-top: 1px solid var(--border);
}
.site-footer p { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 0.8rem; font-weight: 500; }
.footer-links { display: flex; justify-content: center; align-items: center; gap: 1rem; font-size: 0.85rem; }
.footer-links a { color: var(--text-muted); text-decoration: none; transition: color 0.2s; cursor: pointer; }
.footer-links a:hover { color: var(--primary); }
.footer-links .divider { color: #d2d2d7; }

/* Modal (팝업창) 디자인 */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); backdrop-filter: blur(4px);
    display: none; align-items: center; justify-content: center; z-index: 9999;
}
.modal-overlay.active { display: flex; }
.modal-content {
    background: white; width: 90%; max-width: 600px;
    border-radius: 20px; padding: 2.5rem; position: relative;
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-height: 85vh; overflow-y: auto;
}
.modal-close {
    position: absolute; top: 1.5rem; right: 1.5rem;
    background: none; border: none; font-size: 2rem; color: var(--text-muted);
    cursor: pointer; line-height: 1; transition: color 0.2s;
}
.modal-close:hover { color: var(--text-main); }
.modal-content h2 { margin-bottom: 1.5rem; font-size: 1.5rem; color: var(--primary); border-bottom: 1px solid var(--border); padding-bottom: 0.8rem;}
.modal-body p { font-size: 0.95rem; color: var(--text-main); margin-bottom: 1rem; line-height: 1.6; }

/* 모바일 대응 */
@media (max-width: 768px) {
    .nav-logo { position: static; transform: none; margin-bottom: 0.5rem; display: block; margin: 0 auto 0.5rem; }
    .top-bar { flex-direction: column; padding: 1rem; }
    .purchase-header { flex-direction: column; align-items: flex-start; gap: 1rem; }
    .source-toggle { width: 100%; }
    .source-toggle label { flex: 1; text-align: center; }
    .options-grid { grid-template-columns: 1fr; }
    .benefit-math { flex-direction: column; gap: 0.8rem; }
    .math-op { transform: rotate(90deg); margin: 0.5rem 0;}
    .ref-table { font-size: 0.85rem; }
}

/* --- Locked Exchange Rate Styles --- */
input[readonly] {
    background-color: #f5f5f7 !important;
    color: #555 !important;
    cursor: not-allowed;
    border: 1px solid #d2d2d7 !important;
    opacity: 0.9;
}

/* --- Verification Code Badge --- */
.verification-badge-container {
    margin-top: 1rem;
    padding-top: 0.8rem;
    border-top: 1px dashed rgba(0,0,0,0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}
.v-badge-code {
    background: #1d1d1f;
    color: #00e676;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-family: monospace;
    font-size: 0.9rem;
    letter-spacing: 1px;
}

/* --- Action Buttons Container --- */
.action-buttons-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin-top: 1.5rem;
}
.btn-action {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.15);
}
.btn-action:active {
    transform: translateY(0);
}
.btn-whatsapp {
    background-color: #25D366;
    color: white;
}
.btn-whatsapp:hover {
    background-color: #20ba5a;
}
.btn-pdf {
    background-color: #1d1d1f;
    color: white;
}
.btn-pdf:hover {
    background-color: #333336;
}
.btn-copy {
    background-color: #ffffff;
    color: #1d1d1f;
    border: 1px solid #d2d2d7;
}
.btn-copy:hover {
    background-color: #f5f5f7;
}

/* --- PDF Invoice Template Styling (Optimized for 1-Page A4) --- */
.pdf-invoice-card {
    width: 750px;
    background: #ffffff;
    padding: 1.5rem 1.8rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #1d1d1f;
    box-sizing: border-box;
}
.pdf-header-bar {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 2px solid #ff9715;
    padding-bottom: 0.6rem;
    margin-bottom: 0.8rem;
}
.pdf-brand-col {
    display: flex;
    align-items: center;
    gap: 1rem;
}
.pdf-logo-img {
    height: 40px;
}
.pdf-brand-title h2 {
    margin: 0;
    font-size: 1.3rem;
    color: #1d1d1f;
    letter-spacing: -0.5px;
}
.pdf-brand-title p {
    margin: 0.1rem 0 0 0;
    font-size: 0.8rem;
    color: #ff9715;
    font-weight: 600;
}
.pdf-meta-col {
    text-align: right;
    font-size: 0.8rem;
}
.pdf-meta-row {
    margin-bottom: 0.2rem;
}
.pdf-vcode-box code {
    background: #f0f0f5;
    padding: 0.15rem 0.4rem;
    border-radius: 4px;
    color: #d32f2f;
    font-weight: 700;
}
.pdf-section-header {
    background: #f5f5f7;
    padding: 0.35rem 0.6rem;
    font-size: 0.8rem;
    font-weight: 700;
    color: #1d1d1f;
    border-left: 4px solid #ff9715;
    margin: 0.8rem 0 0.4rem 0;
}
.pdf-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.8rem;
    margin-bottom: 0.6rem;
}
.pdf-table th, .pdf-table td {
    padding: 0.4rem 0.6rem;
    border: 1px solid #e5e5ea;
    text-align: left;
}
.pdf-table th {
    background: #fafafc;
    font-weight: 600;
    color: #6e6e73;
}
.mini-table td, .mini-table th {
    padding: 0.3rem 0.5rem;
}
.pdf-row-highlight {
    background: #f4fbf7;
}
.pdf-row-subtotal {
    background: #f5f5f7;
    font-weight: 700;
}
.pdf-row-total {
    background: #fff8f0;
    font-size: 0.95rem;
    color: #ff9715;
}
.pdf-terms-card {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px solid #e5e5ea;
    font-size: 0.72rem;
    color: #86868b;
}
.pdf-terms-card ul {
    padding-left: 1.1rem;
    margin: 0.2rem 0 0.6rem 0;
}
.pdf-stamp-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.6rem;
    font-weight: 700;
    color: #1d1d1f;
}
.stamp-badge {
    border: 2px dashed #ff9715;
    color: #ff9715;
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    letter-spacing: 1px;
}

/* --- PRINT STYLES (Enforces EXACT 1-Page PDF / Print Output) --- */
@media print {
    @page {
        size: A4 portrait;
        margin: 10mm;
    }
    html, body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
        width: 100% !important;
        height: auto !important;
        overflow: visible !important;
    }
    .top-bar, .container, .modal-overlay, footer, .reference-section, .main-input-section, .result-section {
        display: none !important;
    }
    #pdf-template-wrapper {
        position: static !important;
        left: 0 !important;
        top: 0 !important;
        display: block !important;
        width: 100% !important;
        height: auto !important;
        margin: 0 !important;
        padding: 0 !important;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .pdf-invoice-card {
        width: 100% !important;
        max-width: 100% !important;
        padding: 0 !important;
        box-shadow: none !important;
        border: none !important;
    }
}