/* リフォーム見積もりチャットボット スタイル */
:root{
    --rfc-primary:#1565c0;
    --rfc-primary-dark:#0d47a1;
    --rfc-accent:#ffd600;
    --rfc-bg:#ffffff;
    --rfc-bot-bg:#ffffff;
    --rfc-text:#1a2640;
    --rfc-muted:#6b7a8d;
    --rfc-border:#d6e4f7;
  }
*{box-sizing:border-box;}
/* ===== Chatbot ===== */
  #rfc-root{position:fixed;left:24px;bottom:40px;z-index:99999;
    font-family:"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;}
  .rfc-launcher{
    display:inline-flex;align-items:center;gap:10px;padding:14px 22px;border:none;
    border-radius:999px;background:linear-gradient(135deg,var(--rfc-primary),var(--rfc-primary-dark));
    color:#fff;font-size:15px;font-weight:700;cursor:pointer;
    box-shadow:0 8px 24px rgba(21,101,192,.38);transition:transform .18s,box-shadow .18s;
  }
  .rfc-launcher:hover{transform:translateY(-3px);box-shadow:0 14px 32px rgba(21,101,192,.5);}
  .rfc-launcher .dot{width:9px;height:9px;border-radius:50%;background:#ffe08a;
    box-shadow:0 0 0 0 rgba(255,224,138,.8);animation:rfc-pulse 2s infinite;}

  /* アイコンボタンモード */
  .rfc-launcher.rfc-icon-mode{
    width:64px;height:64px;border-radius:50%;padding:0;
    background:transparent;box-shadow:0 4px 20px rgba(0,0,0,.28);
    position:relative;
  }
  .rfc-launcher.rfc-icon-mode:hover{transform:translateY(-3px) scale(1.06);box-shadow:0 10px 28px rgba(0,0,0,.38);}
  .rfc-launcher.rfc-icon-mode img{width:100%;height:100%;object-fit:cover;display:block;border-radius:50%;border:solid #fff 4px;animation:rfc-pulse 2s infinite;}
  @keyframes rfc-pulse{0%{box-shadow:0 0 0 0 rgba(255,224,138,.8);}70%{box-shadow:0 0 0 8px rgba(255,224,138,0);}100%{box-shadow:0 0 0 0 rgba(255,224,138,0);}}

  .rfc-panel{
    position:absolute;left:0;bottom:70px;width:380px;max-width:calc(100vw - 48px);
    height:560px;max-height:78vh;background:var(--rfc-bg);border-radius:20px;
    box-shadow:0 20px 60px rgba(0,0,0,.28);display:none;flex-direction:column;overflow:hidden;
    animation:rfc-rise .25s ease;
  }
  @keyframes rfc-rise{from{opacity:0;transform:translateY(12px);}to{opacity:1;transform:translateY(0);}}
  .rfc-panel.rfc-open{display:flex;}

  .rfc-header{background:linear-gradient(135deg,var(--rfc-primary),var(--rfc-primary-dark));
    color:#fff;padding:16px 18px;display:flex;align-items:center;gap:12px;}
  .rfc-avatar{width:38px;height:38px;border-radius:50%;background:rgba(255,255,255,.25);
    background-size:cover;background-position:center top;flex-shrink:0;border:2px solid rgba(255,255,255,.6);}
  .rfc-head-text{flex:1;}
  .rfc-head-text .t{font-weight:700;font-size:15px;}
  .rfc-head-text .s{font-size:11px;opacity:.9;display:flex;align-items:center;gap:5px;}
  .rfc-head-text .s::before{content:"";width:7px;height:7px;border-radius:50%;background:#aef0b0;}
  .rfc-close{border:none;background:transparent;color:#fff;font-size:24px;cursor:pointer;line-height:1;}

  .rfc-progress{height:4px;background:rgba(255,255,255,.3);}
  .rfc-progress-bar{height:100%;background:#fff;width:0;transition:width .35s ease;}

  .rfc-body{flex:1;overflow-y:auto;padding:18px 16px;display:flex;flex-direction:column;gap:4px;
    background:#ffffff;}
  .rfc-body::-webkit-scrollbar{width:6px;}
  .rfc-body::-webkit-scrollbar-thumb{background:#cdd5ce;border-radius:3px;}

  .rfc-row{display:flex;margin-bottom:8px;align-items:flex-end;gap:8px;}
  .rfc-row.bot{justify-content:flex-start;}
  .rfc-row.user{justify-content:flex-end;}
  .rfc-mini-avatar{width:28px;height:28px;border-radius:50%;background:var(--rfc-primary);
    background-size:cover;background-position:center top;flex-shrink:0;border:1.5px solid #fff;
    box-shadow:0 1px 3px rgba(0,0,0,.12);}
  .rfc-msg{position:relative;max-width:80%;padding:12px 16px;font-size:14px;line-height:1.7;
    border-radius:18px;animation:rfc-fade .3s ease;}
  @keyframes rfc-fade{from{opacity:0;transform:translateY(6px);}to{opacity:1;transform:translateY(0);}}
  .rfc-row.bot .rfc-msg{background:#fff;border:1.5px solid #ffd600;
    border-bottom-left-radius:4px;color:var(--rfc-text);font-weight:500;
    box-shadow:0 3px 10px rgba(255,214,0,.25);}
  .rfc-row.bot .rfc-msg::before{content:"";position:absolute;left:-8px;bottom:6px;width:15px;height:15px;
    background:#fff;border-left:1.5px solid #ffd600;
    border-bottom:1.5px solid #ffd600;transform:rotate(45deg);border-bottom-left-radius:4px;}
  .rfc-row.user .rfc-msg{background:linear-gradient(135deg,var(--rfc-primary),var(--rfc-primary-dark));
    color:#fff;border-bottom-right-radius:4px;box-shadow:0 3px 10px rgba(21,101,192,.3);font-weight:600;}
  .rfc-row.user .rfc-msg::after{content:"";position:absolute;right:-6px;bottom:6px;width:14px;height:14px;
    background:var(--rfc-primary-dark);transform:rotate(45deg);border-bottom-right-radius:4px;}

  .rfc-choices{display:flex;flex-wrap:wrap;gap:8px;margin:2px 0 14px 36px;}
  .rfc-choice{border:1.5px solid var(--rfc-primary);background:#fff;color:var(--rfc-primary-dark);
    padding:9px 15px;border-radius:12px;font-size:13.5px;font-weight:600;cursor:pointer;
    transition:all .15s;
    touch-action:manipulation;
    -webkit-user-select:none;user-select:none;}
  .rfc-choice:hover:not(:disabled){background:var(--rfc-primary);color:#fff;transform:translateY(-1px);}
  .rfc-choice:disabled{opacity:.4;cursor:default;}
  .rfc-choice.selected{background:var(--rfc-primary);color:#fff;}

  .rfc-multi-done{border:none;background:var(--rfc-accent);color:#fff;padding:10px 18px;
    border-radius:12px;font-size:14px;font-weight:700;cursor:pointer;margin-top:4px;}
  .rfc-multi-done:hover{filter:brightness(1.05);}

  /* 見積もりサマリー（自動反映・編集不可） */
  .rfc-summary{margin:2px 0 12px 36px;background:#fff;border:1.5px solid var(--rfc-primary);
    border-radius:14px;padding:14px;max-width:90%;box-shadow:0 2px 8px rgba(232,118,42,.1);}
  .rfc-summary-head{font-size:11px;font-weight:700;color:var(--rfc-primary-dark);
    background:#fff9d6;display:inline-block;padding:3px 10px;border-radius:999px;margin-bottom:10px;}
  .rfc-summary-row{display:flex;justify-content:space-between;gap:10px;font-size:12.5px;
    padding:5px 0;border-bottom:1px dashed var(--rfc-border);}
  .rfc-summary-row:last-child{border-bottom:none;}
  .rfc-summary-row span{color:var(--rfc-muted);flex-shrink:0;}
  .rfc-summary-row b{text-align:right;color:var(--rfc-text);}
  .rfc-summary-row.total b{color:#d9480f;font-size:15px;}

  /* 連絡先フォーム */
  .rfc-form{margin:2px 0 14px 36px;display:flex;flex-direction:column;gap:10px;max-width:90%;}
  .rfc-field{display:flex;flex-direction:column;gap:4px;}
  .rfc-flabel{font-size:12px;font-weight:700;color:var(--rfc-text);}
  .rfc-finput{padding:10px 12px;border:1.5px solid var(--rfc-border);border-radius:10px;
    font-size:14px;width:100%;}
  .rfc-finput:focus{outline:none;border-color:var(--rfc-primary);}
  .rfc-turnstile-wrap{margin-top:2px;}
  .rfc-finput.invalid{border-color:#d9534f;background:#fff6f6;}
  .rfc-finput:disabled{background:#f3f3f3;color:#888;}
  .rfc-fnote{font-size:10.5px;color:var(--rfc-primary-dark);}

  .rfc-input-row{display:flex;gap:8px;margin:2px 0 14px 36px;align-items:center;flex-wrap:wrap;}
  .rfc-input-row input{flex:1;min-width:120px;padding:10px 13px;border:1.5px solid var(--rfc-border);
    border-radius:12px;font-size:14px;}
  .rfc-input-row input.invalid{border-color:#d9534f;background:#fff6f6;}
  .rfc-unit{font-size:13px;color:var(--rfc-muted);}

  .rfc-result{
    flex:1;min-width:0;
    margin:6px 0 14px 0;
    background:linear-gradient(135deg,#fff,#f3f8f3);
    border:2px solid var(--rfc-primary);border-radius:16px;padding:16px;
  }
  .rfc-result .label{font-size:12px;color:var(--rfc-muted);margin-bottom:2px;}
  .rfc-result .amount{
    display:flex;align-items:baseline;flex-wrap:nowrap;gap:2px;
    margin:2px 0 10px;
  }
  .rfc-result .amount .amount-num{
    font-size:32px;font-weight:800;color:var(--rfc-primary-dark);line-height:1;
  }
  .rfc-result .amount .amount-unit{
    font-size:16px;font-weight:700;color:var(--rfc-primary-dark);white-space:nowrap;
  }
  .rfc-result .breakdown{
    margin-top:10px;border-top:1px dashed var(--rfc-border);padding-top:10px;
  }
  .rfc-result .breakdown-head{
    font-size:11px;color:var(--rfc-muted);margin-bottom:6px;
  }
  .rfc-bi{padding:6px 0;border-bottom:1px dotted var(--rfc-border);}
  .rfc-bi:last-of-type{border-bottom:none;}
  .rfc-bi-top{
    display:flex;justify-content:space-between;align-items:baseline;gap:8px;
  }
  .rfc-bi-name{font-size:13px;color:var(--rfc-text);}
  .rfc-bi-price{font-size:13px;color:var(--rfc-primary-dark);white-space:nowrap;flex-shrink:0;}
  .rfc-bi-detail{font-size:11px;color:var(--rfc-muted);margin-top:2px;line-height:1.4;}
  .rfc-bi-meta{
    font-size:11px;color:var(--rfc-muted);
    margin-top:8px;padding-top:6px;border-top:1px dashed var(--rfc-border);
  }
  .rfc-result .note{font-size:11px;color:var(--rfc-muted);margin-top:8px;line-height:1.5;}
  /* キャンペーン */
  .rfc-campaign{
    background:linear-gradient(135deg,#fffde7,#fff9c4);border:1px solid #ffd600;
    border-radius:12px;padding:10px 12px;margin:8px 0;
  }
  .rfc-campaign-label{
    font-size:12px;color:var(--rfc-primary-dark);margin-bottom:5px;
  }
  .rfc-campaign-price{
    display:flex;align-items:center;flex-wrap:wrap;gap:6px;
  }
  .rfc-campaign .was{
    font-size:12px;color:var(--rfc-muted);text-decoration:line-through;white-space:nowrap;
  }
  .rfc-campaign .arrow{font-size:12px;color:var(--rfc-muted);}
  .rfc-campaign .now{
    font-size:17px;color:#d9480f;white-space:nowrap;
  }

  .rfc-footer{padding:8px 14px;text-align:center;font-size:10.5px;color:var(--rfc-muted);
    border-top:1px solid var(--rfc-border);background:#fff;}
  .rfc-backbar{margin:0 0 14px 36px;}
  .rfc-back{border:none;background:transparent;color:var(--rfc-muted);font-size:12.5px;
    cursor:pointer;padding:4px 2px;text-decoration:underline;text-underline-offset:2px;}
  .rfc-back:hover{color:var(--rfc-primary-dark);}

  /* CTAボタン */
  .rfc-cta-wrap{
    margin:30px 0 24px 36px;
    display:flex;flex-direction:column;
    gap:10px;max-width:90%;
    bottom:16.5%;
  }
  .rfc-cta-btn{
    display:flex;align-items:center;gap:12px;width:100%;
    background:linear-gradient(135deg,#2ecc71,#1a9e50);
    color:#fff;border:none;border-radius:16px;
    padding:16px 18px;cursor:pointer;text-align:left;
    box-shadow:0 6px 20px rgba(39,174,96,.42);
    transition:transform .18s,box-shadow .18s,filter .18s;
    animation:rfc-cta-glow 2.8s ease-in-out infinite;
  }
  .rfc-cta-btn:hover:not(:disabled){
    transform:translateY(-3px);
    box-shadow:0 12px 30px rgba(39,174,96,.58);
    filter:brightness(1.06);
  }
  .rfc-cta-btn:disabled{opacity:.5;cursor:default;animation:none;}
  @keyframes rfc-cta-glow{
    0%,100%{box-shadow:0 6px 20px rgba(39,174,96,.42);}
    50%     {box-shadow:0 6px 28px rgba(39,174,96,.68);}
  }
  .rfc-cta-badge{
    width:10px;height:10px;border-radius:50%;
    background:rgba(255,255,255,.9);flex-shrink:0;
    box-shadow:0 0 0 0 rgba(255,255,255,.7);
    animation:rfc-badge-pulse 2.8s ease-in-out infinite;
  }
  @keyframes rfc-badge-pulse{
    0%,100%{box-shadow:0 0 0 0 rgba(255,255,255,.7);}
    50%     {box-shadow:0 0 0 6px rgba(255,255,255,0);}
  }
  .rfc-cta-main{flex:1;font-size:15px;line-height:1.3;text-align:center;}
  .rfc-cta-arrow{
    font-size:20px;flex-shrink:0;
    transition:transform .18s;
  }
  .rfc-cta-btn:hover:not(:disabled) .rfc-cta-arrow{transform:translateX(4px);}
  .rfc-cta-retry{
    display:block;background:transparent;border:none;
    color:var(--rfc-muted);font-size:12px;
    text-align:center;cursor:pointer;padding:4px;
    text-decoration:underline;text-underline-offset:2px;
  }
  .rfc-cta-retry:hover{color:var(--rfc-text);}
  .rfc-cta-retry:disabled{opacity:.4;cursor:default;}

  /* 電話でのお問い合わせ */
  .rfc-tel-sep{
    text-align:center;font-size:12px;color:var(--rfc-muted);
    padding:6px 0 2px;
  }
  .rfc-tel-link-btn{
    width:100%;background:#fff;border:1.5px solid var(--rfc-border);
    border-radius:12px;padding:11px 16px;font-size:13.5px;
    color:var(--rfc-primary-dark);cursor:pointer;text-align:center;
    transition:background .15s,border-color .15s;
  }
  .rfc-tel-link-btn:hover{background:#fff4ee;border-color:var(--rfc-primary);}

  .rfc-tel-overlay{
    position:absolute;inset:0;background:rgba(0,0,0,.48);
    display:flex;align-items:center;justify-content:center;
    z-index:20;border-radius:20px;
  }
  .rfc-tel-card{
    background:#fff;border-radius:20px;
    padding:28px 24px 20px;text-align:center;
    width:88%;box-shadow:0 8px 32px rgba(0,0,0,.22);
  }
  .rfc-tel-card-label{
    font-size:13px;color:#888;margin:0 0 10px;font-weight:600 !important;
  }
  .rfc-tel-num{
    font-size:28px;font-weight:800 !important;color:#222;
    letter-spacing:.03em;margin-bottom:6px;
  }
  .rfc-tel-card-hours{
    font-size:12px;color:#888;margin:0 0 18px;font-weight:500 !important;
  }
  .rfc-tel-callbtn{
    display:flex;align-items:center;justify-content:center;gap:8px;
    width:100%;
    background:linear-gradient(135deg,var(--rfc-primary),var(--rfc-primary-dark));
    color:#fff;border:none;border-radius:999px;
    padding:15px 20px;font-size:16px;font-weight:800 !important;
    cursor:pointer;text-decoration:none;margin-bottom:14px;
    transition:filter .15s;
  }
  .rfc-tel-callbtn:hover{filter:brightness(1.07);}
  .rfc-tel-cancelbtn{
    display:block;width:100%;background:transparent;border:none;
    color:#888;font-size:14px;font-weight:600 !important;
    cursor:pointer;padding:6px;
  }
  .rfc-tel-cancelbtn:hover{color:#444;}

  @media(max-width:480px){
    #rfc-root{left:14px;bottom:2%;}
    .rfc-launcher .txt{display:none;}
  }
  #rfc-root *{font-weight:bold !important;}
