
:root{
    --pbf-gold-900:#7b5a00;
    --pbf-gold-700:#a77d14;
    --pbf-gold-600:#d4af37;
    --pbf-gold-300:#ead58f;
    --pbf-gold-150:#fbf3d8;
    --pbf-ink:#271f14;
    --pbf-line:#ead9aa;
    --pbf-shadow:0 24px 60px rgba(90,65,12,.14);
    --pbf-shadow-soft:0 10px 24px rgba(90,65,12,.10);
}

.pbf-book-btn{
    cursor:pointer;
    border:none;
    outline:none;
    border-radius:14px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    padding:14px 26px;
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 52%,#fff4cb 100%);
    color:#22180a;
    font-size:15px;
    font-weight:800;
    letter-spacing:.04em;
    text-decoration:none;
    border:1px solid rgba(212,175,55,.95);
    box-shadow:var(--pbf-shadow-soft);
    transition:transform .2s ease, box-shadow .2s ease, filter .2s ease;
    -webkit-tap-highlight-color: transparent;
}
.pbf-book-btn:hover,
.pbf-book-btn:focus,
.pbf-book-btn:active{
    transform:translateY(-2px);
    background:linear-gradient(135deg,#8b6500 0%,#d4af37 52%,#fff4cb 100%);
    color:#22180a;
    box-shadow:0 14px 30px rgba(90,65,12,.15);
    outline:none;
}

.pbf-overlay{
    position:fixed;
    inset:0;
    background:rgba(30,23,14,.48);
    backdrop-filter:blur(8px);
    z-index:99998;
    display:flex;
    align-items:center;
    justify-content:center;
    opacity:0;
    visibility:hidden;
    transition:opacity .25s ease, visibility .25s ease;
    padding:18px;
}
.pbf-overlay.is-open{
    opacity:1;
    visibility:visible;
}

.pbf-modal{
    width:100%;
    max-width:900px;
    max-height:92vh;
    overflow:hidden;
    background:linear-gradient(180deg,#fff 0%,#fffdf7 100%);
    border:1px solid var(--pbf-line);
    box-shadow:var(--pbf-shadow);
    border-radius:22px;
    display:flex;
    flex-direction:column;
}

.pbf-modal-head{
    display:flex;
    align-items:flex-start;
    justify-content:space-between;
    gap:12px;
    padding:22px 24px;
    background:linear-gradient(135deg,#14110a 0%,#3c2d15 40%,#7b5a00 100%);
    border-bottom:1px solid rgba(212,175,55,.9);
}
.pbf-eyebrow{
    display:inline-block;
    padding:5px 10px;
    font-size:12px;
    font-weight:800;
    letter-spacing:.06em;
    color:#fff1bf;
    border:1px solid rgba(255,241,191,.35);
    margin-bottom:10px;
}
.pbf-modal-head h2{
    margin:0;
    color:#fff1bf;
    font-size:24px;
    line-height:1.2;
    font-weight:900;
    letter-spacing:.03em;
}
.pbf-close{
    width:42px;
    height:42px;
    border-radius:999px;
    border:1px solid rgba(255,241,191,.45);
    background:rgba(255,255,255,.04);
    color:#fff1bf;
    font-size:24px;
    line-height:1;
    display:flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    flex:0 0 auto;
}
.pbf-close:hover{
    background:linear-gradient(135deg,#7b5a00 0%,#d4af37 52%,#fff4cb 100%);
    color:#22180a;
}

.pbf-steps{
    display:flex;
    align-items:center;
    gap:0;
    padding:18px 24px 0;
    background:linear-gradient(180deg,#fff 0%,#fffaf1 100%);
}
.pbf-step{
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:4px;
}
.pbf-step-num{
    width:34px;
    height:34px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#f4edd8;
    color:#8f6a07;
    border:1px solid var(--pbf-gold-600);
    font-weight:900;
    font-size:13px;
}
.pbf-step.active .pbf-step-num,
.pbf-step.done .pbf-step-num,
.pbf-line.done{
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 55%,#fff4cb 100%);
    color:#22180a;
}
.pbf-step-label{
    font-size:11px;
    font-weight:800;
    color:#7b6a49;
    white-space:nowrap;
}
.pbf-step.active .pbf-step-label,
.pbf-step.done .pbf-step-label{ color:#8f6a07; }
.pbf-line{
    flex:1;
    height:2px;
    margin:0 8px 18px;
    background:#ebdfc3;
}

.pbf-body{
    padding:24px;
    background:radial-gradient(circle at top, rgba(247,239,207,.35) 0%, #fff 44%, #fffdf7 100%);
    overflow:auto;
}

.pbf-welcome-card,
.pbf-chat-card{
    border:1px solid var(--pbf-line);
    background:linear-gradient(180deg,#fffef7 0%,#fff8ea 100%);
    box-shadow:var(--pbf-shadow-soft);
}
.pbf-welcome-card{
    padding:30px 26px;
    text-align:center;
    border-radius:22px;
}
.pbf-badge{
    display:inline-block;
    padding:6px 12px;
    border:1px solid rgba(212,175,55,.85);
    color:#8f6a07;
    background:#fff;
    font-size:12px;
    font-weight:800;
    letter-spacing:.06em;
    margin-bottom:14px;
}
.pbf-welcome-card h3{
    margin:0 0 8px;
    font-size:28px;
    font-weight:900;
    color:#2f2518;
}
.pbf-muted{
    color:#6a5b42;
    margin:0;
}
.pbf-selected-type{
    margin:18px 0 22px;
}
.pbf-selected-type span{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:8px 14px;
    border:1px solid var(--pbf-gold-600);
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 52%,#fff4cb 100%);
    color:#22180a;
    font-weight:900;
}
.pbf-continue-btn{
    cursor:pointer;
    border:1px solid rgba(180,138,31,.95);
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 52%,#fff4cb 100%);
    color:#22180a;
    font-weight:900;
    letter-spacing:.03em;
    padding:14px 24px;
    box-shadow:var(--pbf-shadow-soft);
    border-radius:14px;
}
.pbf-continue-btn:hover{
    background:linear-gradient(135deg,#8b6500 0%,#d4af37 52%,#fff4cb 100%);
}

.pbf-back-btn{
    border:1px solid var(--pbf-line);
    background:#fff;
    color:#7e6840;
    padding:10px 14px;
    margin-bottom:18px;
    font-weight:800;
    border-radius:12px;
    cursor:pointer;
}
.pbf-back-btn:hover{
    background:linear-gradient(135deg,#8b6500 0%,#d4af37 52%,#fff4cb 100%);
    color:#22180a;
}

.pbf-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
    margin-bottom:14px;
}
.pbf-field{
    display:flex;
    flex-direction:column;
    gap:8px;
}
.pbf-field label{
    color:#4d402b;
    font-weight:700;
    font-size:13px;
}
.pbf-field input,
.pbf-chat-form textarea{
    width:100%;
    border:1px solid var(--pbf-line);
    background:#fff;
    color:var(--pbf-ink);
    border-radius:14px;
    padding:12px 14px;
    font-size:14px;
    outline:none;
    transition:border-color .18s ease, box-shadow .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.pbf-field input:focus,
.pbf-chat-form textarea:focus{
    border-color:var(--pbf-gold-600);
    box-shadow:0 0 0 3px rgba(212,175,55,.14);
}

.pbf-submit-btn,
.pbf-send-btn{
    cursor:pointer;
    border:1px solid rgba(180,138,31,.95);
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 52%,#fff4cb 100%);
    color:#22180a;
    font-weight:900;
    letter-spacing:.03em;
    box-shadow:var(--pbf-shadow-soft);
    border-radius:999px;
    padding:12px 18px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:120px;
    transition:transform .2s ease, box-shadow .2s ease, background .2s ease;
}
.pbf-submit-btn:hover,
.pbf-send-btn:hover{
    transform:translateY(-2px);
    background:linear-gradient(135deg,#8b6500 0%,#d4af37 52%,#fff4cb 100%);
}
.pbf-submit-btn:disabled,
.pbf-send-btn:disabled{
    opacity:.75;
    cursor:not-allowed;
    transform:none;
}

.pbf-error{
    margin:10px 0 12px;
    color:#a23a21;
    font-weight:700;
}
.pbf-input-error{
    border-color:#c77d2a !important;
    box-shadow:0 0 0 3px rgba(199,125,42,.12) !important;
}

.pbf-chat-card{
    padding:18px;
    border-radius:22px;
}
.pbf-chat-top{
    display:flex;
    gap:14px;
    align-items:flex-start;
    margin-bottom:16px;
}
.pbf-chat-avatar{
    width:56px;
    height:56px;
    flex:0 0 auto;
    border-radius:18px;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(135deg,var(--pbf-gold-900) 0%,var(--pbf-gold-600) 52%,#fff4cb 100%);
    border:1px solid rgba(180,138,31,.9);
    font-size:28px;
    box-shadow:var(--pbf-shadow-soft);
}
.pbf-chat-title{
    margin:0 0 6px;
    color:#2f2518;
    font-size:22px;
    font-weight:900;
}
.pbf-status-row{
    margin-top:10px;
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    align-items:center;
}
.pbf-status-badge{
    display:inline-flex;
    align-items:center;
    padding:6px 12px;
    border:1px solid rgba(212,175,55,.85);
    background:#fff;
    color:#8f6a07;
    font-weight:800;
    border-radius:999px;
}
.pbf-live-note{
    color:#6a5b42;
    font-weight:700;
}

.pbf-chat-thread{
    min-height:220px;
    max-height:360px;
    overflow-y:auto;
    padding:14px;
    border:1px solid var(--pbf-line);
    background:#fff;
    border-radius:18px;
}
.pbf-empty{
    padding:14px;
    text-align:center;
    color:#6a5b42;
    font-weight:700;
}
.pbf-msg{
    margin-bottom:12px;
    display:flex;
}
.pbf-msg-customer{ justify-content:flex-end; }
.pbf-msg-admin,
.pbf-msg-system{ justify-content:flex-start; }
.pbf-bubble{
    max-width:min(80%, 560px);
    border:1px solid var(--pbf-line);
    background:#fff;
    box-shadow:0 8px 20px rgba(90,65,12,.05);
    border-radius:18px;
    padding:12px 14px;
}
.pbf-msg-customer .pbf-bubble{
    background:linear-gradient(180deg,#fffdf4 0%,#fff7e5 100%);
    border-color:rgba(212,175,55,.5);
}
.pbf-meta{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
    color:#857659;
    font-size:12px;
    margin-bottom:6px;
}
.pbf-text{
    color:#2f2518;
    line-height:1.6;
    white-space:normal;
    word-break:break-word;
}

.pbf-chat-form{
    margin-top:14px;
}
.pbf-composer{
    display:flex;
    gap:10px;
    align-items:flex-end;
}
.pbf-composer textarea{
    flex:1;
    min-height:64px;
    resize:vertical;
    border-radius:22px;
}
.pbf-send-btn{
    min-height:64px;
    min-width:104px;
}

@media (max-width: 768px){
    .pbf-grid{ grid-template-columns:1fr; }
    .pbf-composer{ flex-direction:column; align-items:stretch; }
    .pbf-send-btn{ width:100%; min-height:50px; }
    .pbf-modal-head{ padding:18px; }
    .pbf-body{ padding:18px; }
    .pbf-steps{ padding:14px 18px 0; }
    .pbf-welcome-card h3{ font-size:24px; }
}
