
*{margin:0;padding:0;box-sizing:border-box;}
:root{
  --gold:#B8860B;--gold2:#D4A017;--gold-light:#F5EDD0;--gold-pale:#FBF7EC;
  --ink:#6D1A2A;--ink2:#3D2018;--ink3:#7A5A50;--ink4:#A89080;
  --cream:#FAFAF5;--white:#FFFFFF;
  --panel-bg:#F7F3EA;
  --border:#E8E4D9;--border2:#D4CFC0;
  --serif:'Playfair Display',Georgia,serif;
  --sans:'Source Sans 3',-apple-system,'PingFang SC','Microsoft YaHei',sans-serif;
  --chat-safe-bottom:40px;
}
html,body{height:100%;background:var(--cream);color:#2A1810;font-family:var(--sans);font-size:15px;line-height:1.6;}

/*  LOGO IMAGE  */
.logo-img{
  display:block;
  object-fit:contain;
  filter:
    drop-shadow(1px 0 0 #B8860B)
    drop-shadow(-1px 0 0 #B8860B)
    drop-shadow(0 1px 0 #B8860B)
    drop-shadow(0 -1px 0 #B8860B);
}

/*  APP  */
#app{display:flex;height:100vh;min-height:100vh;flex-direction:row;}

/* Sidebar */
.sidebar{
  width:260px;
  height:100vh;
  flex-shrink:0;
  background:var(--ink);
  display:flex;
  flex-direction:column;
  border-right:1px solid rgba(255,255,255,.06);
  transition:width .22s ease, border-color .22s ease;
  overflow:hidden;
}
#app.sidebar-collapsed .sidebar{
  width:0;
  border-right-color:transparent;
}
.desktop-sidebar-toggle{display:flex!important;}
.desktop-sidebar-toggle.is-open .icon-menu{display:none;}
.desktop-sidebar-toggle.is-open .icon-close{display:block;}
.sb-brand{padding:18px 16px;border-bottom:1px solid rgba(255,255,255,.06);display:flex;align-items:center;gap:10px;}
.sb-newchat-wrap{padding:14px 12px 10px;}
.sb-newchat{
  width:100%;
  display:flex;
  align-items:center;
  gap:10px;
  justify-content:flex-start;
  padding:8px 4px 10px;
  border:none;
  border-radius:0;
  background:transparent;
  color:rgba(255,255,255,.94);
  font-size:15.5px;
  font-weight:800;
  letter-spacing:.2px;
  font-family:var(--sans);
  cursor:pointer;
  box-shadow:none;
  transition:opacity .15s, transform .15s;
}
.sb-newchat:hover{
  opacity:1;
}
.sb-newchat:active{transform:translateY(1px);}
.sb-newchat svg{
  width:18px;
  height:18px;
  flex-shrink:0;
}
.sb-name{font-size:13.5px;font-weight:600;color:var(--white);}

.sb-section{padding:14px 16px 6px;font-size:10px;letter-spacing:.8px;color:rgba(255,255,255,.68);text-transform:uppercase;}
.sb-section-row{display:flex;align-items:center;justify-content:space-between;padding:14px 16px 6px;}
.sb-clear{
  font-size:10px;
  color:rgba(255,255,255,.72);
  cursor:pointer;
  padding:2px 0;
  transition:color .15s;
}
.sb-clear:hover{color:rgba(255,255,255,.96);}
.sb-history{flex:1;min-height:0;overflow-y:auto;padding:0 8px;}
.sb-history{overscroll-behavior:contain;}
.sb-history::-webkit-scrollbar{width:3px;}
.sb-history::-webkit-scrollbar-thumb{background:rgba(255,255,255,.1);}
.sb-item{padding:9px 12px;border-radius:4px;cursor:pointer;font-size:12.5px;color:rgba(255,255,255,.78);transition:all .15s;margin-bottom:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sb-item:hover{background:rgba(255,255,255,.04);color:rgba(255,255,255,.98);}
.sb-item-text{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sb-empty{padding:10px 14px;font-size:12px;color:rgba(255,255,255,.14);}
.sb-item-meta{
  margin-top:4px;
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.sb-item-status{
  display:inline-flex;
  align-items:center;
  gap:4px;
  padding:1px 7px;
  border-radius:999px;
  font-size:10px;
  line-height:1.5;
  border:1px solid transparent;
}
.sb-item-status.completed{
  color:rgba(255,255,255,.52);
  background:rgba(255,255,255,.05);
  border-color:rgba(255,255,255,.07);
}
.sb-item-status.failed{
  color:#F1C0C0;
  background:rgba(143,45,45,.22);
  border-color:rgba(226,119,119,.22);
}
.sb-item-status.pending{
  color:#F4E4B2;
  background:rgba(184,134,11,.14);
  border-color:rgba(212,160,23,.22);
}
.sb-user{
  padding:12px 14px;
  border-top:1px solid rgba(255,255,255,.06);
  display:flex;
  align-items:center;
  gap:8px;
  margin-top:auto;
  background:var(--ink);
  position:sticky;
  bottom:0;
}
.sb-av{width:26px;height:26px;border-radius:50%;overflow:hidden;background:rgba(255,255,255,.08);display:flex;align-items:center;justify-content:center;font-size:11px;color:rgba(255,255,255,.4);flex-shrink:0;}
.sb-av img{width:100%;height:100%;object-fit:cover;}
.sb-uname{font-size:12.5px;color:rgba(255,255,255,.65);font-weight:500;flex:1;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
.sb-logout{font-size:11px;color:rgba(255,255,255,.22);cursor:pointer;padding:2px 6px;border-radius:3px;transition:all .15s;flex-shrink:0;}
.sb-logout:hover{color:rgba(255,255,255,.55);}
.sb-user.is-guest{justify-content:stretch;}
.sb-user.is-guest .sb-av{display:none;}
.sb-user.is-guest .sb-uname{display:none;}
.sb-login-btn{
  margin-left:0;
  width:100%;
  min-height:42px;
  padding:0 16px;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
  border-radius:14px;
  background:#FFFFFF;
  color:#1F1F1F;
  border:1px solid rgba(255,255,255,.22);
  font-size:13px;
  font-weight:700;
  letter-spacing:.01em;
  box-shadow:0 8px 20px rgba(0,0,0,.18), inset 0 1px 0 rgba(255,255,255,.85);
  transition:transform .15s ease, box-shadow .15s ease, border-color .15s ease, background .15s ease;
}
.sb-login-btn::before{
  content:"";
  width:18px;
  height:18px;
  flex-shrink:0;
  background-repeat:no-repeat;
  background-position:center;
  background-size:contain;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath fill='%23EA4335' d='M9 7.364v3.491h4.85c-.213 1.123-.853 2.074-1.812 2.712l2.93 2.274C16.676 14.265 17.7 11.945 17.7 9c0-.586-.053-1.15-.15-1.636H9z'/%3E%3Cpath fill='%2334A853' d='M9 18c2.43 0 4.47-.804 5.96-2.159l-2.93-2.274c-.812.545-1.852.867-3.03.867-2.33 0-4.304-1.573-5.01-3.688H.96v2.347A8.998 8.998 0 0 0 9 18z'/%3E%3Cpath fill='%234285F4' d='M3.99 10.746A5.41 5.41 0 0 1 3.71 9c0-.607.104-1.196.28-1.746V4.907H.96A8.998 8.998 0 0 0 0 9c0 1.452.347 2.827.96 4.093l3.03-2.347z'/%3E%3Cpath fill='%23FBBC05' d='M9 3.568c1.322 0 2.507.454 3.44 1.345l2.58-2.58C13.467.89 11.43 0 9 0 .96 0 0 4.907v2.347l3.03 2.347C4.696 5.14 6.67 3.568 9 3.568z'/%3E%3C/svg%3E");
}
.sb-login-btn:hover{
  color:#111111;
  background:#FFFFFF;
  border-color:rgba(255,255,255,.4);
  box-shadow:0 10px 24px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.92);
  transform:translateY(-1px);
}

/* Main area */
.main{flex:1;display:flex;flex-direction:column;min-width:0;height:100vh;overflow:hidden;background:var(--panel-bg);}
.topbar{
  height:62px;
  padding:0 24px;
  background:var(--panel-bg);
  border-bottom:1px solid rgba(42,24,16,.06);
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-shrink:0;
}
.topbar-left{display:flex;align-items:center;gap:12px;}
.topbar-title{font-family:var(--serif);font-size:17px;font-weight:500;color:#2A1810;letter-spacing:.2px;}
.topbar-right{display:flex;align-items:center;gap:10px;min-height:24px;}
.module-hint-bar{
  padding:8px 28px;
  background:#FCEAE7;
  border-bottom:1px solid #EDB8B0;
  font-size:12px;
  color:#8B2E23;
  line-height:1.7;
  flex-shrink:0;
}
.module-hint-bar.hidden{display:none;}
@keyframes blink{0%,100%{opacity:1;}50%{opacity:.3;}}
.chat{
  flex:1;
  overflow-y:auto;
  padding:34px 28px 16px;
  background:var(--panel-bg);
}
.main.is-idle .chat{
  flex:0 1 auto;
  overflow:visible;
  padding:clamp(36px, 12vh, 108px) 28px 10px;
  margin-top:auto;
}
.main:not(.is-idle) .hero-card{
  display:none;
}
.main.is-idle .msg-group,
.main.is-idle .chat-end-spacer{
  display:none;
}
.chat::-webkit-scrollbar{width:4px;}
.chat::-webkit-scrollbar-thumb{background:var(--border2);border-radius:2px;}

/* Welcome */
.hero-card{
  max-width:720px;
  margin:0 auto 24px;
  padding:0;
  border-radius:0;
  background:transparent;
  border:none;
  box-shadow:none;
}
.welcome{max-width:640px;margin:0 auto;text-align:center;padding:0;}
.welcome h2{
  font-family:var(--sans);
  font-size:34px;
  font-weight:600;
  line-height:1.18;
  margin-bottom:8px;
  color:#181818;
  letter-spacing:-.02em;
  display:flex;
  align-items:center;
  justify-content:center;
  gap:10px;
}
.welcome-title-logo{
  width:36px;
  height:36px;
  flex-shrink:0;
}
.welcome-sub{max-width:420px;margin:0 auto;font-size:13px;color:#8D877D;line-height:1.7;}
.welcome .desc{font-size:14px;color:#7A5A50;line-height:1.8;margin-bottom:24px;}
.coverage{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px;text-align:left;}
.cov-item{padding:12px 14px;background:var(--white);border:1px solid var(--border);border-radius:4px;}
.cov-label{font-size:11px;color:#A89080;letter-spacing:.4px;text-transform:uppercase;margin-bottom:3px;}
.cov-val{font-size:13px;color:#3D2018;font-weight:500;}

/* Province picker */
.province-picker{
  max-width:560px;
  margin:20px auto 0;
  text-align:center;
  padding-top:0;
  border-top:none;
}
.province-label{
  font-size:12px;
  color:#7F776D;
  margin-bottom:12px;
  letter-spacing:0;
  text-transform:none;
}
.prov-switch{
  display:inline-flex;
  align-items:center;
  gap:12px;
  padding:0;
  background:transparent;
  border:none;
  border-radius:0;
  box-shadow:none;
}

/* Messages */
.msg-group{display:flex;flex-direction:column;gap:18px;max-width:800px;margin:0 auto;}
.chat-end-spacer{height:var(--chat-safe-bottom, 96px);flex-shrink:0;}
.row{display:flex;gap:12px;align-items:flex-start;}
.row.user{flex-direction:row;justify-content:flex-end;}
.row.bot,.row.user,.typing-row{gap:0;}
.av{width:30px;height:30px;flex-shrink:0;margin-top:2px;}
.av-user{border-radius:50%;overflow:hidden;background:var(--border);display:flex;align-items:center;justify-content:center;font-size:11px;color:#7A5A50;}
.row.user .av-user{display:none;}
.av-user img{width:100%;height:100%;object-fit:cover;}
.bubble{max-width:72%;animation:emerge .2s ease-out;}
@keyframes emerge{from{opacity:0;transform:translateY(5px);}to{opacity:1;transform:translateY(0);}}
.bubble.bot{
  max-width:100%;
  background:transparent;
  border:none;
  border-radius:0;
  padding:0 0 0 2px;
  color:#1F1F1F;
  font-size:14px;
  line-height:1.74;
  box-shadow:none;
}
.bubble.user{
  width:fit-content;
  max-width:72%;
  background:#F4F4F4;
  border:none;
  border-radius:18px;
  padding:12px 16px;
  margin-left:auto;
  color:#0D0D0D;
  font-size:14px;
  line-height:1.72;
  box-shadow:inset 0 0 0 1px rgba(13,13,13,.04);
  text-align:left;
}
.ts{display:none;}
.status-note{display:block;font-size:12px;color:#8D877D;margin-top:10px;text-align:left;}
.bubble.bot b,.bubble.bot strong{font-weight:600;color:#111111;}
.bubble.bot em{font-style:italic;}
.bubble.bot code{background:#F4F4F4;padding:1px 5px;border-radius:5px;font-size:.88em;color:#1F1F1F;}
.bubble.bot hr{border:none;border-top:1px solid rgba(0,0,0,.08);margin:14px 0;}
.bubble.bot ul,.bubble.bot ol{padding-left:20px;margin:8px 0;}
.bubble.bot li{margin:4px 0;}
.bubble.bot .hl{font-family:var(--sans);font-size:15px;color:#111111;font-weight:600;margin:14px 0 6px;display:block;}
.bubble.bot a{color:#2563EB;text-decoration:underline;}
.bubble.bot table{border-collapse:collapse;width:100%;font-size:13px;margin:8px 0;}
.bubble.bot th{background:#F5F5F5;color:#1F1F1F;padding:7px 11px;font-size:12px;text-align:left;}
.bubble.bot td{padding:6px 11px;border-bottom:1px solid rgba(0,0,0,.08);color:#303030;}
.disclaimer-block{margin-top:14px;padding:12px 14px;background:#F7F7F7;border-left:2px solid rgba(0,0,0,.16);font-size:12.5px;color:#303030;line-height:1.7;border-radius:0 10px 10px 0;}
.bot-actions{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:12px;
}
.copy-btn{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:0;
  border:none;
  background:transparent;
  color:#7F776D;
  font-size:12px;
  font-family:var(--sans);
  cursor:pointer;
  transition:color .15s, opacity .15s;
  opacity:.92;
}
.copy-btn:hover{color:#303030;}
.copy-btn svg{
  width:14px;
  height:14px;
  display:block;
}
.copy-btn.copied{color:#8B6811;}

/* Clickable phone links inside bot bubble */
/* Typing */
.typing-row{display:flex;gap:0;align-items:flex-start;}
.typing-bubble{background:transparent;border:none;border-radius:0;padding:2px 0;display:flex;gap:5px;align-items:center;}
.typing-bubble span{width:6px;height:6px;border-radius:50%;background:var(--gold);opacity:.4;animation:tp 1.4s infinite ease-in-out;}
.typing-bubble span:nth-child(2){animation-delay:-.16s;}
.typing-bubble span:nth-child(3){animation-delay:0s;}
@keyframes tp{0%,80%,100%{transform:scale(.7);opacity:.3;}40%{transform:scale(1);opacity:1;}}

.analysis-status{
  display:inline-flex;
  align-items:center;
  gap:6px;
  color:#7F776D;
  font-size:12.5px;
  line-height:1.6;
  padding:2px 0;
  animation:thinking-pulse 1.15s ease-in-out infinite;
}
.analysis-status-dots{display:inline-flex;gap:3px;}
.analysis-status-dots span{
  width:4px;
  height:4px;
  border-radius:50%;
  background:currentColor;
  opacity:.28;
  animation:thinking-dot 1.1s ease-in-out infinite;
}
.analysis-status-dots span:nth-child(2){animation-delay:.14s;}
.analysis-status-dots span:nth-child(3){animation-delay:.28s;}
@keyframes thinking-pulse{
  0%,100%{opacity:.48;}
  50%{opacity:1;}
}
@keyframes thinking-dot{
  0%,80%,100%{opacity:.22;transform:translateY(0);}
  40%{opacity:.92;transform:translateY(-1px);}
}

/* Input  Claude-style growing textarea */
.input-wrap{
  max-width:800px;
  margin:0 auto;
  padding:14px 28px 20px;
  background:var(--panel-bg);
  flex-shrink:0;
  width:100%;
}
.main.is-idle .input-wrap{
  margin:18px auto auto;
  padding:0 28px 28px;
  background:transparent;
}
.input-inner{
  display:flex;
  gap:10px;
  align-items:flex-end;
  width:100%;
  max-width:800px;
  margin:0 auto;
  background:#FFFFFF;
  border:1px solid rgba(0,0,0,.12);
  border-radius:18px;
  padding:12px 12px 12px 16px;
  transition:border-color .15s, box-shadow .15s, background .15s;
  box-shadow:0 1px 2px rgba(0,0,0,.06);
}
.input-legal{
  max-width:800px;
  margin:8px auto 0;
  font-size:10.5px;
  line-height:1.55;
  color:#989188;
  text-align:center;
}
.input-legal a{
  color:inherit;
  text-decoration:none;
  border-bottom:1px solid rgba(122,90,80,.28);
}
.input-legal a:hover{border-bottom-color:rgba(122,90,80,.55);}
.input-inner:focus-within{
  border-color:rgba(0,0,0,.18);
  background:var(--white);
  box-shadow:0 0 0 4px rgba(0,0,0,.04);
}
.input-wrap.limit-reached .input-inner{
  background:#F6F1E6;
  border-color:#D9C9A8;
  box-shadow:none;
}
.input-wrap.is-locked .input-inner{
  background:#F6F1E6;
  border-color:#D8CCBE;
  box-shadow:none;
}
.input-wrap.is-locked #inp{
  color:#A89080;
  cursor:not-allowed;
}
.input-wrap.is-locked #send{
  opacity:.45;
  cursor:not-allowed;
}
.input-limit-note{
  max-width:800px;
  margin:10px auto 0;
  padding:0 4px;
  font-size:12px;
  line-height:1.7;
  color:var(--ink4);
  text-align:left;
}
.input-limit-note.hidden{display:none;}
#inp{
  flex:1;
  padding:0;
  background:transparent;
  border:none;
  color:var(--ink2);
  font-size:16px; /* 16px prevents iOS auto-zoom */
  font-family:var(--sans);
  outline:none;
  resize:none;
  line-height:1.6;
  min-height:26px;
  max-height:200px;
  overflow-y:auto;
  -webkit-overflow-scrolling:touch;
}
#inp::placeholder{color:#A89080;}
.input-wrap.limit-reached #inp{
  color:#9B8B7A;
}
#send{
  width:40px;height:40px;flex-shrink:0;
  background:#111111;border:none;cursor:pointer;
  border-radius:12px;color:#FFFFFF;
  display:flex;align-items:center;justify-content:center;
  transition:all .15s;
  align-self:flex-end;
  margin-bottom:1px;
  box-shadow:none;
}
#send:hover{background:#000000;color:#FFFFFF;}
#send:disabled{background:var(--border);color:#A89080;cursor:not-allowed;}
.limit-card{
  margin-top:14px;
  padding:16px 18px;
  border-radius:16px;
  background:#FFFFFF;
  border:1px solid rgba(0,0,0,.08);
  box-shadow:none;
}
.limit-card-kicker{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:4px 10px;
  border-radius:999px;
  background:#F4F4F4;
  border:1px solid rgba(0,0,0,.06);
  font-size:10.5px;
  letter-spacing:.04em;
  color:#6F6A61;
  margin-bottom:10px;
  text-transform:uppercase;
}
.limit-card-title{
  font-family:var(--serif);
  font-size:18px;
  color:var(--ink2);
  margin-bottom:6px;
}
.limit-card-desc{
  font-size:13.5px;
  line-height:1.7;
  color:var(--ink3);
}
.limit-card-note{
  margin-top:10px;
  font-size:12px;
  color:#7F776D;
  line-height:1.7;
}
.limit-card-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin-top:14px;
}
.limit-card-primary{
  border:none;
  border-radius:12px;
  background:var(--ink);
  color:var(--gold-light);
  padding:11px 16px;
  font-size:13px;
  font-weight:600;
  cursor:pointer;
  font-family:var(--sans);
}
.limit-card-primary:hover{background:var(--ink2);}
.limit-card-link{
  display:inline-flex;
  align-items:center;
  color:var(--ink4);
  text-decoration:none;
  border-bottom:1px solid rgba(0,0,0,.12);
  font-size:12px;
  padding:4px 0;
}
.limit-card-link:hover{border-bottom-color:rgba(0,0,0,.22);}
/* WeChat overlay */
.wechat-overlay{display:none;position:fixed;inset:0;z-index:9999;background:rgba(0,0,0,.88);flex-direction:column;align-items:center;justify-content:center;padding:32px;}
.wechat-overlay.show{display:flex;}
.wechat-top-bar{position:fixed;top:0;left:0;right:0;background:var(--gold);padding:11px 16px;display:flex;align-items:center;justify-content:space-between;z-index:10000;}
.wechat-top-bar span{font-size:13.5px;color:#fff;font-weight:600;}
.wechat-top-bar .arr{font-size:20px;color:#fff;animation:arr .7s infinite alternate;}
@keyframes arr{from{transform:translateX(0);}to{transform:translateX(5px);}}
.wechat-box{background:var(--white);border-radius:14px;padding:28px 22px;max-width:300px;width:100%;text-align:center;margin-top:52px;}
.wechat-box h3{font-size:17px;font-weight:600;color:var(--ink);margin:14px 0 8px;}
.wechat-box p{font-size:13.5px;color:#7A5A50;line-height:1.7;margin-bottom:18px;}
.wechat-steps{background:var(--gold-pale);border:1px solid #D4A017;border-radius:8px;padding:14px 16px;text-align:left;}
.wechat-step{display:flex;align-items:center;gap:10px;margin-bottom:8px;}
.wechat-step:last-child{margin-bottom:0;}
.step-num{width:20px;height:20px;border-radius:50%;background:var(--gold);color:#fff;font-size:11px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0;}
.wechat-step span{font-size:13px;color:#3D1608;}
.wechat-url{margin-top:14px;font-size:12px;color:#A89080;}
.wechat-url b{color:var(--gold);}

/* Mobile sidebar overlay */
.sb-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:40;}
.mobile-menu-btn{
  display:none;
  width:36px;
  height:36px;
  align-items:center;
  justify-content:center;
  border:none;
  border-radius:10px;
  background:var(--white);
  box-shadow:0 1px 2px rgba(42,24,16,.08), 0 0 0 1px rgba(212,207,192,.9);
  cursor:pointer;
  padding:0;
  color:var(--ink2);
  transition:background .15s, box-shadow .15s, transform .15s;
}
.mobile-menu-btn:hover{
  background:var(--gold-pale);
  box-shadow:0 1px 2px rgba(42,24,16,.08), 0 0 0 1px rgba(184,134,11,.3);
}
.mobile-menu-btn:active{transform:scale(.97);}
.mobile-menu-btn svg{display:block;}
.mobile-menu-btn .icon-close{display:none;}
.mobile-menu-btn.is-open .icon-menu{display:none;}
.mobile-menu-btn.is-open .icon-close{display:block;}

/*  RESPONSIVE  */
@media(max-width:768px){
  /* App layout */
  html,body{height:100%;overflow:hidden;}
  #app{
    position:fixed;
    inset:0;
    height:100vh;
    height:-webkit-fill-available;
    min-height:100%;
  }
  .sidebar{
    position:fixed;
    left:-260px;
    top:0;
    bottom:0;
    height:100dvh;
    max-height:100dvh;
    z-index:50;
    transition:left .25s ease;
    box-shadow:4px 0 20px rgba(0,0,0,.3);
  }
  .sidebar.open{left:0;}
  .sb-overlay{display:block;}
  .sb-overlay.hidden{display:none;}
  .mobile-menu-btn{display:flex;}
  #app.sidebar-collapsed .sidebar{
    width:260px;
    border-right:1px solid rgba(255,255,255,.06);
  }
  .main{
    width:100%;
    display:flex;
    flex-direction:column;
    height:100%;
    min-height:0;
    overflow:hidden;
  }
  .topbar{
    padding:0 12px;
    height:58px;
    background:rgba(255,255,255,.94);
  }
  .topbar-left{gap:10px;}
  .topbar-title{font-size:15px;}
  .topbar-right{gap:8px;}
  .chat{flex:1;min-height:0;overflow-y:auto;-webkit-overflow-scrolling:touch;padding:16px 14px 10px;}
  .main.is-idle .chat{
    flex:0 1 auto;
    overflow:visible;
    padding:24px 14px 10px;
  }
  .hero-card{
    margin:2px auto 18px;
    padding:0;
    border-radius:0;
  }
  .welcome{padding-top:0;}
  .welcome h2{font-size:28px;margin-bottom:6px;}
  .welcome-sub{font-size:12.5px;line-height:1.7;}
  .province-picker{margin-top:18px;padding-top:0;}
  .province-label{font-size:11px;margin-bottom:10px;}
  .prov-switch{gap:10px;padding:0;}
  .bubble{max-width:88%;}
  .bubble.bot,.bubble.user{font-size:13.5px;}
  .bubble.bot{padding:0 0 0 2px;}
  .bubble.user{
    width:fit-content;
    max-width:88%;
    padding:11px 14px;
    border-radius:16px;
  }
  .coverage{grid-template-columns:repeat(2,1fr);}
  /* iOS: fix sticky input above keyboard */
  .input-wrap{
    padding:12px 12px;
    padding-bottom:max(12px,env(safe-area-inset-bottom));
    flex-shrink:0;
    position:static;
    background:linear-gradient(180deg, rgba(247,243,234,0) 0%, rgba(247,243,234,.9) 22%, rgba(247,243,234,1) 100%);
    z-index:10;
  }
  .main.is-idle .input-wrap{
    margin:14px auto auto;
    padding:0 12px max(14px, env(safe-area-inset-bottom));
    background:transparent;
  }
  .input-inner{
    border-radius:16px;
    padding:10px 10px 10px 14px;
    box-shadow:0 1px 2px rgba(0,0,0,.06);
  }
  #inp{
    font-size:16px; /* critical: prevents iOS zoom on focus */
    min-height:24px;
    max-height:160px;
  }
  #send{width:38px;height:38px;border-radius:11px;}
  .input-legal{margin-top:8px;font-size:10px;line-height:1.5;}
  .prov-btn{min-width:92px;padding:10px 16px;font-size:13px;}
}

/* iOS: true fix for keyboard push */
@supports(-webkit-touch-callout:none){
  #app{height:-webkit-fill-available;}
}

.opt-btns{display:flex;flex-wrap:wrap;gap:7px;margin-top:10px;}
.opt-btn{padding:6px 14px;border-radius:100px;border:1.5px solid var(--border2);background:var(--white);color:var(--ink2,#3D2018);font-size:12.5px;cursor:pointer;transition:all .15s;font-family:var(--sans);}
.opt-btn:hover,.opt-btn.sel{background:var(--ink);color:#fff;border-color:var(--ink);}

.bubble.bot ol{padding-left:20px;margin:6px 0;list-style-type:decimal;}
.bubble.bot ol li{margin-bottom:3px;}

/* Province selector buttons */
.prov-btn{
  min-width:110px;
  padding:11px 20px;
  border-radius:999px;
  border:1.5px solid rgba(212,207,192,.95);
  background:transparent;
  color:#6B6760;
  font-size:14px;
  font-weight:600;
  cursor:pointer;
  transition:all .15s;
  display:inline-flex;
  align-items:center;
  justify-content:center;
}
.prov-btn:hover{
  border-color:rgba(184,134,11,.35);
  color:var(--ink2);
  background:rgba(255,249,229,.52);
}
.prov-btn.active{background:linear-gradient(180deg, #7A1F31 0%, #641929 100%);color:#fff;border-color:#6D1A2A;font-weight:700;box-shadow:0 10px 18px rgba(109,26,42,.18);}
.prov-tag{font-size:11.5px;padding:4px 10px;border-radius:100px;font-weight:500;background:#FBF7EC;color:#7C5C0A;border:1px solid #D4A017;}
.sb-item.active{background:rgba(255,255,255,.08);color:rgba(255,255,255,.98);}
.sb-item-preview{
  margin-top:4px;
  font-size:11px;
  color:rgba(255,255,255,.42);
  line-height:1.45;
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  white-space:normal;
}
.sb-item-date{font-size:10px;color:rgba(255,255,255,.2);margin-top:2px;}

